text stringlengths 6.04k 39.5k |
|---|
# coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.core.handlers.wsgi import WSGIRequest
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.test.client import FakePayload
from itertools import chain
import inspect
import six
import warnings
... |
# coding=utf-8
# pynput
# Copyright (C) 2015-2019 <NAME>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# Th... |
import copy
import inspect
import logging
from collections import defaultdict
from autogluon.core.metrics import mean_squared_error
from autogluon.core.constants import AG_ARGS, AG_ARGS_FIT, AG_ARGS_ENSEMBLE, BINARY, MULTICLASS, REGRESSION, SOFTCLASS, QUANTILE
from autogluon.core.models import AbstractModel, GreedyWei... |
# ブラックジャック
import numpy as np
# これで割り算を無し
# np.seterr(divide='ignore', invalid='ignore')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import sys
def card_range_correcter(card): # 引いたカードはここ通す
if card > 10: # 絵札排除
card = 10
if card == 1: # とりあえずAceは11で計算
card = 11... |
import sys
import re
import bisect
import sqlite3
import argparse
import platform
import importlib
import multiprocessing
import os
import zlib
import time
import tempfile
import subprocess
from array import array
from struct import unpack
from urllib.request import pathname2url
import pysam
from datet... |
# The MIT License (MIT)
#
# Copyright (c) 2018 <NAME> for Adafruit Industries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... |
import os
import logging
import json
import collections
import yaml
import pandas as pd
import graphviz as gv
# import numpy as np
# from matplotlib import pyplot as plt
from kinemparse import assembly as lib_asm
from mathtools import utils
from seqtools import fstutils_openfst as fstutils
import pywrapfst as libfst
... |
import copy
import sys
import itertools
from typing import List, Optional
from pyvex.expr import IRExpr
from pyvex.stmt import IRStmt
from . import VEXObject
from . import expr, stmt
from .const import get_type_size
from .stmt import WrTmp, LoadG, LLSC, Dirty, CAS, get_enum_from_int, get_int_from_enum, Exit, IMark
fr... |
## @package model_helper
# Module caffe2.python.model_helper
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, scope, workspace, helpers
from caffe2.python.modeling import parameter_info
f... |
import argparse
import json
import numpy as np
import os
import random
import torch
from typing import Any, Dict, Tuple
from collections import Counter, defaultdict
from torch.utils.data import DataLoader
from tqdm import tqdm, trange
from transformers import AdamW, GPT2Tokenizer, GPT2LMHeadModel
from tokenizers impor... |
# Python Tools for Visual Studio
# Copyright(c) Microsoft Corporation
# All rights reserved.
from __future__ import with_statement
__author__ = "<NAME> <<EMAIL>>"
__version__ = "3.0.0.0"
# This module MUST NOT import threading in global scope. This is because in a direct (non-ptvsd)
# attach scenario, it is loade... |
"""
Circadian Lighting Component for Home-Assistant.
This component calculates color temperature and brightness to synchronize
your color changing lights with perceived color temperature of the sky throughout
the day. This gives your environment a more natural feel, with cooler whites during
the midday and warmer tint... |
# Copyright (c) 2019 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: <NAME> <<EMAIL>>
from __future__ import annotations
import copy
import typing
import asyncio
import logging
import dataclasses
import pyuavcan.transport
from pyuavcan.transport import Timestamp
from .med... |
"""
Data sets downloaded from pNEUMA – open-traffic.epfl.ch are read and converted to pandas dataframes to use in
subsequent coding.
Input: path to csv-file
Output: - List of dataframes, pickled to internal package folder 'data' (created on initialization of package)
- HDF5 database, hierarchical structure wit... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import argparse
import json
import sys
from tqdm import tqdm
import logging
import torch
import numpy as np
from colorama... |
# ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: blueprint.py
#
# Tests: blueprint hdf5 files
#
# Programmer: <NAME>
# Date: Thu Jun 16 10:56:37 PDT 2016
#
# Modifications:
#
# <NAME>, Fri Jul 17 16:29:50 PDT 2020
# Added a test t... |
from collections import OrderedDict
from typing import Any
from typing import Callable
from typing import Dict
from typing import Optional
from typing import Sequence
from typing import Union
import warnings
import numpy
from optuna import logging
from optuna._experimental import experimental
from optuna._imports imp... |
# Copyright 2020 LINE Corporation
#
# LINE Corporation licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
import os
import logging
from collections import OrderedDict
from ast import literal_eval
import six
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from scipy import sparse
import progressbar
from scipy import spatial
import parse
from ..events import indices
from ..events.predi... |
"""
Tag reads by haplotype
Sequencing reads are read from file ALIGNMENTS (in BAM format) and tagged reads
are written to stdout.
"""
import logging
import os
import sys
import pysam
import hashlib
from collections import defaultdict
from typing import List, Optional
from xopen import xopen
from contextlib import Ex... |
#
#
# 0=================================0
# | Kernel Point Convolutions |
# 0=================================0
#
#
# ----------------------------------------------------------------------------------------------------------------------
#
# Functions handling the disposition of kernel points.
... |
#!/usr/bin/python3
import json
from copy import deepcopy
from hashlib import sha1
from pathlib import Path
from typing import Dict, Optional
from eth_utils import remove_0x_prefix
from semantic_version import Version
from brownie._config import _get_data_folder
from brownie.exceptions import UnsupportedLanguage
from... |
"""Support for Xiaomi WiFi speakers."""
import logging
import requests
import hashlib
import hmac
import time
import json
import voluptuous as vol
from datetime import timedelta
from functools import partial
from urllib.parse import urlencode, urlparse, parse_qsl
from homeassistant.const import * # noqa: F401
from ho... |
# ---license-start
# eu-digital-green-certificates / dgc-testdata
# ---
# Copyright (C) 2021 Qryptal Pte Ltd
# Copyright (C) 2021 T-Systems International GmbH and all other contributors
# ---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
import os
import re
import json
import time
import datetime
import dateutil.tz
import dateutil.parser
import pytz
import requests
import logging
import parser
import base64
from collections import defaultdict
try:
import StringIO
... |
#-------------Boilerplate Code Start-----
import socket
from tkinter import *
from threading import Thread
import random
from PIL import ImageTk, Image
screen_width = None
screen_height = None
SERVER = None
PORT = None
IP_ADDRESS = None
playerName = None
canvas1 = None
canvas2 = None
nameEntry = None
nameWindow = ... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import random
from logging import getLogger
import cv2
from PIL import ImageFilter, Image
import numpy as np
import torch... |
from __future__ import annotations
import logging
from dataclasses import dataclass
from threading import Event, Lock, Thread
from typing import Dict, Iterator, Optional
import numpy as np
import torch
from pydantic import BaseModel, StrictBool, StrictFloat, confloat, conint
from hivemind.averaging.training import T... |
import errno
import os
import re
import shlex
import shutil
import subprocess
import sys
import textwrap
from distutils import log, ccompiler, sysconfig
from distutils.core import Extension
from distutils.ccompiler import get_default_compiler
from importlib import invalidate_caches
from setuptools.command.build_ext im... |
# -*- coding: utf-8 -*-
"""File containing a Windows Registry plugin to parse the AMCache.hve file."""
import pyregf
from dfdatetime import filetime as dfdatetime_filetime
from dfdatetime import posix_time as dfdatetime_posix_time
from dfwinreg import definitions as dfwinreg_definitions
from plaso.containers import... |
# Copyright 2015 VMware.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
import random
import pickle
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import os
from event_dataset import EventReader, Parser
from word_models import EventExtractor
from bert_embedding_extractor import BertFeatureExtractor
def train(model, train_batches, dev_batc... |
#!/usr/bin/env python
# -*- coding: utf-8; buffer-read-only: t -*-
__author__ = "<NAME>"
__contact__ = "gambrosio[at]uma.es"
__copyright__ = "Copyright 2021, <NAME>"
__date__ = "2021/07/27"
__license__ = "MIT"
import numpy as np
import pandas as pd
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt... |
# Copyright (C) 2016 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
#!/usr/bin/env python3
# trex2champ is a tool which allows to read output files of quantum
# chemistry codes (GAMESS and trexio files) and write input files for
# CHAMP in V2.0 format.
#
# Copyright (c) 2021, TREX Center of Excellence
# All rights reserved.
#
# Redistribution and use in source and binary forms, w... |
import argparse
import time
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import dgl
import dgl.nn.pytorch as dglnn
import numpy as np
import numpy.linalg as LA
import collections
import random
from sklearn.cluster import KMeans
from sklearn.metrics import f1_s... |
from cv2 import data
import tensorflow as tf
import cv2, os, random, math, numbers
import numpy as np
from pathlib import Path
interp_list = [cv2.INTER_NEAREST, cv2.INTER_LINEAR, cv2.INTER_CUBIC, cv2.INTER_LANCZOS4]
def maybe_random_interp(cv2_interp):
if True:
return np.random.choice(interp_list)
els... |
# Copyright 2019 <NAME> and <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
import random
from htdp_pt_br.universe import *
''' Meu programa da vaquinha 2.0 (com um chupacabra) '''
'''==================='''
'''# Preparacao da Tela e Constantes: '''
(LARGURA, ALTURA) = (600, 400)
TELA = pg.display.set_mode((LARGURA, ALTURA))
try:
... |
"""
defines new types for Users, FileVar, ...
(Server)
Author: Nilusink
"""
from concurrent.futures import ThreadPoolExecutor
from fridrich import cryption_tools
from struct import pack
import contextlib
import socket
import typing
import json
import time
class FileVar:
def __init__(self, value: str | dict, file... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO: remove redundant DEPS.
DEPS = [
'file',
'recipe_engine/path',
'recipe_engine/properties',
'repo',
'recipe_engine/step',
]
_TARGET_DEVICE_M... |
"""This is a module for extracting data from simtelarray files and
calculate image parameters of the events: Hillas parameters, timing
parameters. They can be stored in HDF5 file. The option of saving the
full camera image is also available.
Usage:
"import calib_dl0_to_dl1"
"""
import os
import logging
import numpy ... |
import re
import networkx as nx
import numpy as np
import pandas as pd
from info_gain import info_gain
from sklearn.neighbors import NearestNeighbors
from tqdm.auto import tqdm
def add_hierarchy_columns(df, G, keep_prefix=False):
"""Given a feature dataframe and corresponding hierarchy graph, add all the
high... |
import torch
import numpy as np
import skimage.io as sio
import argparse
from torch.utils.data import DataLoader
from network import dorn_architecture, fpn_architecture
from dataset_loader.dataset_loader_scannet import ScannetDataset
from dataset_loader.dataset_loader_nyud import NYUD_Dataset
from dataset_loader.datase... |
# Copyright 2019 by <NAME>, Technical Animator
# All rights reserved.
# This tool is released under the "MIT License Agreement". Please see the LICENSE
# file that should have been included as part of this package.
import os
import sys
import logging
import json
import pymel.core as pm
from core import ui_function, ... |
import torch
import copy
import time
from torch import nn
from torch_scatter import scatter_mean, scatter_max, scatter_add
from mot_neural_solver.models.mlp import MLP
def scatter_add_weigh(src: torch.Tensor, index: torch.Tensor, dim: int = 0,
dim_size: int = None,
weigh: ... |
# Copyright 2022 Google.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
"""Expressions for the intermediate representation and auxiliary functions."""
from itertools import chain
import operator as op
import typing
import inspect
from functools import wraps, WRAPPER_ASSIGNMENTS, lru_cache
import types
import threading
from warnings import warn
import logging
from contextlib import contextm... |
# ------------------------------------------------------------------------------
# Created by <NAME>.
# Property of TrueLogic Company.
# Copyright (c) 2020.
# ------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019
# <NAME> <<EMAIL>>
# and the IceCube Collaboration <http://www.icecube.wisc.edu>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notic... |
from __future__ import annotations # type: ignore
import asyncio
import json
import re
import traceback
from collections import defaultdict
from datetime import datetime
from hashlib import md5
from io import BytesIO, StringIO
from typing import Any, Dict, List, Optional, Union, Tuple, Iterable
import aiohttp
import... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import numpy as np
import pickle
from sklearn.model_selection import train_test_split
from sklearn import svm
from sklearn.utils import Bunch
from sklearn.model_selection import cross_val_score, cross_validate
def prep_data(infile):
'''
Description:
----... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# -*- coding: utf-8 -*-
#
# Tencent is pleased to support the open source community by making QTA available.
# Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may not use this
# file except in compliance with the License. You may ... |
"""the simple baseline for autograph"""
import random
import os
import joblib
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
import torch_geometric.utils as gtils
from collections import defaultdict
from torch_geometric.data import Data
from sklearn.model_selection import train_tes... |
from flask import Flask, render_template, request, flash, session, url_for, redirect
from blockchain import app
from blockchain.forms import ContactForm, SignupForm, SigninForm, PaymentForm,PurchaseForm, SaleForm, ChangeHashForm,MineForm,BankForm
from flask_mail import Message, Mail
from blockchain.models import db... |
##############################################################################
# Copyright 2018 EuropeanSoftwareMarketingLtd.
# ===================================================================
# Licensed under the ApacheLicense, Version2.0 (the"License");
# you may not use this file except in compliance with the L... |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
# The MIT License (MIT)
#
# Copyright (c) 2015 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... |
"""BTech Dataset.
This script contains PyTorch Lightning DataModule for the BTech dataset.
If the dataset is not on the file system, the script downloads and
extracts the dataset and create PyTorch data objects.
"""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "Licen... |
import autograd.numpy as np
from autograd.extend import defvjp, primitive
from .model import Model
from . import interpolation
from . import fft
from .bbox import Box, overlapped_slices
from scarlet.operators_pybind11 import apply_filter
class Renderer(Model):
def __init__(self, data_frame, model_frame, *paramet... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# -*- mode: python; python-indent-offset: 4 -*-
#
# ./get_PDF_submission.py -c course_id -a assignment_id -u user_id [-e]
# Purpose:
# checks that the submission has been graded and has the grade 'complete'
# and then gets the PDF file submitted for a specified assignment
... |
import sys
import time
import traceback
import logging
from datetime import datetime
from greenlet import GreenletExit
from urllib.parse import unquote
import socket
from . import version_info, gyield
from .server import Server
from .exceptions import BROKEN_SOCK
from .support import reraise
log = logging.getLogger('... |
# coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from enum import Enum
from typing import Any, List
import attr
from six import string_types
from utils.feishu.dt_help import to_json_decorator
from utils.feishu.exception import LarkInvalidArguments
def join_range(s... |
import pandas as pd
import numpy as np
from scipy.stats.mstats import theilslopes
# Custom exception
class NoValidIntervalError(Exception):
'''raised when no valid rows appear in the result grame'''
pass
class pm_frame(pd.DataFrame):
'''Class consisting of dataframe for analysis constructed from system ... |
#Copyright (c) Facebook, Inc. and its affiliates.
#All rights reserved.
#This source code is licensed under the license found in the
#LICENSE file in the root directory of this source tree.
import torch.nn as nn
import torch
import numpy as np
from torch.nn.parameter import Parameter
import torch.nn.functional as F
i... |
import datetime
import sqlite3
from decimal import Decimal as D
from decimal import ROUND_UP
from peewee import bytes_type
from peewee import *
from .base import BaseTestCase
from .base import db
from .base import IS_MYSQL
from .base import IS_POSTGRESQL
from .base import IS_SQLITE
from .base import ModelTestCase
fro... |
"""
This class parses the master input file provided by the user
"""
import multiprocessing, os, subprocess
import numpy as np
import json
from ast import literal_eval
def str_to_bool(s):
if s == 'True':
return True
elif s == 'False':
return False
else:
raise Value... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
__docformat__ = "restructuredtext en"
# pylint:disable=line-too-long,too-many-public-methods
# pylint:disable=import-outside-toplevel
import os
import contextlib
from hamcrest import is_
from hamcrest import assert_... |
import argparse
import arvados
import arvados.collection
import time
import subprocess
import tempfile
import json
import logging
import ruamel.yaml
from bh20sequploader.qc_metadata import qc_metadata
from bh20sequploader.qc_fasta import qc_fasta
import pkg_resources
from schema_salad.sourceline import add_lc_filename
... |
from datetime import timedelta
from typing import List
from django.conf import settings
from django.utils import timezone
from celery import app
from celery.utils.log import get_task_logger
from ethereum.utils import check_checksum, checksum_encode, mk_contract_address
from redis.exceptions import LockError
from gno... |
from __future__ import print_function
import os
import csv
import numpy as np
import pandas as pd
from inferelator_ng import single_cell_workflow
from inferelator_ng import results_processor
from inferelator_ng import utils
from inferelator_ng import default
from inferelator_ng import bbsr_python
from inferelator_ng... |
import os
import errno
import logging
import json
import shutil
import time
import datetime
import tempfile
import tarfile
import zipfile
import bdbag.bdbagit as bdbagit
import bdbag.bdbagit_profile as bdbp
from collections import OrderedDict
from bdbag import VERSION, BAGIT_VERSION, PROJECT_URL, BAG_PROFILE_TAG, DEFAU... |
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, unicode_literals
import operator
from datetime import datetime
from functools import reduce
import extra_views
from django.conf import settings
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.forms import (Pass... |
#######################################################
# This PaxPage.py file implements PAX
import functools, math, struct
from struct import Struct
from io import BytesIO
from Catalog.Identifiers import PageId, FileId, TupleId
from Catalog.Schema import Types, DBSchema
from Storage.Page import PageHeader, Page... |
#!/usr/bin/env python3
"""Parse date/time from paths using glob wildcard pattern intertwined with a subset of strftime directives."""
import calendar
import collections
import copy
import datetime
import os
import pathlib
import re
from typing import Iterable, List, MutableMapping, Optional, Pattern, Tuple, Union
imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Trinkle23897"
__copyright__ = "Copyright (C) 2019 Trinkle23897"
__license__ = "MIT"
__email__ = "<EMAIL>"
import os, csv, json, html, urllib, getpass, base64, hashlib, argparse, platform, subprocess
from tqdm import tqdm
import urllib.request, http.cookieja... |
#!/usr/bin/env python
import argparse, sys, os, gzip, inspect
from shutil import rmtree, copy
from multiprocessing import cpu_count
from tempfile import mkdtemp, gettempdir
from subprocess import PIPE, Popen
from Bio.Format.GPD import GPDStream
from Bio.Stream import LocusStream
import classify_reads
#bring in the f... |
import itertools
import random
from abc import ABCMeta, abstractmethod
from cmath import rect, pi, phase
from time import sleep
import numpy as np
import pygame
from gym_grand_prix.envs.cars.agent import SimpleCarAgent
from gym_grand_prix.envs.cars.utils import Action
from gym_grand_prix.envs.cars.track import plot_m... |
#!/usr/bin/python3.7
# type: ignore
########################################################################################
# thesis_analysis.py - Carries out analysis on data available from Ilaria in her thesis.
#
# Author: <NAME>
# Copyright: <NAME>, 2021
#############################################################... |
"""
Modelos do banco de dados
"""
import datetime as dt
from django.db import models
from django.contrib.auth.models import User
class Categoriaproduto(models.Model):
""" Categoria de produto """
pkid_categoria = models.AutoField(primary_key=True)
nomecategoria = models.CharField(
'Nome da Ca... |
"""
Music module of the bot.
Uses Discord's commands.Cog as a base class.
"""
import os
import math
import random
import re
from gettext import translation
from asyncio import run_coroutine_threadsafe, CancelledError, TimeoutError
import discord
from discord.utils import get
from discord.ext import commands
from yt_dl... |
# Lint as: python3
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
#!/usr/bin/python
# library/tdsinstance.py
# @version v2.01_2020-SEP-27
# @author <NAME>
import sys
import os
from os.path import expanduser
from ansible.module_utils.basic import AnsibleModule
#from ldif import LDIFParser
class TDSInstance:
def __init__(self, module):
self.module = module
def... |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
import chess
import random
import platform
import chess.engine
import generic_mcts
from generic_mcts import Move
import generic_alpha_beta
from generic_alpha_beta import choose_best_move_minimax
from colorama import Fore
from colorama import Style
from random import choice
def load_stockfish():
global stockfish
... |
import numpy as np
import cv2
from scipy.spatial.transform import Rotation
import depthai as dai
import time
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import Image, Imu, CameraInfo
from cv_bridge import CvBridge
import tf2_ros
class OAKDNode(Node):
def __init__(self):
super().__init__... |
#!/usr/bin/python
# library/db2database.py
# @version 2.00_2020-MAR-26
# @author <NAME>
import sys
import os
from os.path import expanduser
from ansible.module_utils.basic import AnsibleModule
class DB2Database:
def __init__(self, module):
self.module = module
self.facts = {}
def parse_par... |
# We will add all the common utility functions over here
import os
import re
import string
import collections
import json
import pickle
import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.INFO)
MIN_POS_SAMPLES_THRESHOLD = -1
Q_TOKEN = "<Q_TARGET>"
URL_TOKEN = "<URL>"
def print_list(l):
for e... |
import copy
import math
import numpy as np
from panda3d.core import CollisionNode, CollisionBox, CollisionSphere, NodePath, BitMask32
from visualization.panda.world import ShowBase
import basis.robot_math as rm
import basis.data_adapter as da
import modeling.geometric_model as gm
import modeling.model_collection as mc
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 10 11:21:08 2019
@author: NeerajBaruah
"""
###############################################################################
#
#
# Project: World Bank AgriDemand Cropland scenarios
# Purpose: Functions which aid in cropland scenario analysis (Cham... |
import os, sys, re, json
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from tqdm import tqdm
import sklearn.metrics as metrics
import warnings
warnings.filterwarnings('ignore')
"""""""""""""""""""""""""""""""""""""""""
# Encoding and Build Dataset
"""""""""""""""""""""""""""""""""""""""""
... |
#!/usr/bin/env python3
"""
This script gives you a MicroPython REPL prompt and provides a hook on the target
board so that the current directory on the host is mounted on the board, at /remote.
Usage:
./mprepl.py [device]
If not specified, device will default to /dev/ttyACM0.
To quit from the REPL press Ctrl-X.... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
#!/usr/local/bin/python3
import os
from os.path import join, dirname, abspath
from subprocess import Popen, PIPE
import argparse
import re
from sheet_helper import connect_GSheets, spreadsheet_id
from sheet_helper import color_header, color_id, color_default, color_white
from sheet_helper import get_border_request
... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
#!/usr/bin/env python
import unittest
import os
import numpy as np
from matador.utils.cell_utils import (
abc2cart,
cart2abc,
cart2volume,
create_simple_supercell,
)
from matador.utils.cell_utils import cart2frac, frac2cart
from matador.utils.cell_utils import doc2spg, cart2abcstar, real2recip
from mata... |
#!/bin/sh
#!nix-shell -i python3 -p python3 -p binutils
#
# binutils is used for addr2line, to lookup the symbols of the binary which is
# currently submitting stacks via the fifo.
# The beginning of this script is both valid shell and valid python, such that
# the script starts with the shell and is reexecuted with ... |
import sys
import numpy as np
from experiments.data import load_webs, load_weak_iris, load_weak_blobs
from experiments.metrics import compute_expected_error, compute_error_matrix
from wlc.WLweakener import computeM, estimate_M, weak_to_index
from wlc.WLweakener import weakCount, newWeakCount
from wlc.WLweakener impor... |
__author__ = "<NAME>"
_version__ = '0.3.0'
from log_calls import log_calls
import doctest
#-------------------------------------------------------------------
# test__omit_property_attr__repr_with_init_active
#-------------------------------------------------------------------
def test__omit_property_attr__repr_wit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.