text stringlengths 2 999k |
|---|
# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.
import dace
import numpy as np
# Declaration of symbolic variables
Nkz, NE, Nqz, Nw, N3D, NA, NB, Norb = (
dace.symbol(name)
for name in ['Nkz', 'NE', 'Nqz', 'Nw', 'N3D', 'NA', 'NB', 'Norb'])
@dace.program
def sse_sigma(neigh_idx: da... |
"""The pysqueezebox.Server() class."""
import asyncio
import json
import logging
import urllib
import aiohttp
import async_timeout
from .const import DEFAULT_PORT, TIMEOUT
from .player import Player
_LOGGER = logging.getLogger(__name__)
# pylint: disable=too-many-instance-attributes
class Server:
"""
Repre... |
# --------------
# Code starts here
# Create the lists
class_1=['Geoffrey Hinton','Andrew Ng','Sebastian Raschka','Yoshua Bengio']
# Concatenate both the strings
class_2=[ 'Hilary Mason','Carla Gentry','Corinna Cortes']
# Append the list
new_class=class_1+class_2
# Print updated list
print(new_class)
# ... |
# Copyright The PyTorch Lightning team.
#
# 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 -*-
from unittest import mock
import pytest
from pyramid.response import Response
from h.feeds import render
@pytest.mark.usefixtures("render_to_response")
class TestRenderAtom:
def test_it_sets_response_content_type(self, pyramid_request):
response = render.render_atom(
... |
# -*- test-case-name: twisted.internet.test.test_endpoints -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that
wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces.
This also implements an exte... |
# -*- coding: utf-8 -*-
# This coding header is significant for tests, as the debug view is parsing
# files to search for such a header to decode the source file content
from __future__ import unicode_literals
import importlib
import inspect
import os
import re
import shutil
import sys
from tempfile import NamedTempor... |
import functools
import os
import random
import sys
import tempfile
import uuid
import warnings
import librosa
import numpy as np
from scipy.signal import butter, sosfilt, convolve
from audiomentations.core.audio_loading_utils import load_sound_file
from audiomentations.core.transforms_interface import BaseWaveformTr... |
"""Protocol-specific hooks and fixtures"""
import tempfile
from typing import Optional, Iterator, List
import pytest
from launchers.sandbox import Sandbox
from tools import constants, utils
from tools.client_regression import ClientRegression
from client.client import Client
from client.client_output import CreateMock... |
"""
Cat task
====================================
A core functionality to execute cat task.
"""
from typing import List
from openvariant.config.config_annotation import AnnotationFormat
from openvariant.find.find import find_files
from openvariant.variant.variant import Variant
def _format_line(line: List[str], out... |
import pygame as pg
import random
import time
pg.init()
win = pg.display.set_mode((640, 640))
pg.display.set_caption('Snake Game')
run = True
left = []
top = []
left_change = []
top_change = []
n = 10
for i in range(n):
top.append(320)
left.append(320 - 32 * i)
left_change.append(32)
top_change.appe... |
"""
Validation of model outputs against in situ data stored and extracted from a database.
This also includes the code to build the databases of time series data sets.
"""
import datetime as dt
import glob as gb
import os
import sqlite3 as sq
import subprocess as sp
import matplotlib.path as mplPath
import matplotl... |
from nova.scheduler.host_manager import HostState
import resource_filter
from oslo_log import log
from oslo_config import cfg
import sys
CONF = cfg.CONF
log.register_options(CONF)
CONF(sys.argv[1:])
CONF.set_override('use_stderr', False)
host_state = HostState("node-101", "node-77701.stc.bluvalt.com", "12lfaslk-312... |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# 3p
import requests
# project
from checks import AgentCheck
from util import headers
class PHPFPMCheck(AgentCheck):
"""
Tracks basic php-fpm metrics via the status module
Requires php-fpm pools to ... |
import os
from setuptools import setup, find_packages
from setuptools.command.install import install
import shutil
import sys
# code style:
# pycodestyle --ignore=E501 --first .
compiler = "gcc"
# If you want to compile with Visual Studio, find the location of
# vcvars64.bat and run it before running "python setup.p... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/8/14 16:09
# @Author : Peter
# @Site :
# @File : PipeLine.py
# @Software: PyCharm
import json
import os
import time
import XX.Encrypt.EncryptHelper as enc
import XX.File.FileHelper as cf
import XX.HTML.HtmlHelper as chtml
import XX.Tools.... |
__author__ = 'mangate'
import numpy as np
import cPickle
from collections import defaultdict
import re
import pandas as pd
import os.path
from process_data_common import load_bin_vec, add_unknown_words, get_W
classes = {
'negative': 0,
'positive': 1
}
def load_train(filename='data/sst2/sst2_train.txt'):... |
from twython import TwythonStreamer
"""
References:
https://www.dropbox.com/sh/cpkokzf1ko0p53t/AABjaP2zGlQKtCePrm08nB-Xa/JG_Ch09_Getting_Data/04_api/3_test_twitter_stream.py?dl=0
"""
#Import the necessary packages
import json
#Create an empty list, collected tweets will be added to this list.
collectedTweets = []
#Thi... |
import fnmatch
import glob
import os
import re
import sys
from functools import total_ordering
from itertools import dropwhile
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.temp import NamedTemporaryFile
from django.core.management.base im... |
import base64
import json
import os
from io import BytesIO
import boto3
from PIL import Image
MAX_SIZE = (1080, 810)
BUCKET_NAME = os.getenv("BUCKET_NAME", "TODO")
AWS_REGION = os.getenv("AWS_REGION", "ap-northeast-2")
s3_client = boto3.client('s3', region_name=AWS_REGION)
def _post_to_s3(byte_string, size, path, n... |
"""
Progress bar threading
======================
This file provides a minimal working example using a progress bar alongside
``@thread_worker`` to report progress.
"""
from time import sleep
from qtpy.QtWidgets import QPushButton, QVBoxLayout, QWidget
import napari
from napari.qt import thread_worker
viewer = napar... |
#!/usr/bin/env python3
# coding: utf8
from pathlib import Path
from . import Utils
from .BaseMedia import BaseMedia
from typing import Dict, List, Union, Any
from datetime import datetime
import re
DuplicateSuffix = re.compile(r'(.*)[ ]\(\d+\)(\..*)')
JSONValue = Union[str, int, float, bool, None, Dict[str, Any], Li... |
import glob
import random
import torch
import os.path as op
import numpy as np
from cv2 import cv2
from torch.utils import data as data
from utils import FileClient, paired_random_crop, augment, totensor, import_yuv
def _bytes2img(img_bytes):
img_np = np.frombuffer(img_bytes, np.uint8)
img = np.expand_dims(cv... |
"""
Test lldb data formatter subsystem.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class DataFormatterSynthValueTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def set... |
import asyncio
import textwrap
import unittest
import unittest.mock
import discord
from bot import constants
from bot.cogs import information
from bot.utils.checks import InWhitelistCheckFailure
from tests import helpers
COG_PATH = "bot.cogs.information.Information"
class InformationCogTests(unittest.TestCase):
... |
"""
WSGI config for palantr 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/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... |
import sys
from .pylite import main
if len(sys.argv) < 2:
db = ":memory:"
else:
db = sys.argv[1]
main(db)
|
# %%
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
%matplotlib inline
import matplotlib.pyplot as plt
# %%
KON = 1
KD = 5
KOFF = KD/KON
def binding_one_to_one(concs, t, KD):
KON = 1
KOFF = KD/KON
dPdt = -KON*concs[0]*concs[1]+(KOFF)*concs[2]
... |
import sympy as sp
# https://github.com/sympy/sympy/issues/4986
# https://github.com/sympy/sympy/issues/5031
class NamedExpressionError(Exception):
pass
class NamedExpression(sp.Equality):
"""Named expression.
"name" is not very strictly a name ... can be a symbol or an
arbitrary expression.
... |
import torch
import math
from torch.nn.parameter import Parameter
from megatron import mpu
from megatron.model.positional_embeddings import SinusoidalPositionalEmbedding
from megatron.model.init_functions import get_init_methods
class Embedding(torch.nn.Module):
"""Language model embeddings.
Arguments:
... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, _
class SaleOrder(models.Model):
_inherit = "sale.order"
def _get_no_effect_on_threshold_lines(self):
self.ensure_one()
# Do not count shipping and free shipping
... |
import sys
sys.setrecursionlimit(15000)
import torch
import torch.nn.functional as F
from torch import nn
import numpy as np
import os
from torch.nn import DataParallel
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision.utils as vut... |
"""
Django settings for django_server project.
"""
import os
from config import BUCKETS
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.dja... |
# -*- encoding: utf-8 -*-
#
# 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, so... |
import os
import re
import time
import json
import redis
import docker
import pytest
import random
import string
import subprocess
import sys
import tarfile
import io
from typing import Dict, Tuple
from datetime import datetime
from swsscommon import swsscommon
from dvslib.dvs_database import DVSDatabase
from dvslib.... |
from __future__ import absolute_import, division, print_function
import os
import networkx as nx
from math import log
from toolz import pluck
from .convert import convert, ooc_types
from .append import append
from .utils import cls_name
# Write out as dot
def dot_graph(filename='conversions'):
# Edges from Conv... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import random
import numpy as np
sizes = np.array([2, 3, 1])
sizes[1:] # array([3, 1])
sizes[:-1] # array([2, 3])
###
b = [np.random.randn(y, 1) for y in sizes[1:]]
b
###
c = [np.random.randn(3, 1), np.random.randn(1, 1)]
c
###
data = np.array([[1,2,3],[4,5,6],[7,8,9]]... |
# 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 ... |
# Copyright 2018 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 a... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <vslutov@yandex.ru> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you ... |
from connectivity_graph import *
from misc.utils import *
from utils import PRUNE_INACTIVE, CYCLE_INACTIVE, UPDATE_INACTIVE
# TODO
# - make the levels based on subproblem switches (use problem_reachable_sources). Don't count things moved by the same controller
# - flag to terminate costs/levels when the goals are reac... |
"""Tests for binary operators on subtypes of built-in types."""
import unittest
# from test import test_support
# Adapted from Python 2.7.x test_binop.py
# As binary operators correclty handle magic methods, they should be tested
# using this unit test.
def gcd(a, b):
"""Greatest common divisor using Euclid's ... |
import argparse
import os.path as osp
from collections import defaultdict
import mmcv
from tqdm import tqdm
def parse_args():
parser = argparse.ArgumentParser(
description='LaSOT test dataset to COCO Video format')
parser.add_argument(
'-i',
'--input',
help='root directory of ... |
#!/usr/bin/python
#
# Problem: Old Magician
# Language: Python
# Author: KirarinSnow
# Usage: python thisfile.py <input.in >output.out
def compute():
w, b = map(int, raw_input().split())
if b%2 == 0:
return "WHITE"
else:
return "BLACK"
for i in range(input()):
print "Case #%d: %s" % (i+1, ... |
"""
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... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for `astropy.vo.client`
Examples
--------
Running inside Python::
>>> import astropy
>>> astropy.test('vo.client', remote_data=True)
Running from top level via command line::
$ python setup.py test -P vo.client --remote-data
Runni... |
from collections import Counter
"""
--- Day 6: Signals and Noise ---
Something is jamming your communications with Santa. Fortunately, your signal is only partially jammed, and protocol in
situations like this is to switch to a simple repetition code to get the message through.
In this model, the same message is sen... |
#!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classification.tl_classifier import TLCla... |
import torch.utils.data as data
from PIL import Image
import torchvision.transforms as transforms
class BaseDataset(data.Dataset):
def __init__(self):
super(BaseDataset, self).__init__()
def name(self):
return 'BaseDataset'
def initialize(self, opt):
pass
def get_transform(opt):
... |
from datetime import date, timedelta
import warnings
from pyluach.dates import GregorianDate
from .core import UnitedStates
from ..registry_tools import iso_register
class HebrewHolidays:
hebrew_calendars = {}
@classmethod
def get_hebrew_calendar(cls, gregorian_year):
"""
Build and cach... |
# run as: bzgrep georss geo_coordinates_en.nt.bz2 | python extract_coordinates.py | tee geo_features.txt
import re, math, urllib, sys
print >>sys.stderr, "extracting coordinates"
# <http://dbpedia.org/resource/Alabama> <http://www.georss.org/georss/point> "33.0 -86.66666666666667"@en .
coord_regex = re.compile(r'.*/re... |
def sumaDatos(datos):
#Inicializamos la suma a 0
suma = 0
#Recorremos todos los datos recibidos
for dato in datos:
#Comprobamos si el datos se puede pasar a un numero real
try:
#Realizamos la suma
suma = suma + float(dato)
except ValueError:
#E... |
# isort:skip_file
from __future__ import absolute_import, division, print_function, unicode_literals
import torch
from tests import utils
class SimpleSigmoidModel(torch.nn.Module):
def __init__(self, inplace=False):
super(SimpleSigmoidModel, self).__init__()
self.inplace = inplace
def forwar... |
from __future__ import unicode_literals, absolute_import
import sys
import unittest
import mock
import re
from fm import Fm
from .mock_client import MockClient
class TestFm(unittest.TestCase):
def setUp(self):
self.mock_stdin = mock.create_autospec(sys.stdin)
self.mock_stdout = mock.create_aut... |
import os
import requests
import json
import traceback
import dateparser
from datetime import datetime, timedelta
from bs4 import BeautifulSoup
from CommonServerPython import *
from typing import List
import demistomock as demisto
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S'
HOST = demisto.params().get('host')
BROKER = argToBool... |
import math
def generate_cidr_block(num_ip_addresses, num_subnets):
cidr_block_step = int(num_ip_addresses / num_subnets)
subnet_ip_prefix = 32 - int(math.log(cidr_block_step, 2))
for i in range(num_subnets):
yield f"10.0.0.{cidr_block_step * i}/{subnet_ip_prefix}"
|
from boa.interop.Neo.Blockchain import GetHeight
from boa.interop.Neo.Runtime import CheckWitness
from boa.interop.Neo.Action import RegisterAction
from boa.interop.Neo.Storage import Get, Put
from boa.builtins import concat
from nex.token import *
from nex.txio import get_asset_attachments
# OnInvalidKYCAddress = Re... |
import unittest
import os
class TestImports(unittest.TestCase):
def test_imports(self):
print('Temporary dummy import test for coverage config.')
import main |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... |
# Copyright 2019 Holloway Inc
class CommandException(Exception):
"""
Exception of which message will be just reported as slack response
(i.e. without showing the stacktrace as well)
"""
pass
def hello():
"""
Prints hello world
"""
return "Hello world!"
# Map of commands to the actual function th... |
from __future__ import absolute_import
from sys import version_info
import datetime
from freezegun import freeze_time
from yaml import add_constructor
from yaml.constructor import SafeConstructor
import pytest
import pytz
import unittest
from charlatan import testing
from charlatan import file_format
from charlatan.u... |
from django.utils.translation import ugettext as _
from django.utils import translation
from django.core.management.base import NoArgsCommand
from django.conf import settings
from mailer import send_html_mail
from agendas.models import UserSuggestedVote
from django.contrib.auth.models import User
class Command(NoArg... |
from __future__ import unicode_literals
import paramiko
import time
from netmiko.cisco_base_connection import CiscoSSHConnection
class FortinetSSH(CiscoSSHConnection):
def _modify_connection_params(self):
"""Modify connection parameters prior to SSH connection."""
paramiko.Transport._preferred_ke... |
from distutils.core import setup
setup(
name = 'rasterlib', # How you named your package folder (MyLib)
packages = ['rasterlib'], # Chose the same as "name"
version = '0.1', # Start with a small number and increase it with every change you make
license='MIT', # Chose a license from here: h... |
# Test code for evaluating pandas to replace xlrd/openpyxl
import pandas
fn = 'text.xls'
df = pandas.read_excel(open(fn)) |
# -*- test-case-name: twisted.words.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
MSNP8 Protocol (client only) - semi-experimental
This module provides support for clients using the MSN Protocol (MSNP8).
There are basically 3 servers involved in any MSN session:
I{Dispatch serv... |
#!/usr/bin/env python3
import sys
class MarkdownGenerator:
def __init__(self):
self.in_question = False
self.first_line_in_question = False
self.prefix = ""
self.qnum = 0
def process_line(self, line, outfile):
if self.in_question:
if not line.startswith("</... |
# qubit number=3
# total number=13
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... |
import uuid
from datetime import date, timedelta
import graphene
import pytest
from freezegun import freeze_time
from saleor.order.models import Order, OrderStatus
from saleor.payment import ChargeStatus
from ..utils import get_graphql_content
from prices import TaxedMoney, Money
@pytest.fixture()
def orders_for_... |
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from electrum_seci.util import base_units
from electrum_seci.i18n import languages
from electrum_seci_gui.kivy.i18n import _
from electrum_seci.plugins import run_hook
from electrum_seci i... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2019-01-02 14:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('activityinfo', '0039_auto_20190102_1417'),
]
operations = [
migrations.AddF... |
# File name: comiccreator.py
import kivy
kivy.require('1.9.1')
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager
Builder.load_file('toolbox.kv')
Builder.load_file('comicwidgets.kv')
Builder.load_file('drawingspace.kv')
Builder.load_file('generaloptions.kv')
Builder... |
'''
Check compatibility with diagrams package and older dependencies it's pulling in
'''
import pytest
try:
import diagrams
except ImportError:
pytest.skip('dependency not available: diagrams', allow_module_level=True)
def test_diagrams_compatibility():
'''Check that wrapper for diagrams package works''... |
#!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.Element
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
MCXRay element input file.
"""
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__ = ""
__date__ = ""
__copyright__ = "... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import attr
import pytest
from aiohttp import web
from pytest_simcore.helpers.utils_assert import assert_status
from pytest_simcore.helpers.utils_login import LoggedUser
from simcore_service_webserver.db_models imp... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import numpy as np
from configs._base_.models.retinanet_r50_fpn import *
from configs._base_.datasets.dota_detection import *
from configs._base_.schedules.schedule_1x import *
from alpharotate.utils.pretrain_zoo import PretrainM... |
import subprocess as sp
import pymysql
import pymysql.cursors
from datetime import datetime
ActiveUser = "GUEST"
UserMode = "N"
MAX_VALUE = 1000000
# customer_id = str(row["E-MailID"]+"@"+doj+"@"+str(row["Phone"]))
# trackid = bill_no + agencyid
# Login username, phone_no
# prints the tuple
def print_result(res):
... |
import os
import cv2
import argparse
import numpy as np
import tensorflow as tf
import yolo.config as cfg
from yolo.yolo_net import YOLONet
from utils.timer import Timer
class Detector(object):
def __init__(self, net, weight_file):
self.net = net
self.weights_file = weight_file
... |
from django.db import models
class Category(models.Model):
catName = models.CharField(max_length=20,default='put your name ')
catImage = models.URLField(max_length=256,default='put ypur image ')
def __str__(self):
return self.catName
|
import collections
from contextlib import contextmanager
import functools
import itertools
import inspect
import logging
import os
import os.path as osp
from baselines import bench
from baselines.common.vec_env.dummy_vec_env import DummyVecEnv
import gym
import joblib
import ray
from pirl import config, utils
from pi... |
from django.shortcuts import render, redirect
from .models import ThoughtModel, SessionModel
def get_username_from_session(request):
cookie_session = request.COOKIES.get('session')
try:
session = SessionModel.objects.get(session=cookie_session)
except SessionModel.DoesNotExist:
return None... |
from django.contrib import admin
# Register your models here.
from management.models.main import LegalSetting, MailSetting, LdapSetting, Footer, Header, CacheSetting, ShopSetting
admin.site.register(LegalSetting)
admin.site.register(MailSetting)
admin.site.register(LdapSetting)
admin.site.register(Header)
admin.site.... |
import re
from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers
class Nyaa(Anime, sitename = 'nyaa'):
sitename = 'nyaa'
url = f'https://{sitename}.si'
@classmethod
def search(cls,query):
rex = r'(magnet:)+[^"]*'
search_res... |
from typing import Any, List, Literal, TypedDict
from .FHIR_code import FHIR_code
from .FHIR_CodeableConcept import FHIR_CodeableConcept
from .FHIR_DeviceMetric_Calibration import FHIR_DeviceMetric_Calibration
from .FHIR_Element import FHIR_Element
from .FHIR_id import FHIR_id
from .FHIR_Identifier import FHIR_Identif... |
import random
from collections import defaultdict
from contextlib import redirect_stdout, redirect_stderr
from io import StringIO
from typing import Dict
from warnings import warn
from pandas import concat, DataFrame, Categorical
from tqdm import tqdm
from data_frames import to_nested_dicts
from data_sources.drug_con... |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
from scipy.spatial import KDTree
import math
import numpy as np
from std_msgs.msg import Int32
import yaml
'''
This node will publish waypoints from the car's current position to some `x` distance ahea... |
"""Module browser.
XXX TO DO:
- reparse when source changed (maybe just a button would be OK?)
(or recheck on window popup)
- add popup menu with more options (e.g. doc strings, base classes, imports)
- add base classes to class browser tree
- finish removing limitation to x.py files (ModuleBrowserTreeIte... |
# 1. import Flask
from flask import Flask
# 2. Create an app, being sure to pass __name__
app = Flask(__name__)
# 3. Define what to do when a user hits the index route
@app.route("/")
def home():
print("Server received request for 'Home' page...")
return "Welcome to my 'Home' page!This works!!!!"
# 4. Defi... |
#!/usr/bin/env python3
# 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.
# pyre-strict
from fbpmp.common.repository.instance_local import LocalInstanceRepository
from fbpmp.pid.entity.pid_ins... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) Merchise Autrement [~º/~] and Contributors
# All rights reserved.
#
# This is free software; you can do what the LICENCE file allows you to.
#
{
"name": "test_view_model",
"vers... |
# Copyright 2020 The TensorFlow Quantum 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... |
"""Unit test for Climate objects."""
import asyncio
import unittest
from unittest.mock import Mock
from xknx import XKNX
from xknx.devices import Climate, ClimateMode
from xknx.devices.climate import SetpointShiftMode
from xknx.dpt import (
DPT2ByteFloat,
DPTArray,
DPTBinary,
DPTControllerStatus,
D... |
'''
Copyright 2021 Agnese Salutari.
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, s... |
import asyncio
from typing import Optional
from blspy import G2Element
from chia.types.coin_record import CoinRecord
from chia.types.coin_spend import CoinSpend
from chia.types.spend_bundle import SpendBundle
from chia.util.config import load_config, save_config
from operator import attrgetter
import logging
import ... |
# -*- coding: utf-8 -*-
import logging
import httplib
import httplib as http # TODO: Inconsistent usage of aliased import
from dateutil.parser import parse as parse_date
from django.utils import timezone
from django.core.exceptions import ValidationError
from flask import request
import mailchimp
from framework impo... |
import os
import clik
import numpy as np
### Some important variables ###
clik_root = os.environ.get('PLANCK_2018_DATA')
if clik_root == None:
raise ValueError('The environment variable PLANCK_2018_DATA is not set.')
### Planck 2018 high ells TT, TE, EE
hell_TTTEEE = clik.clik(clik_root + '/hi_l/plik/plik_rd12_HM... |
from django.contrib import admin
from .models import Contact
@admin.register(Contact)
class AdminContact(admin.ModelAdmin):
list_display = ('fullname', 'email', 'subject', 'time', 'is_read')
list_filter = (['is_read', 'time'])
search_fields = ('fullname', 'subject')
|
import logging
from logging import CRITICAL # NOQA
from logging import DEBUG # NOQA
from logging import ERROR # NOQA
from logging import FATAL # NOQA
from logging import INFO # NOQA
from logging import WARN # NOQA
from logging import WARNING # NOQA
import threading
from typing import Optional
import colorlog
... |
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
from decimal import Decimal
from card import SevenCard
from deck import Deck
def show(s):
print(s)
class RoundGame():
"""
pot 算法:记录每个玩家的筹码投入量,然后从高到低计算 value ,玩家获得小于等于其最大筹码数的其他玩家的筹码。
"""
def __init__(self):
self.players = []
self.livingPlayers = []
self.sm... |
""" Test the functions and classes in the protocol context """
import asyncio
import json
from unittest import mock
from typing import Any, Dict
from opentrons_shared_data import load_shared_data
from opentrons_shared_data.pipette.dev_types import LabwareUri
import opentrons.protocol_api as papi
import opentrons.pro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.