text
stringlengths
957
885k
#!/usr/bin/env python3 """Very simple file based database resembling CSV but using a key.""" import pathlib from typing import Tuple from boxhead import config as boxhead_config from boxhead.boxheadlogging import boxheadlogging logger: boxheadlogging.BoxHeadLogger = boxheadlogging.get_logger(__name__) class KeyMap...
from algotrader.model.market_data_pb2 import * from algotrader.model.model_factory import ModelFactory from algotrader.model.ref_data_pb2 import * from algotrader.model.trade_data_pb2 import * from algotrader.model.time_series_pb2 import * from collections import OrderedDict class SampleFactory(object): def __init...
<gh_stars>0 #!/usr/bin/env python import pickle import rospkg rospack = rospkg.RosPack() RACECAR_PKG_PATH = rospack.get_path('racecar') PLANNER_PKG_PATH = rospack.get_path('planning_utils') CURRENT_PKG_PATH = rospack.get_path('final') BLUE_FILTER_TOPIC = '/cv_node/blue_data' RED_FILTER_TOPIC = '/cv_node/red_data' i...
from datetime import datetime import logging from discord import User from main import AIKyaru from aiohttp import ClientSession, ClientTimeout from expiringdict import ExpiringDict from utils import errors from copy import deepcopy import re class Api: def __init__(self, bot: AIKyaru): self.bot = bot ...
<gh_stars>10-100 from __future__ import with_statement import imp import inspect import os import sys from attest import ast, statistics from attest.codegen import to_source, SourceGenerator __all__ = ['COMPILES_AST', 'ExpressionEvaluator', 'TestFailure', 'assert_hook', ...
<reponame>vtarasv/cbh21-protein-solubility-challenge """ The entry point for your prediction algorithm. """ from __future__ import annotations import argparse import csv import itertools from pathlib import Path import pprint from typing import Any import zipfile from Bio.PDB.PDBParser import PDBParser from Bio.PDB.v...
<gh_stars>1-10 #!/usr/bin/env python # Author: <NAME> # Author: <NAME> # MIT License. # # Copyright 2019 <NAME> and SWCCDC. 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 # restricti...
""" <EMAIL> """ from __future__ import print_function, unicode_literals, absolute_import, division import numpy as np from itertools import product def tile_iterator(im, blocksize = (64, 64), padsize = (64,64), mode = "constant", verbose = False): ...
"""Working with event data, events, and event sequences""" # Copyright (c) 2019 <NAME>. # # This is free, open software licensed under the [MIT License]( # https://choosealicense.com/licenses/mit/). import csv import itertools as itools import json as _json import operator import esal from . import records # Dat...
<reponame>chua-n/particle import random from typing import List, Tuple, Union import numpy as np import pandas as pd from skimage.measure import marching_cubes import torch def fig2array(fig): """Convert a Matplotlib figure to a 3D numpy array with RGB channels and return it @param fig a matplotlib figure ...
''' This script is intented to generate a dgemm model from a BLAS calibration archive. ''' import sys import datetime import time import yaml import cashew import numpy from cashew import linear_regression as lr from cashew import archive_extraction as ae def my_dgemm_reg(df): df = df.copy() lr.compute_variab...
<reponame>TheYuanLiao/individual_mobility_model import os import sys import subprocess import yaml import time import pandas as pd import geopandas as gpd import multiprocessing as mp def get_repo_root(): """Get the root directory of the repo.""" dir_in_repo = os.path.dirname(os.path.abspath('__file__')) ...
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Author: <NAME> Email: <EMAIL> Date: 6/20/2020 """ import asyncio import http import json import shutil from pathlib import Path from typing import List from fastapi import APIRouter, File, UploadFile, Depends from fastapi.exceptions import RequestVal...
<filename>optimization/lightgbm.py # Copyright 2020 The MuLT Authors. 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 #...
<gh_stars>1-10 from string import ascii_lowercase from defaultlist import defaultlist as ref_defaultlist from hypothesis import assume from hypothesis import strategies as st from hypothesis.stateful import RuleBasedStateMachine from hypothesis.stateful import initialize from hypothesis.stateful import rule from pytes...
<filename>cogs/voice.py<gh_stars>1-10 """ Music functions by https://github.com/EvieePy Original Music Module - https://gist.github.com/EvieePy/ab667b74e9758433b3eb806c53a19f34 Added Google Text-to-speech """ import discord from discord.ext import commands import asyncio import itertools import sys import os import t...
<reponame>LiBa001/CoRe #in dieser Version kam hinzu, dass zuerst die Ränder besezt werden, #wenn es keinen anderen sinnvollen zug gibt import random # CoRe def turn(board, symbol): def randAction(): while 1: x = random.choice(range(8)) y = random.choice(range(8)) if getb...
from __future__ import division, print_function import os from mmtbx.validation.ramalyze import ramalyze from libtbx.program_template import ProgramTemplate try: from phenix.program_template import ProgramTemplate except ImportError: pass from libtbx.utils import Sorry class Program(ProgramTemplate): prog = os....
<reponame>tapis-project/tapipy """ Script to download/pickle/store configs under specified name. This allows us to update the Tapipy configs with a script. Note, this allows you to map any spec URL to any other URL filename as that's how they're saved. MEANING! You can give an actor spec a 'files' filename and there wi...
#!/home/bin/python import argparse import time import sys print('\nChecking required modules \n') ''' Purpose of the program: 1) Used to merge the haplotype file generated by phase-Extender and phase-Stitcher. 2) Merge the table file back to VCF. ''' def main(): ''' Define required argument for inter...
<reponame>PaddlePaddle/PaddleSpatial<filename>paddlespatial/networks/vmrgae/agcn.py # -*-Encoding: utf-8 -*- ################################################################################ # # Copyright (c) 2021 Baidu.com, Inc. All Rights Reserved # #####################################################################...
import streamlit as st from datetime import date from os import path import time from utils.tokenizer_funcs import spacy_fastai, Numericalize, open_vocab from utils.processing import fastai_process_trans from utils.logging import log_usage from utils.model_utils import load_quantized_model from utils.translate_utils i...
# finufft module, ie python-user-facing access to (no-data-copy) interfaces # # Some default opts are stated here (in arg list, but not docstring). # Barnett 10/31/17: changed all type-2 not to have ms,etc as an input but infer # from size of f. # Barnett 2018?: google-style docstrings for napoleon. ...
<reponame>gabrielepessoa/programino ''' Players are Python objects with a ``__call__`` method defined to accept a Game instance as the sole argument. Players return None, and leave the input Game unmodified, except for its valid_moves attribute. This value may be replaced with another tuple containing the same moves, b...
<filename>run_lda.py # -*- coding: utf-8 -*- """ Created on Sun Sep 8 22:43:33 2019 @author: dell """ # -*- coding: utf-8 -*- """ Created on Sat Aug 31 11:27:24 2019 @author: dell """ import sys import argparse import json import numpy as np from LDA import lda_model, corp_dict import random as rd from gensim.mode...
<filename>vframe/vframe/settings/paths.py import os from os.path import join import logging from vframe.settings import vframe_cfg as vcfg from vframe.settings import types class Paths: # class properties MAPPINGS_DATE = vcfg.SUGARCUBE_DATES[0] DIR_APP_VFRAME = 'apps/vframe/' DIR_APP_SA = 'apps/syrianarchi...
# Copyright (C) 2019 Intel Corporation. # SPDX-License-Identifier: BSD-3-Clause """Controller for config app. """ import os import xml.etree.ElementTree as ElementTree class XmlConfig: """The core class to analyze and modify acrn config xml files""" def __init__(self, path=None, default=True): self...
# SPDX-License-Identifier: MIT # # Copyright (c) 2021 The Anvil Extras project team members listed at # https://github.com/anvilistas/anvil-extras/graphs/contributors # # This software is published at https://github.com/anvilistas/anvil-extras import json as _json from anvil.js import window as _window __version__ =...
from flask import render_template, request, redirect, url_for, flash from datetime import datetime as dt import json import locale import pandas as pd from sqlalchemy import func from app.models import Rooms, Hotels, User, Reservation, Status, Guest, Account from app import db locale.setlocale(locale.LC_ALL, 'pt_BR.UT...
<reponame>vinthedark/snet-marketplace-service import json import uuid from enum import Enum import web3 from eth_account.messages import defunct_hash_message from web3 import Web3 from common.logger import get_logger logger = get_logger(__name__) class ContractType(Enum): REGISTRY = "REGISTRY" MPE = "MPE" ...
<filename>sliding_window/sliding_window.py import numpy as np import pandas as pd from pathlib import Path class SlidingWindow: def __init__(self, path_to_data, target, window_size, n_largest, stride): # parameters self.path_to_data = Path(path_to_data) self.target = np.array(list(target)...
#!/usr/bin/env python3 # encoding: utf-8 import os import sys import time import numpy as np from copy import deepcopy from typing import (Dict, NoReturn, Optional) from rls.utils.display import show_dict from rls.utils.sundry_utils import (check_or_create, ...
import os import glob import tensorflow as tf from timeit import default_timer from itertools import product from graph_nets.graphs import GraphsTuple from graph_nets.utils_np import graphs_tuple_to_networkxs, networkxs_to_graphs_tuple, get_graph import numpy as np import networkx as nx from networkx.drawing import dr...
<filename>cpdb/twitterbot/tests/test_response_builders.py from django.test import TestCase from django.test.utils import override_settings from mock.mock import mock_open from robber import expect from mock import patch, Mock from twitterbot.response_builders import ( SingleOfficerResponseBuilder, CoaccusedPairRe...
<gh_stars>1-10 ####################################################################### # Copyright [2019] [<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.o...
# -*- coding: utf-8 -*- # @Time : 2020/7/4 # @Author : <NAME> # @FileName: MyLightModule.py # @GitHub : https://github.com/lartpang/MINet/tree/master/code/utils/imgs import os import random from functools import partial import torch from PIL import Image from torch.nn.functional import interpolate from torch.uti...
<reponame>rsyamil/applied-nlp import sys import re import os import collections import json import numpy as np #from NLTK stopwords = ['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', "you're", "you've", "you'll", "you'd", 'your', 'yours', 'yourself', 'yourselves', 'he', ...
<gh_stars>0 from urllib.request import urlopen import pandas as pd from lib.basics import * # Retrieving data from github repository def download_data(): """Downloads the data from the JHU GitHub repository into feed files""" print_log("Downloading data from JHU repository ...") today = set_date() ...
import os import math import torch import random import numpy as np import torch.nn as nn import torch.utils.data import torch.optim as optim import torch.nn.init as init import torch.nn.functional as F import matplotlib.pyplot as plt from torch.autograd import Variable from torch.utils.data import DataLoader from tor...
<gh_stars>1-10 #!/usr/bin/env python3 """ helper tool to run yosys, generating appropriate yosys script python, rather than bash, since commandline arguments etc so much more convenenient in python In addiition, we can give a task, by providing --task-file [task filepath]. The task should be the only declaration in th...
<reponame>myhugong/probing-TTS-models<gh_stars>10-100 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Dec 1 18:51:41 2019 @author: lukeum """ import matplotlib.pylab as plt import os import sys import numpy as np import torch import transformers import soundfile import argparse from praatio import...
<reponame>vs666/BrickBreaker from motion import Motion from Board import Board from variables import game_matrix as ar from variables import props from variables import BrickOb as brk from math import fabs ''' check death check collision reflect vertical reflect horizontial reflect board ( pass board object) dead bal...
#!/usr/bin/python2.7 #TODO UPDATE CAO: 4/1/18 # Requires python-requests. Install with pip: # # pip install requests # # or, with easy-install: # # easy_install requests #Blog post from which much of this code was copied: #https://cryptostag.com/basic-gdax-api-trading-with-python/ #Note the GDAX crypto ids are as ...
import unittest from ishell.console import Console from ishell.command import Command class TestConsole(unittest.TestCase): def test_console_creation(self): """Console must be created.""" c = Console() assert isinstance(c, Console) def test_console_has_prompt(self): """Console...
# # Module to support the pickling of different types of connection # objects and file objects so that they can be transferred between # different processes. # # processing/reduction.py # # Copyright (c) 2006-2008, <NAME> --- see COPYING.txt # __all__ = [] import os import sys import socket import thre...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import ( absolute_import, division, print_function, unicode_literals, ) import numpy as np from .extern.validator import ( validate_scalar, validate_array, validate_physical_type, ) from ...
import json import hashlib import random from datetime import date import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import datetime from aiohttp import web from pymysql import MySQLError from db import mysql_connect from auth import requires_auth from app import get_e...
import json from typing import Dict, List, Tuple, Union from uuid import uuid4 from abc import ABC, abstractmethod from enum import Enum, auto import datetime as dt class PlanObjectType(Enum): TASK = auto() MILESTONE = auto() CATEGORY = auto() class PlanObject(ABC): def __init__(self,...
<gh_stars>0 from flask import g from flask_login import current_user import re from .models import RandomTable, Macros from .randomise_utils import split_id, get_random_table_record, get_macro_record def check_table_definition_validity(table): error_message = '' table_list = table.definition.splitlin...
<filename>pigeon/annotate.py import functools import json import random from IPython.display import clear_output, display from ipywidgets import HTML, Button, Dropdown, FloatSlider, HBox, IntSlider, Output, Textarea def annotate(examples, options=None, shuffle=False, include_skip=True, write_to_file=None, display_fn...
# Copyright 2021 Google LLC # # 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, ...
# -*- coding: utf-8 -*- import numpy as np import multiprocessing import torch from torch import nn, Tensor from ctp.kernels import GaussianKernel from ctp.clutrr.models import BatchNeuralKB, BatchHoppy, BatchUnary, BatchMulti from ctp.reformulators import SymbolicReformulator from typing import List, Dict, Tuple,...
""" Copyright 2013 <NAME> This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distributed in the ho...
#!/usr/bin/env python # -*- coding: utf-8 -*- import tornado.routing import torn.plugins.app import torn.api from torn.exception import TornErrorHandler, TornNotFoundError, TornUrlNameNotFound import tornado.web import torn.plugins import re import os class Route: def __init__(self, uri: str, controller: torn....
<gh_stars>10-100 import asyncio import json from unittest import TestCase from unittest.mock import Mock from test import AsyncMock from pyhap.accessory import ( Accessories, Accessory, ) from pyhap.characteristic import Characteristic from pyhap.characteristics import ( Brightness, On, Hue, ) from...
<filename>viz3d/opengl/camera_shader.py from viz3d.opengl.gl_algebra import gl_transpose from viz3d.opengl.model import PointCloudModel, EllipsesModel, CamerasModel, LinesModel, VoxelsModel, PosesModel from viz3d.opengl.shader import * import numpy as np class CameraAlbedoShader(Shader): """ A CameraAlbedoSh...
<reponame>dalbonip/hmp_hunter<gh_stars>0 import os import re import pandas as pd from search_db_for_lib import look_for_lib from datetime import date, datetime from pytz import timezone directory = "clientes" def make_report(): data_e_hora_atuais = datetime.now() fuso_horario = timezone('America/Sao_Paulo') da...
import csv import os import logging from dataactcore.interfaces.db import GlobalDB from dataactcore.logging import configure_logging from dataactcore.models.jobModels import FileType from dataactcore.models.validationModels import FileColumn, FieldType from dataactvalidator.health_check import create_app from dataactv...
<reponame>lxdzz/item import hashlib from django.core.paginator import Paginator from django.shortcuts import render, HttpResponseRedirect,HttpResponse from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt #免除csrf保护 from Seller.models import * def loginValid(fun): def inner(re...
<filename>GUI Applications/calc.py from tkinter import Tk from tkinter import Entry from tkinter import Button from tkinter import StringVar t=Tk() t.title("<NAME>") t.geometry("425x300") t.resizable(0,0) t.configure(background="black")#back ground color a=StringVar() def show(c): a.set(a.get()+c) def equal():...
# ntripbrowser code is placed under the 3-Clause BSD License. # Written by <NAME> (<EMAIL>) # # If you are interested in using ntripbrowser code as a part of a # closed source project, please contact Emlid Limited (<EMAIL>). # # Copyright (c) 2017, Emlid Limited # All rights reserved. # # Redistribution and use in sour...
<gh_stars>1-10 'Tests for roller-balance server.' import collections import decimal import os.path import uuid # pylint: disable=unused-import import pytest # pylint: enable=unused-import import accounting import db import etherscan import logs import web LOGGER = logs.logging.getLogger('roller.test') ADDRESSES = [4...
<gh_stars>0 import matplotlib matplotlib.use('Agg') import numpy as np from matplotlib import pyplot as plt from pylab import rcParams from pySDC.projects.FastWaveSlowWave.HookClass_acoustic import dump_energy from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right from pySDC.imp...
<gh_stars>1-10 """Reward Calculator for DRL""" import numpy as np import scipy.spatial from geometry_msgs.msg import Pose2D from typing import Dict, Tuple, Union class RewardCalculator: def __init__( self, robot_radius: float, safe_dist: float, goal_radius: float, rule: st...
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2009 <NAME> <<EMAIL>> from dbus import PROPERTIES_IFACE from telepathy.interfaces import CHANNEL_TYPE_DBUS_TUBE, CONN_INTERFACE, \ CHANNEL_INTERFACE, CHANNEL_INTERFACE_TUBE, CONNECTION from coherence.extern.telepathy ...
import time, os, sys import threading import queue from .tools import win32, img import shutil import os import uuid import random from datetime import date from pprint import pprint import pyperclip Task_Queue = queue.Queue() Result_Queue = queue.Queue() task_timeout = 30 # class TaskWork(threading.Thread): ...
<gh_stars>1-10 #!/usr/bin/python # (c) 2018 <NAME>. MIT licensed, see https://opensource.org/licenses/MIT # Part of Blender Driver, see https://github.com/sjjhsjjh/blender-driver """Path Store unit test module. Tests in this module can be run like: python3 path_store/test.py TestInsert """ # Exit if run other than...
from manga_py.providers import providers_list from manga_py.fs import root_path from manga_py.meta import repo_name from json import dumps from datetime import datetime start_items = [ # [ address, (0 - not worked, 1 - worked, 2 - alias), 'Comment'] ['http://com-x.life', 1, ' - One thread only!!! --no-multi-th...
<filename>match_synsets_to_categories.py import warnings import argparse import json from pandas.io.json import json_normalize from categories import Categories import sys from nltk.corpus import wordnet as wn import pandas as pd from tqdm import tqdm import os import re warnings.filterwarnings( "ignore", mes...
import sys import os this_path = os.path.dirname(os.path.realpath(__file__)) root_path = os.path.abspath(os.path.join(this_path, os.pardir)) sys.path.append(root_path) import torch from utilities.vqa.dataset import * from transformers import BertTokenizer from datasets.creator import DatasetCreator, MultiPurposeDatas...
import os import torch import numpy as np from . import base from . import tools class DQN(base.ValueNet): """docstring for DQN""" def __init__(self, handle, env, sub_len, eps=1.0, memory_size=2**10, batch_size=64): super().__init__(env, handle) self.replay_buffer = tools.MemoryGroup(self.view...
import unittest with_alazar = True def get_pulse(): from qupulse.pulses import TablePulseTemplate as TPT, SequencePulseTemplate as SPT, RepetitionPulseTemplate as RPT ramp = TPT(identifier='ramp', channels={'out', 'trigger'}) ramp.add_entry(0, 'start', channel='out') ramp.add_entry('duration', 'stop...
""" Removes the duplicate sets of COPE responses to the same questions in the same survey version. In PPI(COPE) surveys, the purpose of questionnaire_response_id is to group all responses from the same survey together. Some COPE questions allowed participants to provide multiple answers, which be will connected via th...
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import math from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler from UTILS.colorful import * import numpy as np from UTILS.tensor_ops import _2tensor class PPO(): def __init__(self, policy_and_critic,...
<filename>multi-label/resnet/train.py # -*- coding: utf-8 -*- ''' Author: <NAME> Email: <EMAIL> Python Version: 3.7.10 Description: train.py includes the training process for the weakly supervised labeling classification (incomplete label assignments). ''' import os import ast import sys impor...
import datetime from decimal import Decimal import pytest from pybankreader.exceptions import ValidationError from pybankreader.fields import Field, IntegerField, CharField, RegexField, \ TimestampField, DecimalField def _generic_field_test(field_instance, ok_value, long_value, set_value=None): """ As any...
<gh_stars>10-100 #!/usr/bin/env python # -*- python -*- #BEGIN_LEGAL # #Copyright (c) 2019 Intel 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/...
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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...
"""Module to import and decode zs2 files.""" import gzip as _gzip import struct as _struct # Author: <NAME> # Copyright: Copyright 2015,2016,2017, <NAME> # License: MIT ##################################### # # Python 2/3 compatibility # # turn byte/str/int/unicode character into ordinal value _ord= lambda x:...
<gh_stars>0 #!/usr/bin/env python import xml.etree.ElementTree as ETree import numpy as np import pandas as pd import pytest from unify_idents.engine_parsers.ident.xtandem_alanine import ( XTandemAlanine_Parser, _get_single_spec_df, ) def test_engine_parsers_xtandem_init(): input_file = ( pytes...
<reponame>jbrown-xentity/ckan # encoding: utf-8 import datetime import json import pytest import responses import sqlalchemy.orm as orm import ckan.plugins as p import ckanext.datapusher.interfaces as interfaces import ckanext.datastore.backend.postgres as db from ckan.tests import helpers, factories class FakeDat...
from enum import Enum from .errors import JujuError class Source(Enum): """Source defines a origin source. Providing a hint to the controller about what the charm identity is from the URL and origin source. """ LOCAL = "local" CHARM_STORE = "charm-store" CHARM_HUB = "charm-hub" def __str...
<filename>release/scripts/modules/bpy_extras/anim_utils.py # ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at y...
<reponame>DeppMeng/HRNet-MaskRCNN-Benchmark # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime import logging import time import torch import torch.distributed as dist from maskrcnn_benchmark.utils.comm import get_world_size from maskrcnn_benchmark.utils.metric_logger import Metri...
#!/usr/bin/env python __author__ = "bitsofinfo" import importlib from multiprocessing import Pool, Process import json import pprint import yaml from dateutil import parser as dateparser import re import os from objectpath import * import argparse import collections import sys import datetime import logging import ti...
from grpclib.health.check import ServiceStatus from grpclib.health.service import Health from grpclib.server import Server from insanic.app import Insanic from insanic.conf import settings from interstellar import config as interstellar_common_config from interstellar.abstracts import AbstractPlugin from interstellar...
<gh_stars>1-10 from requests import Session import re import numpy import time import sys import csv import datetime import random import string def get_letter(letter, follow_subsequent=True): print("get_letter(\"{}\").".format(letter)) s = Session() # this session will hold the cookies headers = {"User-Agent": "...
<reponame>eggfly/WatchIO print("Hello, world!") from ST7735 import TFT from sysfont import sysfont import machine from machine import SPI,Pin import time import math backlight = machine.Pin(15, machine.Pin.OUT) backlight.value(0) spi = SPI(-1, baudrate=70000000, polarity=0, phase=0, sck=Pin(18), mosi=Pin(23), miso=Pi...
<filename>cca_zoo/deepmodels/architectures.py from abc import abstractmethod from math import sqrt from typing import Iterable import torch class BaseEncoder(torch.nn.Module): @abstractmethod def __init__(self, latent_dims: int, variational: bool = False): super(BaseEncoder, self).__init__() ...
<reponame>rauwuckl/CElegansPhototaxis # Either run python3 evolution.py to start from 0 # or run 'python3 evolution.py population N' to start with population number N which is loaded from filename populationN.npy import numpy as np import timeit import threading import sys import random as randomPack import os.path f...
"""Setup script to compile tlsssl to run against py2.7 on macOS.""" # standard libs from distutils.dir_util import mkpath import os import urllib2 import shutil import sys import stat import re import inspect import argparse # our libs. kind of hacky since this isn't a valid python package. CURRENT_DIR = os.path.dirn...
from ast import keyword import re import json from tqdm import tqdm import os import datetime from transformers import pipeline import sys import datetime import codecs import pandas as pd import textwrap from collections import defaultdict tqdm.pandas() print('downloading model') summarizer = pipeline("summarizat...
import math import pygame from ball import Ball from primitives import Pose from cue import Cue, BasicCue import constants as c from copy import copy class Player(Ball): def __init__(self, game, x=0, y=0): super().__init__(game, x, y) self.mass *= 1.05 self.color = (255, 255, 0) ...
<reponame>PKUfudawei/cmssw<filename>L1Trigger/L1TCalorimeter/python/caloParams_2021_v0_2_cfi.py import FWCore.ParameterSet.Config as cms from L1Trigger.L1TCalorimeter.caloParams_cfi import caloParamsSource import L1Trigger.L1TCalorimeter.caloParams_cfi caloStage2Params = L1Trigger.L1TCalorimeter.caloParams_cfi.caloPar...
<reponame>TUW-GEO/qa4sm-reader<gh_stars>0 # -*- coding: utf-8 -*- """ Contains helper functions for plotting qa4sm results. """ from qa4sm_reader import globals import numpy as np import pandas as pd import os.path from typing import Union import copy import seaborn as sns import matplotlib.pyplot as plt import matp...
# This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful,...
''' Created on Jun 25, 2021 @author: willg ''' from typing import List import os import discord import common import UtilityFunctions main_help_file_list = ['main_help.txt'] tabling_help_file_list = ['tabling_help_1.txt', 'tabling_help_2.txt'] server_defaults_help_file_list = ['server_defaults_help.txt'] flags_help_...
<gh_stars>10-100 # misc small utilities # Author:: <NAME> (<<EMAIL>>) # Copyright:: Copyright (c) 2014, 2015, 2016 Magnetic Media Online, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. #...
<reponame>naiiytom/cms-angular-fastapi-keycloak import os from io import StringIO import pandas as pd import requests import json from flask import Flask, request from flask_cors import CORS from .s3_backend.s3_storage import (get_disease_table_presigned_url, get_export_history_pre...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Make statistics on score files (stored in JSON files). """ import common_functions as common import argparse import numpy as np import math def hist_ratio(json_file_path_list, metric, min_npe=None, max_npe=None, ...