text
stringlengths
2
999k
import os import sys from distutils import log from io import StringIO from setuptools import find_packages, setup import sphinx with open('README.rst') as f: long_desc = f.read() if sys.version_info < (3, 5): print('ERROR: Sphinx requires at least Python 3.5 to run.') sys.exit(1) install_requires = [ ...
from typing import Tuple, List, Union, cast import torch import torch.nn as nn from kornia.geometry.transform.affwarp import rotate def normalize_kernel2d(input: torch.Tensor) -> torch.Tensor: r"""Normalizes both derivative and smoothing kernel. """ if len(input.size()) < 2: raise TypeError("inp...
from google.appengine.ext import db class Track(db.Model): author = db.StringProperty() lyric = db.TextProperty() number = db.IntegerProperty() ref = db.URLProperty() title = db.StringProperty() vol = db.IntegerProperty() created = db.DateTimeProperty() updated = db.DateTimeProperty()
# -*- encoding: utf-8 -*- # # Copyright © 2013 ZHAW SoE # # Authors: Serhiienko Oleksii <serh@zhaw.ch> # # 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/...
#! /usr/bin/env python from panflute import * import sys import shlex from collections import defaultdict import subprocess import os def make_formatter(argline): command = shlex.split(argline) def _formatter(input): read, write = os.pipe() os.write(write, input.encode('utf-8')) os.cl...
from random import random def generate(users, money): users = int(users) money = int(100 * money) if users < 1 or money < users: raise "Error!" while users > 1: amount = int(1 + 2 * (money / users - 1) * random()) users -= 1 money -= amount yield 0.01 * amount...
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmcv.runner import force_fp32 from torch.nn import functional as F from mmdet3d.core import bbox3d2result, merge_aug_bboxes_3d from mmdet3d.ops import Voxelization from mmdet.models import DETECTORS from .. import builder from .single_stage import Singl...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); y...
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-04-04 13:20 from __future__ import unicode_literals import core.model_fields import core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('wagtailima...
# SPDX-License-Identifier: BSD-3-Clause AND Apache-2.0 # Copyright 2018 Regents of the University of California # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code...
import multiprocessing import os import shutil import tempfile from argparse import ArgumentParser from datetime import datetime from typing import List from kgextractiontoolbox.backend.database import Session from kgextractiontoolbox.config import ENTITY_LINKING_CONFIG from kgextractiontoolbox.document import count f...
#!/usr/bin/env python ''' Digit recognition adjustment. Grid search is used to find the best parameters for SVM and KNearest classifiers. SVM adjustment follows the guidelines given in http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf Usage: digits_adjust.py [--model {svm|knearest}] --model {svm|knearest}...
import logging from bs4 import BeautifulSoup import requests fh = logging.FileHandler(filename='craigs.log') logging.basicConfig(level=logging.INFO, handlers=fh) logger = logging.getLogger(__name__) def record_meta(spider): """dynamically fills dictionary with result-meta from each listing""" pass class Cr...
# -*- coding: utf-8 -*- from zadanie6.model.group import Group def test_add_group(app): app.session.login(username="admin", password="secret") app.group.create(Group(name="group1", header="group1", footer="group1")) app.session.logout() def test_empty_add_group(app): app.session.login...
from django.core.exceptions import ValidationError from django.db.utils import IntegrityError from django.test import TestCase from rest_framework import status from rest_framework.test import APIRequestFactory from .businesslogic.tests import * from .serializers import * from .views import * class CardLevelTestCase...
# coding: utf-8 """ Copyright (c) 2021 Aspose.Cells Cloud 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/env python3 from test_framework.test_framework import BitcoinTestFramework from test_framework.qtum import activate_mpos from test_framework.qtumconfig import COINBASE_MATURITY from test_framework.address import byte_to_base58 from test_framework.messages import hash256 import time import struct class Qtum...
def cut_log(p, n): maximum=[0] for j in range(1, n+1): comp=-float("inf") for i in range(1, j+1): # Two nested loops = Θ(n^2) comp=max(p[i-1+1]+maximum[j-i], comp) maximum.append(comp) return maximum[-1]
from crispy_forms.layout import Field, Submit from django.contrib.auth.tokens import default_token_generator from django.core import mail from django.urls import reverse from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_encode from .factories import UserFactory from .utils imp...
# coding: utf-8 ''' # Criteria ## Pathogenic ### Pathogenic Very Strong * PVS1 null variant (nonsense, frameshift, canonical ±1 or 2 splice sites, initiation codon, single or multiexon deletion) in a gene where LOF is a known mechanism of disease ### Pathogenic Strong * PS1 Same amino acid change as a previously es...
# Copyright (c) 2019-2020, NVIDIA 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 agree...
import glob msvc = """ <PlatformToolset Condition="'$(VisualStudioVersion)'=='15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)'=='16.0'">v142</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v143</PlatformToolset> """.strip('\r\n').splitlines(...
from platforms.models import PlatformGroup, Platform from rest_framework import viewsets from platforms.api.serializers import PlatformGroupSerializer, PlatformSerializer class PlatformViewSet(viewsets.ModelViewSet): """ API endpoint that allows tenants to be viewed or edited. """ queryset = Platform...
from wtpy import WtEngine,EngineType from strategies.HftStraDemo import HftStraDemo if __name__ == "__main__": #创建一个运行环境,并加入策略 engine = WtEngine(EngineType.ET_HFT) engine.init('../common/', "config.yaml") engine.commitConfig() straInfo = HftStraDemo(name="hft_IF", code="CFFEX.IF.2104", ex...
# Copyright 2013 Red Hat, 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...
""" Cross validation functions supporting both MultichannelPipeline and scikit-learn predictors. """ import numpy as np import scipy.sparse as sp from sklearn.metrics import balanced_accuracy_score, explained_variance_score from sklearn.metrics import roc_auc_score from sklearn.preprocessing import LabelEncoder from ...
"""Everything related to building logic for the spires goes here""" from sc2.constants import SPIRE class BuildSpire: """Untested""" def __init__(self, main): self.controller = main async def should_handle(self): """Build the spire if only floating buildings left""" l...
import flask import base64, os from init import app,db import models @app.before_request def setup_csrf(): # make a cross-site request forgery preventing token if 'csrf_token' not in flask.session: flask.session['csrf_token'] = base64.b64encode(os.urandom(32)).decode('ascii') @app.before_request def...
# # Copyright (c) 2014 by Christian E. Hopps. # 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 appl...
"""Rutas del proyecto.""" from django.urls import path, include from rest_framework.authtoken.views import obtain_auth_token urlpatterns = [ path('', include('prueba_zxventures.api.urls')), path('auth/', obtain_auth_token, name='api_token_auth') ]
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # # Modifications: # Copyright David Halter and Contributors # Modifications are dual-licensed: MIT and PSF. # 99% of the code is different from pgen2, now. # # A fork of `parso.pgen2.generator`. # https...
import folium import geopandas import numpy as np import pandas as pd import plotly.express as px import streamlit as st from datetime import datetime from folium.plugins import MarkerCluster from streamlit_folium import folium_static # ------------------------------------------ # Settings ...
import unittest import testRObject import testVector import testArray import testDataFrame import testFormula import testFunction import testEnvironment import testRobjects import testMethods import testPackages # wrap this nicely so a warning is issued if no numpy present import testNumpyConversions def suite(): ...
import re import django.dispatch from forum.modules import get_modules_script_classes from forum.authentication.base import AuthenticationConsumer, ConsumerTemplateContext class ConsumerAndContext: def __init__(self, id, consumer, context): self.id = id self._consumer = consumer if context...
# Copyright 2013 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. class Metric(object): """Base class for all the metrics that are used by telemetry measurements. The Metric class represents a way of measuring somethin...
# 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! *** from enum import Enum __all__ = [ 'Status', ] class Status(str, Enum): """ Private link connection state. """ APPROVED = "Approv...
# Copyright 2017 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 python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'PersonalGallery.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Djan...
from os.path import join, dirname, abspath, isfile, pardir from environs import Env env = Env() SRC_DIR = abspath(dirname(__file__)) BASE_DIR = abspath(join(SRC_DIR, pardir)) ENV_FILENAME = join(BASE_DIR, ".env") if isfile(ENV_FILENAME): env.read_env(ENV_FILENAME) MONGO_URL = env.str("MONGO_URL", "mongodb://db:2...
# Generated by Django 2.0.8 on 2018-09-15 02:32 import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0009_alter_user_last_name_ma...
# -*- test-case-name: twisted.python.test.test_release -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Twisted's automated release system. This module is only for use within Twisted's release system. If you are anyone else, do not use it. The interface and behaviour will change without...
import numpy as np from tensorflow import keras import seaborn as sns import matplotlib.pyplot as plt import pickle from evaluation_metrics import hamming_loss from evaluation_metrics import example_based_accuracy import time from sklearn.metrics import confusion_matrix import time def plot_cm(y_true, y_pred, class_n...
# %% [markdown] # # Random forest # # In this notebook, we will present the random forest models and # show the differences with the bagging classifiers. # # Random forests are a popular model in machine learning. They are a # modification of the bagging algorithm. In bagging, any classifier or # regressor can be used....
import base64 from apistar import annotate, http from apistar.backends.sqlalchemy_backend import Session from apistar.interfaces import Auth from apistar.permissions import IsAuthenticated from .models import Admin, Publisher, Culinary auth = annotate(permissions=[IsAuthenticated()]) def get_token(session: Session...
import pytest import os import string import shell from hypothesis.database import ExampleDatabase from hypothesis import given, settings from hypothesis.strategies import text, lists, composite, integers from test_util import run, rm_whitespace, clone_source def setup_module(m): m.tempdir = clone_source() m.o...
import json from great_expectations.execution_engine import PandasExecutionEngine from great_expectations.expectations.expectation import ( ColumnMapExpectation, Expectation, ExpectationConfiguration, ) from great_expectations.expectations.metrics import ( ColumnMapMetricProvider, column_condition_...
from __future__ import annotations import numpy as np from pandas._libs import lib from pandas.core.dtypes.cast import maybe_downcast_numeric from pandas.core.dtypes.common import ( ensure_object, is_datetime_or_timedelta_dtype, is_decimal, is_integer_dtype, is_number, is_numeric_dtype, i...
#!/usr/bin/env python """Motion Prediction Node. Uses position data from the camera to estimate the velocity and acceleration of the ball. """ import rospy import math import tf2_ros import geometry_msgs.msg import turtlesim.srv from filterpy.kalman import KalmanFilter from filterpy.common import Q_discrete_white_noi...
from __future__ import absolute_import from libconfpacker.packagers.deb import DebianPackager from libconfpacker.packagers.build_config import BuildConfig from ... import helpers class TestDebianPackager(helpers.ConfpackerTestCase): def setUp(self): helpers.ConfpackerTestCase.setUp(self) self.bc = BuildCo...
""" Example of json-rpc usage with Wergzeug and requests. NOTE: there are no Werkzeug and requests in dependencies of json-rpc. NOTE: server handles all url paths the same way (there are no different urls). """ from werkzeug.wrappers import Request, Response from werkzeug.serving import run_simple from jsonrpc impo...
# Concord # # Copyright (c) 2019 VMware, Inc. All Rights Reserved. # # This product is licensed to you under the Apache 2.0 license (the "License"). # You may not use this product except in compliance with the Apache 2.0 License. # # This product may include a number of subcomponents with separate copyright # notices a...
# A multi-producer, multi-consumer queue. # define this exception to be compatible with Python 1.5's class # exceptions, but also when -X option is used. try: class Empty(Exception): pass class Full(Exception): pass except TypeError: # string based exceptions # exception raised by get(b...
import datetime from app import db from app.models.base.base import BaseModel class ShareReportModel(db.Model, BaseModel): __bind_key__ = "a_social" __tablename__ = "share_report" id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, default=0) report_name_id = db.Column(d...
# encoding: utf-8 ''' Created on 2016/01/31 @author: oreyou ''' from datetime import datetime import math import re import cStringIO import csv import types class ValueEstimator(object): ''' 文字列を受け入れられるか検証するもの ''' def __init__(self, nullable = True): ''' 初期化 ...
print("vasanthi") print("vasanthiyerramothu@gmail.com")
from enum import Enum class GenderChoices(Enum): male = 'male' female = 'female' none = '' class CivilStatChoices(Enum): single = 'single' married = 'married' livein = 'livein' none = '' class PermChoices(Enum): user = 'user' group = 'group'
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT """ Display magnetometer data once per second """ import time import board import adafruit_lis3mdl i2c = board.I2C() # uses board.SCL and board.SDA sensor = adafruit_lis3mdl.LIS3MDL(i2c) while True: mag_x...
#!/usr/bin/env python from AgileCLU import AgileCLU from optparse import OptionParser, OptionGroup from operator import itemgetter import sys, os.path, string, urllib def sizeof_fmt(num): for x in ['bytes','KB','MB','GB','TB']: if num < 1024.0: return "%3.1f %s" % (num, x) num ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ ] setup_requirements = ['pytest-run...
# Copyright 2022 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, ...
# Whole Body Control - Hand make # Updated in 2020 1/4 # Author Junwen Cui / JameScottX # Other: import numpy as np import numba as nb if __name__ == '__main__': from qp_solver import * else: from comm.dynamics.qp_solver import * from comm.action.basis import R_Matrix def kd_cal(dis_,speed_des...
import os import torch import torch.nn as nn import Reader import Graph2Coo import GATModel import numpy as np import pickle as pk import Evaluation as eval import cross_layer_walk as clw transform = { '1':lambda a, b, c: a + (b + c), '2':lambda a, b, c: torch.mm(torch.mm(b, c.t()), a), '3':lambda a, b, c:...
""" Django settings for Blogalytics project. Generated by 'django-admin startproject' using Django 1.11.29. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ impo...
import logging import serial import time from .baseio import BaseIO from ..helpers import get_kwargs log = logging.getLogger("SerialIO") class SerialIO(BaseIO): def __init__(self, *args, **kwargs) -> None: self._serial_port = get_kwargs(kwargs, "device_path") self._serial_baud = get_kwargs(kwarg...
from olympia.lib.settings_base import * # noqa ENGAGE_ROBOTS = True EMAIL_URL = env.email_url('EMAIL_URL') EMAIL_HOST = EMAIL_URL['EMAIL_HOST'] EMAIL_PORT = EMAIL_URL['EMAIL_PORT'] EMAIL_BACKEND = EMAIL_URL['EMAIL_BACKEND'] EMAIL_HOST_USER = EMAIL_URL['EMAIL_HOST_USER'] EMAIL_HOST_PASSWORD = EMAIL_URL['EMAIL_HOST_P...
import torch import torch.nn as nn from einops.einops import rearrange from .backbone import build_backbone from .utils.position_encoding import PositionEncodingSine from .loftr_module import LocalFeatureTransformer, FinePreprocess from .utils.coarse_matching import CoarseMatching from .utils.fine_matching import Fine...
import logging from collections import defaultdict import networkx import pyvex from . import Analysis, register_analysis from .code_location import CodeLocation from ..errors import SimSolverModeError, SimUnsatError, AngrDDGError from ..sim_variable import SimRegisterVariable, SimMemoryVariable, SimTemporaryVariable...
from .packet1 import * from .packet3 import * from .packet4 import * from .packet5 import * from .packet6 import * from .packet10 import * from .packet2a import * from .packet32 import * from .packet2 import * from .packet7 import * from .packet8 import * from .packet9 import * from .packet14 import * from .packetA im...
'''OpenGL extension NV.copy_image Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_NV_copy_image' _DEPRECATED = False glCopyImageSubDataNV = pl...
import unittest from datetime import datetime from main.block import Block from main.blockchain import BlockChain, first_proof class BlockChainTest(unittest.TestCase): def test_creation(self): blockchain = BlockChain(address='my-address') chain = blockchain.chain self.assertEqual(len(chai...
import json import pytest import base64 from libtaxii import messages_10 as tm10 from libtaxii import messages_11 as tm11 from libtaxii.constants import ( ST_UNAUTHORIZED, ST_BAD_MESSAGE, CB_STIX_XML_111, RT_FULL) from opentaxii.taxii.http import HTTP_AUTHORIZATION from opentaxii.utils import sync_conf_dict_into_...
# -*- coding: utf-8 -*- # @Time : 2019-12-27 # @Author : mizxc # @Email : xiangxianjiao@163.com from mongoengine import * class Album(Document): title = StringField(max_length=60, required=True) number = IntField(required=True) isShow = BooleanField(default=True) # 是否显示 introduction = StringFie...
#!/usr/bin/env python3 # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2016 The DigiByte Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ imp...
# Python has a number of other, more comlicated datatypes # Here, we will talk about lists # A list is a datatype that is an ordered container for # information, # Create with square brackets and seperate each item with a # comma myList = ["Juan", "Rogier","Ying"] # A list can be empty emptyList = [] # It can cont...
# -*- coding: utf-8 -*- # # Copyright 2021 Google LLC. 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 requir...
""" Tool Parameter specific sanitizing. """ import logging import string import galaxy.util log = logging.getLogger(__name__) class ToolParameterSanitizer: """ Handles tool parameter specific sanitizing. >>> from galaxy.util import XML >>> sanitizer = ToolParameterSanitizer.from_element(XML( ....
from os.path import join from os import walk from sys import argv as CLIARGS rootdir = CLIARGS[1] if "-e" in CLIARGS or "--only-errors" in CLIARGS: onlyErrors = True else: onlyErrors = False if "-f" or "--fuzz" in CLIARGS: fuzzIndex = None if "-f" in CLIARGS: fuzzIndex = CLIARGS.index("-f") ...
"""Window for choosing record to use in fit data.""" from typing import List, Callable import toga from eddington import FitData from toga.style import Pack from toga.style.pack import COLUMN from eddington_gui.boxes.line_box import LineBox from eddington_gui.consts import LINE_HEIGHT, SMALL_PADDING, RECORD_WINDOW_SIZ...
# 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 HyperflexPreDeplo...
from datetime import datetime from typing import TYPE_CHECKING, Any, Dict, List, Optional from pydantic import BaseModel, Field, root_validator if TYPE_CHECKING: AnyUrl = str HttpUrl = str else: from pydantic import AnyUrl, HttpUrl class Category(BaseModel): """Data model for the `<category>` field...
import hashlib fn = input("Enter a file: ") f = open(fn,encoding="UTF-8").read() out = open("log_{}_{}.txt".format(fn,hashlib.md5(fn.encode()).hexdigest()),"w") lines = f.split("\n") done = [] totale = 0 for l in lines: if l.startswith("!") or l == "": continue if l in done: out.write("Dup: {}\n".format(l)) if "...
#!/usr/bin/env python # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (t...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
from __future__ import absolute_import import contextlib import errno import io import locale # we have a submodule named 'logging' which would shadow this if we used the # regular name: import logging as std_logging import os import posixpath import re import shutil import stat import subprocess import sys import tar...
""" Support for MQTT climate devices. For more details about this platform, please refer to the documentation https://home-assistant.io/components/climate.mqtt/ """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.components import mqtt, climate from homeassistant.c...
import cmd_args from option_saver import OptionSaver class OptionBase(object): def __init__(self): self._opt = {} self._default_opt = {} self._opt_names = set() self.init_default_options() pass def init_default_options(self): pass def set_option(self, nam...
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import tempfile import threading import time import unittest import warnings from unittest import mock from django.conf import settings from django.core...
import socket from threading import Thread HEADER_LENGTH = 10 client_socket = None def connect(ip, port, my_username, error_callback): """ Connects to the server """ global client_socket # Create a socket (socket.AF_INET == IPv4 (options: AF_INET6, AF_BLUETOOTH, AF_UNIX)) client_socket = soc...
import os import sys import subprocess from pathlib import Path import Utils from io import BytesIO from urllib.request import urlopen class VulkanConfiguration: requiredVulkanVersion = "1.2.170.0" vulkanDirectory = "./PepperMint/vendor/VulkanSDK" @classmethod def Validate(cls): if (not cl...
from argparse import ArgumentParser from string import ascii_letters, digits from random import randint, choice from requests import get, post from requests_html import AsyncHTMLSession as a from threading import Thread # get 600 http(s) proxies, lists fplproxies.py async def 一(): return await a().get('https://free-p...
import typing import json import os import warnings import pandas as pd import numpy as np from .base import AbstractAdapter import dalmatian class FirecloudAdapter(AbstractAdapter): """ Job input adapter Parses inputs as firecloud expression bois if enabled, job outputs will be written back to workspa...
from abc import ABC, abstractmethod from typing import AsyncContextManager, Collection, NamedTuple, Optional, Tuple from eth_enr import ENRAPI, ENRDatabaseAPI from eth_keys import keys from eth_typing import NodeID from ddht.base_message import AnyInboundMessage, BaseMessage from ddht.endpoint import Endpoint from dd...
# -*- coding: utf-8 -*- """ Sahana Eden Members Model @copyright: 2012 (c) Sahana Software Foundation @license: MIT 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 ...
from dfp.model.Patch import Patch2, PARAM_MATCHER, TRANSFORM_BEFORE CUSTOM_PATCHES = [ # Changes maintainer instructions to label, e.g.: MAINTAINER John email@email.com ---> LABEL maintainer="John email@email.com" Patch2( before=f"MAINTAINER{PARAM_MATCHER}", after=f"LABEL", is_combinabl...
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This scaffolding model makes your app work on Google App Engine too ######################################################################...
from simtk.openmm import app from pdbfixer import PDBFixer fixer = PDBFixer(pdbid="2z9j") fixer.removeChains(chainIds=['B']) fixer.removeHeterogens(keepWater=False) app.PDBFile.writeFile(fixer.topology, fixer.positions, open("input/2z9j_clean.pdb", "w"))
""" Logic regarding the various sampling techniques, in particular: * Tick Bars * Volume Bars * Dollar Bars * Tick Imbalance Bars * Volume Imbalance Bars * Dollar Imbalance Bars * Tick Run Bars * Volume Run Bars * Dollar Run Bars """ from mlfinlab.data_structures.standard_data_structures import get_tick_bars, get_dol...
from . import util import os import numpy as np import random import sys from alphafold.common import protein from alphafold.model import data from alphafold.model import config from alphafold.model import model from typing import List, NoReturn from absl import logging def set_config( use_templates: bool, ...
"""dmp_main.py This file calls in the various classes required to solve, simulate, and compute IRFs for the DMP model specified in dmp_model.py. """ from dmp_model import dmp_model from dmp_simulator import dmp_simulator from dmp_solver import dmp_solver from dmp_irf import dmp_irf # solve the model solver = dmp_s...
import numpy as np import pandas as pd import soundfile as sf from pathlib import Path import librosa from audiomentations import * import torch.utils.data as torchdata from config import CFG import time class WaveformDataset(torchdata.Dataset): def __init__( self, df: pd.DataFrame, da...