text
stringlengths
2
999k
import sys sys.path.insert(0,'Access Subsystem/Ve-Vnfm-em') import VnfmDriverTemplate class DummyVnfmDriver3(VnfmDriverTemplate.VnfmDriverTemplate): def __init__(self, vnfmId, vnfmAddress, vnfmCredentials): super().__init__(vnfmId, vnfmAddress, vnfmCredentials)
import json import logging import sys import unittest from unittest import mock from engineio import exceptions as engineio_exceptions from engineio import packet as engineio_packet import pytest from socketio import asyncio_namespace from socketio import client from socketio import exceptions from socketio import na...
import collections import contextlib import datetime import itertools import locale import logging import re import threading from typing import List, Optional import pandas import tqdm import lxml.etree from .xml import iter_extract_elems from .utils import PathType locale_lock = threading.Lock() @contextlib.cont...
"""Output types for a Queenbee Job steps. For more information on plugins see plugin module. """ import json from typing import Union, List, Dict, Any from pydantic import constr, Field from .function import FunctionStringOutput, FunctionIntegerOutput, \ FunctionNumberOutput, FunctionBooleanOutput, FunctionFolde...
import numpy as np import random class Cuboid: """ Implementation for box (Cuboid) RANSAC. A cuboid is defined as convex polyhedron bounded by six faces formed by three orthogonal normal vectors. Cats love to play with this kind of geometry. This method uses 6 points to find 3 best plane equations or...
#!/usr/bin/env python """apps: provides support libraries for controlling applications (local or web). """ __all__ = ['blast', 'carnac', 'cd_hit', 'clustalw', 'cmfinder', 'comrna', 'consan', 'contrafold', 'cove', 'dialig...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 構文木変数クラス """ from node.node import Node from code import Code class Symbol(Node): def __init__(self, symbol): try: self.number = int(symbol) # 変数の番号 except: raise Exception("Error: Illigal symbol") def getNumber(self): return self.number def run(self, ...
# -*- coding: utf-8 -*- """ 备忘录模式: 在不破坏封装的前提下,捕获一个对象的内部状态,并在该对象之外的保存这个状态。这样以后就可以恢复到原先的状态 Created by 相濡HH on 4/14/15. """ class Memento(object): """ 备记录 用于存储状态信息 """ def __init__(self, states): if isinstance(states, dict): self.state = states else: print...
from mock import patch, MagicMock import pytest from db.errors import EntityDoesNotExist, ResourceIsNotDeployed from db.repositories.workspace_services import WorkspaceServiceRepository from db.repositories.operations import OperationRepository from models.domain.resource import ResourceType from models.domain.workspa...
from app.IndentificationSystem import data_cluster, data_handler_3, data_cluster_3 from app.IndentificationSystem.data.ProfilePredictor import ProfilePredictor import matplotlib.pyplot as plt if __name__ == "__main__": data_cluster.choose_best_cluster(2, 8) profile_predictor = ProfilePredictor(data_handler_3....
from unittest import TestCase from chibi.file import Chibi_path from chibi.file.snippets import inflate_dir class Test_inflate_dir( TestCase ): def test_inflate_dir_should_inflate_current_dir( self ): result = inflate_dir( '.' ) expected = Chibi_path.current_dir() self.assertEqual( resul...
import pytest, os, shutil import glob from pprint import pprint from lxml import html import cinefiles.cinefiles as cf def test_import(): import cinefiles movies = [ '5th Element','Amour','Astronaut Farmer', 'Down Periscope','Grand Budapest Hotel, The (2014)', 'Interstellar (2014)','Inv...
#!/usr/bin/env python # -*- coding: utf-8 -*- ########################################################### # WARNING: Generated code! # # ************************** # # Manual changes may get lost if file is generated again. # # Only code inside the [MANUAL] ta...
import json from django.http import JsonResponse from django.middleware.csrf import get_token def get_csrf(request): response = JsonResponse({'detail': 'CSRF cookie set'}) response['X-CSRFToken'] = get_token(request) return response
###################################################################### # # File: b2sdk/sync/policy.py # # Copyright 2019 Backblaze Inc. All Rights Reserved. # # License https://www.backblaze.com/using_b2_code.html # ###################################################################### from abc import ABCMeta, abstrac...
import webdriver_manager webdriver_manager.update()
from arjuna.tpi import Arjuna from arjuna.tpi.markup import * from .wp import WPLoginLogout @test_function def test(my): automator = Arjuna.create_gui_automator() WPLoginLogout.login(automator) main_win = automator.MainWindow() main_win.maximize() print(main_win.get_title()) automator.exec...
# model settings norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( type='EncoderDecoder', pretrained=None, backbone=dict( type='UNet', in_channels=3, base_channels=64, num_stages=5, strides=(1, 1, 1, 1, 1), enc_num_convs=(2, 2, 2, 2, ...
# Copyright 2011 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from __future__ import print_function from subprocess import PIPE, S...
/home/runner/.cache/pip/pool/26/14/dc/6a1106633ac76b905b8dae4d3c0f02a35c9b1cc143fd435fb252341042
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Microsoft Public License. A # copy of the license can be found in the License.html file at the root of this...
import sys ''' CONVERTERS { 0, 1 } convertToZeroOne( data ) { -1, 1 } convertToPosNegOne( data ) ''' def convertToZeroOne( data ): return( data[0], [ [ 1 if elem is 1 else 0 for elem in row ] for row in data[1] ] ) # def convertToPosNegOne( data ): return( data[0], [ [ 1 if elem is 1 else -1 for elem in...
# -*- coding: utf-8 -*- import re import requests from bs4 import BeautifulSoup from metro.parser.base import BaseRuDataProvider class DataProvider(BaseRuDataProvider): metro_data_src = "http://ru.wikipedia.org/wiki/\ Список_станций_Нижегородского_метрополитена" td_count = 4 def d...
import uuid from django.db import models from tombstones.models import SoftDeleteModel class Person(SoftDeleteModel): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(max_length=100) class VicePrincipal(Person): hire_date = models.DateField() class ...
#!/usr/bin/env pytest ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test multidimensional support in HDF5 driver # Author: Even Rouault <even.rouault@spatialys.com> # ################################################################...
import re from .regex import REGEX_SEARCH_PATTERN, REGEX_SQUARE_BRACKETS from .._compat import long def to_num(num): result = 0 try: result = long(num) except NameError as e: result = int(num) return result class RestParser(object): def __init__(self, db): self.db = db ...
# Created on Sep 2, 2020 # author: Hosein Hadipour # contact: hsn.hadipour@gmail.com import os output_dir = os.path.curdir def zsnow2(T=12): cipher_name = 'zsnow2' recommended_mg = 9 recommended_ms = 12 eqs = '#%s %d Rounds\n' % (cipher_name, T) eqs += 'connection relations\n' for t in range(...
"""Helpful utilities for building analysis pipelines. """ import glob import gzip import os import tempfile import time import shutil import contextlib import itertools import functools import random import fnmatch import subprocess import sys import types import six import toolz as tz import yaml from collections im...
# Copyright 2019 The Magenta 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 ...
# coding=utf-8 # Copyright 2020 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...
#!/usr/bin/env python # -*- coding: utf-8 # Copyright 2017-2019 The FIAAS 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 # # U...
# Copyright (c) 2012 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. { 'variables': { 'chromium_code': 1, # Keep the archive builder happy. 'chrome_personalization%': 1, 'use_syncapi_stub%': 0, 'con...
# -*- coding: utf-8 -*- # Copyright (c) 2020, ifitwala and contributors # For license information, please see license.txt from __future__ import unicode_literals # import frappe from frappe.model.document import Document class InstructorLog(Document): pass
# from numba import jit, njit, float64, int32 from enum import IntEnum from collections import defaultdict import torch import itertools from flatland.envs.rail_env import RailEnv from flatland.envs.agent_utils import RailAgentStatus from flatland.envs.rail_generators import sparse_rail_generator from flatland.envs...
from django.db import connection, models from psqlextra.backend.schema import PostgresSchemaEditor from . import db_introspection from .fake_model import ( define_fake_materialized_view_model, define_fake_view_model, get_fake_model, ) def test_schema_editor_create_delete_view(): """Tests whether cre...
import os.path import pickle import shutil import tempfile import unittest import pcl import numpy as np from nose.plugins.attrib import attr _data = [(i, 2 * i, 3 * i + 0.2) for i in range(5)] _DATA = """0.0, 0.0, 0.2; 1.0, 2.0, 3.2; 2.0, 4.0, 6.2; 3.0, 6.0, 9.2; 4.0, 8....
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
import sys from flask import Blueprint, request, jsonify from flaskApp import db from flaskApp.course.utils import * from flaskApp.course.GoogCalInteract import * from flaskApp.error.error_handlers import * import json course = Blueprint('course', __name__) @course.route('/newCal', methods=['POST']) def new_session()...
import numpy as np import pandas as pd from six.moves.collections_abc import Sequence, Iterable import sklearn import scipy import wandb def encode_labels(df): le = sklearn.preprocessing.LabelEncoder() # apply le on categorical feature columns categorical_cols = df.select_dtypes( exclude=["int", "...
from unittest.mock import Mock, call, patch import pytest from hammurabi.rules.text import LineExists, LineNotExists, LineReplaced def get_line_exists_rule( text="Example text", match="Example match", position=1, lines=[], **kwargs ): mock_file = Mock() mock_file.read.return_value.splitlines.return_valu...
# coding: utf-8 """ Cisco Intersight OpenAPI specification. The Cisco Intersight OpenAPI specification. OpenAPI spec version: 1.0.9-1461 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class ConnectorPtyBorgT...
# Time: O(n^2) # Space: O(n) class Solution(object): def numFactoredBinaryTrees(self, A): """ :type A: List[int] :rtype: int """ M = 10**9 + 7 A.sort() dp = {} for i in xrange(len(A)): dp[A[i]] = 1 for j in xra...
# coding=utf-8 # Copyright 2018 The Google AI Team 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 applicabl...
from numpy import zeros import itertools from pymclevel import alphaMaterials from pymclevel.level import extractHeights am = alphaMaterials # naturally occuring materials blocks = [ am.Grass, am.Dirt, am.Stone, am.Bedrock, am.Sand, am.Gravel, am.GoldOre, am.IronOre, am.CoalOre, ...
from model.authentication import * from config.options import * import json import redis import time from pymongo import MongoClient class RedisSubscribeListener(object): def __init__(self): mongo_client = MongoClient(MONGODB_URI) db = mongo_client[MONGODB_DBNAME] self.tr_tweets = db.tr_...
# -*- coding: utf-8 -*- # # Copyright 2020 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutControlStatements(Koan): def test_if_then_else_statements(self): if True: result = 'true value' else: result = 'false value' self.assertEqual('true value', result) def test_if_t...
# adb/commands.py - Run executables on an Android device -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for l...
from abc import ABC, abstractmethod, abstractclassmethod class ParserABC(ABC): def __init__(self, manga): self._manga = manga self._page: str = None self.contents = {} @abstractclassmethod def urlparse(cls, url: str)->str: pass @abstractmethod async def parse_info(...
class myclass(object): pass print(dir()) x = myclass() print(myclass) print(x) print(type(x)) print(myclass == type(x))
import numpy as np import theano, theano.tensor as T def He(shape, name, fan_in): """ He initialization of parameters """ rng = np.random.RandomState(1) W = rng.normal(0, np.sqrt(2. / fan_in), size=shape) return theano.shared(W, borrow=True, name=name).astype('float32') def ConstantInit(shape, name, v...
ENS = 'http://schemas.microsoft.com/exchange/services/2006/errors' MNS = 'http://schemas.microsoft.com/exchange/services/2006/messages' SNS = "http://schemas.xmlsoap.org/soap/envelope/" TNS = 'http://schemas.microsoft.com/exchange/services/2006/types' NSMAP = { "e": ENS, "m": MNS, "s": SNS, "t": TNS, }
from migen.fhdl.std import * from migen.genlib.record import * from migen.flow.actor import * class Relax(Module): def __init__(self, layout): self.d = Sink(layout) self.q = Source(layout) self.busy = Signal() ### reg_a = Record(layout) reg_a_full = Signal(reset=0...
'''Multimethods for fast Hankel transforms. ''' import numpy as np from ._basic import _dispatch from ._fftlog import fht as _fht from ._fftlog import ifht as _ifht from scipy._lib.uarray import Dispatchable __all__ = ['fht', 'ifht'] @_dispatch def fht(a, dln, mu, offset=0.0, bias=0.0): """fht multimethod."""...
# -*- coding: utf-8 -*- ''' Sync custom types to the Master .. versionadded:: 2016.3.0 ''' from __future__ import absolute_import # Import python libs import logging # Import salt libs import salt.utils.extmods log = logging.getLogger(__name__) def sync_all(saltenv='base'): ''' Sync all custom types ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2012-2017, Erigones, s. r. o try: from zabbix_api import ZabbixAPI, ZabbixAPIException except ImportError: ZabbixAPI = ZabbixAPIException = None from ansible.module_utils.basic import AnsibleModule def main(): # noinspection PyShadowingBuiltins module...
#!/usr/bin/env python # # Copyright (C) 2013 Umea Universitet, Sweden # # 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...
import pytest from pytest_mock import mocker import pandas as pd from kipoiseq.transforms.functional import translate, rc_dna from kipoiseq.dataclasses import Interval, Variant from kipoiseq.extractors.protein import cut_transcript_seq, TranscriptSeqExtractor, ProteinSeqExtractor, \ ProteinVCFSeqExtractor, SingleSe...
#! /usr/bin/env python import threading import time from gps import * class GpsPoller(threading.Thread): '''https://stackoverflow.com/questions/6146131/python-gps-module-reading-latest-gps-data''' def __init__(self): threading.Thread.__init__(self) self.session = gps(mode=WATCH_ENABLE) self.cu...
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution. The full text of the license may be found at # http://opensource....
from __future__ import print_function, absolute_import, unicode_literals from zope.interface import implementer import contextlib from ._interfaces import IJournal @implementer(IJournal) class Journal(object): def __init__(self, save_checkpoint): self._save_checkpoint = save_checkpoint self._outbou...
""" Pydantic schemas. """ from app.schemas.message import Message from app.schemas.question import ( Answer, Question, QuestionAnswer, QuestionCreate, QuestionListItem, QuestionUpdate, ) from app.schemas.question_order_item import ( QuestionOrderItem, QuestionOrderItemCreate, Questi...
import asyncio import os import shutil import time from decimal import getcontext from math import floor as floor import aiohttp import blockcypher import mpmath from x20bf.logger import logger genesis_time = 1231006505 def unsignedToSigned(n, byte_count): return int.from_bytes( n.to_bytes(byte_count, ...
"""This file implements the functionalities of a minitaur derpy using pybullet. It is the result of first pass system identification for the derpy robot. The """ import math import numpy as np import minitaur KNEE_CONSTRAINT_POINT_LONG = [0, 0.0055, 0.088] KNEE_CONSTRAINT_POINT_SHORT = [0, 0.0055, 0.100] class M...
def int_hex(v): v = hex(v) v = v[2:] return v def main(v): v = v.upper() print(v) main(int_hex(int(input())))
import codecs import bz2 import numpy chars = [] init='。' with codecs.open('../msr_dic/msr_dict.utf8', 'r', encoding='utf8') as f: lines = f.readlines() for line in lines: for w in line: if w == '\n': continue else: chars.append(w) print(len(chars...
# Generated by Django 2.0.3 on 2018-04-06 18:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('entrance', '0062_auto_20180406_2242'), ] operations = [ migrations.AddField( model_name='selectenrollmenttypeentrancestep', ...
# Copyright 2011 Nebula, 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 ...
#!/usr/bin/env python print("helloworld")
import numpy as np import tensorflow as tf import collections from deepchem.metrics import to_one_hot from deepchem.models import KerasModel from deepchem.models.layers import Stack from deepchem.models.losses import SoftmaxCrossEntropy, L2Loss class RobustMultitaskClassifier(KerasModel): """Implements a neural ne...
# Generated by Django 3.1.4 on 2021-03-11 01:52 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Candidate', fields=[ ('id', models.AutoFiel...
# ---------------------------------------------------------------------------- # Copyright (C) Microsoft. All rights reserved. # Licensed under the MIT license. # ---------------------------------------------------------------------------- import os import binascii import struct import shutil import inspect import s...
from torm.builder.MongoBuilder import MongoBuilder from torm.builder.MysqlBuilder import MysqlBuilder
import cv2 import dlib import numpy as np import math from scipy.spatial import distance as dist # CONSTANTS MOUTH_THRESH = 0.9 EYE_AR_THRESH = 0.3 EYE_AR_CONSEC_FRAMES = 3 MOUTH_THRESH = 0.9 MASK_INFO = { 'mask1.jpg': { "src_points": np.float32([[400, 480], [800, 480], [600, 600]])...
import time import operator def get_a(U, pi, tasks, b): q = tasks[b][2] idx_b = pi.index(b) for val in pi: p = 0 r = tasks[val][0] mi = pi.index(val) for a in range(mi, idx_b + 1): p += tasks[pi[a]][1] if U == r + p + q: return val def get_...
# https://www.programiz.com/dsa/selection-sort def selectionSort(a1): # Time complexity: O(n^2) # Space complexity: O(1) - use 1 temp var n=len(a1) for i in range(n-1): mini = i # find the lowest for j in range(i+1,n): if a1[j] < a1[mini]: mini = j #on...
# coding=utf8 # Copyright 2018-2025 JDCLOUD.COM # # 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 agr...
import numpy as np import itertools from math import sqrt import sys import copy BASE_SHIFT = 1.13 COM_SHIFT = 0.5 FROM_OXDNA_TO_ANGSTROM = 8.518 FROM_ANGSTROM_TO_OXDNA = 1. / FROM_OXDNA_TO_ANGSTROM NAME_TO_BASE = { "ADE" : "A", "CYT" : "C", "GUA" : "G", "THY" : "T", "URA" : "U...
import typing import torch import torch.nn.functional as F import torch.nn as nn from vel.api.base import SupervisedModel, ModelFactory, LinearBackboneModel from vel.metrics.accuracy import Accuracy from vel.metrics.loss_metric import Loss class MultilayerSequenceClassificationGRU(SupervisedModel): """ Multilay...
# -*- coding: utf-8 -*- """ Enumerate the opcodes of the Bitcoin VM. The MIT License (MIT) Copyright (c) 2013 by Richard Kiss Copyright (c) 2019 July by mkbeh 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...
# Generated by Django 2.0.1 on 2018-02-09 08:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('learning_logs', '0003_topic_owner'), ] operations = [ migrations.AddField( model_name='topic', name='public', ...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from mock import Moc...
# coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import pytest import functools from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import set_bodiless_matcher from azure....
""" Working with calendars The calendar module contains different classes that you can use to create calendars. A text based calendar # 11 # A HTML based calendar # 32 Part 2: # 50 """ import calendar # A text based calendar # cal = calendar.TextCalendar(calendar.SUNDAY) # SUNDAY is the first da...
from .autorunner import AutoRunner from .markdowntoc_insert import MarkdowntocInsert from .markdowntoc_update import MarkdowntocUpdate __all__ = ["AutoRunner", "MarkdowntocInsert", "MarkdowntocUpdate"]
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PerlDistCheckconflicts(PerlPackage): """Declare version conflicts for your dist""" ho...
import asyncio import urllib.parse from functools import wraps from typing import Any, Awaitable, Callable, Dict, Optional, TypeVar from unittest import TestResult import orjson from asgiref.sync import async_to_sync, sync_to_async from django.conf import settings from django.core import signals from django.db import ...
import requests import MySQLdb from lxml import etree def get_address(url): headers={ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36' } response=requests.get(url,headers=headers) if response.status_code==2...
import pytest from loris import constants class TestImageRequest: def test_valid_filenames(self): self._assert_valid('/123.jpg/full/full/0/default.jpg') @pytest.mark.parametrize('path', [ '/a*b/full/full/0/default.jpg', '/a:b/full/full/0/default.jpg', '/a-b/full/full/0/defaul...
''' Created on 2020-08-24 @author: wf ''' # python standard library import sqlite3 import datetime import io import time import sys import re from lodstorage.lod import LOD class SQLDB(object): ''' Structured Query Language Database wrapper :ivar dbname(string): name of the database :ivar debug(b...
import io import locale import logging import os from functools import partial from typing import Callable, Iterable, List, Mapping, Optional, Tuple, Union from funcy import ignore from dvc.progress import Tqdm from dvc.scm.base import CloneError, MergeConflictError, RevError, SCMError from dvc.utils import fix_env, ...
N, M = [int(x) for x in input().split()] adj = [[] for i in range(N + 1)] for i in range(M): u, v = [int(x) for x in input().split()] adj[u].append(v) adj[v].append(u) visited = [] def dfs(node, S): if node == S: return True visited[node] = True found ...
""" A set of utilities for helping to perform simulations using openmm. """ import copy import logging from typing import TYPE_CHECKING, List, Optional, Tuple import numpy from openff.evaluator.attributes.attributes import UndefinedAttribute try: import openmm from openmm import app from openmm import un...
""" Name: Setup file Description: This file contains the setup tool code. Version: [release][3.2] Source url: https://github.com/OPHoperHPO/image-background-remove-tool Author: Anodev (OPHoperHPO)[https://github.com/OPHoperHPO] . License: Apache License 2.0 License: Copyright 2020 OPHoperHPO Licensed under the A...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------- import os from setuptools import setup from torch.utils import cpp_exte...
from __future__ import absolute_import, division, print_function import scitbx.math from scitbx.array_family import flex from scitbx import lbfgsb as lbfgsb_core import scitbx.lbfgs as lbfgs_core import sys floating_point_epsilon_double = scitbx.math.floating_point_epsilon_double_get() class FunctionalException(Runti...
from ctypes import * import numpy as np from numpy.ctypeslib import as_ctypes import os hfo_lib = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__), 'libhfo_c.so')) """Possible feature sets""" NUM_FEATURE_SETS = 2 LOW_LEVEL_FEATURE_SET, HIGH_LEVEL_FEATURE_SET = list(range...
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test segwit transactions and blocks on P2P network.""" import math import random import struct import t...
#!/usr/bin/env python # coding=utf-8 # Copyright © 2017 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space> # # 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...
__all__ = [ 'SortItemSelf', 'SortItemsSelf', 'SortOrder', 'BaseSortItem', 'BaseSortItems', 'SearchRequestMetaclass', 'BaseSearchRequest', 'ProjectSearchRequest', 'ProjectSortItems', 'PoolSearchRequest', 'PoolSortItems', 'TrainingSearchRequest', 'TrainingSortItems', ...