content stringlengths 5 1.05M |
|---|
import asyncio
import os
from collections import OrderedDict
from contextlib import contextmanager
try:
import skein
except ImportError:
raise ImportError(
"'%s.YarnClusterManager' requires 'skein' as a dependency. "
"To install required dependencies, use:\n"
" $ pip install dask-gatew... |
from .JWTAuthentication import JWTAuthentication |
'''
Author: xmh
Date: 2021-01-24 20:21:07
LastEditors: xmh
LastEditTime: 2021-01-27 10:47:25
Description:
FilePath: \gpt2-pytorch\main\main.py
'''
# -*- coding: utf-8 -*-
# @Author : xmh
# @Time : 2021/1/24 20:21
# @File : main.py
"""
file description::
"""
from data_loader.encoder import get_encoder
from m... |
"""
<your resource name> API Service Test Suite
Test cases can be run with the following:
nosetests -v --with-spec --spec-color
coverage report -m
"""
import os
import logging
from unittest import TestCase
from unittest.mock import MagicMock, patch
from tests.factories import AccountFactory, AddressFactory
from se... |
# Holds the visualisation code:
# Idea is you will see a white room with lots of bouncy balls
#### PROJECT GOALS ####
# See the difference in pressure caused by Bernoulli at a molecular level
# The current code will only be in 2D, there should be a sequel in 3D
# Home screen
# tools to interact with balls:
# - cli... |
# Python Standard Library Imports
import calendar
import datetime
def start_of_quarter(dt):
y, m, d = dt.year, dt.month, dt.day
quarter_starts = (
datetime.date(y, 1, 1),
datetime.date(y, 4, 1),
datetime.date(y, 7, 1),
datetime.date(y, 10, 1),
)
for soq in quarter_sta... |
# You are given the following information, but you may prefer to do some research for yourself.
# 1 Jan 1900 was a Monday.
# Thirty days has September,
# April, June and November.
# All the rest have thirty-one,
# Saving February alone,
# Which has twenty-eight, rain or shine.
# And on lea... |
class AbstractUploadBackend(object):
BUFFER_SIZE = 10485760 # 10MB
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def setup(self, filename, *args, **kwargs):
"""Responsible for doing any pre-processing needed before the upload
starts."""
def update_filename(self, ... |
#!/usr/bin/env python3
import os
import time
import logging
import requests
from emoji import emojize
from functools import wraps
from pssh.clients import SSHClient
from pssh.exceptions import AuthenticationException
from requests.exceptions import RequestException
from telegram import ReplyKeyboardMarkup, ChatAction, ... |
from datetime import datetime
from itertools import chain
import argparse
import copy
import io
import logging
import os
import pickle
import re
import socket
import time
import random
from tensorboardX import SummaryWriter
import numpy as np
import pika
import torch
from scipy.signal import lfilter
from dotaservice.... |
""" Script for orlov anat browndust packages. """
import os
import logging
# flake8: noqa
# pylint: disable=no-name-in-module
# pylint: disable=unused-import
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=E0401
from anat.utility import POINT, TMP_REFERENCE_DIR
... |
import os
import dotenv
import pytesseract
import requests
from PIL import Image
dotenv.load_dotenv(r"../../config/env-api.env")
def get_token_from_api():
oauth_docs_user = os.getenv("OAUTH_DOCS_USER")
oauth_docs_pwd = os.getenv("OAUTH_DOCS_PWD")
url = "https://watxaut.com/api/v1/token"
params = {"... |
# -*- coding: utf-8 -*-
"""
Implements general single-atom calculations
This module calculates single (isolated) atom properties of all alkali metals in
general. For example, it calculates dipole matrix elements, quandrupole matrix
elements, etc. Also, some helpful general functions are here, e.g. for saving
and load... |
from ray.rllib.agents.ppo import ppo
from ray.rllib.agents.trainer import with_base_config
from ray.rllib.optimizers import TorchDistributedDataParallelOptimizer
"""Decentralized Distributed PPO implementation.
Unlike APPO or PPO, learning is no longer done centralized in the trainer
process. Instead, gradients are co... |
# All these are reqiured for actual NULL:
# null=True, default=None, blank=True
# Goddammit.
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
import datetime
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
class Pro... |
from setuptools import find_packages
from setuptools import setup
from pip._internal.req import parse_requirements
import os
with open("README.md", "r") as fh:
long_description = fh.read()
# Pulls pip packages with versions from the requirements file
install_requires = parse_requirements("requirements.txt", sess... |
''' be sure to check the .eapi.conf hosts file to see the list of variables that are
being used to set up the environment for connecting to the devices'''
import pyeapi
from pprint import pprint
pynet_sw3 = pyeapi.connect_to("pynet-sw3")
pynet_sw4 = pyeapi.connect_to("pynet-sw4")
pynet_sw3.get_config()
my_config =... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import nacl.signing
def write_array(arr: []) -> str:
buff = ""
i = 0
while i < 32:
buff += arr[i]
if i != 31:
buff += ", "
i += 1
if i % 8 == 0:
buff += "\n "
return buff
def main(... |
#Bot to forward tweets from Twitter to Parler
#This should effectively make this account a Twitter client
#NOTE: I initially made some typos spelling "parley" as "parlay." I intend to fix them soon. Look out for them!
from parler import Parler
import tweepy
import time
import datetime
import pickle
import re
#Parler a... |
import FWCore.ParameterSet.Config as cms
hltPFMETJetCorrector = cms.EDProducer("ChainedJetCorrectorProducer",
correctors = cms.VInputTag("hltPFMETJetCorrectorL1", "hltPFMETJetCorrectorL2", "hltPFMETJetCorrectorL3")
)
|
from fraction_ed.fraction_ed import Fraction, lcd, gcf, sum, Mixed
|
from floodsystem.geo import stations_by_distance
from floodsystem.stationdata import build_station_list
def run():
stations = build_station_list()
p = (52.2053, 0.1218)
x = stations_by_distance(stations, p)
y = []
for i in x:
y.append((i[0].name, i[0].town, i[1]))
print(y[:10]... |
import os
import sys
import json
import os.path
__DEBUG = False
__RUN_MODE = ''
__env_mode = os.getenv('TSADM_MODE')
if __env_mode == 'test' or __env_mode == 'dev':
__RUN_MODE = __env_mode
if __env_mode == 'dev':
__DEBUG = True
__BASE_DIR = os.path.join('/opt', 'tsadm'+__RUN_MODE, 'webapp')
__ETC_DIR = os.pat... |
from django.test import Client
from django.test import TestCase
from django.urls import reverse
from .models import Profile
class RegisterTests(TestCase):
def setUp(self):
self.client = Client()
def test_register_page_status_code(self):
response = self.client.get(reverse('register'))
... |
# coding: utf-8
"""
Masking API
Schema for the Masking Engine API # noqa: E501
OpenAPI spec version: 5.1.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import... |
from typing import Sequence, Set
from mockdown.constraint import IConstraint
# from mockdown.instantiation.normalization import normalize_multiplier
from mockdown.instantiation.types import IConstraintInstantiator
from mockdown.instantiation.prolog.logic import valid_constraints
from mockdown.instantiation.visibility ... |
import logging
from core import Rule, Rules, DefaultRulesEngine, Facts, MODEPASSALL
logger = logging.getLogger(__name__)
class TestRule(Rule):
def __init__(self):
self.name = "test rule"
self.priority = 1
def condition(self, **kwargs):
if 'a' in kwargs and kwargs['a'] > self.priorit... |
from django.test import SimpleTestCase
from django.urls import reverse, resolve
from chat.views import room, index
class TestUrls(SimpleTestCase):
def test_urls(self):
url = reverse('room', args=['some-slug'])
print(resolve(url))
|
import multiprocessing
import threading
import pygame
from pygame.locals import *
import os
import os.path
import random
import time
from tkinter import Tk
import math
from copy import deepcopy
class Board():
def __init__(self):
self.dark_square = pygame.image.load(os.path.join("texture... |
"""empty message
Revision ID: 0a88ad0f29e0
Revises: 298bbf22bdb8
Create Date: 2017-04-04 12:59:27.234320
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0a88ad0f29e0'
down_revision = '298bbf22bdb8'
branch_labels = None
depends_on = None
def upgrade():
# ... |
ogrenciler = ["Barış","Ayşe","Aydan","Mert","Kerem"]
#Listedeki eleman sayısını bilmiyoruz varsayalım
for a in rane(len(ogrenciler)):
print(ogrenciler[a]) |
import os
import glob
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
from realtimenet import camera
from realtimenet import engine
def set_internal_padding_false(module):
"""
This is used to turn off padding of steppable convolution layers.
"""
if hasattr(module, "... |
from flask import render_template,request,redirect,url_for,abort
from flask_login import login_required,current_user
from .. import db
from .froms import BlogForm,commentForm
from . import main
from ..models import User,BlogPost
import markdown2
@main.route('/')
def index():
'''
route that displays the blogpost
'''... |
# Copyright 2021 Edoardo Riggio
#
# 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 writin... |
##############################################################################
# Copyright 2013-2020 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 PyArrow(PythonPa... |
#!/usr/bin/python
import itertools
data = [1, 2, 3, 4, 5, 6, 7, 8]
result = itertools.accumulate(data, operator.mul)
for each in result:
print(each)
|
# Generated by Django 2.2.24 on 2022-01-10 18:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sponsors', '0067_sponsorbenefit_a_la_carte'),
]
operations = [
migrations.AlterField(
model_name='sponsorship',
nam... |
"""Provisioning for SQLAlchemy Testing Suite."""
# coding=utf-8
import os
from uuid import uuid4
from sqlalchemy.engine import url as sa_url
from sqlalchemy.testing.provision import create_db
from sqlalchemy.testing.provision import drop_db
from sqlalchemy.testing.provision import follower_url_from_main
from sqlalche... |
# tokenkeycode.py というファイル名で以下の行を保存する
# TOKEN = 'xxxxxxxxxxxxxxxxxxxxxxxx.yyyyyy.zzzzzzzzzzzzzzzzzzzzzzzzzzz'
inputchannel = '凸報告'
outputchannel = '状況報告'
BossName = [
'ゴブリングレート',
'ライライ',
'シードレイク',
'スピリットホーン',
'カルキノス',
]
#最大攻撃数
MAX_SORITE = 3
BATTLESTART = '06/25'
BATTLEEND = '06/29'
LevelUpLap =... |
class Relationship:
def __init__(self, unitNumber):
self.unitNumber = unitNumber |
import os
from . import app, aac
from flask import g, current_app, send_from_directory, send_file, request, abort, url_for
from flask.json import jsonify
@app.teardown_appcontext
def close_connection(exception):
aac().renderer.library.close()
@app.errorhandler(500)
def page_not_found(e):
aac().render('50... |
import tkinter as tk
root = tk.Tk()
# stacks under each other by order
frm_biggest = tk.Frame(master=root, width=200, height=200, background="green")
frm_biggest.pack()
frm_mid = tk.Frame(master=root, width=100, height=100, background="aquamarine")
frm_mid.pack()
frm_small = tk.Frame(master=root, width=50, height=5... |
import sys
import requests
import json
def getToken():
url = 'http://xxxxxxxx:8080/api/auth/login'
headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}
loginJSON = {'username': 'tenant@thingsboard.org', 'password': 'tenant'}
tokenAuthResp = requests.post(url, headers=headers, js... |
##urls for kannada
from django.urls import path
from . import views
urlpatterns = [
path("",views.index),
path("profile/", views.profile),
path("signUp/", views.signUp),
path("logout/",views.logout, name="log_kn"),
path("profiles/",views.signCompleted),
path("profile/charity/", views.charity)... |
import os
import re
from os import environ
basedir = os.path.abspath(os.path.dirname(__file__))
JSON_SORT_KEYS = False # CRITICAL. Do not sort the data when returning values to the front end.
# The API_TOKEN is used to ensure that the
# workflow synch can work without a lot of
# back and forth.
# you may want to c... |
from random import randint
# list of play options
play = ["Rock", "Paper", "Scissors"]
<<<<<<< master
# list of messages
messages = ["Tie!", "You win!", "You lose!"]
# game rule
winning_rule = {"Rock": "Scissors", "Paper": "Rock", "Scissors": "Paper"}
# get the user input
player = input("Rock", "Paper", "Scissors? ... |
import unittest
from babelvueextractor.lexer import Lexer, Token, TOKEN_TEXT, TOKEN_VAR, TOKEN_COMMENT, TOKEN_RAW_HTML, TOKEN_CONST, \
TOKEN_DOUBLE_WAY_BINDING, TOKEN_DIRECTIVE
class TestLexer(unittest.TestCase):
def assertTokensEqual(self, t_a, t_b):
for t1, t2 in zip(t_a, t_b):
self.asse... |
import views
if __name__ == '__main__':
views.app.secret_key = 'super_secret_key'
views.app.debug = True
views.app.run(host='0.0.0.0', port=5000)
|
from PIL import Image
from abc import ABCMeta
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.utils.translation import ugettext as _
from django import forms
from binder.json import jsonloads, JsonResponse
from binder.exceptions import BinderValidationError
from binder.router import... |
import discord
def embed_Move_Details(char_name, char_url, char_moveIcon, char_imgur, char_move,
char_guard, char_dmg, char_startup, char_active, char_recovery, char_advantage, char_notes):
embed = discord.Embed(title=char_name.title() + " Frame Data (DustLoop)",
... |
from typing import *
import numpy as np
from numpy import ndarray
from . import _tensor
if TYPE_CHECKING:
from _tensor import Tensor
def filter_types(objs, types: Union[Type, Tuple[Type]]):
return filter(lambda x: isinstance(x, types), objs)
class Context:
def __setitem__(self, key, value):
sel... |
import tensorflow as tf
import numpy as np
import os
import time
from importlib import import_module
from utils import Logger
from algorithms.ddpg.explore import ExploreScheduler
def train(env, Agent, agent_params, train_params, exp_dir, run_id, use_gpu, use_actor_ray=False):
"""
Train DDPG-type ag... |
# This file contains all the matlab_Surfstat* wrapper functions. Some of
# them are not yet implemented
import matlab.engine
import matlab
import numpy as np
import math
import sys
sys.path.append("python")
sys.path.append("matlab")
def matlab_init_surfstat():
global surfstat_eng
surfstat_eng = matlab.engine.... |
###########################################################################
#
# 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
#
# https://www.apache.org... |
import os
import yaml
def parse_config(filepath):
if not os.path.exists(filepath):
raise FileNotFoundError(f'Config file {filepath} does not exist.')
# Not wrapping in a try/except so that we get the
# yaml library to raise any issues on parsing
with open(filepath, 'r') as f:
config =... |
from django.test import TestCase
from eventex.subscriptions.forms import SubscriptionForm
class SubscriptionFormTest(TestCase):
def setUp(self):
self.form = SubscriptionForm()
def test_form_has_fields(self):
"""Form must have 4 fields"""
expected = ["name", "cpf", "email", "phone"]
... |
# -*- coding: utf-8 -*-
# Copyright © 2014, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
import warnings
import numpy... |
# Interface do programa
from typing import List, Tuple
from tkinter.ttk import (Progressbar, Frame, Button, Label, Entry)
from tkinter import (Tk,
NW,
Canvas,
IntVar,
DoubleVar,
StringVar,
Photo... |
/anaconda/lib/python3.6/rlcompleter.py |
from textwrap import dedent
def test_discover_command(tmpdir, runner):
runner.write_with_general(dedent('''
[storage foo]
type = filesystem
path = {0}/foo/
fileext = .txt
[storage bar]
type = filesystem
path = {0}/bar/
fileext = .txt
[pair foobar]
a = foo
b = bar
... |
# Copyright (c) 2021. Nicolai Oswald
# Copyright (c) 2021. University of Edinburgh
# 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 must retain the above co... |
# -*- coding: utf-8 -*- #
# Copyright 2014 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... |
import os
import numpy as np
import pytest
from moviepy.video.io.bindings import mplfig_to_npimage
from moviepy.video.VideoClip import VideoClip
from tests.test_helper import TMP_DIR
try:
import matplotlib
except ImportError:
matplotlib = None
@pytest.mark.skipif(not matplotlib, reason="no matplotlib")
d... |
from __future__ import annotations
from typing import Union, Optional
import numpy as np
from sklearn.tree import DecisionTreeClassifier
class RandomForest:
"""Random Forest Classifier
Parameters:
-----------
n_estimators: int = 10
The number of trees in the forest.
n_features: Optional[Un... |
from django.http import HttpResponse
from django.shortcuts import render
from rest_framework import viewsets
from .serializers import StockUserSerializer
from .serializers import StockMarketSerializer
from .serializers import StockItemListSerializer
from .serializers import StockItemSerializer
from .models import ... |
import login
client = login.login()
# NorthBound API call to get all users
user_list_result = client.user.getUsers()
# Serialize the model object to a python dictionary
users = client.serialize(user_list_result)
print(users) |
from past.builtins import cmp
from builtins import str
from common.k8s.base import BaseK8sTest
from tcutils.wrappers import preposttest_wrapper
import test
import re
import json
import time
from pprint import pprint
from tcutils.util import get_random_name
from tcutils.contrail_status_check import ContrailStatusChecker... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
"""batched collective operations for overhead amortization and better
bandwidth utilization"""
import math
from typing import List
import torch
from torch import Tensor
import torch.distributed
from torch.distributed import ProcessGroup
import torch.nn.functional
from deepspeed.utils import instrument_w_nvtx
from de... |
import pytest
from chouette_iot.metrics._merger import MergedMetric, MetricsMerger
@pytest.fixture
def metrics_values(raw_metrics_values):
"""
Returns a list of metrics bytes objects cleaned of timestamps,
one message that is not parceable to JSON and one message that
can't be cast to a RawMetric ins... |
from pydantic import BaseModel
from pydantic import Field
__all__ = [
"MySqlConfig",
]
class MySqlConfig(BaseModel):
host: str = "127.0.0.1"
port: int = Field(3306, gt=0, lt=65536)
database: str = "asteriskcdrdb"
user: str
password: str
|
import numpy as np
import torchio
import torchio.transforms as iotf
import torchvision
class CTTransforms(object):
'''built on torchio
https://torchio.readthedocs.io/index.html
'''
def __init__(self, is_train, slice_num, img_size,
mean=[0.5,0.5,0.5], std=[0.5,0.5,0.5],
... |
"""
A propery object to be used inside a class
Author: Friedrich Schotte
Date created: 2018-11-01
Date last modified: 2019-03-06
"""
from logging import debug,warn,info,error
__version__ = "2.0.1" # debug messages
def thread_property(method):
"""A property representing an task to be run in background"""
name =... |
import sys
import re
def increment_count(dict, key):
"""Increments the associated key value in a dictionary where keys are strings
and values are integer counts.
Arguments:\n
dict -- a dictionary of string (key), count (value) pairs\n
key -- the key whose count should be incremented\n
"""
... |
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "argoid-client",
version = "1.2.0",
author = "Wim Muskee",
author_email = "wimmuskee@gmail.com",
url = "https://github.com/wimmuskee/argoid",
... |
from .linear_fct import slope
from .linear_fct import intercept
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2019-12-19 10:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('surveys', '0004_set_form_id'),
]
operations = [
migrations.AlterField(
... |
import asyncio
from pyrogram import Client, idle
from . import anibot
from .utils.db import _close_db
async def main():
await asyncio.gather(anibot.start())
await idle()
await asyncio.gather(anibot.stop())
_close_db()
asyncio.get_event_loop().run_until_complete(main()) |
import collections
Action = collections.namedtuple('Action', 'action value')
file = open('./input.txt', 'r')
string = file.read()
actions = list(map(lambda x: Action(x[:1], int(x[1:])), string.split('\n')))
# The ship starts by facing east.
x = 0
y = 0
direction = 0 # east
def move(action):
global x
global y
... |
import numpy as np
import torch
import torch.nn as nn
def gaussian_1d(k_size, sigma):
kernel = np.array([1/(sigma*np.sqrt(2*np.pi))
* np.exp(-(((x - k_size//2) / sigma)**2)/2)
for x in range(k_size)])[..., None]
return kernel / np.sum(kernel)
def gaussian_2d(k_s... |
from django.apps import AppConfig
class SubscribeConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Apps.Subscribe'
|
# -*- coding: utf-8 -*-
"""Module with launch utitlies for the CLI."""
import click
from .display import echo_process_results
def launch_process(process, daemon, **inputs):
"""Launch a process with the given inputs.
If not sent to the daemon, the results will be displayed after the calculation finishes.
... |
# -*- coding:utf-8 -*-
from controller.base import MainHandler, HeartbeatHandler
from controller import AuthController, AgentController, PackageController
urls = [
(r"/", MainHandler),
(r"/heartbeat", HeartbeatHandler),
(r"/auth/login", AuthController.LoginHandler),
(r"/auth/logout", AuthController.Lo... |
# coding=utf-8
import importlib
# import unittest
import os
import xml.etree.ElementTree as ET
from time import time
from unittest import TestSuite
from SRC import settings
from SRC.common.const import RunModel, RunResult, RunStatus
from SRC.common.exceptions import ReadParamFileException
from SRC.common.fileHelper im... |
#! /bin/env python
import os, math, operator
import optparse, sys
import PEAT_SA.Core as Core
#In KJ per mol kelvin
GasConstant = 8.314472E-3
def VitalitiesForDrug(drugData, substrateData, combination='Average', verbose=True):
print '\nCalculating vitalities for %s' % drugData
print '\nUsing %s of substrate val... |
import zerorpc
from tagger_fe import search
class TaggerMail(object):
"""Python class containing the method calls for application
functionality.
"""
def say_hello(self):
return "Hello, World!"
def do_search(self, search_string, path):
res = search(search_string, path)
r... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2021-Today
@author: marie-christin.wimmler@tu-dresden.de
"""
from TreeModelLib.BelowgroundCompetition.SimpleNetwork import SimpleNetwork
from TreeModelLib.BelowgroundCompetition.FixedSalinity import FixedSalinity
from ProjectLib.Logger import method_logger
# ... |
from ambre.design.workflow import ambre_run, CONFIG
from collections import defaultdict
import sys
CONFIG.param['reference_fpath'] = sys.argv[2]
CONFIG.update(sys.argv[1])
regions_fpath, temp_tag = sys.argv[3], sys.argv[4]
multiplex_fpath = "%s.multiplx.out"%temp_tag
w = ambre_run(regions_fpath, temp_tag)
primer_set... |
import numpy as np
import pandas as pd
import time
import matplotlib.pyplot as plt
import seaborn as sns
import random
from bayes_opt import BayesianOptimization
import os, sys
sys.path.insert(1, os.path.join(sys.path[0], '../dataset'))
from crypto_data_loader import get_candles
sns.set()
use_csv = False
def get_sta... |
# coding:utf-8
import requests
import os
import time
from threading import Thread
from collections import deque
from bs4 import BeautifulSoup
import seafile_api
from io import BytesIO
session = requests.Session()
img_url_list = deque()
def get_girl_list():
response = session.get("http://www.win400... |
import pytest
##################
## Import files ##
##################
from tree import BinaryTree
from node import TreeNode
from binary_tree import BinarySearchTree
#########################
## Assert Imports Work ##
#########################
def test_node():
assert TreeNode(1)
def test_tree():
assert BinaryT... |
import json
import sseclient
import urllib3
def open_stream(url, headers):
"""Get a streaming response for the given event feed using urllib3."""
http = urllib3.PoolManager()
return http.request('GET', url, preload_content=False, headers=headers)
if __name__ == '__main__':
# match the url from the bl... |
import re
from ..graph_helper import get_label, reserve_and_get_next_available_numbered_node_name, attr_encode, attr_decode
from .. import DecisionGraphNode, decision_graph_from_agraph
class SuccessorCategoryNode(DecisionGraphNode):
def __init__(self, category, successors=()):
super(SuccessorCategoryNode... |
class OperatorUtils():
@classmethod
def apply_assignment_op(cls, left, op, right):
if op == "=":
return right
elif op == "*=":
return left * right
elif op == "/=":
return left / right
elif op == "%=":
return left % right
eli... |
import io
from urllib.request import HTTPHandler, HTTPSHandler, ProxyHandler, Request
from http.client import HTTPResponse
import _py_wininet
from _py_wininet import Session, Stream
class WininetHandler(HTTPHandler, HTTPSHandler, ProxyHandler):
class Wrapper(io.RawIOBase):
def __init__(self, stream: Str... |
"""This module implements a port scan routine, run over a non-blocking
task queue in which units of work are delegated to daemon threads
"""
import socket
from threading import Lock
from brutus.models.BaseBrutusModule import BaseBrutusModule
from brutus.tasking.ThreadedTaskQueue import ThreadedTaskQueue
from brutus.u... |
import numpy as np
import pytest
from csbdeep.utils import normalize
from stardist.matching import matching, relabel_sequential
from stardist import calculate_extents, polyhedron_to_label
from utils import real_image2d, real_image3d
from stardist.geometry import polygons_to_label_coord
from stardist.big import BlockN... |
import unittest
import dataloader as dta
import models as mdl
import tensorflow as tf
import warnings
warnings.simplefilter('ignore')
class TestDataLoader(unittest.TestCase):
def setUp(self):
self.train_set, _ = dta.get_client_data('emnist',
'example',
... |
# Copyright 2014 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.
import telemetry.timeline.event as timeline_event
class Slice(timeline_event.TimelineEvent):
"""A Slice represents an interval of time plus parameters as... |
# Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.