text stringlengths 1 927k |
|---|
from briefmetrics import api
from briefmetrics import test
from briefmetrics import model
from briefmetrics.lib.service import registry as service_registry
from briefmetrics.lib.payment import registry as payment_registry
from dateutil.relativedelta import relativedelta
import mock
import json
import logging
import da... |
#!/usr/bin/env python
#
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... |
"""
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the admini... |
# -*- coding: utf-8 -*-
{
'!langcode!': 'pl',
'!langname!': 'Polska',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:',
'%s %%{ro... |
'''
LeetCode LinkedList Q.876 Middle of the Linked List
Recusion and Slow/Fast Pointer Solution
'''
def middleNode(self, head: ListNode) -> ListNode:
def rec(slow, fast):
if not fast:
return slow
elif not fast.next:
return slow
return rec(slow.next, fast.next.nex... |
import asyncore
import socket
LOCAL_SERVER_HOST = 'localhost'
REMOTE_SERVER_HOST = 'www.google.com'
BUFFSIZE = 2048
class PortForwarder(asyncore.dispatcher):
def __init__(self, ip, port, remoteip, remoteport, backlog=5):
asyncore.dispatcher.__init__(self)
self.remoteip = remoteip
self.rem... |
import psycopg2
from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql import text
import os
class NetworkAudit(object):
def __init__(self):
''' Constructor for this class. '''
#@TODO: Refactor
sqlalchemy_db_uri = 'postgresql://{... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen... |
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
import numpy as np
from curvas import *
from utils import rgb
class Heroe:
def __init__(self, p):
self.p = np.array(p) # posicion
self.vive = True # marca para poder eliminar ...
self.r = 30
def... |
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2016 Mag. Christian Tanzer. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
# ****************************************************************************
# This module is part of the package _MOM.
#
# This module is licensed under the terms... |
# -*- coding: utf-8 -*-
"""QGIS Unit test utils for provider tests.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"... |
#V2 uses 4 types of numbers
#V3 uses 3 types of numbers
#types of numbers: int, float, complex
print("\nNumbers:")
#int
a = 496
print("a(496) is a:",type(a))
#float
e = 2.718281828
f = 2.0
print("e(2.718281828) is a:",type(e))
print("f(2.0) is a:",type(f))
#complex numbers
z = 2 - 6.1j
print("z(2-6.1j) is a:",type(z... |
#
# Copyright (C) 2018 ETH Zurich, University of Bologna and
# GreenWaves Technologies
#
# 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
#
# U... |
"""added about_me and last_seen to user
Revision ID: 0b9fe706da69
Revises: 3f0fb80d30af
Create Date: 2019-12-14 14:45:04.886154
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0b9fe706da69'
down_revision = '3f0fb80d30af'
branch_labels = None
depends_on = None
... |
import requests
from requests.auth import HTTPBasicAuth
from access_token import generate_access_token
import keys
def register_url():
my_access_token = generate_access_token()
api_url = "https://sandbox.safaricom.co.ke/mpesa/c2b/v1/registerurl"
headers = {"Authorization": "Bearer %s" % my_access_toke... |
"""
Author: Tong
Time: --2021
"""
from argparse import ArgumentParser
from datasets import NAMES as DATASET_NAMES
import importlib
import os
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from utils.conf import base_path
class DatasetAnalysis:
def __init__(self, dataset, args):
... |
# -*- coding: utf-8 -*-
'''
Insert minion return data into a sqlite3 database
:maintainer: Mickey Malone <mickey.malone@gmail.com>
:maturity: New
:depends: None
:platform: All
Sqlite3 is a serverless database that lives in a single file.
In order to use this returner the database file must exist,
h... |
"""
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... |
#coding:utf-8
#
from django.db import models
from DjangoUeditor.models import UEditorField
from DjangoUeditor.commands import *
def getImagePath(model_instance=None):
if model_instance is None:
return "aaa/"
else:
return "%s/" % model_instance.Name
def getDescImagePath(model_instance=None):
... |
"""
This module implements MC Dropout based sampler.
https://arxiv.org/pdf/1506.02142.pdf
Following https://github.com/yaringal/DropoutUncertaintyExps
"""
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.regularizers import l2
from keras import backend as K
from ... |
#!/usr/bin/env python3
import utils, os, random, time, open_color, arcade
utils.check_version((3,7))
SCREEN_WIDTH = 1000
SCREEN_HEIGHT = 1000
SCREEN_TITLE = "Sprites Example"
class MyGame(arcade.Window):
def __init__(self):
super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
file_path ... |
import sys
# Bronze League
# Bring data on patient samples from the diagnosis machine to the laboratory with enough molecules to produce medicine!
class Sample():
def __init__(self, sample_id, carried_by, rank, gain, health, cost):
self.sample_id = sample_id
self.carried_by = carried_by
s... |
"""
PRACTICE Test 3.
This problem provides practice at:
*** LOOPS WITHIN LOOPS, SEQUENCES and MUTATION ***
Authors: David Mutchler, Valerie Galluzzi, Mark Hays, Amanda Stouder,
their colleagues and Liam.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
def main():
""" Calls the TEST functions i... |
import numpy as np
import pandas as pd
from pandas import Categorical, DataFrame, Series, Timestamp, date_range
import pandas._testing as tm
class TestDataFrameDescribe:
def test_describe_bool_in_mixed_frame(self):
df = DataFrame(
{
"string_data": ["a", "b", "c", "d", "e"],
... |
import argparse
import os
import pandas as pd
def parse_args(args):
parser = argparse.ArgumentParser(description="choose_TFs_cv")
parser.add_argument(
"file_names",
type=str,
help="Name of folder and filenames for the promoters extracted",
)
parser.add_argument(
"no_of... |
# -*- coding:utf-8 -*-
import base64
import datetime
import functools
import hashlib
import json
import logging
import logging.handlers
import mistune
import os
import re
import requests
import shutil
import six
import smtplib
import socket
import sys
import tempfile
import time
import dataset
import datafreeze
import ... |
import warnings
import sys
import abc
abstractmethod = abc.abstractmethod
if sys.version_info >= (3, 4):
ABC = abc.ABC
else: # pragma: no cover
ABC = abc.ABCMeta('ABC', (), {})
from ..adversarial import Adversarial
from ..criteria import Misclassification
class Attack(ABC):
"""Abstract base class for a... |
# Author: Martin Billinger <martin.billinger@tugraz.at>
# License: BSD Style.
import os
from os import path as op
from ..utils import _get_path, _do_path_update
from ...utils import _fetch_file, _url_to_local_path, verbose
EEGMI_URL = 'http://www.physionet.org/physiobank/database/eegmmidb/'
@verbose
def data_path... |
def subset_x_y(target, features, start_index:int, end_index:int):
"""Keep only the rows for X and y sets from the specified indexes
Parameters
----------
target : pd.DataFrame
Dataframe containing the target
features : pd.DataFrame
Dataframe containing all features
features : in... |
# Copyright (c) OpenMMLab. All rights reserved.
import copy
import os.path as osp
from abc import ABCMeta, abstractmethod
from typing import Optional, Sequence, Union
import mmcv
from torch.utils.data import Dataset
from .pipelines import Compose
class BaseDataset(Dataset, metaclass=ABCMeta):
"""Base class for ... |
from sympy.diffgeom.rn import R2, R2_p, R2_r, R3_r, R3_c, R3_s
from sympy.diffgeom import (Commutator, Differential, TensorProduct,
WedgeProduct, BaseCovarDerivativeOp, CovarDerivativeOp, LieDerivative,
covariant_order, contravariant_order, twoform_to_matrix, metric_to_Christoffel_1st,
metric_to... |
# Generated by Django 3.1.4 on 2021-01-09 15:49
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterModelTable(
name='post',
table='post',
),
] |
from admin_tools.dashboard.modules import DashboardModule
from bluebottle.utils.model_dispatcher import get_task_model
from django.utils.translation import ugettext_lazy as _
TASK_MODEL = get_task_model()
class TaskModule(DashboardModule):
"""
"""
title = _('Recently Created Tasks')
template = 'admin... |
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** 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, Dict, List, Mapping, Optional, Tuple, Union
from ... import _utilities, _tables
from . imp... |
# -*- coding: utf-8 -*-
"""Internationalization.
Use
from i18n import translate as _
to enable string localization. In the future it would be easily
replaced by gettext since translatable strings are marked in the
same way as _("text").
Beside the translation service, this module defines the messages
used in the... |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"v1 = \"first string\"\n",
"v2 = \"second string\""
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"v2 = v1\n",
"v1 =... |
import tkinter as tk
import ttk
import Logger
class WhoAmIFrame(ttk.Frame):
def __init__(self, parent, *args, **kwargs):
self.button_command = kwargs.pop('command', lambda *args, **kwargs: None)
self.textvariable = kwargs.pop('textvariable', None)
self.textvariable_path = kwargs.pop('text... |
#amara.lib
__all__ = ['IriError', 'inputsource']
from amara import Error
class IriError(Error):
"""
Exception related to URI/IRI processing
"""
RESOURCE_ERROR = 1
INVALID_BASE_URI = 100
#RELATIVE_DOCUMENT_URI = 110
RELATIVE_BASE_URI = 111
OPAQUE_BASE_URI = 112
NON_FILE_URI = 12... |
'''define the config file for ade20k and resnet50os8'''
from .base_cfg import *
# modify dataset config
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG['train'].update(
{
'type': 'ade20k',
'rootdir': 'data/ADE20k',
}
)
DATASET_CFG['test'].update(
{
'type': 'ade20k',
'rootdir':... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2019 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... |
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/v1/notes/', include('notes.urls'))
] |
import flask
from .users import users_cli
def register_cli(app: flask.Flask):
app.cli.add_command(users_cli) |
import os
import time
from cereal import car
from common.kalman.simple_kalman import KF1D
from common.realtime import DT_CTRL
from selfdrive.car import gen_empty_fingerprint
from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event
from selfdrive.controls.lib.vehicle_model import VehicleModel
from... |
""" Tests for commandline scripts """
from mock import patch
from pypicloud import scripts
from pypicloud.access import get_pwd_context
try:
import unittest2 as unittest # pylint: disable=F0401
except ImportError:
import unittest
class TestScripts(unittest.TestCase):
""" Tests for commandline scripts... |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
# https://dmoj.ca/problem/bsspc21j2
m = int(input())
booleanList = [False] * 1441
for i in range(0,m):
a,b = list(map(int, input().split(" ")))
for j in range(a,b+1):
booleanList[j] = True
n = int(input())
for i in range(0,n):
a,b = list(map(int, input().split(" ")))
intersects = False
for j... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.functional
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for functional languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, incl... |
# SPDX-License-Identifier: MIT
import itertools, fnmatch
from construct import *
from .utils import AddrLookup, FourCC, SafeGreedyRange
__all__ = ["load_adt"]
ADTPropertyStruct = Struct(
"name" / PaddedString(32, "ascii"),
"size" / Int32ul,
"value" / Bytes(this.size & 0x7fffffff)
)
ADTNodeStruct = Struc... |
import os
from pyzbar.pyzbar import decode
from PIL import Image
res = ''
filenames = sorted([int(name.replace('.png', '')) for name in os.listdir('./qrs/')])
for filename in filenames:
if qr:=decode(Image.open('./qrs/'+str(filename)+'.png')):
res += qr[0].data.decode()
else: print(f'error with file {filenam... |
import os
import re
import sys
import sysconfig
import platform
import subprocess
import distutils
import glob
import tempfile
import shutil
from distutils.version import LooseVersion
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
from setuptools.command.test i... |
from django.http import JsonResponse
from django.http import HttpResponse, Http404,HttpResponseRedirect
from .permissions import IsAdminOrReadOnly
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from profiles.models import Pro... |
import functools
from pprint import pprint
from tkinter import *
from datetime import datetime, time
from pytz import timezone
# la fenêtre
import apiWeather
fenetre = Tk()
fenetre.configure(bg="#000000", pady=20, padx=20)
fenetre.attributes("-fullscreen", True)
# définitions des variables destinée à la taille des f... |
import random
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
tmax = 875
t = 0
x = [0]
y = [0]
t=0
t_total = 0
dist = 0
#coord = [[x[t],y[t]]]
while t < tmax:
coord = random.randint(0,1)
if coord == 0:
direction = random.randint(0,1)
dire... |
import aiohttp
async def submit(r: aiohttp.web.RequestHandler):
return aiohttp.web.HTTPOk() |
#! /usr/bin/env python
# ***********************************************************************************
# * Copyright 2010 - 2016 Paulo A. Herrera. All rights reserved *
# * *
# * Redistribution and use in source ... |
import gdown
import tempfile
import pandas as pd
from Bio import SeqIO
import io
# Download GISAID cov2020 acknowledgements file from Google drive
excel_url = "https://drive.google.com/uc?id=1g85nEcuiVnmO75Hh8yWAty5uW8P_RSiR"
# Download sars-cov-2 genomic sequences fasta file
fasta_url = "https://drive.google.com/uc?... |
from __future__ import absolute_import
from ..exceptions import ImproperlyConfigured
from .enriched_datetime import ArrowDateTime
from .enriched_datetime.enriched_datetime_type import EnrichedDateTimeType
arrow = None
try:
import arrow
except ImportError:
pass
class ArrowType(EnrichedDateTimeType):
"""
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import threading
__all__ = ['await_callback']
class ThreadExceptHookHandler(object):
"""Workaround to deal with a bug in the Python interpreter (!).
Report: http://bugs.python.org/issue1... |
""" argdeco.main -- the main function
This module provides :py:class:`~argdeco.main.Main`, which can be used to create main
functions.
For ease it provides common arguments like `debug`, `verbosity` and `quiet`
which control whether you want to print stacktraces, and how verbose the logging
is. These arguments will ... |
import json
from unittest import TestCase
from uuid import uuid4
from events_protocol.core.exception import EventParsingException
from events_protocol.core.logging.supressor import supress_log
from events_protocol.core.model.event import Event, CamelPydanticMixin, ResponseEvent
from events_protocol.core.model.event_ty... |
import pytest
from pip._internal.cli.req_command import RequirementCommand
from pip._internal.commands.install import InstallCommand
from pip._internal.index.collector import LinkCollector
from pip._internal.index.package_finder import PackageFinder
# from pip._internal.models.index import PyPI
from pip._internal.mod... |
import numpy as np
from .config import cfg
pure_python_nms = False
try:
from lib.utils.gpu_nms import gpu_nms
from ..utils.cython_nms import nms as cython_nms
except ImportError:
pure_python_nms = True
def nms(dets, thresh):
if dets.shape[0] == 0:
return []
if pure_python_nms:
# pr... |
"""
Copyright (C) 2018-2020 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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... |
""" The wrapper for pymongo's connection stuff. """
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from pymongo import MongoClient
from pymongo.errors import ConnectionFailure
class Connection(object):
"""
This just caches a pymongo connection and adds
a... |
from pytest_voluptuous import Partial, S
def test_retrieve_supported_tags_response_status_code_is_200(client, recipient_id):
"""
GIVEN a client
WHEN retrieving the list of supported tags
THEN the status code of the response is 200
"""
response = client.retrieve_supported_tags()
assert resp... |
import climate
import pickle
import gzip
import numpy as np
import os
import pickle
import sys
import tarfile
import tempfile
import urllib
try:
import matplotlib.pyplot as plt
except ImportError:
logging.critical('please install matplotlib to run the examples!')
raise
logging = climate.get_logger(__name_... |
#Import Libraries
#Web Scraping tools
from bs4 import BeautifulSoup as bs
from selenium import webdriver
#from splinter import Browser
#DataFrame tools
import pandas as pd
#Misc tools for web scraping
import time
import requests
#Function to initianilze browser.
def init_browser():
#Settings for headless mode.... |
#!/usr/bin/env python
import unittest
from framework import VppTestCase, VppTestRunner
from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
class TestSCTP(VppTestCase):
""" SCTP Test Case """
@classmethod
def setUpClass(cls):
super(TestSCTP, cls).setUpClass()
def setUp(self):
... |
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Stancecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
This checks if all command line args are documented.
Return value is 0 to indicate no error.
Auth... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: link.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import... |
import KratosMultiphysics
import KratosMultiphysics.DEMApplication as DEMApplication
import KratosMultiphysics.KratosUnittest as KratosUnittest
import test_guis
import test_kinematic_constraints
import test_particle_creator_destructor
import test_wall_creator_destructor
import test_analytics
import test_glued_particle... |
#This is the initialization package
from jpeg_compression import Code_experimental_design, Compression_code, Stock_files_library |
from app.models.roles_and_permissions import (
roles,
translate_permissions_from_admin_roles_to_db,
)
from app.notify_client import NotifyAdminAPIClient, _attach_current_user, cache
class InviteApiClient(NotifyAdminAPIClient):
def init_app(self, app):
super().init_app(app)
self.admin_url... |
## [1D] Clump Finding Problem
genome = "CGGACTCGACAGATGTGAAGAAATGTGAAGACTGAGTGAAGAGAAGAGGAAACACGACACGACATTGCGACATAATGTACGAATGTAATGTGCCTATGGC"
k, L, t = 5, 75, 4
## do something...
l1, l2 = 0, L
k1, k2 = 0, k
clumps_dict = {}
first_round = True
while l2 <= len(genome):
while first_round:
while k2 <= l2:
... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
# To add a new artifact module, import it here as shown below:
# from scripts.artifacts.fruitninja import get_fruitninja
# Also add the grep search for that module using the same name
# to the 'tosearch' data structure.
import traceback
from scripts.artifacts.applicationstate import get_applicationstate
from scri... |
#!/usr/bin/python
"""
This program is a demonstration of ellipse fitting.
Trackbar controls threshold parameter.
Gray lines are contours. Colored lines are fit ellipses.
Original C implementation by: Denis Burenkov.
Python implementation by: Roman Stanchak, James Bowman
"""
import sys
import urllib2
import random... |
import os
import re
import traceback
import requests
from lxml import html
from flask import Flask, redirect, jsonify, request, abort
from werkzeug.contrib.cache import FileSystemCache
HOUR = 3600
ROOT_DIR = os.path.join(os.path.dirname(__file__))
CACHE_DIR = os.path.join(ROOT_DIR, 'cache')
app = Flask(__name__)
c... |
import errno
import itertools
import os
import shutil
from collections import namedtuple
from leapp.libraries.stdlib import run, CalledProcessError, api
from leapp.libraries.common.config import get_all_envs
ALWAYS_BIND = ['/etc/hosts:/etc/hosts']
ErrorData = namedtuple('ErrorData', ['summary', 'details'])
class ... |
#
# Copyright 2016 The BigDL 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 in ... |
from . import fixtures |
# Copyright (c) 2021, nla group, manchester
# 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 code must retain the above copyright notice, this
# list of condition... |
# -*- coding: utf-8 -*-
import logging
import os
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
from random import randrange
from collections import namedtuple, deque
from copy import deepcopy
from urllib.parse import urljoin, urlparse
import requests
from .decorators import with_histor... |
# 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 agreed to in writing, ... |
# Generated by Django 2.2.11 on 2020-04-22 17:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0023_merge_20200406_1206'),
]
operations = [
migrations.AlterModelOptions(
name='creator',
options={'order... |
# coding=utf-8
"""
@author: magician
@date: 2018/8/25
"""
import collections
class StrKeyDict(collections.UserDict):
"""
key is str
"""
def __missing__(self, key):
if isinstance(key, str):
raise KeyError(key)
return self[str(key)]
def __contains__(self, key):
... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The GleecBTC Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -alertnotify, -blocknotify and -walletnotify options."""
import os
from test_framework.addre... |
import cv2
import sys
import os
import numpy as np
def main(arg: object) -> object:
img_path = arg[0]
img_out = arg[1]
height = int(arg[2])
if not os.path.exists(img_path) or not os.path.exists(img_out):
print("Path error")
return
files = os.listdir(img_path)
for index, file ... |
from __future__ import absolute_import, print_function
__all__ = ['SourceProcessor']
import codecs
import logging
import re
import base64
import six
import time
import zlib
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from collections import namedtuple
from os.path import s... |
# Copyright 2022 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 required by applicable law or a... |
#!/usr/bin/env python
"""
Terminal Colorization
=====================
This module contains a class for sending strings with color and other
attributes to a terminal application.
Simple Usage Example
--------------------
Print bold and bright red text on a white background.
import termcolor
termcolor.cprin... |
#!/usr/bin/env python3
# Copyright (c) 2016-2018 The Democoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various net timeouts.
- Create three democoind nodes:
no_verack_node - we never send a vera... |
# 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 may ... |
"""
Tests for the timer impl extension
"""
import unittest
import threading
from typing import List, Callable
from ....base import EventBus
from ....boot.bootstrap.bus import bootstrap_event_bus
from ....core.timer.api.bootstrap import bootstrap_timer_api
from ....core.state.api.events import EVENT_ID_UPDATED_STATE, S... |
import numpy as np
from tensorflow.keras import backend as K
def extract_image_patches(X, ksizes, strides,
padding='valid',
data_format='channels_first'):
raise NotImplementedError
def depth_to_space(input, scale, data_format=None):
raise NotImplementedErr... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'My Project',
'author': 'My Name',
'url': 'URL to get it at.',
'download_url': 'Where to download it.',
'author_email': 'My email.',
'version': '0.1',
... |
import asyncio
import os.path
import time
import sys
import platform
import queue
import traceback
import os
import webbrowser
from functools import partial, lru_cache
from typing import NamedTuple, Callable, Optional, TYPE_CHECKING, Union, List, Dict
from PyQt5.QtGui import (QFont, QColor, QCursor, QPixmap, QStandar... |
from .users import User, Permission
from .logs import save_access |
"""Example on how to disconnect/reset all available tunneling channels."""
import asyncio
from xknx import XKNX
from xknx.io import ConnectionState, Disconnect, GatewayScanner, UDPClient
async def main():
"""Search for a Tunnelling device, walk through all possible channels and disconnect them."""
xknx = XKN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.