text
stringlengths
957
885k
# # MazeGame v 1.0.0 # {Server side version} # Python version # # SmartFoxServer PRO example file # # (c) 2005 - 2006 gotoAndPlay() # # number of players in the room numPlayers = 0 # associative array of users in the room users = {} # flag that handles if the game is started gameStarted = False ...
# Copyright (C) 2019 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Controls tests.""" # pylint: disable=redefined-outer-name import copy import pytest from lib import base, browsers, factory, url from lib.constants import element, objects from lib.entities import entity...
from ..kernel import core from ..kernel.core import VSkillModifier as V from ..character import characterKernel as ck from functools import partial from ..status.ability import Ability_tool from . import globalSkill from .jobbranch import warriors from .jobclass import demon from math import ceil ### ๋ฐ๋ชฌ์–ด๋ฒค์ ธ ์ง์—… ์ฝ”๋“œ (์ž‘์„ฑ์ค‘) ...
<reponame>kaibabbob/capirca """Tests for google3.third_party.py.capirca.lib.gcp_hf.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import unittest from absl.testing import parameterized from capir...
""" This script is used to compute the window functions and mode coupling matrices of the SO simulations. The window function are defined of the product of a survey mask and a galactic mask, there is also an option to use a hitcount maps To run it you need to specify a dictionnary file, for example global_sims_all.dict...
<reponame>dsavransky/admissions<filename>admissions/utils.py import numpy as np import pandas import scipy.interpolate from scipy.optimize import curve_fit from scipy.stats import norm import country_converter as coco from fuzzywuzzy import process from shutil import copyfile from admissions.rankings import tfit clas...
<reponame>imtapps/django-dynamic-validation import mock from django import test as unittest from django.contrib.auth.models import User from dynamic_rules import models as rule_models from dynamic_validation import models from dynamic_validation.dynamic_actions import BaseDynamicValidation, BadViolationType from dyna...
<reponame>mnguyen0226/image-augmentation-dnn-performance<filename>image_preprocessor/preprocess_image.py<gh_stars>0 from scipy import ndarray import skimage.io import skimage as sk from skimage import transform from skimage import util import os import numpy as np import matplotlib.pyplot as plt from PIL import Image ...
<filename>leisure/transports.py import fcntl import os import socket import errno from collections import deque from .event_emmiter import EventEmmiter class Socket(EventEmmiter): def __init__(self,address, delegate=None): self.address = address self.delegate = delegate self.event_loop = None self.re...
<gh_stars>0 # differential expression import pyspark.sql.functions as F from pyspark.sql.types import FloatType from pyspark.sql import Window from scipy.stats import t def diff_expr_top_n(df_melt_flt, cluster_id=0, n=10): ''' Take filtered tall-format dataframe, cluster_id of interest and n as inputs ...
import torch import torch._prims.utils as utils from torch._prims.utils import ( TensorLikeType, NumberType, ELEMENTWISE_TYPE_PROMOTION_KIND, ) import torch._refs as refs from torch._prims.wrappers import ( elementwise_type_promotion_wrapper, out_wrapper, ) from typing import Optional __all__ = [...
<reponame>rodrigofaccioli/drugdesign #! /usr/bin/env python """ Routines to extract compounds from ZINC Database: http://zinc.docking.org/ These routines were developed by: <NAME> - <EMAIL> / <EMAIL> <NAME> - <EMAIL> / <EMAIL> """ import ConfigParser as configparser import os import shutil import...
<reponame>a-amaral/qiskit-terra # -*- coding: utf-8 -*- # Copyright 2018, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """ Histogram visualization """ from string import Template from collections import Counter i...
# -*- coding: utf-8 -*- """ Created on Mon Feb 8 08:11:50 2021 @author: <NAME> """ import os from pickle import load, dump import subprocess from time import time, sleep from shutil import rmtree import numpy as np import pandas as pd from reificationFusion import model_reification import concurrent.futures from mul...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `ndextcgaloader` package.""" import os import tempfile import shutil import unittest from ndexutil.config import NDExUtilConfig from ndextcgaloader import ndexloadtcga from ndextcgaloader.ndexloadtcga import NDExNdextcgaloaderLoader import json import ndex2...
import numpy as np class HMM: def __init__(self, states, observables): # Set states and observables self.numStates = states self.numObservables = observables self.randomizeProbabilities() def randomizeProbabilities(self): # Alpha are state probabilities # Also called the "transition probabilities" # A...
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved. # This is licensed software from AccelByte Inc, for limitations # and restrictions contact your company contract manager. # # Code generated. DO NOT EDIT! # template file: justice_py_sdk_codegen/__main__.py # justice-legal-service (1.22.2) # pylint: disable=d...
<gh_stars>0 import os.path from time import time import numpy as np from matplotlib import pyplot as plt import burg_toolkit as burg def loading_saving_lib(): fn = '/home/rudorfem/datasets/object_libraries/test_library/test_library_def.yaml' fn2 = '/home/rudorfem/datasets/object_libraries/test_library/test_...
# Copyright 2016 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. """ Cache temperature specifies how the browser cache should be configured before the page run. See design doc for details: https://docs.google.com/document...
<filename>tests/unit_tests/test_cli_funcs/test_train.py """tests for vak.cli.train module""" from configparser import ConfigParser import os from pathlib import Path import shutil import tempfile import unittest import vak.cli.train HERE = Path(__file__).parent TEST_DATA_DIR = HERE.joinpath('..', '..', 'test_data') ...
<filename>DOS/FunctionsLayer1/getNumberMatrix.py # -*- coding: utf-8 -*- import numpy as np from BasicFunctions.generateNumberArray import generateNumberArray def isRepeatedSample(numberArray, samples_list): # for recordedNumberArray in samples_list: diff = [recordedNumberArray[i] - numberArray[i]\ ...
<gh_stars>0 """ Import file catalog metadata from the IceProd v2 simulation database. """ import sys import os import argparse import hashlib import pymysql import requests try: from crawler import generate_files, stat except ImportError: print('Requires file_crawler in PYTHONPATH') sys.exit(1) level_ty...
<filename>dalle_pytorch/transformer.py from functools import partial from itertools import islice, cycle import torch from torch import nn, einsum import torch.nn.functional as F from einops import rearrange from dalle_pytorch.reversible import ReversibleSequence, SequentialSequence from dalle_pytorch.attention impor...
<reponame>mgotz/PyDataProcessing<filename>mg/dataprocessing/savitzky_golay.py # -*- coding: utf-8 -*- """ Created on Thu Jul 16 12:45:39 2015 1d and 2d savitzky_golay smoothing functions blatantly copied from scipy cookbook """ import numpy as np from math import factorial from scipy.signal import fftconvolve __all__...
# vim: set tabstop=4 expandtab : ############################################################################### # Copyright (c) 2019-2021 ams AG # # 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 o...
<gh_stars>0 """ 2019-May-10 -- incorporates modernizations from <https://github.com/diyclassics/library-callnumber-lc/blob/master/callnumber/__init__.py> """ import logging, re log = logging.getLogger(__name__) __version__ = '0.1.0' joiner = '' topspace = ' ' bottomspace = '~' topdigit = '0' bottomdigit = '9' wei...
<reponame>gregwinther/predicting-solid-state-qubit-material-hosts import pandas as pd import logging import sys from pymatgen.symmetry.groups import SYMM_DATA, sg_symbol_from_int_number def sortByMPID(df: pd.DataFrame) -> pd.DataFrame: mpid_num = [] for i in df["material_id"]: mpid_num.append(int(i[3:...
#!/usr/bin/env python3 import json import requests # https://www.notion.so/EXTERNAL-Gather-http-API-3bbf6c59325f40aca7ef5ce14c677444#af100c0dc3a84ea6869cb779d58ff7b7 class Gather: def __init__(self, gather_api_key, gather_space_id): self.gather_api_key = gather_api_key self.gather_space_id = ga...
<reponame>floringogianu/wintermute """ A DQN example using wintermute that is close to the setup in the original paper. """ import time import random from functools import partial from types import SimpleNamespace from datetime import datetime import torch from torch import optim from termcolor import colored as c...
<gh_stars>0 """ Module containing classes that represent single results or sets of results that are obtained at once. E.g. the several results that come from one test bar Also classes to represent a result """ import os from typing import List, Tuple import pandas as pd from google.cloud import firestore # How too...
from collections import defaultdict import copy from nltk.parse import DependencyGraph from common.globals_args import nltk_nlp def span_tree_to_hybrid_dependency_graph_interface(span_tree=None): '''span tree to hybrid dependency graph interface''' skeleton_span_node = span_tree.get_root_span_node() if le...
from flask import render_template, abort, flash, redirect, url_for, current_app, request, make_response from . import main from .. import db from ..models import User, Role, Post, Permission, Post, Comment from flask_login import login_required, current_user from .forms import EditProfileForm, EditProfileAdminForm, Pos...
from example_utils import fmt_row, fetch_dataset import cPickle, numpy as np import cgt from cgt import nn import argparse, time def rmsprop_updates(cost, params, stepsize=0.001, rho=0.9, epsilon=1e-6): grads = cgt.grad(cost, params) updates = [] for p, g in zip(params, grads): acc = cgt.shared(p....
import datetime import os import subprocess import click from tess.src.compiler import should_be_compiled, compile_cmd from tess.src.directories import Directory from tess.src.navigator import list_files, cases_absolute_path, \ build_absolute_path, solutions_absolute_path, debug_build_absolute_path, \ debug_s...
import os import json import time import sys from .socket_server.server import Server from .socket_server.server import ReturnCode from .socket_server.server_app import ServerApp class DmMockServer(Server): @staticmethod def get_socket_file(): return os.path.join(os.path.expanduser("~"), ...
<filename>PyTkGui/widgets/_base.py # -*- coding: utf-8 -*- import gc from tkinter import ttk from typing import List from ..utils import get_real_master class _Base: iter_num = 0 def __init__(self, parent, **options): self.parent = parent self.options = options self.configures = {} ...
<reponame>daniellepintz/torchx<filename>torchx/schedulers/kubernetes_scheduler.py<gh_stars>0 #!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tr...
import tensorflow import numpy as np import cv2 import random from game import move_conv, find_winner import time np.set_printoptions(suppress=True) model = tensorflow.keras.models.load_model("RPS-model.h5") # 0_Rock 1_Paper 2_Scissors 3_YourTurn s = ["images/0.png", "images/1.png", "images/2.png", "images/3.jfi...
<reponame>GMDennis/claf from overrides import overrides import torch from torch.autograd import Variable from claf.data import utils class PadCollator: """ Collator apply pad and make tensor Minimizes amount of padding needed while producing mini-batch. * Kwargs: cuda_device_id: tensor ass...
# -*- coding: utf-8 -*- # pylint: disable-msg = W0613, W0622, W0704 # # Copyright 2004-2006 <NAME> or his licensors, as applicable # # 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...
<gh_stars>1000+ # Copyright (c) 2020 PaddlePaddle 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 # # Unless r...
<reponame>futureseadev/coba import unittest import timeit from typing import List from coba.pipes import MemorySource from coba.config import CobaConfig, NoneLogger from coba.simulations import ( Interaction, MemorySimulation, ClassificationSimulation, LambdaSimulation, CsvSimulation, ArffSimulation, LibsvmSi...
# Scrape Pardot extracted emails for leads and contact id's for opportunities # ---------------------------------------------------------------------------- import io import sys import os from os.path import expanduser as ospath import numpy as np import pandas as pd import xlsxwriter from collections import OrderedDic...
from njupass import NjuUiaAuth import time import datetime from pytz import timezone from urllib.parse import urlencode URL_JKDK_LIST = 'http://ehallapp.nju.edu.cn/xgfw/sys/yqfxmrjkdkappnju/apply/getApplyInfoList.do' URL_JKDK_APPLY = 'http://ehallapp.nju.edu.cn/xgfw/sys/yqfxmrjkdkappnju/apply/saveApplyInfos.do' URL_JK...
<filename>src/utils/run_reports.py import logging import time def publish_report(wrapper, name, version): try: logging.info("Publishing report version {}-{}".format(name, version)) return wrapper.execute(wrapper.ow.publish_report, name, version) except Exception as ex: logging.exceptio...
#!/usr/bin/python # Copyright (c) 2010-2013, Regents of the University of California. # All rights reserved. # # Released under the BSD 3-Clause license as published at the link below. # https://openwsn.atlassian.net/wiki/display/OW/License import threading import socket import logging import os import time import...
# # Collective Knowledge (Workflow to automate validation of results from the SysML'19 paper: "AGGREGATHOR: Byzantine Machine Learning") # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: <NAME>, <EMAIL>, http://fursin.net # cfg={} # Will be updated by CK (meta de...
from bloom.bloomfilter import BloomFilter, openfile, setup_dict import hashlib import logging from bitarray import bitarray import subprocess logging.basicConfig(level=logging.DEBUG) logging.getLogger('pytest bloom3') logging.info("pytest bloomfilter") logging.debug("debug") def test_bitmap_creation(): bf = Bloo...
#!/usr/bin/python import os import subprocess from os.path import isfile, join # KITTI 02 #start_num = 0 #stop_num = 4660 #frame_step = 1 #left_prefix = "/image_0/" #right_prefix = "/image_1/" #left_suffix = ".png" #right_suffix = ".png" #out_fname = "kitti_02_lst.xml" #start_num = 0 ##stop_num = 1100 #frame_step = 1...
<reponame>augustinharter/nlp-bert-project<filename>tests/bert_test.py import torch from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler from keras.preprocessing.sequence import pad_sequences from sklearn.model_selection import train_test_split from tqdm import tqdm, trange import pan...
import os import re import json import yaml import numpy as np from tps.types import Charset from tps import symbols as smb GRAPHEME_DICT = { Charset.en: smb.english.GRAPHEMES_EN, Charset.en_cmu: smb.english.GRAPHEMES_EN, Charset.ru: smb.russian.GRAPHEMES_RU, Charset.ru_trans: smb.russian.GRAPHEMES_R...
<reponame>disruptek/boto<filename>scripts/rebuild-endpoints.py """Rebuild endpoint config. Final format looks like this:: { "autoscaling": { "ap-northeast-1": "autoscaling.ap-northeast-1.amazonaws.com", "ap-northeast-2": "autoscaling.ap-northeast-2.amazonaws.com", "ap-southeast-1": "autosca...
""" my_args.py ใ‚ณใƒžใƒณใƒ‰ใƒฉใ‚คใƒณๅผ•ๆ•ฐใฎ็ฎก็† ใƒ‘ใƒฉใƒกใƒผใ‚ฟ็ฎก็† """ import argparse def get_parser(): parser = argparse.ArgumentParser(description='ใƒ‘ใƒฉใƒกใƒผใ‚ฟๆŒ‡ๅฎš') # general parser.add_argument('--workers', default=0, type=int, help="ไฝฟ็”จใ™ใ‚‹CPUใ‚ณใ‚ขๆ•ฐ") # pathๆŒ‡ๅฎš parser.add_argument('--no_check', action='store_true', help="ใƒ•...
import os import shutil from joblib import Parallel, delayed from .data_file import DataFile from .helpers import (proc_file_input, mp_consol_save, wrap_load_func) from pandas.util._decorators import doc from .Dataset import _shared_docs, _sip_docs import numpy as np import pandas as pd def get_file_mapping(self, col...
<filename>install/app_store/tk-multi-workfiles/v0.7.4/python/tk_multi_workfiles/file_list_view.py # Copyright (c) 2013 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See ...
import uuid from galaxy import model from galaxy.jobs.rule_helper import RuleHelper from galaxy.model import mapping from galaxy.util import bunch USER_EMAIL_1 = "<EMAIL>" USER_EMAIL_2 = "<EMAIL>" USER_EMAIL_3 = "<EMAIL>" def test_job_count(): rule_helper = __rule_helper() __assert_job_count_is( 0, rule_hel...
from math import pi, sqrt from raytracer.tuple import ( tuple, point, vector, magnitude, normalize, dot, cross, Color, ) from raytracer.util import equal from raytracer.matrices import Matrix, I from raytracer.transformations import ( translation, scaling, rotation_x, ro...
<gh_stars>1-10 """ A Galaxy wrapper script for corrector <NAME> - GigaScience and BGI-HK """ import optparse import os import shutil import subprocess import sys import tempfile import glob def stop_err(msg): sys.stderr.write(msg) sys.exit() def cleanup_before_exit(tmp_dir): if tmp_dir and os.path.exists...
# test_cleanupaccounts.py - functionnal test for CleanAccounts task # # This file is part of debexpo # https://salsa.debian.org/mentors.debian.net-team/debexpo # # Copyright ยฉ 2020 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associ...
#!/usr/bin/env python3 import time from Cluster import Cluster from TestHelper import TestHelper from WalletMgr import WalletMgr from testUtils import Utils ############################################################### # nodeos_producer_watermark_test # --dump-error-details <Upon error print etc/eosio/node_*/confi...
<filename>gcsl/__init__.py import copy import itertools import time from collections import deque from typing import Any, Callable, List, Literal, Sequence, Tuple, Type, Union import gym import numpy as np import torch import torch.distributions as D import torch.optim import torch.nn import torch.nn.functional as F ...
<filename>pointnet_model/models/pointnet2_wss_reg.py import os import sys BASE_DIR = os.path.dirname(__file__) sys.path.append(BASE_DIR) sys.path.append(os.path.join(BASE_DIR, '../utils')) import tensorflow as tf import numpy as np import tf_util from pointnet_util import pointnet_sa_module, pointnet_sa_module_msg, poi...
import RabinKarp import plotly.plotly as py import plotly.graph_objs as go import time py.sign_in(username='aafham', api_key='<KEY>') start = time.time() malaysiaIO = open('news/text/Kuala Lumpur.txt', 'r', encoding='utf-8') malaysia_text = malaysiaIO.read().lower() malaysia_text = malaysia_text.replace("\n", " ") ma...
<gh_stars>10-100 """Tests for the views of the ``payslip`` app.""" from django.test import TestCase from django.utils import timezone from django_libs.tests.mixins import ViewRequestFactoryTestMixin from mixer.backend.django import mixer from .. import views class DashboardViewTestCase(ViewRequestFactoryTestMixin, ...
from copy import deepcopy import os import numpy as np from datetime import datetime, timedelta from snowav.utils.wyhr import calculate_wyhr_from_date from snowav.utils.OutputReader import iSnobalReader import netCDF4 as nc def outputs(run_dirs, wy, properties, start_date = None, end_date = None, flight_d...
import tensorflow as tf bn_axis = -1 initializer = 'glorot_normal' def residual_unit(inputs, num_filter, stride, dim_match, name): bn_axis = -1 initializer = 'glorot_normal' x = tf.keras.layers.BatchNormalization(axis = bn_axis, scale = True, ...
import py, sys from pypy.objspace.std.model import registerimplementation, W_Object from pypy.objspace.std.register_all import register_all from pypy.objspace.std.settype import set_typedef as settypedef from pypy.objspace.std.frozensettype import frozenset_typedef as frozensettypedef from pypy.interpreter import gatew...
<filename>oop03 (class methods).py<gh_stars>1-10 # oop3 # class methods # regular methods in a class automatically pass attribute as a argument as the first arguement. By convention, we call it "self". # class methods in a class automatically pass class as a arguement as the first arguement. By convention, we call it...
<filename>src/baselines/PACNet/task_semanticSegmentation/main.py """ Copyright (C) 2019 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). """ import argparse import os import time import math import random import glob from...
from __future__ import division import os import sys import time import random import string import numpy as np from scipy.optimize import root import zarr from numcodecs import LZ4, Blosc # ---------------------------------------------------- # enter parameters # units: Masses [solar masses] # Distances [km]...
from .shell import cast, call from .routers.linux import LinuxRouter from .routers.darwin import DarwinRouter from .routers.windows import WindowsRouter from .openers.linux import LinuxOpener from .openers.darwin import DarwinOpener from .openers.windows import WindowsOpener from . import observer as gigalixir_observer...
<filename>falmer/events/migrations/0006_auto_20170817_1119.py # -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-08-17 11:19 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields class Migration(migrations.Migrat...
from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import get_object_or_404, redirect, render from recipemaster.recipes.forms import CollectionForm, RecipeF...
# -*- coding: utf-8 -*- # # rtk.dao.RTKNSWC.py is part of The RTK Project # # All rights reserved. # Copyright 2007 - 2017 <NAME> andrew.rowland <AT> reliaqual <DOT> com """ =============================================================================== The RTKNSWC Table ==========================================...
import dgl import networkx as nx import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import pandas as pd import matplotlib.pyplot as plt path_object = 'data_dgl/object.csv' path_object_object = 'data_dgl/object-interact-object.csv' path_room = 'data_dgl/room.csv' path_room_object = 'da...
<reponame>kandouss/kamarl<gh_stars>1-10 import numpy as np import torch import tqdm from collections import namedtuple, defaultdict import random import gc import numba import pickle import gym import itertools def chunked_iterable(iterable, size): it = iter(iterable) while True: chunk = tuple(itertool...
from rest_framework.test import APITestCase, APIRequestFactory, force_authenticate from api.v2.views import PlatformTypeViewSet as ViewSet from api.tests.factories import UserFactory, AnonymousUserFactory, GroupFactory, PlatformTypeFactory from django.core.urlresolvers import reverse class GetListTests(APITestCase): ...
#!/usr/bin/env python3 import json import logging import os import os.path import sys import time import unittest from unittest.mock import MagicMock from unittest.mock import call import uuid import praw from praw.config import Config import prawcore import requests import scrape # I didn't know this before creatin...
<filename>fdm-devito-notebooks/01_vib/exer-vib/vib_undamped_verify_mms.py<gh_stars>1-10 import sympy as sym import numpy as np V, t, I, w, dt = sym.symbols('V t I w dt') # global symbols f = None # global variable for the source term in the ODE def ode_source_term(u): """Return the terms in the ODE that the sou...
"""Decorators and small standalone functions for api module""" import logging import urllib.parse from functools import wraps from typing import Sequence, Union, Iterable, Optional, List from collections.abc import Mapping import fnmatch import pandas as pd from iblutil.io import parquet import numpy as np import one...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Comparison functions for `astropy.cosmology.Cosmology`. This module is **NOT** public API. To use these functions, import them from the top-level namespace -- :mod:`astropy.cosmology`. This module will be moved. """ from __future__ import annotations...
from copy import deepcopy import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import utils # Used for Atari class Conv_Q(nn.Module): def __init__(self, frames, num_actions): super(Conv_Q, self).__init__() self.c1 = nn.Conv2d(frames, 32, kernel_size=8, stride=4) ...
""" Find modules used by a script, using bytecode analysis. Based on the stdlib modulefinder by <NAME> and <NAME>, but uses a graph data structure and 2.3 features """ from pkg_resources import require require("altgraph") import dis import imp import marshal import os import sys import new import struct import urlli...
import datetime as dt import matplotlib.dates as dates import matplotlib.pyplot as plt import pandas as pd import pylab from matplotlib import ticker from mplfinance.original_flavor import candlestick_ohlc from pandas import DataFrame import vnpy.analyze.data.data_prepare as dp import vnpy.analyze.view.view_util as v...
import json from base64 import b64encode import boto3 from prefect import Task from prefect.client import Secret from prefect.utilities.tasks import defaults_from_attrs class LambdaCreate(Task): """ Task for creating a Lambda function. Args: - function_name (str): name of the Lambda function to...
<reponame>LaudateCorpus1/PACE #!/usr/bin/env python """ 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,...
<gh_stars>0 from tests.integration.star_wars import star_wars_test_urls, \ STAR_WARS_TRIVIA_PART_2_DEFAULT_ANSWERS, \ STAR_WARS_TRIVIA_PART_3_DEFAULT_ANSWERS, \ STAR_WARS_TRIVIA_PART_1_DEFAULT_ANSWERS from tests.integration.star_wars.star_wars_tests import StarWarsTestCase class TestNavigation(StarWarsTes...
# SPDX-License-Identifier: BSD-3-Clause from platform import python_version from typing import Iterator, List, cast from softfab.FabPage import FabPage from softfab.Page import PageProcessor from softfab.packaging import dependencies, getDistribution from softfab.projectlib import getBootTime from softfab.timeview im...
from alambi import db, app from flask_login import UserMixin from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from itsdangerous import TimedJSONWebSignatureSerializer as Serializer import datetime migrate = Migrate(app, db) manager = Manager(app) manager.add_command('db',...
import numpy as np import os.path as path import datetime from keras.layers import Dense, LSTM, Input from keras.models import Model from keras.callbacks import TensorBoard from utils import print_sequence import dataset as ds from argparse import ArgumentParser def run(args): # Read the data from the corpus dire...
<reponame>jelic98/raf_pp from app.type import * from app.token import Token class Lexer(): def __init__(self, text): self.text = text self.pos = 0 def skip_whitespace(self): while self.pos < len(self.text) and self.text[self.pos].isspace(...
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appli...
<reponame>AllenInstitute/em_stitch<gh_stars>1-10 #!/usr/bin/env python ''' Converts metafiles to p->q collections. <NAME> 2019.02.15 ''' import argparse import glob import json import os import sys from enum import IntEnum # Position codes in metafile class Edge(IntEnum): INVALID = 0 CENTER = 1 # unuse...
import codecs import json import os import random import asyncio import re from cloudbot import hook from cloudbot.util import textgen nick_re = re.compile("^[A-Za-z0-9_|@|<|>|.\-\]\[\{\}]*$", re.I) def is_valid(target): """ Checks if a string is a valid IRC nick. """ if nick_re.match(target): retur...
from django.http import HttpResponse from django.db.models import Q from drf_yasg.utils import swagger_auto_schema from drf_yasg.openapi import Parameter, Schema, Response, TYPE_INTEGER, TYPE_OBJECT, TYPE_STRING, IN_QUERY from json import dumps from .. import models from .StudentsInformation import StudentsInformation...
# !/usr/bin/python """ Copyright ยฉ๏ธ: 2020 Seniatical / _-*โ„ข#7519 License: Apache 2.0 A permissive license whose main conditions require preservation of copyright and license notices. Contributors provide an express grant of patent rights. Licensed works, modifications, and larger works may be distributed under ...
from functools import partial import numpy as np class Covariance: def __init__(self, nol: int, alt: np.ma.MaskedArray): """assumed covariances :param no number of levels :param alt altitudes """ self.nol = nol self.alt = alt def gaussian(...
<filename>cyner/tner/checkpoint_versioning.py """ checkpoint versioning tool """ import os import hashlib import json import shutil import logging import requests from glob import glob __all__ = 'Argument' class Argument: """ Model training arguments manager """ def __init__(self, checkpoint_...
#!/usr/bin/python # # Copyright (c) 2017 <NAME>, <<EMAIL>> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ...
''' This module contains the handler for web requests pertaining to the list of oversubscribed modules. ''' from app import RENDER import web from components import model, session from components.handlers.fixed_module_mountings import Fixed from components.handlers.tentative_module_mountings import ...