text
stringlengths
2
999k
# Copyright 2015 The TensorFlow 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 required by applica...
#!/usr/bin/env vpython # -*- coding: UTF-8 -*- # # Copyright 2021 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. """ Asserts that expected and generated list of GRD files is equal. """ import sys import json def main(ar...
# Copyright (c) OpenMMLab. All rights reserved. from typing import Any, Dict, Optional, Sequence, Tuple, Union import mmcv import numpy as np import torch from torch.utils.data import Dataset from mmdeploy.codebase.base import BaseTask from mmdeploy.utils import Task, get_input_shape from .mmsegmentation import MMSEG...
from Crypto.PublicKey import RSA key = RSA.generate(2048) private_key = key.export_key() file_out = open("private.pem", "wb") file_out.write(private_key) public_key = key.publickey().export_key() file_out = open("receiver.pem", "wb") file_out.write(public_key)
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 3.1.4. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ f...
""" This file offers the methods to automatically retrieve the graph Flagellimonas eckloniae. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, title={STRING v11: protein--protei...
# -*- coding: UTF-8 -*- """ This file is part of SENSE. (c) 2016- Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE file """ from distutils.core import setup # use distutils as this allows to build extensions in placee import os # import glob import numpy as np import json # from setuptoo...
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
''' Data preparation and feature extraction of arXiv dataset available at https://www.kaggle.com/neelshah18/arxivdataset ''' import argparse import beautifultable as bt from bert_serving.client import BertClient import collections from gensim.models import Word2Vec import pandas as pd import networkx as nx import nump...
#! /usr/bin/env python """Calculate vector divergence and related quantities at nodes or cells.""" import numpy as np from landlab.utils.decorators import use_field_name_or_array @use_field_name_or_array('link') def calc_flux_div_at_node(grid, unit_flux, out=None): """Calculate divergence of link-based fluxes at...
VBA = \ r''' Function IsAdmin() On Error Resume Next CreateObject("WScript.Shell").RegRead("HKEY_USERS\S-1-5-19\Environment\TEMP") if Err.number = 0 Then IsAdmin = True else IsAdmin = False end if Err.Clear On Error goto 0 End Function Function GetComputerName() Set ...
import csv from torch.utils.data import Dataset, DataLoader import numpy as np from base.torchvision_dataset import TorchvisionDataset import torchvision.transforms as transforms from .preprocessing import get_target_label_idx import torch from torch.utils.data import Subset class CreditFraud_Dataset(TorchvisionDatase...
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-2020 Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram 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...
from flask import Blueprint gpx2tcx = Blueprint('gpx2tcx', __name__, template_folder='../templates', static_folder='../static')
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems This module is developed by: Yalin Li <zoe.yalin.li@gmail.com> This module is under the University of Illinois/NCSA Open Source License. Please refer to https://github.com/QSD-G...
import typing from functools import partial from delira.models.backends.chainer import AbstractChainerNetwork from delira.data_loading import BaseDataManager from delira.training.base_experiment import BaseExperiment from delira.utils import DeliraConfig from delira.training.backends.chainer.utils import create_optim...
# -*- coding: utf-8 -*- """ Created on Mon Jul 31 15:41:28 2017 @author: Aman Kedia """ # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Churn_Modelling.csv') X = dataset.iloc[:, 3: 13].values y = dataset.iloc[:, 13].value...
from base import BaseTest import requests import json class Test(BaseTest): def test_root(self): """ Test / http endpoint """ self.render_config_template( ) proc = self.start_beat(extra_args=["-E", "http.enabled=true"]) self.wait_until(lambda: self.log_co...
"""Functions related to getting soundcloud data.""" import requests def get_track_info(url): """ Get the track info of the passed URL. """ _client_ID = 'LvWovRaJZlWCHql0bISuum8Bd2KX79mb' api = "http://api.soundcloud.com/resolve.json?url={}&client_id={}" URL = api.format(url, _client_ID) r...
""" Django settings for app project. Generated by 'django-admin startproject' using Django 3.2.5. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathlib imp...
from __future__ import print_function import sys import json import argparse import pyjq import os.path from shared.nodes import Account, Region from shared.common import parse_arguments, query_aws from os import listdir __description__ = "Cross-reference EC2 instances with AMI information" def log_warning(msg): ...
# -*- coding: utf-8 -*- ''' Support for Portage :optdepends: - portage Python adapter For now all package names *MUST* include the package category, i.e. ``'vim'`` will not work, ``'app-editors/vim'`` will. ''' from __future__ import absolute_import # Import python libs import copy import logging import re # Imp...
# Copyright (c) 2015,2016,2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Tests for the `skewt` module.""" import matplotlib from matplotlib.gridspec import GridSpec import matplotlib.pyplot as plt import numpy as np import pytest from metpy...
# Comment import sys import time def foobar(string, count=10, sleep=False): """ Docstring for the method. """ string = str(string) count = int(count) for i in range(count): print(string) if sleep: time.sleep(1)
import os import glob import pytest import pdb from VCF.VcfUtils import VcfUtils # test_VcfUtils.py @pytest.fixture def vcf_object(bcftools_folder, bgzip_folder, gatk_jar_folder, datadir): """Returns a VcfUtils object""" vcf_file = "{0}/test.vcf.gz".format(datadir) vcflist = ['test.vcf.gz','test1.vcf.gz...
""" Copyright (c) 2022 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W...
""" ============= ============= """ import importlib import os import sys import click from . import ff, with_appcontext, app def get_migrations_root(migrations_root): migrations_root = migrations_root or os.path.join( os.environ.get('FANTASY_MIGRATION_PATH', os.environ['FANTASY...
def get_db_cols(cur, table_name, schema='public', type_map=True): """ Gets the column names of a given table if type_map is true, returns also a dictionary mapping each column name to the corresponding postgres column type """ db_cols_sql = """SELECT column_name, data_type FROM in...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from ast import literal_eval from odoo import fields, models, _, api from odoo.exceptions import UserError from odoo.fields import Datetime _logger = logging.getLogger(__name__) class Employee(models.A...
import typing from .. import exceptions from ..protocol import Protocol, Request, SuccessResponse, ErrorResponse PARSE_ERROR_CODE = -32700 INVALID_REQUEST_CODE = -32600 METHOD_NOT_FOUND_CODE = -32601 INVALID_PARAMS_CODE = -32602 INTERNAL_ERROR_CODE = -32603 MIN_VALID_SERVER_ERROR_CODE = -32099 MAX_VALID_SERVER_ERROR...
import peewee as pw import pytest from muffin_peewee import Plugin as Peewee, JSONField @pytest.fixture(scope='module') def aiolib(): return 'asyncio', {'use_uvloop': False} @pytest.fixture(scope='session', autouse=True) def setup_logging(): import logging logger = logging.getLogger('peewee') logge...
from .uri import URI, URIError from .header import Header __author__ = 'Terry Kerr' __email__ = 't@xnr.ca' __version__ = '0.3.1'
''' Model Evaluation script. The evaluation strategy here is to show the prediction class of an image as an input image path is provided. Therefore, there is no need to use the DataLoader class to load the data. However, if you wish you evaluate in batches, use the LoadDataset class from load_data.py and DataLoader cla...
# -*- coding: utf-8 -*- """Testing dirstack""" #from __future__ import unicode_literals, print_function from contextlib import contextmanager from functools import wraps import os import os.path import subprocess import builtins import pytest from xonsh import dirstack from xonsh.environ import Env from xonsh.built_i...
# -*- coding: utf-8 -*- # pylint: disable=C0103 # pylint: disable=C0111 import ustruct import uctypes from ubinascii import hexlify, unhexlify from micropython import const """ SCO handle is 12 bits, followed by 2 bits packet status flags. 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 -----------------------------...
from pyotp.otp import OTP import urllib class HOTP(OTP): def at(self, count): """ Generates the OTP for the given count @param [Integer] count counter @returns [Integer] OTP """ return self.generate_otp(count) def verify(self, otp, counter): ...
import os import pytest import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') def test_directories(host): dirs = [ '/DATA', '/DATA/docker', '/DATA/fluentd', '/DATA/grafana'...
# -*- coding: utf-8 -*- # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # # SPDX-License-Identifier: MIT import os import sys sys.path.insert(0, os.path.abspath("..")) # -- General configuration ------------------------------------------------ # Add any Sphinx extension module names here, as strings...
# # Copyright 2019 The FATE 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 required by appli...
""" Copyright 2015 Rackspace 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, software dist...
from node.blockchain.inner_models import Node def make_node(node_key_pair, addresses): return Node( identifier=node_key_pair.public, addresses=addresses, fee=4, )
import logging import os import sys import time import traceback from dials.util import Sorry from dials.util.version import dials_version from libtbx import group_args import xia2.Driver.timing import xia2.Handlers.Streams import xia2.XIA2Version from xia2.Applications.xia2_helpers import process_one_sweep from xia2....
"""Aggregation function for CLI specified options and config file options. This holds the logic that uses the collected and merged config files and applies the user-specified command-line configuration on top of it. """ import argparse import configparser import logging from typing import Optional from typing import S...
from typing import Any, Optional, Sequence, Union import dagster._check as check from ..execution.execute_in_process_result import ExecuteInProcessResult from ..execution.with_resources import with_resources from ..instance import DagsterInstance from ..storage.fs_io_manager import fs_io_manager from .assets import A...
''' agent_exclusions ================ The following methods allow for interaction into the Tenable.io :devportal:`agent exclusions <agent-exclusions>` API endpoints. Methods available on ``tio.agent_exclusions``: .. rst-class:: hide-signature .. autoclass:: AgentExclusionsAPI .. automethod:: create .. autom...
# Copyright 2019 Graphcore Ltd. import os from urllib import request import tarfile import subprocess import tempfile cifar10_data_dir = None def download_cifar(): """Download the CIFAR-10 dataset if it's not already available.""" DATA_URL = 'https://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz' dir...
# License: BSD 3-Clause from collections import OrderedDict import pickle import time from typing import Any, IO, TextIO, List, Union, Tuple, Optional, Dict # noqa F401 import os import arff import numpy as np import openml import openml._api_calls from openml.base import OpenMLBase from ..exceptions import PyOpenM...
# -*- coding: utf-8 -*- import sys def translate(seq): geneticCode = { 'UUU':'F', 'UUC':'F', 'UUA':'L', 'UUG':'L', #UU 'UCU':'S', 'UCC':'S', 'UCA':'L', 'UCG':'L', #UC 'UAU':'Y', 'UAC':'Y', 'UAA':'ST', 'UAG':'ST', #UA 'UGU':'C', 'UGC':'C', 'UGA':'ST', 'UGG':'W', #UG 'CUU':'L', 'CUC':'L', 'CUA':'L', 'CUG':'L'...
import requests from collections import OrderedDict from ..exceptions import ElevationApiError from ..geometry import Point, LineString def elevation(path, api_key=None, sampling=50): """ Google elevation API backend """ url = 'https://maps.googleapis.com/maps/api/elevation/json' params = {} ...
from internal import *
import argparse import numpy as np from sklearn.cluster import KMeans from sklearn.preprocessing import normalize import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.optim import Adam import utils from model import GAT from evaluation import eva de...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019-2020 Fortinet, Inc. # # 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 3 of th...
# third party from flask_sockets import Sockets from main import ws from nacl.encoding import HexEncoder from nacl.signing import SigningKey # grid relative from ..routes import association_requests_blueprint from ..routes import dcfl_blueprint from ..routes import groups_blueprint from ..routes import mcfl_blueprint ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
# backup-1.py import os #==================================================================== cwd = os.getcwd() prefix = cwd.split('/')[-1] # get current folder's name; not all stuff leading to it # visit the current directory and every one within it, recursively for dir_listing in os.walk(cwd): here = dir_li...
import sys sys.path.append("..") import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Parameter import utils from metrics import calculate_kl as KL_DIV import config_bayesian as cfg from ..misc import ModuleWrapper class BBBLinear(ModuleWrapper): def __init__(...
#!/usr/bin/env python # -*- coding: utf-8 -*- #### s09_check_chrom1.py #### made by Min-Seok Kwon #### 2020-01-21 09:55:02 ######################### import sys import os SVRNAME = os.uname()[1] if "MBI" in SVRNAME.upper(): sys_path="/Users/pcaso/bin/python_lib" elif SVRNAME == "T7": sys_path="/ms1/bin/python_li...
import os import pytest from dvc.output import base def test_stage_cache(tmp_dir, dvc, mocker): tmp_dir.gen("dep", "dep") tmp_dir.gen( "script.py", ( 'open("out", "w+").write("out"); ' 'open("out_no_cache", "w+").write("out_no_cache")' ), ) stage = dvc...
from setuptools import setup setup(name='scattering', version='0.0', description='Compute scattering functions', url='http://github.com/mattwthompson/scattering', author='Matthew W. Thompson', author_email='matt.thompson@vanderbilt.edu', license='MIT', packages=['scattering'],...
import numpy as np import numpy import math import logging logger = logging.getLogger(__name__) # Set reasonable precision for comparing floats to zero. Originally the multiplier was # 10, but I needed to set this to 1000 because some of the trimesh distance methods # do not see as accurate as with primitive shapes....
# # Copyright 2019 Delphix # # 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, so...
"""The tests for the Remote component, adapted from Light Test.""" # pylint: disable=protected-access import unittest import homeassistant.components.remote as remote from homeassistant.const import ( ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_OFF, STATE_ON, ) fro...
"""Main custom_json op handler.""" import logging from funcy.seqs import first, second from hive.db.adapter import Db from hive.db.db_state import DbState from hive.indexer.accounts import Accounts from hive.indexer.posts import Posts from hive.indexer.feed_cache import FeedCache from hive.indexer.follow import Follo...
import pytest from pywps import Service from pywps.tests import assert_response_success from .common import TESTDATA, client_for, CFG_FILE # from flyingpigeon.processes import IndicessingleProcess @pytest.mark.skip(reason="no way of currently testing this") def test_wps_indices_simple(): client = client_for(Ser...
# (C) StackState 2020 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os import jsonpickle as jsonpickle try: from unittest.mock import patch except ImportError: from mock import patch from stackstate_checks.base.stubs import topology from stackstate_checks.cloudera im...
# Jacob Gildenblat, 2015 # Implementation of edge preserving smoothing by minimizing with the Ambrosio-Tortorelli appoach # AM scheme, using conjugate gradients import cv2, scipy import numpy as np import sys import scipy from scipy.sparse.linalg import LinearOperator class AmbrosioTortorelliMinimizer(): def __in...
from django.db import models from django.utils import timezone from data_refinery_common.models.computed_file import ComputedFile from data_refinery_common.models.managers import PublicObjectsManager # Compendium Computational Result class CompendiumResult(models.Model): """ Computational Result For A Compendium...
import logging import os import time from application import Exponentiator from utility import get_service_name log = logging.getLogger(__name__) ENVIRONMENT_SLEEP_DURATION_KEY = 'SLEEP_DURATION' class DaemonApp: def __init__(self): self.exponentiator = None def setup(self, application_name): ...
import random import os import ConfigParser import time import subprocess from tumblpy import Tumblpy from make_gifs import make_gif, check_config config = ConfigParser.ConfigParser() config.read("config.cfg") config.sections() slugs = check_config("config.cfg")[3] CONSUMER_KEY = config.get("tumblr", "consumer_key")...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from .config import * from .experiment import Experiment from .nni_client import *
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-28 03:43 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('job_board', '0006_siteconfig_remote'), ] operations = [ migrations.AlterFie...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Box decomposition algorithms. References .. [Lacour17] R. Lacour, K. Klamroth, C. Fonseca. A box decomposit...
# coding: utf-8 from enum import Enum from six import string_types, iteritems from bitmovin_api_sdk.common.poscheck import poscheck_model class H262PresetConfiguration(Enum): XDCAM_HD_422 = "XDCAM_HD_422"
from multiprocessing import Process, Event from termcolor import colored from .helper import set_logger class BertHTTPProxy(Process): def __init__(self, args): super().__init__() self.args = args self.is_ready = Event() def create_flask_app(self): try: from flask...
""" semi-automation of google search for information """ import webbrowser as wb from time import sleep # from bs4 import BeautifulSoup # import requests foods = [ 'egg', 'avocado', 'spinach', 'peanut', 'cheese', 'brocoli', 'chicken', 'mayonnaise', 'salmon', 'tuna', 'tomat...
# coding: utf-8 import re import six from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class DatabaseForCreation: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The ke...
from os import walk, sep, pardir from os.path import split, join, abspath, exists, isfile from glob import glob import re import random from sympy.core.compatibility import PY3 # System path separator (usually slash or backslash) to be # used with excluded files, e.g. # exclude = set([ # "%(sep...
#!/bin/env python # -*- coding: utf-8 -*- """ Copyright 2020-present Works Mobile Corp. 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 requir...
import json from django.core.urlresolvers import reverse from seaserv import seafile_api from seahub.test_utils import BaseTestCase from seahub.share.models import ExtraSharePermission class Shares(BaseTestCase): def setUp(self): self.repo_id = self.repo.id self.group_id = self.group.id ...
from demopy.pyglet.preferences import load_user_pref from demopy.pyglet.resource import load_resource g_caption = 'Tank 2021' g_user_pref = load_user_pref() g_resource = load_resource()
import setuptools with open("README.md", "r") as file_header: long_description = file_header.read() setuptools.setup( name="new-template-USERNAME", version="", author="", author_email="", description="", long_description=long_description, long_description_content_type="text/markdown", ...
from dash import dcc import dash_bootstrap_components as dbc from dash import html from constants import * files_location = dcc.Upload( id="upload", children=[ 'Drag and Drop or ', html.A('Select a File') ], multiple=False, style={ 'width': '100%', 'height': '60px',...
from collections import OrderedDict import gym import logging import re import tree # pip install dm_tree from typing import Dict, List, Optional, Tuple, Type, TYPE_CHECKING, Union from ray.util.debug import log_once from ray.rllib.models.tf.tf_action_dist import TFActionDistribution from ray.rllib.models.modelv2 imp...
import os import tkinter as tk import tkinter.scrolledtext as tkscrolled import tkinter.filedialog as tkfd from src.utilities.matdis.prime_op import is_prime from src.cryptography import elgamal class ResultPageFrame(tk.Frame): def __init__(self, master, title, process_time, plaindir, cipherdir): tk.Frame...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------------------------------------...
import matplotlib.pyplot as plt import numpy as np def load_planar_dataset(): np.random.seed(2) m = 400 # number of examples N = int(m/2) # number of points per class D = 2 # dimensionality X = np.zeros((m,D)) # data matrix where each row is a single example Y = np.zeros((m,1), dtype='uint8') ...
# -*- coding: utf-8 -* from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np import utool as ut import ubelt as ub import functools # NOQA from six import next from six.moves import zip, range def safe_vstack(tup, default_shape=(0,), default_dtype=np.float): """ st...
from Simulador import Simulador import math import pandas as pd # d = pd.read_pickle('C:/Users/Eduar/Documents/GitHub/Trabalho_final_estatistica_cd/dados/simulacoes_chance_30%.pkl') # d.to_csv(r'C:/Users/Eduar/Documents/GitHub/Trabalho_final_estatistica_cd/dados/simulacoes_chance_30%.txt', sep=' ', index=False) # d = ...
# Generated by Django 3.2.8 on 2021-11-18 08:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('userprofile', '0001_initial'), ] operations = [ migrations.AddField( model_name='profile', name='username', ...
## seq2seq 做数学题 import torch from tqdm import tqdm import torch.nn as nn from torch.optim import Adam import numpy as np import os import json import time import glob import bert_seq2seq from torch.utils.data import Dataset, DataLoader from bert_seq2seq.tokenizer import Tokenizer, load_chinese_base_vocab from bert_se...
from .backends import GraphQLFilterBackend from .mixins import FilterMixin
# Copyright (c) 2019 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 required by app...
"""Classes representing lines.""" from __future__ import print_function, division, absolute_import import copy as copylib import numpy as np import skimage.draw import skimage.measure import cv2 from .. import imgaug as ia from .base import IAugmentable from .utils import (normalize_shape, project_coords, interpolat...
#!/usr/bin/env python3 # vi:nu:et:sts=4 ts=4 sw=4 """ Perform various automated code reviews on the source. The module must be executed from the repository that contains the Jenkinsfile. """ # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, u...
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-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...
# -*- coding: utf-8 -*- """ Functionality to generate and work with the directory structure of a project """ from __future__ import absolute_import, print_function import os from os.path import exists as path_exists from os.path import join as join_path from . import templates, utils from .contrib.six import string_t...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the fake file system implementation.""" import unittest from dfvfs.path import fake_path_spec from dfvfs.resolver import context from dfvfs.vfs import fake_file_system from tests import test_lib as shared_test_lib class FakeFileSystemTest(shared_test_lib.B...
import matplotlib.pyplot as plt from numpy import pi, exp from ....Classes.Arc1 import Arc1 from ....Classes.LamSlot import LamSlot from ....Classes.Segment import Segment from ....definitions import config_dict from ....Functions.Plot import ( ARROW_COLOR, ARROW_WIDTH, MAIN_LINE_COLOR, MAIN_LINE_STYLE...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division import logging from contextlib import closing from functools import partial from ratelimiter import RateLimiter from requests import Session from .query import SpaceTrackQueryBuilder, SUPPORTABLE_ENTITIES class SpaceTrackApi(object): def...
import pandas as pd from my_lambdata.ds_utilities import enlarge, get_business_info def test_business_info(): test_df = get_business_info('fast food', 'denver', 'FL') assert len(test_df.iloc[0]['Phone_No']) >= 10 def test_elarge(): assert enlarge(3) == 300