text stringlengths 2 999k |
|---|
# SPDX-License-Identifier: Apache-2.0
"""
Python Package for controlling Tesla API.
For more details about this api, please refer to the documentation at
https://github.com/zabuldon/teslajsonpy
"""
import time
from typing import Dict, Optional, Text
import datetime
from teslajsonpy.homeassistant.vehicle import Vehic... |
import json
import pika
class ConsumeMessage(object):
"""Consumes a JSON message. A subclass of this method has to be passed to
AsyncConsumer. This subclass will have to implement a `process_msg`
method.
"""
def __init__(self,
properties: pika.spec.BasicProperties = None,
... |
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path("", include("main.urls")),
]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL,
... |
# Licensed under a 3-clause BSD style license - see PYFITS.rst
from __future__ import print_function
import bz2
import gzip
import os
import shutil
import sys
import warnings
import numpy as np
from . import compressed
from .base import _BaseHDU, _ValidHDU, _NonstandardHDU, ExtensionHDU
from .groups import GroupsHD... |
# -*- 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... |
# Copyright 2018-2022 Streamlit 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 required by applicable law or agreed to in wr... |
def permute(seq):
if not seq:
yield seq
else:
for i in range(len(seq)):
rest = seq[:i] + seq[i+1:]
for x in permute(rest):
yield seq[i:i+1] + x
print(list(permute('abc')))
|
import string
from chatterbot import languages
class LowercaseTagger(object):
"""
Returns the text in lowercase.
"""
def __init__(self, language=None):
self.language = language or languages.ENG
def get_text_index_string(self, text):
return text.lower()
class PosLemmaTagger(obje... |
# Copyright 2019 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, ... |
from enum import Enum
class ColumnDType(Enum):
STRING = "STRING"
ICONBUTTON = "ICONBUTTON"
DOWNLOAD = "DOWNLOAD"
IMAGE = "IMAGE"
LINK = "LINK"
class Column():
def __init__(self, name, label = None, switchcase = None, dtype: ColumnDType = ColumnDType.STRING, icon = None):
self... |
# Generated by Django 2.2.12 on 2021-02-01 16:11
from django.db import migrations
def remove_waffle_switch(apps, schema_editor):
Switch = apps.get_model('waffle', 'Switch')
Switch.objects.filter(name='yara-read-binary').delete()
class Migration(migrations.Migration):
dependencies = [('scanners', '0041... |
# 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
# distributed under t... |
import os
import itertools
import numpy as np
import pytest
import scipy.stats as sts
import sklearn.metrics as skm
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
import mmu
from mmu.commons._testing import gene... |
from setuptools import setup, find_packages
with open("README.md", 'r') as fh:
long_description = fh.read()
setup(
url = "https://github.com/mesquita-daniel/StabBB",
author = 'Daniel Mesquita',
name="stabbb",
version="0.0.0.1",
description="Implementation of stabilized Barzilai-Borwein Method ... |
# -*- coding: utf-8 -*-
'''
Define some generic socket functions for network modules
'''
# Import python libs
from __future__ import absolute_import, unicode_literals, print_function
import itertools
import os
import re
import types
import socket
import logging
import platform
import random
import subprocess
from stri... |
import pytest
from etcaetera.adapter import *
class TestAdapterSet:
def test_set_defaults_to_invalid_type_raises(self):
s = AdapterSet()
with pytest.raises(TypeError):
s.defaults = 123
def test_set_overrides_to_invalid_type_raises(self):
s = AdapterSet()
... |
import sys
import semver
import logging
import reconcile.queries as queries
import reconcile.openshift_base as ob
import reconcile.jenkins_plugins as jenkins_base
from reconcile.slack_base import init_slack
from utils.gitlab_api import GitLabApi
from utils.saasherder import SaasHerder
from utils.defer import defer
... |
# coding=utf-8
#
# 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");... |
import numpy as np
from ..plot.crosssection import _StructuredCrossSection
from ..plot.vcrosssection import _VertexCrossSection
from ..plot import plotutil
try:
import matplotlib.pyplot as plt
import matplotlib.colors
except ImportError:
plt = None
class PlotCrossSection(object):
"""
... |
import numpy as np
import pdb
from pylayers.antprop.slab import *
from pylayers.antprop.diff import *
#
# Metalic case : MacNamara Page 202
#
fGHz = 3.
N = 320/180.
phi0 = 40*np.pi/180.
phi = np.linspace(0.01,N*np.pi-0.01,800)
#phi = np.linspace(0,3*np.pi/2,10)
dm = MatDB()
dm.load('matDB.ini')
mat0 = dm['METAL']
matN ... |
import logging
import json
import subprocess
def send(channel=None, process=None):
"""Notify Slack channel about the ended process.
:param channel: Slack channel
:param process: information about process. (.info() inserted into body)
"""
if channel is None:
raise ValueError("'channel'key... |
#!/usr/bin/python
import time
import random
import sys
import alsaaudio
import json
import requests
import os
import socket
from collections import OrderedDict
WHOAMI = socket.gethostname()
WHATAMI = os.path.basename(__file__).replace(".py", "")
#m = alsaaudio.Mixer('PCM')
#current_volume = m.getvolume() # Get the cu... |
# Generated by Django 3.0.3 on 2021-01-27 13:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fyle', '0004_auto_20201209_0558'),
]
operations = [
migrations.AddField(
model_name='expense',
name='billable',
... |
import logging
import os
import random
import redis
import telegram
from dotenv import load_dotenv
from functools import partial
from bot_utils import get_arguments
from bot_utils import get_quiz_qa
from enum import Enum
from telegram.ext import ConversationHandler
from telegram.ext import CommandHandler
from telegra... |
import unittest
import rlbench.backend.task as task
import os
from rlbench.backend.utils import task_file_to_task_class
from pyrep import PyRep
from pyrep.robots.arms.panda import Panda
from pyrep.robots.end_effectors.panda_gripper import PandaGripper
from rlbench.backend.const import TTT_FILE
from tools.task_validator... |
'''
page
~~~~
Handles creating new pages and inserting them in the master document.
:copyright: Copyright 2011-2014 by Vlad Riscutia and contributors (see
CONTRIBUTORS file)
:license: FreeBSD, see LICENSE file
'''
import os
import shutil
import tinkerer
from tinkerer import master, paths, util... |
class Person:
name=''
def sayHello(self,msg):
return self.name+' say:'+msg
x =Person()
x.name="xiao.xinmiao"
hello =x.sayHello("good morning.")
print(hello)
y =Person()
y.name="liu.ruoying"
hello2 =y.sayHello("good everning.")
print(hello2) |
#!/usr/bin/env python
"""
This application replicates the switch CLI command 'show fex'
It largely uses raw queries to the APIC API
"""
from acitoolkit import Credentials, Session
from tabulate import tabulate
class FexCollector(object):
def __init__(self, url, login, password):
# Login to APIC
se... |
#! /usr/bin/env python
"""
Moduł zawiera klasę wyliczajcą średni rozmiar dziur na obrazku w skali szarości
"""
import copy
from feature import feature
from bitmap import bitmap_grayscale
class AvgSizeOfHoleFeature(feature.Feature):
"""
Klasa oblicza średni rozmiar dziur.
Cecha 17.
"""
def __in... |
# encoding: utf-8
# If the genre classification does not match the fiction classification, throw
# away the genre classifications.
#
# E.g. "Investigations -- nonfiction" maps to Mystery, but Mystery
# conflicts with Nonfiction.
# SQL to find commonly used DDC classifications
# select count(editions.id) as c, subject... |
# 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 ... |
def maximum_minimum(x):
print('Given list:\t',l)
maximum = x[0]#We will take a constant to check
for i in x:#For all the numbers in list
if maximum < i:#if any number exists larger than maximum, if exists then next number larger than that number and so on
maximum = i#Gave variable the v... |
#!/usr/bin/python
# (c) 2016, Tomas Karasek <tom.to.the.k@gmail.com>
# (c) 2016, Matt Baldwin <baldwin@stackpointcloud.com>
# (c) 2016, Thibaud Morel l'Horset <teebes@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... |
import pandas as pd
from db_connector import FixturesDB
from db_connector import LeagueDB
from db_connector import PlayersDB
from db_connector import TeamsDB
class DataInit():
def __init__(self, league='EN_PR', season='2019'):
self.league = league
self.season = season
@staticmethod
def... |
from rest_framework import generics
from rest_framework.filters import DjangoFilterBackend
from .models import *
from .serializers import *
from rest_framework_gis.filters import *
class LocationList(generics.ListCreateAPIView):
model = Location
serializer_class = LocationGeoSerializer
pagination_seriali... |
from PARAMETERS import *
from helpers_cntk import *
####################################
# MAIN
####################################
makeDirectory(modelDir)
print ("classifier = " + classifier)
print ("cntk_lr_per_image = " + str(cntk_lr_per_image))
# optionally retrain DNN
# if the classifier is svm, then simply re... |
import uuid
from copy import deepcopy
from datetime import date, timedelta
from decimal import Decimal
from unittest import mock
from unittest.mock import ANY, MagicMock, Mock, call, patch
import graphene
import pytest
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ValidationEr... |
import json
from pathlib import Path
from typing import Any, Dict, Optional, Set, Union
import numpy
from pydantic import BaseModel, BaseSettings
from ..testing import compare_recursive
from ..util import deserialize, serialize, yaml_import
from ..util.autodocs import AutoPydanticDocGenerator
from ..util.decorators i... |
from collections import defaultdict
from functools import lru_cache
def sum_of_squares_of_digits(n):
return sum(int(d) ** 2 for d in str(n))
@lru_cache(maxsize=None)
def get_terminal_number(n):
if n in [0, 1, 89]:
return n
return get_terminal_number(sum_of_squares_of_digits(n))
def ans():
... |
#
# PySNMP MIB module A3COM-HUAWEI-EVC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-EVC-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:04:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... |
# Copyright 2018 The TensorFlow 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 applica... |
import logging
import pytorch_lightning as pl
from hydra.utils import instantiate
from torch.utils.data import DataLoader, Dataset
class MNISTDataLoader(pl.LightningDataModule):
def __init__(
self,
dataset,
data_base_path: str,
batch_size: int,
num_workers: int,
tr... |
# -*- coding: utf-8 -*-
"""
Clase C{ArithmeticOperatorNode} del árbol de sintáxis abstracta.
"""
from pytiger2c.ast.binaryoperatornode import BinaryOperatorNode
from pytiger2c.types.integertype import IntegerType
class ArithmeticOperatorNode(BinaryOperatorNode):
"""
Clase C{ArithmeticOperatorNode} del árbol... |
#!/usr/bin/env python
"""Tests for the hunt."""
import logging
from grr.lib import flags
from grr.lib import queues
from grr.lib import rdfvalue
from grr.lib import utils
from grr.server import aff4
from grr.server import flow
from grr.server import foreman as rdf_foreman
from grr.server.hunts import implementation
... |
#!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA
#
# https://github.com/CNES/Pandora_pandora
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... |
# -*- coding: utf-8 -*-
"""
The following image extraction implementation was taken from an old
copy of Reddit's source code.
"""
__title__ = 'newspaper'
__author__ = 'Lucas Ou-Yang'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014, Lucas Ou-Yang'
import logging
import math
import io
import traceback
import urllib.... |
import logging
import requests
from django.core.exceptions import SuspiciousOperation
from django.urls import reverse
from mozilla_django_oidc.auth import OIDCAuthenticationBackend
from mozilla_django_oidc.utils import absolutify
from oidc.services import store_token_info_in_oidc_profile
LOGGER = logging.getLogger(_... |
import datetime
from pathlib import Path
from .context import browser_history
from .utils import ( # noqa: F401; pylint: disable=unused-import
become_linux,
become_mac,
become_windows,
change_homedir,
assert_histories_equal,
assert_bookmarks_equal,
)
# pylint: disable=redefined-outer-name,un... |
import logging
import os
import time
from ray import data
from ray.rllib.offline.io_context import IOContext
from ray.rllib.offline.json_writer import _to_json_dict
from ray.rllib.offline.output_writer import OutputWriter
from ray.rllib.utils.annotations import override, PublicAPI
from ray.rllib.utils.typing import Sa... |
import discord
import aiohttp
import asyncio
import json
import yaml
import logging
from datetime import datetime, timedelta
from io import BytesIO
from urllib.parse import quote
from redbot.core import commands, checks, Config
from redbot.core.data_manager import cog_data_path
from redbot.core.i18n import Translator, ... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "the_el.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
# -*- coding:utf-8 -*-
from ais_sdk.utils import encode_to_base64
from ais_sdk.utils import decode_to_wave_file
from ais_sdk.distortion_correct import distortion_correct_aksk
from ais_sdk.utils import init_global_env
import json
if __name__ == '__main__':
#
# access moderation distortion correct post data by a... |
from rand_param_envs.gym.envs import algorithmic as alg
import unittest
# All concrete subclasses of AlgorithmicEnv
ALL_ENVS = [
alg.copy_.CopyEnv,
alg.duplicated_input.DuplicatedInputEnv,
alg.repeat_copy.RepeatCopyEnv,
alg.reverse.ReverseEnv,
alg.reversed_addition.ReversedAdditionEnv,
]
ALL_TAPE_... |
# Copyright 2021 DeepMind Technologies Limited. 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 ... |
import numpy as np
import tensorflow as tf
from .ops import causal_conv, mu_law_encode
def create_variable(name, shape):
'''Create a convolution filter variable with the specified name and shape,
and initialize it using Xavier initialition.'''
initializer = tf.contrib.layers.xavier_initializer_conv2d()
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=15
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
class Opty(cirq.PointOptimizer):
def optimization_at(
... |
#!/usr/bin/env python3
"""
"""
import json
import logging
import os
import shutil
from pathlib import Path
from pprint import pprint
from unittest import TestCase
import flywheel_gear_toolkit
from flywheel_gear_toolkit.utils.zip_tools import unzip_archive
import run
def install_gear(zip_name):
"""unarchive ini... |
# Copyright 2017 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... |
import pytest
from tests.utils import file_response
from documenters_aggregator.spiders.chi_police import Chi_policeSpider
test_response = file_response('files/chi_police.json')
spider = Chi_policeSpider()
parsed_items = [item for item in spider.parse(test_response) if isinstance(item, dict)]
def test_name():
as... |
from agent import Agent
from q_learning.src.game import TicTacToe, RunRL
from TicTacToe.q_learning.src.q_learning_agent import Agent as PreciseAgent
def main():
game = TicTacToe()
alpha = 1e-4
gamma = 0.5
agentA = Agent(game, alpha, gamma)
agentB = PreciseAgent(game, alpha, gamma=0.7)
runGame... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import os.path as osp
import cv2
import logging
import argparse
import motmetrics as mm
import numpy as np
import torch
from lib.tracker.multitracker import JDETracker
from lib.tra... |
# proxy module
from kiva.agg.test_numeric_weakref import *
|
import warnings
import pytest
def lame_function():
warnings.warn("Please stop using this", DeprecationWarning)
# rest of function
def test_lame_function(recwarn):
lame_function()
assert len(recwarn) == 1
w = recwarn.pop()
assert w.category == DeprecationWarning
assert str(w.message) == '... |
from django.apps import AppConfig
class LojasConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'lojas'
|
#!/usr/bin/env python
from evgen.core import SessionTemplate, EventGroup, GenericEventTemplate
from evgen.writers import ConsoleWriter
from evgen.formats import CSVEventFormat
from random import uniform
#Random time series generator example
#creating custom event template
class TemperatureEventTemplate(GenericEventT... |
# 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 u... |
#!/usr/bin/env/py35
# coding=utf-8
import requests
import json
from urllib.request import urlopen,Request
from urllib.parse import urlencode
import ssl
from flask import Flask,jsonify,g,request
import logging
import os
API_KEY = 'aQRWZp00xQ4aX56D03gzuo7Y'
SECRET_KEY = 'Ip8ARjMQc1j6O3mgZNDNZQgAs3v0GBfn'
URL = 'https:... |
"""
Tests on Pointset labelling class: PointInfo
Robert Clewley, November 2005
"""
from PyDSTool.Points import PointInfo
from PyDSTool.parseUtils import symbolMapClass
import pytest
@pytest.fixture()
def pi():
p = PointInfo()
p[3] = ('a', {'bif': 'sn'})
p[5] = ('a', {'bif': 'h'})
p['a'] = (7, {'bif... |
# fault analysis
from .fault_analysis import solve_bus_asymmetry_fault
from .analysis_result import save_fault_analysis_result |
import logging
import os
import unittest
from io import StringIO
from typing import Optional
import jsonasobj
from jsonasobj2 import as_json, load
from linkml.utils.schemaloader import SchemaLoader
from tests.test_utils.environment import env
from tests.utils.filters import json_metadata_filter
from tests.utils.test_... |
import sys
import logging
import logging.handlers
import logging.config
import datetime
DISABLE__STD = False
logging.config.fileConfig('missed.conf')
logger = logging.getLogger(__name__)
intelliDialogue_verbose = False
def log(s):
if intelliDialogue_verbose:
logger.info(str(s))
def... |
from enum import Enum
from typing import Any, Dict, List, NoReturn, Optional, Tuple, Type, TypeVar
from django.utils.translation import gettext as _
T = TypeVar("T", bound="AbstractEnum")
class AbstractEnum(Enum):
"""An enumeration whose members are used strictly for their names."""
def __new__(cls: Type[T... |
"""Code for parsing files."""
from .segments_base import BaseSegment
from .lexer import Lexer
from .grammar import Delimited, Ref
class FileSegment(BaseSegment):
"""A segment representing a whole file or script.
This is a bit of a special segment in that it does the initial splitting
and probably defin... |
"""Tests for the definitions module."""
from pathlib import Path
from unittest.mock import patch
from cmatools.definitions import (
CONFIGFILE,
CONFIGLOGS,
PACKAGE,
ROOT_DIR,
SRC_DIR,
main,
)
DEBUG = True
"""bool: Debugging module-level constant (Default: True)."""
def test_definitions():
... |
"""Manages Git."""
import logging
import os
from funcy import cached_property
from pathspec.patterns import GitWildMatchPattern
from dvc.exceptions import GitHookAlreadyExistsError
from dvc.scm.base import Base
from dvc.scm.base import CloneError
from dvc.scm.base import FileNotInRepoError
from dvc.scm.base import R... |
from mailu import db, models
from mailu.internal import internal
import flask
@internal.route("/postfix/domain/<domain_name>")
def postfix_mailbox_domain(domain_name):
domain = models.Domain.query.get(domain_name) or flask.abort(404)
return flask.jsonify(domain.name)
@internal.route("/postfix/mailbox/<emai... |
# Generated by Django 3.1.5 on 2021-01-11 12:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0159_call_part_introductory_text_blank'),
]
operations = [
migrations.AlterField(
model_name='proposalscientific... |
# 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
# distributed under t... |
""" Elements are mini chameleon macros, usually used to render a single
element. Sometimes it is useful to not just apply a macro, but to have an
actual object representing that code snippet. The prime example being links.
Elements are rendered in chameleon templates by calling them with the layout
object::
<tal:... |
# -*- coding: utf-8 -*-
"""
Created Date: 2021-03-22 Am
@author: XiaoQingLin
@email: xiaoqinglin2018@gmail.com
"""
from os.path import dirname, join
from sys import version_info
import setuptools
if version_info < (3, 0, 0):
raise SystemExit("binary_python requires must be python 3.0.0 or later.")
with open(joi... |
from django.apps import AppConfig
class DepartmentConfig(AppConfig):
name = 'department'
|
import getpass
import json
import lzma
import os
import platform
import re
import shutil
import string
import sys
import tempfile
from contextlib import contextmanager, suppress
from datetime import datetime, timezone
from functools import wraps
from hashlib import md5
from io import BytesIO
from pathlib import Path
fr... |
'''
Created on Oct 23, 2015
@author: kelvinguu
'''
import logging
import operator
import os.path
import random
import shutil
import traceback
import types
import json
import warnings
from abc import ABCMeta, abstractmethod, abstractproperty
from collections import OrderedDict, defaultdict, MutableMapping, Mapping
from... |
"""
With these settings, tests run faster.
"""
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY",
default="vIMQefyEk... |
cudnn_benchmark = True
# model settings
norm_cfg = dict(type='BN', requires_grad=True)
model = dict(
type='RetinaNet',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
... |
# Dependencies
from aurora.helpers import app
# Controllers routes
apps = [
app(name='errors', url='errors'),
app(name='aurora', url='aurora'),
app(name='notes', url='notes'),
app(name='users', url='users'),
]#do-not-change-me |
import json
import tarfile
import urllib2
import os
import codecs
import gzip
import sys
from Tkinter import *
import Tkinter as tk
from PIL import ImageTk, Image
import tkMessageBox, Tkconstants, tkFileDialog
DEVCENTRIC_IMAGE = "small-devcentric.png"
class LMEUI():
def __init__1(self, root):
#Fram... |
from .yolo_utils.google_utils import *
from .yolo_utils.layers import *
from .yolo_utils.parse_config import *
ONNX_EXPORT = False
def create_modules(module_defs, img_size, cfg):
# Constructs module list of layer blocks from module configuration in module_defs
img_size = [img_size] * 2 if isinstance(img_siz... |
from .BaseSerializer import BaseSerializer
from .IntSeriliazer import IntSerializer
from ..BaseModel import BaseModel
class ModelSeriliazer(BaseSerializer):
@classmethod
def serialize(cls, value, dtype=None, format=None):
assert isinstance(value, dtype)
return value.to_dict()
@classmethod... |
from .detector import *
from .extractor import *
from .image import *
from .job import *
from .matcher import *
from .presentation import *
from .video import *
from .video_frame import *
from .misc import *
|
from matplotlib.patches import _Style, FancyArrowPatch
from matplotlib.transforms import IdentityTransform
from matplotlib.path import Path
import numpy as np
class _FancyAxislineStyle:
class SimpleArrow(FancyArrowPatch):
"""
The artist class that will be returned for SimpleArrow style.
""... |
import discord, asyncio
import logging, traceback
import platform
import time
import sys
from discord.ext import commands
from utils import presence,settings
log = logging.getLogger("bot.core")
class LunaBot(commands.AutoShardedBot):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs... |
'''
model:
Declares all functions for
running Tensorflow + Keras model functions.
''' |
from psycopg2.extras import DateRange, DateTimeRange, DateTimeTZRange, NumericRange
from django.apps import AppConfig
from django.core.signals import setting_changed
from django.db import connections
from django.db.backends.signals import connection_created
from django.db.migrations.writer import MigrationWriter
from ... |
# Copyright 2021 Troila
# 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 applic... |
from neighborhood.views import user_profiles
from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.dispatch import receiver
from .models import Profile
@receiver(post_save, sender=User)
def create_profile(sender, instance, created, **kwargs):
if created:
Pr... |
# Last Update: 18-09-2021, Author: Lusmaysh
import sys,os,random
R = "\33[31;1m";G = "\33[32;1m";Y = "\33[33;1m";
try:
from requests import *
from threading import Thread
from user_agent import generate_user_agent
except ImportError:
try:
os.system("pip3 install requests threaded user_agent")
except:
os.system... |
"""
`try` - Awesome cli tool to try out python packages.
This module contains the command line interface.
:copyright: (c) by Timo Furrer
:license: MIT, see LICENSE for details
"""
import os
import re
import sys
import click
from .core import Package, TryError, try_packages
from .config import parse... |
# Simple test suite for http/cookies.py
import copy
from test.support import run_unittest, run_doctest
import unittest
from http import cookies
import pickle
class CookieTests(unittest.TestCase):
def test_basic(self):
cases = [
{'data': 'chips=ahoy; vienna=finger',
... |
import paramiko
from time import sleep
import json
import config
import ssh
import mister
import cores
import logger
import discord
SETTINGS = config.get_config()
maps = cores.read_file_map()
RECENTS_FOLDER = '/media/{}/config/'.format(SETTINGS['core_storage'])
last_game = None
last_core = None
def replace_text(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.