text stringlengths 1 927k |
|---|
from __future__ import annotations
from collections import OrderedDict
import logging
from typing import Any, cast, Iterator, List, Mapping, Optional
from PyQt5 import Qt
import vapoursynth as vs
from vspreview.core import Output, QYAMLObjectSingleton, QYAMLObject
from vspreview.utils import de... |
##
# Copyright 2018 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
# without restriction, including without limitation the rights to ... |
# 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.
#
# Copyright 2010 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2... |
""" qemu-img library: Manages conversions of vDisk types and mapping them to raw devices """
from pathlib import Path
from voithos.lib.system import shell, assert_path_exists
def convert(input_format, output_format, input_path, output_path):
""" Execute qemu-img inside a container that mounts input_path and outp... |
# Tencent is pleased to support the open source community by making PocketFlow available.
#
# Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... |
"""Web Server Gateway Interface (WSGI) entry-point."""
import os
from browse.factory import create_web_app
# We need someplace to keep the flask app around between requests.
# Double underscores excludes this from * imports.
__flask_app__ = None
def application(environ, start_response):
"""WSGI application, cal... |
#!/usr/bin/python2
# -*-coding:utf-8-*-
import logging
log = None
def init_log(log_name):
# 日志输出格式
fmt = '%(asctime)s - %(filename)s:%(lineno)s - %(levelname)s - %(name)s - %(message)s'
formatter = logging.Formatter(fmt)
# 创建一个handler,用于输出到控制台
console_handler = logging.StreamHandler()
consol... |
from __future__ import division
import docrep
from .helpers import coefficients, hpd, mahalanobis, geometric_sum
import numpy as np
from numpy.linalg import solve, cholesky
import scipy as sp
from scipy.linalg import cho_solve, solve_triangular, inv, eigh
from scipy.special import loggamma
import scipy.stats as st
from... |
# LTI 1.3
# Initial authentication request arguments
# https://www.imsglobal.org/spec/security/v1p0/#step-1-third-party-initiated-login
LTI13_LOGIN_REQUEST_ARGS = [
"iss",
"login_hint",
"target_link_uri",
]
# Initial authentication request arguments
# https://www.imsglobal.org/spec/security/v1p0/#step-2-au... |
import numpy as np
from edutorch.nn import RNNCell
from tests.gradient_check import estimate_gradients
def test_rnn_cell_forward() -> None:
N, D, H = 3, 10, 4
x = np.linspace(-0.4, 0.7, num=N * D).reshape(N, D)
model = RNNCell(
prev_h=np.linspace(-0.2, 0.5, num=N * H).reshape(N, H),
Wx=n... |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:2332")
else:
access = Ser... |
from fastapi import FastAPI
import uvicorn
from logic import add
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello"}
@app.get("/add/{num1}/{num2}")
async def adder(num1: int, num2: int):
"""Add two numbers together"""
total = add(num1,num2)
return {"total": total}
if __name_... |
class ModelBase:
def __init__(self):
pass
def InitByMainKey(self, MainKeyObj):
pass
def InsertAllInfoToForm(self):
pass |
import pygame
class Display():
def __init__(self, w=800, h=600) -> None:
self.w, self.h = w, h
self.fullscreen = False
self.brightness = 255
self.brightness_mask = pygame.Surface((w,h), pygame.SRCALPHA)
self.brightness_mask.fill((0,0,0,0))
def create(self, caption: str... |
import numpy as np
from hypothesis import given
from hypothesis import strategies as st
from hypothesis.extra.numpy import arrays, array_shapes
from hypothesis.extra.pandas import data_frames, column, series, range_indexes
from timeseers.utils import MinMaxScaler
@given(
arrays(
np.float,
shape=a... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2021 Devon (Gorialis) R
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 limita... |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
#--------------------------
def setplot(plotdata):
#--------------------------
"""
Specify what is to be... |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015, 2016, 2017 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... |
# Copyright 2010-2012 Institut Mines-Telecom
#
# 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 _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="colorbar", parent_name="parcoords.line", **kwargs):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... |
"""Constants for the Dynalite component."""
import logging
LOGGER = logging.getLogger(__package__)
DOMAIN = "dynalite"
CONF_ACTIVE = "active"
CONF_ALL = "ALL"
CONF_AREA = "area"
CONF_AUTO_DISCOVER = "autodiscover"
CONF_BRIDGES = "bridges"
CONF_CHANNEL = "channel"
CONF_DEFAULT = "default"
CONF_FADE = "fade"
CONF_HOST ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class Image(pulumi.CustomResource):
... |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import json
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.encoding import smart_str... |
import boto3
import pytest
import sure # noqa
from botocore.exceptions import ClientError
from datetime import datetime
from moto import mock_iam
from moto.core import ACCOUNT_ID
@mock_iam
def test_get_all_server_certs():
conn = boto3.client("iam", region_name="us-east-1")
conn.upload_server_certificate(
... |
import numpy as np
import pandas as pd
import pandas.testing as tm
import pytest
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.schema as sch
from ibis.backends.impala.pandas_interop import DataFrameWriter # noqa: E402
pytestmark = pytest.mark.impala
@pytest.fixture
def exhaustive_df():
return p... |
# -*- coding: utf-8 -*-
import getpass
import json
import logging
from datetime import datetime
from pymongo import MongoClient
from water.utils import remove_dots, restore_dots
LOGGER = logging.getLogger(__name__)
class MongoDB(object):
def __init__(self, database=None, config=None, **kwargs):
if co... |
from rest_framework import serializers
from app_book.models import Novel, NovelFork, NovelChapter
class NovelSerializer(serializers.ModelSerializer):
forks = serializers.SerializerMethodField()
new = serializers.SerializerMethodField()
class Meta:
model = Novel
fields = ('id', 'title', '... |
Pull requests
Git init
Git pull *clone or download URL*
Git status
#For Git to track that file, the add command is given. If you know the exact name of the file, you can specify that simply type the following command:
Git add .
Git commit -m “changes made”
Git status
Git remote add origin *URL*
Git remote -v
Git pu... |
# -*- coding: utf-8 -*-
from ctypes import POINTER, c_int, c_double, c_float, c_size_t, c_void_p
import numpy as np
from pyfr.backends.base import ComputeKernel
from pyfr.ctypesutil import LibWrapper
# Possible CLBlast exception types
CLBlastError = type('CLBlastError', (Exception,), {})
class CLBlastWrappers(Li... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 30 16:10:56 2016
@author: fergal
$Id$
$URL$
"""
__version__ = "$Id$"
__URL__ = "$URL$"
import matplotlib.pyplot as mp
import numpy as np
"""
This is the task to run the fortran bls code. It's not used
in the normal pipeline, but I keep it here in case we ever need
... |
import hashlib
# Prepare the transaction
sender = "0xAlice"
receiver = "0xBob"
amount = "10"
transaction = sender + ";" + receiver + ";" + amount + ";"
print("Transaction text: " + transaction)
salt = 0
# Loop over all salts and check if the condition is met
while True:
salt = salt+1
print("Trying salt " + ... |
__author__ = 'demi'
# Define a function, hash_string,
# that takes as inputs a keyword
# (string) and a number of buckets,
# and returns a number representing
# the bucket for that keyword.
def hash_string(keyword,buckets):
res = 0
for c in keyword:
res += ord(c)
return res % buckets
print(hash... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-06-06 09:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('category', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
# Copyright (c) 2018 by contributors. 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... |
# -*- coding: utf-8 -*-
# @Time : 2020/11/9 下午9:00
# @Author : 司云中
# @File : redis_lock.py
# @Software: Pycharm
import uuid
import math
import time
from threading import Thread
import redis
from redis import WatchError
def acquire_lock_with_timeout(conn, lock_name, acquire_timeout=3, lock_timeout=3, **kwargs):
... |
#!/usr/bin/env python
#
# Copyright 2015 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 requir... |
# Copyright 2017 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... |
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
from registration.forms import RegistrationFormTermsOfService
from invitation.views import register
admin.autodiscover()
# Change URLs given the INVITE_MODE setting, useful for tests
if getattr(settings, 'INVITE... |
#!/usr/bin/env python2.6
# nodestored.py - block storage access API
# renamed from gt-xm-storage.py
# refactored from gt-xm-reimage0.py
# refactored from original gt-xm-reimage0 shell script
#
# Copyright (C) 2006-2011 Eric Windisch
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... |
s = [1, 2, 3]
class SetOps(object):
def __init__(self, s):
self.set = s
def subsets(self):
n = len(self.set)
# each set has 0 to 2^(n - 1) subsets (total of 2^n)
for i in range(pow(2, n)):
subset = []
# this bit masks each of n bits to find which eleme... |
import glob
import os.path as osp
from dassl.utils import listdir_nohidden
from ..build import DATASET_REGISTRY
from ..base_dataset import Datum, DatasetBase
@DATASET_REGISTRY.register()
class DigitsDG(DatasetBase):
"""Digits-DG.
It contains 4 digit datasets:
- MNIST: hand-written digits.
-... |
cars = 100
space_in_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_car
average_passengers_per_car = passengers / cars_driven
print("There are", cars, "cars available")
print("There are only", drivers, "drivers available")
print("T... |
import datetime
import numpy as np
"""
Class to define a 'RiskAssessment' from FHIR.
Currently only produces JSON.
{
"date": date assesment was made in ISO format yyyy-mm-dd,
"results": {
"five_year_abs": Five year Absolute Risk for this patient as decimal
"five_year_ave"... |
from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
from article.models import Article, Categroy, Tag
from frontuser.models import User, UserExtendsion
def index(request):
user = User(name="小红")
user.save()
category = Categroy(name='中国古典文学')
category.sav... |
#!/usr/bin/env vpython3
# Copyright 2021 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.
"""Tests scenarios with number of devices and invalid devices"""
import subprocess
import unittest
import unittest.mock as mock
from a... |
import json
def _log_info(msg):
print(msg)
class PackageAPI():
"""Package API class
This class is used to hold the interface of a given package
being analyzed by doppel. It's comparison operators enable comparison
between interfaces and its standard JSON format allows this comparison
to hap... |
from congregation.config.network import NetworkConfig
from congregation.config.codegen import CodeGenConfig, JiffConfig
class Config:
def __init__(self):
self.system_configs = {}
def add_config(self, cfg: [NetworkConfig, CodeGenConfig, JiffConfig]):
self.system_configs[cfg.cfg_key] = cfg
... |
import json
from status.get_status_from_s3_path import handler
from status.StatusData import StatusData
import test.test_data as test_data
# s3path: echo -n "my/path/to/file (2020).xlsx" | base64
event = {
"headers": {"Authorization": f"bearer {test_data.bearer_token_with_access}"},
"pathParameters": {"s3_pat... |
from typing import Sequence, Union
import numpy as np
from scipy.ndimage.interpolation import rotate as np_rotate
from PIL.Image import Image
from torch import Tensor, tensor
from torchvision.transforms.functional import rotate
class ImageRotation(object):
def __init__(self, degree):
self.degree = degree... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from scipy.linalg import lapack
from typing import Tuple
from ...core.acquisition import Acquisition
from ...quadrature.methods import VanillaBayesianQuadrature
class SquaredCorrelatio... |
# -*- coding: utf-8 -*-
__author__ = 'Shinobu Jamella Hoshino, https://github.com/Boneflame/gpipe43'
import urlfetch_ps, urllib_ps, Entdecker
from remove_control_characters import remove_control_characters
import chardet
import random
import re
import urlparse
import threading
import time
from lxml import etree
from l... |
#!/usr/bin/python
#
# Copyright 2014 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 b... |
from django.test import TestCase
from datetime import datetime, timedelta
from django.utils.dateparse import parse_date
from blog.models import Article
from blog.tools import *
# Create your tests here.
class ArticleTests(TestCase):
def test_future_article_will_be_public(self):
p = Article(title='test', content='... |
#!/usr/bin/env python3
from copy import copy
class SimulatorM5PModel:
def __init__(self, last_mcs, last_length, cur_mcs, statistics):
self.max_length_th = dict()
self.candidates = []
self._last_mcs = last_mcs
self._last_length = last_length
self._cur_mcs = cur_mcs
self._statistics = statistics
self.s... |
import linked_list
llist = linked_list.LinkedList()
llist.add(10)
llist.add(10)
llist.add(11)
llist.add(12)
llist.add(13)
llist.add(13)
llist.add(13)
llist.add(14)
llist.add(14)
print(f'List: {llist}')
llist.remove_duplicate()
print('Removed duplicates')
print(f'List: {llist}') |
# Generated by Django 2.2.3 on 2019-07-15 10:31
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('TeamXapp', '0056_auto_20190715_1130'),
]
operations = [
migrations.AlterField(
model_name='allm... |
# Delete all keys that start with 'foo'.
for k in hiera.keys():
if k.startswith('foo'):
hiera.pop(k) |
#!/usr/bin/python
"""
==============================================================================
Author: Tao Li (taoli@ucsd.edu)
Date: Jun 23, 2015
Question: 106-Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal
Link: https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-... |
from warnings import warn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from ..misc import NeuroKitWarning, find_plateau
def complexity_k(signal, k_max="max", show=False):
"""Automated selection of the optimal k_max parameter for Higuchi Fractal Dimension (HFD).
The optimal kmax is... |
import logging
import warnings
from collections import OrderedDict
import transaction
from pyramid.events import NewRequest
import pyramid.tweens
from enum import Enum
from kinto.core.utils import strip_uri_prefix
logger = logging.getLogger(__name__)
class ACTIONS(Enum):
CREATE = "create"
DELETE = "delete... |
import _plotly_utils.basevalidators
class HovertemplateValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="hovertemplate", parent_name="mesh3d", **kwargs):
super(HovertemplateValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... |
import pretrainedmodels as pm
import torch
# models giving an error
errored_model_name = ['fbresnet152', 'bninception', 'inceptionv4', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']
# collect all (model, pretrained) tuples
pm_args = []
for model_name in pm.model_names:
for pretrained in pm.pretrained_... |
# coding: utf-8
"""
WARNING: used in logic, but FAB uses version in basic_web_app/app
The primary copy is here -- copy changes to basic_web_app/app.
on relationships...
* declare them in the parent (not child), eg, for Order:
* OrderDetailList = relationship("OrderDetail", backref="OrderHeader", cascade_backref... |
import os
import pandas as pd
from openpyxl import load_workbook
data_dir = "."
template = 'chartme_template.xlsx'
new_wkbk = 'chartme_data_added.xlsx'
tab_name = 'data'
ROWS_AXIS = 0
COLS_AXIS = 1
def normalize(series):
"""Accepts a column (a pandas.Series object) and returns a normalized
version. Op... |
from pathlib import Path
import numpy as np
import pandas as pd
if "ihome" in str(Path.home()):
path_photoz = Path.home() / "photoz"
# path_photoz = Path("/bgfs") / "jnewman" / "bid13" / "photoZ"
elif "/Users/andrews" in str(Path.home()):
path_photoz = Path.home() / "projects" / "photoz"
path_pasquet2019... |
from setuptools import setup, Distribution
import sys
import os
class PlatformError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BinaryDistribution(Distribution):
def is_pure(self):
return False
#Get relative path to re... |
#!/usr/bin/env python3
import codecs
import os
import pathlib
from typing import Any, List, Dict
from setuptools import setup # type: ignore
from setuptools import find_packages
def is_travis_deploy() -> bool:
if os.getenv("DEPLOY_SDIST", "") or os.getenv("DEPLOY_WHEEL", ""):
return is_tagged_commit()
... |
"""Entity for Surepetcare."""
from __future__ import annotations
from abc import abstractmethod
from surepy.entities import SurepyEntity
from homeassistant.core import callback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import SurePetcareDataCoordinator
from .const import DOMAIN
... |
from bitstring import BitArray
from flopz.arch.instruction import Instruction
from flopz.arch.ia32.registers import IA32_Register
from flopz.arch.ia32.ia32_generic_arch import ProcessorMode
"""
Prefixes and Fields that make up IA-32 instructions
"""
# REX
class REX:
def __init__(self, w=0, r=0, x=0, b=0):
... |
"""1. Predict with pre-trained Simple Pose Estimation models
==========================================
This article shows how to play with pre-trained Simple Pose models with only a few
lines of code.
First let's import some necessary libraries:
"""
from matplotlib import pyplot as plt
from gluoncv import model_zoo... |
#!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
import matplotlib
# matplotlib.use('Agg')
from pandas import DataFrame
from pandas import Series
from pandas import concat
from pandas import read_csv
from pandas import datetime
import pandas as pd
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import MinMaxScaler
from keras.models import Se... |
# Copyright (C) 2021 Antmicro
# SPDX-License-Identifier: Apache-2.0
from os import path
from logging import warning, info, error
from nmigen import Elaboratable, Module, Signal, Instance, Fragment
from nmigen.hdl.ast import Const
from nmigen.build import Platform
from nmigen.back import verilog
from .ipwrapper import I... |
#!/usr/bin/python
#
# ==-- jobstats - support for reading the contents of stats dirs --==#
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014-2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/... |
#!/usr/bin/python
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""This module provides shared functionality for the system to generate
dart:html APIs fr... |
import json
from os import path
from zlib import decompress, MAX_WBITS
from subprocess import check_output
from statistics import median, mean, stdev
from collections import OrderedDict
SECTION_SEPARATOR = '-' * 40
IDENT = ' ' * 4
def parse_schema(s):
def parse_type(s, end_delimiter, element_type):
keys ... |
"""Convert XFL color effects to SVG."""
from dataclasses import dataclass
import re
import xml.etree.ElementTree as ET
import warnings
HEX_COLOR = re.compile(r"#[A-Za-z0-9]{6}")
@dataclass(frozen=True)
class ColorEffect:
multiplier: tuple = (1, 1, 1, 1)
offset: tuple = (0, 0, 0, 0)
@classmethod
de... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import logging
import urllib.parse
import argparse
import requests
import lxml.html
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)s %(name)s: %(funcName)s(%(lineno)d): %(message)s")
# logging.basicConfig(level=logging.DEBUG, f... |
"""
Copyright (c) 2022 Henry Schreiner. All rights reserved.
scikit-hep-repo-review: Review repos for compliance to the Scikit-HEP developer guidelines
"""
from __future__ import annotations
__version__ = "0.3.0"
__all__ = ("__version__",) |
#####################################################################################################
# entregable5.py
#
# Version 1.2: corregido bug:
# - La imagen resultante no se guardaba como gif.
# Version 1.1: corregidos dos bugs:
# - Ahora el programa también funciona si el método get de la clase tkin... |
# Copyright 2017 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... |
"""Top-level package for libshipkore."""
__author__ = """Innerkore"""
__email__ = 'admin@innerkore.com'
__version__ = '0.2.2' |
from importlib.metadata import requires
from wsgiref.validate import validator
from pkg_resources import safe_extra
from mycroft import MycroftSkill, intent_handler
from adapt.intent import IntentBuilder
from mycroft.util.format import join_list
from os.path import dirname, join
from lingua_franca.parse import fuzzy_m... |
from django.test import TestCase
from avocado.core.paginator import BufferedPaginator
class BufferedPaginatorTestCase(TestCase):
def test_base(self):
kwargs = {
'count': 100,
'offset': 0,
'buf_size': 10,
'object_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
... |
from functools import partial
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.http import Http404, HttpResponse
from django.shortcuts import render
from... |
import pytest
import os
import shutil
from tempfile import gettempdir
from oldpy2store.errors import OverWritesNotAllowedError, DeletionsNotAllowed
from oldpy2store.test.util import get_s3_test_access_info_from_env_vars
# from collections.abc import MutableMapping
# from oldpy2store.base import AbstractObjStore
# imp... |
import os
from unittest import TestCase
from . import _sqlite_db_path
from py_queryable import expressions
from py_queryable.expressions import operators
from .models import Student
from py_queryable.db_providers import SqliteDbConnection
from py_linq.exceptions import NoElementsError, MoreThanOneMatchingElement, NoMat... |
import re
import os
import json
import base64
import urllib3
import requests
from .config import VdsConfig
from queue import Queue
from automon.log import Logging
# disable insecure ssl warnings
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class VdsLdapClient(object):
"""Not implemented... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = "0.0"
__maintainer__ = "Ricardo Ribeiro"
__email__ = "ricardojvr@gmail.com"
__status__ = "Development"
from __init__ import *
class SimpleExample... |
# 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... |
"""
This file is copied from app.executable master branch
It is required by the tasks.py file.
While editing please make sure:
1) Not to import unnecessary modules.
2) Import only within the function where it is necessary.
3) Any new import will require you to install it in the worker container.
(See Docker/CPUWork... |
# pylint: disable=too-many-lines
# 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) AutoRe... |
"""
Province Class
"""
import time
from city import City
from device_type import DeviceType
from device_scene import DeviceScene
class Province:
def __init__(self):
self.province_name = ''
self.province_cities = []
self.province_point = 0
self.province_screens = 0
... |
import unittest
from actions.balances import Balances
from clickhouse_driver import Client
from unittest.mock import MagicMock
TEST_TABLE = "test_eth_transaction"
class BalancesTestCase(unittest.TestCase):
def setUp(self):
self.balances = Balances(TEST_TABLE)
self.client = Client('localhost')
... |
# -*- coding: utf-8 -*-
#
# testreport test docs documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 28 11:37:14 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerate... |
data_root_path = 'data/'
data = dict(
samples_per_gpu=2,
workers_per_gpu=2,
train=dict(),
val=dict(),
test=dict()
) |
#City , Country:
def CityCountryFunc(city, country):
return str(city)+', '+str(country) |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... |
import datetime
from datetime import datetime
from datetime import timedelta
import asyncio
import functools
import itertools
import math
import random
import time
from sys import platform
import platform
import psutil
import discord
from discord.ext.commands import Bot
import youtube_dl
from async_timeout import timeo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.