max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
7
115
max_stars_count
int64
101
368k
id
stringlengths
2
8
content
stringlengths
6
1.03M
python/spec/fixtures/setup_files/imports_version.py
lioramilbaum/dependabot-core
2,670
11068753
<gh_stars>1000+ from setuptools import setup, find_packages from split_settings import __version__ setup(name='python-package', version=__version__, description='Example setup.py', url='httos://github.com/example/python-package', author='Dependabot', scripts=[], packages=find_packa...
parlai/chat_service/utils/config.py
zl930216/ParlAI
9,228
11068774
#!/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. """ Config Utils. """ import yaml from collections import namedtuple WorldConfig = namedtuple( "WorldConfig", [...
tests/test_visitors/test_ast/test_complexity/test_classes/test_bases_classes_counts.py
cdhiraj40/wemake-python-styleguide
1,931
11068778
import pytest from wemake_python_styleguide.violations.complexity import ( TooManyBaseClassesViolation, ) from wemake_python_styleguide.visitors.ast.complexity.classes import ( ClassComplexityVisitor, ) correct_count = """ class CorrectClassName( FirstParentClass, SecondParentClass, ThirdParentCla...
tests/test_plugin.py
Vlczech/spectree
183
11068818
<gh_stars>100-1000 import pytest from spectree.utils import get_model_key, get_model_path_key, get_model_schema from .common import JSON, SECURITY_SCHEMAS, Cookies, Headers, Query, Resp, get_paths from .test_plugin_falcon import api as falcon_api from .test_plugin_flask import api as flask_api from .test_plugin_flask...
core/migrations/0008_auto__add_field_attachment_filename.py
nuwainfo/treeio
242
11068890
<gh_stars>100-1000 # encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license # encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm)...
OpenDataCatalog/comments/widgets.py
runonthespot/Open-Data-Catalog
105
11068923
from django.forms.util import flatatt from django.utils.encoding import StrAndUnicode, force_unicode from django.utils.html import conditional_escape from django.utils.safestring import mark_safe class StarsRadioInput(StrAndUnicode): """ An object used by RadioFieldRenderer that represents a single <input...
tools/mo/openvino/tools/mo/front/tf/roll_ext.py
ryanloney/openvino-1
1,127
11068947
<filename>tools/mo/openvino/tools/mo/front/tf/roll_ext.py # Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from openvino.tools.mo.ops.roll import Roll from openvino.tools.mo.front.extractor import FrontExtractorOp class RollExtractor(FrontExtractorOp): op = 'Roll' enabled = T...
jiant/tasks/lib/udpos.py
yzpang/jiant
1,108
11068951
<reponame>yzpang/jiant<filename>jiant/tasks/lib/udpos.py import numpy as np import torch from dataclasses import dataclass from typing import List, Union from jiant.tasks.core import ( BaseExample, BaseTokenizedExample, BaseDataRow, BatchMixin, Task, TaskTypes, ) from jiant.tasks.lib.templates....
datathon/cbis_ddsm/scripts/cbis_ddsm_ml/trainer/tpu_model.py
kourtneyshort/healthcare
310
11068953
#!/usr/bin/python # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
tests/api/conftest.py
Gorlym/WEB
187
11068968
import pytest from alembic.command import upgrade from sqlalchemy import create_engine from analyzer.api.__main__ import parser from analyzer.api.app import create_app @pytest.fixture async def migrated_postgres(alembic_config, postgres): """ Возвращает URL к БД с примененными миграциями. """ upgrade...
metrics/log_collectors/training_data_service_client/connect.py
adrian555/FfDL
680
11068994
# # Copyright 2017-2018 IBM Corporation # # 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...
apache/flask/webapp/validators.py
jamitupya/SweetSecurity3alpha
792
11068996
import re def convertMac(macAddress): if re.match(r"^[A-za-z0-9]{2}-[A-za-z0-9]{2}-[A-za-z0-9]{2}-[A-za-z0-9]{2}-[A-za-z0-9]{2}-[A-za-z0-9]{2}$",macAddress): macAddress=macAddress.replace('-','') elif re.match(r"^[A-za-z0-9]{2}:[A-za-z0-9]{2}:[A-za-z0-9]{2}:[A-za-z0-9]{2}:[A-za-z0-9]{2}:[A-za-z0-9]{2}$",macAddress...
examples/multioutput-example/predict.py
Anenizer/igel
3,110
11069011
<filename>examples/multioutput-example/predict.py from igel import Igel """ The goal of igel is to use ML without writing code. Therefore, the right and simplest way to use igel is from terminal. You can run ` igel predict -dp path_to_dataset`. Alternatively, you can write code if you want. This example below demons...
examples/sharepoint/files/upload_file.py
juguerre/Office365-REST-Python-Client
544
11069018
<reponame>juguerre/Office365-REST-Python-Client<gh_stars>100-1000 import os from office365.sharepoint.client_context import ClientContext from tests import test_user_credentials, test_team_site_url test_team_site_url = test_team_site_url ctx = ClientContext(test_team_site_url).with_credentials(test_user_credentials) ...
src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/__init__.py
Mannan2812/azure-cli-extensions
207
11069030
# 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 ...
pyinfra/operations/windows.py
yggdr/pyinfra
1,532
11069040
<gh_stars>1000+ ''' The windows module handles misc windows operations. ''' from __future__ import unicode_literals from pyinfra.api import operation # Tip: Use 'Get-Command -Noun Service' to search for what commands are available or # simply 'Get-Command' to see what you can do...) # Tip: To see the windows help p...
flexneuart/retrieval/cand_provider.py
gitter-badger/FlexNeuART
101
11069048
<filename>flexneuart/retrieval/cand_provider.py # # Copyright 2014+ Carnegie Mellon University # # 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-...
docs/examples/ex22.py
bhaveshshrimali/scikit-fem
238
11069054
<gh_stars>100-1000 r"""Adaptive Poisson equation. This example solves `ex01.py` adaptively in an L-shaped domain. Using linear elements, the error indicators read .. math:: \eta_K^2 = h_K^2 \|f\|_{0,K}^2 for each element :math:`K`, and .. math:: \eta_E^2 = h_E \| [[\nabla u_h \cdot n ]] \|_{0,E}^2 for each edg...
OcCo_Torch/models/pointnet_jigsaw.py
sun-pyo/OcCo
158
11069063
# Copyright (c) 2020. <NAME>, <EMAIL> import torch, torch.nn as nn, torch.nn.functional as F from pointnet_util import PointNetEncoder, feature_transform_regularizer class get_model(nn.Module): def __init__(self, num_class, num_channel=3, **kwargs): super(get_model, self).__init__() self.num_cla...
tests/st/func/wizard/test_resnet50.py
lvyufeng/mindconverter_standalone
216
11069097
<gh_stars>100-1000 # Copyright 2020-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 app...
mypaas/stats/client_code.py
lilahtovmoon/mypaas
208
11069109
<reponame>lilahtovmoon/mypaas<filename>mypaas/stats/client_code.py """ Python code that will be transpiled to JS to implement the client side. """ from pscript.stubs import window, document, undefined, Math, Date # JS from pscript.stubs import data_per_db, text_color # are made available panels = [] # %% Button ...
test/unit/test_k8s_job_name_sanitizer.py
Netflix/metaflow
5,821
11069117
import re from metaflow.plugins.aws.eks.kubernetes import generate_rfc1123_name rfc1123 = re.compile(r'^[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?$') def test_job_name_santitizer(): # Basic name assert rfc1123.match(generate_rfc1123_name('HelloFlow', '1', 'end', '321', '1')) # Step name ends with _ ...
sandbox/library/apps.py
caplena/django-hashid-field
310
11069121
from django.apps import AppConfig class LibraryConfig(AppConfig): name = 'library'
x-pack/filebeat/tests/system/test_xpack_modules.py
tetianakravchenko/beats
9,729
11069146
<gh_stars>1000+ import os import sys import test_modules class XPackTest(test_modules.Test): @classmethod def setUpClass(self): self.beat_name = "filebeat" self.beat_path = os.path.abspath( os.path.join(os.path.dirname(__file__), "../../")) super(test_modules.Test, self)....
homeassistant/components/panasonic_viera/__init__.py
MrDelik/core
30,023
11069153
"""The Panasonic Viera integration.""" from functools import partial import logging from urllib.error import HTTPError, URLError from panasonic_viera import EncryptionRequired, Keys, RemoteControl, SOAPError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistan...
wechat_sdk/__init__.py
upcwangying/wechat-python-sdk
1,150
11069213
# -*- coding: utf-8 -*- from wechat_sdk.core.conf import WechatConf from wechat_sdk.basic import WechatBasic from wechat_sdk.ext import WechatExt __all__ = ['WechatConf', 'WechatBasic', 'WechatExt'] __version__ = "0.6.4"
net/data/gencerts/__init__.py
Yannic/chromium
575
11069224
<reponame>Yannic/chromium #!/usr/bin/env python # Copyright (c) 2015 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. """Set of helpers to generate signed X.509v3 certificates. This works by shelling out calls to the 'open...
bigflow_python/python/bigflow/transform_impls/select_elements_processor.py
tushushu/bigflow
1,236
11069290
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################## # # Copyright (c) 2015 Baidu, 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 o...
VMEncryption/main/CommandExecutor.py
shridpant/azure-linux-extensions
266
11069292
<reponame>shridpant/azure-linux-extensions #!/usr/bin/env python # # VMEncryption extension # # Copyright 2015 Microsoft Corporation # # 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 # # ht...
tools/mb/mb.py
chromium/chromium
14,668
11069298
<reponame>chromium/chromium #!/usr/bin/env python # Copyright 2020 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. """MB - the Meta-Build wrapper around GN. MB is a wrapper script for GN that can be used to generate build...
release/stubs.min/System/Diagnostics/__init___parts/DebuggerBrowsableAttribute.py
htlcnn/ironpython-stubs
182
11069304
class DebuggerBrowsableAttribute(Attribute,_Attribute): """ Determines if and how a member is displayed in the debugger variable windows. This class cannot be inherited. DebuggerBrowsableAttribute(state: DebuggerBrowsableState) """ def __init__(self,*args): """ x.__init__(...) initializes x; see x._...
packages/plugins/minos-database-aiopg/minos/plugins/aiopg/factories/aggregate/snapshots/__init__.py
minos-framework/minos-python
247
11069306
from .impl import ( AiopgSnapshotDatabaseOperationFactory, ) from .queries import ( AiopgSnapshotQueryDatabaseOperationBuilder, )
base_model/mobilenetv1.py
Abhishekvats1997/ResRep
176
11069307
import torch.nn as nn from builder import ConvBuilder import torch.nn.functional as F from constants import MI1_ORIGIN_DEPS class MobileV1Block(nn.Module): '''Depthwise conv + Pointwise conv''' def __init__(self, builder:ConvBuilder, in_planes, out_planes, stride=1): super(MobileV1Block, self).__init__...
examples/locality-load-balancing/client.py
giantcroc/envoy
17,703
11069332
import sys import urllib.request from collections import Counter url, n_requests = sys.argv[1], int(sys.argv[2]) count = Counter() count_fail = 0 for i in range(n_requests): try: with urllib.request.urlopen(url) as resp: content = resp.read().decode("utf-8").strip() count[content]...
src/amuse/plot/__init__.py
sibonyves/amuse
131
11069342
<reponame>sibonyves/amuse from ._plot import *
openspeech/models/rnn_transducer/configurations.py
CanYouImagine/openspeech
207
11069354
<filename>openspeech/models/rnn_transducer/configurations.py # MIT License # # Copyright (c) 2021 <NAME> and <NAME> and <NAME> # # 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 restri...
smsBomb/__main__.py
YINZHI-keji/smsBomb
461
11069363
<filename>smsBomb/__main__.py # coding=utf-8 from smsBomb import cli if __name__ == '__main__': cli.main()
elliot/recommender/neural/NeuMF/neural_matrix_factorization.py
gategill/elliot
175
11069391
<reponame>gategill/elliot """ Module description: """ __version__ = '0.3.1' __author__ = '<NAME>, <NAME>' __email__ = '<EMAIL>, <EMAIL>' import time import numpy as np from tqdm import tqdm from elliot.recommender.neural.NeuMF import custom_sampler as cs from elliot.recommender.base_recommender_model import BaseRe...
examples/airline_demo/airline_demo_tests/unit_tests/test_ingest_csv_file_handle_to_spark.py
dbatten5/dagster
4,606
11069402
<filename>examples/airline_demo/airline_demo_tests/unit_tests/test_ingest_csv_file_handle_to_spark.py<gh_stars>1000+ import tempfile from airline_demo.pipelines import local_parquet_io_manager from airline_demo.solids import ingest_csv_file_handle_to_spark from dagster import ( LocalFileHandle, ModeDefinition,...
openstackclient/tests/functional/compute/v2/test_flavor.py
mydevice/python-openstackclient
262
11069417
# 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...
model/model_cd.py
MingSun-Tse/Collaborative-Distillation
172
11069433
import numpy as np import os import torch.nn as nn import torch from torch.utils.serialization import load_lua from utils import load_param_from_t7 as load_param from model.model_kd2sd import SmallDecoder1_16x_aux, SmallDecoder2_16x_aux, SmallDecoder3_16x_aux, SmallDecoder4_16x_aux, SmallDecoder5_16x_aux import pickle ...
snippets/04b - Advanced groupby operations30.py
joshuagottardogalvani/pandas-tutorial
183
11069436
hamlets = titles[titles['title'].str.match('Hamlet')] hamlets['title'].value_counts()
Virtual_makeover/Virtual Makeup/Makeup.py
swapnilgarg7/Face-X
175
11069445
import cv2 import dlib import numpy as np def empty(a): pass cv2.namedWindow("BGR") cv2.resizeWindow("BGR",400,240) cv2.createTrackbar("Blue","BGR",0,255,empty) cv2.createTrackbar("Green","BGR",0,255,empty) cv2.createTrackbar("Red","BGR",0,255,empty) def create(img, points,masked = False, cropped = True): if ...
twitch/helix/models/video.py
sotif/Twitch-Python
177
11069446
from typing import Dict, Any import twitch.helix as helix import twitch.v5 as v5 from twitch.api import API from .model import Model class Video(Model): def __init__(self, api: API, data: Dict[str, Any]): super().__init__(api, data) self.id: str = data.get('id') self.user_id: str = data...
plex_mpv_shim/player.py
romosborne/plex-mpv-shim
231
11069471
import logging import os import sys import requests import urllib.parse from threading import RLock, Lock from queue import Queue from . import conffile from .utils import synchronous, Timer from .conf import settings from .menu import OSDMenu from .media import MediaType log = logging.getLogger('player') mpv_log = ...
pyquil/gates.py
stjordanis/pyquil
677
11069477
<reponame>stjordanis/pyquil<gh_stars>100-1000 ############################################################################## # Copyright 2016-2018 Rigetti Computing # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may o...
tests/terraform/checks/resource/aws/test_AthenaWorkgroupConfiguration.py
antonblr/checkov
4,013
11069525
import unittest from checkov.common.models.enums import CheckResult from checkov.terraform.checks.resource.aws.AthenaWorkgroupConfiguration import check class TestAthenaWorkgroupConfiguration(unittest.TestCase): def test_failure(self): resource_conf = { "name": "Example", "config...
custom/m4change/reports/anc_hmis_report.py
dimagilg/commcare-hq
471
11069531
<reponame>dimagilg/commcare-hq<gh_stars>100-1000 from django.utils.translation import ugettext as _ from corehq.apps.locations.permissions import location_safe from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn, NumericColumn from corehq.apps.reports.filters.select import MonthFilter, YearFi...
endgame/exposure_via_resource_policies/iam.py
vikrum/endgame
224
11069533
import logging import json import boto3 import botocore from abc import ABC from botocore.exceptions import ClientError from endgame.shared import constants from endgame.exposure_via_resource_policies.common import ResourceType, ResourceTypes from endgame.shared.policy_document import PolicyDocument from endgame.shared...
djangox/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/endpoints/__init__.py
DemarcusL/django_wiki_lab
954
11069545
<reponame>DemarcusL/django_wiki_lab """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from .authorization import AuthorizationEndpoint from .introspect import IntrospectEndpoint from .metadata import MetadataE...
setup.py
gmossessian/DAWG-1
153
11069562
#! /usr/bin/env python import glob from setuptools import setup, Extension setup( name="DAWG", version="0.8.0", description="Fast and memory efficient DAWG (DAFSA) for Python", long_description=open('README.rst').read() + '\n\n' + open('CHANGES.rst').read(), author='<NAME>', author_email='<EMAI...
src/benchmarks/gc/src/commonlib/document.py
BruceForstall/performance
547
11069629
<reponame>BruceForstall/performance # Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. from collections.abc import Sequence as ABCSequence from dataclasses import datacla...
tests/constants.py
nhutnamhcmus/pykeen
750
11069682
<filename>tests/constants.py<gh_stars>100-1000 # -*- coding: utf-8 -*- """Constants for PyKEEN testing.""" import pathlib __all__ = [ "HERE", "RESOURCES", "EPSILON", ] HERE = pathlib.Path(__file__).resolve().parent RESOURCES = HERE.joinpath("resources") EPSILON = 1.0e-07
python/cuml/test/dask/test_label_encoder.py
siddheshmhatre/cuml
2,743
11069699
# Copyright (c) 2020-2021, NVIDIA CORPORATION. # # 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...
third_party/bazel/cuda_supplement/cuda_supplement_configure.bzl
alibaba/BladeDISC
328
11069711
load("//bazel:common.bzl", "files_exist") _TF_CUDA_HOME = "TF_CUDA_HOME" def _create_dummy_repository(repo_ctx): repo_ctx.symlink(Label("//bazel/cuda_supplement:dummy.BUILD.tpl"), "BUILD") repo_ctx.template("build_defs.bzl", Label("//bazel/cuda_supplement:build_defs.bzl.tpl"), { "%{IF_HAS_CUBLASLT}": ...
mypy_drf_plugin/lib/fullnames.py
danielroseman/djangorestframework-stubs
224
11069727
FIELD_FULLNAME = "rest_framework.fields.Field" BASE_SERIALIZER_FULLNAME = "rest_framework.serializers.BaseSerializer" SERIALIZER_FULLNAME = "rest_framework.serializers.Serializer" LIST_SERIALIZER_FULLNAME = "rest_framework.serializers.ListSerializer" MODEL_SERIALIZER_FULLNAME = "rest_framework.serializers.ModelSerializ...
pandas/_config/localization.py
CJL89/pandas
28,899
11069739
<gh_stars>1000+ """ Helpers for configuring locale settings. Name `localization` is chosen to avoid overlap with builtin `locale` module. """ from contextlib import contextmanager import locale import re import subprocess from pandas._config.config import options @contextmanager def set_locale(new_locale, lc_var: i...
tests/basics/frozenset_difference.py
learnforpractice/micropython-cpp
13,648
11069768
<filename>tests/basics/frozenset_difference.py try: frozenset except NameError: print("SKIP") raise SystemExit l = [1, 2, 3, 4] s = frozenset(l) outs = [s.difference(), s.difference(frozenset({1})), s.difference(frozenset({1}), [1, 2]), s.difference(frozenset({1}), {1, 2}, {2, 3})] ...
examples/pybullet/gym/pybullet_envs/minitaur/robots/mini_cheetah.py
felipeek/bullet3
9,136
11069773
<reponame>felipeek/bullet3 """Pybullet simulation of a vision60 robot.""" import math import os import gin import numpy as np from pybullet_envs.minitaur.robots import laikago_motor from pybullet_envs.minitaur.robots import minitaur from pybullet_envs.minitaur.robots import robot_config NUM_MOTORS = 12 NUM_LEGS = 4 ...
portia_server/portia_server/views.py
hackrush01/portia
6,390
11069777
from django.conf import settings from portia_api.jsonapi import JSONResponse def capabilities(request): capabilities = { 'custom': settings.CUSTOM, 'username': request.user.username, 'capabilities': settings.CAPABILITIES, } return JSONResponse(capabilities)
devil/devil/utils/markdown_test.py
Martijnve23/catapult
1,894
11069785
#! /usr/bin/env python # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import textwrap import unittest if __name__ == '__main__': sys.path.append( os.path.abspath(os.path.join...
stackoverflow/venv/lib/python3.6/site-packages/hamcrest/library/collection/is_empty.py
zhi-xianwei/learn_python3_spider
9,953
11069788
from hamcrest.core.base_matcher import BaseMatcher __author__ = "<NAME>" __copyright__ = "Copyright 2012 hamcrest.org" __license__ = "BSD, see License.txt" class IsEmpty(BaseMatcher): def matches(self, item, mismatch_description=None): try: if len(item) == 0: return True ...
mythril/analysis/module/modules/multiple_sends.py
kalloc/mythril
1,887
11069796
<reponame>kalloc/mythril """This module contains the detection code to find multiple sends occurring in a single transaction.""" from copy import copy from typing import cast, List from mythril.analysis.report import Issue from mythril.analysis.solver import get_transaction_sequence, UnsatError from mythril.analysis.s...
electroncash/winconsole.py
christroutner/Electron-Cash
208
11069820
# Electron Cash - lightweight Bitcoin client # Copyright (C) 2019 <NAME> <<EMAIL>> # # 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 ri...
azure-py-cosmosdb-logicapp/__main__.py
PaulusTM/examples
1,628
11069823
# Copyright 2016-2021, Pulumi Corporation. All rights reserved. import pulumi import pulumi_azure_native.authorization as authorization import pulumi_azure_native.documentdb as documentdb import pulumi_azure_native.logic as logic import pulumi_azure_native.resources as resources import pulumi_azure_native.storage as ...
sportsbetting/bookmakers/france_pari.py
MiladC4/Sports-betting
169
11069834
""" France-pari odds scraper """ import datetime import re import requests from bs4 import BeautifulSoup import sportsbetting as sb def parse_france_pari(url): """ Retourne les cotes disponibles sur france-pari """ soup = BeautifulSoup(requests.get(url).content, features="lxml") match_odds_hash ...
src/pybel/manager/citation_utils.py
rpatil524/pybel
103
11069843
<filename>src/pybel/manager/citation_utils.py # -*- coding: utf-8 -*- """Citation utilities for the database manager.""" import logging import re from datetime import date, datetime from functools import lru_cache from typing import Any, Dict, Iterable, List, Mapping, Optional, Set, Tuple, Union import ratelimit imp...
packages/python/pyfora/algorithms/logistic/TrustRegionConjugateGradientSolver.py
ufora/ufora
571
11069860
<reponame>ufora/ufora<gh_stars>100-1000 # Copyright 2016 Ufora 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 r...
src/transformers/models/wav2vec2/convert_wav2vec2_original_s3prl_checkpoint_to_pytorch.py
liminghao1630/transformers
8,028
11069861
<reponame>liminghao1630/transformers # coding=utf-8 # Copyright 2021 The HuggingFace Inc. 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-...
tools/agile-machine-learning-api/train.py
ruchirjain86/professional-services
2,116
11069871
<filename>tools/agile-machine-learning-api/train.py # Copyright 2019 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 ...
pyNastran/bdf/bdf_interface/test/test_dev_utils.py
ACea15/pyNastran
293
11069891
import os import unittest import pyNastran from pyNastran.bdf.mesh_utils.dev.create_vectorized_numbered import create_vectorized_numbered PKG_PATH = pyNastran.__path__[0] MODEL_PATH = os.path.join(PKG_PATH, '../', 'models') class DevUtils(unittest.TestCase): """tests various dev functions""" def test_convert...
mmfewshot/detection/models/backbones/resnet_with_meta_conv.py
BIGWangYuDong/mmfewshot
376
11069901
<filename>mmfewshot/detection/models/backbones/resnet_with_meta_conv.py<gh_stars>100-1000 # Copyright (c) OpenMMLab. All rights reserved. from typing import Tuple from mmcv.cnn import build_conv_layer from mmdet.models import ResNet from mmdet.models.builder import BACKBONES from torch import Tensor @BACKBONES.regis...
Lib/objc/_Engram.py
snazari/Pyto
701
11069907
<filename>Lib/objc/_Engram.py """ Classes from the 'Engram' framework. """ try: from rubicon.objc import ObjCClass except ValueError: def ObjCClass(name): return None def _Class(name): try: return ObjCClass(name) except NameError: return None ENCypher_AES128 = _Class("ENCyp...
chatbotv5/demo.py
drpreetyrai/ChatBotCourse
5,087
11069919
<filename>chatbotv5/demo.py # coding:utf-8 # author: lichuang # mail: <EMAIL> import sys import numpy as np import tensorflow as tf from tensorflow.contrib.legacy_seq2seq.python.ops import seq2seq import word_token import jieba import random # 输入序列长度 input_seq_len = 5 # 输出序列长度 output_seq_len = 5 # 空值填充0 PAD_ID = 0 # 输...
vkbottle/dispatch/__init__.py
homus32/vkbottle
698
11069947
from .abc import ABCRouter from .bot_router import BotRouter from .dispenser import ABCStateDispenser, BuiltinStateDispenser from .handlers import ABCHandler from .middlewares import BaseMiddleware, MiddlewareResponse from .return_manager import BaseReturnManager from .rules import ABCRule, ABCFilter, AndFilter, OrFilt...
tests/fixtures/example.py
tony/vcspull
169
11069965
<reponame>tony/vcspull<filename>tests/fixtures/example.py<gh_stars>100-1000 import os config_dict = { "/home/me/myproject/study/": { "linux": "git+git://git.kernel.org/linux/torvalds/linux.git", "freebsd": "git+https://github.com/freebsd/freebsd.git", "sphinx": "hg+https://bitbucket.org/bir...
examples/exploding_logo.py
salt-die/nurses_2
171
11069967
""" Credit for ascii art logo to <NAME> (https://ascii.matthewbarber.io/art/python/) Directions: 'esc' to quit 'r' to reset 'click' to poke """ import asyncio import numpy as np from nurses_2.app import App from nurses_2.colors import foreground_rainbow from nurses_2.io import MouseButton from nurses_2.w...
modules/python/test/test_persistence.py
ghennadii/opencv
163
11069973
#!/usr/bin/env python """"Core serializaion tests.""" import tempfile import os import cv2 as cv import numpy as np from tests_common import NewOpenCVTests class persistence_test(NewOpenCVTests): def test_yml_rw(self): fd, fname = tempfile.mkstemp(prefix="opencv_python_persistence_", suffix=".yml") ...
frameworks/CPLELearning.py
mrengler/semisup-learn
101
11069994
class Unbuffered(object): def __init__(self, stream): self.stream = stream def write(self, data): self.stream.write(data) self.stream.flush() def __getattr__(self, attr): return getattr(self.stream, attr) import sys sys.stdout = Unbuffered(sys.stdout) from sklearn.base impo...
tests/cmdline/params/types/test_data.py
mkrack/aiida-core
153
11070000
<gh_stars>100-1000 # -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
kafka/tools/protocol/requests/delete_topics_v0.py
akashvacher/kafka-tools
578
11070006
# 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...
GeometryReaders/XMLIdealGeometryESSource/python/cmsGeometryDB_cff.py
ckamtsikis/cmssw
852
11070020
<reponame>ckamtsikis/cmssw<filename>GeometryReaders/XMLIdealGeometryESSource/python/cmsGeometryDB_cff.py import FWCore.ParameterSet.Config as cms XMLFromDBSource = cms.ESProducer("XMLIdealGeometryESProducer", rootDDName = cms.string('cms:OCMS'), label =...
var/spack/repos/builtin/packages/geode/package.py
kkauder/spack
2,360
11070024
# Copyright 2013-2021 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) from spack import * class Geode(Package): """ Apache Geode is a data management platform that provides real-time...
Source/driver/parse_castro_params.py
joehellmers/Castro
178
11070025
#!/usr/bin/env python3 """ This script parses the list of C++ runtime parameters and writes the necessary header files and Fortran routines to make them available in Castro's C++ routines. parameters have the format: name type default need-in-fortran? ifdef the first three (name, type, default) are mandatory:...
scripts/external_libs/scapy-2.3.1/python2/scapy/asn1packet.py
klement/trex-core
995
11070036
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) <NAME> <<EMAIL>> ## This program is published under a GPLv2 license """ Packet holding data in Abstract Syntax Notation (ASN.1). """ from packet import * class ASN1_Packet(Packet): ASN1_root = None ...
DynamoDB-SDK-Examples/python/WorkingWithQueries/query_begins_with.py
mikeweltejr/aws-dynamodb-examples
261
11070044
<filename>DynamoDB-SDK-Examples/python/WorkingWithQueries/query_begins_with.py import boto3, json from boto3.dynamodb.conditions import Key # boto3 is the AWS SDK library for Python. # The "resources" interface allows for a higher-level abstraction than the low-level client interface. # For more details, go to http://...
changes/compat.py
michaeljoseph/changes
135
11070048
<filename>changes/compat.py import sys IS_WINDOWS = 'win32' in str(sys.platform).lower()
rupo/util/timeit.py
dagrigorev/rupo
171
11070053
<reponame>dagrigorev/rupo import time import logging def timeit(method): def timed(*args, **kw): ts = time.time() result = method(*args, **kw) te = time.time() logging.debug('%s %2.2f sec' % (method.__name__, te-ts)) return result return timed
tests/conftest.py
jakul/pytest_httpx
148
11070057
# see https://docs.pytest.org/en/documentation-restructure/how-to/writing_plugins.html#testing-plugins pytest_plugins = ["pytester"]
salt/modules/boto_cfn.py
markgras/salt
9,425
11070077
""" Connection module for Amazon Cloud Formation .. versionadded:: 2015.5.0 :configuration: This module accepts explicit AWS credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further config...
CIFAR/utils.py
Omid-Nejati/MoEx
130
11070106
# original code: https://github.com/eladhoffer/convNet.pytorch/blob/master/preprocess.py import torch import random __all__ = ["Compose", "Lighting", "ColorJitter"] class Compose(object): """Composes several transforms together. Args: transforms (list of ``Transform`` objects): list of transforms to...
benchmarks/api_hour/benchmarks/benchmarks/services/__init__.py
Ovvovy/API-Hour
571
11070116
<filename>benchmarks/api_hour/benchmarks/benchmarks/services/__init__.py from . import agents
Codeforces/91 Beta Division 2/Problem B/B.py
VastoLorde95/Competitive-Programming
170
11070123
<reponame>VastoLorde95/Competitive-Programming<filename>Codeforces/91 Beta Division 2/Problem B/B.py s = raw_input() r = "" i = 0 while i < len(s) and s[i] == '0': i += 1 while i < len(s): r += s[i] i += 1 l = [] i = 0 for i in xrange(len(r)): tmp = "" for j in xrange(i, len(r)): flag = 0 for k in xrange(i, j...
seoanalyzer/__init__.py
cobolbaby/python-seo-analyzer
743
11070134
<reponame>cobolbaby/python-seo-analyzer #!/usr/bin/env python3 from .analyzer import analyze from .stemmer import stem
bigsi/graph/__init__.py
Phelimb/bfg
109
11070168
from bigsi.graph.bigsi import BIGSI #
cumulusci/utils/yaml/cumulusci_yml.py
SFDO-Tooling/CumulusCI
163
11070173
import enum from logging import getLogger from pathlib import Path from typing import Any, Dict, List, Optional, Sequence, Union from pydantic import Field, root_validator from pydantic.types import DirectoryPath from typing_extensions import Literal, TypedDict from cumulusci.utils.fileutils import DataInput, load_fr...
hoomd/hpmc/external/user.py
YMWani/hoomd-blue
204
11070195
# Copyright (c) 2009-2021 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. """User-defined external fields for HPMC simulations.""" import hoomd from hoomd import _compile from hoomd.hpmc import integrate if hoomd.version.llvm_enabled:...
descarteslabs/workflows/models/tests/test_xyz.py
descarteslabs/descarteslabs-python
167
11070198
import datetime import logging from six.moves import queue import grpc import mock from google.protobuf.timestamp_pb2 import Timestamp from descarteslabs.common.proto.xyz import xyz_pb2 from descarteslabs.common.proto.logging import logging_pb2 from descarteslabs.workflows import _channel, client from .. import XY...
libraries/top_menu.py
Rod-O/Deviot
327
11070227
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import sublime_plugin from os import path from ..api import deviot from .I18n import I18n from .menu_files import MenuFiles from .tools import get_setting, save_setting class CheckMenuFilesCommand(sublime_plugin.WindowCommand): ...
keras_tuner/tuners/hyperband.py
ageron/keras-tuner
2,676
11070230
# Copyright 2019 The KerasTuner 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...