text stringlengths 2 999k |
|---|
"""Pushbullet platform for sensor component."""
from __future__ import annotations
import logging
import threading
from pushbullet import InvalidKeyError, Listener, PushBullet
import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
SensorEntity,
SensorEntityDescription,
)
... |
import os
from e2efold.common.config import process_config
from e2efold.common.utils import get_args
args = get_args()
config_file = args.config
config = process_config(config_file)
print("#####Stage 1#####")
print('Here is the configuration of this run: ')
print(config)
os.environ["CUDA_VISIBLE_DEVICES"]= config.gpu... |
import torch
from torchvision import transforms
from torchvision.utils import save_image
#from torch.utils.serialization import load_lua
import torchfile
from PIL import Image
import argparse
parser = argparse.ArgumentParser(description='Sketch simplification demo.')
parser.add_argument('--model', type=str, default='... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-01-29 19:59
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('awards', '0017_merge_20180125_2132'),
('awards', '0015_summarytransactiongeoview'),
]
... |
"""
Tests for chunked adjustments.
"""
from collections import namedtuple
from itertools import chain, product
from textwrap import dedent
from unittest import TestCase
from nose_parameterized import parameterized
from numpy import (
arange,
array,
asarray,
dtype,
full,
where,
)
from six.moves ... |
import tensorflow as tf
from data_provider import DataProvider
from rnn_model import RNNModel
import sys
import matplotlib
import numpy as np
import time
matplotlib.use("Agg")
import matplotlib.pyplot as plt
# Args
if len(sys.argv) != 2:
print("Please select a dataset.")
print("Usage: python text_predictor.py ... |
#
# Copyright 2019 The FATE 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 appli... |
#
# Runtime util
#
# Copyright (c) 2020, Arm Limited. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
import builtins
import collections as co
import itertools as it
from ..glue import Inherit
RUNTIMES = co.OrderedDict()
def runtime(cls):
assert cls.__argname__ not in RUNTIMES
RUNTIMES[cls.__a... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'nuevo_dialog_save.ui'
#
# Created: Sat Jul 20 19:01:55 2019
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
exc... |
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
|
# -*- 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
#... |
from decimal import Decimal
from enum import IntEnum
import numpy as np
from astropy.io import fits
from astropy.stats import SigmaClip
from loguru import logger
from panoptes.utils.images import fits as fits_utils
from photutils import Background2D
from photutils import BkgZoomInterpolator
from photutils import MeanB... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: second/protos/losses.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google... |
# Copyright 2019 Intelligent Robotics Lab
#
# 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... |
# This file is part of the Extra-P software (http://www.scalasca.org/software/extra-p)
#
# Copyright (c) 2020, Technical University of Darmstadt, Germany
#
# This software may be modified and distributed under the terms of a BSD-style license.
# See the LICENSE file in the base directory for details.
class Recoverable... |
import os
import unittest
from datetime import datetime
from collections import OrderedDict
from sqlalchemy import TEXT, BIGINT
from sqlalchemy.exc import IntegrityError, SQLAlchemyError, ArgumentError
from dataset import connect, chunked
from .sample_data import TEST_DATA, TEST_CITY_1
class DatabaseTestCase(unitte... |
# Copyright 2010 New Relic, 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 writ... |
from unittest import TestCase
from tests import get_data
from pytezos.operation.forge import forge_operation_group
class OperationForgingTestooDRC4(TestCase):
def setUp(self):
self.maxDiff = None
def test_forge_ooDRC4(self):
expected = get_data(
path='operations/ooDRC4Ak... |
# coding: utf-8
# Copyright 2017 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... |
from enum import Enum
from grpc_health.v1 import health_pb2 as health_proto
from grpc_health.v1 import health_pb2_grpc as health_grpc
from python_pachyderm.proto.v2.admin import admin_pb2 as admin_proto
from python_pachyderm.proto.v2.admin import admin_pb2_grpc as admin_grpc
from python_pachyderm.proto.v2.auth import ... |
from car.car_base import CarBase
from cv.image_init import ImageInit
from cv.follow_line import FollowLine
from cv.find_intersection import FindIntersection
from cv.find_zebra_crossing import FindZebraCrossing
from cv.find_roadblock import FindRoadblock
class CarMain(CarBase):
def __init__(self, line_camera, od_c... |
# pylint: disable=R0201
"""Output classes"""
import sys
import json
import uuid
import logging
import bumblebee.store
import bumblebee.util
MAX_PERCENTS = 100.
CHARS = 8
HBARS = [
u"\u2581",
u"\u2582",
u"\u2583",
u"\u2584",
u"\u2585",
u"\u2586",
u"\u2587",
u"\u2588"]
VBARS = [
u"... |
# Copyright (c) OpenMMLab. All rights reserved.
from ..builder import DETECTORS
from .cascade_rcnn import CascadeRCNN
@DETECTORS.register_module()
class HybridTaskCascade(CascadeRCNN):
"""Implementation of `HTC <https://arxiv.org/abs/1901.07518>`_"""
def __init__(self, **kwargs):
super(HybridTaskCasc... |
begin_unit
comment|'# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a cop... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright 2016-2021 Blaise Frederick
#
# 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/LICEN... |
def rodCutting(n, v):
a = v
for _ in a:
a = list(map(max, a, (a[0] + y for y in v)))
x = a.pop(0)
return x
n = 4
v = [0, 2, 4, 7, 7]
print(rodCutting(n, v))
|
class YaDialogsException(Exception):
"""База для исключений yadialogs."""
|
'''
NOTE: These helper functions should only be used once to get everything initialized.
'''
from urllib.request import urlretrieve
from zipfile import ZipFile
from project_helpers import n4j_driver
netflix_data_url = 'https://www.kaggle.com/netflix-inc/netflix-prize-data/downloads/netflix-prize-data.zip/1'
data_dir =... |
import logging
import django_heroku
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from .base import * # noqa
from .base import env
# GENERAL
# -----------------------------------------------------------------------------... |
"""MobileChat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... |
from __future__ import absolute_import
from __future__ import print_function
import json
import requests
from .base import Provider as BaseProvider
def ProviderParser(subparser):
subparser.add_argument("--auth-username", help="specify username (CL12345)")
subparser.add_argument("--auth-token", help="specif... |
# Generated by Django 3.0 on 2019-12-06 23:12
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("clubs", "0009_merge_201912... |
from __future__ import print_function
import torch
import numpy as np
from PIL import Image
import inspect, re
import torch.nn as nn
import os
from Options_all import BaseOptions
import collections
config = BaseOptions().parse()
def tensor2im(image_tensor, imtype=np.uint8):
image_numpy = image_tensor[0].cpu().flo... |
# Copyright 2014 OpenStack Foundation
# 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 requ... |
import time
import thriftpy
from thriftpy.rpc import make_server
class Dispatcher(object):
def get_time(self):
return time.ctime()
time_thrift = thriftpy.load('time_service.thrift', module_name='time_thrift')
server = make_server(time_thrift.TimeService, Dispatcher(), '127.0.0.1', 6000)
server.serve()
|
import sys
from baselines.common.cmd_util import common_arg_parser
from baselines.run import parse_cmdline_kwargs
from baselines.her.metric_diversification import MetricDiversifier
from baselines.her.cover_measure import init_from_point
import gym
#import gym_maze
import numpy as np
import time
from baselines.her.paper... |
import os
from .base import *
SECRET_KEY = os.environ.get("SECRET_KEY")
DEBUG = False
# White Noise configuration - http://whitenoise.evans.io/en/stable/django.html
INSTALLED_APPS.extend(["whitenoise.runserver_nostatic"])
# Must insert after SecurityMiddleware, which is first in settings/common.py
MIDDLEWARE.insert... |
from lib2to3.fixes.fix_paren import FixParen
|
class Tree():
children = []
def __init__(self,token):
self.__token = token
self.children = []
def addChild(self,token):
self.children.append(Tree(token))
def getChild(self,index):
return self.children[index]
def getToken(self):
return self.__token
def setT... |
import logging
import os
from checkov.cloudformation import cfn_utils
from checkov.cloudformation.context_parser import ContextParser as CfnContextParser
from checkov.serverless.base_registry import EntityDetails
from checkov.serverless.parsers.context_parser import ContextParser as SlsContextParser
from checkov.cloud... |
#!/usr/bin/env python
""" Test for TLatex error which doesn't parse a frac definition properly. """
import ROOT
def test_tlatex_error():
s_fails = r"$\frac{\mathrm{d}N}{d\mathit{p}_{\mathrm{T}}}$"
#ROOT.TLatex()
c = ROOT.TCanvas("c", "c")
tex = ROOT.TMathText()
tex.DrawMathText(0.1, 0.1, s_fail... |
# 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... |
# keyword list
DEPARMENT = frozenset(
[
"laboratorio",
"laboratories",
"laboratory",
"laboratoire",
"institute",
"academic",
"department",
"division",
"faculty of ",
"genomics center",
"research station",
]
)
INSTITUTE = f... |
"""
19. Uma empresa de pesquisas precisa tabular os resultados da seguinte enquete
feita a um grande quantidade de organizações:
"Qual o melhor Sistema Operacional para uso em servidores?"
As possíveis respostas são:
1- Windows Server
2- Unix
3- Linux
4- Netware
5- Mac OS
6- O... |
"""
This is the core file in the `gradio` package, and defines the Interface class, including methods for constructing the
interface using the input and output types.
"""
import gradio
from gradio.inputs import InputComponent
from gradio.outputs import OutputComponent
from gradio import networking, strings, utils
from... |
class Country:
def __init__(self, name, capital, population, continent):
self.__name = name
self.__capital = capital
self.__population = population
self.__continent = continent
my_country = Country('France', 'Paris', 67081000, 'Europe')
print(my_country._Country__name)
print(my_country._Country__cap... |
import logging
from io import BytesIO
from lakesuperior.dictionaries.namespaces import ns_collection as nsc
from lakesuperior.dictionaries.namespaces import ns_mgr as nsm
from lakesuperior.env import env
from lakesuperior.store.ldp_rs.lmdb_store import LmdbStore, TxnManager
logger = logging.getLogger(__name__)
rdfl... |
# The MIT License (MIT)
#
# Copyright (c) 2014 pystun Developers
#
# 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 without restriction, including without limitation the rights
# to use, copy,... |
# coding: utf-8
"""
tinycss.decoding
----------------
Decoding stylesheets from bytes to Unicode.
http://www.w3.org/TR/CSS21/syndata.html#charset
:copyright: (c) 2012 by Simon Sapin.
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
import operator
impo... |
from enum import Enum
from fastapi import FastAPI, Request, Response, status
from pydantic import BaseModel
from .config import API_CONFIG
from .logger import Logger
from .question_generator import QuestionGenerator
from .validator import validate_and_log, HTTP_500_ERROR_MESSAGE
logger = Logger()
class NQuestions(... |
import logging
from aws_adfs import authenticator
from aws_adfs.authenticator import html_roles_fetcher
from aws_adfs.authenticator import account_aliases_fetcher
class AwsAccount:
def __init__(self, account_no, account_name):
self.account_no = account_no
self.account_name = account_name
class ... |
from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import seq_multiple_add
expected_verilog = """
module test;
reg CLK;
reg RST;
reg [32-1:0] idata_00;
reg [32-1:0] idata_01;
reg [32-1:0] idata_02;
reg [32-1:0] idata_03;
reg [32-1:0] idata_04;
reg [32-1:0] id... |
# Copyright (c) 2021, Digi International, Inc.
#
# 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 without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
"""The tests for the hassio component."""
import asyncio
import os
from unittest.mock import patch, Mock, MagicMock
import pytest
from homeassistant.const import HTTP_HEADER_HA_AUTH
from homeassistant.setup import async_setup_component
from tests.common import mock_coro
API_PASSWORD = 'pass1234'
@pytest.fixture
d... |
from sacred import Experiment
from Config import config_ingredient
import tensorflow as tf
import numpy as np
import os
import Datasets
import Utils
import Models.UnetAudioSeparator
ex = Experiment('Waveunet Preprocessing', ingredients=[config_ingredient])
@ex.config
# Executed for training, sets the seed value to t... |
from __future__ import absolute_import
from typing import Optional # noqa: F401
from eth_utils import (
big_endian_to_int,
)
from eth_keys.datatypes import ( # noqa: F401
PrivateKey,
PublicKey,
Signature,
)
from eth_keys.exceptions import (
BadSignature,
)
from eth_keys.validation import (
... |
"""
Django settings for trydjango18 project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... |
import asyncio
import dataclasses
import logging
import random
import time
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
import aiosqlite
from blspy import AugSchemeMPL
import chialite.server.ws_connection as ws # lgtm [py/import-and-import-from]
... |
from django.db import models
# Create your models here.
class Tipo(models.Model):
codigo = models.CharField(max_length=20)
descripcion = models.CharField(max_length=50)
def __str__(self):
return self.descripcion
class Articulo(models.Model):
nombre = models.CharField(max_length=100)
des... |
# Copyright (c) 2019 Intel Corporation
#
# 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 without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
# Copyright 2018 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
from setuptools import setup
import os
from os.path import join
with open('README.md') as readme_file:
readme = readme_file.read()
with open('CHANGELOG.md') a... |
#!/usr/bin/env python
"""
Functions used to calculate statistics.
"""
import xarray as xr
import numpy as np
import matplotlib.pyplot as plt
from mom6_tools.DiagsCase import DiagsCase
from mom6_tools.ClimoGenerator import ClimoGenerator
from mom6_tools.m6toolbox import genBasinMasks, request_workers, add_global_attrs... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listtransactions API."""
from decimal import Decimal
from io import BytesIO
from test_framewo... |
# Generated by Django 2.2.6 on 2019-11-02 03:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('production', '0003_auto_20190818_2258'),
('rehearsal', '0012_auto_20191026_0837'),
]
operations = [
... |
from django.contrib import admin
try:
# Django >= 1.10
from django.urls import reverse
except ImportError:
# Django < 2.0
from django.core.urlresolvers import reverse
from .models import Blind
class BlindAdmin(admin.ModelAdmin):
list_display = ('desc', 'thumbnail', 'name', 'child_safe')
list_e... |
from odf.element import Element
from odf.namespaces import OFFICENS
from odf.opendocument import OpenDocumentSpreadsheet
from odf.style import Style
from odf.table import Table, TableColumn, TableRow, TableCell, CoveredTableCell
from odf.text import P, A # noqa (used by frontend apps)
class Row(object):
def __in... |
import json
import logging
import random
import threading
import discord
import mysql.connector
import names
from faker import Faker
import utilities
from aging import Aging
# Objects
client = discord.Client()
fake = Faker()
# File logger
logger = logging.getLogger('discord')
logger.setLevel(logging.INFO)
handler =... |
"""
Contains two funcitons that deal with the absorption of photons that propagate
through tissue. Each photon has a weight that is partly absorped, the rest of
the photon will continue to propagate in a new direction.
"""
import math
import random
def bins(photon, prop):
""" Alters photon weight and puts absorbe... |
import asyncio
import pytest
from liualgotrader.common.database import create_db_connection
from liualgotrader.trading.alpaca import AlpacaTrader
alpaca_trader: AlpacaTrader
@pytest.fixture
def event_loop():
global alpaca_trader
loop = asyncio.get_event_loop()
loop.run_until_complete(create_db_connecti... |
"""Utility functions with no non-trivial dependencies."""
import os
import pathlib
import re
import subprocess
import sys
import hashlib
from typing import (
TypeVar, List, Tuple, Optional, Dict, Sequence, Iterable, Container, IO, Callable
)
from typing_extensions import Final, Type, Literal
try:
import curse... |
''' get date '''
def id_to_date(id):
import re, os
file = "/afs/slac.stanford.edu/u/ki/pkelly/pipeline/bluh2"
command = "/afs/slac/u/ki/anja/software/ldacpipeline-0.12.20/bin/Linux_64/caldate -d 31/12/1998 -i " + id + " > " + file
os.system(command)
yy = open(file,'r').readlines()
... |
"""
Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com
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 without restriction, including without limitation
the rights to use, copy, m... |
# -*- coding: UTF-8 -*-
from pp.store import redis
from pp.search import search_url
from flask import Flask, Response, render_template, request, redirect, abort
from flask.ext.assets import Environment, Bundle
from flask.ext.misaka import Misaka
from flask.ext.cache import Cache
from htmlmin.minify import html_minify
... |
from helper import DataControl, DatasetFormatter, JsonReader, Scorer
import pandas as pd
import numpy as np
from time import time as getTime
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklear... |
# Copyright 2019-2021 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... |
# Generated by Django 2.2.4 on 2019-11-17 12:37
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... |
"""
${NAME}
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import os
import zipfile
import re
log = logging.getLogger(__name__)
class ResourceNotFound(KeyError):
pass
class ResourceLoader(object):
def __init__(self, fallbackZipFile):
super(Re... |
import os
root_dir = os.path.expanduser("/media/darg1/Projects/pointer_summarizer/")
log_root = os.path.join(root_dir, "logs")
def get_data_paths(data_folder):
input_dir = os.path.join(root_dir, "finished_files", data_folder)
data_paths = {
'chunked_train': input_dir + "/chunked/train_*",
't... |
import pytest
import io
from tad.util.ints import int8, uint8, int16, uint16, int32, uint32, int64, uint64, uint128, int512
class TestStructStream:
def _test_impl(self, cls, upper_boundary, lower_boundary):
with pytest.raises(ValueError):
t = cls(upper_boundary + 1)
with pytest.rais... |
from datetime import datetime
from decimal import Decimal
from unittest import mock
import pytest
from django_countries.fields import Country
from django_scopes import scopes_disabled
from pytz import UTC
from pretix.base.models import (
InvoiceAddress, Order, OrderPosition, SeatingPlan, SubEvent,
)
from pretix.b... |
# -*- coding: utf-8 -*-
"""
SeisHub database client for ObsPy.
:copyright:
The ObsPy Development Team (devs@obspy.org)
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
from __future__ import (absolute_import, division, print_function,
... |
# -*- coding: utf-8 -*-
# Copyright 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 l... |
"""Unit test package for aion_client."""
|
from typing import NamedTuple, Optional, Union, List
from gssutils.csvw.namespaces import URI
class Datatype(NamedTuple):
base: Optional[str] = None
format: Optional[str] = None
class Column(NamedTuple):
name: str
titles: Union[str, List[str], None] = None
datatype: Union[str, Datatype, None] =... |
##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... |
#!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... |
class ManagedTool(object):
def __init__(self, response):
self.__dict__ = response
self.name = response['name']
self.last_release_version = response['lastReleaseVersion']
self.download_url = response['downloadUrl']
self.package_binary_path = response['packageBinaryPath']
... |
# -*- 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
#... |
import pytest
from cure import trail_name
@pytest.mark.parametrize(
"kw, expected",
[
("a", "a"),
("as", "as_"),
("id", "id_"),
("id_", "id_"),
("uuid", "uuid"),
("uuid_", "uuid_"),
("str", "str_"),
("global", "global_"),
("key", "key"),... |
import pandas as pd
import mundi
import sidekick as sk
from pydemic_ui import st
from pydemic_ui.i18n import _
DISPLAY_NAME = _("Abstract")
ABSTRACT = _(
"""
## Update from the last 24 hours (as {date} Brasilia Time)
**{cases}** additional cases and **{deaths}** additional deaths reported from
all {n_children} {... |
# -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
import numpy as np
import os
from GUI.audio_device_widget import AudioDeviceWidget
from GUI.plot_widget import PlotWidget, PlotWidget_HPIRs, PlotWidget_HPCF
use_vispy = True
try:
from GUI.vispyWidget import VispyCanvas
except ImportError:
use... |
import psycopg2
def insert_datos(NOMBRE_USUARIO, PUNTAJE):
sql = """ INSERT INTO DATOS_JUEGO (NOMBRE_USUARIO, PUNTAJE) VALUES (%s, %s);"""
conn = None
try:
conn = psycopg2.connect(
host="localhost",
port="5432",
user="postgres",
database="prueba... |
import json
from channels.generic.websocket import AsyncWebsocketConsumer
from django.contrib.auth import get_user_model
from channels.consumer import AsyncConsumer
from channels.db import database_sync_to_async
# from .models import Thread, ChatMessage
import asyncio
class ChatConsumer(AsyncWebsocketConsumer):
... |
from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers
import re
import json
class Anistream(Anime, sitename='anistream.xyz'):
"""
Site: http://anistream.xyz
Config
------
version: One of ['subbed', 'dubbed]
Selects the versio... |
# Generated by Django 2.0.1 on 2018-02-07 11:59
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Guide',
fields=[
('id', models.AutoField(au... |
import datetime
import uuid
from typing import Optional, Protocol
from pizza_store.db.models import RefreshToken
from sqlalchemy.ext.asyncio import AsyncSession
class IRefreshTokenCRUD(Protocol):
"""Has methods for getting, adding, deleting refresh tokens from db."""
@classmethod
async def get_refresh_t... |
# run_hadamard_eigen_accuracy
import os
import sys
import errno
import numpy as np
import chaospy as cp
from pystatreduce.stochastic_collocation import StochasticCollocation
from pystatreduce.quantity_of_interest import QuantityOfInterest
from pystatreduce.dimension_reduction import DimensionReduction
import pystatre... |
# -*- coding: utf-8 -*-
"""ANT+ device profiles.
Not implemented.
"""
##############################################################################
#
# Copyright (c) 2011, Martín Raúl Villalba
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documenta... |
#!/usr/bin/python
#
# Copyright 2014 Google 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 a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.