text stringlengths 1 927k |
|---|
default_app_config = "apps.courts.apps.CourtsConfig" |
# MIT License
#
# Copyright (c) 2020 Arkadiusz Netczuk <dev.arnet@gmail.com>
#
# 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
# t... |
import colored_traceback
from .RunStep import RunStep
from js9 import j
import json
import aiohttp
colored_traceback.add_hook(always=True)
RETRY_DELAY = [10, 30, 60, 300, 600, 1800] # time of each retry in seconds, total: 46min 10sec
class Run:
def __init__(self, model):
self.lastnr = 0
self.log... |
""" Alpha Vantage Model """
__docformat__ = "numpy"
import pandas as pd
from alpha_vantage.sectorperformance import SectorPerformances
from gamestonk_terminal import config_terminal as cfg
def get_sector_data() -> pd.DataFrame:
"""Get real-time performance sector data
Returns
----------
df_sectors ... |
from haikufinder import *
from nltk.util import ngrams
import random, re
tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')
# theText = ['on others" or that require "the general public [to] pick up the tab.', 'For good reason, we have repeatedly refused to take such a step.', 'But the Lee Court made two ... |
'''
Created on Oct 3, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
import os, io, sys, traceback
from collections import defaultdict
from decimal import Decimal
from lxml import etree
from xml.sax import SAXParseException
from arelle import (PackageManager, X... |
from django.db import IntegrityError
from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import Group
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views.generic import Vie... |
# -*- coding: utf-8 -*-
"""Click commands."""
import os
from glob import glob
from subprocess import call
import click
HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.join(HERE, os.pardir)
TEST_PATH = os.path.join(PROJECT_ROOT, "tests")
@click.command()
def test():
"""Run the tests."""
... |
"""
Derived module from dmdbase.py for higher order dmd.
Reference:
- S. L Clainche, J. M. Vega, Higher Order Dynamic Mode Decomposition.
Journal on Applied Dynamical Systems, 16(2), 882-925, 2017.
"""
import numpy as np
from .dmdbase import DMDBase
from .utils import compute_tlsq
class HODMD(DMDBase):
"""
... |
from GenerativeModelling.Autoencoder import Autoencoder
from GenerativeModelling.Encoder import Encoder
from GenerativeModelling.Decoder import Decoder
from GenerativeModelling.verification_net import VerificationNet
from SemiSupervisedLearning import visualisations
from GenerativeModelling.Trainer import Trainer
from ... |
# -*- coding: utf-8 -*-
#
# Flask-OIDC documentation build configuration file, created by
# sphinx-quickstart on Tue May 17 10:16:49 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... |
""" Tuple as Data Structure
We have see how we interpreted tuples as data structures
The position of the object contained in the tuple gives it meaning
For example, we can represent a 2D coordinate as: (10, 20)
x y
If pt is a position tuple, we can re... |
# Copyright (c) 2015-2021 Dell Inc. or its subsidiaries.
#
# 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 l... |
import multiprocessing as _std_multiprocessing
import billiard as _billiard
# Determine which multiprocessing API to use
if _std_multiprocessing.current_process().daemon:
multiprocessing = _billiard
else:
multiprocessing = _std_multiprocessing |
from django.conf.urls import url
from django.views.decorators.csrf import csrf_exempt
from channel_github import views
urlpatterns = [
url(r'^authenticate',
views.StartAuthenticationView.as_view(),
name='connect'),
url(r'^oauth-callback',
views.CallbackView.as_view(),
name='ca... |
import requests
import json
url='https://www.mail.ru'
print('hello', 'world', 123, sep=':', end=' !!! \n')
st='Марка авто'
age=16
print(type(st))
print(type(age))
engain_volume=1.6
print(type(engain_volume))
a=True
print(type(a))
a=int(input('Введите первое число: '))
b=int(input('Введите второе число: '))
print(a+b)... |
import os
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
database_url = os.getenv('DATABASE_URL')
Base = declarative_base()
engine = create_engine(database_url)
from sqlalchemy_bigint_id.testapp import models # noqa |
import time
import math
def time_sec():
return int(time.time())
class Progress:
"""
Progress reporting.
Usage:
from jxa.Progress import Progress
from time import sleep
p = Progress(frequency=4)
max = 9000_000
for i in range(0,max,1000):
sleep(1/300)
p.print(i,max... |
import sys
if not sys.warnoptions:
import warnings
warnings.simplefilter("ignore")
import numpy as np
import csv
import copy
from torch import optim
from torch.nn import BCELoss
from torch.optim import Adam
import torch
from random import shuffle
import random
import models
import pickle
embed_matrix = p... |
# Copyright Peznauts <kevin@cloudnull.com>. 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 requ... |
import collections
import pandas as pd
from typing import Dict, Hashable, Optional, Any
from copy import deepcopy
from .features_checkers_handlers import dates_handler, dates_checker, cat_checker
class TypesHandler:
"""
Класс для автоматического определения типов признаков.
Базовая имплементация порядк... |
import numpy as np
import pandas as pd
import astropy.units as u
import healpy as hp
from lens.sie.plot import *
def angle2pixel(ra_deg,dec_deg):
""" return healpix index 12"""
phi = ra_deg * np.pi / 180
theta = np.pi/2 - (dec_deg * np.pi/180)
return hp.ang2pix(4096,theta,phi,nest=True)
def lensedQS... |
import pytest
from django.urls import resolve, reverse
from ginger_arxiv.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username})
== f"/users/{user.username}/"
)
assert resolve(f"/users/{... |
"""
Copyright 2013 Rackspace
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, software
dist... |
import numpy as np
import os
import sys
import ntpath
import time
from . import util, html
from subprocess import Popen, PIPE
import tifffile as tiff
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomExceptionBase = ConnectionError
def save_images(webpage, visuals, image_path, aspect_... |
"""
7. How to get the items not common to both series A and series B?
"""
"""
Difficulty Level: L2
"""
"""
Get all items of ser1 and ser2 not common to both.
"""
"""
Input
"""
"""
ser1 = pd.Series([1, 2, 3, 4, 5])
ser2 = pd.Series([4, 5, 6, 7, 8])
"""
# Input
ser1 = pd.Series([1, 2, 3, 4, 5])
ser2 = pd.Series([4, 5, 6... |
'''Test fixtures for dagster-airflow.
These make very heavy use of fixture dependency and scope. If you're unfamiliar with pytest
fixtures, read: https://docs.pytest.org/en/latest/fixture.html.
'''
# pylint doesn't understand the way that pytest constructs fixture dependnecies
# pylint: disable=redefined-outer-name, u... |
def merge_the_tools(string, k):
while string:
if len(string) > k:
sub_string = string[:k]
string = string[k:]
else:
sub_string = string[:]
string = ''
s = []
for c in sub_string:
if c not in s:
s.append(c)
... |
import os
import pytest
import numpy as np
from deepforest import _io as io
open_buffer = io.Buffer(use_buffer=True,
buffer_dir="./",
store_est=True,
store_pred=True,
store_data=True)
close_buffer = io.Buffer(use_buffer... |
ByteArray = 0x00
Boolean = 0x01
Integer = 0x02
InteropInterface = 0x40
Array = 0x80
Struct = 0x81
Map = 0x82 |
class Solution(object):
def threeSumClosest(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
nums = sorted(nums)
closest = abs((nums[0] + nums[1] + nums[2]) - target)
res = res = [nums[0], nums[1], nums[2]]
for i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Radim Rehurek <me@radimrehurek.com>
"""
USAGE: %(program)s CONFIG
Example:
./w2v_server.py w2v_hetzner.conf
"""
from __future__ import with_statement
import os
import sys
from functools import wraps
import time
import logging
import bisect
i... |
"""Nbconvert exporter to inline css & js for collapsible_headings."""
from __future__ import print_function
from nbconvert.exporters.html import HTMLExporter
from traitlets import Dict
class ExporterInliner(HTMLExporter):
inliner_resources = Dict(
{'css': [], 'js': []}, config=True,
help='css a... |
def elo_to_category(elo: float) -> str:
if elo >= 2500:
return "IG"
elif 2400 <= elo < 2500:
return "IM"
elif 2300 <= elo < 2400:
return "FM"
elif 2200 <= elo < 2300:
return "CM"
elif 2000 <= elo < 2200:
return "E"
elif 1800 <= elo < 2200:
return "... |
from json import dump
from math import ceil
from random import randint
import string
from keras.layers import Input, Dense, Embedding
#uncoment if using CPU
##from keras.layers import LSTM
#comment out the line bellow if using CPU
from keras.layers import CuDNNLSTM as LSTM
from keras.models import Model, load_model
fr... |
#!/usr/bin/env python
import unittest
from src.convert import kilometers_to_miles, miles_to_kilometers,\
years_to_minutes, minutes_to_years
class TestConvert(unittest.TestCase):
def test_km_to_miles(self):
actual = kilometers_to_miles(1)
expected = 0.621 #from google
self.assertA... |
# coding: utf8
# copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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 requ... |
import numpy as np
import re
import torch.utils.data as tud
import torch
import shutil
def get_word_ids(doc, rnn_encode=True, max_length=100,
nr_unk=100, nr_var=600, rev_dic=None, relabel=True, ent_dict=None):
queue = list(doc)
X = np.zeros(max_length, dtype='int32')
# M = np.zeros(max_le... |
#!/usr/bin/env python
# Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode)
from __future__ import print_function, division, absolute_import
import argparse
import os
import sys
import time
import cv2
import matplotlib.... |
""" Swift storage driver.
Uses: http://docs.openstack.org/developer/swift/overview_large_objects.html
"""
import os.path
import copy
import hmac
import string
import logging
import json
from _pyio import BufferedReader
from collections import namedtuple
from hashlib import sha1
from random import SystemRandom
fr... |
import base64
import json
from urllib.parse import urlparse
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.shortcuts import render, reverse
from django.utils import... |
"""
Copyright (C) 2019 Intel Corporation
SPDX-License-Identifier: MIT
@file zes.py
@version v1.1-r1.1.10
"""
import platform
from ctypes import *
from enum import *
###############################################################################
__version__ = "1.0"
#############################################... |
import sys
import yaml
from dotenv import load_dotenv
from services.lib.constants import NetworkIdents
from services.lib.date_utils import parse_timespan_to_seconds
class SubConfig:
def __init__(self, config_data):
self._root_config = config_data
def get(self, path: str = None, default=None, pure=F... |
from typing import List
class Solution:
def numSubarrayProductLessThanK(self, nums: List[int], target: int) -> int:
if not nums:
return 0
start, count, prod = 0, 0, 1
for end, num in enumerate(nums):
if num >= target:
prod = 1
start = e... |
#!/usr/bin/env python
#
# 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.
"""
Concatenates autostart modules, application modules' module.json descriptors,
and the application loader into a single script.
Al... |
#!/usr/bin/env python
# encoding: utf-8
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
P... |
from wordsiv.sentence_models_sources import WordCountSource, RandomModel
from pathlib import Path
import json
# Assuming installed as directory (zip_safe=False)
HERE = Path(__file__).parent.absolute()
with open(HERE / "meta.json", "r") as f:
meta = json.load(f)
# Sources should always be prefixed with the packa... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test rescan behavior of importaddress, importpubkey, importprivkey, and
importmulti RPCs with different... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
"""Tests for `InteractorFinder` class."""
import pandas as pd
from drugintfinder.finder import InteractorFinder
from .constants import MAPT, PROTEIN, PHOSPHORYLATION, CAUSAL
finder = InteractorFinder(symbol=MAPT, pmods=[PHOSPHORYLATION], edge=CAUSAL)
class TestInteractorFinder:
"""Tests for the InteractorFinde... |
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#!/usr/bin/python
#
# Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... |
import logging
import os
import platform
import re
import subprocess
from pathlib import Path
logger = logging.getLogger(__name__)
BASEDIR = {
"Windows": "C:/Program Files (x86)/StarCraft II",
"Darwin": "/Applications/StarCraft II",
"Linux": "~/StarCraftII",
"WineLinux": "~/.wine/drive_c/Program Files... |
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import pytest
import torch
from mmcv.device.mlu import IS_MLU_AVAILABLE
from mmcv.utils import IS_CUDA_AVAILABLE
class TestBBox(object):
def _test_bbox_overlaps(self, device, dtype=torch.float):
from mmcv.ops import bbox_overlaps
... |
# -*- coding: utf-8 -*-
import input_data
import tensorflow as tf
import numpy as np
from tf_fix import *
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
sess = tf.InteractiveSession()
with tf.name_scope('input'):
x = tf.placeholder("float", shape=[None, 784])
y_ = tf.placeholder("float", shape=[None... |
from django.conf.urls import url, include
from . import views
app_name = 'homepage'
urlpatterns = [
url(r'^$', views.login_view, name="login"),
url(r'^compose/$', views.compose_view, name="compose"),
url(r'^inbox/$', views.inbox_view, name="inbox"),
url(r'^sent/$', views.sent_view, name="sent"),
u... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import codecs
import os.path
import re
import subprocess
import sys
from codecs import open
from distutils import log
from distutils.errors import DistutilsError
from setuptools import find_packages, setup
from setuptools.command.install import install
from setu... |
# Copyright (c) 2012 OpenStack Foundation.
# 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... |
import datetime
import os
from pathlib import Path
import attr
import orjson
from dis_snek.mixins.serialization import DictSerializationMixin
from storage.genius import Genius
from storage.nerf import Nerf
@attr.s(slots=True)
class Container(DictSerializationMixin):
nerf: Nerf = attr.ib(factory=dict, converter=... |
from typing import TYPE_CHECKING, Iterable
from .boards import Scoreboard
if TYPE_CHECKING:
from graphviz import Digraph # type: ignore # pragma: no cover
GREY = "#787c7e"
YELLOW = "#c9b458"
GREEN = "#6aaa64"
class GraphBuilder:
def __init__(self, scoreboards: Iterable[Scoreboard]) -> None:
self.... |
#!/usr/bin/env python
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.spatial import ConvexHull
from colour import Color
from matplotlib.patches import Polygon
import statistics as st
from granatum_sdk import Granatum
COLORS = ["#3891ea", "#29ad19", "#ac2d58", "#db7580",... |
import sys
import numpy as np
import tensorflow as tf
from model.transformer_utils import create_encoder_padding_mask, create_mel_padding_mask, create_look_ahead_mask
#from preprocessing.text import Pipeline
from model.layers import PreBottleNeckDecoder, Encoder, Decoder, SpeakerModule
from utils.losses import model_lo... |
"""LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class L05Ebola(object):
__slots__ = ["cured"]
def __init__(self):
self.cured = False
def enco... |
# Copyright (c) 2021 PaddlePaddle 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 app... |
"""
DRS Package for API unit tests
Copyright (c) 2018-2020 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
Redistribu... |
# Copyright (c) 2019-2021, 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 agreed... |
from pickle import PicklingError
from abc import abstractmethod, ABC
from requests_futures.sessions import FuturesSession
from concurrent.futures._base import Future
import multiprocess
import recaptcha_manager
from recaptcha_manager.exceptions import LowBidError, NoBalanceError, BadDomainError, BadAPIKeyError, BadSite... |
"""Setup.py for ProsperAPI Flask project"""
from os import path, listdir
import importlib
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
HERE = path.abspath(path.dirname(__file__))
def include_all_subfiles(*args):
"""Slurps up all files in a directory (non rec... |
import subprocess
import shutil
import os
import argparse
from pathlib import Path
from threading import Thread
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output", help="output directory for .html and .txt files")
args = parser.parse_args()
def runcmd(cmd):
if os.name == "nt":
return... |
class Solution(object):
def XXX(self, x):
"""
:type x: int
:rtype: int
"""
a = []
b = ''
if x < 0:
ran = -x
else:
ran = x
for i in str(ran):
a.append(i)
for j in range(1, len(a) + 1):
b = ... |
# Code for making a figure
#
# Copyright (c) 2018 Uber Technologies, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
# Pylint doesn't play well with fixtures and dependency injection from pytest
# pylint: disable=redefined-outer-name
import os
import pytest
from buildstream import _yaml
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import walk_dir
pyt... |
"""
pyexcel.filters
~~~~~~~~~~~~~~~
Filtering functions for pyexcel readers
:copyright: (c) 2014-2015 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
Design note for filter algorithm::
#1 2 3 4 5 6 7 <- original index
# x x
#1 3 4... |
import itertools
import praw
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('best_of_modmail', __name__, url_prefix='/modmail')
reddit = praw.Reddit(client_id=current_app.config.get('REDDIT_BOT_CLIENT_ID'),
client_secret=current_app.config.get('REDDIT_BOT_CLIENT_... |
URANIUM_PY = """
def main(build):
build.packages.install("nose")
import nose
assert nose is not None
""".strip()
URANIUM_PY_UPDATE = """
def main(build):
build.packages.install("nose" {0})
import nose
print(nose.__version__)
print("test")
""".strip()
URANIUM_PY_UNINSTALL = """
def main(b... |
# Copyright 2013 OpenStack Foundation
#
# 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... |
#
# 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"); you may not... |
import os
import shutil
import zipfile
if __name__ == "__main__":
chunk_size = 300
pwd = os.path.dirname(os.path.realpath(__file__))
package_dir = os.path.join(pwd, "package")
tmp_dir = os.path.join(pwd, "tmp")
final_dir = os.path.join(pwd, "final")
for zip_file in os.listdir(package_dir):
... |
from shared import *
# Input data is in INPUT_DATA.
# INPUT_DATA = [int(x) for x in INPUT_DATA]
class Line:
def __init__(self, start: complex, end: complex):
self.start: complex
self.start = start
self.end: complex
self.end = end
@property
def vertical(self) -> bool:
... |
"""
ASGI config for diarypro project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... |
import json
from phc.base_client import BaseClient
from phc.easy.auth import Auth
from phc.easy.ocr.options.ocr_config_types import Config as OcrConfig
class Config:
@staticmethod
def create(config: OcrConfig, auth_args: Auth = Auth.shared()):
auth = Auth(auth_args)
client = BaseClient(auth.s... |
import segment as seg
import snakeconfig as config
class Player(object):
def __init__(self):
self.dir_x = 1
self.dir_y = 0
self.length = 4
self.segments = list()
def initializePlayer(self, start_x, start_y):
self.length = 4
self.segments.clear()
... |
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['Lag1Trend'] , ['Seasonal_Hour'] , ['NoAR'] ); |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
class Discord(object):
def __init__(self, client):
self.client = client |
import hashlib
import io
import os
import pathlib
from unittest.mock import patch, ANY, Mock
from freezegun import freeze_time
from pyexpect import expect
from pyfakefs.fake_filesystem_unittest import TestCase
from werkzeug.datastructures import FileStorage
from mariner import config
from mariner.exceptions import Un... |
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: all,-execution,-papermill,-trusted
# formats: ipynb,py//py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.7.1
# kernelspec:
# display_name: Python 3
# ... |
import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="y", parent_name="funnel.marker.colorbar", **kwargs):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... |
TRACES = {
'smell': 'A strange smell',
'rotten_flesh': 'Rotten flesh',
'scratches': "Scratch marks",
'groaning': "Groaning sounds",
'creature_dead': "Entity recognized as deceased",
'creature_wounds': "Some wounds in the body of the entity",
'creature_dirty': "Great amount of dirty covers th... |
# SPDX-License-Identifier: Apache-2.0
"""Unit Tests for Tensorflow shape inference."""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import variables as variables_lib
from... |
import logging
from filelock import FileLock
import pdb
import pandas as pd
# Ignore warnings
import warnings
warnings.filterwarnings("ignore")
import json
'''Logging Modules'''
def get_logger(name, log_file_path='./logs/temp.log', logging_level=logging.INFO, log_format='%(asctime)s | %(levelname)s | %(filename)s: %(... |
from softioc import builder
from tickit.adapters.epicsadapter import EpicsAdapter
from tickit.core.device import Device, DeviceUpdate
from tickit.core.typedefs import SimTime
from tickit.utils.compat.typing_compat import TypedDict
class FemtoDevice(Device):
"""Electronic signal amplifier."""
#: An empty typ... |
import os
import uuid
from cloudinitd.cb_iaas import IaaSTestInstance
from cloudinitd.exceptions import APIUsageException
from cloudinitd.pollables import InstanceHostnamePollable
from cloudinitd.user_api import CloudInitD
import unittest
class ServiceUnitTests(unittest.TestCase):
def test_baddir_name(self):
... |
import xgboost as xgb
import testing as tm
import numpy as np
import unittest
rng = np.random.RandomState(1337)
class TestTrainingContinuation(unittest.TestCase):
num_parallel_tree = 3
xgb_params_01 = {
'silent': 1,
'nthread': 1,
}
xgb_params_02 = {
'silent': 1,
'nth... |
#!/usr/bin/env python
#
# Copyright The SCons Foundation
#
# runtest.py - wrapper script for running SCons tests
#
# The SCons test suite consists of:
#
# - unit tests - included in *Tests.py files from SCons/ dir
# - end-to-end tests - these are *.py files in test/ directory that
# req... |
from requests_oauthlib import OAuth1Session
from django.conf import settings
client_key = settings.SPLITWISE_CLIENT_KEY
client_secret = settings.SPLITWISE_CLIENT_SECRET
def get_request_token():
""" obtain generic resource owner key and secret from splitwise
"""
request_token_url = 'https://secure.splitw... |
__author__ = "Rick Sherman"
__credits__ = "Jeremy Schulman"
import unittest
from nose.plugins.attrib import attr
from jnpr.junos.factory.factory_cls import FactoryCfgTable, FactoryOpTable
from jnpr.junos.factory.factory_cls import FactoryTable, FactoryView
@attr('unit')
class TestFactoryCls(unittest.TestCase):
... |
"""tutorial URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... |
# -*- coding: utf-8 -*-
"""
Encapsulate the different transports available to Salt.
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt libs
import salt.utils.versions
# Import third party libs
from salt.ext import six
from salt.ext.six.moves... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.