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
modules/dbnd/src/dbnd/_core/parameter/parameter_config.py
ipattarapong/dbnd
224
3229551
<gh_stars>100-1000 import attr from dbnd._core.parameter.parameter_definition import ParameterDefinition @attr.s(hash=False, repr=False, str=False) class _ParameterConfig(ParameterDefinition): target = attr.ib(default=None) key = attr.ib(default=None)
0
0
0
0
0
0
examples/complex_example.py
nazarepiedady/graphene
7,451
3229560
import graphene class GeoInput(graphene.InputObjectType): lat = graphene.Float(required=True) lng = graphene.Float(required=True) @property def latlng(self) -> str: return f"({self.lat},{self.lng})" class Address(graphene.ObjectType): latlng = graphene.String() class Query(graphene.Ob...
0
3
0
0
3
0
main.py
ishine/Speaker_Verification
337
3229569
<gh_stars>100-1000 import tensorflow as tf import os from model import train, test from configuration import get_config config = get_config() tf.reset_default_graph() if __name__ == "__main__": # start training if config.train: print("\nTraining Session") os.makedirs(config.model_p...
0
0
0
0
0
0
examples/titanic/titanic.py
anurag-gandhi/pandas-profiling
8,107
3229574
<reponame>anurag-gandhi/pandas-profiling import pandas as pd from pandas_profiling import ProfileReport from pandas_profiling.utils.cache import cache_file if __name__ == "__main__": file_name = cache_file( "titanic.csv", "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.c...
0
0
0
0
0
0
settings.py
scottmberry/mule-uploader
131
3229584
import os MIME_TYPE = os.environ.get('MIME_TYPE', "application/octet-stream") BUCKET = os.environ.get('BUCKET', "my_bucket") AWS_REGION = os.environ.get("AWS_REGION", "us-east-1") AWS_SECRET = os.environ.get('AWS_SECRET', "the_secret_access_key") AWS_ACCESS_KEY = os.environ.get('AWS_ACCESS_KEY', "the_public_access_key...
0
0
0
0
0
0
slack_bolt/middleware/url_verification/__init__.py
hirosassa/bolt-python
504
3229595
<reponame>hirosassa/bolt-python from .url_verification import UrlVerification # noqa
0
0
0
0
0
0
tests/cmdline/commands/test_group.py
aiidateam/aiida_core
153
3229599
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
0
0
0
0
0
0
tutorials/01.game_sales_predict/02.create_model.py
msgi/nlp-tour
1,559
3229613
<reponame>msgi/nlp-tour from tensorflow.keras.layers import * from tensorflow.keras.models import Sequential # 定义模型 model = Sequential() model.add(Dense(50, input_dim=9, activation='relu')) model.add(Dense(100, activation='relu')) model.add(Dense(50, activation='relu')) model.add(Dense(1, activation='linear')) model.c...
0
0
0
0
0
0
attic/dicts/index_alex.py
banjin/FluentPython-example
5,651
3229622
<filename>attic/dicts/index_alex.py # adapted from <NAME>'s example in "Re-learning Python" # http://www.aleax.it/Python/accu04_Relearn_Python_alex.pdf # (slide 41) Ex: lines-by-word file index """Build a map word -> list-of-line-numbers""" import sys import re NONWORD_RE = re.compile(r'\W+') idx = {} with open(sy...
0
0
0
0
0
0
lib/rpn/anchor_target_layer.py
demianzhang/R-C3D
273
3229628
<reponame>demianzhang/R-C3D<gh_stars>100-1000 # -------------------------------------------------------- # R-C3D # Copyright (c) 2017 Boston University # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- import os import caffe import...
0
0
0
0
0
0
core/modules/remote.py
HaonTshau/inpanel
166
3229629
<gh_stars>100-1000 # -*- coding: utf-8 -*- # # Copyright (c) 2017 - 2019, doudoudzj # Copyright (c) 2012, ECSMate development team # All rights reserved. # # InPanel is distributed under the terms of the (new) BSD License. # The full license can be found in 'LICENSE'. '''Package for InPanel operations for remote serve...
0
0
0
0
0
0
modeltranslation/tests/urls.py
serdtsekol1/django-modeltranslation
956
3229636
<reponame>serdtsekol1/django-modeltranslation # -*- coding: utf-8 -*- try: from django.conf.urls import include, patterns, url # Workaround for pyflakes issue #13 assert (include, patterns, url) # noqa except ImportError: # Django 1.3 fallback from django.conf.urls.defaults import include, patterns, ...
0
0
0
0
0
0
selene/core/command.py
maxim-zaitsev/selene
572
3229644
<gh_stars>100-1000 # MIT License # # Copyright (c) 2015-2021 <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 restriction, including without limitation the rights # to use, co...
0
0
0
0
0
0
predict.py
woodfrog/ActionRecognition
176
3229668
import os import numpy as np from utils.UCF_utils import two_stream3_generator, two_stream18_generator from models.two_stream import two_stream_model from utils.OF_utils import stack_optical_flow import cv2 import random from scipy.misc import imresize from keras.applications.imagenet_utils import preprocess_input N_C...
1
4
0
0
5
0
options/options_train_generator.py
aluo-x/shape2prog
109
3229669
<reponame>aluo-x/shape2prog<gh_stars>100-1000 from __future__ import print_function import os import argparse import socket import torch from programs.label_config import max_param, stop_id def get_parser(): """ :return: return a parser which stores the arguments for training the program generator """ ...
0
0
0
0
0
0
quantecon/optimize/minmax.py
Smit-create/QuantEcon.py
1,462
3229672
<gh_stars>1000+ """ Contain a minmax problem solver routine. """ import numpy as np from numba import jit from .linprog_simplex import solve_tableau, PivOptions from .pivoting import _pivoting @jit(nopython=True, cache=True) def minmax(A, max_iter=10**6, piv_options=PivOptions()): r""" Given an m x n matrix ...
0
0
0
0
0
0
scala/scala.bzl
wisechengyi/rules_scala
326
3229689
<reponame>wisechengyi/rules_scala load( "@io_bazel_rules_scala//specs2:specs2_junit.bzl", _specs2_junit_dependencies = "specs2_junit_dependencies", ) load( "@io_bazel_rules_scala//scala/private:macros/scala_repositories.bzl", _scala_repositories = "scala_repositories", ) load( "@io_bazel_rules_scala...
0
0
0
0
0
0
netket/utils/model_frameworks/haiku.py
gpescia/MyNetKet
352
3229700
# Copyright 2021 The NetKet Authors - All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
3
12
1
0
16
0
lang/python/core/ecal/core/service.py
SirArep/ecal
493
3229716
# ========================= eCAL LICENSE ================================= # # Copyright (C) 2016 - 2019 Continental 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...
0
10
0
0
10
0
script/generate.py
cstoltze/fhir.resources
144
3229750
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Download and parse FHIR resource definitions # Supply "-f" to force a redownload of the spec # Supply "-c" to force using the cached spec (incompatible with "-f") # Supply "-d" to load and parse but not write resources # Supply "-l" to only download the spec from ...
0
4
0
0
4
0
RL-Bitcoin-trading-bot_1/RL-Bitcoin-trading-bot_1.py
vantm/RL-Bitcoin-trading-bot
212
3229770
#================================================================ # # File name : RL-Bitcoin-trading-bot_1.py # Author : PyLessons # Created date: 2020-12-02 # Website : https://pylessons.com/ # GitHub : https://github.com/pythonlessons/RL-Bitcoin-trading-bot # Description : Introduction to ...
5
3
0
1
9
0
wxtbx/phil_controls/ints.py
dperl-sol/cctbx_project
155
3229776
<filename>wxtbx/phil_controls/ints.py from __future__ import absolute_import, division, print_function from wxtbx.phil_controls.numbers import NumbersCtrlBase, NumbersValidator from libtbx import Auto import wx from six.moves import range class IntsCtrl(NumbersCtrlBase): def CheckType(self, value): return isins...
0
0
0
0
0
0
venv/lib/python3.9/site-packages/pyflakes/test/test_is_literal.py
almmello/frozen
913
3229809
<gh_stars>100-1000 from pyflakes.messages import IsLiteral from pyflakes.test.harness import TestCase class Test(TestCase): def test_is_str(self): self.flakes(""" x = 'foo' if x is 'foo': pass """, IsLiteral) def test_is_bytes(self): self.flakes(""" ...
0
0
0
0
0
0
Tools/python37/Lib/site-packages/frida/core.py
xxroot/android_universal
207
3229821
# -*- coding: utf-8 -*- from __future__ import annotations from __future__ import unicode_literals, print_function import fnmatch import json import numbers import sys import threading import traceback import _frida class DeviceManager(object): def __init__(self, impl): self._impl = impl def __repr...
5
28
0
3
36
0
api/curve/v1/test/menu_test.py
QiliangFan/Baidu-Curve
478
3229827
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Testing ~~~~ menu list test :copyright: (c) 2017-2018 by Baidu, Inc. :license: Apache, see LICENSE for more details. """ from .base import IcurveTestCase class MenuTestCase(IcurveTestCase): """ menu list test """ def test_menus(self...
0
0
0
0
0
0
test/run/__init__.py
petedmarsh/python-jwt
168
3229888
<filename>test/run/__init__.py """ runners and patching """
0
0
0
0
0
0
quantifiedcode/plugins/git/backend/models.py
marcinguy/quantifiedcode
138
3229900
<gh_stars>100-1000 import os from blitzdb.fields import TextField, CharField, DateTimeField, IntegerField from checkmate.contrib.plugins.git.models import (GitRepository as BaseGitRepository, GitSnapshot, GitBranch) cl...
0
0
0
0
0
0
setup.py
fakegit/video-funnel
113
3229914
from setuptools import setup version = '0.3.0' setup( name='video_funnel', packages=['video_funnel'], version=version, description='Use multiple connections to request the video, then feed the combined data to the player.', author='<NAME>', author_email='<EMAIL>', url='https://github.com/c...
0
0
0
0
0
0
sleekxmpp/xmlstream/matcher/base.py
E-Tahta/sleekxmpp
499
3229942
# -*- coding: utf-8 -*- """ sleekxmpp.xmlstream.matcher.base ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Part of SleekXMPP: The Sleek XMPP Library :copyright: (c) 2011 <NAME> :license: MIT, see LICENSE for more details """ class MatcherBase(object): """ Base class for stanza matchers. Stanza match...
0
1
0
0
1
0
service/learner/brains/specs.py
lcrh/falken
213
3229944
# Copyright 2021 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 agreed to in writing, ...
10
36
3
1
50
0
ppci/arch/arm/__init__.py
kl4w3i/ppci
161
3229946
<filename>ppci/arch/arm/__init__.py """ Arm machine specifics. The arm target has several options: * thumb: enable thumb mode, emits thumb code """ from .arch import ArmArch __all__ = ["ArmArch"]
0
0
0
0
0
0
examples/button_group.py
pzahemszky/guizero
320
3229957
from guizero import App, ButtonGroup def selected(): print(choice.value + " " + choice2.value) app = App() choice = ButtonGroup(app, options=["cheese", "ham", "salad"], command=selected) # You can use specific values for the button group by passing them as a 2d list. # choice = ButtonGroup(app, options=[["cheese"...
0
0
0
0
0
0
reviewboard/cmdline/utils/argparsing.py
b1pb1p/reviewboard
921
3229969
"""Argument parsing utilities for command line tools.""" from __future__ import unicode_literals import argparse import os import sys import reviewboard from reviewboard.cmdline.utils.console import get_console class HelpFormatter(argparse.RawDescriptionHelpFormatter): """Formats help text by preserving paragr...
0
1
1
0
2
0
test/plugin/integration/unik/test.py
jaeh/IncludeOS
3,673
3229992
<reponame>jaeh/IncludeOS<gh_stars>1000+ #!/usr/bin/env python3 from builtins import str import sys import os from vmrunner import vmrunner # TODO: Implement a mockup of the Unik registration protocol on 10.0.0.56 vm=vmrunner.vms[0] if len(sys.argv) > 1: vm.boot(image_name=str(sys.argv[1])) else: # Boot the...
0
0
0
0
0
0
SAN/lib/models/initialization.py
yerang823/landmark-detection
612
3230008
<gh_stars>100-1000 import torch import torch.nn as nn from torch.nn import init def weights_init_cpm(m): classname = m.__class__.__name__ # print(classname) if classname.find('Conv') != -1: m.weight.data.normal_(0, 0.01) if m.bias is not None: m.bias.data.zero_() elif classname.find('BatchNorm2d') != -...
0
0
0
0
0
0
PortOpt/base_est.py
jingmouren/OptimalPortfolio
279
3230034
<reponame>jingmouren/OptimalPortfolio import numpy as np from numpy.core.defchararray import upper import pandas as pd from scipy.optimize import minimize import warnings from . import utility_functions as utility_functions import cvxpy as cp class BaseEstimator: def __init__(self, tickers) -> None: self....
0
0
0
0
0
0
tests/ducktape_mock.py
nikesh0822/ducktape
301
3230086
<reponame>nikesh0822/ducktape # Copyright 2015 Confluent Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
0
0
0
0
0
0
var/spack/repos/builtin/packages/py-pot/package.py
LiamBindle/spack
2,360
3230099
# 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 PyPot(PythonPackage): """ This open source Python library provide several solvers for ...
0
0
2
0
2
0
2016/Round B/Problem C/C-solution.py
prashantsingh2408/Google-Kick-Start
237
3230100
import collections Endpoint = collections.namedtuple("Endpoint", ["index", "value", "start"]) T = int(input()) for t in range(1, T + 1): N, L1, R1, A, B, C1, C2, M = map(int, input().split()) endpoints = [Endpoint(0, L1, True), Endpoint(0, R1 + 1, False)] for i in range(1, N): x = (A * L1 + B * R1...
0
0
0
0
0
0
scripts/CPI-corpora-preparing/bllip-parser/second-stage/programs/features/swig/python/test/test.py
AmmarQaseem/CPI-Pipeline-test
189
3230109
<reponame>AmmarQaseem/CPI-Pipeline-test<filename>scripts/CPI-corpora-preparing/bllip-parser/second-stage/programs/features/swig/python/test/test.py # 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...
0
0
0
0
0
0
backend/op/viewfinder_op.py
xuantan/viewfinder
645
3230129
# Copyright 2013 Viewfinder Inc. All Rights Reserved. from __future__ import annotations """Viewfinder base operation. ViewfinderOperation is the base class for all other Viewfinder operations. It contains code that is common across at least two derived operations. """ __authors__ = ['<EMAIL> (<NAME>)'] from copy i...
1
2
0
0
3
0
apps/accounts/constants/search.py
goztrk/django-htk
206
3230135
DEFAULT_NUM_SEARCH_RESULTS = 20
0
0
0
0
0
0
nsm/word_embeddings.py
MartinoMensio/neural-symbolic-machines
354
3230141
<gh_stars>100-1000 import json import numpy as np import gensim class EmbeddingModel(object): def __init__( self, vocab_file, embedding_file, normalize_embeddings=True): with open(embedding_file, 'rb') as f: self.embedding_mat = np.load(f) if normalize_embeddings: self.embedding_mat = self...
0
0
0
0
0
0
rapidsms/contrib/messagelog/tables.py
catalpainternational/rapidsms
330
3230151
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import django_tables2 as tables from rapidsms.contrib.messagelog.models import Message class MessageTable(tables.Table): class Meta: model = Message exclude: tuple[str] = ('id', ) order_by: tuple[str] = ('-date', ) attrs: dict[st...
0
0
3
0
3
0
tests_sql/test_sql_interestingness.py
cclauss/lux
3,731
3230155
# Copyright 2019-2020 The Lux 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 by applicable law or agreed...
0
0
0
0
0
0
smdebug/mxnet/hook.py
jsspric/sagemaker-debugger
133
3230161
# Third Party from __future__ import annotations import mxnet as mx from mxnet.ndarray import NDArray # First Party from smdebug.core.collection import DEFAULT_MXNET_COLLECTIONS, CollectionKeys from smdebug.core.hook import CallbackHook from smdebug.core.json_config import DEFAULT_WORKER_NAME from smdebug.core.utils i...
10
9
0
4
23
0
example_client/multi_inputs.py
Xaenalt/model_server
305
3230169
<reponame>Xaenalt/model_server # # Copyright (c) 2019-2020 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 req...
0
0
0
0
0
0
extra_tests/snippets/encoding.py
mainsail-org/RustPython
11,058
3230170
<gh_stars>1000+ from testutils import assert_raises try: b" \xff".decode("ascii") except UnicodeDecodeError as e: assert e.start == 3 assert e.end == 4 else: assert False, "should have thrown UnicodeDecodeError" assert_raises(UnicodeEncodeError, "¿como estás?".encode, "ascii") def round_trip(s, en...
0
0
0
0
0
0
pointmvsnet/utils/preprocess.py
MarcWong/PointMVSNet
419
3230175
<reponame>MarcWong/PointMVSNet<gh_stars>100-1000 import numpy as np import cv2 import math def norm_image(img): """ normalize image input """ img = img.astype(np.float32) var = np.var(img, axis=(0, 1), keepdims=True) mean = np.mean(img, axis=(0, 1), keepdims=True) return (img - mean) / (np.sqrt(va...
0
0
0
0
0
0
examples/optimizers/misc/create_aoa.py
anukaal/opytimizer
528
3230187
<reponame>anukaal/opytimizer<gh_stars>100-1000 from opytimizer.optimizers.misc import AOA # One should declare a hyperparameters object based # on the desired algorithm that will be used params = { 'a_min': 0.2, 'a_max': 1.0, 'alpha': 5, 'mu': 0.499 } # Creates an AOA optimizer o = AOA(params=params)
0
0
0
0
0
0
test/test_echo_to_stream.py
josephabrahams/django-sendgrid-v5
249
3230202
import warnings from unittest.mock import MagicMock from django.core.mail import EmailMessage from django.test import override_settings from django.test.testcases import SimpleTestCase from python_http_client.exceptions import UnauthorizedError from sendgrid_backend.mail import SendgridBackend class TestEchoToOutpu...
0
0
0
0
0
0
src/Evaluator.py
jqueguiner/HighRes-net
271
3230205
<reponame>jqueguiner/HighRes-net """ Python script to evaluate super resolved images against ground truth high resolution images """ import itertools import numpy as np from tqdm import tqdm from DataLoader import get_patch def cPSNR(sr, hr, hr_map): """ Clear Peak Signal-to-Noise Ratio. The PSNR score, ad...
0
0
0
0
0
0
OpenGL/GL/NV/representative_fragment_test.py
t20100/pyopengl
210
3230215
'''OpenGL extension NV.representative_fragment_test This module customises the behaviour of the OpenGL.raw.GL.NV.representative_fragment_test to provide a more Python-friendly API Overview (from the spec) This extension provides a new _representative fragment test_ that allows implementations to reduce the amou...
0
1
0
0
1
0
tests/r/test_biomass.py
hajime9652/observations
199
3230248
<reponame>hajime9652/observations from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.biomass import biomass def test_biomass(): """Test module biomass.py by downloading biomass.csv and testing...
0
0
0
0
0
0
jodconverter-web/src/main/office/program/python-core-2.7.6/lib/ctypes/macholib/dylib.py
Congliang0229/kkFileView
112
3230251
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### from __future__ import annotations """ Generic dylib path manipulation """ import re __all__ = ...
5
3
0
0
8
0
ch_06/std_from_mean_kde.py
ags-ds/Hands-On-Data-Analysis-with-Pandas-By-Ags
260
3230260
<filename>ch_06/std_from_mean_kde.py<gh_stars>100-1000 import itertools def std_from_mean_kde(data): """ Plot the KDE of the pandas series along with vertical reference lines for each standard deviation from the mean. Parameters: - data: pandas Series with numeric data Returns: ...
0
0
0
0
0
0
adb/systrace/catapult/devil/devil/android/tools/system_app_test.py
mohanedmoh/TBS
2,151
3230280
#!/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 unittest if __name__ == '__main__': sys.path.append(os.path.abspath( os.path.join(os.path.dirname(...
0
2
0
0
2
0
src/homework/tests/cross_check/tests_question_crosscheck_dispatcher.py
denkasyanov/education-backend
151
3230288
<filename>src/homework/tests/cross_check/tests_question_crosscheck_dispatcher.py import pytest from homework import tasks from homework.models import AnswerCrossCheck pytestmark = [pytest.mark.django_db] def test_crosschecks_are_created(question_dispatcher): question_dispatcher() assert AnswerCrossCheck.ob...
0
0
0
0
0
0
chessbot/r2_chess_pgn.py
amjadmajid/rosbook
442
3230291
<reponame>amjadmajid/rosbook<filename>chessbot/r2_chess_pgn.py #!/usr/bin/env python import sys, rospy, tf, moveit_commander, random from geometry_msgs.msg import Pose, Point, Quaternion import pgn class R2ChessboardPGN: def __init__(self): self.left_arm = moveit_commander.MoveGroupCommander("left_arm") self...
0
0
0
0
0
0
tests/nnapi/specs/V1_2/sqrt_4D_float_nnfw.mod.py
bogus-sudo/ONE-1
255
3230344
<reponame>bogus-sudo/ONE-1<filename>tests/nnapi/specs/V1_2/sqrt_4D_float_nnfw.mod.py # model model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{2, 2, 2, 2}") i2 = Output("op2", "TENSOR_FLOAT32", "{2, 2, 2, 2}") model = model.Operation("SQRT", i1).To(i2) # Example 1. Input in operand 0, input0 = {i1: # input 0 ...
0
0
0
0
0
0
tf_rl/__init__.py
KEVINYZY/tensorflow-deepq
1,094
3230363
<reponame>KEVINYZY/tensorflow-deepq<gh_stars>1000+ from .simulate import simulate
0
0
0
0
0
0
recipes/sota/2019/raw_lm_corpus/get_titles.py
Zilv1128/test1
5,921
3230370
<reponame>Zilv1128/test1 import argparse import os import xml.etree.ElementTree as ET from multiprocessing.pool import ThreadPool from gutenberg.query import get_metadata CACHE_PATH = "" def get_one_title_from_cache(book_id): return (book_id, get_metadata("title", int(book_id))) def get_one_title(book_id): ...
0
0
0
0
0
0
examples/pytorch_lightning/graph_sage.py
NucciTheBoss/pytorch_geometric
2,350
3230378
import os.path as osp import pytorch_lightning as pl import torch import torch.nn.functional as F from torch.nn import BatchNorm1d from torchmetrics import Accuracy from torch_geometric import seed_everything from torch_geometric.data import LightningNodeData from torch_geometric.datasets import Reddit from torch_geo...
5
3
0
0
8
0
code/stable/glassbr/src/python/OutputFormat.py
smiths/Drasil
114
3230385
## \file OutputFormat.py # \author <NAME> and <NAME> # \brief Provides the function for writing outputs ## \brief Writes the output values to output.txt # \param is_safePb probability of glass breakage safety requirement # \param is_safeLR 3 second load equivalent resistance safety requirement # \param P_b probability ...
0
0
0
0
0
0
nilearn/plotting/tests/test_html_document.py
Qin-Ming/nilearn
827
3230387
<reponame>Qin-Ming/nilearn import os import time import pytest import tempfile import webbrowser from nilearn.plotting import html_document from numpy.testing import assert_no_warnings # Note: html output by nilearn view_* functions # should validate as html5 using https://validator.w3.org/nu/ with no # warnings de...
0
0
0
0
0
0
tests/migrations/0001_initial.py
pombredanne/django-mutant
152
3230405
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from mutant.db.fields.generic import FieldDefinitionTypeField class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('mutant', '0001_initial'), ('contenttypes', '000...
0
0
2
0
2
0
tests/providers/apache/pig/operators/test_pig.py
ChaseKnowlden/airflow
15,947
3230426
# 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...
0
0
0
0
0
0
test/integration_test/tools/lib/ofp/ofp_group_stats_request.py
ryoon/lagopus
281
3230429
import os import sys import copy import logging from checker import * from .ofp import register_ofp_creators from .ofp import OfpBase # YAML: # group_stats_request: # flags: 0 # group_id: 0 SCE_GROUP_STATS_REQUEST = "group_stats_request" @register_ofp_creators(SCE_GROUP_STATS_REQUEST) class OfpGroupStatsReques...
0
1
0
0
1
0
magnum/tests/functional/api/v1/clients/cluster_template_client.py
ajmadsen/magnum
319
3230470
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
2
7
0
0
9
0
release/stubs.min/Autodesk/Revit/DB/__init___parts/CategoryNameMap.py
htlcnn/ironpython-stubs
182
3230473
class CategoryNameMap(APIObject,IDisposable,IEnumerable): """ A map that contains a mapping of category name to its category object. CategoryNameMap() """ def Clear(self): """ Clear(self: CategoryNameMap) Removes every category from the map,rendering it empty. """ pass def Contains(...
0
0
0
0
0
0
app/outlier_treatment/main.py
tungpatrick/AutoOut
101
3230495
import glob import json import os import time import dask import numpy as np import pandas as pd from dask import delayed from distributed import LocalCluster, Client from joblib import parallel_backend from scipy.stats import zscore from sklearn.cluster import DBSCAN, OPTICS from sklearn.covariance import EllipticEnv...
5
6
0
1
12
0
archai/networks/shakeshake/shakeshake.py
shatadru99/archai
344
3230502
# -*- coding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable class ShakeShake(torch.autograd.Function): @staticmethod def forward(ctx, x1, x2, training: bool=True) -> object: if training: alpha = torch.cuda.FloatTensor(x1....
1
3
0
0
4
0
face_recog.py
SolidGoat/EagleEye
3,199
3230508
from __future__ import annotations import cv2 import face_recognition from urllib.request import urlretrieve from pathlib import Path import os import tempfile from sys import platform import random import string import utils.console as console class FaceRecog: def __init__(self, profile_list, profile_img, num_j...
1
2
0
2
5
0
tensorflowServingWeb/app.py
xrxiang/tensorflow2.0-coding
102
3230531
# coding=utf-8 from __future__ import annotations import flask from flask import request,jsonify import werkzeug import os import tensorflow as tf import getConfig import numpy as np import pickle import requests import json from PIL import Image gConfig = {} gConfig = getConfig.get_config(config_file='config.ini') ap...
0
4
0
0
4
0
marching_cube/data/shape.py
YiyiLiao/deep_marching_cubes
206
3230543
<reponame>YiyiLiao/deep_marching_cubes<filename>marching_cube/data/shape.py # Generate a series of cubes import numpy as np import os import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from numpy.random import uniform class Shape(object): """Sample points from toy primitives such as ellipsoi...
0
0
0
0
0
0
tests/unit/test_collection.py
jaimegildesagredo/finch
118
3230569
<filename>tests/unit/test_collection.py # -*- coding: utf-8 -*- try: from urllib.parse import urlencode except ImportError: from urllib import urlencode try: from http.client import OK, NOT_FOUND, CREATED, NO_CONTENT, INTERNAL_SERVER_ERROR, BAD_REQUEST except ImportError: from httplib import OK, NOT_FO...
0
0
0
0
0
0
recipes/Python/578287_Multidimensional_Pareto_front/recipe-578287.py
tdiprima/code
2,023
3230573
import numpy as np def pareto_frontier_multi(myArray): # Sort on first dimension myArray = myArray[myArray[:,0].argsort()] # Add first row to pareto_frontier pareto_frontier = myArray[0:1,:] # Test next row against the last row in pareto_frontier for row in myArray[1:,:]: if sum([row[x]...
0
0
0
0
0
0
pyunicorn/climate/map_plots.py
jkroenke/pyunicorn
168
3230578
<reponame>jkroenke/pyunicorn #!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of pyunicorn. # Copyright (C) 2008--2019 <NAME> and pyunicorn authors # URL: <http://www.pik-potsdam.de/members/donges/software> # License: BSD (3-clause) # # Please acknowledge and cite the use of this software and its authors...
0
0
0
0
0
0
erroranalysis/erroranalysis/analyzer/__init__.py
ezherdeva/responsible-ai-toolbox
119
3230585
<filename>erroranalysis/erroranalysis/analyzer/__init__.py<gh_stars>100-1000 # Copyright (c) Microsoft Corporation # Licensed under the MIT License. """Module for defining the analyzers.""" from .error_analyzer import ModelAnalyzer, PredictionsAnalyzer __all__ = ["PredictionsAnalyzer", "ModelAnalyzer"]
0
0
0
0
0
0
tools/accuracy_checker/openvino/tools/accuracy_checker/representation/optical_flow.py
TolyaTalamanov/open_model_zoo
2,201
3230596
""" Copyright (c) 2018-2022 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 applicable law or agreed to in wri...
0
2
0
1
3
0
rl_coach/tests/architectures/mxnet_components/heads/test_q_head.py
jl45621/coach
1,960
3230602
import mxnet as mx import os import pytest import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) from rl_coach.architectures.mxnet_components.heads.q_head import QHead, QHeadLoss from rl_coach.agents.clipped_ppo_agent import ClippedPPOAgentParameters from rl_coach.spaces import Space...
0
0
0
0
0
0
custom/inddex/reports/r1_master_data.py
dimagilg/commcare-hq
471
3230628
import textwrap from itertools import chain from corehq.apps.reports.filters.case_list import CaseListFilter from custom.inddex import filters from custom.inddex.food import INDICATORS, FoodData from .utils import MultiTabularReport, format_row, na_for_None class MasterDataReport(MultiTabularReport): name: str ...
0
3
4
0
7
0
portia_server/portia_api/utils/extract.py
hackrush01/portia
6,390
3230664
import logging from twisted.internet import defer from twisted.web.client import getPage from scrapy import Request from scrapy.http import HtmlResponse from scrapy.utils.misc import arg_to_iter from crochet import setup, wait_for, TimeoutError setup() class FetchError(Exception): status: int = 400 def __...
0
7
1
0
8
0
test/manual/documents/test_update_document.py
membranepotential/mendeley-python-sdk
103
3230693
from test import cassette from test.resources.documents import * def test_should_update_document(): session = get_user_session() delete_all_documents() with cassette('fixtures/resources/documents/update_document/update_document.yaml'): doc = create_document(session) patched_doc = doc.upda...
0
0
0
0
0
0
facial-motion-transfer/first-order-model/loss.py
AaratiAkkapeddi/nnabla-examples
228
3230710
<reponame>AaratiAkkapeddi/nnabla-examples # Copyright 2021 Sony Corporation. # Copyright 2021 Sony Group 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...
0
0
0
0
0
0
Chapter07/enumerate_lines.py
4n3i5v74/Python-3-Object-Oriented-Programming-Third-Edition
393
3230734
import sys filename = sys.argv[1] with open(filename) as file: for index, line in enumerate(file): print(f"{index+1}: {line}", end="")
0
0
0
0
0
0
tests/micropython/heapalloc_yield_from.py
sebastien-riou/micropython
13,648
3230740
<reponame>sebastien-riou/micropython # Check that yield-from can work without heap allocation import micropython # Yielding from a function generator def sub_gen(a): for i in range(a): yield i def gen(g): yield from g g = gen(sub_gen(4)) micropython.heap_lock() print(next(g)) print(next(g)) microp...
0
0
0
0
0
0
src/classes/test_inheritance.py
ckr0/learn-python
12,869
3230754
"""Inheritance @see: https://docs.python.org/3/tutorial/classes.html#inheritance Inheritance is one of the principles of object-oriented programming. Since classes may share a lot of the same code, inheritance allows a derived class to reuse the same code and modify accordingly """ # pylint: disable=too-few-public-...
0
2
0
0
2
0
samples/system.py
IMULMUL/PythonForWindows
479
3230814
<reponame>IMULMUL/PythonForWindows import sys import os.path sys.path.append(os.path.abspath(__file__ + "\..\..")) import windows system = windows.system print("Basic system infos:") print(" version = {0}".format(system.version)) print(" bitness = {0}".format(system.bitness)) print(" computer_name = {0}".for...
0
0
0
0
0
0
setup.py
romanorac/discomll
103
3230827
<filename>setup.py from setuptools import setup, find_packages setup( name='discomll', version='0.1.4.2', author='<NAME>', author_email='<EMAIL>', url="https://github.com/romanorac/discomll", packages=find_packages(), # adding packages package_data={"": ["*.txt", "*.sh", "*.csv"]}, # add ...
0
0
0
0
0
0
compare_mt/formatting.py
maks5507/compare-mt
401
3230877
from __future__ import annotations import re class Formatter(object): latex_substitutions: dict[object,str] = { re.compile("\["): "{[}", re.compile("\]"): "{]}", re.compile("<"): r"\\textless", re.compile(">"): r"\\textgreater" } def __init__(self, decimals: int=4): ...
2
2
1
0
5
0
google_problems/problem_20.py
loftwah/Daily-Coding-Problem
129
3230886
"""This problem was asked by Google. Given an undirected graph represented as an adjacency matrix and an integer k, write a function to determine whether each vertex in the graph can be colored such that no two adjacent vertices share the same color using at most k colors"""
0
0
0
0
0
0
ppci/lang/c3/visitor.py
kl4w3i/ppci
161
3230919
from __future__ import annotations """ Visitor class. """ from . import astnodes as ast class Visitor: """ Visitor that can visit all nodes in the AST and run pre and post functions. """ def __init__(self, pre: object | None=None, post: object | None=None): self.pre = pre sel...
2
0
0
0
2
0
Chapter09/sum_tree.py
GeniusDog/Intelligent-Projects-Using-Python
105
3230932
<reponame>GeniusDog/Intelligent-Projects-Using-Python import numpy as np class sum_tree: write = 0 def __init__(self, capacity): self.capacity = capacity self.tree = np.zeros( 2*capacity - 1 ) self.data = np.zeros( capacity,dtype=object ) def _propagate_(self, idx, change): ...
0
0
0
0
0
0
L1Trigger/L1TCommon/python/caloStage1LegacyFormatDigis_cfi.py
ckamtsikis/cmssw
852
3230962
import FWCore.ParameterSet.Config as cms import sys sys.stderr.write("WARNING: L1Trigger/L1TCommon/python/caloStage1LegacyFormatDigis_cfi.py has been deprecated...\n") sys.stderr.write("WARNING: please use L1Trigger/L1TCalorimeter/python/caloStage1LegacyFormatDigis_cfi.py\n") from L1Trigger.L1TCalorimeter.caloStage...
0
0
0
0
0
0
data.py
anoidgit/zero
111
3230970
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from utils.util import batch_indexer, token_indexer class Dataset(object): def __init__(self, src_file, tgt_file, src_vocab, tgt_vocab, max_len: int=10...
6
1
0
1
8
0
fooltrader/spiders/chinastock/sina_category_spider.py
beaquant/fooltrader
1,103
3230977
# -*- coding: utf-8 -*- import json import threading import demjson import scrapy from scrapy import Request from scrapy import signals from fooltrader.api.technical import get_security_list from fooltrader.contract.files_contract import get_security_list_path from fooltrader.utils.utils import get_exchange class ...
0
3
2
0
5
0
example/subuser/post_create_subuser.py
bailzx5522/huobi_Python
611
3230998
<filename>example/subuser/post_create_subuser.py from huobi.client.subuser import SubuserClient from huobi.constant import * from huobi.utils import * import string import random subuser_client = SubuserClient(api_key=g_api_key, secret_key=g_secret_key) userName = ''.join(random.choices(string.ascii_uppercase + string...
0
0
0
0
0
0
Hackerank/Python/Pangrams.py
abdzitter/Daily-Coding-DS-ALGO-Practice
289
3231006
#!/bin/python3 import math import os import random import re import sys # Complete the pangrams function below. ascii_array = [] def pangrams(s) -> str: lower_s = s.lower() for i in range(len(lower_s)): ascii_array.append(ord(lower_s[i])) for i in range(97,123): if i not in ascii_array: ...
0
1
0
0
1
0
airflow/migrations/versions/0086_092435bf5d12_add_max_active_runs_column_to_dagmodel_.py
npodewitz/airflow
8,092
3231008
<gh_stars>1000+ # # 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 # "Licens...
0
0
0
0
0
0