text stringlengths 1 927k |
|---|
"""Adds config flow for keymaster."""
import asyncio
import logging
import os
from typing import Any, Dict, List, Optional, Union
import voluptuous as vol
from voluptuous.schema_builder import ALLOW_EXTRA
from homeassistant import config_entries
from homeassistant.components.binary_sensor import DOMAIN as BINARY_DOMA... |
# Generated by Django 2.1.5 on 2019-02-02 17:04
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Grades', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... |
#!/usr/bin/env python3
import requests
import json
import os
import sys
import inspect
API_URL = 'https://api.figshare.com/v2/institution/hrfeed/upload'
filename = inspect.getframeinfo(inspect.currentframe()).filename
path = os.path.dirname(os.path.abspath(filename))
KEY_FILE = path + '/conf/test_figsh_hr_key.json'... |
from collections import OrderedDict
import numpy as np
from reinforcement_learning.gym import spaces
# Important: gym mixes up ordered and unordered keys
# and the Dict space may return a different order of keys that the actual one
KEY_ORDER = ['observation', 'achieved_goal', 'desired_goal']
class HERGoalEnvWrapper... |
import uuid
from unittest import TestCase
import pytest
from tiny_listener.routing import CONVERTOR_TYPES, Route, RouteError, compile_path
def test_compile_path() -> None:
reg, convertors = compile_path("/user")
assert convertors == {}
_, convertors = compile_path("/user/{age:int}")
assert "age" in... |
import logging
import math
from typing import Callable, List
from datasketches import frequent_strings_sketch
from whylogs.core.statistics.thetasketch import ThetaSketch
from whylogs.core.summaryconverters import from_string_sketch
from whylogs.proto import CharPosMessage, CharPosSummary, StringsMessage, StringsSumma... |
###########################################################################################
# #
# Evaluator class: Implements the most popular metrics for object detection #
# ... |
"""AWS Braket provider."""
from braket.aws import AwsDevice
from braket.device_schema.dwave import DwaveDeviceCapabilities
from qiskit.providers import ProviderV1
from .braket_backend import AWSBraketBackend, BraketLocalBackend
class AWSBraketProvider(ProviderV1):
"""AWSBraketProvider class for accessing AWS Br... |
# 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
# d... |
#!/usr/bin/env python3
#
# Author: Hao Tang, 2016-05-22
import sys
import urllib.request
import urllib.parse
import json
import re
import datetime
import time
def query_page(title, lang):
'''
Return a JSON string fetched from wikipedia.
title is the page title to fetch written in the specified language.
... |
#!/usr/bin/env python3
import sys
import getconf
CHAIN = sys.argv[1]
ROOMNAME = sys.argv[2]
DESCRIPTION = 'CHAT ' + sys.argv[3]
RPCURL = getconf.def_credentials(CHAIN)
try:
create_result = getconf.oraclescreate_rpc(CHAIN, ROOMNAME, DESCRIPTION, 'S')
sendraw_result = getconf.sendrawtx_rpc(CHAIN, create_result[... |
# %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/NAIP/ndwi_timeseries.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank"... |
# -*- coding: utf-8 -*-
import lxml.html
from .abstract import get_strategy
from ...strategies.hierarchy import Hierarchy
class TestGetHierarchyRadio:
def test_toplevel(self):
# Given
hierarchy = {
'lvl0': 'Foo',
'lvl1': None,
'lvl2': None,
'lvl3': ... |
# Copyright 2015 - 2016 OpenMarket Ltd
#
# 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... |
# Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# 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 agre... |
import datetime
class Swimmer:
class Time:
def __init__(self, name, date, time):
self.name = name
self.time = time
self.date = date
def __str__(self):
if self.time is None:
return "DQ"
time = round(self.time, 2)
... |
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 wit... |
from PIL import Image
import numpy
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
from tensorflow.python.keras.applications.mobilenet import MobileNet
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.layers import Dense, Dropout, BatchNormalization
from tensorflo... |
print("my name") |
# $Id: pjsua.py 4724 2014-01-31 08:52:09Z nanang $
#
# Object oriented PJSUA wrapper.
#
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
#
# 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 Foundati... |
from unittest import TestCase
from galaxy_test.base.api import UsesApiTestCaseMixin
from galaxy_test.base.testcase import FunctionalTestCase
try:
from galaxy_test.driver.driver_util import GalaxyTestDriver
except ImportError:
# Galaxy libraries and galaxy test driver not available, just assume we're
# targ... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'src\abi\tools\ui\uifileconverter.ui'
#
# Created: Thu Jul 12 16:54:59 2018
# by: pyside2-uic running on PySide2 5.11.0a1
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore, QtGui, QtWidgets
class Ui_U... |
"""
Dirichlet-multinomial models for statistical analysis of compositional changes in single-cell data.
For further reference, see:
Büttner, Ostner et al.: scCODA: A Bayesian model for compositional single-cell data analysis
:authors: Johannes Ostner
"""
import numpy as np
import time
import warnings
import tensorfl... |
import os
import os.path as osp
import sys
import time
import argparse
from pdb import set_trace as st
import json
import functools
import torch
import numpy as np
import torchvision
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import transforms
class MovingAver... |
from django.contrib.auth import mixins
from django.urls import reverse_lazy
from django.views import generic
from goods import forms, models
class HomeView(mixins.LoginRequiredMixin, generic.TemplateView):
template_name = "goods/base.html"
class TradeNameListView(mixins.PermissionRequiredMixin, generic.ListVie... |
###############################################################################
# Auto-generated by `jupyter-book config`
# If you wish to continue using _config.yml, make edits to that file and
# re-generate this one.
###############################################################################
author = 'The Jupyter... |
from manager import manager, CURRENT_VERSION
import os
from view import g_view
import os.path
from .constants import OperationTypes
try:
os.mkdir('Projects')
os.chdir('Projects')
except OSError:
os.chdir('Projects')
class BaseFileOperation(object):
def getMessage(self):
raise NotImplemente... |
import numpy as np
import pprint
import tensorflow as tf
import os
from datetime import datetime
from model import AlternatingAttention
import data_helper
import train
import test1
import sys
flags = tf.app.flags;
flags.DEFINE_integer("embedding_dim", 384, "Dimensionality of character embedding (default: 384)")
flag... |
old_curis_schema = {
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/root.json",
"type": "object",
"title": "The Root Schema",
"required": [
"cb_id",
"address",
"birthdate",
"contact_number",
"date_visits",
"email_address",
"fam... |
import multiprocessing
import os.path as osp
import gym,sys
from collections import defaultdict
import tensorflow as tf
import numpy as np
import pickle
from baselines.common.vec_env import VecFrameStack,VecEnv, VecNormalize
from baselines.run import parse_cmdline_kwargs, build_env, configure_logger, get_default_networ... |
from copy import copy
from . import Parameter, Model
import networkx as nx
def parent_edges(node):
if isinstance(node, Parameter):
mapped_mods = node.mapped_models
n_mapped = len(mapped_mods)
if n_mapped == 0:
return []
elif n_mapped == 1:
return [(node.mapp... |
import arrow
def getCurrentTime(obj, eng):
obj['data']['currentTime'] = arrow.now().to('Asia/Kolkata').format('DD-MMM-YYYY HH:mm:ss ZZ')
def getZoneTime(obj, eng):
obj['data']['zonedTime'] = arrow.now().to(obj['tz']).format('DD-MMM-YYYY HH:mm:ss ZZ') |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
import math
from . import data_utils, FairseqDataset
def collate(
samples,
pad_idx,
eos_idx,
... |
from __future__ import absolute_import
from keras_unet_collection.layer_utils import *
from keras_unet_collection.transformer_layers import patch_extract, patch_embedding, SwinTransformerBlock, patch_merging, patch_expanding
from tensorflow.keras.layers import Input, Dense
from tensorflow.keras.models import Model
d... |
import json
import os.path as osp
import shutil
import sys
import tempfile
from importlib import import_module
from typing import Optional, Tuple, NoReturn
import yaml
from easydict import EasyDict
from ding.utils import deep_merge_dicts
from ding.envs import get_env_cls, get_env_manager_cls
from ding.policy import ge... |
"""Gradient interface"""
import torch
from .modules.utils import _single, _pair, _triple
def _grad_input_padding(grad_output, input_size, stride, padding, kernel_size):
input_size = list(input_size)
k = grad_output.dim() - 2
if len(input_size) == k + 2:
input_size = input_size[-k:]
if len(in... |
#!/usr/bin/env python
# Copyright 2017 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.
import argparse
import errno
import os
import shutil
import subprocess
import sys
def main():
parser = argparse.ArgumentParser(
... |
import asyncio
import platform
from bleak import BleakClient
MODEL_NBR_UUID = '50430B3B-0437-485E-8D91-3862CE188C31'
address = 'db:d4:9e:88:24:c2'
import platform
import asyncio
import logging
from bleak import BleakClient
async def run(address, loop, debug=False):
log = logging.getLogger(__name__)
if deb... |
import numpy as np
from skimage.metrics import peak_signal_noise_ratio
from nets import *
from scipy.optimize import minimize
import os
from os import listdir
from os.path import join
from imageio import imread, imwrite
import glob
from tqdm import trange
import argparse
parser = argparse.ArgumentParser()
parser.add_... |
import resources.useq_run_status_mail
import resources.useq_modify_samplesheet
import resources.useq_group_permissions |
"""
Control concurrency of steps within state execution using zookeeper
===================================================================
:depends: kazoo
:configuration: See :py:mod:`salt.modules.zookeeper` for setup instructions.
This module allows you to "wrap" a state's execution with concurrency control.
This ... |
#!/usr/bin/env python
import numpy as np
import pandas as pd
import os
data_file = os.path.join(os.path.dirname(__file__),'Top5000population.csv')
data = pd.read_csv(data_file, header=None, thousands=',',sep=',',
names=['city','state','pop'],
encoding='iso-8859-1')
data['city'] = data['city'].str.st... |
# Communication Platform - Client
import time
import json
import socketio #Need this for exceptions
from server import PlayerInfo
from loggers import client_logger as logger
from common import JsonClient as Client
import socketio
# Method for sending a file to your opponent during a game.
class Player:
def __init__... |
import netCDF4 as nc4
import numpy as np
def annual_mean_model(filepath, var, varfiletype, nyrs, conv_factor):
"""Calculate time series of model annual means for one variable.
:param filepath (str): the file path and name for the data file
:param var (str): the name of the variable to call from data ... |
import requests
from bs4 import BeautifulSoup
from requests_html import HTMLSession
from datetime import datetime
import time
import re
def scrape_npr(max_articles_per_category):
# datetime object containing current date and time for error log
now = datetime.now()
# Open error log file
errorlog = open... |
# -*- coding: utf-8 -*-
# pylint: disable=E1101
"""
Deprecated. Use named_interface.BVBQMixMVN.
Won't be documented due to this
"""
import torch
from . import utils
from . import bvbq
from . import distributions
from . import gp
from . import acquisition
from . import metrics
class BVBQMixMVN(object):
de... |
r"""
Sage interface to Cremona's ``eclib`` library (also known as ``mwrank``)
This is the Sage interface to John Cremona's ``eclib`` C++ library for
arithmetic on elliptic curves. The classes defined in this module
give Sage interpreter-level access to some of the functionality of
``eclib``. For most purposes, it is... |
from pyretic.lib.corelib import *
from pyretic.lib.std import *
from pyretic.kinetic.util.resetting_q import *
from pyretic.kinetic.fsm_policy import *
from pyretic.kinetic.drivers.json_event import JSONEvent
from pyretic.kinetic.smv.model_checker import *
############################################################... |
"""
Twilio SMS platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.twilio_sms/
"""
import logging
from homeassistant.components.notify import (
ATTR_TARGET, DOMAIN, BaseNotificationService)
from homeassistant.helpers... |
from cumulus.chain import step
from cumulus.util.template_query import TemplateQuery
from troposphere import autoscaling
class BlockDeviceData(step.Step):
def __init__(self,
volume):
step.Step.__init__(self)
self.volume = volume
def handle(self, chain_context):
launc... |
import threading
import logging
import datetime
logger = logging.getLogger()
def schedule_function(interval: int, worker_func: callable, args: [] = None, kwargs: {} = None, iterations: int = 0):
try:
if iterations != 1:
threading.Timer(
interval,
schedule_funct... |
#!/usr/bin/python3.6
import sys
import os
import yaml
import time
import threading
def detector():
global pend
global workers
global avg_work
global slots
print(workers, pend)
while True:
try:
pend = 0
workers = {}
avg_work = 0
slots = 0
pods = os.popen("kubectl get pods | grep worker")
pod... |
import calendar
import datetime
import json
import requests
class Connection(object):
"""Connection to Moodo API"""
def __init__(self, email, password):
"""Initialize connection object"""
self.__authenticated = False
self.user_agent = 'Mozilla/5.0'
self.baseurl = 'https://rest.m... |
import logging
import re
from .baseoutput import baseoutput
from ..helpers import get_kwargs
from ..helpers import key_wanted
log = logging.getLogger("screen")
class screen(baseoutput):
def __str__(self):
return "[the default output module] outputs the results to standard out in a slightly formatted way... |
#!/usr/bin/env python
from hv import main
if __name__ == "__main__":
main() |
"""Formatting of UML model elements into text tests."""
import pytest
from gaphor.core.eventmanager import EventManager
from gaphor.core.modeling import ElementFactory
from gaphor.UML import model
from gaphor.UML import uml as UML
from gaphor.UML.umlfmt import format
from gaphor.UML.umllex import parse
@pytest.fixt... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('etl', '0023_auto_20170329_1610'),
]
operations = [
migrations.RemoveField(
model_name='featurecardtype',
... |
#!/usr/bin/python
# -*- coding=utf-8 -*-
import os
import os.path
import re
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='get jsfm version....')
parser.add_argument("-path", type=str, help="jsfm path")
args = parser.parse_args()
f = open(args.path, 'r')
content =... |
# 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... |
"""
The MIT License (MIT)
Copyright © 2019 Jean-Christophe Bos & HC² (www.hc2.fr)
"""
from . import *
from .httpResponse import HttpResponse
from binascii import a2b_base64
import json
# ============================================================================
# ===( HttpRequest )========... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
# -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class EnvironmentEnum(object):
"""Implementation of the 'Environment' enum.
Specifies the environment (such as 'kVMware' or 'kSQL') where the
Protection Source exists. Depending on the environment, one of the
following Protection Sources are init... |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import io
import sys
from setuptools import setup
from setuptools.command.bdist_egg import bdist_egg
from setuptools.command.develop import develop
from io import Byte... |
import errno
import hashlib
import os
import posixpath
import select
import shutil
import subprocess
import tempfile
import threading
from contextlib import contextmanager
from werkzeug import urls
from lektor._compat import (iteritems, iterkeys, range_type, string_types,
text_type, queue, StringIO)
from lektor.e... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
lst = [('➙', 'Heavy Rightwards'),
('➢', ''),
('➣', ''),
('➤', 'Black Rightwards arrow head'),
('⬅', 'Leftwards black arrow'),
('➡', 'Black Rightwards arrow'),
('➳', ''),
('➵', ''),
('➸', 'Heavy Black Feathered'),
... |
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("http://localhost/litecart/en/")
products_list = driver.find_elements_by_css_selector("div li.product.column.shadow.hover-light")
#stickers_list = driver.find_elements_by_css_selector("div li.product.column.shadow.hover-light .sticker")
for i in ... |
import inspect
import threading
import time
import urllib.parse
from ..errors import ConfigurationError
from ..util import get_dependency
from .base import Storage
class MemcachedStorage(Storage):
"""
Rate limit storage with memcached as backend.
Depends on :pypi:`pymemcache`.
"""
STORAGE_SCHEM... |
import sys
sys.path.append('/home/user/research/refinenet-pytorch')
import os
import numpy as np
import tqdm
import argparse
import math
import random
from PIL import Image
import torch
import torch.nn as nn
import datasets as ds
from torchvision import transforms as trf
from models.refinenet_resnet import refinenet_r... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
from os.path import abspath, join, dirname
import adis16470
import adis16470.version
# -- RTD configuration ------------------------------------------------
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthe... |
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
return True if len(nums)!=len(set(nums)) else False |
#!"C:\Users\sopor\Desktop\AGO-DIC 19\DAS\ERIK EDUARDO MONTOYA MARTINEZ\PRIMER PARCIAL\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3.7'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = ... |
from datetime import date, datetime
from unittest import mock
import graphene
import pytest
import pytz
from django.utils import timezone
from django.utils.text import slugify
from freezegun import freeze_time
from ....attribute.models import AttributeValue
from ....attribute.utils import associate_attribute_values_t... |
from distutils.core import setup
from Cython.Build import cythonize
import sys
setup(
name="pyorbit",
author="Luca Malavolta",
ext_modules = cythonize("./pyorbit/*/*.pyx", compiler_directives={'language_level' : sys.version_info[0]}),
) |
#!/usr/bin/env python
"""
Copyright (c) 2014-2020 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function
import datetime
import glob
import gzip
import hashlib
import io
import json
import mimetypes
import os
import re
import... |
# -*- coding: utf-8 -*-
from datetime import datetime
from django.db import models
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.contrib.comments.signals import comment_was_posted
from dj... |
#!/usr/bin/python
#
# Podium API
#
# Copyright (C) 2014-2016 Autosport Labs
#
# This file is part of the Race Capture App
#
# This 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 3 of the Licens... |
import json
import os
import uuid
import urllib.parse
from metadata import DocumentRegistryClient, DocumentLineageClient
from helper import FileHelper, S3Helper
metadataTopic = os.environ.get('METADATA_SNS_TOPIC_ARN', None)
if not metadataTopic:
raise ValueError("Missing arguments.")
## The body should be custo... |
from app.service import token_service
from app.service import umm_client
from app.service import nexus_client
from app.domain.solution import Solution
from app.domain.document import Document
def upload_document(**args):
http_request = args.get('http_request')
token = token_service.get_token(http_request)
... |
from .simulate import simulate |
# 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 ... |
import yt
from yt.visualization.volume_rendering.interactive_vr import \
SceneGraph, BlockCollection, TrackballCamera
from yt.visualization.volume_rendering.interactive_loop import \
RenderingContext
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
# Create GLUT window
rc = RenderingContext(1280, 960)
# ... |
# 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
# d... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 21 02:22:08 2019
@author: phunh
"""
import cv2
import mapnik
import platform
import tempfile
from models import BoundaryCollection, PointCollection
from map_maker.my_datasource import MapDatasource
class MapMakerApp(object):
def __init__(self, ... |
from pathlib import Path
import pandas as pd
from src.metrics.multi_year_metrics import MultiYearMetrics
import pytest
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
project_dir = Path("__file__").resolve().parents[1]
@pytest.fixture
def define_multi_year_metrics():
... |
import pandas as pd
from alephnull.gens.utils import hash_args
from alephnull.sources.data_source import DataSource
class FuturesDataFrameSource(DataSource):
"""
Yields all events in event_list that match the given sid_filter.
If no event_list is specified, generates an internal stream of events
to ... |
"""
WSGI config for pygoat project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... |
import json
import threading
import time
import websocket
from logging import getLogger
class RealtimeAPI(object):
"""
Realtime API (JSON-RPC 2.0 over WebSocket)
https://bf-lightning-api.readme.io/docs/realtime-api
"""
def __init__(self, channel, data_queue, is_daemon=False):
self.logger... |
from typing import Any, Dict, List, Tuple
from aiohttp.web_exceptions import HTTPRequestEntityTooLarge
from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy
from packed import packable
from ...requests import Request
__all__ = ("HistoryRequest",)
@packable("jj.mock.HistoryRequest")
class H... |
""" Vishhvaan's Test Script """
import time
import datetime
import csv
import threading
import os
import RPi.GPIO as GPIO
#import numpy as np
# setup the GPIO pins to control the pumps
P_drug_pins = [20]
P_nut_pins = [24]
P_waste_pins = [25]
P_LED_pins = [21]
P_fan_pins = [26]
pin_list = [P_drug_pins + P_nut_pins + ... |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... |
import asyncio
import argparse
import os
import json
import linecache
import sys
import traceback
from coin_bot import CoinBot
from proxy import ProxyManager
from datetime import datetime
from io import StringIO
def traceback_msg(e):
exc_type, exc_obj, first_tb = sys.exc_info()
tb = StringIO()
traceback.... |
# Generated by Django 3.1.3 on 2021-01-30 02:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('taxa', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='taxon',
name='species',
fiel... |
#
# Python GUI - Standard Colors - Generic
#
from GUI.Colors import rgb, selection_forecolor, selection_backcolor
black = rgb(0, 0, 0)
dark_grey = rgb(0.25, 0.25, 0.25)
grey = rgb(0.5, 0.5, 0.5)
light_grey = rgb(0.75, 0.75, 0.75)
white = rgb(1, 1, 1)
red = rgb(1, 0, 0)
green = rgb(0, 1, 0)
blue = rgb(0, 0, 1)
yello... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage:
Install cx_Freeze: http://cx-freeze.sourceforge.net/
Copy script to the web2py directory
c:\Python27\python standalone_exe_cxfreeze.py build_exe
"""
from cx_Freeze import setup, Executable
from gluon.import_all import base_modules, contributed_module... |
"""
States to manage git repositories and git configuration
.. important::
Before using git over ssh, make sure your remote host fingerprint exists in
your ``~/.ssh/known_hosts`` file.
.. versionchanged:: 2015.8.8
This state module now requires git 1.6.5 (released 10 October 2009) or
newer.
"""
impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='fn_exchange',
version='1.0.0',
license='MIT',
author='IBM Resilient',
author_email='support@resilientsystems.com',
description="Resilient Circuits Components for 'fn_exchange'",
long_desc... |
# coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version 1.0 ... |
from app import constant, game
from tkinter import *
import main
import os
def run():
# Display application
root = Tk()
root.configure(background=constant.BACKGROUND)
root.geometry(f'{constant.WIDTH}x{constant.HEIGHT}')
root.resizable(0, 0) # Prevent resizing and disable maximize button
root.... |
import torch.nn as nn
from torch.nn.functional import interpolate
class PixelShuffleUpscaleBlock(nn.Module):
def __init__(self, in_channels=64, kernel_size=3, upscale_factor=2):
super().__init__()
self.block = nn.Sequential(
nn.Conv2d(in_channels=in_channels,
out... |
import asyncio
import logging
from typing import List, Optional, Set, Tuple
import aiosqlite
from blspy import G1Element
from covid.types.blockchain_format.sized_bytes import bytes32
from covid.util.db_wrapper import DBWrapper
from covid.util.ints import uint32
from covid.wallet.derivation_record import DerivationRec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.