text stringlengths 28 881k |
|---|
import torchNEWLINEimport torch.nn as nnNEWLINEimport torch.nn.functional as FNEWLINEfrom mmcv.cnn import normal_init, kaiming_initNEWLINEimport numpy as npNEWLINENEWLINEfrom mmdet.ops import ModulatedDeformConvPack, RoIAlign, soft_nmsNEWLINEfrom mmdet.core import multi_apply, bbox_areas, force_fp32NEWLINEfrom mmdet.co... |
# coding: utf-8NEWLINENEWLINE"""NEWLINE Isilon SDKNEWLINENEWLINE Isilon SDK - Language bindings for the OneFS API # noqa: E501NEWLINENEWLINE OpenAPI spec version: 4NEWLINE Contact: sdk@isilon.comNEWLINE Generated by: https://github.com/swagger-api/swagger-codegen.gitNEWLINE"""NEWLINENEWLINENEWLINEfrom _... |
from os import path, environNEWLINEfrom os.path import joinNEWLINEimport jsonNEWLINENEWLINENEWLINEclass Config:NEWLINE def __init__(self):NEWLINE _dirpath = path.dirname(path.realpath(__file__))NEWLINE self.config_path = join(_dirpath, '../config.json')NEWLINENEWLINE if path.isfile(self.config_p... |
"""DSM 7 SYNO.Core.* datas."""NEWLINE |
import loggingNEWLINEimport reNEWLINEimport timeNEWLINEimport hashlibNEWLINENEWLINEfrom bs4 import BeautifulSoupNEWLINEimport requestsNEWLINEfrom requests.exceptions import ReadTimeoutNEWLINENEWLINEclass BackEnd:NEWLINENEWLINE @staticmethodNEWLINE def help():NEWLINE return [NEWLINE "url: ex http... |
# Try getting setup from setuptools first, then distutils.core.NEWLINE# http://goo.gl/BC32zk (StackOverflow)NEWLINEtry:NEWLINE from setuptools import setupNEWLINEexcept ImportError:NEWLINE from distutils.core import setupNEWLINENEWLINEclassifiers = [NEWLINE 'Development Status :: 3 - Alpha',NEWLINE 'Intende... |
import timeNEWLINENEWLINEfrom absl import loggingNEWLINENEWLINEfrom icubam.www.handlers import baseNEWLINEfrom icubam.www.handlers import homeNEWLINEfrom icubam.www import tokenNEWLINEfrom icubam.www import updaterNEWLINENEWLINENEWLINEclass UpdateHandler(base.BaseHandler):NEWLINENEWLINE ROUTE = updater.Updater.ROUTENE... |
"""Implements get optimizer method."""NEWLINEimport torchNEWLINENEWLINENEWLINEdef get_optimizer(optimizer):NEWLINE """Method to get optimizer from pytorch."""NEWLINE dir_optim = dir(torch.optim)NEWLINE opts = [o.lower() for o in dir_optim]NEWLINENEWLINE if isinstance(optimizer, str):NEWLINENEWLINE tr... |
# -*- coding: utf-8 -*-NEWLINE"""NEWLINENEWLINEScript Name: ProFile.pyNEWLINEAuthor: Do Trinh/Jimmy - 3D artist.NEWLINENEWLINEDescription:NEWLINENEWLINE"""NEWLINE# -------------------------------------------------------------------------------------------------------------NEWLINENEWLINEfrom pyPLM.Widgets import GroupGr... |
import pkgutilNEWLINEimport insightsNEWLINEimport jsonNEWLINENEWLINE# from insights.client.config import InsightsConfigNEWLINEfrom insights.client.collection_rules import InsightsUploadConfNEWLINEfrom mock.mock import patch, MockNEWLINEfrom insights.specs.default import DefaultSpecsNEWLINEfrom insights.specs.sos_archiv... |
"""NEWLINETurner, Mann, Clandinin:NEWLINENEWLINEhttps://github.com/mhturner/SC-FCNEWLINEmhturner@stanford.eduNEWLINE"""NEWLINEfrom scfc import bridge, anatomical_connectivityNEWLINEimport osNEWLINENEWLINEdata_dir = bridge.getUserConfiguration()['data_dir']NEWLINENEWLINEinclude_inds_branson, name_list_branson = bridge.g... |
#!/bin/env python2.7NEWLINE# encoding: utf-8NEWLINEimport ctypesNEWLINEimport osNEWLINEimport reNEWLINEimport sysNEWLINEimport timeNEWLINENEWLINEIS_32_BITS_PYTHON = ctypes.sizeof(ctypes.c_voidp)==4NEWLINE# 4 for 32 bit or 8 for 64 bit. NEWLINENEWLINEfrom fixtures import *NEWLINENEWLINENEWLINEtry:NEWLINE FileNotFound... |
from __future__ import absolute_importNEWLINEfrom __future__ import divisionNEWLINEfrom __future__ import print_functionNEWLINENEWLINEimport tensorflow as tfNEWLINENEWLINEfrom ray.rllib.models.model import ModelNEWLINEfrom ray.rllib.models.fcnet import FullyConnectedNetworkNEWLINEfrom ray.rllib.models.action_dist impor... |
import reNEWLINEimport unittestNEWLINEimport markdownNEWLINEfrom biovis_media_extension.extension import BioVisPluginExtensionNEWLINENEWLINEclass TestUtils(unittest.TestCase):NEWLINE plugin = BioVisPluginExtension(configs={})NEWLINENEWLINE def test_invalid_plugin(self):NEWLINE text = """NEWLINE @inv... |
import jsonNEWLINEimport configparserNEWLINEimport argparseNEWLINEimport numpy as npNEWLINEimport pyodbcNEWLINEimport pandas as pdNEWLINENEWLINEfrom pyapacheatlas.auth import ServicePrincipalAuthenticationNEWLINEfrom pyapacheatlas.core.typedef import EntityTypeDefNEWLINEfrom pyapacheatlas.core import (NEWLINE AtlasA... |
import getpassNEWLINEimport os.path as pathNEWLINEimport osNEWLINEimport numpy as npNEWLINEfrom scipy.stats import describeNEWLINENEWLINEHOST, PORT = "141.37.176.188", 22NEWLINEBASE_URL = "/michael/DoD/baumer_test_prod_var/512x512_samplescale1.0_patchscale1.0/samples"NEWLINEBASE_DIR = "__sftpcache__"NEWLINENEWLINEclass... |
import serialNEWLINEimport datetimeNEWLINEimport csvNEWLINEser = serial.Serial('/dev/cu.usbmodem1461', 9600)NEWLINEwhile (1):NEWLINE serial_line = ser.readline()NEWLINE a = (ser.readline().decode("utf-8"))NEWLINE rup = datetime.datetime.now().strftime('%m-%d %H:%M:%S')NEWLINE a = rup + ','+ aNEWLINE prin... |
from __future__ import print_functionNEWLINENEWLINEimport pytestNEWLINENEWLINEfrom urbansim_templates.shared import CoreTemplateSettingsNEWLINENEWLINENEWLINEdef test_property_persistence():NEWLINE """NEWLINE Confirm CoreTemplateSettings properties persist through to_dict() and from_dict().NEWLINE NEWLINE ""... |
"""NEWLINEData structures for sparse float data. Life is made simpler by dealing only withNEWLINEfloat64 dataNEWLINE"""NEWLINENEWLINE# pylint: disable=E1101,E1103,W0231,E0202NEWLINENEWLINEfrom numpy import nanNEWLINEimport numpy as npNEWLINENEWLINEfrom pandas.core.common import _pickle_array, _unpickle_array, _try_sort... |
from typing import Any, Dict, GeneratorNEWLINENEWLINEimport pytestNEWLINEfrom pydantic import BaseModelNEWLINENEWLINEfrom xpresso import App, Dependant, FromFormData, Path, SecurityNEWLINEfrom xpresso.security import OAuth2, OAuth2PasswordRequestFormStrictNEWLINEfrom xpresso.testclient import TestClientNEWLINEfrom xpre... |
# setup.pyNEWLINE#!/usr/bin/env pythonNEWLINENEWLINEfrom setuptools import setup, find_packagesNEWLINENEWLINEsetup(NEWLINE name='indexserial',NEWLINE version='1.1.0',NEWLINE description='Serialize objects and allow random reading.',NEWLINE author='JamzumSum',NEWLINE author_email='zzzzss990315@gmail.com',... |
import osNEWLINEimport clickNEWLINENEWLINEdef register(app):NEWLINE @app.cli.group()NEWLINE def translate():NEWLINE """translation and localization"""NEWLINE passNEWLINENEWLINE @translate.command()NEWLINE def update():NEWLINE """Update all languages."""NEWLINE if os.system('pybab... |
import subprocessNEWLINEfrom pkgmt import newNEWLINENEWLINEimport pytestNEWLINENEWLINENEWLINE@pytest.fixtureNEWLINEdef uninstall():NEWLINE yieldNEWLINE subprocess.check_call(['pip', 'uninstall', 'somepkg', '-y'])NEWLINENEWLINENEWLINEdef test_package(tmp_empty, uninstall):NEWLINE new.package('somepkg')NEWLINENE... |
# encoding: utf-8NEWLINEimport jsonNEWLINENEWLINEimport pytestNEWLINEimport requests_mockNEWLINENEWLINEimport configfetcherNEWLINEimport phabricatorNEWLINEimport wikibugsNEWLINEfrom tests.common import rootNEWLINEfrom tests.wikibugs_network.common import parse_request, conduit_connect, unexpectedNEWLINENEWLINENEWLINEcl... |
# (C) Copyright Artificial Brain 2021.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLIN... |
import _plotly_utils.basevalidatorsNEWLINENEWLINENEWLINEclass LenValidator(_plotly_utils.basevalidators.NumberValidator):NEWLINE def __init__(NEWLINE self, plotly_name="len", parent_name="scatterpolargl.marker.colorbar", **kwargsNEWLINE ):NEWLINE super(LenValidator, self).__init__(NEWLINE ... |
#!/usr/bin/env python3NEWLINENEWLINE# do lxc list --format=json swift-runwayNEWLINE# ...and delete themNEWLINENEWLINENEWLINE# while it would be cool if this worked, it doesn't and the docs are badNEWLINE# https://linuxcontainers.org/lxc/documentation/#pythonNEWLINE# import lxcNEWLINE# for defined in (True, False):NEWLI... |
import loggingNEWLINENEWLINEimport numpyNEWLINEfrom numpy.linalg import pinvNEWLINENEWLINEfrom colormath import color_constantsNEWLINENEWLINElogger = logging.getLogger(__name__)NEWLINENEWLINENEWLINE# noinspection PyPep8NamingNEWLINEdef _get_adaptation_matrix(wp_src, wp_dst, observer, adaptation):NEWLINE """NEWLINE ... |
# Copyright (C) 2020-2021 Intel CorporationNEWLINE# SPDX-License-Identifier: Apache-2.0NEWLINENEWLINE"""You may copy this file as the starting point of your own model."""NEWLINENEWLINEimport numpy as npNEWLINEfrom logging import getLoggerNEWLINEfrom torchvision.datasets import ImageFolderNEWLINEfrom torchvision.transfo... |
N = int(input(''))NEWLINEfor i in range(1, N + 1):NEWLINE if i % 2 == 0:NEWLINE print('%d^2' %i, '=', i **2) |
import loggingNEWLINEfrom pathlib import PathNEWLINEfrom typing import DictNEWLINENEWLINEimport colorlogNEWLINEfrom concurrent_log_handler import ConcurrentRotatingFileHandlerNEWLINEfrom logging.handlers import SysLogHandlerNEWLINENEWLINEfrom mogua.util.path import mkdir, path_from_rootNEWLINENEWLINENEWLINEdef initiali... |
#!/usr/bin/env python3NEWLINENEWLINE"""Unit tests for Mininet Topologies in mininet_test_topo"""NEWLINENEWLINEfrom unittest import TestCase, mainNEWLINENEWLINEfrom clib.config_generator import FaucetFakeOFTopoGeneratorNEWLINENEWLINENEWLINEclass FaucetTopoTest(TestCase):NEWLINE """Tests for Faucet test suite mininet ... |
import timeNEWLINEimport mrcfileNEWLINEimport argparseNEWLINEimport numpy as npNEWLINEimport multiprocessingNEWLINEfrom scipy import ndimage as ndiNEWLINEfrom scipy.stats import wasserstein_distanceNEWLINEfrom skimage import transform, measureNEWLINENEWLINESHIFT = ['Euclidean', 'L1', 'cosine'] # Metrics requiring real ... |
#!/usr/bin/env python3NEWLINENEWLINEimport argparseNEWLINEimport pandas as pdNEWLINEimport numpy as npNEWLINEimport sysNEWLINEimport matplotlibNEWLINEfrom matplotlib import useNEWLINEuse('Agg')NEWLINEimport matplotlib.pyplot as pltNEWLINENEWLINEEOL=chr(10)NEWLINENEWLINENEWLINEdef parseArguments():NEWLINE if len(sys... |
"""Auto-generated file, do not edit by hand. 81 metadata"""NEWLINEfrom ..phonemetadata import NumberFormatNEWLINENEWLINEPHONE_ALT_FORMAT_81 = [NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{4})', format=u'\\1-\\2-\\3', leading_digits_pattern=['(?:12|57|99)0']), NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{2})', forma... |
from sympy import Point, Line, SegmentNEWLINEfrom skimage import feature, measureNEWLINEimport numpy as npNEWLINEfrom scipy import ndimage as ndNEWLINENEWLINEdef thr_calculator(filtered_img,min_distance,stringency):NEWLINENEWLINE """NEWLINE Function used to calculate the threshold to use for the dotsNEWLINE co... |
# -*- coding: utf-8 -*-NEWLINEfrom torch.utils.tensorboard import SummaryWriterNEWLINENEWLINENEWLINEclass TensorboardHandler(object):NEWLINE """docstring for TensorboardHandler"""NEWLINE __TENSORBOARD_HANDLER = NoneNEWLINENEWLINE def __new__(cls, *args: str, **kwargs: str) -> object:NEWLINE if cls.__TEN... |
import socketNEWLINEimport selectNEWLINENEWLINEHEADER_LENGTH = 10NEWLINENEWLINEIP = "127.0.0.1"NEWLINEPORT = 1234NEWLINENEWLINENEWLINEserver_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)NEWLINENEWLINEserver_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)NEWLINEserver_socket.bind((IP, PORT))NEW... |
import torchNEWLINEimport torch.nn as nnNEWLINEimport torch.nn.functional as FNEWLINEimport randomNEWLINENEWLINEfrom torch.distributions import NormalNEWLINENEWLINENEWLINEclass Retina:NEWLINE """A visual retina.NEWLINENEWLINE Extracts a foveated glimpse `phi` around location `l`NEWLINE from an image `x`.NEWLIN... |
import osNEWLINENEWLINEimport torchNEWLINEimport torch.nn as nnNEWLINEimport torch.nn.functional as FNEWLINEimport torchvisionNEWLINEimport torchvision.datasets as datasetsNEWLINEimport torchvision.transforms as transformsNEWLINEfrom pl_bolts.datamodules import CIFAR10DataModuleNEWLINEfrom pl_bolts.callbacks import Pri... |
root = {NEWLINENEWLINE "general" : {NEWLINENEWLINE "display_viewer" : False,NEWLINE #The visible GPUS will be restricted to the numbers listed here. The pytorch (cuda:0) numeration will start at 0NEWLINE #This is a trick to get everything onto the wanted gpus because just setting cuda:4 in the f... |
import requestsNEWLINENEWLINE#sresponse = requests.get() |
"""NEWLINEUnit tests for the budgeteer main app models.NEWLINE"""NEWLINEimport datetimeNEWLINEimport randomNEWLINEimport stringNEWLINEimport calendarNEWLINEfrom decimal import DecimalNEWLINENEWLINEfrom unittest_data_provider import data_providerNEWLINENEWLINEfrom django.core.exceptions import ValidationErrorNEWLINEfrom... |
# import numpyNEWLINEimport numpy as npNEWLINENEWLINE# importing qiskitNEWLINEimport qiskitNEWLINEfrom qiskit import QuantumCircuit, ClassicalRegister, QuantumRegisterNEWLINEfrom qiskit.compiler import schedule, transpileNEWLINENEWLINEfrom qiskit.test.mock.backends.almaden import FakeAlmadenNEWLINEbackend = FakeAlmaden... |
# coding=utf-8NEWLINE"""NEWLINEThis code was generated byNEWLINE\ / _ _ _| _ _NEWLINE | (_)\/(_)(_|\/| |(/_ v1.0.0NEWLINE / /NEWLINE"""NEWLINENEWLINEfrom twilio.base import deserializeNEWLINEfrom twilio.base import valuesNEWLINEfrom twilio.base.instance_context import InstanceContextNEWLINEfrom twili... |
#!/usr/bin/env pythonNEWLINE# -*- coding: utf-8 -*-NEWLINE#NEWLINE# SigPro documentation build configuration file, created byNEWLINE# sphinx-quickstart on Fri Jun 9 13:47:02 2017.NEWLINE#NEWLINE# This file is execfile()d with the current directory set to itsNEWLINE# containing dir.NEWLINE#NEWLINE# Note that not all po... |
# -*- coding: utf-8 -*-NEWLINE# Generated by Django 1.9.7 on 2016-07-18 04:20NEWLINEfrom __future__ import unicode_literalsNEWLINENEWLINEfrom django.db import migrations, modelsNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE dependencies = [NEWLINE ('wl_main', '0004_wildlifelicencety... |
import timeNEWLINEimport mrcfileNEWLINEimport argparseNEWLINEimport numpy as npNEWLINEimport multiprocessingNEWLINEfrom scipy import ndimage as ndiNEWLINEfrom scipy.stats import wasserstein_distanceNEWLINEfrom skimage import transform, measureNEWLINENEWLINESHIFT = ['Euclidean', 'L1', 'cosine'] # Metrics requiring real ... |
from typing import List, Dict, SetNEWLINEfrom itertools import chainNEWLINEimport reNEWLINEfrom collections import defaultdict, CounterNEWLINENEWLINENEWLINEclass BytePairEncoding(object):NEWLINE """ Byte Pair Encoding classNEWLINE We aren't gonna use this class for encoding. Because it is too slow......NEWLINE ... |
from threading import EventNEWLINEimport osNEWLINEos.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = 'hide'NEWLINEimport pygameNEWLINENEWLINEexit = Event()NEWLINENEWLINENEWLINEdef main():NEWLINE print('chime.py - Play an alert every X seconds')NEWLINE try:NEWLINE interval = int(input('How many seconds between chim... |
#NEWLINE# © Copyright 2020 Hewlett Packard Enterprise Development LPNEWLINE#NEWLINE# This file was auto-generated by the Python SDK generator; DO NOT EDIT.NEWLINE#NEWLINENEWLINEfrom ..resource import Resource, CollectionNEWLINEfrom ..exceptions import NimOSAPIOperationUnsupportedNEWLINENEWLINEclass Controller(Resou... |
"""NEWLINE Created by howie.hu at 2022-01-21.NEWLINE Description: 执行分发动作NEWLINE - 执行命令: PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/sender/action.pyNEWLINE Changelog: all notable changes to this file will be documentedNEWLINE"""NEWLINEimport timeNEWLINENEWLINEfrom src.config import ConfigNEWL... |
# --------------------------------------------------------------------------------------------NEWLINE# Copyright (c) Microsoft Corporation. All rights reserved.NEWLINE# Licensed under the MIT License. See License.txt in the project root for license information.NEWLINE# --------------------------------------------------... |
"""Tests for TypeVar."""NEWLINENEWLINEfrom pytype import file_utilsNEWLINEfrom pytype.tests import test_baseNEWLINENEWLINENEWLINEclass TypeVarTest(test_base.TargetPython3BasicTest):NEWLINE """Tests for TypeVar."""NEWLINENEWLINE def test_id(self):NEWLINE ty = self.Infer("""NEWLINE import typingNEWLINE T =... |
import osNEWLINENEWLINEfrom celery import CeleryNEWLINENEWLINE# set the default Django settings module for the 'celery' program.NEWLINEos.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")NEWLINENEWLINEapp = Celery("finance_api")NEWLINENEWLINE# Using a string here means the worker doesn't have to ser... |
from random import randintNEWLINEfrom tkinter import *NEWLINEfrom tkinter import ttkNEWLINENEWLINENEWLINEclass Node:NEWLINE def __init__(self, x, y, aValue):NEWLINE self.x = xNEWLINE self.y = yNEWLINE self.leftNode = 0NEWLINE self.bottomNode = 0NEWLINE self.rightNode = 0NEWLINE ... |
from Service import ServiceNEWLINEfrom Graph import Graph, NodeNEWLINEfrom Parser import port_dicNEWLINEfrom dcm import*NEWLINENEWLINE# The maximum number of texts or images for each user.NEWLINE# This is to prevent the server from over-loading.NEWLINEMAX_DOC_NUM_PER_USER = 30 # non-negative inetegrNEWLINENEWLINE# Trai... |
import xbmcNEWLINEimport xbmcguiNEWLINEimport xbmcaddonNEWLINEimport jsonNEWLINEimport requestsNEWLINEimport sysNEWLINEimport mathNEWLINENEWLINEfrom .lib.ssdp import SSDP_ProviderNEWLINEfrom .lib.helpers import display_message, log_errorNEWLINENEWLINEclass HandoverUI():NEWLINENEWLINE def __init__(self,):NEWLINE self.a... |
"""Python TAXII 2.0 Client API"""NEWLINENEWLINEfrom __future__ import unicode_literalsNEWLINENEWLINEimport datetimeNEWLINEimport jsonNEWLINEimport timeNEWLINENEWLINEimport pytzNEWLINEimport requestsNEWLINEimport requests.structures # is this public API?NEWLINEimport sixNEWLINEimport six.moves.urllib.parse as urlparseN... |
from setuptools import setup, find_packagesNEWLINENEWLINENEWLINEsetup(NEWLINE name='zeit.find',NEWLINE version='3.0.10.dev0',NEWLINE author='gocept, Zeit Online',NEWLINE author_email='zon-backend@zeit.de',NEWLINE url='http://www.zeit.de/',NEWLINE description="vivi UI for querying elastic search",NEWLI... |
#!/usr/bin/env pythonNEWLINEfrom setuptools import setupNEWLINENEWLINENEWLINEwith open('README.rst', 'r') as f:NEWLINE long_description = f.read()NEWLINENEWLINEsetup(NEWLINE name='githubstars',NEWLINE version='0.0.6',NEWLINE description='List repository stars and info through Gituhb v4 GraphQL API',NEWLINE ... |
#!/usr/bin/env pythonNEWLINE# -*- coding: utf-8 -*-NEWLINE#NEWLINE# conda_devenv documentation build configuration file, created byNEWLINE# sphinx-quickstart on Tue Jul 9 22:26:36 2013.NEWLINE#NEWLINE# This file is execfile()d with the current directory set to itsNEWLINE# containing dir.NEWLINE#NEWLINE# Note that not ... |
"""OpenAQ Air Quality Dashboard with Flask"""NEWLINEfrom flask import Flask, render_template, requestNEWLINEfrom flask_sqlalchemy import SQLAlchemyNEWLINEfrom openaq_py import OpenAQNEWLINENEWLINENEWLINE# Create app and DataBaseNEWLINEAPP = Flask(__name__)NEWLINEAPP.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sql... |
#! /usr/vin/env pythonNEWLINE# -*-coding:utf8-*-NEWLINENEWLINEfrom collections import OrderedDictNEWLINENEWLINENEWLINEclass LRUCache(OrderedDict):NEWLINE '''不能存储可变类型对象,不能并发访问set()''' NEWLINENEWLINE def __init__(self,capacity):NEWLINE self.capacity = capacityNEWLINE self.cache = OrderedDict()NEWLINEN... |
from flask import Flask, render_templateNEWLINEfrom flask_sqlalchemy import SQLAlchemyNEWLINEimport osNEWLINENEWLINEapp = Flask(__name__)NEWLINENEWLINEdb_path = os.path.join(os.path.dirname(__file__), 'database.db')NEWLINEdb_uri = 'sqlite:///{}'.format(db_path)NEWLINEapp.config['SQLALCHEMY_DATABASE_URI'] = db_uriNEWLIN... |
# BSD 3-Clause LicenseNEWLINE#NEWLINE# Copyright (c) 2019, Elasticsearch BVNEWLINE# All rights reserved.NEWLINE#NEWLINE# Redistribution and use in source and binary forms, with or withoutNEWLINE# modification, are permitted provided that the following conditions are met:NEWLINE#NEWLINE# * Redistributions of sourc... |
NEWLINEimport dns.resolverNEWLINEimport loggingNEWLINEimport timeNEWLINENEWLINENEWLINEclass DnsResolver:NEWLINENEWLINE def __init__(self, nameserver="100.64.0.10", timeout=120):NEWLINE self.nameserver = nameserverNEWLINE self.timeout = timeoutNEWLINENEWLINE self.resolver = dns.resolver.Resolver(... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License").NEWLINE# You may not use this file except in compliance with the License.NEWLINE# A copy of the License is located atNEWLINE#NEWLINE# http://www.apache.org/license... |
# Copyright (c) Microsoft Corporation.NEWLINE# Licensed under the MIT license.NEWLINENEWLINEimport timeNEWLINEfrom typing import IterableNEWLINENEWLINEfrom ..graph import Model, ModelStatusNEWLINEfrom .interface import AbstractExecutionEngineNEWLINEfrom .listener import DefaultListenerNEWLINENEWLINE_execution_engine = ... |
#crie uma matrix 3x3 inputa numa lista e msotra no final 9 valoresNEWLINElista = list()NEWLINEdado = list()NEWLINEfor m in range(1, 10):NEWLINE dado.append(int(input(f'Digite o {m}o Valor: ')))NEWLINE lista.append(dado[:])NEWLINE dado.clear()NEWLINEprint(f'{lista[0]}{lista[1]}{lista[2]}')NEWLINEprint(f'{lista[... |
#!/usr/bin/env pythonNEWLINEimport numpy as npNEWLINEimport sysNEWLINEimport scipy.io as io_mat NEWLINEimport argparseNEWLINEfrom scipy.interpolate import griddataNEWLINEimport matplotlibNEWLINEmatplotlib.use('Svg')NEWLINEimport matplotlib.pyplot as pltNEWLINEfont = {'weight' : 'normal',NEWLINE 'size' : 12}NEW... |
from dataclasses import dataclassNEWLINENEWLINENEWLINE__all__ = ['CORSSettings']NEWLINENEWLINENEWLINE@dataclassNEWLINEclass CORSSettings:NEWLINE origins: list[str]NEWLINE methods: list[str]NEWLINE headers: list[str]NEWLINE |
import sysNEWLINEimport pype_trayNEWLINENEWLINEsys.exit(pype_tray.PypeTrayApplication().exec_())NEWLINE |
from enum import EnumNEWLINEimport loggingNEWLINEimport randomNEWLINEimport reNEWLINEimport requestsNEWLINEfrom r2d7.core import DroidCoreNEWLINENEWLINElogger = logging.getLogger(__name__)NEWLINENEWLINEclass Talkback(DroidCore):NEWLINE """NEWLINE Chat responses unrelated to other commandsNEWLINE """NEWLINE ... |
from config import BLACK, WHITE, EMPTYNEWLINEfrom random import randintNEWLINENEWLINEclass Evaluator(object):NEWLINE def __init__(self, level):NEWLINE super().__init__()NEWLINE self.level = levelNEWLINE if(level == 1):NEWLINE self.WEIGHT_MATRIX = self.WORST_WEIGHT_MATRIXNEWLINE ... |
#!/usr/bin/env pythonNEWLINE# coding=utf-8NEWLINENEWLINEimport socketNEWLINENEWLINEfrom urllib.parse import urlparseNEWLINEfrom http.server import HTTPServer, BaseHTTPRequestHandlerNEWLINENEWLINENEWLINEclass ProxyHandler(BaseException):NEWLINE """NEWLINE 参考链接:NEWLINE https://zhuanlan.zhihu.com/p/28737960NEWLI... |
import datetimeNEWLINENEWLINEimport pytestNEWLINENEWLINEfrom prisma import PrismaNEWLINENEWLINENEWLINE# TODO: add tests for every database provider we supportNEWLINENEWLINENEWLINE@pytest.mark.asyncioNEWLINEasync def test_precision_loss(client: Prisma) -> None:NEWLINE """https://github.com/RobertCraigie/prisma-client... |
"""NEWLINEA WSGI application which lists available versionsNEWLINEof APIs understood by another WSGI application.NEWLINE"""NEWLINENEWLINEfrom reporting_api.common.apiversion import APIVersionNEWLINEfrom reporting_api.common.application import ApplicationNEWLINENEWLINENEWLINEclass VersionsApp(Application):NEWLINE """... |
class Solution:NEWLINE def solve(self, matrix):NEWLINE if not matrix:NEWLINE return -1NEWLINE NEWLINE sets = [set(row) for row in matrix]NEWLINE return next((num for num in matrix[0] if all(num in row for row in matrix)), -1)NEWLINE |
#!/usr/bin/env python3NEWLINE# Copyright (c) 2014-2020 The Vadercoin Core developersNEWLINE# Distributed under the MIT software license, see the accompanyingNEWLINE# file COPYING or http://www.opensource.org/licenses/mit-license.php.NEWLINENEWLINE"""NEWLINE ZMQ example using python3's asyncioNEWLINENEWLINE Vaderc... |
#NEWLINE# This file is part of pysnmp software.NEWLINE#NEWLINE# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>NEWLINE# License: http://snmplabs.com/pysnmp/license.htmlNEWLINE#NEWLINEimport randomNEWLINEfrom hashlib import md5NEWLINEfrom hashlib import sha1NEWLINENEWLINEtry:NEWLINE from pysnmpcrypto import... |
# Copyright 2016-2020 Blue Marble Analytics LLC.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#... |
from dalek_debug import DalekPrint, DalekDebugOn , DalekDebugSetOutputDeviceNEWLINEimport timeNEWLINEimport dalek_spiNEWLINEimport RPi.GPIO as GPIO # Import GPIO diversNEWLINEdalek_spi.init()NEWLINENEWLINENEWLINE#####################################################NEWLINENEWLINE# This is just for playing with the ... |
"""NEWLINECodemonk link: https://www.hackerearth.com/problem/algorithm/vaishu-and-tower-arrangements-fe7c349eNEWLINENEWLINEVaishu is fond of building wooden towers. Currently, she has N wooden towers. Since, she is a big fan of uniformity, sheNEWLINEarranges the towers in such a way that the first few consecutive tower... |
# Copyright 2018 IguazioNEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required b... |
from django.db import modelsNEWLINEfrom django.db.models import signalsNEWLINEfrom media_management_api.media_service.models import UserProfileNEWLINENEWLINEimport osNEWLINEimport base64NEWLINEimport structNEWLINEimport hashlibNEWLINEimport loggingNEWLINENEWLINElogger = logging.getLogger(__name__)NEWLINENEWLINEclass Ap... |
# test importing of required modules and sit2standpy packageNEWLINENEWLINENEWLINEdef test_numpy():NEWLINE import numpyNEWLINENEWLINE returnNEWLINENEWLINENEWLINEdef test_scipy():NEWLINE import scipyNEWLINENEWLINE returnNEWLINENEWLINENEWLINEdef test_pywt():NEWLINE import pywtNEWLINENEWLINE returnNEWLINE... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENS... |
def prime_factors(N):NEWLINE n = round(N ** 0.5) + 1NEWLINE i = 1NEWLINE factors = []NEWLINE while True:NEWLINE i += 1NEWLINE if N % i == 0:NEWLINE factors.append(i)NEWLINE N = N // iNEWLINE i = 1NEWLINE n = round(N ** 0.5) + 1NEWLINE if i > n... |
# Generated by Django 3.2.9 on 2021-11-16 10:40NEWLINENEWLINEfrom django.db import migrations, modelsNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE dependencies = [NEWLINE ('Blog', '0007_post_image'),NEWLINE ]NEWLINENEWLINE operations = [NEWLINE migrations.CreateModel(N... |
#NEWLINE# Licensed to the Apache Software Foundation (ASF) under one or moreNEWLINE# contributor license agreements. See the NOTICE file distributed withNEWLINE# this work for additional information regarding copyright ownership.NEWLINE# The ASF licenses this file to You under the Apache License, Version 2.0NEWLINE# (... |
import socketNEWLINENEWLINEdef Server(host="127.0.0.1",porta=8585):NEWLINE """NEWLINE -> Servido TCPNEWLINE :param host: Ip para o ServidoNEWLINE :param porta: Porta de ComunicaçãoNEWLINE :return: NoneNEWLINE """NEWLINE s = socket.socket(socket.AF_INET, socket.SOCK_STREA... |
from redis import RedisNEWLINEimport timeNEWLINEimport threadingNEWLINENEWLINENEWLINEdef notrans():NEWLINE conn = Redis("127.0.0.1",6379)NEWLINE print conn.incr('notrans:')NEWLINE time.sleep(.1)NEWLINE conn.incr('notrans:',-1)NEWLINENEWLINENEWLINENEWLINEdef __main__():NEWLINE for i in xrange(3):NEWLINE ... |
import jsonNEWLINENEWLINEfrom django.template.loader import render_to_stringNEWLINEfrom django.urls import reverseNEWLINEfrom django.utils.translation import ugettext_lazy as _NEWLINEfrom wagtail.admin.widgets import AdminChooserNEWLINENEWLINENEWLINEclass AdminModelChooser(AdminChooser):NEWLINE show_edit_link = Fals... |
# Configuration file for the Sphinx documentation builder.NEWLINE#NEWLINE# This file only contains a selection of the most common options. For a fullNEWLINE# list see the documentation:NEWLINE# https://www.sphinx-doc.org/en/master/usage/configuration.htmlNEWLINENEWLINE# -- Path setup -----------------------------------... |
import asyncioNEWLINEimport ioNEWLINENEWLINEimport discordNEWLINEfrom asyncpg.pool import PoolNEWLINEfrom discord.ext import commandsNEWLINENEWLINEfrom utils.db.cache import BotCacheNEWLINEfrom utils.ext import standards as stdNEWLINENEWLINENEWLINEclass Context(commands.Context):NEWLINE def __init__(self, **kwargs):... |
from pylinsql.async_database import ConnectionParametersNEWLINEimport unittestNEWLINENEWLINENEWLINEclass DatabaseTestCase(unittest.IsolatedAsyncioTestCase):NEWLINE params: ConnectionParametersNEWLINENEWLINE def __init__(self, method_name: str):NEWLINE super().__init__(method_name)NEWLINE self.params... |
# coding: utf-8NEWLINE"""NEWLINE Cisco IntersightNEWLINENEWLINE Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and a... |
from lib.base import BaseJiraActionNEWLINEfrom lib.formatters import to_attachment_dictNEWLINENEWLINE__all__ = [NEWLINE 'GetJiraIssueAttachmentsAction'NEWLINE]NEWLINENEWLINENEWLINEclass GetJiraIssueAttachmentsAction(BaseJiraAction):NEWLINE def run(self, issue_key):NEWLINE issue = self._client.issue(issue_k... |
# -*- coding: utf-8 -*-NEWLINENEWLINEimport ioNEWLINEimport reNEWLINENEWLINEimport demjsonNEWLINEimport requestsNEWLINEimport pandas as pdNEWLINENEWLINEfrom zvt.api.common import china_stock_code_to_idNEWLINEfrom zvt.api.technical import init_securities, df_to_dbNEWLINEfrom zvt.domain import Provider, StockIndex, Stock... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.