content stringlengths 5 1.05M |
|---|
'''MemberManagerConfig class'''
from django.apps import AppConfig
class MemberManagerConfig(AppConfig):
'''MemberMangerConfig sets up the MemberManager app'''
name = 'member_manager'
verbose_name = 'Member Manager'
|
# coding=utf-8
import tensorflow as tf
from os import environ
environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
environ["CUDA_VISIBLE_DEVICES"] = "1, 2, 3, 4"
config = tf.ConfigProto(
device_count={"CPU": 4},
inter_op_parallelism_threads=1,
intra_op_parallelism_threads=4,
log_device_placement=True
)
conf... |
import sys
def main():
s = input()
print(s.count(' '))
if __name__ == '__main__':
main()
sys.exit(0)
|
from setuptools import setup, find_packages
import ml_bay12
setup(
name="ml_bay12",
description=ml_bay12.__doc__,
version=ml_bay12.__version__,
author="Open Mafia Team",
author_email="openmafiateam@gmail.com",
packages=find_packages(),
install_requires=[
# Skipping, as we have o... |
import numpy as np
class Momentum():
def __init__(self, lr = 5e-3, beta = 0.9):
self.lr= lr
self.beta = beta
def set_parameters(self, params):
self.parmeters = params
run_values = {}
for key in params.keys():
run_values[key] = 0
self.run_values = ru... |
import xarray as xr
import numpy as np
class InterpolateVariable:
"""Class instantiation of InterpolateVariable:
Here we will be interpolating the respective variable onto 1, 3, 5, and 7 km above ground level (AGL).
Attributes:
climate (str): Whether to interpolate variable in the ``current`` or... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='sight_machine',
version='0.5',
author="Denis Bajet",
author_email="dbajet@gmail.com",
description='Simple binary logger',
long_description=long_description,
long_description_conten... |
from actor.restore_actor import restore_actor
class Inventory:
def __init__(self, capacity=5):
self.item_bag = []
self.capacity = capacity
self.item_bag = [None for _ in range(self.capacity)]
def get_dict(self):
result = {}
result["capacity"] = self.capacity
it... |
from contextlib import redirect_stdout
def save_line_to_file(line, file_path, mode):
"""Save a string line(s) to a file.
Parameters
----------
line : string
The line(s) to save to a file.
file_path : string
The file path to save the line(s) to.
mode : string
Whether to ... |
import os
import pathlib
# get the path until the home directory
path_to_home = str(pathlib.Path().absolute())
# gets '/home/wizard/sandbox/'
cds = ''
index = len(path_to_home)
while index != 0:
# sets the env folder to whatever the path is + /env
env = f'{path_to_home[:index]}/env'
# checks whether env exists in... |
from setuptools import find_packages, setup
setup(
name='mlflowstone',
packages=find_packages(),
version='0.1.1',
license='MIT',
description='Object oriented api over mlflow tracking',
author='Luciano Lorenti',
url='https://github.com/lucianolorenti/mlflowstone',
install_requires=[
... |
# coding: utf-8
"""
Decision Lens API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import... |
"""
This test is trying to build a Y-shape pipe system in anuga-swmm
It has two inlet nodes in the same altitude and connect to one outlet node which is in lower altitude
and see how water flows in the simple system.
Using the same domain structure like previous testing "test_volume_inlet_op.py"
"""
# -... |
#--------------------------------------------------------------------------------------------
# Name:
# Purpose: This .py file creates a JSON formated file to push into a DB
# The file contains student data
#
# Required libs:
# Author: Konstantinos Oikonomou
#
# Created: 03/11/2016
#... |
"""
Demo: Calculate the kernel matrices on the MUTAG data.
"""
from os import path
from igraph import Graph
from graphkernels import kernels as gk
N_GRAPHS = 188
MUTAG_DIR = 'mutag'
THIS_DIR = path.dirname(__file__)
def gen_mutag_graph_paths():
yield from (
path.join(MUTAG_DIR, ('mutag_%d.graphml' % ... |
from file_util import read_lines
from print_aoc import finish_task1, finish_task2
from typing import Callable
def count_amount_of_ones(nums: list[str] | set[str], number_len=12) -> list[int]:
return [sum(num[i] == "1" for num in nums) for i in range(number_len)]
def task1(lines: list[str], number_len=12) -> int... |
# -*- coding:utf-8 -*-
from __future__ import absolute_import
import unittest
import os
import random
import tensorflow as tf
from pyxtools import list_files
try:
from pymltools.tf_utils import SmartImageIterator, ImageIteratorTestDemo
except ImportError:
from pymltools.pymltools.tf_utils import SmartImageI... |
#!/usr/bin/env python3
import os
import sys
from discord.ext import commands
from hangman_commands import HangmanCommands
class Hangman(commands.Bot):
def __init__(self, command_prefix="+"):
super().__init__(command_prefix)
self.add_cog(HangmanCommands(self))
if __name__ == "__main__":
try:
... |
__all__ = ['Encoder', 'Decoder', 'Multitask_AE'] |
from .rf_impute import *
from .synthesize import *
from .distance import *
|
#!/usr/bin/env python3
import click
import requests
import json
import shutil
import time
import zipfile
import os
@click.command()
@click.argument("links", nargs=1, type=click.Path(exists=True))
@click.argument("dst", nargs=1, type=click.Path(exists=True))
@click.argument("headers", nargs=1, type=click.Path(exists=... |
import torch
import torch.nn as nn
import torch.nn.functional as func
class DyNetNd(nn.Module):
r'''Implements dynamic convolution as introduced by Zhang et al.
(https://arxiv.org/abs/2004.10694). This version is implemented with conv2D.
Args:
in_size (int): input size
out_size (int):... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import ska_helpers
from .timbre import load_model_specs, get_full_dtype, get_local_model, c_to_f, f_to_c, setup_model, run_profile
from .timbre import calc_binary_schedule, create_opt_fun, find_second_dwell, run_state_pairs
__version__ = ska_helpers.get_... |
import pandas as pd
import numpy as np
import sys
import random
from pykalman import KalmanFilter
from STRATEGY.BaseTradeEngine import BaseTradeEngine
import statsmodels.api as sm
def get_src_cls(source_name):
return getattr(sys.modules[__name__], source_name)
class Kalman(BaseTradeEngine):
def __init__(... |
# Copyright 2015 refractionPOINT
#
# 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... |
"""
Use this for only unit test
"""
from builtins import object
class EmulatorHelper(object):
"""
Works as global value for the emulator switch.
WARNNING: This is not multi thread safe.
"""
#DO not change default values
LocalCouchDBData = None
ReqMonDBData = None
WMAgentDBData= None
... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse('user:create')
TOKEN_URL = reverse('user:token')
ME_URL = reverse('user:me')
def create_user(**params... |
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE
"""
This module defines a versionless model for ``TBasket``, including much of the
functionality of basket-reading.
Includes both "embedded" ``TBaskets`` (as a member of TBranch) and "free"
``TBaskets`` (top-level objects, located by ... |
import setuptools
def read_file(name):
with open(name, "r", encoding="UTF-8") as f:
return f.read().strip()
install_requires = read_file("./config/install_requires.txt").split('\n')
project_name = read_file("./config/project_name.txt")
version = __import__(project_name).__version__
long_descriptio... |
from datetime import datetime
from threading import Thread
from urllib.request import Request, urlopen
import atexit
import json
_format = '%Y-%m-%d %H:%M:%S.%f'
_file = None
_slack_url = None
_history = []
_cache_size = 2000
def init(filename, slack_url=None):
global _file, _slack_url
_close_logfile()
... |
"""
Tests for the conversions module. Updated by G.W. on 5/25/19.
"""
import chemics as cm
from pytest import approx
def test_massfrac_to_molefrac():
y = [0.36, 0.16, 0.20, 0.28] # mass fraction [-]
mw = [12.011, 1.008, 15.999, 14.007] # molecular weight [g/mol]
x = cm.massfrac_to_molefrac(... |
import apps.logging.request_logger as logging
from django.contrib.auth.models import User, Group
from django.core.exceptions import ValidationError
from django.db import models, transaction
from rest_framework import status
from rest_framework.exceptions import APIException
from apps.accounts.models import UserProfil... |
import unittest
import pytest
from andrew_is_hungry_for_py.eat import feedme
@pytest.mark.parametrize("input_date,expected", [
("2019-10-31", "Birthday Cake"),
("2019-10-01", "Cake"),
("2019-11-01", "Leftover Birthday Cake"),
])
def test_feedme(input_date, expected):
assert feedme(input_date) == expe... |
# Copyright 2020 The MediaPipe 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 ... |
# Import libraries
from pyspark.sql import SparkSession
from pyspark.sql.functions import isnan, count, when, col, desc, udf, col, sort_array, asc, \
avg, from_unixtime, split, min, max, round, lit, mean
from pyspark.sql.functions import sum as Fsum
from pyspark.sql.functions import ro... |
from jumpscale.packages.tfgrid_solutions.chats.flist import FlistDeploy
from solutions_automation.utils.gedispatch import GedisChatBotPatch
class FlistAutomated(GedisChatBotPatch, FlistDeploy):
NAME_MESSAGE = "Please enter a name for your workload (Can be used to prepare domain for you and needed to track your so... |
"""Application code."""
import connexion
import database
# Creating Flask app
app = connexion.FlaskApp(__name__, specification_dir=".")
# Initializing database
app.app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///:memory:"
database.db.init_app(app.app)
with app.app.app_context():
database.db.create_all()
# Ru... |
from invoke import Collection
from tasks import code
ns = Collection()
ns.add_collection(code)
|
import src.homework.homework10.main
|
# 329. Longest Increasing Path in a Matrix
# ttungl@gmail.com
class Solution(object):
def longestIncreasingPath(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: int
"""
# time: O(m*n)
# space: O(m*n)
# runtime: 392ms
if not matrix: return 0
... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
SpatialPositionModelDialog
A QGIS plugin
Compute spatial interaction models
-------------------
begin : 2017-05-15
git ... |
import platform
import psutil
from datetime import datetime
class GetBasicInputData:
__systemName: str
__systemBuild: str
__architectureOfOS: str
__deviceName: str
__lastTimeComputerBoot: str
__dateTimeOfDataEntry: str
def __init__(self):
currentComputer = platform.uname()
... |
from __future__ import print_function
import sys,os,csv,re,coral,array
from RecoLuminosity.LumiDB import argparse,sessionManager,CommonUtil,dataDML,revisionDML,nameDealer,dbUtil
DATABRANCH_ID=3
def patchV2(dbsession,runnum,inputpathnames,inputdata):
'''
inputpathnames: [pathname,]
inputdata: {cmslsnum:[pres... |
from pykern import pkio, pkjson
import glob
import re
# wget --recursive --no-clobber --page-requisites --html-extension --convert-links --domains ops.aps.anl.gov --no-parent https://ops.aps.anl.gov/manuals/elegant_latest/elegant.html
files = {}
models = {}
for html_file in glob.glob('manual/*.html'):
#print(ht... |
# --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Reading the file
data=pd.read_csv(path)
#Code starts here
#Creating a new variable to store the value counts
loan_status = data['Loan_Status'].value_counts()
print(loan_status)
#Plotting bar plot
plt.fi... |
class Solution(object):
def fib(self, N):
"""
:type N: int
:rtype: int
"""
if N == 0 or N == 1:
return N
# return self.fib(N - 1) + self.fib(N - 2)
f = [0] * (N + 1)
f[0] = 0
f[1] = 1
for i in range(2, N + 1):
f... |
# File name: hello.py
import kivy
kivy.require('1.9.0')
from kivy.app import App
from kivy.uix.button import Label
class HelloApp(App):
def build(self):
return Label(text='Hello World!')
if __name__=="__main__":
HelloApp().run()
|
"""This modules deals with cleaning up the titanic data."""
import re
import numpy as np
from pandas.core.frame import DataFrame
def clean_data(data: DataFrame) -> DataFrame:
"""
Clean the titanic data by converting all the data
into int64s.
Drops the passenger id since it does not contribute
to... |
# ******************************************************************************
# Copyright 2017-2018 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.apa... |
import requests
import glob
from pathlib import Path
import gzip
from bs4 import BeautifulSoup
from hashlib import sha256
from concurrent.futures import ProcessPoolExecutor as PPE
Path('job_description_htmls').mkdir(exist_ok=True)
def get_detail_job_description(url):
ha = sha256(bytes(url, 'utf8')).hexdigest()
... |
from .cne import CNE
__version__ = "0.0.dev"
|
import re
import json
from rest_framework import serializers, exceptions
from rest_framework.response import Response
from rest_framework.pagination import PageNumberPagination
from rest_auth.serializers import LoginSerializer
from django.utils.translation import ugettext_lazy as _
from mysite.settings import DEFAULT_... |
import random
class Board(object):
def __init__(self):
pass
def copy(self):
raise NotImplementedError("Method <copy> is not implemented for "+str(self.__class__))
class Player(object):
def __init__(self,name):
self.name = name
self.wins = 0
self.ties = 0
... |
#!/usr/bin/env python
# coding=utf-8
from selenium import webdriver
import os
import time
def auto_connect():
print('open a phantomJS browser...\n')
browser = webdriver.PhantomJS()
browser.get('https://gw.ict.ac.cn/srun_portal_pc.php?ac_id=1')
username, password = read_conf()
browser.find_elemen... |
from datetime import timedelta, datetime
from types import MethodType
import pytest
from motion_lighting import MotionLighting
from test.test_helper import create_state_trigger_info, \
create_time_trigger_info, now_is_between
def common_passed_args(given_that):
given_that.passed_arg('enabler_entity_id').is_... |
while True:
print('-' * 40)
n = int(input('Você Vendeu: '))
b = (n * (9/100)) + 200
a = list()
a.append([n, b])
print(f'Vendendo R${a[0][0]}\nVocê tem uma comissão de R${a[0][1]}.')
if 200 <= a[0][1] <= 299:
print('Você Está na 6ª Divisão')
if 300 <= a[0][1] <= 399:
prin... |
from .signatures import * |
from eqsig import sdof
import numpy as np
from tests import conftest
from tests.conftest import TEST_DATA_DIR
def test_nigam_and_jennings_vs_duhamels():
record_path = TEST_DATA_DIR
record_filename = 'test_motion_dt0p01.txt'
dt = 0.01
rec = np.loadtxt(record_path + record_filename, skiprows=2)
peri... |
import numpy as np
import nibabel as nib
from nose.tools import (assert_true, assert_false, assert_equal,
assert_almost_equal, assert_raises)
from numpy.testing import assert_array_equal, assert_array_almost_equal
from dipy.data import get_data
from dipy.segment.quickbundles import QuickBundles
... |
from coldtype import *
@animation(timeline=600)
def shorthand(f):
return (DP()
.define(r=f.a.r.take(150, "mdx").square())
.gs("$r← ↖|c:=355|$r↑ ↗|c|$r→ ↘|c|$r↓ ↙|c|§")
.f(None).s(0).sw(1)
#.rotate(f.e("l", 1, 0)*360)
)
|
import pytest
pytestmark = pytest.mark.django_db
def test_subject_model_str(subject):
"""
calling Subject.__str__() should return subject's name
"""
assert subject.__str__() == subject.name
|
#!/usr/bin/env python3
# @AUTHUR: Kingsley Nnaji <kingsley.nnaji@gmail.com>
# @LICENCE: MIT
# Creation Date: 06.09.2019
def is_Even(num):
'''
is_Even(num) -> boolean
Checks to see is a given number is an even number and returns a True or False.
>>> is_Even(5)
False
>>> is_Even(8)
True... |
import moviepy.editor as mp
from datafinder import DataFinder
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from moviepy.video.VideoClip import TextClip, DataVideoClip
from moviepy.video.io.bindings import mplfig_to_npimage
clip1 = mp.VideoFileClip("gyro2.MP4",fps_source="fps")
s... |
"""Pytests for Chromograph """
import os
import unittest.mock as mock
from unittest.mock import mock_open
import pandas as pd
from chromograph.chr_utils import (chr_type_format, cast, read_cfg, filter_dataframe,
png_filename, outpath, parse_wig_declaration,
... |
import Models
def handle_data(data: list, offset: int, overwrite):
studentModel = Models.StudentsModel()
#programmesModel = Models.ProgrammesModel()
init = offset
for item in data:
write = True
if len(item[4]) < 9:
write = True
else:
if overwrite:
... |
from rest_framework import serializers
from taggit_serializer.serializers import (TagListSerializerField, TaggitSerializer)
from spaces.models import Spaces
class SpaceSerializer(TaggitSerializer, serializers.ModelSerializer):
facilities = TagListSerializerField()
class Meta:
model = Spaces
fi... |
from pyscreenshot.util import use_x_display
from ref import backend_to_check, prog_check
if use_x_display():
if prog_check(["maim", "--version"]):
def test_maim():
backend_to_check("maim")
|
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
from h2o.utils.typechecks import assert_is_type
from h2o.frame import H2OFrame
def h2oparse_raw():
"""
Python API test: h2o.parse_raw(setup, id=None, first_line_is_header=0)
copied fro... |
import json
import re
import untangle
import xml.etree.ElementTree as ET
import requests
import os
from utils.delex import Delexicalize
from data.WebNLG.rephrasing import rephrase, rephrase_if_must
from utils.graph import Graph
from utils.time import Time
from data.WebNLG.reader import WebNLGDataReader, RDFFileReader... |
#! /usr/bin/env python3
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
import binascii
_... |
# Stores data about student group
class StudentsGroup:
# Initializes student group data
def __init__(self, id, name, numberOfStudents):
self.Id = id
self.Name = name
self.NumberOfStudents = numberOfStudents
self.CourseClasses = []
# Bind group to class
def addClass(self,... |
# -*- coding: utf-8 -*-
import os, sys, time, socket, argparse, asyncio, discord
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
from lib.util import *
from lib.message import handle
from bin import __version__, __bundledir__
from lib.util.error import DiscordError
from lib.util.... |
#!/usr/bin/env python3.4
|
# -*- coding: utf-8 -*-
import re
import urlparse
import urllib2
import time
import datetime
import robotparser
from downloader import Downloader
def link_crawler(seed_url, link_regex=None, delay=5, max_depth=-1, max_urls=-1, user_agent='wswp', proxies=None,
num_retries=1, scrape_callback=None, cache... |
#creating a 'progress bar' to show data was being collected
from astro_pi import AstroPi
from time import sleep
class AstroPiProgressBar():
def __init__(self, ap, colour = [255,255,255]):
self.ap = ap
self.colour = colour
self.reset()
def next(self):
self._clear_pixel()... |
from flask import jsonify
from src.db.sqlalchemy import db_session
from src.model.car import Car
from src.util import log
def get(car_id):
try:
car = db_session().query(Car).filter_by(id=car_id).first()
if car:
return jsonify(error=False, response=car.serialize()), 200
else:
... |
''' Misc API methods from termux-api'''
from .android import execute
def __dir__():
return ['generic', 'battery', 'brightness', 'contactlist', 'download', 'fingerprint', 'getfile', 'location', 'torch', 'vibrate', 'volume']
def generic(funcName: str):
'''
Any function can be called, which will be passed d... |
# Copyright 2015 Alexey Baranov <me@kotiki.cc>. 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 ap... |
import copy
import pytest
from cumulusci.core import utils
from cumulusci.core.exceptions import ConfigMergeError, CumulusCIException
@pytest.fixture
def universal_config():
return {
"flows": {
"steps_all_flows": {
"group": "flowy",
"description": "Elaborate d... |
# -*- coding: utf-8 -*-
'''
Directive that places active element inputs.
'''
import os.path
from docutils.parsers.rst import directives
from docutils import io, nodes, utils
from sphinx.errors import SphinxError
from sphinx.util import logging
import aplus_nodes
import lib.translations as translations
import lib.yaml_... |
# flake8: noqa: F402
from . import clean_text, file_mgmt, get_tweets, tweet_info, vocabulary
|
from deephaven.TableTools import readCsv
from deephaven import Plot
from deephaven import tableToDataFrame
from deephaven import dataFrameToTable
from sklearn.neighbors import KDTree as kdtree
import pandas as pd
import numpy as np
# Read external data, remove unwanted parts, and split into train/test
creditcard = re... |
def test_list_devices(client):
devices = client.devices()
assert len(devices) > 0
assert any(map(lambda device: device.serial == "emulator-5554", devices))
def test_list_devices_by_state(client):
devices = client.devices(client.BOOTLOADER)
assert len(devices) == 0
devices = client.devices(clie... |
import json
import uuid
from collections import OrderedDict
from operator import attrgetter
from urllib.parse import urlencode
"""
Create Postman collections with ease.
"""
def newid():
return str(uuid.uuid4())
class Collection(object):
def __init__(self, name, id=None, description=None):
self.id =... |
from typing import List
from xendit.models._base_model import BaseModel
from xendit.models._base_query import BaseQuery
class BatchDisbursementItem(BaseModel):
"""Item to be sent for Batch Disbursement (API Reference: BatchDisbursement)"""
class Query(BaseQuery):
"""Item to be sent for Batch Disburse... |
import os
import csv
import sys
import sqlite3
WORK_DIR = '/home/ming/PSMD'
DB_DIR = os.path.join(WORK_DIR, 'dbs')
kingdoms = {}
groups = {}
subgroups = {}
#input files are eukaryote, virus, prokaryote best genome xls file
for infile in sys.argv[1:]:
with open(infile) as fh:
reader = csv.reader(fh,... |
def test_url_wired_setup(registry):
from wired_components.url import wired_setup
assert wired_setup(registry) is None
def test_url_construction():
from wired_components.url import Url
url = Url(path='somepath')
assert url.path == 'somepath'
|
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
"""
tenacity模块,用于重试
在什么情况下才进行重试?
重试几次呢?
重试多久后结束?
每次重试的间隔多长呢?
重试失败后的回调?
"""
import time
from requests import exceptions
from tenacity import retry, wait_fixed, stop_after_attempt, stop_after_delay, retry_if_exception_type, retry_if_result
# 1.无条件重... |
import signal
# Achieve Ctrl-c interrupt recv
signal.signal(signal.SIGINT, signal.SIG_DFL)
HEARTBEAT_TOPIC = "heartbeat"
HEARTBEAT_INTERVAL = 10
HEARTBEAT_TOLERANCE = 30
|
from manga_py.provider import Provider
from .helpers.std import Std
class Hentai2ReadCom(Provider, Std):
images_cdn = 'https://static.hentaicdn.com/hentai'
def get_chapter_index(self) -> str:
idx = self.re.search('.+/([^/]+)/', self.chapter)
return '-'.join(idx.group(1).split('.'))
def g... |
#!/usr/bin/env python
import re
from kobas import dbutils
from kobas.kb.reactome import reactome_organisms
def parse(stid_handle, map_handle, kobasrc):
pathways, gene_pathways = {}, {}
stids = {}
for line in stid_handle:
uniprotkb_ac, paid, pname = line.split('\t')[:3]
if not stids.has_k... |
import os
from chatterbot import ChatBot
import logging
logging.basicConfig(level=logging.INFO)
# configure how the bot train and retrieve responses
#Change ChatBot name to your choice
chatbot = ChatBot(
'Bot',
trainer='chatterbot.trainers.ListTrainer',
storage_adapter='chatterbot.storage.SQLStorageAdapt... |
"""Submodule used for creating plots of monitoring station data:"""
from pyrsistent import b
from floodsystem.station import MonitoringStation
import matplotlib.pyplot as plt
import matplotlib.dates as dt
from floodsystem.analysis import polyfit
import numpy as np
import datetime
def lables_and_title(title):
""... |
from .capturegame import CaptureGameNetwork |
import os
from typing import List, Dict
from domain.models.paths import Paths
from domain.exceptions.models_exception import PathNotFound
from domain.services.contracts.abstract_path_service import AbstractPathService
from domain.services.contracts.abstract_checkpoint_service import AbstractCheckpointService
class Ch... |
"""
Copyright 2021 K.M Ahnaf Zamil
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, publish, distribute, su... |
import builtins
import logging
import os
from unittest import TestCase
from flexiconf import Configuration, ArgsLoader
from app.database.connection import DatabaseConnection
from app.database.scoped_session import ScopedSession
from app.models.all import Group, Request, Response, User
class MatcherAny:
def __eq... |
import uuid
import logging
from enum import Enum
from datetime import datetime
from typing import Any
from typing import Callable
from typing import Dict
from typing import Optional
from typing import Union
from ..service.template import ServiceClass
# from .template import dict_diff
from .template import ValueBaseT... |
"""
This example uses UCI ML California Housing dataset, which is a
regression dataset including 20k samples.
Dua, D. and Graff, C. (2019). UCI Machine Learning Repository
[http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of
Information and Computer Science.
## Result
```bash
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.