content stringlengths 0 894k | type stringclasses 2
values |
|---|---|
from ..util import slice_
def scopy(N, SX, INCX, SY, INCY):
"""Copies a vector, x, to a vector, y.
Parameters
----------
N : int
Number of elements in input vectors
SX : numpy.ndarray
A single precision real array, dimension (1 + (`N` - 1)*abs(`INCX`))
INCX : int
Stora... | python |
from BatteryConditionChecks import isBatteryOk
if __name__ == '__main__':
assert(isBatteryOk(25, 70, 0.7) == True)
assert(isBatteryOk(45, 80, 0.8) == True)
assert(isBatteryOk(50 , 95, 0.9) == False)
assert(isBatteryOk(23 , 10, 0.9) == False)
assert(isBat... | python |
'''
################################################################################################################
Manuscript Title: The evaluation of tools used to predict the impact of missense variants is hindered by two types of circularity
#########################################################################... | python |
import sys
import os
import logging
from maya import cmds
from jiminy.vendor.Qt import QtCore
from jiminy import api as jiminy
from . import pipeline
self = sys.modules[__name__]
self._menu = "jiminymaya"
log = logging.getLogger(__name__)
global SILO
def install():
def deferred():
cmds.menuItem(
... | python |
#!/usr/bin/env python3
import argparse
import json
import os
import random
import timeit
from glob import glob
import numpy as np
import _init_path
from spacenet7_model.utils import get_image_paths, get_aoi_from_path
def parse_args():
"""[summary]
Returns:
[type]: [description]
"""
parser ... | python |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | python |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... | python |
"""
This script handles the loading of the cleaned metadata into the mongodb.
Data from scraping server is compressed.
server: scraping server
workdir: data/corpus
command: tar -czvf KCP_<list_of_corpus_ids_to_compress_separated_by_underscore>.tar.gz
Send compressed data to gateway:
server: scraping server
workdir: d... | python |
# coding: utf-8
#
# Copyright 2018 The Oppia 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 requi... | python |
# 바이너리를 저장하고 불러온다
# TODO: 클래스 분리할 것
import os
import pickle
import secrets
from lib.log_gongik import Logger
from lib.file_property import FileProp
from lib.file_detect import BackupFileDetector # 파일 탐지
from lib.utils import (
get_today_date_formated,
extract_dir
)
class BackupRestore(object):
def __ini... | python |
import pytest
from chapter10 import C10, message
from fixtures import SAMPLE
@pytest.fixture
def packet():
for packet in C10(SAMPLE):
if isinstance(packet, message.MessageF0):
return packet
@pytest.fixture
def msg(packet):
return next(packet)
def test_csdw(packet):
assert packet.... | python |
from bs4 import BeautifulSoup
from urllib.request import urlopen
import re
import requests
import json
def count_user(repo):
r = requests.get('https://api.github.com/repos/{}'.format(repo))
if r.ok:
repoItem = json.loads(r.text or r.content)
return repoItem['subscribers_count'], repoI... | python |
import io
import os
import sys
import unittest
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
self.wasRun = False
... | python |
# Generated by Django 2.1.5 on 2019-01-15 16:11
import django.contrib.gis.db.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('property', '0011_property_city'),
]
operations = [
migrations.RemoveField(
model_name='proper... | python |
"""Module containing models used for server responses"""
class Response:
"""Response indicating successful operation"""
def __init__(self, text, time):
self.text = text
self.time = time
class ErrorResponse:
"""Response indicating failed operation"""
def __init__(self, message):
... | python |
from ptrlib import ror
hashval = [
0x13e0ff2c,
0xB7D26563,
0x5B9E4069,
0x98AE69CB,
0x96AE69D0,
0x998802F1,
0x7F3EECA7
]
def calc_hash(name, key):
hashval = 0
for c in name:
hashval = ((ord(c) | 0x20) + ror(hashval, 8, bits=32)) ^ key
return hashval
with open("apilist_k... | python |
# Copyright 2012 Pedro Navarro Perez
# Copyright 2013 Cloudbase Solutions Srl
# 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... | python |
from brownie import Wei
from helpers.network import network_manager
from helpers.time_utils import days, hours, minutes
# Setts that are not tendable will automatically be skipped
# Lines can be commented out here to skip Setts
setts_to_skip = {
"eth": {
"harvest": [
"native.uniBadgerWbtc",
... | python |
import unittest
from datetime import datetime, timedelta
from rowboat.util.input import parse_duration
class TestRuleMatcher(unittest.TestCase):
def test_basic_durations(self):
dt = parse_duration('1w2d3h4m5s')
self.assertTrue(dt < (datetime.utcnow() + timedelta(days=10)))
self.assertTru... | python |
from movies.views import MovieViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'movies', MovieViewSet)
urlpatterns = router.urls
| python |
import sys
import os
from mlad.core.default.config import service_config
from mlad.cli import config as config_core
def is_debug_mode():
if '-d' in sys.argv or '--debug' in sys.argv or os.environ.get(
'MLAD_DEBUG', service_config['mlad']['debug']):
return True
return False
| python |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | python |
checkout_session_signature = 't=1591264652,v1=1f0d3e035d8de956396b1d91727267fbbf483253e7702e46357b4d2bfa078ba4,v0=20d76342f4704d49f8f89db03acff7cf04afa48ca70a22d608b4649b332c1f51'
checkout_session_body = b'{\n "id": "evt_1GqFpHAlCFm536g8NYSLoccF",\n "object": "event",\n "api_version": "2019-05-16",\n "created": 159... | python |
from django.contrib import admin
from django.urls import path
from core import views
urlpatterns = [
path('', views.index, name='index'),# name é opcional
#path('',views.marcarHorario)
] | python |
import click
import numpy as np
import re
import tifffile
import xtiff
from pathlib import Path
from .data import anndata_cmd, csv_cmd, fcs_cmd
from .graphs import graphs_cmd
from ..._cli.utils import OrderedClickGroup
from ... import io
@click.group(
name="export",
cls=OrderedClickGroup,
help="Export d... | python |
from vrtManager.connection import wvmConnect
from xml.etree import ElementTree
class wvmNWFilters(wvmConnect):
def get_nwfilter_info(self, name):
nwfilter = self.get_nwfilter(name)
xml = nwfilter.XMLDesc(0)
uuid = nwfilter.UUIDString()
return {'name': name, 'uuid': uuid, 'xml': xml... | python |
#
# This file is part of LiteX.
#
# Copyright (c) 2021 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
from litex.build.generic_platform import GenericPlatform
from litex.build.quicklogic import common, symbiflow
# QuickLogicPlatform ------------------------------------... | python |
from __future__ import annotations
import logging
import typing
if typing.TYPE_CHECKING:
from .types import (
UserDatabaseConfig, DatabaseConfig, DriverWrapper,
DriverPool, DriverConnection,
)
class DatabaseTransaction(object):
"""
A wrapper around a transaction for your database.
... | python |
#coding=utf8
"""
Created on Sun Nov 17 16:16:09 2019
@author: Neal LONG
"""
from nltk.stem import WordNetLemmatizer
import nltk
from nltk.corpus import wordnet
def get_wordnet_pos(treebank_tag):
"""
Translate the complext NLTK postag to simplied
wordnet definitions of postag
"""
if... | python |
import socket
import os
import sys
TARGET_IP = "127.0.0.1"
TARGET_PORT = 5005
BLOCK_SIZE = 1024
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
fileName = "picture.png"
fileSize = os.stat(fileName).st_size
fp = open(fileName, "rb")
payload = fp.read()
sent = 0
for i in range((len(payload)/BLOCK_SIZE) + 1):
... | python |
from pprint import pprint
import json
class JsonReader:
def heddepts():
f = open('HigherEdDepartments.json')
depts = json.load(f)
deptnames = set()
for item in depts:
printme = item["title"]
deptnames.add(printme)
pprint(deptnames)
pass
JsonReade... | python |
import unittest
import pandas as pd
from study.ml.trees import NaiveNumericDecisionTree
from test_classifiers import ClassifierBaseTest
class TestNonNumericDecisionTree(ClassifierBaseTest):
data2_df = pd.DataFrame({'one': [1., 2., 3., 4., 5., 6.],
'two': [True, True, False, False, F... | python |
import json
import logging
import subprocess
import warnings
from pathlib import Path
from typing import Dict, List, NamedTuple, Optional, Union
from contributors_txt.const import (
DEFAULT_TEAM_ROLE,
GIT_SHORTLOG,
NO_SHOW_MAIL,
NO_SHOW_NAME,
)
class Alias(NamedTuple):
mails: List[str]
author... | python |
from __future__ import print_function
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.view import view_config, view_defaults
from pyramid.response import Response
from github import Github, GithubException
import os
import shutil
from subprocess import call
import log... | python |
import pandas as pd
from sentimentanalyser import preprocess
## from preprocess import PreProcess
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.externals import joblib
from sklearn import svm
from sklearn.naive_bayes import MultinomialNB
... | python |
import abc
import re
import tempfile
import traceback
from typing import Tuple, Callable, Union, List, Optional
import kerassurgeon
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras import models, layers
class BasePruning:
_FUZZ_EPSILON = 1e-5
def __init__(self,
... | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 24 16:24:44 2019
@author: usingh
"""
import pytest
from pyrpipe import assembly
from pyrpipe import pyrpipe_utils as pu
from testingEnvironment import testSpecs
import os
testVars=testSpecs()
def test_assembly():
#create assemble object
ao... | python |
def PlotLossesKeras(**kwargs):
"""PlotLosses callback for Keras (as a standalone library, not a TensorFlow module).
Args:
**kwargs: key-arguments which are passed to PlotLosses
Notes:
Requires keras to be installed.
"""
from .keras import PlotLossesCallback
return PlotL... | python |
# Generated by Django 3.1.13 on 2021-10-09 13:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_profile'),
]
operations = [
migrations.AlterField(
model_name='user',
name='email',
field... | python |
from sqlalchemy import create_engine
import tushare as ts
stock_basics = ts.get_stock_basics() #所有股票列表 stock_basic
print(stock_basics) | python |
import requests, json, time, pickle, argparse
from os import path
# Authentication function
def authenticate(bridge_ip):
auth_req = requests.post("http://"+bridge_ip + "/api", json={"devicetype":"hue_exit_code#linux"})
auth_res = auth_req.json()
if len(auth_res) == 1:
auth_res = auth_res[0]
... | python |
from flask_login import LoginManager
login = LoginManager()
def login_initializing(app):
login.init_app(app)
login.login_view = 'blue.login'
| python |
from ipsframework import Component
class Driver(Component):
def step(self, timestamp=0.0):
worker_comp = self.services.get_port('WORKER')
self.services.call(worker_comp, 'step', 0.0)
| python |
# Copyright (c) OpenMMLab. All rights reserved.
"""Get test image metas on a specific dataset.
Here is an example to run this script.
Example:
python tools/misc/get_image_metas.py ${CONFIG} \
--out ${OUTPUT FILE NAME}
"""
import argparse
import csv
import os.path as osp
from multiprocessing import Pool
impor... | python |
# * Mathematical Algorithm - Lucky number
| python |
# from tkinter import *
# from tkinter import ttk
# ventana = Tk()
print("Hola")
# window=Tk()
# window.title("Python")
# window.geometry("600x500")
# window.mainloop()
#--------------- example2---------------
# from tkinter import *
# tkinter.use("Agg")
# from tkinter.ttk import *
# root=Tk()
# label=Label(root, tex... | python |
__author__ = 'tinglev@kth.se'
import unittest
from test import mock_test_data
from modules.steps.resource_policy_checker import ResourcePolicyChecker
from modules.util import data_defs, exceptions
class TestResourcePolicyChecker(unittest.TestCase):
def test_bad_resource_policy(self):
step = ResourcePolic... | python |
#!/usr/bin/env python
#coding: utf-8
"""
LeetCode: https://leetcode.com/problems/clone-graph/
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use '#' as a separator for each node, and ','... | python |
import nltk
import sys , os
FILE_MATCHES = 1
SENTENCE_MATCHES = 1
def main():
# Check command-line arguments
if len(sys.argv) != 2:
sys.exit("Usage: python questions.py corpus")
# Calculate IDF values across files
files = load_files(sys.argv[1])
file_words = {
filename: tokenize... | python |
"""
("([a-z0-9!#$%&'*+\/=?^_'{|}~-]+(?:\.[a-z0-
9!#$%&'*+\/=?^_'"
"{|}~-]+)*(@|\sat\s)(?:[a-z0-9](?:[a-z0-9-
]*[a-z0-9])?(\.|"
"\sdot\s))+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)")
"""
import urllib.request as ur
import sys,re
url = sys.argv[1]
try:
page_code = ur.urlopen(url).read()
print(page_code.decode())
compiled = r... | python |
import csv
# with open('Depth Data/KinectDataMinMax.csv', 'r', newline='') as file:
# reader = csv.reader(file)
# fileWriter = open("Depth Data/KinectDataMinMaxWallConfig.csv", "w")
# count = 0
# for row in reader:
# target = row.pop(0) #Remove the target
# if target == "Wall":
# ... | python |
"""Integration test cases for the startlists route."""
from datetime import datetime
from json import dumps
import os
from typing import Any, Dict, List
from aiohttp import hdrs
from aiohttp.test_utils import TestClient as _TestClient
from aioresponses import aioresponses
import jwt
import pytest
from pytest_mock impo... | python |
'''
This script can be used to search for a number in a sorted 2D matrix.
Parameters:
- matrix: sorted 2D list
- target: number to be searched
'''
def searchMatrix(matrix, target: int) -> bool:
n, m = len(matrix), len(matrix[0])
for i in range(n): # finding the possible row
... | python |
# coding=utf-8
# Copyright 2021 The Edward2 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 o... | python |
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2017 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | python |
'''FUPQ leia um ano qualquer e mostre se ele é BISSEXTO'''
from datetime import date
ano = int(input('Digite um ano qualquer ou coloque 0 para analisar o ano atual: '))
if ano == 0:
ano = date.today().year
if ano%4 == 0 and ano%100!= 0 or ano%400 == 0:
print(f'O ano {ano} BISSEXTO')
else:
print(f'O ano {an... | python |
# Copyright (c) 2019-2021 - for information on the respective copyright owner
# see the NOTICE file and/or the repository
# https://github.com/boschresearch/pylife
#
# 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 co... | python |
import logging
import os
import shutil
import sys
import tempfile
import unittest
from unittest.mock import Mock, patch
from git import Repo
from tests.helpers.repo_utils import (
achieve_dirty_and_untracked_repo,
add_untracked,
create_clean_repo,
make_repo_dirty,
readonly_handler,
)
from torque i... | python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import torch.utils.model_zoo as model_zoo
class BaseConv(nn.Module):
"""A Conv2d -> Batchnorm -> silu/leaky relu block"""
def __init__(
self, in_channels, out_cha... | python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/Colin/Documents/hackedit/data/forms/settings_page_workspaces.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
... | python |
import torch
def foo(x, y):
return 2 * x + y
traced_foo = torch.jit.trace(foo, (torch.rand(3), torch.rand(3)))
torch.jit.save(traced_foo, 'jit-test.pt')
| python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File coupling.py created on 20:47 2018/1/1
@author: Yichi Xiao
@version: 1.0
"""
import matplotlib.cm
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
import time
import logging
from interfaces import *
from tree_search import *
from lispy import... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by Em on 2017/5/12
"""
分布式进程 -- 服务器端
"""
import random, multiprocessing
from multiprocessing.managers import BaseManager
from multiprocessing import freeze_support
# 从BaseManager继承的QueueManager:
class QueueManager(BaseManager):
pass
# 发送任务的队列:
task_queu... | python |
"""Decorator and utility functions for protecting access to endpoints."""
from connexion.exceptions import Unauthorized
from connexion import request
from flask import current_app
from functools import wraps
import logging
from typing import (Callable, List, Mapping, Union)
from jwt import (decode, get_unverified_hea... | python |
# -*- coding: utf-8 -*-
from os import path
from email import Encoders
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.Utils import COMMASPACE
from email.Utils import formatdate
from django.utils.deconstruct import deconstructible
import ... | python |
# coding: utf-8
import numpy as np
import math
import cv2
import os
from os import listdir
import json
import time
import sys
from MtcnnDetector import FaceDetector
#import Enhance_image
TRAINING = 0
TESTING = 1
CPU = 0
GPU = 1
CASIA = 0
REPLAYATTACK = 1
OULU = 2
def list2colmatrix(pts_list):
"""
conver... | python |
import base64
import hashlib
import struct
from os.path import basename
from cloudmesh.common.util import path_expand
from pathlib import Path
import requests
from cloudmesh.configuration.Config import Config
# noinspection PyBroadException
class SSHkey(dict):
def __init__(self, name=None):
self.load()
... | python |
import argparse
import cv2
import matplotlib.pyplot as plt
import numpy as np
from kohonen import KohonenNetwork
def mse(X, Y):
return np.mean((X.astype(np.float32) - Y.astype(np.float32)) ** 2)
def psnr(X, Y):
return 10 * np.log10(255.0 ** 2 / mse(X, Y))
def compress_image(filename,
n... | python |
import torch
from utils.torch_utils import BatchIter
def train_network_flexible(loss_function, parameters, data_tuple, n,
data_tuple_dev=None, max_epochs=10000,
batch_size=128, max_no_improve=20):
optim = torch.optim.Adam(parameters)
batch_iter = BatchIte... | python |
# -*- coding: utf-8 -*-
T = int(input())
temp = list(range(T))
for i in range(1000):
print("N[%d] = %d" % (i, temp[i % T])) | python |
import cv2
import os
import numpy as np
import glob
results = "/data/vpta/dataset/results/VOC2012/Main/car.txt"
source_path = "/data/vpta/dataset/VOC2012/JPEGImages-test"
dest_path = "/data/vpta/dataset/results/VOC2012/output"
def draw():
with open(results, 'r') as f:
lines = f.readlines()
for line... | python |
# Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: Configuration/Generator/python/fragment_T2ttZH_mStop-600.py --filein file:test.lhe --fileout file:gensim.root --mc --eventcontent RAWSIM --... | python |
#!/usr/bin/python3
import numpy,hashlib,appdirs,os.path,os
from .. import helpers
import re
cacheDir = appdirs.user_cache_dir('XpyY',appauthor='Arian Sanusi')
try: os.mkdir(cacheDir)
except FileExistsError: pass
digitre=re.compile(rb'\d')
def parse(infile):
''' returns an array of the given LVMs data
caches ... | python |
class MyCircle(object):
def __init__(self, center=(0.0,0.0), radius=1.0, color='blue'):
self.center = center
self.radius = radius
self.color = color
def _repr_html_(self):
return "○ (<b>html</b>)"
def _repr_svg_(self):
return """<svg width="100px" height="10... | python |
## módulo eulerimplicito
''' método de Euler implicito para resolver el PVI
X,Y = integrate(F,x0,y0,xfinal,N).
{y}' = {F(x,{y})}, donde
{y} = {y[0],y[1],...y[N-1]}.
x0,y0 = condiciones iniciales
xfinal = valor final de la variable x
h = incremento de x usado para la integrac... | python |
import numpy as np
from .BaseTransformer import BaseTransformer
from .Standardizer import Standardization
import numpy as np
class SGD:
def __init__(self, variables, lr=None, decay=0.,):
self.lr = lr
self.variables = variables
self.decay = decay
def update(self, lr=None, ):
if ... | python |
from time import sleep
from ssd1306 import SSD1306_I2C
from machine import Pin, I2C
def send(lora):
counter = 0
print("LoRa Sender")
#display = Display()
rst = Pin(16, Pin.OUT)
rst.value(1)
scl = Pin(15, Pin.OUT, Pin.PULL_UP)
sda = Pin(4, Pin.OUT, Pin.PULL_UP)
i2c = I2C(scl=scl, sda=sd... | python |
"""generate random conformations from pdbbind ligands for test.
"""
import json
import argparse
import numpy as np
from tqdm import tqdm
from pathlib import Path
from rdkit import Chem
from rdkit.Chem import AllChem
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
parser = argparse.ArgumentPar... | python |
import rocksdb
import os
import json
from . import datalayer
class History:
def __init__(self, base_path):
self.base_path = base_path
self.db_path = os.path.join(self.base_path, "sheets-history.db")
self.db = rocksdb.DB(self.db_path, rocksdb.Options(create_if_missing=True))
def save_c... | python |
import os
import numpy as np
import wandb
from src.globals import archive_dir, current_dir, deskew_path, mini_path, \
network_path
from src.gui import run_gui
from src.network import NeuralNetwork
from src.train import train
from src.utils import deskew_data, load_data
def main():
if os.path.isfile(network_path):... | python |
from ens import ENS as _ens
from web3 import Web3
from termcolor import cprint
from nubia import command, argument
from legions.commands.commands import w3
import requests
import json
from tabulate import tabulate
from datetime import datetime
@command
class ens:
"Ethereum Name Service Tools"
def __init__(se... | python |
# The MIT License (MIT)
# Copyright (c) 2021 Tom J. Sun
# 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, ... | python |
from src.base.tile import Tile
from src.base.bbox import Bbox
from src.base.node import Node
from src.base.tag import Tag
from src.data.orthofoto.wms.wms_api import WmsApi
from src.train.coord_walker import CoordWalker
from src.train.osm_object_walker import OsmObjectWalker
import argparse
def main(args):
coord... | python |
# import pytest
# from Full_setup_tests_todomvc.helpers.allure.gherkin import when, given, then
# from Full_setup_tests_todomvc.helpers.pytest.skip import pending
from full_setup_tests_todomvc.model import todos
def test_add_first_todo():
todos.open()
todos.should_be_empty()
todos.add('a')
todos.sh... | python |
# lightManager_gui.py
import sys
import random
from PyQt5 import QtWidgets, QtCore, QtGui
from lightManager_main import readDictionnary, getDictBasedOnName
lightDictionnary = readDictionnary()
class MyWidget(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle('Light Ma... | python |
from __future__ import print_function, division, absolute_import
import time
import matplotlib
matplotlib.use('Agg') # fix execution of tests involving matplotlib on travis
import numpy as np
import six.moves as sm
from imgaug import augmenters as iaa
from imgaug import parameters as iap
from imgaug.testutils impor... | python |
from __future__ import absolute_import
from exception_wrappers.database.apsw.base import APSWBaseWrapper
from exception_wrappers.database.apsw.raw import APSWConnectionWrapper
from exception_wrappers.libraries.playhouse import apsw_ext
from exception_wrappers.manager import ExceptionSource
from peewee import _sqlite_... | python |
from enum import Enum
from typing import Optional, Any
from FlaUILibrary.flaui.exception import FlaUiError
from FlaUILibrary.flaui.interface import (ModuleInterface, ValueContainer)
from FlaUILibrary.flaui.util.treeitems import TreeItems
from FlaUILibrary.flaui.util.converter import Converter
class Tree(ModuleInterfa... | python |
import json
import time
import copy
import os, sys
import datetime
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(1, os.getcwd())
import pandas as pd
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils import data
from torch.utils.tensorboard import SummaryWri... | python |
"""
This module include the cost sensitive decision tree method.
"""
# Authors: Alejandro Correa Bahnsen <al.bahnsen@gmail.com>
# License: BSD 3 clause
import numpy as np
import copy
from ..metrics import cost_loss
from sklearn.base import BaseEstimator
from sklearn.externals import six
import numbers
class CostSens... | python |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | python |
import multiprocessing
import os.path as osp
import gym,sys
from collections import defaultdict
import tensorflow as tf
import numpy as np
import pickle
from baselines.common.vec_env import VecFrameStack,VecEnv, VecNormalize
from baselines.run import parse_cmdline_kwargs, build_env, configure_logger, get_default_networ... | python |
import sys
import os
import unittest
import shutil
from io import StringIO
sys.path.append(".")
from mock_gff3 import Create_generator
from mock_helper import gen_file
import annogesiclib.plot_coverage_table as pct
class Mock_func(object):
def mock_fig(self, rowlabels, collabels, cells, filename,
... | python |
""" CISCO_IP_LOCAL_POOL_MIB
This MIB defines the configuration and monitoring capabilities
relating to local IP pools.
Local IP pools have the following characteristics\:
\- An IP local pool consists of one or more IP address ranges.
\- An IP pool group consists of one or more IP local pools.
\- An IP local pool ... | python |
#!/usr/bin/env python3
import pytest
from tidyexc.views import *
def test_data_view():
d = [{'a': 1, 'b': 2}, {'b': 3, 'c': 4}]
v = data_view(d)
assert repr(v) == "data_view([{'a': 1, 'b': 2}, {'b': 3, 'c': 4}])"
assert v == {'a': 1, 'b': 3, 'c': 4}
assert len(v) == 3
assert set(v) == {'a', '... | python |
# URLs for Podcasts
from django.conf import settings
from django.conf.urls.static import static
from django.urls import include, path
from rest_framework import routers
from podcasts.views.page_views import EpisodeDetail, PodcastDetail, PodcastList, HomePage
from podcasts.views.rest_api_views import PodcastViewSet
ap... | python |
# Copyright (C) 2018-2021, Raffaele Salmaso <raffaele@salmaso.org>
#
# 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, cop... | python |
# Project libraries
from . import BaseResource
from .buildpack import Buildpack
class BuildpackInstallation(BaseResource):
"""Heroku Buildpack Insallation."""
_map = {"buildpack": Buildpack}
_ints = ["ordinal"]
_pks = ["ordinal"]
def __repr__(self):
return "<buildpack-installation '{}'>"... | python |
TOKEN = "put your token here" | python |
class OrdenaLista():
def ordenaDecrescente(lista):
for i in range(1, len(lista)):
key = lista[i]
j = i-1
while j >=0 and key < lista[j] :
lista[j+1] = lista[j]
j -= 1
lista[j+1] = key
def ordenaCre... | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.