text stringlengths 6.04k 39.5k |
|---|
import chess
import random as rnd
import timeit
from math import sqrt, log
from .bot import ChessBot
class ChessBotVictor(ChessBot):
def __init__(self, name, opt_dict = None):
super().__init__(name, opt_dict)
self.depth = opt_dict['depth']
self.start_board = None
self.is_white = Tr... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 16:06:50 2019
@author: gourgue
cellule 1 : importation
"""
#%%
#importation
import numpy as np
import os
from skimage.io import imread, imsave
from skimage.color import rgb2gray
from skimage.measure import regionprops
from skimage import i... |
#!/usr/bin/env python3
import argparse
import ast
import json
import logging
import os
import shutil
import tempfile
import zipfile
from typing import Tuple
import re
import requests
import yaml
logger = logging.getLogger()
logging.basicConfig(level=logging.DEBUG)
_cwd = os.path.dirname(__file__)
TESTS_PATH = os.p... |
import collections
import json
import logging
import os
import string
import sys
import threading
import traceback
import app_identity
from datetime import datetime, timezone
from enum import IntEnum
import random
import requests
from flask import request, Response
from google.api.monitored_resource_pb2 import Monito... |
#!/usr/bin/env python
# encoding: utf-8
import gzip
import shutil
from os import remove, rename, makedirs
from os.path import join, dirname, basename
from Naked.toolshed.network import HTTP
from Naked.toolshed.file import FileWriter
from Naked.toolshed.system import stderr, stdout, file_exists, dir_exists
from Naked.t... |
# Copyright 2016 Canonical Limited.
#
# This file is part of charms.hardening.
#
# charm-helpers is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed in the hope th... |
import discord
import youtube_dl
import asyncio
import random
import os
from discord.ext import commands
def setup(bot):
bot.add_cog(MusicCog(bot))
class MusicCog(commands.Cog, name='Musica'):
def __init__(self, bot: discord.Client):
self.bot = bot
self.ydl_opts = {
'format': 'be... |
import torch
from sys import platform
if platform != "win32":
from torch_geometric.data import Data
else:
import open3d as o3d
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
import quaternion
from scipy.spatial.transform import Rotation
sys.path.insert(0, os.path.join(os.environ['ALFWOR... |
# Copyright 2017 National Research Foundation (Square Kilometre Array)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditi... |
import pytest
from diofant import (Eq, Function, I, Lambda, Rational, binomial, expand_func,
factorial, gamma, rf, sin, sqrt, symbols)
from diofant.abc import a, b
from diofant.solvers.recurr import (rsolve, rsolve_hyper, rsolve_poly,
rsolve_ratio)
__all__ = (... |
"""
Useful functions for segmenting.
"""
__date__ = "August 2019 - March 2021"
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import numpy as np
import os
from scipy.signal import stft
from scipy.io import wavfile
from scipy.io.wavfile import WavFileWarning
import warnings
EPSILON = 1e-9
def get_spec... |
# Copyright 2019 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.
from contextlib import contextmanager
from collections import defaultdict, namedtuple
from hashlib import sha256
from recipe_engine import recipe_api
from P... |
import re
from os import path
NodeTypeSets = {
"node/-/-/not_define": ["sc_node"],
"node/-/not_define": ["sc_node"],
"node/const/general_node": ["sc_node"],
"node/const/terminal": ["sc_node_abstract"],
"node/const/struct": ["sc_node_struct"],
"node/const/tuple": ["sc_node_tuple"],
"node/c... |
# Copyright (c) 2021-2022, InterDigital Communications, Inc
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the disclaimer
# below) provided that the following conditions are met:
# * Redistributions of source cod... |
"""
ParallelProcessor utilizes multiple CPU cores to process compute-intensive tasks.
If you have a some time-consuming statements in a for-loop and no state is shared among loops, you can map these
statements to different processes. Assume you need to process a couple of files, you can do this in parallel::
def... |
from typing import Dict, Union, Optional, List, Any
from datetime import datetime
import numpy as np
import warnings
from relevanceai._api import APIClient
from relevanceai.client.helpers import Credentials
from relevanceai.constants import Messages
from relevanceai.constants import IMG_EXTS
from relevanceai.utils... |
import datetime
import os.path
import sys
from pathlib import Path
import fsspec
import intake
import intake_xarray
import numpy as np
import pystac
import pytest
import xarray as xr
import yaml
from intake.catalog import Catalog
from intake.catalog.local import LocalCatalogEntry
from intake_stac import StacCatalog, ... |
#!/usr/bin/env python3
"""Simple proxy server to intercept traffic."""
import argparse
import asyncio
from ipaddress import IPv4Address
import logging
import sys
from typing import Any, Dict, Optional, cast
from google.protobuf.message import Message as ProtobufMessage
from zeroconf import Zeroconf
from pyatv.auth.h... |
import warnings
from numbers import Number
try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping
from psims.xml import XMLWriterMixin, XMLDocumentWriter
from psims.utils import TableStateMachine
from .components import (
MzIdentML,
ComponentDispatcher, etree, c... |
# This code is part of the epytope distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""
.. module:: Core.Generator
:synopsis: Contains functions to transform variants to transcripts and
proteins to peptides.
:Note: A... |
""" Utility functions for extracting COS spectral data into lightcurves
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from astropy.io import fits
import os
import numpy as np
from scipy.interpolate import interp1d
import six
from .utils import expan... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 4 17:02:30 2019
@author: to_reilly
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import special
from scipy import spatial
def calcP(mm, aa, bb, kk):
mu0 = 4 * np.pi * 10**(-7)
dBesselk_m = special.kvp(mm, abs(kk)*aa,1)
dBe... |
"""This module provides various helper functions."""
from __future__ import division, print_function
import logging
import sys
import os
import warnings
from astropy.visualization import (PercentileInterval, ImageNormalize,
SqrtStretch, LinearStretch)
from astropy.time import Time
im... |
import numpy as np
import tensorflow as tf
slim = tf.contrib.slim
from tensorflow.contrib.layers.python.layers import conv2d
from tf_ops.wrap_ops import tensor_shape, soft_nms, smooth_l1, softmax_with_logits
POS_NUMBER_PER_LAYER_SCOPE = 'POS_NUMBER_PER_LAYER_SCOPE'
NEG_NUMBER_PER_LAYER_SCOPE = 'NEG_NUMBER_PER_LAYER_S... |
# -*- coding: utf-8 -*-
"""
Copyright by <NAME>, Univ. of Southampton, UK, 2016
Created on Wed Jan 6 13:27:47 2016
"""
import numpy as np
#================
# new implementation
#http://diyhpl.us/~bryan/papers2/IGES5-3_forDownload.pdf
#http://soliton.ae.gatech.edu/people/jcraig/classes/ae4375/notes/b-splines-04.p... |
# -*- coding: utf-8 -*-
#
# author: yanmeng2
#
# 非实时转写调用demo
import base64
import hashlib
import hmac
import json
import os
import time
import re
import requests
from nltk.translate.bleu_score import sentence_bleu
import Levenshtein
lfasr_host = 'http://raasr.xfyun.cn/api'
# 请求的接口名
api_prepar... |
from collections import defaultdict
import numpy as np
import scipy.signal
import mne
from scipy.stats import kurtosis
from mne.preprocessing.bads import _find_outliers
from mne.utils import logger
from mne.io.pick import pick_info, _picks_by_type
def _bad_mask_to_names(info, bad_mask):
"""Remap mask to ch names"... |
# Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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... |
# Copyright 2020, Futurewei Technologies
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, V... |
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file acc... |
import traceback
from werkzeug.exceptions import BadRequest
from flask import Flask, jsonify, request
app = Flask(__name__)
app.url_map.strict_slashes = False
instance = None
import hoplite.utils as utils
def error(code, message):
return response(True, code, None, message)
def response(error, code, data, mess... |
import random
import os
import math
from vtkmodules import all as vtk
from vtkmodules.util import numpy_support
import numpy as np
from matplotlib import pyplot as plt
from scipy.spatial import KDTree
from multiprocessing import Pool
import torch
from torch.utils.data import Dataset
from utils.sdf import SDFRead
from ... |
#!/usr/bin/env python3
# coding: utf-8
# vim: set ts=4 sts=4 sw=4 expandtab cc=80:
# Copyright (c) 2014, 2016, chys <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions... |
#!/usr/bin/python3
import os,sys,math
import numpy as np
pi = np.pi
cos = np.cos
sin = np.sin
exp = np.exp
abs = np.abs
tanh = np.tanh
#tanh activation function (defualt)
def actfn_tanh(z):
return tanh(z)
#derivative of tanh activation function (default)
def dactfn_tanh(z):
return (1-tanh(z)**2)
#quadratic... |
#!/usr/bin/env python3.6
import argparse
import os
import sys
import json
import csv
from pathlib import Path
import yaml
import mongoengine
import output_formatters
from model import util, Bot, User, BannedPair, UserPK
def load_config():
config_path = Path(__file__).parent / 'settings' / 'confi... |
try:
from builtins import object
except ImportError:
# python2
pass
import inspect
import itertools
import logging
from collections import OrderedDict
from collections import defaultdict
from collections import deque
from functools import partial
from six import string_types
logger = logging.getLogger(__na... |
# Copyright 2020-2022 OpenDR European Project
#
# 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 agree... |
#!/usr/bin/env python3
# ==============================================================================
#
import os
import sys
import click
import json
import random
import freeton_utils
from freeton_utils import *
from pinatapy import PinataPy
from pprint ... |
"""Abstraction layer over PyOpenCL.
It implements the abstract interfaces defined by :mod:`katsdpsigproc.abc`.
"""
from typing import List, Tuple, Sequence, Optional, Callable, Type, TypeVar, Union, Any
from types import TracebackType
import pyopencl
import pyopencl.array
import numpy as np
try:
from numpy.typin... |
import os
import pickle
from logging import getLogger
import iris
import math
import numpy as np
import pandas as pd
from omnium import Analyser
from omnium.utils import get_cube
logger = getLogger('cosar.spa')
def max_wind_diff_between_levels(u_rwp, v_rwp, start_level, end_level, pressure):
max_wind_diff, max... |
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2008-2022 <NAME> r.c.i.mackenzie at googlemail.com
#
# https://www.gpvdm.com
#
# This program is free software; you can redistribute it and/or m... |
# -*- coding: utf-8 -*-
"""
This module contains methods to augment a nested data structure with
*AnAugmentedTreeItem*-Classes.
"""
from typing import Any, Dict, Union, Mapping, List, Sequence, Optional, Generator, Tuple
from pandas import DataFrame
import numpy as np
from augmentedtree.core import (
AUGMENTATION... |
"RequestHandler subclass for all pages."
import base64
import functools
import json
import logging
import traceback
import urllib.request
import urllib.error
import urllib.parse
import couchdb2
import tornado.web
import orderportal
from orderportal import constants
from orderportal import settings
from orderportal i... |
#
# Pyserini: Reproducible IR research with sparse and dense representations
#
# 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... |
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
#!/usr/bin/env python3
__author__ = 'anton'
import asyncio
from argparse import ArgumentParser
from collections import Counter, defaultdict
import csv
import functools
import itertools
import math
from pathlib import Path
import pprint
import statistics
from enum import Enum
import Levenshtein as lev
import substr... |
#!/usr/bin/env python
from bootstats import PyBootstrap
import numpy as np
import h5py
import os
NUMPREC = 1.e-14
#-------------------------------------------------------------------------------
class Bootstrapper(object):
"""Bootstrapper class for mean distribution estimation."""
#------------------
def __ini... |
from gat import GAT
import process
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import nn_ops
class Basic... |
# Copyright (C) 2019-2021, TomTom (http://tomtom.com).
#
# 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 o... |
from copy import copy
from time import sleep
from threading import Lock, Event
from functools import wraps
from helpers import setup_logger, remove_left_failsafe, cb_needs_key_state, \
KEY_PRESSED, KEY_RELEASED, KEY_HELD
from utils import to_be_foreground, check_value_lock
from base_ui import BaseU... |
"""
CMSIS DAP access protocol
Interfaces with CMSIS-DAP standard debuggers over HID
"""
import time
from logging import getLogger
from .dapwrapper import DapWrapper
from ..util import binary
from ..pyedbglib_errors import PyedbglibError
class CmsisDapUnit(DapWrapper):
"""Communicates with a DAP via standard CM... |
"""SciUnit score collections, such as arrays and matrices.
These collections allow scores to be organized and visualized
by model, test, or both.
"""
import warnings
from datetime import datetime
from typing import List, Tuple, Union
import bs4
import numpy as np
import pandas as pd
from IPython.display import Javas... |
# for each seq
# tabulate tetramers (and comps) in a Window
# advance the Window by Step and retabulate
import lut
import numpy as np
import pandas as pd
import misc
import string
from Bio import Seq
from Bio import SeqRecord
from Bio import SeqUtils
from collections import OrderedDict
from collections import Coun... |
from typing import Any, Callable, Dict, List, Optional, Protocol, Tuple, Type
import ConfigSpace as CS
import numpy as np
from parzen_estimator import (
MultiVariateParzenEstimator,
ParzenEstimatorType,
build_categorical_parzen_estimator,
build_numerical_parzen_estimator,
)
from tpe.optimizer.base_o... |
# Sample python code to Public API course
# Requires python 2.7+
# Install required dependencies via: $ pip install requests pytz pyrfc3339
import subprocess
import os
import requests
from requests.exceptions import HTTPError
import pyrfc3339
from datetime import datetime
import re
def create_endpoint(hostname, root... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from scipy.stats import truncnorm
from atari_utils.utils import one_hot_encode, sample_with_temperature
from simple.utils import MeanAttention, ActionInjector, standardize_frame, get_timing_signal_nd, mix, Container, \
bit_to_int, int_to_bit
clas... |
# -*- coding:UTF-8 -*-
"""
Created on Mon Jul 9 20:41:03 2018
@author: 康文洋 <EMAIL>、陈祚松、夏萍萍、艾美珍、陈兰兰、张梦丽、易传佳
"""
from django.shortcuts import render
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.urls import reverse
#from django.core import serializers
from django.forms.m... |
#!/opt/anaconda3/bin/python
import math
import os.path
import statistics
import subprocess
import sys
from collections import namedtuple
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image, ImageDraw
import tabio.pascalvoc
def bbox_union(a, b):
if a == ... |
#!/usr/bin/python3
__author__ = 'mirko'
import sys, os, ctypes as ct
from time import clock, sleep
from os import path
import OpenGL.GL as gl
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from ctypes import *
try:import numpy as np
except:np = None
_shaderProgram = None
_shaderVarFil... |
#!/usr/bin/env python
#
"""oocgcm.griddeddata.grids
Define tools for building grid objects from array of latitude and
longitude.
"""
import numpy as np
import xarray as xr
from xarray.ufuncs import sqrt, cos
from ..core.grids import generic_2d_grid,_mi,_mj,_horizontal_gradient
from ..core.utils import _append_dataar... |
from abc import ABCMeta, abstractmethod
import os
import csv
import sys
import inspect
import requests
import re
import pandas as pd
import time
from subprocess import run, DEVNULL, STDOUT
import tempfile
from collections import defaultdict
from Bio import SeqIO
import random
import uuid
class IEDB(metaclass=ABCMeta):... |
#coding=utf-8
#from List import toList,toPylist
from List import *
from Match import *
from Parsec import *
from dt import *
dt = Datatype()
c = Constructor()
dt.program('a') == c.a_program('exp')
program = dt.program
a_program = c.a_program
is_program = lambda x:isinstance(x,program)
dt.expression('a') == \
c.con... |
"""
Este programa é quase idêntico ao moving_platforms.py, mas demonstra uma
método Control.update_viewport () diferente que nos permite facilitar
rolagem.
Aqui a rolagem começa quando o jogador cruza 1/3 da tela.
A rolagem começa na metade da velocidade do jogador, mas quando o jogador atinge
a rolagem no meio do cami... |
# ----------------------------------------------------------------------------
# Copyright (c) 2018-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
#!/usr/bin/env python3
import argparse
import os
import time
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
import connexion
import logging
# import umap
from flask import send_from_directory, redirect, json
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import MDS, TSNE
from copy impor... |
import calendar
import datetime
import random
from django.contrib import messages
from django.contrib.auth import get_user_model, update_session_auth_hash
from django.contrib.auth.forms import PasswordChangeForm
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseRedirect
from dja... |
#!/usr/bin/env python3
"""
This script performs primary evaluation measures
for the developed question answering system.
Usage:
python3 evaluate.py dataset.json 2> processing.log
"""
import sys
import json
import time
import statistics
import random
from difflib import SequenceMatcher
import spacy
# sys.path.append... |
"""
-*- coding: utf-8 -*- {{{
vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
Copyright (c) 2018, Battelle Memorial Institute
All rights reserved.
1. Battelle Memorial Institute (hereinafter Battelle) hereby grants
permission to any person or entity lawfully obtaining a copy of this
software and associated... |
import socket
from scapy.all import *
import re
import time
# Constants:
FTP_CONTROL_PORT = 21 # FTP control channel works on port 21
FTP_DATA_PORT = 20 # FTP data channel works on port 20
IP_CLIENT = "192.168.40.50"
IP_PROXY_CLIENT = "192.168.40.80"
IP_PROXY_SERVER = "192.168.30.80"
IP_SERVER = "192.168.30.90"
INTER... |
"""All game objects."""
from os import path
from numpy import sign
from pygame import image
from pygame.event import Event, post
from pygame.surface import Surface
from main.code.constants import FULLTILE
from main.code.engine.components.maths import f_loop
from main.code.engine.components.output_handler import Draw... |
from typing import List
from sequence.kernel.timeline import Timeline
from sequence.topology.node import BSMNode, Node
from sequence.components.memory import MemoryArray
from sequence.components.optical_channel import ClassicalChannel, QuantumChannel
from sequence.entanglement_management.generation import Entanglement... |
from tkinter import *
from tkinter.messagebox import showinfo
from itertools import permutations
N = 0
button_number = 0
player_1 = []
player_2 = []
class game_board:
def __init__(self, number, x, y, color):
self.number = number
self.x = x
self.y = y
self.co... |
from __future__ import print_function
'''
R-1.1 Write a short Python function, is_multiple(n, m), that takes two integer values and
returns True if n is a multiple of m, that is, n = mi for some integer i, and False otherwise
'''
def is_multiple(n, m):
try:
return n % m == 0
except ZeroDivisionError:
... |
import os
import re
import json
import datetime
from threading import Timer
numSecondsPerSample = 1
#def getmyIP():
# return os.popen("curl \"http://myexternalip.com/raw\"").read() + ":8333"
def bitcoin(cmd):
return os.popen("./../src/bitcoin-cli -rpcuser=cybersec -rpcpassword=<KEY> -rpcport=8332 " + cmd).read()
d... |
from pathlib import Path
import docx.parts.story as story
import numpy as np
import pandas as pd
from docx import Document
from docx.enum.style import WD_STYLE_TYPE
from docx.enum.table import WD_ALIGN_VERTICAL
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml.shared import OxmlElement, qn
from docx.shared ... |
#!/usr/bin/env python
"""Provides a class (RSSaveFile) for loading and saving Rocksmith save files.
I do not recommend using this class on its own, as it does not provide any protection
from overwriting save files (no backups) and doesn't manage interactions between the
Rocksmith files and Steam.
Instead, use the pro... |
"""
Soft Actor-Critic
Based on SAC implementation from https://github.com/rail-berkeley/softlearning
"""
from copy import deepcopy
import csv
from pathlib import Path
from typing import Union
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Dense
import ... |
#!/usr/bin/env python
# minervaclient: The command-line interface
# This file is from Minervac, a command-line client for Minerva
# <http://npaun.ca/projects/minervac>
# (C) Copyright 2016-2017 <NAME>
# (C) Copyright 2018-2019 <NAME>
from __future__ import print_function
from builtins import input
from builtins impor... |
# coding: utf-8
from __future__ import unicode_literals
import django
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.fields import *
from django.db.models.fields.rela... |
import discord
import copy
from icons import iconreplace
from util import *
EMP = "Extended Mastery Support Skill"
DOMAIN = "Domain Bonus Ability"
async def characterparse(categories: list, source: str, embed: discord.Embed,
simple: bool) -> discord.Embed():
# Trim off any potential fasc... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-01-21 at 09:37
import rules:
Cannot import drs_table
Cannot import whole of apero.config (drs_setup uses drs_table)
@author: cook
"""
import numpy as np
import os
import time
import random
from apero.... |
import argparse
import hashlib
import json
import os
import pty
import subprocess
import sys
import unittest
import urllib
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
MAX_ITEMS_TO_CHECK = 25
URL_SAFE_CHARS = '/\'()'
URL_SAFE_CHARS_RELAXED = '/\'()[]{}^'
ALBUM = 'album'
IMAG... |
import numpy as np
from collections import Counter
import re
def z_value(w, x, b):
return np.dot(w, x) + b
def sigmoid(z):
"""sigmoid function to squash the output of the
linear equation itno a range of [0,1]
"""
return 1 / (1+ np.exp(-z))
def cross_entropy_loss(y_est, y):
"""logarithmic ... |
from __future__ import print_function, division
from coffea import hist
import numpy as np
import awkward as ak
from dummy_distributions import dummy_jagged_eta_pt
import pytest
import sys
def test_hist():
counts, test_eta, test_pt = dummy_jagged_eta_pt()
h_nothing = hist.Hist("empty inside")
assert h_... |
# python thoreau-scriptor.py --log +BCDEFGHW
# python thoreau-scriptor.py -f arbores.txt thoreau-initio.txt
from collections import defaultdict
from tkinter.ttk import Progressbar
from math import sqrt,sin,cos
from tabulate import tabulate
from random import randint
from tkinter import *
import argparse
import pickle... |
from typing import *
from fffw.graph.meta import AUDIO, VIDEO, StreamType, Meta
from fffw.encoding import filters, inputs, outputs, FFMPEG
Group = Dict[int, Set[int]]
""" Grouping result."""
PairKey = Tuple[int, int]
""" Dict key containing ids of two related objects."""
Incoming = Union[inputs.Stream, filters.Filte... |
#!/usr/bin/env python
"""
Copyright (c) 2018 <NAME>
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, modify, merge, publi... |
import TimeTagger as TT
import time
import copy
import pickle
import numpy as np
from pylabnet.utils.logging.logger import LogHandler
from pylabnet.hardware.interface.gated_ctr import GatedCtrInterface, CtrError
from pylabnet.network.core.service_base import ServiceBase
from pylabnet.network.core.client_base import Cli... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from typing import Callable, Optional, List, Tuple
from enum import Enum
import gtimer as gt
from functools impo... |
#!/usr/bin/python
# ------------------------------------------------
# act_latency.py
#
# Analyze an act_storage or act_index output file.
# Typical print_usage:
# $ ./act_latency.py -l act_out.txt
# where act_out.txt is output generated by act_storage or act_index, and which
# uses defaults:
# (-h - depends on con... |
from __future__ import division
import numpy as np
import gym
from gym.utils import seeding
import sys, os
### Environment
class ToricGameEnv(gym.Env):
metadata = {'render.modes': ['human']}
def __init__(self, **kwargs):
"""
ToricGameEnv environment. Effective single player game.
The p... |
import asyncio
import functools
import logging
import textwrap
from contextlib import suppress
import discord
from discord.ext import commands
from firetail.core import checks
from firetail.lib import db
log = logging.getLogger(__name__)
PERMS_MAP = {
"kick_members": 1,
"ban_members": 2,
"administrator... |
import numpy as np
from ase.units import Hartree, eV, Bohr, Ang
import rdkit
from rdkit import Chem
from rdkit.Chem import AllChem
import torch
import os
class data_infor:
def __init__(self, index, datadir, reference, ftype="confs", qmtype=None):
"""Use to get information we need for each molecule
... |
from os import listdir, urandom, path, makedirs, remove as rm_file
import json
import bcrypt
import sqlite3
from hashlib import sha256
from flask import Flask, request, render_template, session, redirect, flash, send_from_directory, jsonify
from werkzeug.utils import secure_filename
from db import get_db, init_app
from... |
import numpy as np
import datetime
from calculations import *
import mahotas
from georectification import *
from os import path, listdir
from scipy.signal import argrelextrema
def lowestCountourSnowDepth(imglist,datetimelist,mask,settings,logger,objsize,light_threshold,sigma,bias):
try:
sigma = int(sigma)... |
import struct
import json
import base64
from datetime import datetime
from .Tool import read_var_int, hash_hash256
# Read the header and transaction count.
# Reference: https://en.bitcoin.it/wiki/Block#Block_structure
class Header:
def __init__(self, blk_data: bytes):
# Magic no, block size, and version
(sel... |
#!/usr/bin/env python
#coding:utf-8
# Author: mozman --<<EMAIL>>
# Purpose: test filters module
# Created: 04.11.2010
# Copyright (C) 2010, <NAME>
# License: GPLv3
import unittest
from svgwrite import filters
class TestFilter(unittest.TestCase):
def test_constructor(self):
f = filters.Filt... |
from app import (
mythic,
db_objects,
links,
use_ssl,
server_header,
mythic_admin_password,
mythic_admin_user,
default_operation_name,
)
from sanic.response import json
from sanic import response
from sanic.exceptions import (
NotFound,
Unauthorized,
MethodNotS... |
# ===================================================================================================
# _ __ _ _
# | |/ /__ _| | |_ _ _ _ _ __ _
# | ' </ _` | | _| || | '_/ _` |
# |_|\_\__,_|_|\__|\_,_|_| \__,_|
... |
import collections
import contextlib
import json
import uuid
from collections import abc
from typing import Any, Dict, List, Optional
import bpy
from ...common import convert
from ...common.human_bone import HumanBoneSpecifications
from .property_group import Vrm0HumanoidPropertyGroup, Vrm0PropertyGroup
def read_te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.