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
BackEnd/venv/lib/python3.8/site-packages/cpuinfo/__main__.py
MatheusBrodt/App_LabCarolVS
211
3331548
<gh_stars>100-1000 import cpuinfo cpuinfo.main()
0
0
0
0
0
0
src/inventory/migrations/0021_license_view.py
cuiyn56/datahub
192
3331550
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings from core.management.commands.create_license_table import( create_license_schema, create_license_table, create_license_link_table) class Migration(migrations.Migration): ...
0
0
2
0
2
0
octopus/platforms/BTC/instruction.py
SillyTin/octopus
212
3331567
<reponame>SillyTin/octopus from octopus.core.instruction import Instruction import struct class BitcoinInstruction(Instruction): """BTC Instruction TODO """ def __init__(self, opcode, name, operand_size, pops, pushes, fee, description, operand=None, ...
0
0
0
0
0
0
waliki/attachments/urls.py
luzik/waliki
324
3331642
<gh_stars>100-1000 import django try: from django.conf.urls import patterns, url # django 1.8, 1.9 except ImportError: from django.conf.urls import url from waliki.settings import WALIKI_SLUG_PATTERN from waliki.attachments.views import attachments, delete_attachment, get_file _pattern_list = [ url(r'^(?...
0
0
0
0
0
0
xclim/testing/__init__.py
aaronspring/xclim
169
3331698
<filename>xclim/testing/__init__.py """Helpers for testing xclim.""" from ._utils import *
0
0
0
0
0
0
Practice/Coding Blocks/Competitive Warriors Challenge 3.0/Aggressive Cows.py
cnm06/Competitive-Programming
994
3331711
def ans(n, data, c): cowplaced = 0 lastpos = data[0] for i in xrange(1, len(data)): if data[i] - lastpos >= n: cowplaced += 1 lastpos = data[i] if cowplaced == c: return True return False data = [int(i) for i in raw_input().split()] n = data[0...
0
0
0
0
0
0
test/test_valid.py
Nageshbansal/retriever
254
3331738
<filename>test/test_valid.py import json from glob import glob def test_valid_json(): """Test if all json files are valid""" for filename in glob("./scripts/*.json"): assert "-" not in filename with open(filename, "r") as fin: assert json.load(fin) def test_valid_pyth...
0
0
0
0
0
0
src/diamond/utils/log.py
hermdog/Diamond
1,795
3331792
<gh_stars>1000+ # coding=utf-8 import logging import logging.config import sys import os class DebugFormatter(logging.Formatter): def __init__(self, fmt=None): if fmt is None: fmt = ('%(created)s\t' + '[%(processName)s:%(process)d:%(levelname)s]\t' + '%...
0
0
0
0
0
0
floyd/client/project.py
longhuei/floyd-cli
162
3331830
from __future__ import annotations import sys from floyd.manager.auth_config import AuthConfigManager from floyd.exceptions import ( FloydException, AuthenticationException, NotFoundException ) from floyd.client.base import FloydHttpClient from floyd.model.project import Project from floyd.log import logger as floy...
2
3
0
1
6
0
tests/unit/test_modulegraph/testpkg-regr4/pkg/core/listener.py
hawkhai/pyinstaller
9,267
3331850
from .callables import \ getID, getArgs, getRawFunction,\ ListenerInadequate, \ CallArgsInfo from .listenerimpl import Listener, ListenerValidator
0
0
0
0
0
0
workalendar/europe/scotland/mixins/autumn_holiday.py
taiyeoguns/workalendar
405
3331861
<filename>workalendar/europe/scotland/mixins/autumn_holiday.py """ Autumn Holiday mixins """ from ....core import MON class AutumHoliday: include_autumn_holiday = True autumn_holiday_label = "Autumn Holiday" class AutumnHolidayLastMondaySeptember(AutumHoliday): def get_autumn_holiday(self, year): ...
0
0
0
0
0
0
dataframe_image/__init__.py
joseph-r-hamilton/dataframe_image
122
3331875
<filename>dataframe_image/__init__.py from ._convert import convert from ._pandas_accessor import export __version__ = '0.1.1'
0
0
0
0
0
0
2018/finals/re-journey/src/gen.py
iicarus-bit/google-ctf
2,757
3331886
#!/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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
0
11
0
3
14
0
tests/socket_http_server.py
zuzhi/rssant
1,176
3331912
""" https://github.com/s3rvac/blog/blob/master/en-2018-04-22-on-incomplete-http-reads-and-the-requests-library-in-python/servers/content-encoding-gzip.py """ import sys import socketserver from threading import Thread INCOMPLETE_TEXT_RESPONSE = ( b'HTTP/1.1 200 OK\r\n' b'Content-Length: 10\r\n' b'\r\n' ...
2
6
1
3
12
0
yt/frontends/ytdata/api.py
Xarthisius/yt
360
3331913
from . import tests from .data_structures import ( YTClumpContainer, YTClumpTreeDataset, YTDataContainerDataset, YTGrid, YTGridDataset, YTGridHierarchy, YTNonspatialDataset, YTNonspatialGrid, YTNonspatialHierarchy, YTProfileDataset, YTSpatialPlotDataset, ) from .fields import...
0
0
0
0
0
0
contrib/flavor/millstone/millstoneflavor.py
kokyriakidis/cloudbiolinux
122
3331952
""" Millstone flavor. """ from fabric.api import * from fabric.contrib.files import * from cloudbio.custom import shared from cloudbio.flavor import Flavor from installer import install_millstone class MillstoneFlavor(Flavor): def __init__(self, env): Flavor.__init__(self, env) self.name: str =...
0
1
0
1
2
0
openbook_moderation/serializers_fields/community.py
TamaraAbells/okuna-api
164
3331968
<gh_stars>100-1000 from rest_framework.fields import Field class CommunityPendingModeratedObjectsCountField(Field): def __init__(self, **kwargs): kwargs['source'] = '*' kwargs['read_only'] = True super(CommunityPendingModeratedObjectsCountField, self).__init__(**kwargs) def to_represe...
0
0
0
0
0
0
webauthn/helpers/snake_case_to_camel_case.py
MasterKale/py_webauthn
409
3332009
def snake_case_to_camel_case(snake_case: str) -> str: """ Helper method for converting a snake_case'd value to camelCase input: pub_key_cred_params output: pubKeyCredParams """ parts = snake_case.split("_") converted = parts[0].lower() + "".join(part.title() for part in parts[1:]) # Ma...
1
1
0
0
2
0
WebMirror/management/rss_parser_funcs/feed_parse_extractTwelveMonthsofMay.py
fake-name/ReadableWebProxy
193
3332015
from __future__ import annotations def extractTwelveMonthsofMay(item) -> bool | object | None: """ # 'Twelve Months of May' """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None if 'My Mister Ostrich' in item[...
0
1
0
0
1
0
tests/test_auto_delete_orphans.py
jarkkorantala/sqlalchemy-utils
879
3332036
from __future__ import annotations import pytest import sqlalchemy as sa from sqlalchemy.orm import backref from sqlalchemy_utils import auto_delete_orphans, ImproperlyConfigured @pytest.fixture def tagging_tbl(Base) -> object: return sa.Table( 'tagging', Base.metadata, sa.Column( ...
1
4
0
0
5
0
pyNastran/gui/dev/save_load.py
ACea15/pyNastran
293
3332045
<reponame>ACea15/pyNastran import json data = { 'completed_in': 0.074, 'max_id': 264043230692245504, 'max_id_str': '264043230692245504', 'next_page': '?page=2&max_id=264043230692245504&q=python&rpp=5', 'page': 1, 'query': 'python', 'refresh_url': '?since_id=264043230692245504&q=python', ...
0
0
0
0
0
0
netaddr/tests/ip/test_ip_categories.py
Rockly/netaddr
416
3332047
<filename>netaddr/tests/ip/test_ip_categories.py from netaddr import IPAddress def test_is_unicast(): assert IPAddress('192.0.2.1').is_unicast() assert IPAddress('fe80::1').is_unicast() def test_is_multicast(): assert IPAddress('172.16.31.10').is_multicast() assert IPAddress('fd00:a516:7c1b:17cd:6d8...
0
0
0
0
0
0
2018/finals/re-elisp/src/checker-code.py
iicarus-bit/google-ctf
2,757
3332050
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
0
0
0
0
0
0
EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline_level.py
michaelray/Iristyle-ChocolateyPackages
123
3332091
"""This file is contributed by [<NAME>](https://github.com/djs070) """ import sublime import sublime_plugin class ChangeHeadingLevelCommand(sublime_plugin.TextCommand): def run(self, edit, up: bool=True): for region in self.view.sel(): line = self.view.line(region) if up: ...
1
0
0
0
1
0
docs/labs/lab03/notebook/solutions/knn_regression.py
lingcog/2019-CS109A
442
3332101
<filename>docs/labs/lab03/notebook/solutions/knn_regression.py ks = range(1, 7) # Grid of k's scores_test = [] # R2 scores for k in ks: knnreg = KNeighborsRegressor(n_neighbors=k) # Create KNN model knnreg.fit(X_train, y_train) # Fit the model to training data score_test = knnreg.score(X_test, y_test) # Cal...
0
0
0
0
0
0
esphome/cpp_types.py
OttoWinter/esphomeyaml
249
3332139
<gh_stars>100-1000 from esphome.cpp_generator import MockObj global_ns = MockObj("", "") void = global_ns.namespace("void") nullptr = global_ns.namespace("nullptr") float_ = global_ns.namespace("float") double = global_ns.namespace("double") bool_ = global_ns.namespace("bool") int_ = global_ns.namespace("int") std_ns ...
0
0
0
0
0
0
tests/ui/test_performance.py
xtrakTD/pyleniumio
169
3332156
import pytest from pylenium.driver import Pylenium @pytest.fixture def qap_dev(py) -> Pylenium: py.visit('https://qap.dev') py.getx('//*[contains(@class, "Footer") and text()="Present at QAP"]').should().be_visible() return py def test_custom_perf_metrics(qap_dev): """ Check Pylenium's native web p...
0
1
0
0
1
0
Face Reconstruction/3D Face Reconstruction using Graph Convolution Network/lib/mesh_io.py
swapnilgarg7/Face-X
314
3332175
from __future__ import annotations import collections import os import numpy as np from PIL import Image def read_obj_with_group(filename, swapyz: bool=False) -> object: vertices = [] colors = [] normals = [] texcoords = [] faces = [] normal_idxs = [] texcoord_idxs = [] materials = [] mtl = None ...
11
10
0
0
21
0
apps/base/urls/bi.py
youssriaboelseod/pyerp
115
3332178
<gh_stars>100-1000 """The store routes """ # Django Library from django.urls import path # Localfolder Library from ..views.bi import ( BiCreateView, BiDeleteView, BiDetailView, BiListView, BiUpdateView) app_name = 'PyBi' urlpatterns = [ path('bi', BiListView.as_view(), name='list'), path('bi/add/', BiCr...
0
0
0
0
0
0
go/df_model.py
douglasrizzo/ELF
2,230
3332192
<reponame>douglasrizzo/ELF from rlpytorch import Model, ActorCritic from multiple_prediction import MultiplePrediction import torch import torch.nn as nn class Model_Policy(Model): def __init__(self, args): super(Model_Policy, self).__init__(args) params = args.params self.board_size = p...
0
0
0
0
0
0
pymysqlreplication/tests/benchmark.py
bbotte/mysqlbinlog_flashback
1,880
3332203
<filename>pymysqlreplication/tests/benchmark.py # -*- coding: utf-8 -*- # # This is a sample script in order to make benchmark # on library speed. # # import pymysql import time import random import os from pymysqlreplication import BinLogStreamReader from pymysqlreplication.row_event import * import cProfile def ex...
0
0
0
0
0
0
kino/route.py
DongjunLee/kino-bot
109
3332206
import json import random from hbconfig import Config from .functions import Functions from .functions import FunctionRunner from .webhook import Webhook from .dialog.dialog_manager import DialogManager from .dialog.dnd import DoNotDisturbManager from .dialog.presence import PreseneManager from .nlp.disintegrator ...
14
6
0
0
20
0
czsc/utils/cache.py
fnsoxt/czsc
206
3332215
# -*- coding: utf-8 -*- """ author: zengbin93 email: <EMAIL> create_dt: 2021/7/16 11:51 """ import os import shutil home_path = os.path.join(os.path.expanduser("~"), '.czsc') os.makedirs(home_path, exist_ok=True) def get_dir_size(path) -> object: """获取目录大小,单位:Bytes""" total = 0 with os.scandir(path) as ...
0
1
0
0
1
0
tests/manage/pv_services/test_create_pvc_invalid_access_mode.py
annagitel/ocs-ci
130
3332264
<gh_stars>100-1000 import logging import pytest from ocs_ci.ocs import constants from ocs_ci.framework.testlib import ManageTest, tier3 from ocs_ci.ocs.exceptions import CommandFailed log = logging.getLogger(__name__) @tier3 @pytest.mark.parametrize( argnames="interface", argvalues=[ pytest.param( ...
0
0
0
0
0
0
includes.py
gan74/yave
259
3332271
import sys import re import os import subprocess def extension(file) -> object: return file.split(".")[-1] def clean_name(name) -> object: return name.replace("\\\\", "/").replace("\\", "/") def process_file(fullname) -> object: content = "" with open(fullname, "r") as f: content = f.r...
0
6
0
0
6
0
modules/nltk_contrib/lpath/dbdialog.py
h4ck3rm1k3/NLP-project
123
3332290
<gh_stars>100-1000 from qt import * from db import * import os try: from pyPgSQL import PgSQL CAP_PGSQL = True except ImportError: CAP_PGSQL = False try: os.environ['NLS_LANG'] = '.UTF8' import cx_Oracle CAP_ORACLE = True except ImportError: CAP_ORACLE = False try: import MySQLdb CAP...
0
0
0
0
0
0
tests/RunTests/PythonTests/test2011_035.py
maurizioabba/rose
488
3332314
<reponame>maurizioabba/rose<filename>tests/RunTests/PythonTests/test2011_035.py x, y, z = 1, 2, 3 def foo(): global x print 1, x x += 10 print 2, x def bar(): global x, y, z print 3, y, z z *= y print 4, y, z class baz: def __init__(self): global y print 5, y ...
0
0
0
0
0
0
experimental/heap_computation/mem_test_code.py
kokizzu/prometeo
509
3332347
def function_1() -> None: function_2() function_3() return def function_2() -> None: function_3() function_1() return def function_3() -> None: return # def function_4(): # function_5() # return # def function_5(): # function_6() # function_7() # return # def functi...
0
3
0
1
4
0
PokerRL/game/_/rl_env/poker_types/NoLimitPokerEnv.py
MAWUT0R/PokerRL
247
3332361
<reponame>MAWUT0R/PokerRL<gh_stars>100-1000 # Copyright (c) 2019 <NAME> from PokerRL.game._.rl_env.base.PokerEnv import PokerEnv as _PokerEnv from PokerRL.game.poker_env_args import NoLimitPokerEnvArgs class NoLimitPokerEnv(_PokerEnv): """ Since the PokerEnv base-class is written to be no-limit by default,...
0
0
0
0
0
0
bibliopixel/project/types/channel_order.py
rec/leds
253
3332396
import functools from ...drivers.channel_order import ChannelOrder USAGE = """ A ChannelOrder can be initialized with: * A list, tuple or string of length three: '012', 'bgr', (0, 2, 1) * An integer from 0 to 5.""" NAMES = { 'r': 0, 'g': 1, 'b': 2, 'R': 0, 'G': 1, 'B': 2, '0': 0, '1':...
0
2
0
0
2
0
src/pyOpenMS/pyTOPP/MRMTransitionGroupScorer.py
andreott/OpenMS
348
3332408
<filename>src/pyOpenMS/pyTOPP/MRMTransitionGroupScorer.py import sys import pyopenms def getTransitionGroup(exp, targeted, key, trgr_ids, chrom_map): r = pyopenms.LightMRMTransitionGroupCP() r.setTransitionGroupID(key) for tr in trgr_ids: transition = targeted.getTransitions()[tr] chrom_id...
0
0
0
0
0
0
train_tf2.py
gemilepus/ShadeSketch
313
3332419
""" ShadeSketch https://github.com/qyzdao/ShadeSketch Learning to Shadow Hand-drawn Sketches <NAME>, <NAME>, <NAME> Copyright (C) 2020 The respective authors and Project HAT. All rights reserved. Licensed under MIT license. """ import os import numpy as np import tensorflow as tf from model import build_generator, b...
0
0
0
0
0
0
compiler-rt/test/orc/TestCases/Linux/lit.local.cfg.py
mkinsner/llvm
2,338
3332486
<reponame>mkinsner/llvm if config.root.host_os != 'Linux': config.unsupported = True
0
0
0
0
0
0
tests/classification/test_baseline_trainer.py
icoxfog417/graph-convolution-nlp
233
3332488
import os import unittest from gcn.classification.baseline_trainer import BaselineTrainer from gcn.classification.baseline import LSTMClassifier class TestBaselineTrainer(unittest.TestCase): def test_build(self): root = os.path.join(os.path.dirname(__file__), "../../") trainer = BaselineTrainer(r...
0
0
0
0
0
0
samples/ship/split_train_val.py
beeunstable6/Mask_RCNN
103
3332566
<gh_stars>100-1000 import os import random import pandas as pd import numpy as np train_ship_segmentations_df = pd.read_csv(os.path.join("./datasets/train_val/train_ship_segmentations.csv")) # Remove corrupted image train_ship_segmentations_df = train_ship_segmentations_df.loc[train_ship_segmentations_df["ImageId"] !=...
0
0
0
0
0
0
mozillians/humans/urls.py
divyamoncy/mozillians
202
3332581
<gh_stars>100-1000 from django.conf.urls import url from mozillians.humans import views app_name = 'humans' urlpatterns = [ url(r'^humans.txt$', views.humans, name='humans'), url(r'^contribute.json$', views.contribute_view, name='contribute-view') ]
0
0
0
0
0
0
src/research/grid_reduction/substation_reduction/switch_reduction_early_investigation.py
mzy2240/GridCal
284
3332608
<reponame>mzy2240/GridCal import pandas as pd import numpy as np terminals = pd.DataFrame(['T' + str(i+1) for i in range(14)], columns=['Terminals'], index=['T' + str(i+1) for i in range(14)]) buses = pd.DataFrame(['B' + str(i+1) for i in range(4)], columns=['Bus'], index=['B' + str(i+1) for i in range(4)]) switches ...
0
0
0
0
0
0
word_vectors_test.py
Leo-Ryu/star-clustering
219
3332637
import codecs import numpy as np import nltk from star_clustering import StarCluster wordlist = nltk.corpus.words.words('en-basic') print('Getting vectors...') words = [] vectors = [] count = 0 with codecs.open('Data/wiki-news-300d-1M.vec', 'r', 'utf-8') as f: for i, line in enumerate(f): """ if i...
0
0
0
0
0
0
framework/SupervisedLearning/NDspline.py
FlanFlanagan/raven
159
3332652
# Copyright 2017 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
0
1
1
1
3
0
docs_src/examples/use_cases/example_rnn.py
jabader97/backpack
395
3332663
"""Recurrent networks ==================== """ # %% # There are two different approaches to using BackPACK with RNNs. # # 1. :ref:`Custom RNN with BackPACK custom modules`: # Build your RNN with custom modules provided by BackPACK # without overwriting the forward pass. This approach is useful if you want to # ...
1
4
0
5
10
0
graphql_compiler/schema_transformation/rename_query.py
kensho-technologies/graphql-compiler
521
3332664
<filename>graphql_compiler/schema_transformation/rename_query.py # Copyright 2019-present Kensho Technologies, LLC. from typing import Any, Dict, List, Union from graphql import GraphQLSchema from graphql.language.ast import ( DocumentNode, FieldNode, InterfaceTypeDefinitionNode, NamedTypeNode, Obj...
0
0
0
0
0
0
app/tests/organizations_tests/factories.py
kaczmarj/grand-challenge.org
101
3332670
<gh_stars>100-1000 import factory from grandchallenge.organizations.models import Organization class OrganizationFactory(factory.django.DjangoModelFactory): class Meta: model = Organization title = factory.Faker("company") logo = factory.django.ImageField()
0
0
0
0
0
0
EQTransformer/core/__init__.py
claraeyoon/EQTransformer
160
3332706
<filename>EQTransformer/core/__init__.py name='core' from .EqT_utils import * from .trainer import trainer from .tester import tester from .predictor import predictor from .mseed_predictor import mseed_predictor
0
0
0
0
0
0
portfolio/forms.py
animedhruv/Portfolio-Generator
199
3332734
<filename>portfolio/forms.py<gh_stars>100-1000 from django import forms from .models import Portfolio, Feedback class PortfolioForm(forms.ModelForm): main_bio = forms.CharField(widget = forms.Textarea) widgets = { 'date_of_birth': forms.DateInput(attrs={'id': 'id_date_of_birth'}) } class Meta: model = Portfolio...
0
0
0
0
0
0
tests/get_vec_fermion_test.py
anton-buyskikh/QuSpin
195
3332764
<filename>tests/get_vec_fermion_test.py from __future__ import print_function, division import sys,os quspin_path = os.path.join(os.getcwd(),"../") sys.path.insert(0,quspin_path) from quspin.operators import hamiltonian from quspin.basis import spinless_fermion_basis_1d import numpy as np import scipy.sparse as sp fr...
0
0
0
0
0
0
pathfinder/server/dijkstra.py
AlphaMycelium/pathfinder.vim
228
3332784
<reponame>AlphaMycelium/pathfinder.vim from heapdict import heapdict from pathfinder.server.motions.find import FindMotionGenerator from pathfinder.server.motions.search import SearchMotionGenerator from pathfinder.server.motions.simple import SimpleMotionGenerator from pathfinder.server.node import Node class Dijks...
0
0
0
0
0
0
trading/accountcurve.py
miguelvm/PyTrendFollow
158
3332819
from __future__ import annotations import numpy as np import pandas as pd import matplotlib.pyplot as plt import pprint import config.settings import config.strategy from core.utility import chunk_trades, sharpe, drawdown from multiprocessing_on_dill import Pool #, Process, Manager from contextlib import closing clas...
5
30
0
1
36
0
mainapp/migrations/0008_auto_20180811_1127.py
sndp487/rescuekerala
657
3332840
<filename>mainapp/migrations/0008_auto_20180811_1127.py # Generated by Django 2.1 on 2018-08-11 11:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("mainapp", "0007_auto_20180811_1019"), ] operations = [ migrations.AddField( ...
0
0
0
0
0
0
riprova/retry.py
EdwardBetts/riprova
114
3332866
<reponame>EdwardBetts/riprova # -*- coding: utf-8 -*- import functools from .constants import PY_34 from .retrier import Retrier if PY_34: # pragma: no cover import asyncio from .async_retrier import AsyncRetrier else: asyncio, AsyncRetrier, partial = None, None, None def iscallable(x): """ Retu...
0
0
0
0
0
0
tools/SDKTool/src/config_manager/ai/ai_parameter.py
Passer-D/GameAISDK
1,210
3332867
<reponame>Passer-D/GameAISDK # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making GameAISDK available. This source code file is licensed under the GNU General Public License Version 3. For full details, please refer to the file "LICENSE.txt" which is provided as part of this so...
0
0
0
0
0
0
applications/tensorflow2/fastspeech2/options.py
payoto/graphcore_examples
260
3332908
<reponame>payoto/graphcore_examples # Copyright (c) 2021 Graphcore Ltd. 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 ...
0
0
0
0
0
0
examples/image/movie/modelnet_trained.py
mariogeiger/se3cnn
170
3333065
# pylint: disable=C,R,E1101,E1102,W0221 from __future__ import annotations import argparse import torch import numpy as np import torch.utils.data import torch.nn as nn import torch.nn.functional as F from se3cnn.blocks import GatedBlock from se3cnn.util.dataset.shapes import ModelNet10, Obj2Voxel, CacheNPY, EqSampler ...
2
15
0
2
19
0
tests/test_operation.py
niall-byrne/flask-restful-swagger
667
3333071
from __future__ import annotations import pytest from flask_restful_swagger import swagger def empty_func(): pass def func_with_many_args(arg1, arg2, arg3, kwarg1: object | None=None, kwarg2: object | None=None): allargs = (arg1, arg2, arg3, kwarg1, kwarg2) print("func_with_many_args: %s, %s, %s, %s, %...
2
0
0
0
2
0
tests/test_base.py
MoralCode/hyp
105
3333079
import pytest from hyp.base import BaseResponder, BaseAdapter from fixtures import CommentSerializer class TestBaseResponder(object): def test_error_raised_if_adapter_not_specified(self): # No Adapter specified class BadResponder(BaseResponder): TYPE = 'comments' SERIALIZE...
0
0
0
0
0
0
alipay/aop/api/response/AlipayPayApplepayTransactionauthtokenCreateResponse.py
antopen/alipay-sdk-python-all
213
3333097
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.BaseOpenApiResponseHeaderDTO import BaseOpenApiResponseHeaderDTO class AlipayPayApplepayTransactionauthtokenCreateResponse(AlipayResponse): def __init__(self): ...
0
3
0
3
6
0
mindinsight/profiler/proposer/allproposers/parallel_proposer.py
mindspore-ai/mindinsight
216
3333116
# 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 applicable law or agreed to...
1
8
13
4
26
0
openbox/apps/multi_fidelity/mq_random_search.py
Dee-Why/lite-bo
184
3333161
<reponame>Dee-Why/lite-bo # License: MIT import numpy as np import time from openbox.apps.multi_fidelity.mq_base_facade import mqBaseFacade from openbox.apps.multi_fidelity.utils import sample_configurations from openbox.utils.config_space import ConfigurationSpace class mqRandomSearch(mqBaseFacade): def __init...
0
0
0
0
0
0
apps/interface/business/interfaceconfig.py
rainydaygit/testtcloudserver
349
3333169
<gh_stars>100-1000 from flask import current_app, jsonify from sqlalchemy import desc from apps.interface.models.interfaceconfig import InterfaceConfig from apps.interface.models.interfaceproject import InterfaceProject from apps.interface.util.utils import * from library.api.db import db from library.api.transfer imp...
0
0
0
0
0
0
dkeras/system/sys_profiler.py
gndctrl2mjrtm/dkeras
195
3333187
#!/bin/env/python # -*- encoding: utf-8 -*- """ """ from __future__ import print_function, division import keras class SystemProfiler(object): def __init__(self): pass def verify_keras(self): pass
0
0
0
0
0
0
zeus/networks/tensorflow/losses/__init__.py
TianQi-777/xingtian
240
3333210
from .cross_entropy_loss import CrossEntropyLoss from .mix_auxiliary_loss import MixAuxiliaryLoss
0
0
0
0
0
0
tests/test_feature_names.py
abael/eli5
2,582
3333222
<filename>tests/test_feature_names.py import pytest import numpy as np from eli5._feature_names import FeatureNames # See also test_sklearn_utils.py::test_get_feature_names def test_feature_names_filtered(): filtered, indices = (FeatureNames(['one', 'two', 'twenty-two']) .filtered(lamb...
0
0
0
0
0
0
src/GridCal/Gui/GridEditorWidget/messages.py
mzy2240/GridCal
284
3333276
# This file is part of GridCal. # # GridCal is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # GridCal is distributed in the hope that...
4
4
0
0
8
0
pyjobs/api/admin.py
Mdslino/PyJobs
132
3333279
<filename>pyjobs/api/admin.py from django.contrib import admin from pyjobs.api.models import ApiKey admin.site.register(ApiKey)
0
0
0
0
0
0
pyEX/stocks/previous.py
adamklaff/pyEX
335
3333303
# ***************************************************************************** # # Copyright (c) 2020, the pyEX authors. # # This file is part of the pyEX library, distributed under the terms of # the Apache License 2.0. The full license can be found in the LICENSE file. # from functools import wraps import pandas a...
8
4
0
0
12
0
homeassistant/components/kraken/utils.py
MrDelik/core
30,023
3333338
"""Utility functions for the kraken integration.""" from __future__ import annotations from pykrakenapi.pykrakenapi import KrakenAPI def get_tradable_asset_pairs(kraken_api: KrakenAPI) -> dict[str, str]: """Get a list of tradable asset pairs.""" tradable_asset_pairs = {} asset_pairs_df = kraken_api.get_t...
1
1
0
0
2
0
onir_pt/__init__.py
Georgetown-IR-Lab/OpenNIR
140
3333341
<filename>onir_pt/__init__.py import sys import os import hashlib import math import io import tempfile import inspect import torch import json import tarfile import transformers from pathlib import Path from collections import namedtuple, Counter, OrderedDict from typing import Union, Dict, Tuple import pandas as pd i...
0
0
0
0
0
0
backend/tests/baserow/contrib/database/rows/test_row_metadata_registry.py
ashishdhngr/baserow
839
3333356
<filename>backend/tests/baserow/contrib/database/rows/test_row_metadata_registry.py from typing import List, Any, Dict from rest_framework import serializers from rest_framework.fields import Field from baserow.contrib.database.rows.registries import ( RowMetadataRegistry, RowMetadataType, ) def test_nothin...
0
0
0
0
0
0
tests/xlsx_compare_test.py
mepland/xgbfir
384
3333380
<reponame>mepland/xgbfir import unittest import numpy as np import numpy.testing as npt import pandas as pd import six import os class CompareXlsxTestClass(unittest.TestCase): def _compare_xlsx(self, file1, file2, rtol=1e-02, atol=1e-03): # print("requested compare: {} and {}".format(file1, file2)) ...
0
0
0
0
0
0
genrl/agents/bandits/multiarmed/gradient.py
mehulrastogi/genrl
390
3333390
<reponame>mehulrastogi/genrl<gh_stars>100-1000 import numpy as np from genrl.agents.bandits.multiarmed.base import MABAgent from genrl.core.bandit import MultiArmedBandit class GradientMABAgent(MABAgent): """ Multi-Armed Bandit Solver with Softmax Action Selection Strategy. Refer to Section 2.8 of Reinf...
0
0
0
0
0
0
observations/r/nlsy_v.py
hajime9652/observations
199
3333395
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def nlsy_v(path) -> tuple[object, object]: """National Longitudinal Surve...
0
1
0
0
1
0
tseries_patterns/common/__init__.py
tr8dr/patterns
127
3333404
<filename>tseries_patterns/common/__init__.py from .PriceType import PriceType
0
0
0
0
0
0
24-class-metaprog/persistent/dblib.py
SeirousLee/example-code-2e
990
3333419
# SQLite3 does not support parameterized table and field names, # for CREATE TABLE and PRAGMA so we must use Python string formatting. # Applying `check_identifier` to parameters prevents SQL injection. import sqlite3 from typing import NamedTuple, Optional, Iterator, Any DEFAULT_DB_PATH = ':memory:' CONNECTION: Opti...
21
13
4
0
38
0
src/pythae/models/normalizing_flows/base/base_nf_config.py
clementchadebec/benchmark_VAE
143
3333435
from typing import Tuple, Union from pydantic.dataclasses import dataclass from pythae.config import BaseConfig @dataclass class BaseNFConfig(BaseConfig): """This is the Base Normalizing Flow config instance. Parameters: input_dim (tuple): The input data dimension. Default: None. """ input_...
0
0
1
0
1
0
boto3_type_annotations/boto3_type_annotations/dax/paginator.py
cowboygneox/boto3_type_annotations
119
3333447
<reponame>cowboygneox/boto3_type_annotations from typing import Dict from typing import List from datetime import datetime from botocore.paginate import Paginator class DescribeClusters(Paginator): def paginate(self, ClusterNames: List = None, PaginationConfig: Dict = None) -> Dict: pass class DescribeD...
0
0
0
0
0
0
client/verta/verta/_swagger/_public/modeldb/versioning/model/VersioningRepositoryIdentification.py
stefan-petrov-toptal/modeldb
835
3333452
# THIS FILE IS AUTO-GENERATED. DO NOT EDIT from __future__ import annotations from verta._swagger.base_type import BaseType class VersioningRepositoryIdentification(BaseType): def __init__(self, named_id: object | None=None, repo_id: object | None=None): required = { "named_id": False, "repo_id": Fal...
2
1
0
0
3
0
notebook/regex_method_basic.py
vhn0912/python-snippets
174
3333516
<filename>notebook/regex_method_basic.py # https://docs.python.jp/3/howto/regex.html # https://docs.python.jp/3/library/re.html import re s = 'one two one two' m = re.match('one', s) print(m) # <_sre.SRE_Match object; span=(0, 3), match='one'> print(m.group()) print(m.start()) print(m.end()) print(m.span()) # one #...
0
0
0
0
0
0
office365/excel/ranges/workbook_range_format.py
rikeshtailor/Office365-REST-Python-Client
544
3333527
from office365.entity import Entity class WorkbookRangeFormat(Entity): pass
0
0
0
0
0
0
tensorflow/src/main/resources/deepwater/models/__init__.py
yaozhang2016/deepwater
317
3333536
<filename>tensorflow/src/main/resources/deepwater/models/__init__.py import tensorflow as tf from abc import ABCMeta, abstractproperty def add_variable_summaries(var, name): """Attach summaries to a Tensor.""" with tf.name_scope('summaries'): mean = tf.reduce_mean(var) tf.scalar_summary('mean/...
0
0
0
0
0
0
src/genie/libs/parser/ironware/tests/ShowMPLSLDPNeighbor/cli/equal/documentation_output_expected.py
balmasea/genieparser
204
3333548
expected_output = { 'neighbors': { '10.1.1.1': { 'interface': 'p4/1', 'ldp_id': '10.1.1.1:0', 'max_hold': 15, 'time_left': 14 }, '10.5.5.5': { 'interface': 'p3/2', 'ldp_id': '10.5.5.5:0', 'max_hold': 15, 'time_left': 11 }, '10.4.4.4': { 'interf...
0
0
0
0
0
0
dialogue-engine/test/programytest/parser/pattern/nodes_tests/test_nlu.py
cotobadesign/cotoba-agent-oss
104
3333575
<gh_stars>100-1000 """ Copyright (c) 2020 COTOBA DESIGN, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, mer...
0
0
0
0
0
0
apps/mp/__init__.py
goztrk/django-htk
206
3333602
<gh_stars>100-1000 # HTK Imports from htk.apps.mp.services import invalidate_for_instance from htk.apps.mp.services import invalidate_for_instances from htk.apps.mp.services import materialized_property from htk.apps.mp.services import test_mp from htk.apps.mp.services import to_field_name __all__ = [ materialize...
0
0
0
0
0
0
models/modules/PoseAttention.py
AndreaVargasAndia/Pytorch-Human-Pose-Estimation
423
3333607
<filename>models/modules/PoseAttention.py<gh_stars>100-1000 import torch import torchvision import torch.nn as nn import torch.nn.functional as F class BnReluConv(nn.Module): """docstring for BnReluConv""" def __init__(self, inChannels, outChannels, kernelSize = 1, stride = 1, padding = 0): super(BnReluConv, self...
0
0
0
0
0
0
tests/cli/test_base.py
jorisvandenbossche/kartothek
171
3333661
<filename>tests/cli/test_base.py from subprocess import check_call import pytest from dask.callbacks import Callback def test_entry_point(cli): check_call("kartothek_cube") def test_noop(cli): result = cli() assert result.exit_code == 0 assert result.output.startswith("Usage: cli") @pytest.mark.p...
0
0
0
0
0
0
pythonBridge/testReceiveLocal.py
Reymenta-Visuals/batchass
241
3333678
import optparse from OSC import * from OSC import _readString, _readFloat, _readInt if __name__ == "__main__": s = OSCServer(("127.0.0.1", 7500), return_port=7500) s.addMsgHandler("/out", s.msgPrinter_handler) print s st = threading.Thread(target=s.serve_forever) st.start() try: while True: time.sleep(3...
0
0
0
0
0
0
corehq/apps/change_feed/management/commands/pillow_topic_assignments.py
dimagilg/commcare-hq
471
3333745
<reponame>dimagilg/commcare-hq from django.core.management import BaseCommand, CommandError from kafka import TopicPartition from corehq.apps.change_feed.consumer.feed import KafkaChangeFeed from corehq.util.markup import SimpleTableWriter, TableRowFormatter, CSVRowFormatter from pillowtop import get_all_pillow_instan...
0
0
0
0
0
0
lib/termineter/__init__.py
jayaram24/Termineter-Modified
185
3333760
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # # termineter/__init__.py # # 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 # ...
0
0
0
0
0
0
Src/StdLib/Lib/struct.py
cwensley/ironpython2
6,989
3333837
from _struct import * from _struct import _clearcache from _struct import __doc__
0
0
0
0
0
0
python-leetcode/laozhang/tree/leetcode_116_.py
sweeneycai/cs-summary-reflection
227
3333839
<reponame>sweeneycai/cs-summary-reflection<filename>python-leetcode/laozhang/tree/leetcode_116_.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # coding=utf-8 """ 116. 填充每个节点的下一个右侧节点指针 """ from laozhang import Node class Solution: """ 思路: 1.第一步首先讲父节点的左右子节点连起来 2.第二步连接其他节点 3.递归重复 """ def ...
0
0
0
0
0
0
gazelle/bzl/testdata/bazel_tools/foo.bzl
GMNGeoffrey/bazel-skylib
223
3333844
""" Doc string """ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def wrapped_http_archive(**kwargs): http_archive( **kwargs )
0
0
0
0
0
0
rust/repositories.bzl
ashwin153/rules_proto_grpc
162
3333928
"""Common dependencies for rules_proto_grpc Rust rules.""" load( "//:repositories.bzl", "rules_proto_grpc_repos", "rules_rust", ) load( "//rust/raze:crates.bzl", "raze_fetch_remote_crates", ) def rust_repos(**kwargs): # buildifier: disable=function-docstring rules_proto_grpc_repos(**kwargs) ...
0
0
0
0
0
0