text
stringlengths
6.04k
39.5k
from builtins import hex from builtins import object from functools import total_ordering import json import os import pbkdf2 from random import SystemRandom import shutil from uuid import UUID, uuid4 from Crypto.Cipher import AES # Crypto imports necessary for AES encryption of the private key from Crypto.Hash import...
#!/usr/bin/env python import numpy as np from numpy import pi, cos, sin, exp, conj import scipy.optimize from warnings import warn import epgcpmg as epg import time import sys from argparse import ArgumentParser import pickle import matplotlib.pyplot as plt class PulseTrain: def __init__(self, state_file, T, T...
''' * * LSM9DS1 class for python based on: * https://github.com/akimach/LSM9DS1_RaspberryPi_Library.git * * VERSION: 1.6 * - ADDED : Multithreading for faster performance * * KNOWN ISSUES: * - None ATM * * Author : <NAME> * Date : Nov. 21st, 2017 Year of Our Lord * Last Modified : Jan. 9th,...
# -*- coding: utf-8 -*- #MIT License #Copyright (c) 2017 <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, mod...
import numpy as np from ..Math import mmMath as mm # =============================================================================== # Reference : Appendix A of Momentum Control for Balance, SIGGRAPH 2009 # =============================================================================== def get_P(masses, posi...
#!/usr/bin/env python # # Author: <NAME> [tg at isi dot edu] # Created: 10/17/18 import torch import rtg from rtg import log, yaml, TranslationExperiment as Experiment, device, BatchIterable from rtg.module import NMTModel from rtg.utils import IO from rtg.module import criterion as criteria from abc import abstractm...
import re import os import functools from itertools import chain from datetime import date, datetime, timedelta import yaml from flask import current_app, Markup from veripress import cache from veripress.model.models import Page, Post, Widget from veripress.model.parsers import get_standard_format_name, get_parser f...
import errno import json import os import random import string import socket from concurrent.futures import ThreadPoolExecutor from collections import deque, namedtuple from datetime import datetime, timedelta from tornado import gen from tornado import ioloop from tornado.log import app_log from tornado.httpclient im...
"""Contains functionality for exposing behavior to the client. Members: ClientAPI -- Main class for underlying implementation of the client API. BaseContext -- Base class for exposed classes using Context system. GlobalContext -- Container class for global state available to Contexts. aut...
import matplotlib.pyplot as plt import seaborn as sns import torch.nn as nn import numpy as np import torch import os from collections import Counter from tasks import FreeRecall # from models import CRPLSTM as Agent from models import GRU as Agent from models import compute_a2c_loss, compute_returns from utils import...
from functools import reduce import logging import numpy as np import vaex.promise from .utils import (_ensure_strings_from_expressions, _ensure_string_from_expression, _ensure_list, _is_limit, _isnumber, _issequence, _is_string, _parse_reduction, _parse_n, _normalize_selection_na...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 2 14:24:25 2017 @author: ajaver """ from tierpsy.features.tierpsy_features.helper import get_n_worms_estimate, \ get_delta_in_frames, add_derivatives from tierpsy.features.tierpsy_features.events import get_event_stats, event_region_labels, ev...
import actions import logger import testutil import test_engine log = logger.Logger(__name__, logger.INFO) def _bulk_update(table_name, col_names, row_data): return actions.BulkUpdateRecord( *testutil.table_data_from_rows(table_name, col_names, row_data)) class TestDerived(test_engine.EngineTestCase): sampl...
'''Chats. ''' from utils import * from user import * from errors import ISkypeError class IChat(Cached): '''Represents a Skype chat. ''' def __repr__(self): return '<%s with Name=%s>' % (Cached.__repr__(self)[1:-1], repr(self.Name)) def _Alter(self, AlterName, Args=None): return sel...
import os import logging import sys from collections import OrderedDict import datetime import cartosql import requests import json # do you want to delete everything currently in the Carto table when you run this script? CLEAR_TABLE_FIRST = False # name of data directory in Docker container DATA_DIR = 'data' # Cart...
# -*- coding: utf-8 -*- """ tinys3.request_factory ~~~~~~~~~~~~~~~~~~~~~~ Generates Request objects for various S3 requests """ import datetime import mimetypes import os import requests # Python 2/3 compatibility try: from urllib import quote except ImportError: from urllib.parse import quote from .util ...
# -*- coding: utf-8 -*- ''' Folium Tests ------- ''' import json import mock import pandas as pd import nose.tools as nt import jinja2 from jinja2 import Environment, PackageLoader import vincent import folium from folium.six import PY3 def setup_data(): '''Import economic data for testing''' with open('us-c...
"""Abstract base class for detectors. FIXME[todo]: the detector interface seems to be somewhat inconsistent. Clean it! Example: from dltb.tool import Tool Tool['haar'].detect_and_show('examples/reservoir-dogs.jpg') detect_and_show from dltb.thirdparty.opencv.face import DetectorHaar detector = DetectorHaar() file...
import numpy as np import scipy.linalg as linalg from pyriemann.estimation import Covariances from pyriemann.utils.mean import mean_covariance from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.cross_decomposition import CCA from sklearn.utils.validation import check_is_fitted from .utils import filt...
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np import math def import_class(name): components = name.split('.') mod = __import__(components[0]) for comp in components[1:]: mod = getattr(mod, comp) return mod def conv_...
from transform import rescale, split_dim, crop_pad_to_bbox,\ combination_labels, remove_small_region import torch from pathlib import Path from tqdm import tqdm import nibabel as nib from utils import json_load, json_save import numpy as np import scipy.ndimage as ndi from transforms3d.affines import compose, deco...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import sys import os import tensorflow as tf import deepdish as dd import itertools as itr import numpy as np import datetime import glob import re from autocolorize.tensorflow.sparse_extractor import sparse_extractor from selfsup.util import DummyDict import time import functools import selfsup.model.resnet152_bn impo...
import os, json import pandas as pd import glob from csv_diff import load_csv, compare import datetime EXCLUSION_LIST=['package-list.json',".index.json",'package.json',"validation-summary","example"] def create_current_df(path): """ reads a csv in the specified folder, if it does not exists returns None ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import time import logging from google.appengine.ext import ndb from google.appengine.api import urlfetch import bitcoin from validators import validators as validator import BlockData.BlockData as BlockData from BlockLinker import BlockLinker as BlockLinker im...
import sys, os, glob, string import numpy as np import astropy as ast import matplotlib.pyplot as plt from pyraf import iraf import odi_config as odi import pandas as pd from astropy.coordinates import SkyCoord from astropy import units as u from collections import OrderedDict def find_sources_full(img,fwhm,bg_std,thr...
import json import re import time from itertools import chain import string import random from collections import Counter from residue.models import ResidueGenericNumberEquivalent from signprot.models import SignprotComplex from protein.models import Protein, ProteinSegment, ProteinFamily, ProteinGProteinPair from co...
# AnalogClock setup dialog # <NAME> <e.a.tacao |at| estadao.com.br> # http://j.domaindlx.com/elements28/wxpython/ # 15 Fev 2006, 22:00 GMT-03:00 # Distributed under the wxWidgets license. # Tags: phoenix-port import functools import wx import wx.lib.colourselect as csel from . import styles from .lib_setup...
import tensorflow as tf from tensorflow.keras import Model from tensorflow.keras.layers import Conv2D, Dense, Flatten, Concatenate, Input, AvgPool2D, Activation from tensorflow.keras.utils import get_custom_objects import numpy as np def myswish_beta(x): beta = tf.Variable(initial_value=1.0, trainable=True, name='...
#!/usr/bin/env python3 import sys import time import struct from enum import IntEnum, Enum class COMMAND_CODE(IntEnum): CONNECT = 0x01 SET_MTA = 0x02 DNLOAD = 0x03 UPLOAD = 0x04 TEST = 0x05 START_STOP = 0x06 DISCONNECT = 0x07 START_STOP_ALL = 0x08 GET_ACTIVE_CAL_PAGE = 0x09 SET_S_STATUS = 0x0C GE...
"""module irafutils.py -- general utility functions printCols Print elements of list in cols columns printColsAuto Print elements of list in the best number of columns stripQuotes Strip single or double quotes off string and remove embedded quote pairs csvSplit Split comma-separated ...
# MIT License # Copyright (c) 2021 <NAME> and <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, mer...
import pygame, sys, random, time from pygame.locals import * import pygame_textinput # Team 12 res_y = 1000 class Column: # Returns the x value for a column, draws lines on the screen def __init__(self, screen): self.screen = screen def getX(self, column): # Returns x value for given column ...
import pickle import timeit from collections import OrderedDict import os import sys sys.path.append(os.path.dirname(__file__)) import numpy as np from tqdm import tqdm from sklearn.svm import OneClassSVM from tensorflow.keras.applications.vgg16 import VGG16 from tensorflow.keras.applications.vgg16 import preprocess_i...
import argparse import importlib import models import os import tensorflow as tf import sys import h5py import numpy as np BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = BASE_DIR sys.path.append(BASE_DIR) # model sys.path.append('./utils') sys.path.append(os.path.join(ROOT_DIR, 'tf_ops/sampling')) f...
# T1 Plasti Element import numpy as np def Elmt_Init(): NoElementDim = 2 NoElementNodes = 3 NoElementHistory = 7 ElementDofNames = ["UX", "UY"] ElementMaterialNames = ["E", "nu", "y0", "kh"] ElementPostNames = ["UX", "UY", "SigMises", "a"] return NoElementDim, NoElementNodes, ElementDofNa...
from django.shortcuts import render from django.http import HttpResponseRedirect from django.urls import reverse from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from applications.globals.models import (Designation, ExtraInfo, ...
import logging import re import math import geohash # python-geohash package import googlemaps import numpy as np from geographiclib.geodesic import Geodesic from anyway.backend_constants import BE_CONST from anyway.models import NewsFlash from anyway.parsers import resolution_dict from anyway import secrets from anyw...
from collections.abc import Iterable from copy import deepcopy import gc import networkx as nx import numba from numba import jit import numpy as np import os import pandas as pd from scipy import sparse from sklearn.decomposition import TruncatedSVD import time import warnings from csrgraph.methods import ( _row_...
import random from PlayerClass import * def initPlayerCountries(player, amountOfInitialCountries, listOfCountries): for i in range(amountOfInitialCountries): country = input() while True: if searchInCountries(listOfCountries, country): if searchInCountries(player.count...
import random import numpy as np import pyx from pyx import * from pyx.graph import graphxy, axis, data from pyx.graph.axis import parter, painter, texter from pyx.graph.axis.tick import tick def read_dat(input_file, col_types, comment_chars = '#%@'): """Read data from a text file, returning a tuple of lists. ...
bl_info = { "name": "Point Cloud Loader", "author": "Short Notion (<NAME>)", "version": (0, 1), "blender": (2, 75, 0), "location": "View3D > T-panel > Object Tools", "description": "Generate point cloud from data files", "warning": "", "wiki_url": "", "tracker_url": "", "category...
# -*- coding: utf-8 -*- """Test suite for assets.""" import copy import pytest from axonius_api_client.constants import AGG_ADAPTER_ALTS, AGG_ADAPTER_NAME from axonius_api_client.exceptions import ApiError, NotFoundError from ...meta import FIELD_FORMATS, SCHEMA_FIELD_FORMATS, SCHEMA_TYPES from ...utils import get_s...
import numpy as np import matplotlib.pyplot as plt from skimage import filters, color, io, data, draw from skimage.exposure import histogram import skimage.segmentation as seg from skimage.filters import threshold_otsu, gaussian from skimage.color import rgb2gray from skimage.segmentation import active_contour from pa...
from __future__ import absolute_import, division, print_function, unicode_literals import Queue import logging import threading import time from collections import namedtuple from difflib import SequenceMatcher from functools import total_ordering from mopidy import audio, core from mopidy.audio import PlaybackSt...
############################################### #JH - 12/2017 #Problem Description: #Take a course plan in Excel format and extract the course outline #from the corresponding worksheet tabs. The information gathered will be used #to populate a PDF Course Outline file with the appropriate formatting. ############...
# # Copyright 2013 <NAME> # Copyright 2014-2017 Red Hat, Inc # # 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 applica...
""" RRT* path planner for a seven joint arm Author: <NAME> (mahyaret) """ import math import os import sys import random import numpy as np from mpl_toolkits import mplot3d import matplotlib.pyplot as plt sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../n_joint_arm_3d/") try: from N...
import math import numbers import random from PIL import Image, ImageOps from torchvision.transforms import functional as F from torchvision import transforms import numpy as np """ Most of codes here are from https://github.com/zijundeng/pytorch-semantic-segmentation/blob/master/utils/joint_transforms.py """ def p...
# -*- coding: utf-8 -*- from collections import defaultdict from cadnano.proxies.cnenum import StrandType, LatticeType from cadnano.part.refresholigoscmd import RefreshOligosCommand from cadnano import setBatch, getReopen, setReopen # from cadnano.color import intToColorHex from cadnano.part.nucleicacidpart import DEF...
from dku_idtb_decision_tree.node import Node, CategoricalNode, NumericalNode from dku_idtb_compatibility.utils import safe_str from collections import deque import pandas as pd class Tree(object): def __init__(self, target, target_values, features): self.target = target self.target_values = target...
import wavelink import re import itertools from async_timeout import timeout from discord.ext import commands from discord import Embed, Member, VoiceChannel, VoiceState from datetime import timedelta from asyncio import TimeoutError, Queue from os import environ from dotenv import load_dotenv from pymongo im...
''' Multipoint communication service protocol (T.125) ''' import logging import ptypes from ptypes import * from protocol import gcc, ber, per ptypes.setbyteorder(ptypes.config.byteorder.bigendian) ### MCS protocol data (BER Encoding) class Protocol(ber.Protocol.copy(recurse=True)): pass class Element(ber.Eleme...
#!/usr/bin/env python # -*- coding: utf-8 -*- ########################################################################## # Official Evaluation Script for Semeval2016 Task9 Chinese Semantic Dependency Parsing # # Version : 1.1 # # Author :...
""" Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. """ import argparse import copy import datetime import os import time import numpy as np import pandas as pd import rasterio import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from ...
# Copyright 2020 DeepMind Technologies Limited. # # 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 ag...
from __future__ import print_function from __future__ import division import torch import torch.nn as nn from torch.optim import * from loss import * import torch.nn.functional as F from torch.nn.utils import clip_grad_norm_ import torch.utils.model_zoo as model_zoo from dataset import get_dataloaders_generated_data ...
# Copyright (c) 2013 Mirantis Inc. # # 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 writi...
import json import math import os from pathlib import Path from tempfile import NamedTemporaryFile import csv import librosa import numpy as np import sox import pandas as pd import torch from torch.utils.data import Dataset, Sampler, DistributedSampler, DataLoader import torchaudio from deepspeech_pytorch.configs.tra...
import math import pytest import numpy as np from verifai.features import * ### Utilities def checkFlattening(domain, point, expectedLength=None, coordsAreNumeric=None): flat = domain.flatten(point) assert type(flat) is tuple assert len(flat) == domain.flattenedDimension if expectedLength is not Non...
# -*- coding: utf-8 -*- import torch import torch.onnx import torch.onnx.symbolic_helper import torch.onnx.utils import torch.nn as nn import numpy as np from collections import OrderedDict from . import register from . import mask_utils from . import function_module from typing import Dict, List from torchpruner.op...
import math import os import re from pathlib import Path from coaches.world_objects_coach import WorldViewCoach, PlayerViewCoach from configurations import DRIBBLE_OR_PASS_STRAT_PREFIX, DRIBBLE_INDICATOR, PASS_INDICATOR, GOALIE_MODEL_TEAMS, \ STAMINA_MODEL_TEAMS, DRIBBLE_OR_PASS_TEAMS from geometry import Coordina...
import re # used to get info from frd file import os import sys import subprocess # used to check ccx version from enum import Enum, auto from typing import List, Tuple, Type import logging from ..bc import BoundaryCondition from ..core import MeshSet, ElementSet, SurfaceSet, NodeSet, Connector from ..loadcase impor...
""" [1] <NAME>, <NAME>, and <NAME>. 2019. FiBiNET: Combining Feature Importance and Bilinear Feature Interaction for Click-through Rate Prediction. In ACM Conference on Recommender Systems (RecSys). 169--177. """ import sys import os sys.path.insert(0, os.path.abspath('..')) from typing import List, Tuple,...
"""! @brief ConvTasnet implementation copied from: https://github.com/kaituoxu/Conv-TasNet/blob/master/src/conv_tasnet.py @author <NAME> {<EMAIL>} @copyright University of Illinois at Urbana-Champaign """ import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import num...
from machine import UART import utime as time # This hashmap collects all generic AT commands CMDS_GENERIC = { 'TEST_AT': b'AT', 'RESET': b'AT+RST', 'VERSION_INFO': b'AT+GMR', 'DEEP_SLEEP': b'AT+GSLP', 'ECHO': b'ATE', 'FACTORY_RESET': b'AT+RESTORE', 'UART_CFG_DEF': b'AT+UART_DEF=9600,8,1,0,...
from django.shortcuts import redirect from rest_framework.views import APIView from requests import Request from rest_framework import status from rest_framework.response import Response from .credentials import * from requests import post from .util import * import base64 class AuthURL(APIView): def get(self, re...
from __future__ import annotations from baywatch.bay import Bay from baywatch.config_control import ConfigUpdateForm, Configuration from baywatch.version import __version__ import rich from rich.panel import Panel from rich.align import Align from rich.console import RenderableType from rich.text import Text from ric...
'''Pytorch training procedure for the FashionMNIST Usage: %(prog)s [--no-cuda] [--json-path=<path>] [--skip-tst-dataset] [--seed=<int>] %(prog)s (--help | -h) Options: --seed=<int> random seed [default: 1] --json-path=<path> ...
''' Mutation functions ''' from random import randint, choice from genetic_algorithm.GLOBAL import ( get_note_timing, get_scale_notes, allowed_melody_octaves, allowed_chord_octaves, max_note_divisor, remove_note_timing, get_note_abs_index, min_notes, get_triad_distances, get_key_...
import tvm from tvm import relay from . import layers from .init import create_workload, QuantizeInitializer def residual_unit_v1(data, input_channels, num_filter, stride, dim_match, name, bottle_neck=True, ...
# coding=utf-8 """Shared utility functions""" import collections import os import re import subprocess import sys import threading import unicodedata from typing import Any, BinaryIO, Iterable, List, Optional, TextIO, Union from wcwidth import wcswidth from . import constants def strip_ansi(text: str) -> str: ...
import discord from discord.ext import commands from discord_components import DiscordComponents, Button, ButtonStyle, InteractionType #The bot was coded by _NooberrUwU#6969. #Do not change any code line in here. #To change the config of the bot (such as TOKEN, PREFIX,...), change them in ./data/config.json #Any error...
"""Collection Class amd Child Classes Implementation.""" import glob import logging import os import spiceypy from ..utils import et_to_date from ..utils import extension_to_type from .log import error_message from .product import PDS3DocumentProduct class Collection(object): """Class to generate a PDS4 Collect...
import binascii import cgi import json import os import subprocess import urllib.parse import webbrowser import requests import sublime import sublime_plugin from Default.paragraph import expand_to_paragraph Settings = None class ValeFixCommand(sublime_plugin.TextCommand): """Applies a fix for an alert. "...
#!/usr/bin/env python ## <NAME> ## CDC ## <EMAIL> ## https://github.com/jvhagey/ ## 2021 ## written in python3 from numpy import * import os, re, glob, shutil import pandas as pd from argparse import ArgumentParser import subprocess # set colors for warnings so they are seen CRED = '\033[91m' + '\nWarning:' CYEL = '...
import datetime from httplib import FORBIDDEN from django.contrib.auth.decorators import login_required from django.contrib import messages from django.core.exceptions import FieldDoesNotExist from django.core.mail import send_mass_mail from django.core.urlresolvers import reverse from django.db.models import Q from d...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ /* This file is part of Bohrium and copyright (c) 2018 the Bohrium <http://www.bh107.org> Bohrium is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either v...
# coding: utf-8 """ This module contains event manager for MacOS platform. """ from __future__ import absolute_import # Standard imports import sys from traceback import format_exc # External imports from AppKit import NSDate from AppKit import NSEvent from AppKit import NSProcessInfo import Quartz # Local imports f...
import argparse import math import os import shutil import sys from pathlib import Path import cv2 import numpy as np import pandas as pd import torch from moviepy.editor import ImageSequenceClip from skimage import io from torchvision import transforms from tqdm.auto import tqdm from dataloading.nvidia import Nvidia...
""" Neuraxle's AutoML Classes ==================================== Classes used to build any Automatic Machine Learning pipelines. Hyperparameter selection strategies are used to optimize the hyperparameters of given pipelines. .. Copyright 2022, Neuraxio Inc. Licensed under the Apache License, Version 2.0 (t...
#!/usr/bin/env python3 import sys, os, subprocess, argparse, shutil, urllib import logging import json ############# #Global configurations for build base_dir = os.environ['PWD'] + "/" build_dir = base_dir + 'build/' rootfs_dir = base_dir + 'rootfs_overlay' cdn_dir = base_dir + 'CDN' ver_file = cdn_dir + 'versio...
""" Semantic Segmentation system. """ import copy import functools import glob import collections from datetime import datetime from os.path import join, isdir, split, exists, isdir from os import makedirs import numpy as np from PIL import Image # from skimage.transform import resize as skimage_resize from estimator....
# import numpy as np from number_objects.primitives.polycalc_numbers import Rational, Integer from number_objects.primitives.vector import Vector # Todo: Cholesky decomposition, singlular value decomposition, eigen values class Matrix(list): def __float__(self): assert self.shape == (1, 1) retur...
import math import os import re import time import ffmpeg import numpy as np from ffmpeg import Error from matplotlib import mlab from matplotlib import pyplot as plt from scipy.signal import find_peaks ffmpeg_cmd = 'bin/ffmpeg.exe' class VideoMontageConfig: def __init__(self, input_dir, ...
import glob import random import copy from abc import ABC, abstractmethod from collections import OrderedDict from typing import List, Tuple, Union, Callable, Dict, Type import numpy as np import cairo from PIL import Image, ImageDraw import imageio import imgaug as ia import imgaug.augmenters as iaa from .layout imp...
import os import warnings import torch.backends.cudnn as cudnn warnings.filterwarnings("ignore") from datetime import datetime from torch.utils.data import DataLoader from decaps import CapsuleNet from torch.optim import Adam import numpy as np from config import options import torch import torch.nn.functional as F fro...
import asyncio from asyncio import QueueEmpty, StreamReader, StreamWriter from collections import defaultdict import functools import itertools import logging from pathlib import Path import pickle import time import traceback from typing import ( # noqa: F401 Any, AsyncGenerator, AsyncIterable, AsyncI...
from django.core import exceptions, validators from django.db import models from django.apps import apps from django.core.exceptions import FieldDoesNotExist from django.db.models.fields.related import ForeignKey from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor from django import forms...
import csv import os import sys from datetime import datetime, timedelta from functools import wraps import numpy as np if os.getenv("FLEE_TYPE_CHECK") is not None and os.environ["FLEE_TYPE_CHECK"].lower() == "true": from beartype import beartype as check_args_type else: def check_args_type(func): @w...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
"""Parsers for pw.x output.""" import re from pathlib import Path from typing import ( Any, Dict, Generic, Iterable, List, Mapping, Match, MutableMapping, Optional, Pattern, Sequence, Tuple, TypeVar, Union, ) import numpy as np from pwproc.geometry import Basis...
import numpy as np import tensorflow as tf import edward as ed import _pickle # TODO figure out seed # TODO hyperparam search def save_graph_parameters(file): sess = ed.get_session() trained_vars = [] for var in tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES): trained_vars.append(sess.run(var)...
# (C) Copyright 2020 by <NAME> # # 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...
from Ikarus.objects import * from Ikarus.strategies.StrategyBase import StrategyBase import asyncio from binance import AsyncClient from datetime import datetime import json from Ikarus import binance_wrapper, performance, strategy_manager, analyzers, observers, mongo_utils from Ikarus.enums import * from Ikarus.utils ...
"""Unit tests for classes implemented in cygraph/graph.pyx """ import os import pickle import numpy as np import pytest import cygraph as cg def test_constructor(): """Tests initialization of a StaticGraph and DynamicGraph objects. """ graphs = [] # Smoke tests. cg.graph() vertex_lists = ...
# coding: utf-8 """ Adapters """ from __future__ import print_function, division, absolute_import import sys import re from collections import defaultdict from cutadapt import align, colorspace from cutadapt.seqio import ColorspaceSequence, FastaReader # Constants for the find_best_alignment function. # The function i...
from PDFObjectsParser import * import pytest from utils import ObjectIter class TestArray: def test_simple(self): simple1 = b"[1 2 3 4 5]" simple2 = b"[1 2 0 R]" simple3 = b"[15 0 R]" simple4 = b"[ 484 9874 618 798]" simple5 = b"[/Train (KEY) (Len(Pi))]" simple6 = b...
#!/usr/bin/env python # encoding: utf-8 """ Executes commands to get status information from AFQM server processes """ import sys import argparse import zmq import operator try: from afqueue import queue_config as config except ImportError: from afqueue.config_files import queue_config_base as config from af...
import numpy as np import scipy.stats as ss import os import logging from sklearn.utils import check_random_state import torch from torch.utils.data import Dataset import ada.utils.experimentation as xp from ada.datasets.dataset_access import DatasetAccess def shift_data(x_in, ti=None, ri=None, si=None): """ ...