text stringlengths 1 927k |
|---|
n = 5
for x in range(n, 0, -1):
for y in range(n, 0, -1):
if y > x:
print("*", end=" ")
else:
print(x, end=" ")
print() |
import numpy as np
def hwc_to_chw(image):
return np.einsum('hwc->chw', image) # change to pytorch format |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Length, ValidationError
class SearchForm(FlaskForm):
search_query = StringField('What cuisine are you in the mood for today?', validators=[DataRequired(),
Length... |
# DO NOT EDIT THIS FILE!
#
# This file is generated from the CDP specification. If you need to make
# changes, edit the generator and regenerate all of the modules.
#
# CDP domain: BackgroundService (experimental)
from __future__ import annotations
import enum
import typing
from dataclasses import dataclass
from .util... |
# Generated by Django 2.2.5 on 2019-10-07 10:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('portfolio', '0005_cvcategory_resume'),
]
operations = [
migrations.RemoveField(
model_name='resume',
name='categorie',
... |
#
# 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... |
# 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.
# -----------------------------------------------------... |
from .codegen import lambdify_, jit_compile_func, tuplefy, SymBVP, FuncBVP, FuncOCP |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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... |
from django.core.paginator import Paginator
objects = ['john', 'paul', 'george', 'ringo', 'jane', 'mag']
page = Paginator(objects, 2)
print(type(page)) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simulate a predator prey environment.
Each agent can just observe itself (it's own identity) i.e. s_j = j and vision sqaure around it.
Design Decisions:
- Memory cheaper than time (compute)
- Using Vocab for class of box:
-1 out of bound,
inde... |
import pandas as pd
import pyproj
import glob
import os
import datetime
#first install the following c++ for python library
#https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
#run python setup.py install
#https://jswhit.github.io/pyproj/
#program is now ready to be used.
#docu
#https://pypi.python... |
import os, sys
sys.path.insert(0, os.path.abspath(".."))
import pandas as pd
import numpy as np
import pytest
def test():
from pycaret.datasets import get_data
data = get_data("boston")
from pycaret.regression import setup, create_model, tune_model
s = setup(data, target="medv", silent=True, html=... |
import json
import logging
import os
import re
import socket
import sys
import threading
import time
from typing import Dict, Optional, Union
from urllib.parse import urlparse
if sys.version_info >= (3, 8):
from typing import TypedDict
else:
from typing_extensions import TypedDict
import boto3
import botocore... |
from .deck import Deck # noqa
from .layer import Layer # noqa
from .light_settings import LightSettings # noqa
from .view import View # noqa
from .view_state import ViewState # noqa |
from aiy.enviro import EnviroKit
from aiy.cloudiot import CloudIot
from luma.core.render import canvas
from PIL import ImageDraw
from time import sleep
import argparse
def update_display(display, msg):
with canvas(display) as draw:
draw.text((0, 5), msg, fill='white')
def _none_to_nan(val):
return ... |
# 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... |
# Copyright (c) 2011 Openstack, LLC.
# Copyright (c) 2012 Justin Santa Barbara
#
# 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.... |
# Copyright (c) Aishwarya Kamath & Nicolas Carion. Licensed under the Apache License 2.0. All Rights Reserved
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Utilities for bounding box manipulation and GIoU.
"""
import torch
import numpy as np
from torchvision.ops.boxes import box_area
from t... |
from django.conf import settings
from django.core.exceptions import ValidationError
from django.utils.translation import gettext as _
import requests
from wagtail.core import blocks
from webstories import Story, StoryPage
from .markup import AMPText
class AMPCleanHTMLBlock(blocks.RawHTMLBlock):
def clean(self, v... |
from saturnv.ui.managers import FileBasedManager
class FontManager(FileBasedManager):
def __init__(self, path, extension='*ttf'):
super().__init__(path, extension) |
import logging
import datetime
import json
import requests
from bs4 import BeautifulSoup
from twilio.rest import TwilioRestClient
from .config import twilio
logger = logging.getLogger(__name__)
def translate_timestamp(ts):
translation = {
'stycznia': 1,
'lutego': 2,
'grudnia': 12,
}... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Hydrogen(CMakePackage, CudaPackage):
"""Hydrogen: Distributed-memory dense and s... |
# -*- coding: utf-8 -*-
"""RotationForest vector classifier.
Rotation Forest, sktime implementation for continuous values only.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["RotationForest"]
import time
import numpy as np
from joblib import Parallel, delayed
from sklearn.base import BaseEstimator
from sklearn... |
#!/usr/bin/env python3
# Copyright (c) 2014-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.
# Base class for RPC testing
import logging
import optparse
import os
import sys
import shutil
import te... |
from __future__ import division
from io import BytesIO
import base64
import numpy as np
import warnings
try:
import matplotlib.pyplot as pl
import matplotlib
except ImportError:
warnings.warn("matplotlib could not be loaded!")
pass
from . import labels
from . import colors
from ..common import convert_... |
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import cv2
import glob
import time
from sklearn.svm import LinearSVC
from sklearn.preprocessing import StandardScaler
from extract_feature import *
# NOTE: the next import is only valid for scikit-learn version <= 0.17
# for scikit-lear... |
from monk.pytorch.finetune.imports import *
from monk.system.imports import *
from monk.pytorch.finetune.level_11_optimizers_main import prototype_optimizers
class prototype_losses(prototype_optimizers):
'''
Main class for all parameters in expert mode
Args:
verbose (int): Set verbosity levels
... |
# -*- encoding: utf8 -*-
"""Tests for distutils.command.check."""
import unittest
from test.test_support import run_unittest
from distutils.command.check import check, HAS_DOCUTILS
from distutils.tests import support
from distutils.errors import DistutilsSetupError
class CheckTestCase(support.LoggingSilencer,
... |
"""
Python Wechaty - https://github.com/wechaty/python-wechaty
Authors: Huan LI (李卓桓) <https://github.com/huan>
Jingjing WU (吴京京) <https://github.com/wj-Mcat>
2020 @ Copyright Wechaty Contributors <https://github.com/wechaty>
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use... |
"""
Base client outlining how we fetch and parse responses
"""
import json
import logging
import httplib2
from .utils import NotFound, CongressError, u
log = logging.getLogger('congress')
class Client(object):
"""
Client classes deal with fetching responses from the ProPublica Congress
API and parsing w... |
import torch.nn as nn
from chemprop.nn_utils import get_activation_function
from chemprop.args import TrainArgs
def create_ffn(output_size: int, input_size: int, args: TrainArgs):
"""
Creates the feed-forward layers for the model.
:param args: A :class:`~chemprop.args.TrainArgs` object containing model a... |
# coding: utf-8
"""
rokka.io
digital image processing done right. [Documentation](https://rokka.io/documentation). [Changelog](https://api.rokka.io/changelog.md). # noqa: E501
OpenAPI spec version: 1.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import... |
import numpy as np
from FEM import get_element_dof
from tqdm import tqdm
from scipy.spatial.distance import pdist
def get_elements_sensibilities(local_matrix, minimum_density, elements_density,
displacements, penalty, connectivity, nodes_dof):
# calculate elements sensibilities
... |
def highlight(code, language):
return code
def escape_html(code):
return code.replace("&","&").replace("<","<").replace("\n","<br>")
def escape_html_char(char):
if char=="<":
return "<"
if char=="&":
return "&"
if char=="\n":
return "<br>"
if char=="\r":
return ""
return char
def parse(c... |
"""Support for Fibaro lights."""
import asyncio
from functools import partial
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_WHITE_VALUE,
DOMAIN,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_WHITE_VALUE,
LightEntity,
)
from homeassistant.c... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) DeFi Blockchain Developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Test Futures contract RPC."""
from test_framework.test_fram... |
# -*- coding: utf-8 -*-
"""
@date: 2020/11/21 下午4:16
@file: test_resnest.py
@author: zj
@description:
"""
import torch
from zcls.config import cfg
from zcls.config.key_word import KEY_OUTPUT
from zcls.model.recognizers.resnet.resnet import ResNet
def test_data(model, input_shape, output_shape):
data = torch.r... |
# -*- coding: utf-8 -*-
"""
Lower-level and simpler USID-specific HDF5 utilities that facilitate higher-level data operations
Created on Tue Nov 3 21:14:25 2015
@author: Suhas Somnath, Chris Smith
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import collections
from warnings ... |
# -*- coding: utf-8 -*-
__author__ = 'Øyvind Jekteberg and Kristian Gingstad'
__copyright__ = 'Copyright 2020, The arXivDigest project'
import datetime
from arxivdigest.frontend.database.db import getDb
def isAdmin(id):
'''Returns True if if the user with user_id of id is an admin and false if not.'''
cur =... |
'''
累加数
累加数是一个字符串,组成它的数字可以形成累加序列。
一个有效的累加序列必须至少包含 3 个数。除了最开始的两个数以外,字符串中的其他数都等于它之前两个数相加的和。
给定一个只包含数字 '0'-'9' 的字符串,编写一个算法来判断给定输入是否是累加数。
说明: 累加序列里的数不会以 0 开头,所以不会出现 1, 2, 03 或者 1, 02, 3 的情况。
示例 1:
输入: "112358"
输出: true
解释: 累加序列为: 1, 1, 2, 3, 5, 8 。1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8
示例 2:
输入: "199100199"
输出: t... |
from __future__ import absolute_import
import pyflann
import numpy
import sklearn.preprocessing
from ann_benchmarks.algorithms.base import BaseANN
class FLANN(BaseANN):
def __init__(self, metric, target_precision):
self._target_precision = target_precision
self.name = 'FLANN(target_precision=%f)' ... |
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
from __future__ import absolute_import
from collections import namedtuple
import errno
import dnf
from mock import call, Mock, patch, PropertyMock
import pytest
from module_build_service.common.config import conf
from module_build_service.common.errors import Unp... |
# -*- coding: utf-8 -*-
# Python imports
# 3rd Party imports
# App imports
from .individual import Individual
class Crossover:
parent_a: Individual
parent_b: Individual
individual_class: type
def __init__(self, individual_class: type = Individual):
self.individual_class = individual_class
... |
from app.db.base_class import Base
from app.models import Team, User
from sqlalchemy_oso.roles import resource_role_class
# ROLE MODELS ##
TeamRoleMixin = resource_role_class(Base, User, Team, ["OWNER", "ADMIN", "MEMBER"])
class TeamRole(Base, TeamRoleMixin):
pass |
from .recognizer import Recognizer
from .distance_checker import DistanceChecker
from .time_checker import TimeChecker
from .pass_checker import PassChecker
from .stop_recognizer import StopRecognizer |
import os
import torch
import numpy as np
from torchvision import transforms
from torch import nn
from torch.nn import Softmax
from facenet_pytorch import MTCNN
from PIL import Image
import matplotlib.pyplot as plt
from loadOpenFace import prepareOpenFace
from collections import OrderedDict
import argparse
# Check if... |
import unittest
from unittest.mock import Mock, PropertyMock, patch
from typer.testing import CliRunner
from nuplan.cli.nuplan_cli import cli
runner = CliRunner()
class TestNuPlanCli(unittest.TestCase):
"""
Test nuplan cli with typer engine
"""
@patch("nuplan.cli.db_cli.NuPlanDB")
def test_db_... |
from django import forms
from django.contrib.auth.forms import UserChangeForm
from .models import CustomUser
class CustomUserChangeForm(UserChangeForm):
email = forms.EmailField(required=True)
class Meta:
model = CustomUser
fields = ('email', 'first_name', 'last_name')
class UploadAvatarFor... |
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... |
'''https://leetcode.com/problems/symmetric-tree/'''
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def isMirror(self, left, right):
if left is None and right is None:
... |
# -*- coding: utf-8 -*-
"""ssd7_training_inferenceonvideo.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1gMZm_sCuKq7g_cZIGfEcYyKoVw-U7jTX
"""
# from IPython.display import clear_output
# ! rm -rf *
# ! wget -O repo.zip https://github.com/pierl... |
#!/usr/bin/env python
'''
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")... |
# coding: utf-8
"""
Velo Payments APIs
The version of the OpenAPI document: 2.26.124
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import velo_payments
from velo_payments.models.get_payouts_response_v3_page import GetPayoutsResponseV3Page # n... |
# encoding=utf8
"""Implementations of Zakharov function."""
import numpy as np
from niapy.problems.problem import Problem
__all__ = ['Zakharov']
class Zakharov(Problem):
r"""Implementations of Zakharov functions.
Date: 2018
Author: Klemen Berkovič
License: MIT
Function:
**Zakharov Functi... |
# 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
# distributed under the... |
# Lint as: python3
# Copyright 2020 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 ... |
from __future__ import absolute_import
from .roomba import Roomba
from .password import Password |
from __future__ import absolute_import
import logging
import six
from rest_framework import serializers, status
from uuid import uuid4
from sentry import roles
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.decorators import sudo_required
from se... |
from typing import Optional
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.expectations.expectation import (
ColumnMapExpectation,
InvalidExpectationConfigurationError,
)
from great_expectations.expectations.util import render_evaluation_parameter... |
class Attributes(object):
amount_cents = 'amount_cents'
total_historical_amount_cents = 'total_historical_amount_cents'
declined_since = 'declined_since'
created_at = 'created_at'
pledge_cap_cents = 'pledge_cap_cents'
patron_pays_fees = 'patron_pays_fees'
unread_count = 'unread_count'
clas... |
#!/usr/bin/env python
"""
This script will add a new tag (host group) in Stealthwatch using the REST API.
For more information on this API, please visit:
https://developer.cisco.com/docs/stealthwatch/
-
Script Dependencies:
requests
Depencency Installation:
$ pip install requests
System Requirements:
... |
try:
from django.conf.urls import patterns, url
except ImportError:
from django.conf.urls.defaults import patterns, url
from django.views.generic.list import ListView
from schedule.models import Calendar
from schedule.feeds import UpcomingEventsFeed
from schedule.feeds import CalendarICalendar
from schedule.per... |
import collections
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
def requests_retry_session(
retries=3,
backoff_factor=0.3,
status_forcelist=(500, 502, 504),
session=None
):
"""
Exponential back off for requests.
via https... |
# Copyright 2004-present, Facebook. All Rights Reserved.
# flake8: noqa
from .catalogs import (
post_item_batch,
post_item_batch_by_id,
create_product,
update_product,
create_catalog,
)
from .dummy_products import create_dummy_products |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012-2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from habittracker.utils import connect_to_database, init_sqlite_table, check_file_existing
from habittracker.commands import get_main_user_choice, display_title_bar, evaluate_main_user_choice
def main():
database_name = "habits.db"
# Initialize database when data... |
# -*- coding: utf-8 -*-
# pylint: disable=too-few-public-methods,too-many-arguments,too-many-instance-attributes
from raiden.transfer.architecture import StateChange
from raiden.transfer.state import RouteState
from raiden.transfer.mediated_transfer.state import (
LockedTransferSignedState,
TransferDescription... |
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from profiles_api import serializers
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.... |
# SPDX-License-Identifier: Apache-2.0
import config
import onnx
import os
import sys
def main():
script_dir = os.path.dirname(os.path.abspath(__file__))
directory = os.path.join(script_dir, '../onnx/backend/test/data/node')
count = failed_count = 0
for root, _, files in os.walk(directory):
for... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import time
g_num = 0
def work1(num):
global g_num
for i in range(num):
mutex.acquire() # 上锁
g_num += 1
mutex.release() # 解锁
# print("----in work1, g_num is %d---" % g_num)
def work2(num):
global g_num
fo... |
# 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 math
import torch
import torch.nn as nn
import torch.nn.functional as F
from .modules import TransformerLayer, PositionalEmbedding #... |
from setuptools import setup, find_packages
setup(
name='bugsnag_exporter',
version='1.3.0.dev0',
author='Wolfgang Schnerring',
author_email='wolfgang.schnerring@zeit.de',
url='https://github.com/ZeitOnline/bugsnag_exporter',
description='',
long_description=(
open('README.rst').re... |
from repositories.category import CategoryRepo
from repositories.product import ProductRepo
from repositories.menu import MenuRepo |
# 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... |
"""
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/bcc"
# docs_base_url = "https://[org_name].github.io/bcc"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "Bcc" |
import pytest
from temporal import DEFAULT_VERSION
from temporal.workflow import workflow_method, WorkflowClient, Workflow
TASK_QUEUE = "test_workflow_get_version_single_tq"
NAMESPACE = "default"
version_found_in_step_1_0 = None
version_found_in_step_1_1 = None
version_found_in_step_2_0 = None
version_found_in_step_... |
#!/usr/bin/env python
# cardinal_pythonlib/django/function_cache.py
"""
===============================================================================
Original code copyright (C) 2009-2020 Rudolf Cardinal (rudolf@pobox.com).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Ve... |
# This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 7 12:21:28 2021
@author: user15
"""
from random import choice
counter = 0
def randomize():
jokenpo_value = ['gu', 'choki', 'pa']
machine = choice(jokenpo_value)
return machine
# get input from user
def init_game(counter):
if counter == 0:
... |
# coding: utf-8
"""
Pure1 Public REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from... |
# -*- coding: utf-8 -*-
import json
import logging
from collections import OrderedDict
from rest_framework import exceptions
from rest_framework.views import APIView, exception_handler
from common import error_code
from django.utils.translation import gettext as _
logger = logging.getLogger("api-request")
def custom... |
#!/usr/bin/python
#
# Copyright (C) 2009 Mendix. All rights reserved.
#
from __future__ import print_function
import argparse
import atexit
import cmd
import datetime
import getpass
import logging
import os
import pwd
import random
import shlex
import signal
import string
import subprocess
import sys
import yaml
from... |
# !/usr/bin/python
"""
Copyright ©️: 2020 Seniatical / _-*™#7519
License: Apache 2.0
A permissive license whose main conditions require preservation of copyright and license notices.
Contributors provide an express grant of patent rights.
Licensed works, modifications, and larger works may be distributed under differe... |
"""
amt-load -- Artifact Management Tool Reader
amt is a Tool for managing software artifacts
It defines classes_and_methods and a command line interface
@author: Kenneth E. Bellock
@copyright:
@contact: ken@bellock.net
"""
import os
import sys
import yaml
import logging
__all__ = ['load']
SCRIPT_PATH = o... |
import re
from parallel import hand_odds
if __name__ == '__main__':
while True:
class_string = input('Paste html extract:')
split = (class_string.split(','))
number_of_players = int(split[-1])
split = split[:-1]
print(split)
match_list = []
suits = []
... |
#
# Copyright 2015 Quantopian, 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 wr... |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 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 InvalidateBlock code
#
from test_framework.test_framework import KakobitTestFramework
from test... |
#!/usr/bin/python
#
# Copyright 2019 Polyaxon, 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 o... |
# -*- coding: utf-8 -*-
"""Package configuration.
Copyright (c) 2016-2020 Cisco and/or its affiliates.
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 limit... |
__all__ = ["DiscreteTune"]
from typing import Dict, Tuple, Optional
import WrightTools as wt
class DiscreteTune:
def __init__(
self, ranges: Dict[str, Tuple[float, float]], default: Optional[str] = None, **kwargs
):
"""A Tune which maps one set of inputs to associated output points.
... |
import asyncio
import dataclasses
import io
import logging
import random
import time
import traceback
from typing import Callable, Dict, List, Optional, Tuple, Set
from chiavdf import create_discriminant
from btcgreen.consensus.constants import ConsensusConstants
from btcgreen.consensus.pot_iterations import calculat... |
#!/usr/bin/python3
from botbase import *
_saarlouis_c = re.compile(r"insgesamt:\s*([0-9.]+)")
_saarlouis_d = re.compile(r"Verstorben:\s*([0-9.]+)")
_saarlouis_g = re.compile(r"Genesen:\s*([0-9.]+)")
def saarlouis(sheets):
import bs4
soup = get_soup("https://www.kreis-saarlouis.de/Corona-Virus/Corona-Ticker.ht... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 14 14:15:06 2021
@author: brsr
"""
import numpy as np
import matplotlib.pyplot as plt
import mapproj
import fiona
from shapely.geometry import Point, LineString, MultiPolygon, Polygon
import geopandas
import pyproj
geod = pyproj.Geod(a=1, f=0)
n = ... |
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Any, List
# This is a hack to prevent circular imports; since Interpreter imports from this file,
# we will only import it during the type_checking run from mypy
if TYPE_CHECKING:
from yaplox.interpreter impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2022 F4PGA Authors
#
# 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
#
# Unl... |
########################################################################
# Impoorts Required for Flask Server Functionality
########################################################################
from flask import Flask, render_template, url_for, abort, redirect, request
##############################################... |
#! python3
# __author__ = "YangJiaHao"
# date: 2018/2/1
# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def mergeTwoLists(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: Li... |
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
import numbers
from coremltools.converters.mil.mil import Operation, types
from co... |
import logging
import os
import time
def tap_screen(x, y,device_x,device_y):
#模拟点击
base_x, base_y = 1920, 1080
real_x = int(x / base_x * device_x)
real_y = int(y / base_y * device_y)
os.system('adb shell input tap {} {}'.format(real_x, real_y))
def VT_init():
#虚拟机adb初始化
os.system('adb connect 12... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.