text
stringlengths
2
999k
# coding=utf-8 from smartnet.optims import * from smartnet.layers import * import smartnet as sn import unittest class OptimTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass @classmethod def setUpClass(cls): print("optim test begins.") @classmethod ...
# Generated by Django 2.2.4 on 2019-08-03 08:31 from django.db import migrations, models import users.models class Migration(migrations.Migration): dependencies = [ ('users', '0006_auto_20190803_0830'), ] operations = [ migrations.AlterField( model_name='customuser', ...
################################################################################# # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # # # Licensed under the Apache License, Version 2.0 (the "License"). ...
import regex import argparse import requests import time import os import threading import random execPath = os.getcwd() currentPath = os.path.dirname(__file__) os.chdir(currentPath) FUZZ_PLACE_HOLDER = '??????' TIMEOUT_DELAY = 5 LOCK = threading.Lock() parser = argparse.ArgumentParser() parser.add_argument("--file"...
# Generated by Django 3.1.14 on 2022-03-04 18:39 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0003_user_username'), ] operations = [ migrations.RemoveField( model_name='user', name='username', ), ]...
# Generated by Django 3.0.11 on 2021-02-28 16:39 import django.contrib.postgres.fields.jsonb import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("bpp", "0240_auto_20210228_1739"), ("import_pracownikow", "0001_initial"...
from __future__ import unicode_literals from django.db import models from django.utils.translation import pgettext_lazy from django.utils.timezone import now class ExpenseTypes(models.Model): name = models.CharField( pgettext_lazy('ExpenseTypes field', 'name'), unique=True, max_length=128) descriptio...
# Enter your code here. Read input from STDIN. Print output to STDOUT averageX, averageY = [float(num) for num in input().split(" ")] CostX = 160 + 40*(averageX + averageX**2) CostY = 128 + 40*(averageY + averageY**2) print(round(CostX, 3)) print(round(CostY, 3))
# -*- coding: utf-8 -*- import hnswlib import numpy as np def buildIndex(X): dim = X.shape[1] num_elements = X.shape[0] data_labels = np.arange(num_elements) p = hnswlib.Index(space = 'cosine', dim = dim) p.init_index(max_elements = num_elements, ef_construction = 200, M = 16) p.add_items(X, d...
# VMware vCloud Director Python SDK # Copyright (c) 2014-2019 VMware, 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 ...
import MySQLdb from biliClass.biliAid import Aid import time def dblink(): # 连接数据库 # demo return MySQLdb.connect( host='localhost', user='root', passwd='password', db='nav', charset='utf8' ) def dbsql(conn, sql): # 执行sql cursor = conn.cursor() cursor...
# Copyright (c) 2013 eBay Inc. # Copyright (c) OpenStack Foundation # # 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 ap...
"""Unit test package for ziphyr."""
import os import subprocess import time from contextlib import contextmanager import grpc import pytest from dagster_test.dagster_core_docker_buildkite import ( build_and_tag_test_image, test_project_docker_image, ) from dagster import check from dagster.grpc.client import DagsterGrpcClient from dagster.utils...
import io import resource from pathlib import Path import numpy as np import PIL import pytest from keras_preprocessing.image import utils def test_validate_filename(tmpdir): valid_extensions = ('png', 'jpg') filename = tmpdir.ensure('test.png') assert utils.validate_filename(str(filename), valid_extens...
"""This module contains unit tests for stream module.""" import pytest import pseudo __author__ = "Patryk Niedźwiedziński" @pytest.fixture def stream(): """Returns stream object""" def _s(i): s = pseudo.stream.Stream(i) return s return _s @pytest.mark.timeout(2) def test_get_current...
from __future__ import absolute_import import json from .model import OpenShiftPythonException class Result(object): def __init__(self, high_level_operation, tracking_limit=None): self.high_level_operation = high_level_operation self.__actions = [] # if tracking_limit is less than 0 that...
#!/usr/bin/env ccp4-python """Module to run sheetbend on a model""" __author__ = "Adam Simpkin" __date__ = "05 Aug 2018" __version__ = "1.0" import os from simbad.util import mtz_util from simbad.mr.refmac_refine import Refmac from pyjob import cexec class SheetBend(object): """Class to run sheetbend""" d...
# 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 from .. import _utilities, _tables from ...
from __future__ import absolute_import from pex.platforms import *
import numpy as np from os import path as osp from mmdet3d.core import show_result, show_seg_result from mmdet3d.core.bbox import DepthInstance3DBoxes from mmdet.datasets import DATASETS from mmseg.datasets import DATASETS as SEG_DATASETS from .custom_3d import Custom3DDataset from .custom_3d_seg import Custom3DSegDat...
"""Tools for manipulating of large commutative expressions. """ from sympy.core.add import Add from sympy.core.compatibility import iterable from sympy.core.mul import Mul, _keep_coeff from sympy.core.power import Pow from sympy.core.basic import Basic from sympy.core.expr import Expr from sympy.core.function import e...
# Copyright 2017 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/space/shields/shared_adv_deflector_shields.iff" result.att...
#!/usr/bin/env python # coding: utf-8 """Download and parse Tanakh from <http://mechon-mamre.org/>. The text is based on the [Aleppo Codex][1]. [1]: https://en.wikipedia.org/wiki/Aleppo_Codex Each book is in a separate HTML file (e.g., `c01.htm`) and contains navigation and textual data. The relevant structure is: ...
##Patterns: R0914: { "max-locals": "3" } ##Warn: R0914 def doEverything(thing): a = 3 b = 3 c = 3 d = 3 e = 3 f = 3 g = 3 h = 3 i = 3 j = 3 k = 3 l = 3 m = 3 n = 3 o = 3 p = 3 q = 3 r = 3 s = 3 t = 3
# 作为新框架测试用 import pygame import os import json import platform import ctypes from sysconf import * pygame.init() # 如果是Windows系统,在游戏中禁用显示缩放 # 注:通常高分屏用户在使用Windows系统时,都会把缩放调到100%以上,否则会瞎眼。 # 例如1920*1080屏幕,Windows推荐的缩放率就是125%。 # 这样会导致游戏窗口被严重放大,造成一部分游戏画面处在任务栏下方。 # 然而,在Linux系统下并没有这问题,所以这里只判定是否为Windows。 if platform.system()...
import datetime import os from http import HTTPStatus from operator import attrgetter from pathlib import Path from django.conf import settings from django.contrib.sites.models import Site from django.template import Context, Template from django.test import TestCase from django.urls import reverse, set_urlconf from ...
import numpy as np import cv2 import os mean = [] std = [] img_list = [] dir_path = './STL10-data/train' class_paths = os.listdir(dir_path) print(class_paths) for cls in class_paths: img_paths = os.listdir(dir_path + os.sep + cls) print(len(img_paths)) for img_path in img_paths: print(img_path) ...
# qubit number=4 # total number=31 import pyquil from pyquil.api import local_forest_runtime, QVMConnection from pyquil import Program, get_qc from pyquil.gates import * import numpy as np conn = QVMConnection() def make_circuit()-> Program: prog = Program() # circuit begin prog += X(3) # number=1 prog...
from .file import read_files, write_files
# Copyright 2013, Nachi Ueno, NTT I3, 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC ''' Spartan 6 bitstream analyzer tool...
# -*- coding: utf-8 -*- # # Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
""" create errno-specific classes for IO or os calls. """ import sys, os, errno class Error(EnvironmentError): def __repr__(self): return "%s.%s %r: %s " %(self.__class__.__module__, self.__class__.__name__, self.__class__.__doc__, ...
import numpy as np import sys import os import fnmatch import argparse try: import cv2 as cv except ImportError: raise ImportError('Can\'t find OpenCV Python module. If you\'ve built it from sources without installation, ' 'configure environment variable PYTHONPATH to "opencv_bu...
import re import sys import csv import json import pickle import collections from pathlib import Path from tf.fabric import Fabric from book_formats import get_book_maps, etcbc2sbl, etcbc2abbr from verb_form import get_verbform, get_cl_verbform from modify_domain import permissive_q from synvar_carc import in_dep_calc ...
import pygame import random import math import enemies.enemy class ZigZagEnemy(enemies.enemy.Enemy): def __init__(self, game): super().__init__(game) self.timer = self.game.getRepeateTimer() self.timer.duration = 3000 self.timer.action = self.changeAngle def changeAngle(self): ...
# -*- coding: utf-8 -*- """ Created on Mon Jan 09 09:59:13 2017 @author: as624 """ import csv import os import matplotlib.pyplot as plt import numpy as np def output_detection_figures( image, wells, bacteria, timeindex, output_dir): """ Produces and saves figures showing the output from the detection ...
# MIT License # # Copyright (c) 2019 Red Hat, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge...
#!/usr/bin/python # Imports import sys, os, re, time import argparse import pdb import pickle from itertools import * # Science import numpy as np import scipy.stats as stats import pandas as pd # Plotting import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from matplotlib import colors from mpl_to...
# coding: utf-8 # # This code is part of cmpy. # # Copyright (c) 2022, Dylan Jones """This module contains methods for modeling disorder.""" import numpy as np from typing import Union, Sequence def create_subst_array( size: int, values: Sequence[float], conc: Union[float, Sequence[float]] ) -> np.ndarray: ...
""" This file offers the methods to automatically retrieve the graph Sphingomonas hankookensis. 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--prot...
# Copyright 2018 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 -*- from __future__ import unicode_literals, print_function import pandas as pd # The field class_name contains the name of the class to load to execute the # plugin. class_name = 'OntaskTestPlugin' class OntaskTestPlugin(object): """ Example of a class that implements the OnTask plugin ...
import dataclasses from typing import Any, Callable, List, Optional, Type from wagtail.core.blocks.field_block import CharBlock, FieldBlock, RichTextBlock from wagtail.core.blocks.stream_block import StreamBlock from wagtail.core.fields import StreamField from wagtail.images.blocks import ImageChooserBlock import str...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "irs990.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the ...
import django import json import os import sys # Make sure we can see the parent directory to import sys.path.append('../') os.environ['DJANGO_SETTINGS_MODULE'] = 'shipwrecks.settings' # Make sure Django is set up django.setup() # Now we can import our Django model(s) from wrecks.models import Wreck from wrecks.mode...
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: train.py import argparse import itertools import numpy as np import os import shutil import cv2 import six assert six.PY3, "FasterRCNN requires Python 3!" import tensorflow as tf import tqdm import tensorpack.utils.viz as tpviz from tensorpack import * from tensor...
# 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 from ... import _utilities, _tables __a...
# Copyright 2016 gRPC 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 applicable law or agreed to in writing...
import os.path import sys from nose.tools import assert_raises from cx_Freeze.common import ConfigError, process_path_specs rootdir = "C:\\" if sys.platform == "win32" else "/" def test_process_path_specs(): inp = [ os.path.join(rootdir, "foo", "bar"), (os.path.join(rootdir, "foo", "qux"), os.p...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import webbrowser import sublime import sublime_plugin from . import MDETextCommand from . import plugin_name from . import settings from python_utils.misc_utils import get_system_tempdir from python_utils.mistune_utils import md from python_utils.sublime_text_util...
import json import time import os import pandas as pd import requests from bs4 import BeautifulSoup from tqdm import tqdm def process_9gag(args): fetched_memes = [] errors = 0 # for i in tqdm(range(args.)) pass def process_me_dot_me(args): pass def templates_imgflip(args): args.source_url =...
class Array(object,ICloneable,IList,ICollection,IEnumerable,IStructuralComparable,IStructuralEquatable): """ Provides methods for creating,manipulating,searching,and sorting arrays,thereby serving as the base class for all arrays in the common language runtime. """ @staticmethod def AsReadOnly(array): """ AsRe...
import os.path import unittest import hashlib from tableaudocumentapi import Workbook TEST_ASSET_DIR = os.path.join( os.path.dirname(__file__), 'assets' ) TEST_TWB_FILE = os.path.join( TEST_ASSET_DIR, 'group_test.twb' ) TEST_TWB_FILE2 = os.path.join( TEST_ASSET_DIR, 'add_user_filter_test.twb...
# -*- coding: utf-8 -*- # Lista de exercicio 06 # Exercicio 4 # importando as bibliotecas import matplotlib as plt import matplotlib.pyplot as plt import numpy as np # informacoes da tabela relativas aos dados masculino e feminino (IBGE) idade = np.array( ["0 a 4 anos", "5 a 9 anos", "10 a 14 anos", "15 a 19 ...
metros = int(input("uma distância em metro: ")) print("A medida de {}m corresponde a".format()) print("{}km".format(metros/1000)) print("{}hm".format(metros/100)) print("{}dam".format(metros/10)) print("{}dm".format(metros*10)) print("{}cm".format(metros*100)) print("{}mm".format(metros*1000))
from __future__ import unicode_literals import os import uuid from airflow.exceptions import AirflowSkipException from dagster_airflow.factory import AIRFLOW_MAX_DAG_NAME_LEN, _rename_for_airflow from dagster_airflow.test_fixtures import ( # pylint: disable=unused-import dagster_airflow_docker_operator_pipeline,...
from .elf import Corpus from .base import CorpusBase, JsonCorpus, JsonCorpusLoader
import json import re import spacy import enchant import copy as cp sp = spacy.load('en_core_web_sm') def lemmatize_this(str_word): return sp(str_word)[0] def main(): while True: print("Ingrese la Palabra: ") word = input() word = str(lemmatize_this(word)) try: wit...
####################################### # IMPORTS ####################################### from strings_with_arrows import * import string ####################################### # CONSTANTS ####################################### DIGITS = '0123456789' LETTERS = string.ascii_letters LETTERS_DIGITS = LETTERS + DIGITS...
import pyclassifiers.values import config.general import config.helpers project_github_username = "veltzer" project_name = "pyapikey" github_repo_name = project_name project_website = f"https://{project_github_username}.github.io/{project_name}" project_website_source = f"https://github.com/{project_github_username}/...
# 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...
# Author: True Price <jtprice at cs.unc.edu> from collections import OrderedDict, defaultdict from io import StringIO from itertools import combinations import os import struct from .camera import Camera from .image import Image import numpy as np from .rotation import Quaternion # ----------------------------------...
from __future__ import absolute_import, print_function, division import copy import scipy.sparse from theano.compile import shared_constructor, SharedVariable from theano.sparse.basic import SparseType, _sparse_py_operators class SparseTensorSharedVariable(_sparse_py_operators, SharedVariable): dtype = property(l...
# encoding: utf-8 # module apt_pkg # from /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-x86_64-linux-gnu.so # by generator 1.145 """ Classes and functions wrapping the apt-pkg library. The apt_pkg module provides several classes and functions for accessing the functionality provided by the apt-pkg library. Typica...
""" Examples: visualizer.py visualizer.py --map=gen/hz.txt --lm="py:lm_ai.Oscillating(frequency=5)" ghc:fickle.ghc ghc:miner.ghc Controls: ESC, q - quit b - one step back arrows - control interactive lm any key - one step of non-interactive lm """ import random import curses import logging import ...
from core.advbase import * from slot.a import * def module(): return Aldred class Aldred(Adv): comment = 'maintain dragondrive' conf = {} conf['slots.a'] = Heralds_of_Hinomoto()+Dear_Diary() conf['slots.poison.a'] = Heralds_of_Hinomoto()+The_Plaguebringer() conf['acl'] = """ `s3, not ...
# coding: utf-8 import io import os import shutil import tempfile import unittest from edo_client import WoClient class ContentApi_DownloadTestCase(unittest.TestCase): ''' - Basically this is to ensure all the facilities related to HTTP range headers are working properly; ''' @classmethod ...
n=int(input('enter no.')) factors = [] while n % 2 == 0: factors.append(2) n//=2 divisor=3 while n!=1 and divisor <=n: if n% divisor == 0: factors.append(divisor) n//=divisor else: divisor+=2 print('prime factors is') for i in range (len(factors)): print(factors[i], end=" ")...
# -*- coding: utf-8 -*- ''' The caller module is used as a front-end to manage direct calls to the salt minion modules. ''' # Import python libs from __future__ import print_function import os import sys import logging import datetime import traceback # Import salt libs import salt.exitcodes import salt.loader import...
## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera ## 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...
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from ppr...
from rldqn import DQN, FCNet, RandomLearner from rlddpg import DDPG
#!/usr/bin/env python import PUMI.utils.Concat as conc conc=conc.concat_workflow(2) conc.inputs.inputspec.par1="abc" conc.inputs.inputspec.par2="def" conc.write_graph('graph-orig.dot', graph2use='orig', simple_form=True); conc.write_graph('graph-exec-detailed.dot', graph2use='exec', simple_form=False); conc.write_gra...
# -*- coding: utf-8 -*- # Most of this file was copied from: # https://raw.githubusercontent.com/django/django/1.11.12/tests/cache/tests.py # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import copy import io import os import r...
import pytest import os import logging import requests_helper @pytest.fixture def valid_post_image(): return open('_test/src/img001.jpg', 'rb') @pytest.fixture def valid_post_url(): return os.environ['COMPUTER_VISION_ENDPOINT'] + "/vision/v3.0/read/analyze" @pytest.fixture def valid_headers(): return...
"""Repository rule for CUDA autoconfiguration. `cuda_configure` depends on the following environment variables: * `TF_NEED_CUDA`: Whether to enable building with CUDA. * `GCC_HOST_COMPILER_PATH`: The GCC host compiler path * `TF_CUDA_CLANG`: Whether to use clang as a cuda compiler. * `CLANG_CUDA_COMPILER_PATH...
import datetime import zlib from collections import OrderedDict from copy import deepcopy from decimal import Decimal from django.db.models import Q from clients.models import Document, DispensaryReg, Card from directions.models import Napravleniya, Issledovaniya, ParaclinicResult, IstochnikiFinansirovaniya, PersonCo...
#!/usr/bin/env python import rospy from gazebo_msgs.srv import SpawnModel, SpawnModelRequest, SpawnModelResponse # from gazebo_msgs.srv import ApplyBodyWrench, GetModelProperties, GetWorldProperties, SetModelState from copy import deepcopy from tf.transformations import quaternion_from_euler sdf_cube = """<?xml versi...
""" Parsed Config File Produces Expected Behaviors - configurations """ import inspect import os import deeplenstronomy.deeplenstronomy as dl doc = """ \tRunning tests from test_expected_behaviors_configurations.py \tThe tests included in this module demonstrate that the properties of each \tconfiguration wer...
import sys from cx_Freeze import setup, Executable base = None # Uncomment to disable the console on Windows, once the thing is stable #if sys.platform == "win32": # base = "Win32GUI" config = { 'description': 'Twitch Bot', 'author': 'Janne Enberg', 'url': 'https://github.com/lietu/twitch-bot', 'do...
import os import glob from pathlib import Path import numpy as np import random import carb from PIL import Image from tensorflow import keras from pxr import Usd, UsdGeom, Gf, UsdPhysics import omni.kit from omni.isaac.examples.base_sample import BaseSample from omni.isaac.core.objects import DynamicCuboid from omni.i...
import os # Bot token BOT_TOKEN = os.getenv('BOT_TOKEN') # Web application setup WEBAPP_HOST = '0.0.0.0' WEBAPP_PORT = int(os.getenv('PORT')) # Webhook setup WEBHOOK_HOST = 'https://neural-painter-bot.herokuapp.com' WEBHOOK_PATH = f'/webhook/{BOT_TOKEN}' WEBHOOK_URL = f'{WEBHOOK_HOST}{WEBHOOK_PATH}'
from django.core.management.base import BaseCommand, CommandError try: from django.contrib.auth import get_user_model except ImportError: from django.contrib.auth.models import User else: User = get_user_model() from django_otp import devices_for_user class Command(BaseCommand): """ Command for d...
import unittest from app.models import Comments class CommentsModelTest(unittest.TestCase): def setUp(self): self.new_comment = Comments(comment='a') def test_instance(self): self.assertEqual(self.new_comment.comment, 'a') def test_save_comment(self): self.new_comment.save_comme...
#!/bin/env dls-python from sys import version_info if version_info.major == 2: import __builtin__ as builtins # Allows for Python 2/3 compatibility, 'builtins' is namespace for inbuilt functions else: import builtins import unittest from mock import patch, MagicMock p = patch('dls_ade.Server') server_mock ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : train.py # Author: Alvin(Xinyao) Sun <xinyao1@ualberta.ca> # Date : 02.05.2021 import logging import os import sys import hydra import pytorch_lightning as pl from omegaconf import DictConfig, OmegaConf sys.path.append(os.path.dirname(os.path.realpath(__file__...
from .wasserstein import wasserstein_distance from .bottleneck import bottleneck_distance __author__ = "Marc Glisse" __copyright__ = "Copyright (C) 2020 Inria" __license__ = "MIT"
# -*- coding: utf-8 -*- # # Zend Framework 2 documentation build configuration file, created by # sphinx-quickstart on Fri Jul 6 18:55:07 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file...
# Copyright 2014 SolidBuilds.com. All rights reserved # # Authors: Ling Thio <ling.thio@gmail.com> from datetime import datetime from flask import current_app, flash from flask import Blueprint, redirect, render_template from flask import request, url_for from flask_user import current_user, login_required, roles_acc...
""" UnionFind disjoint sets data structure. """ from . import unionfind
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @File : __init__.py.py @Time : 2020/3/27 22:36 @Author : Empty Chan @Contact : chen19941018@gmail.com @Description: @License : (C) Copyright 2016-2020, iFuture Corporation Limited. """ from . import *
# -*- coding: utf-8 -*- import pytest from plexapi.exceptions import BadRequest, NotFound from . import conftest as utils def test_myplex_accounts(account, plex): assert account, "Must specify username, password & resource to run this test." print("MyPlexAccount:") print("username: %s" % account.username...
import os from aiohttp import web from app.utility.logger import Logger class FileSvc: def __init__(self, payload_dirs, exfil_dir): self.payload_dirs = payload_dirs self.log = Logger('file_svc') self.exfil_dir = exfil_dir async def download(self, request): name = request.he...
from yowsup.structs import ProtocolEntity, ProtocolTreeNode class AckProtocolEntity(ProtocolEntity): ''' <ack class="{{receipt | message | ?}}" id="{{message_id}}"> </ack> ''' def __init__(self, _id, _class): super(AckProtocolEntity, self).__init__("ack") self._id = _id sel...
#!/usr/bin/env python3 import hashlib def main(): print(hashlib.sha256("hugh,13145820,20193833".encode("ascii")).hexdigest()) # 13145820 guess_flag = True digits = 1 while guess_flag: bound = 10**digits guess = 0 while guess < bound: guess_str = ("hugh,{:0" + st...
# -*- coding: utf-8 -*- # Copyright 2018 Google 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 ...
from typing import Callable from datetime import datetime, timezone from time import mktime from ..common.const import ( MILESTONES_USING_TIMESTAMP_ONLY, TIMESTAMP_B, TIMESTAMP_E, ATCH_TIMESTAMP_B, ATCH_TIMESTAMP_E ) from ..common import tryte_to_int import logging __all__ = [ 'TimeFilter', ] ...