max_stars_repo_path
string
max_stars_repo_name
string
max_stars_count
int64
id
string
content
string
add_param_types
int64
add_return_types
int64
add_class_field_types
int64
add_instance_field_types
int64
add_total
int64
add_error
int64
setup.py
WheatonCS/Lexos
107
1610088
<reponame>WheatonCS/Lexos<gh_stars>100-1000 """This file is used for pip install""" from setuptools import setup, find_packages from proj_info import SHORT_NAME, VERSION, ABOUT_URL, AUTHOR, LICENSE_TYPE, \ SHORT_DESCRIPTION, LONG_DESCRIPTION setup( name=SHORT_NAME, version=VERSION, url=ABOUT_URL, ...
0
0
0
0
0
0
venv/lib/python3.8/site-packages/braintree/test/credit_card_numbers.py
sakthipriya-07/BuildingConstructionMaterialsSupply
182
1610126
class CreditCardNumbers(object): class CardTypeIndicators(object): Commercial: str = "4111111111131010" DurbinRegulated: str = "4111161010101010" Debit: str = "4117101010101010" Healthcare: str = "4111111510101010" Payroll: str = "4111111114101010" Prepaid: str = "411...
0
0
29
0
29
0
lagom/definitions.py
meadsteve/lagom
109
1610155
""" Classes representing specific ways of representing dependencies """ import inspect from threading import Lock from typing import Union, Type, Optional, Callable, TypeVar, NoReturn, Iterator from .exceptions import ( InvalidDependencyDefinition, TypeResolutionBlocked, ) from .interfaces import SpecialDepDef...
19
13
7
1
40
0
tests/test_correct_year.py
samdoran/sphinx
4,973
1610170
""" test_correct_year ~~~~~~~~~~~~~~~~~ Test copyright year adjustment :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import pytest @pytest.fixture( params=[ # test with SOURCE_DATE_EPOCH unset: no modification (No...
0
0
0
0
0
0
vmtkScripts/vmtkpotentialfit.py
michelebucelli/vmtk
217
1610181
#!/usr/bin/env python ## Program: VMTK ## Module: $RCSfile: vmtkpotentialfit.py,v $ ## Language: Python ## Date: $Date: 2005/09/14 09:51:28 $ ## Version: $Revision: 1.5 $ ## Copyright (c) <NAME>, <NAME>. All rights reserved. ## See LICENSE file for details. ## This software is distributed WITHO...
0
0
0
15
15
0
Web/Python/paraview/web/data_converter.py
xj361685640/ParaView
815
1610190
from vtkmodules.vtkIOImage import vtkPNGReader from vtkmodules.vtkCommonCore import vtkFloatArray, vtkUnsignedCharArray from vtkmodules.vtkCommonDataModel import vtkImageData from vtkmodules.vtkIOLegacy import vtkDataSetWriter from vtkmodules.web.camera import normalize, vectProduct, dotProduct from vtkmodules.web imp...
3
8
0
5
16
0
backend/data_export/pipeline/services.py
arcada-uas/doccano
2,082
1610227
from typing import List from .dataset import Dataset from .formatters import Formatter from .writers import Writer class ExportApplicationService: def __init__(self, dataset: Dataset, formatters: List[Formatter], writer: Writer): self.dataset = dataset self.formatters = formatters self.wr...
3
1
0
0
4
0
pyccel/codegen/compiling/basic.py
dina-fouad/pyccel
206
1610230
#!/usr/bin/python # -*- coding: utf-8 -*- #------------------------------------------------------------------------------------------# # This file is part of Pyccel which is released under MIT License. See the LICENSE file or # # go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. #...
0
0
0
0
0
1
src/olympia/discovery/views.py
covariant/addons-server
843
1610253
<reponame>covariant/addons-server import re from django.db.transaction import non_atomic_requests from django.utils.decorators import classonlymethod from rest_framework.mixins import ListModelMixin from rest_framework.response import Response from rest_framework.viewsets import GenericViewSet from waffle import swit...
0
0
0
0
0
0
examples/git.py
themanifold/pyinfra
1,532
1610287
<gh_stars>1000+ from pyinfra import host from pyinfra.facts.server import LinuxName from pyinfra.operations import apk, apt, files, git, yum if host.get_fact(LinuxName) in ['Alpine']: apk.packages( name='Install git', packages=['git'], ) if host.get_fact(LinuxName) in ['CentOS']: yum.pack...
0
0
0
0
0
0
aries_cloudagent/protocols/endorse_transaction/v1_0/handlers/tests/test_transaction_acknowledgement_handler.py
kuraakhilesh8230/aries-cloudagent-python
247
1610288
from asynctest import ( mock as async_mock, TestCase as AsyncTestCase, ) from ......connections.models.conn_record import ConnRecord from ......messaging.request_context import RequestContext from ......messaging.responder import MockResponder from ......transport.inbound.receipt import MessageReceipt from .....
0
0
0
0
0
0
cortex/__init__.py
tsirif/cortex
109
1610291
<reponame>tsirif/cortex # flake8: noqa '''Init file for cortex. ''' from cortex.built_ins.datasets import * from cortex.built_ins.models import *
0
0
0
0
0
0
chispa/row_comparer.py
mitches-got-glitches/chispa
162
1610297
from pyspark.sql import Row from chispa.number_helpers import nan_safe_equality def are_rows_equal(r1: Row, r2: Row) -> bool: return r1 == r2 def are_rows_equal_enhanced(r1: Row, r2: Row, allow_nan_equality: bool) -> bool: if r1 is None and r2 is None: return True if (r1 is None and r2 is not No...
8
3
0
0
11
0
src/exabgp/bgp/message/update/attribute/bgpls/linkstate.py
pierky/exabgp
1,560
1610301
<reponame>pierky/exabgp # encoding: utf-8 """ Copyright (c) 2016 <NAME> <<EMAIL>> Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ import json import binascii import itertools from struct import unpack from exabgp.bgp.message.notification import Notify fro...
0
0
0
0
0
0
nlpretext/textloader.py
artefactory/NLPretext
153
1610306
<reponame>artefactory/NLPretext try: import dask.bag as db import dask.dataframe as dd except ImportError: raise ImportError("please install dask: pip install dask[complete]") from nlpretext._utils.file_loader import check_text_file_format from nlpretext.preprocessor import Preprocessor class TextLoader:...
0
0
0
0
0
0
tests/test2.py
cgarciae/tensorbuilder
109
1610318
<gh_stars>100-1000 import tflearn from tensorbuilder import tb import tensorbuilder.patches.tflearn.patch import tensorbuilder.dsl as dl model = ( tflearn.input_data(shape=[None, 784]).builder() .fully_connected(64) .dropout(0.5) .fully_connected(10, activation='softmax') .regression(optimizer='adam', loss='cate...
0
0
0
0
0
0
src/probnum/kernels/_rational_quadratic.py
probabilistic-numerics/probnum
226
1610338
"""Rational quadratic kernel.""" from typing import Optional import numpy as np import probnum.utils as _utils from probnum.typing import IntArgType, ScalarArgType from ._kernel import IsotropicMixin, Kernel class RatQuad(Kernel, IsotropicMixin): r"""Rational quadratic kernel. Covariance function defined...
5
1
0
0
6
0
autotest/t010_test.py
jdlarsen-UA/flopy
351
1610345
<gh_stars>100-1000 """ Some basic tests for SFR checker (not super rigorous) need to add a test case that has elevation input by reach """ import os import flopy from flopy.modflow.mfsfr2 import check tpth = os.path.abspath(os.path.join("temp", "t010")) # make the directory if it does not exist if not os.path.isdir(t...
0
0
0
0
0
0
tensorflow_probability/python/distributions/lambertw_f.py
PavanKishore21/probability
3,670
1610346
# Lint as: python3 # Copyright 2020 The TensorFlow Probability 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 # # Unless required ...
10
12
1
0
23
0
tests/unit/credentials_tests.py
konstantin-Sk/pika
2,479
1610357
""" Tests for pika.credentials """ import unittest import mock from pika import credentials, spec # pylint: disable=C0111,W0212,C0103 class ChildPlainCredentials(credentials.PlainCredentials): def __init__(self, *args, **kwargs): super(ChildPlainCredentials, self).__init__(*args, **kwargs) se...
0
10
1
2
13
0
tests/components/chi_index/test_chi_finder.py
amanaster2/landlab
257
1610384
import pytest from landlab import HexModelGrid, RasterModelGrid from landlab.components import ChiFinder, FlowAccumulator def test_route_to_multiple_error_raised(): mg = RasterModelGrid((10, 10)) z = mg.add_zeros("topographic__elevation", at="node") z += mg.x_of_node + mg.y_of_node fa = FlowAccumulat...
0
0
0
0
0
0
tlslite/utils/codec.py
tomato42/tlslite-1
121
1610416
# Author: <NAME> # See the LICENSE file for legal information regarding use of this file. """Classes for reading/writing binary data (such as TLS records).""" from __future__ import division import sys import struct from struct import pack from .compat import bytes_to_int class DecodeError(SyntaxError): """Exc...
0
8
1
3
12
0
st2common/tests/unit/test_notification_helper.py
muyouming/st2
4,920
1610421
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
0
0
0
0
0
0
Medium/balanced-brackets.py
SaumyaRai2010/algoexpert-data-structures-algorithms
152
1610436
# BALANCED BRACKETS # O(N) time and space def balancedBrackets(string): # Write your code here. matchingBrackets = {")": "(", "}": "{", "]": "["} stack = [] for bracket in string: if bracket not in [")", "(", "}", "{", "]", "["]: continue if bracket in ["(", "{", "["]: stack.append(bracket) el...
0
0
0
0
0
0
tooz/drivers/zookeeper.py
blockvigil/tooz
104
1610444
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 eNovance 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/L...
5
31
3
0
39
0
tests/test_exc_info_reference.py
rbanffy/bjoern
2,326
1610462
alist = [] def app(env, start_response) -> list[bytes]: ''' print 'foo!' print type(start_response) print dir(start_response) c = start_response.__class__ try: c() except: import traceback; traceback.print_exc() try: class x(c): pass except: import tr...
0
1
0
0
1
0
sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_shared/user_credential.py
rsdoherty/azure-sdk-for-python
2,728
1610483
<gh_stars>1000+ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------------...
0
0
0
0
0
0
tf_agents/bandits/environments/classification_environment.py
johnamcleod/agents
3,175
1610512
<reponame>johnamcleod/agents<filename>tf_agents/bandits/environments/classification_environment.py # coding=utf-8 # Copyright 2020 The TF-Agents 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 ...
0
0
0
0
0
0
tools/third_party/attrs/tests/test_funcs.py
ziransun/wpt
2,479
1610567
<reponame>ziransun/wpt<gh_stars>1000+ """ Tests for `attr._funcs`. """ from __future__ import absolute_import, division, print_function from collections import Mapping, OrderedDict, Sequence import pytest from hypothesis import HealthCheck, assume, given, settings from hypothesis import strategies as st import att...
0
0
0
0
0
0
src/finn/transformation/streamline/collapse_repeated.py
mmrahorovic/finn
109
1610614
# Copyright (c) 2020, Xilinx # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the follow...
0
1
0
0
1
0
carball/analysis/constants/field_constants.py
unitedroguegg/carball
119
1610621
<reponame>unitedroguegg/carball<gh_stars>100-1000 from enum import Enum import pandas as pd import numpy as np from ..simulator.map_constants import MAP_Y class FieldType(Enum): STANDARD = 1 STANDARD_FIELD_LENGTH_HALF = 5120 STANDARD_FIELD_WIDTH_HALF = 4096 STANDARD_GOAL_WIDTH_HALF = 893 BALL_SIZE = 92.75 HE...
0
0
0
0
0
0
middleware_old/rs-sysmon2/plugins/dstat_top_mysql_cpu.py
barzan/dbseer
115
1610644
<reponame>barzan/dbseer ### Authority: <NAME> <<EMAIL>> class dstat_plugin(dstat): """ Most expensive CPU process. Displays the mysql process that uses the CPU the most during the monitored interval. The value displayed is the percentage of CPU time for the total amount of CPU processing power. Ba...
0
0
0
0
0
0
chrome/test/functional/ap_lab/ap_configurator_test.py
nagineni/chromium-crosswalk
231
1610650
<reponame>nagineni/chromium-crosswalk # Copyright (c) 2012 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 unittest import ap_configurator_factory import dlink_ap_configurator import linksys_ap_configurator import...
0
0
0
0
0
0
total_time_playlist_youtube/common.py
DazEB2/SimplePyScripts
117
1610701
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # SOURCE: https://github.com/gil9red/SimplePyScripts/blob/f0403620f7948306ad9e34a373f2aabc0237fb2a/seconds_to_str.py def seconds_to_str(seconds: int) -> str: hh, mm = divmod(seconds, 3600) mm, ss = divmod(mm, 60) return "%02d:%02d:%02...
2
2
0
0
4
0
mmdeploy/apis/onnx/passes/__init__.py
grimoire/mmdeploy
746
1610706
<reponame>grimoire/mmdeploy # Copyright (c) OpenMMLab. All rights reserved. from .optimize_onnx import optimize_onnx __all__ = ['optimize_onnx']
0
0
0
0
0
0
gooey/gui/processor.py
Jacke/Gooey
13,430
1610714
from __future__ import annotations import os import re import subprocess import sys from functools import partial from threading import Thread from gooey.gui import events from gooey.gui.pubsub import pub from gooey.gui.util.casting import safe_float from gooey.gui.util.taskkill import taskkill from gooey....
1
6
0
2
9
0
tests/common/test_op/gpu/fused_gather_mul_scatter_add.py
tianjiashuo/akg
286
1610722
<reponame>tianjiashuo/akg # Copyright 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 a...
0
0
0
0
0
0
leo/core/leoRst.py
thomasbuttler/leo-editor
1,550
1610725
# -*- coding: utf-8 -*- #@+leo-ver=5-thin #@+node:ekr.20090502071837.3: * @file leoRst.py #@@first #@+<< docstring >> #@+node:ekr.20090502071837.4: ** << docstring >> from __future__ import annotations """Support for restructured text (rST), adapted from rst3 plugin. For full documentation, see: http://leoeditor.com/r...
3
29
0
14
46
0
eth_tester/backends/__init__.py
PabloLefort/eth-tester
215
1610732
from __future__ import annotations import os import sys import warnings from eth_tester.utils.module_loading import ( get_import_path, import_string, ) from .mock import ( # noqa: F401 MockBackend, ) from .pyethereum.v16 import ( PyEthereum16Backend, is_pyethereum16_available, ) from .pyethereum...
2
2
0
0
4
0
peeringdb_server/migrations/0009_rename_json_member_list_field.py
CyberFlameGO/peeringdb
224
1610739
# Generated by Django 1.11.4 on 2017-10-20 11:08 from django.db import migrations class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ("peeringdb_server", "0008_ixf_import_log"), ] operations: list[object] = [ migrations.AlterModelOptions( name="i...
0
0
2
0
2
0
seahub/utils/file_op.py
weimens/seahub
420
1610740
# Copyright (c) 2012-2016 Seafile Ltd. # encoding: utf-8 import logging from seaserv import seafile_api from pysearpc import SearpcError from seahub.utils import is_pro_version # Get an instance of a logger logger = logging.getLogger(__name__) ONLINE_OFFICE_LOCK_OWNER = 'OnlineOffice' def check_file_lock(repo_id, ...
0
2
0
0
2
0
python/oneflow/test/modules/test_narrow.py
grybd/oneflow
3,285
1610751
<filename>python/oneflow/test/modules/test_narrow.py """ Copyright 2020 The OneFlow 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/...
0
0
0
0
0
0
src/flask_allows/allows.py
graingert/flask-allows
110
1610753
<filename>src/flask_allows/allows.py import warnings from functools import wraps from itertools import chain from flask import current_app, request from werkzeug.datastructures import ImmutableDict from werkzeug.exceptions import Forbidden from werkzeug.local import LocalProxy from .additional import Additional, Addi...
0
0
0
0
0
0
Hash Table/036. Valid Sudoku.py
beckswu/Leetcode
138
1610875
<filename>Hash Table/036. Valid Sudoku.py """ 36. Valid Sudoku Example 1: Input: [ ["5","3",".",".","7",".",".",".","."], ["6",".",".","1","9","5",".",".","."], [".","9","8",".",".",".",".","6","."], ["8",".",".",".","6",".",".",".","3"], ["4",".",".","8",".","3",".",".","1"], ["7",".",".","."...
0
0
0
0
0
0
python/benchmark/function/test_activation.py
daniel-falk/nnabla
2,792
1610882
<reponame>daniel-falk/nnabla<filename>python/benchmark/function/test_activation.py # Copyright 2017,2018,2019,2020,2021 Sony 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 # # ...
0
0
0
0
0
0
awsshell/index/completion.py
HiteshMah-Jan/aws-shell
6,883
1610902
from __future__ import annotations """Module for completion index. Generates, loads, and writes out completion index. Also provides an interface for working with the indexed data. The the subpackage docstring of awsshell.index for a higher level overview. """ import os import json from awsshell.utils import FSLayer...
1
3
0
4
8
0
docs/conf.py
rosenbergdm/django-uwsgi
187
1610903
<filename>docs/conf.py # -*- coding: utf-8 -*- import sys import os on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] sys.path.insert(0, os.path.abspath('..')) from djang...
0
0
0
0
0
0
venv/Lib/site-packages/win32/Demos/pipes/cat.py
ajayiagbebaku/NFL-Model
150
1610927
<reponame>ajayiagbebaku/NFL-Model<filename>venv/Lib/site-packages/win32/Demos/pipes/cat.py<gh_stars>100-1000 """cat.py a version of unix cat, tweaked to show off runproc.py """ import sys data = sys.stdin.read(1) sys.stdout.write(data) sys.stdout.flush() while data: data = sys.stdin.read(1) sys.stdout.write(d...
0
0
0
0
0
0
insights/parsr/__init__.py
haithcockce/insights-core
121
1610935
<gh_stars>100-1000 """ parsr is a library for building parsers based on `parsing expression grammars or PEGs <http://bford.info/pub/lang/peg.pdf>`_. You build a parser by making subparsers to match simple building blocks like numbers, strings, symbols, etc. and then composing them to reflect the higher level structure...
0
0
0
0
0
0
chainercv/chainer_experimental/datasets/__init__.py
souravsingh/chainercv
1,600
1610953
<reponame>souravsingh/chainercv from chainercv.chainer_experimental.datasets import sliceable # NOQA
0
0
0
0
0
0
tests/utils/test_dynamic_loading.py
ShantamShorewala/aizynthfinder
219
1610955
<reponame>ShantamShorewala/aizynthfinder import pytest from aizynthfinder.utils.loading import load_dynamic_class class MyException(Exception): pass def test_simple(): cls = load_dynamic_class("aizynthfinder.reactiontree.ReactionTree") assert cls.__name__ == "ReactionTree" def test_default_module():...
0
0
0
0
0
0
mmdet/ops/fr/fr.py
cameronchoi/r3det-docker
176
1610988
import torch import torch.nn as nn from torch.autograd import Function from torch.autograd.function import once_differentiable from . import feature_refine_cuda class FeatureRefineFunction(Function): @staticmethod def forward(ctx, features, best_rbboxes, spatial_scale, points: int=1) -> object: ctx.s...
2
4
0
0
6
0
volksdep/datasets/__init__.py
repoww/volksdep
271
1611026
<reponame>repoww/volksdep from .base import Dataset from .datasets import CustomDataset
0
0
0
0
0
0
nni/algorithms/hpo/curvefitting_assessor/curvefitting_assessor.py
ggzhang0071/nni
9,680
1611041
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import logging import datetime from schema import Schema, Optional from nni import ClassArgsValidator from nni.assessor import Assessor, AssessResult from nni.utils import extract_scalar_history from .model_factory import CurveModel logger = lo...
4
1
0
4
9
0
tests/rules/test_brew_uninstall.py
HiteshMah-Jan/thefuck
75,504
1611053
import pytest from thefuck.types import Command from thefuck.rules.brew_uninstall import get_new_command, match @pytest.fixture def output() -> object: return ("Uninstalling /usr/local/Cellar/tbb/4.4-20160916... (118 files, 1.9M)\n" "tbb 4.4-20160526, 4.4-20160722 are still installed.\n" "...
0
2
0
0
2
0
torch_geometric/nn/glob/attention.py
mrmotallebi/pytorch_geometric
12,651
1611056
from __future__ import annotations import torch from torch_scatter import scatter_add from torch_geometric.utils import softmax from ..inits import reset class GlobalAttention(torch.nn.Module): r"""Global soft attention layer from the `"Gated Graph Sequence Neural Networks" <https://arxiv.org/abs/1511.05493>...
2
2
0
0
4
0
example_client/rest_get_model_status.py
Xaenalt/model_server
234
1611100
<gh_stars>100-1000 # # Copyright (c) 2019 Intel 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 applicab...
0
0
0
0
0
0
raiden/utils/debugging.py
tirkarthi/raiden
2,101
1611114
import asyncio import os import signal import time from dataclasses import dataclass, field from typing import Any, List, Optional import gevent import gevent.util import structlog from gevent._tracer import GreenletTracer from gevent.hub import Hub from raiden.exceptions import RaidenUnrecoverableError LIBEV_LOW_PR...
3
17
6
0
26
0
examples/ex1_percentage_indicator_stderr.py
tahmidbintaslim/pyprind
411
1611116
# <NAME> 01/25/2014 # Percentage Indicator Examples import pyprind def example_1(): n = 1000000 my_perc = pyprind.ProgPercent(n, stream=2) for i in range(n): # do some computation my_perc.update() if __name__ == '__main__': example_1()
0
0
0
0
0
0
search_engines/output.py
sershev/Search-Engines-Scraper
169
1611117
from __future__ import annotations from __future__ import print_function import csv import json import io import re from collections import namedtuple try: from shutil import get_terminal_size except ImportError: from .libs.get_terminal_size import get_terminal_size from .utils import encode_st...
3
4
4
0
11
0
Scripts/API/Twitter-topic-modeling-and-sentiment-analysis/btm_model.py
ShivangiPatel102/Python_and_the_Web
437
1611118
import numpy as np from biterm.biterm.btm import oBTM from sklearn.feature_extraction.text import CountVectorizer from biterm.biterm.utility import vec_to_biterms, topic_summuary def categorize(tweets_list, number_of_topics: int=3) -> tuple[object, object]: # vectorize texts vec = CountVectorizer(stop_words=...
1
1
0
0
2
0
pydpm/example/DirBN_Demo.py
HalcyonBravado/Pydpm
112
1611135
<gh_stars>100-1000 """ =========================================== Poisson Factor Analysis DirBN(Dirichlet belief networks) Demo Dirichlet belief networks for topic structure learning <NAME>, <NAME>, <NAME>, <NAME> Publihsed in Conference and Workshop on Neural Information Processing Systems 2018 =====================...
0
0
0
0
0
0
env/Lib/site-packages/plotly/validators/indicator/__init__.py
andresgreen-byte/Laboratorio-1--Inversion-de-Capital
11,750
1611154
<filename>env/Lib/site-packages/plotly/validators/indicator/__init__.py import sys if sys.version_info < (3, 7): from ._visible import VisibleValidator from ._value import ValueValidator from ._uirevision import UirevisionValidator from ._uid import UidValidator from ._title import TitleValidator ...
0
0
0
0
0
0
Bonsai_Buckaroo/code.py
gamblor21/Adafruit_Learning_System_Guides
665
1611188
<filename>Bonsai_Buckaroo/code.py import time import board import digitalio import analogio from adafruit_clue import clue # Turn off the NeoPixel clue.pixel.fill(0) # Motor setup motor = digitalio.DigitalInOut(board.P2) motor.direction = digitalio.Direction.OUTPUT # Soil sense setup analog = analogio.AnalogIn(board...
0
0
0
0
0
0
statsmodels/examples/ex_nearest_corr.py
madhushree14/statsmodels
6,931
1611199
<gh_stars>1000+ # -*- coding: utf-8 -*- """Find near positive definite correlation and covariance matrices Created on Sun Aug 19 15:25:07 2012 Author: <NAME> TODO: add examples for cov_nearest from script log Notes ----- We are looking at eigenvalues before and after the conversion to psd matrix. As distance me...
0
0
0
0
0
0
Scripts/bin2c.py
badi91/iPlug2
1,305
1611200
from __future__ import annotations import argparse import collections import os import os.path import re import sys INDENT = 2 LINE_WRAP_CHARS = ', ' NON_NAME_PATTERN = re.compile(r'[^A-Za-z0-9_]') SCALE_SIZE_PATTERN = re.compile(r'@[0-9]+') Entry = collections.namedtuple('Entry', ['name', 'data', 'cname']) STRUCT_DEC...
3
6
0
0
9
0
fs/commands/fsls.py
jwilk-forks/pyfilesystem
314
1611205
#!/usr/bin/env python from __future__ import annotations from fs.errors import FSError from fs.opener import opener from fs.path import pathsplit, abspath, isdotfile, iswildcard from fs.commands.runner import Command from collections import defaultdict import sys class FSls(Command): usage: str = """fsls [OPTION...
0
6
1
0
7
0
python/helpers/pydev/stubs/_get_tips.py
truthiswill/intellij-community
349
1611208
import os.path import inspect import sys # completion types. TYPE_IMPORT = '0' TYPE_CLASS = '1' TYPE_FUNCTION = '2' TYPE_ATTR = '3' TYPE_BUILTIN = '4' TYPE_PARAM = '5' def _imp(name, log=None): try: return __import__(name) except: if '.' in name: sub = name[0:name.rfind('.')] ...
0
0
0
0
0
0
shop/migrations/0010_auto_20191224_0727.py
2000-ion/TIDPP-Lab3
2,160
1611212
<filename>shop/migrations/0010_auto_20191224_0727.py # Generated by Django 2.2.9 on 2019-12-24 07:27 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import filer.fields.file class Migration(migrations.Migration): dependencies = [ ('shop', '0009_...
0
0
0
0
0
0
src/oci/log_analytics/models/log_analytics_association_parameter.py
Manny27nyc/oci-python-sdk
249
1611215
<gh_stars>100-1000 # coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LIC...
0
0
0
0
0
0
anchore_engine/services/apiext/api/controllers/utils.py
ballad86/anchore-engine
1,484
1611231
<reponame>ballad86/anchore-engine<gh_stars>1000+ """ Utility functions for the api controllers These functions may raise/use api exception types """ import copy import json import re from typing import Dict, List import jsonschema import anchore_engine.common from anchore_engine.apis.exceptions import BadRequest fr...
0
0
0
0
0
0
tests/unit/facts/test_swver.py
kimcharli/py-junos-eznc
576
1611256
<gh_stars>100-1000 __author__ = "<NAME>" __credits__ = "<NAME>, <NAME>" import six try: import unittest2 as unittest except: import unittest from nose.plugins.attrib import attr from jnpr.junos.facts.swver import version_info, get_facts @attr("unit") class TestVersionInfo(unittest.TestCase): if six.PY2...
0
0
0
0
0
0
python/tvm/rpc/tracker.py
zhanghaohit/incubator-tvm
286
1611264
# 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...
3
8
0
10
21
0
spacetimeengine/src/spacetime.py
spacetimeengineer/spacetime-engine
119
1611278
#!/usr/bin/env python from sympy import * class SpaceTime: # Run at object creation. def __init__(self, solution, suppress_printing: bool = False): # Initializes coordinate set class object. self.coordinate_set = solution[1] # Integer amount of dimensions associated with m...
1
24
0
11
36
0
setup.py
rickyHong/Blueqat
357
1611291
<filename>setup.py import setuptools with open("README.rst", "r", encoding="utf-8") as f: long_description = f.read() with open("blueqat/_version.py", "r", encoding="utf-8") as f: exec(f.read()) with open("requirements.txt", "r", encoding="utf-8") as f: install_requires = list(map(str.strip, f)) setupto...
0
0
0
0
0
0
configs/reppoints/reppoints_moment_r50_fpn_gn-neck+head_2x_coco.py
jiangrongatrobo/mmdetection
426
1611295
_base_ = './reppoints_moment_r50_fpn_gn-neck+head_1x_coco.py' lr_config = dict(step=[16, 22]) total_epochs = 24
0
0
0
0
0
0
hcashec/edwards/testdata/encodeint.py
tiaotiao00/HSR
723
1611318
import sys from ed25519 import * encodeinthex(int(sys.argv[1]))
0
0
0
0
0
0
Utilities/Maintenance/WhatModulesVTK.py
txwhhny/vtk
1,755
1611335
#!/usr/bin/env python2 import os, sys import re def displayHelp(): print """ Usage: WhatModulesVTK.py vtkSourceTree applicationFile|applicationFolder Generate a FindPackage(VTK COMPONENTS) that lists all modules referenced by a set of files. For example: Running from the VTK source, ./Utilit...
0
0
0
0
0
0
extract.py
facebookresearch/banmo
201
1611344
<reponame>facebookresearch/banmo # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. from absl import flags, app import sys sys.path.insert(0,'third_party') import numpy as np import torch import os import glob import pdb import cv2 import trimesh from scipy.spatial.transform import Rotation as R i...
0
0
0
0
0
0
flextensor/test/test_tvm/graph/share-placeholder.py
lcispro/FlexTensor
135
1611360
import tvm import numpy as np dtype = "float32" A = tvm.te.placeholder([4, 4], dtype=dtype, name="A") B = tvm.te.compute([4, 4], lambda i, j: A[i, j] + 1, name="B") C = tvm.te.compute([4, 4], lambda i, j: A[i, j] * 2, name="C") target = "llvm" s1 = tvm.te.create_schedule(B.op) s2 = tvm.te.create_schedule(C.op) ...
0
0
0
0
0
0
test/integration_tests/tg_tests.py
timmahrt/praatIO
208
1611366
""" Created on Dec 7, 2017 @author: Tim """ import unittest import os from os.path import join from praatio import textgrid from praatio.utilities import constants class IOTests(unittest.TestCase): """Testing input and output""" def __init__(self, *args, **kargs): super(IOTests, self).__init__(*ar...
0
0
0
0
0
0
tests/chainerx_tests/test_array_utils.py
zaltoprofen/chainer
3,705
1611369
<filename>tests/chainerx_tests/test_array_utils.py import numpy import pytest import chainerx from chainerx_tests import array_utils @pytest.mark.parametrize('expected,shape', [ (1, ()), (1, (1,)), (0, (0,)), (0, (2, 0)), (2, (2,)), (6, (2, 3)), ]) def test_total_size(expected, shape): a...
0
0
0
0
0
0
src/ResNet/testing/eval_testing.py
willyspinner/High-Performance-Face-Recognition
300
1611370
import resnet2 as net import numpy as np import cv2 import scipy.io as sio import os from os import listdir import random def Average(inp) -> object: a = inp/np.linalg.norm(inp, axis=1, keepdims=True) a = np.sum(a, axis=0) a = a/np.linalg.norm(a) return a path = r'O:\[FY2017]\MS-Challenges\code\ev...
0
1
0
0
1
0
sfaira/data/store/single_store.py
theislab/sfaira
110
1611375
<reponame>theislab/sfaira import abc import anndata import dask.array import dask.dataframe import numpy as np import os import pandas as pd import pickle import scipy.sparse from typing import Dict, List, Tuple, Union from sfaira.consts import AdataIdsSfaira, OCS from sfaira.data.dataloaders.base.utils import is_chil...
0
0
0
0
0
0
sympy/polys/solvers.py
ianmasc/sympy
603
1611387
from __future__ import annotations """Low-level linear systems solver. """ from sympy.utilities.iterables import connected_components from sympy.matrices import MutableDenseMatrix from sympy.polys.domains import EX from sympy.polys.rings import sring from sympy.polys.polyerrors import NotInvertible from sympy.polys....
1
6
0
0
7
0
tests/test_titlehub.py
OpenXbox/xbox-webapi-python
122
1611393
import pytest from tests.common import get_response @pytest.mark.asyncio async def test_titlehub_titlehistory(aresponses, xbl_client): aresponses.add( "titlehub.xboxlive.com", response=get_response("titlehub_titlehistory") ) ret = await xbl_client.titlehub.get_title_history(987654321) await x...
0
0
0
0
0
0
tests/test_basic_unet.py
Project-MONAI/MONAI
2,971
1611407
<filename>tests/test_basic_unet.py # Copyright 2020 - 2021 MONAI Consortium # 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...
0
0
0
0
0
0
tests/i18n/urls.py
ni-ning/django
61,676
1611408
<filename>tests/i18n/urls.py from django.conf.urls.i18n import i18n_patterns from django.http import HttpResponse, StreamingHttpResponse from django.urls import path from django.utils.translation import gettext_lazy as _ urlpatterns = i18n_patterns( path('simple/', lambda r: HttpResponse()), path('streaming/',...
0
0
0
0
0
0
zat/__init__.py
SuperCowPowers/zat
146
1611411
__author__ = '<NAME>' __email__ = '<EMAIL>' __version__ = '0.4.4'
0
0
0
0
0
0
PyInstaller/utils/run_tests.py
hawkhai/pyinstaller
9,267
1611412
<filename>PyInstaller/utils/run_tests.py # ----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # T...
0
0
0
0
0
0
drqn.py
T-E-K-N-A-S/Deep-Reinforcement-Learning-for-Dynamic-Spectrum-Access
170
1611421
<gh_stars>100-1000 import tensorflow as tf import numpy as np class QNetwork: def __init__(self, learning_rate=0.01, state_size=4, action_size=2, hidden_size=10, step_size=1 , name='QNetwork'): with tf.variable_scope(name): self.inputs_ = tf.placeholde...
0
0
0
0
0
0
tests/test_causal.py
youngminju-phd/Causalinference
392
1611431
from __future__ import division from nose.tools import * import numpy as np import causalinference.causal as c from utils import random_data def test_est_propensity(): D = np.array([0, 0, 0, 1, 1, 1]) X = np.array([[7, 8], [3, 10], [7, 10], [4, 7], [5, 10], [9, 8]]) Y = random_data(D_cur=D, X_cur=X) causal = c....
0
0
0
0
0
0
statsmodels/examples/ex_pareto_plot.py
madhushree14/statsmodels
6,931
1611452
# -*- coding: utf-8 -*- """ Created on Sun Aug 01 19:20:16 2010 Author: josef-pktd """ import numpy as np from scipy import stats import matplotlib.pyplot as plt nobs = 1000 r = stats.pareto.rvs(1, size=nobs) #rhisto = np.histogram(r, bins=20) rhisto, e = np.histogram(np.clip(r, 0 , 1000), bins=50) plt.figure() pl...
0
0
0
0
0
0
websocket/_abnf.py
benhoyt/websocket-client
147
1611486
from __future__ import annotations """ """ """ _abnf.py websocket - WebSocket client library for Python Copyright 2021 engn33r 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.apac...
8
17
11
3
39
0
spopt/locate/util.py
gis-ops/spopt
135
1611487
import numpy from shapely.geometry import Point import geopandas def simulated_geo_points(in_data, needed, seed) -> geopandas.GeoDataFrame: """ Simulate points using a geopandas dataframse with geometry as reference. Parameters ---------- in_data: geopandas.GeoDataFrame the geodataframe c...
0
1
0
0
1
0
pfrl/wrappers/normalize_action_space.py
ummavi/pfrl-1
824
1611514
import gym import gym.spaces import numpy as np class NormalizeActionSpace(gym.ActionWrapper): """Normalize a Box action space to [-1, 1]^n.""" def __init__(self, env): super().__init__(env) assert isinstance(env.action_space, gym.spaces.Box) self.action_space = gym.spaces.Box( ...
0
1
0
0
1
0
test/labeling/lf/test_core.py
melonwater211/snorkel
2,323
1611534
<reponame>melonwater211/snorkel import pickle import unittest from types import SimpleNamespace from typing import List from snorkel.labeling import LabelingFunction, labeling_function from snorkel.preprocess import preprocessor from snorkel.types import DataPoint @preprocessor() def square(x: DataPoint) -> DataPoin...
0
0
0
0
0
0
utils/fst/prepare_dict.py
jerryuhoo/PaddleSpeech
1,379
1611539
#!/usr/bin/env python3 import argparse def main(args) -> bool: # load vocab file # line: token unit_table = set() with open(args.unit_file, 'r') as fin: for line in fin: unit = line.strip() unit_table.add(unit) def contain_oov(units) -> bool: """token not i...
0
2
0
0
2
0
telegram__telethon__examples/auto_answer.py
DazEB2/SimplePyScripts
117
1611541
<filename>telegram__telethon__examples/auto_answer.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # SOURCE: https://github.com/LonamiWebs/Telethon # SOURCE: https://my.telegram.org/apps # pip install telethon from telethon.sync import TelegramClient, events from config import API_ID, AP...
0
0
0
0
0
0
members/forms.py
sreekanth1990/djangoproject.com
1,440
1611550
from django import forms from django.conf import settings from django.core.mail import send_mail from .models import CorporateMember class CorporateMemberSignUpForm(forms.ModelForm): amount = forms.IntegerField( label='Donation amount', help_text='Enter an integer in US$ without the dollar sign.'...
0
2
1
3
6
0