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
kivent/examples/8_simple_animation/main.py
WeilerWebServices/Kivy
515
3232529
<reponame>WeilerWebServices/Kivy<filename>kivent/examples/8_simple_animation/main.py from kivy.app import App from kivy.uix.widget import Widget from kivy.clock import Clock from kivy.core.window import Window from random import randint, choice, randrange import kivent_core from kivent_core.gameworld import GameWorld f...
0
0
0
0
0
0
spyder/utils/external/__init__.py
Earthman100/spyder
7,956
3232579
<reponame>Earthman100/spyder<gh_stars>1000+ # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2009- Spyder Project Contributors and others (see LICENSE.txt) # # Licensed under the terms of the MIT and other licenses where noted # (see LICENSE.txt in ...
0
0
0
0
0
0
novaclient/tests/unit/v2/test_quotas.py
klmitch/python-novaclient
199
3232583
# Copyright 2011 OpenStack Foundation # 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 requ...
0
2
1
0
3
0
paypal/express_checkout/urls.py
rodolfotorres02/django-oscar-paypal
111
3232588
from django.urls import path from paypal.express_checkout import views from paypal.express_checkout.gateway import buyer_pays_on_paypal base_patterns = [ # Views for normal flow that starts on the basket page path('redirect/', views.PaypalRedirectView.as_view(), name='express-checkout-redirect'), path('ca...
0
0
0
0
0
0
src/backends/loom_backend.py
almartin82/bayeslite
964
3232597
# -*- coding: utf-8 -*- # Copyright (c) 2010-2017, MIT Probabilistic Computing Project # # 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/LICENS...
10
39
0
1
50
0
jupyter_py/ptstrategy_distance.py
vdaytona/statistical-arbitrage-18-19
163
3232606
from ptstrategy import PTStrategy import pandas as pd import numpy as np import datetime as dt import backtrader as bt class DistStrategy(PTStrategy): def __init__(self): super().__init__() self.resid_mean: None = None self.resid_std: None = None def log_status(self): ...
0
1
0
2
3
0
src/Render/render.py
hjwdzh/FrameNet
102
3232614
<filename>src/Render/render.py from ctypes import * import numpy as np Render = cdll.LoadLibrary('./Render/libRender.so') def setup(info): Render.InitializeCamera(info['depthWidth'], info['depthHeight'], c_float(info['d_fx']), c_float(info['d_fy']), c_float(info['d_cx']), c_float(info['d_cy'])) def SetMesh(V, F):...
0
0
0
0
0
0
syhandler/message/message.py
larrycameron80/outis
129
3232618
from __future__ import annotations from ..transport.transport import Transport from syhelpers.log import * import struct DEBUG_MODULE = "Message" class Message: """ Message object for the transport communication Message format: Type-Byte 4-Byte-Length Content-of-that-Length Everything should be netw...
4
2
10
1
17
0
tests/test_nullify.py
almartin82/bayeslite
964
3232649
# -*- coding: utf-8 -*- # Copyright (c) 2010-2017, MIT Probabilistic Computing Project # # 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/LICENS...
0
0
0
0
0
0
tools/validate-all-file.py
bbezak/kolla
957
3232656
<reponame>bbezak/kolla #!/usr/bin/env python3 # 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
examples/pybullet/examples/createSphereMultiBodies.py
felipeek/bullet3
9,136
3232663
<filename>examples/pybullet/examples/createSphereMultiBodies.py import pybullet as p import time useMaximalCoordinates = 0 import pybullet_data p.connect(p.GUI) p.setAdditionalSearchPath(pybullet_data.getDataPath()) #p.loadSDF("stadium.sdf",useMaximalCoordinates=useMaximalCoordinates) monastryId = concaveEnv = p.crea...
0
0
0
0
0
0
toollib/tcli/commands/_set_conda.py
atpuxiner/toollib
113
3232676
""" @author axiner @version v1.0.0 @created 2022/4/30 13:20 @abstract @description @history """ import sys from pathlib import Path from toollib import utils from toollib.decorator import sys_required from toollib.tcli.base import BaseCmd from toollib.tcli.commands import byter from toollib.tcli.option import Options ...
0
1
0
0
1
0
env/lib/python3.6/site-packages/altair/vegalite/display.py
anthowen/duplify
1,134
3232688
<gh_stars>1000+ from ..utils.display import Displayable, default_renderer_base, json_renderer_base from ..utils.display import RendererRegistry __all__ = ( "Displayable", "default_renderer_base", "json_renderer_base", "RendererRegistry" )
0
0
0
0
0
0
src/prod/tools/linux/lldb/sftypes.py
AnthonyM/service-fabric
2,542
3232708
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ import lldb def wstring_SummaryPr...
0
1
0
0
1
0
third_party/substitution.bzl
xiaohanhuang/pytorch
60,067
3232726
# This Bazel rules file is derived from https://github.com/tensorflow/tensorflow/blob/master/third_party/common.bzl # Rule for simple expansion of template files. This performs a simple # search over the template file for the keys in substitutions, # and replaces them with the corresponding values. # # Typical usage: ...
0
1
0
0
1
0
corehq/messaging/smsbackends/http/forms.py
akashkj/commcare-hq
471
3232753
<filename>corehq/messaging/smsbackends/http/forms.py from django.core.exceptions import ValidationError from django.forms.fields import BooleanField, ChoiceField from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop from crispy_forms import layout as crispy from dimagi....
0
0
0
0
0
0
examples/multiubuntu/build/flask/http_test.py
oneiro-naut/KubeArmor
220
3232757
#!/usr/bin/python -O import sys from flask import Flask app = Flask(__name__) @app.route('/') def index() -> str: return "URL: /\n" @app.route('/test1') def test1() -> str: return "URL: /test1\n" @app.route('/test2') def test2() -> str: return "URL: /test2\n" if len(sys.argv) != 2: print("Usage: {} [port]".fo...
0
3
0
0
3
0
pugsql/exceptions.py
Torvaney/pugsql
509
3232818
""" Exception types raised by PugSQL. PugSQL will also raise built-in exceptions when they're appropriate. """ __pdoc__ = {} class ParserError(ValueError): """ Exception raised when syntax errors are encountered parsing PugSQL files. """ token: None = None def __init__(self, message, token): ...
0
0
1
0
1
0
src/main/python/rlbot/matchconfig/conversions.py
VirxEC/RLBot
408
3232822
import json from pathlib import Path from rlbot.matchconfig.loadout_config import LoadoutConfig, LoadoutPaintConfig from rlbot.matchconfig.match_config import MatchConfig, ExtensionConfig, MutatorConfig, PlayerConfig, ScriptConfig from rlbot.parsing.agent_config_parser import PARTICIPANT_CONFIGURATION_HEADER, PARTICIP...
6
7
0
0
13
0
qa/L0_rate_limiter/rate_limiter_test.py
jwierzbo/server
2,159
3232835
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. 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...
1
4
0
8
13
0
10_pipeline/sagemaker_mlops/sagemaker-project-modelbuild/pipelines/_utils.py
ichen20/oreilly_book
2,327
3232892
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
2
2
0
0
4
0
tests/test_provider_iwarapter_scaffolding.py
mjuenema/python-terrascript
507
3232928
# tests/test_provider_iwarapter_scaffolding.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:26:12 UTC) def test_provider_import(): import terrascript.provider.iwarapter.scaffolding def test_resource_import(): from terrascript.resource.iwarapter.scaffolding import scaffolding_resource def...
0
0
0
0
0
0
questions/peak-index-in-a-mountain-array/Solution.py
marcus-aurelianus/leetcode-solutions
141
3232953
""" Let's call an array A a mountain if the following properties hold: A.length >= 3 There exists some 0 < i < A.length - 1 such that A[0] < A[1] < ... A[i-1] < A[i] > A[i+1] > ... > A[A.length - 1] Given an array that is definitely a mountain, return any i such that A[0] < A[1] < ... A[i-1] < A[i] > A[i+1] > ... > A[...
0
1
0
0
1
0
introcore/agents/linux/scripts/generator_header.py
hugmyndakassi/hvmi
677
3232956
# # Copyright (c) 2020 Bitdefender # SPDX-License-Identifier: Apache-2.0 # import os, re, sys def main(): out_file_path = sys.argv[1] out_file_name = out_file_path.split('/')[-1].upper().split('.')[0] f = open(out_file_path, 'wt') f.write('#ifndef _%s_H_\n' % (out_file_name)) f.write('#define _%s_...
0
0
0
0
0
0
src/prepare_training/gen_virtual_scan.py
collector-m/overlap_localization
188
3232967
#!/usr/bin/env python3 # Developed by <NAME> and <NAME> # This file is covered by the LICENSE file in the root of this project. # Brief: This script generates virtual scans for map grids using a voxelized point cloud map import os import sys import yaml import numpy as np import open3d as o3d from tqdm import tqdm im...
8
2
0
0
10
0
cupy/_core/_gufuncs.py
Onkar627/cupy
6,180
3232994
<filename>cupy/_core/_gufuncs.py<gh_stars>1000+ import re import numpy import cupy import cupy._core._routines_manipulation as _manipulation from cupy._core._dtype import get_dtype from cupy._core import internal # Signature parsing code and dimension accessing has been borrowed # from dask # https://github.com/dask...
0
0
0
0
0
0
zcls/data/datasets/build.py
ZJCV/ZCls
110
3233001
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ @date: 2020/8/22 下午9:21 @file: trainer.py @author: zj @description: """ import torch from .cifar import CIFAR from .fashionmnist import FashionMNIST from .imagenet import ImageNet from .general_dataset import GeneralDataset from .general_dataset_v2 import GeneralDatase...
0
0
0
0
0
0
analytics/models.py
soffieswan044/cccatalog-api
122
3233006
import enum from sqlalchemy import Integer, Column, Enum, String, DateTime, Boolean, Float from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.sql import func from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Image(Base): __tablename__: str = "image" # Managed...
0
0
11
0
11
0
waybackpy/__init__.py
jonasjancarik/waybackpy
185
3233013
<reponame>jonasjancarik/waybackpy # ┏┓┏┓┏┓━━━━━━━━━━┏━━┓━━━━━━━━━━┏┓━━┏━━━┓━━━━━ # ┃┃┃┃┃┃━━━━━━━━━━┃┏┓┃━━━━━━━━━━┃┃━━┃┏━┓┃━━━━━ # ┃┃┃┃┃┃┏━━┓━┏┓━┏┓┃┗┛┗┓┏━━┓━┏━━┓┃┃┏┓┃┗━┛┃┏┓━┏┓ # ┃┗┛┗┛┃┗━┓┃━┃┃━┃┃┃┏━┓┃┗━┓┃━┃┏━┛┃┗┛┛┃┏━━┛┃┃━┃┃ # ┗┓┏┓┏┛┃┗┛┗┓┃┗━┛┃┃┗━┛┃┃┗┛┗┓┃┗━┓┃┏┓┓┃┃━━━┃┗━┛┃ # ━┗┛┗┛━┗━━━┛┗━┓┏┛┗━━━┛┗━━━┛┗━━┛┗┛┗┛┗┛━━━┗━┓┏┛ # ━━...
0
0
0
0
0
0
tensorflow_graphics/datasets/modelnet40/modelnet40_checksums.py
Liang813/graphics
2,759
3233023
<filename>tensorflow_graphics/datasets/modelnet40/modelnet40_checksums.py # Copyright 2020 The TensorFlow Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org...
0
0
0
0
0
0
logdevice/ops/ldquery/py/__init__.py
majra20/LogDevice
1,831
3233052
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import, division, print_function, unicode_literals # pyre...
0
0
0
0
0
0
tests/nn_tests/test_recurrent_branched.py
ummavi/pfrl-1
824
3233058
import unittest import pytest import torch from torch import nn from pfrl.nn import RecurrentBranched, RecurrentSequential from pfrl.testing import torch_assert_allclose from pfrl.utils.recurrent import ( concatenate_recurrent_states, get_recurrent_state_at, mask_recurrent_state_at, one_step_forward, ...
0
6
0
0
6
0
alipay/aop/api/domain/ContractManagerParticipantsSyncRequest.py
antopen/alipay-sdk-python-all
213
3233064
<filename>alipay/aop/api/domain/ContractManagerParticipantsSyncRequest.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class ContractManagerParticipantsSyncRequest(object): def __init__(self): self._name = None self._principal_nam...
0
0
0
0
0
0
python/craftassist/test/test_dialogue_manager.py
boldsort/craftassist
626
3233079
<reponame>boldsort/craftassist<filename>python/craftassist/test/test_dialogue_manager.py from base_agent.nsp_dialogue_manager import NSPDialogueManager from base_agent.loco_mc_agent import LocoMCAgent import os import unittest import logging from all_test_commands import * class AttributeDict(dict): __getattr__ =...
0
0
0
0
0
0
demos/cta_stk/Strategies/DualThrust.py
NoTravel/wtpy
164
3233080
from wtpy import BaseCtaStrategy from wtpy import CtaContext import numpy as np class StraDualThrust(BaseCtaStrategy): def __init__(self, name:str, code:str, barCnt:int, period:str, days:int, k1:float, k2:float, isForStk:bool = False): BaseCtaStrategy.__init__(self, name) self.__days...
13
2
0
0
15
0
ut/lib/b2b_setup.py
insanum/warp17
375
3233094
<reponame>insanum/warp17 # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER # # Copyright (c) 2016, Juniper Networks, Inc. All rights reserved. # # # The contents of this file are subject to the terms of the BSD 3 clause # License (the "License"). You may not use this file except in compliance # with the ...
0
0
0
0
0
0
tests/test_api.py
Kani999/pynetbox
264
3233100
<gh_stars>100-1000 import unittest import six import pynetbox from .util import Response if six.PY3: from unittest.mock import patch else: from mock import patch host = "http://localhost:8000" def_kwargs = { "token": "<PASSWORD>", "private_key_file": "tests/fixtures/api/get_session_key.json", } # K...
0
0
0
0
0
0
desktop/core/ext-py/django-ipware-2.1.0/ipware/ip.py
yetsun/hue
5,079
3233113
<gh_stars>1000+ from django.conf import settings from .utils import is_valid_ip from . import defaults as defs NON_PUBLIC_IP_PREFIX = tuple([ip.lower() for ip in defs.IPWARE_NON_PUBLIC_IP_PREFIX]) TRUSTED_PROXY_LIST = tuple([ip.lower() for ip in getattr(settings, 'IPWARE_TRUSTED_PROXY_LIST', [])]) def get_ip(reques...
0
0
0
0
0
0
pg_partitioning/signals.py
felix-zg/django-pg-partitioning
152
3233118
<reponame>felix-zg/django-pg-partitioning<filename>pg_partitioning/signals.py<gh_stars>100-1000 from django.dispatch import Signal post_create_partition = Signal(providing_args=["partition_log"]) """Sent when a partition is created. """ post_attach_partition = Signal(providing_args=["partition_log"]) """Sent when a pa...
0
0
0
0
0
0
doc/FormattingDecisionComments/types.py
frou/erlfmt
329
3233149
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
0
3
0
0
3
0
test/compare/compare.py
sthagen/anchore-syft
2,084
3233177
<gh_stars>1000+ #!/usr/bin/env python3 import sys import json import collections INDENT = " " Metadata = collections.namedtuple("Metadata", "metadata sources") Package = collections.namedtuple("Package", "name type version") class Syft: def __init__(self, report_path): self.report_path = report_path...
0
0
0
0
0
0
layers.py
rickyHong/pixelCNN-repl
193
3233187
from __future__ import annotations import theano import theano.tensor as T import numpy from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams from theano.sandbox.cuda.dnn import dnn_conv from generic_utils import * srng = RandomStreams(seed=3732) T.nnet.relu = lambda x: T.switch(x > floatX(0.), x, floa...
18
8
0
6
32
0
LocalJournals/utils/CyberDome/submissions.py
key-equivalent/AttackVectors
423
3233189
#!/usr/bin/python3 import logging import pprint import sys import datetime import praw from pathlib import Path def reddit_log(log_text, thread_id) -> None: log_thread = reddit.submission(id=thread_id) logging.info(f"log_output: {log_text}") log_thread.reply(log_text) return version = '1.1' testing =...
0
1
0
0
1
0
logger_example.py
DazEB2/SimplePyScripts
117
3233203
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' def get_logger(name, file: str='log.txt', encoding: str='utf-8') -> object: import logging log = logging.getLogger(name) log.setLevel(logging.DEBUG) formatter = logging.Formatter('[%(asctime)s] %(filename)s:%(lineno)d %(levelname...
2
1
0
0
3
0
example/keepalive/client.py
kokizzu/ijson
117
3233239
import requests r = requests.post('http://12172.16.31.10:8001/test/command', json={'params': 'Hello'}) print(r.json())
0
0
0
0
0
0
AutotestWebD/all_models_for_dubbo/models/B0002_dubbo_testcase.py
yangjourney/sosotest
422
3233246
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Make sure each ForeignKey has `on_delete` set to the desired behavior. # * Remove `managed = False` lines if ...
0
0
11
0
11
0
benchmarks/dockerize/fast_api/gateway.py
hipacloud/zero
304
3233265
<reponame>hipacloud/zero import logging from typing import Optional from aiohttp import ClientSession from fastapi import FastAPI logger = logging.getLogger(__name__) try: import uvloop uvloop.install() except ImportError: logger.warn("Cannot use uvloop") pass app = FastAPI() session: Optional[C...
0
0
0
0
0
0
esphome/components/binary/__init__.py
OttoWinter/esphomeyaml
249
3233272
import esphome.codegen as cg binary_ns = cg.esphome_ns.namespace("binary")
0
0
0
0
0
0
snapx/snapx/classes/coreviews.py
jihun-hong/snap-python
242
3233281
<filename>snapx/snapx/classes/coreviews.py<gh_stars>100-1000 from collections.abc import Mapping from .attrdict import AttributeDict class AtlasView(Mapping): """This is a view into a dict-of-dict-like structure. This view shows a certain node's neighbors and their edge attributes. Note that unlike Netw...
0
0
0
0
0
0
lucida/asyncthrift/fake/fakecmd_py/FakeCMDServer.py
extremenelson/sirius
1,808
3233288
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import sys, glob sys.path.insert(0, glob.glob('/home/yba/Documents/clarity/fbthrift/thrift/lib/py/build/lib*')[0]) # This needs to be more generic. from lucidatypes.ttypes import * from lucidaservice imp...
0
0
0
0
0
0
adminlteui/migrations/0001_initial.py
emaiqi/django-adminlte-ui
249
3233296
<reponame>emaiqi/django-adminlte-ui # Generated by Django 2.2.2 on 2019-06-29 07:08 from django.db import migrations, models from django.utils import timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='O...
0
0
0
0
0
0
integration/fixtures/versions-app/app.py
alvesgabriel/tsuru
2,885
3233388
import os from flask import Flask app = Flask(__name__) @app.route('/') def hello() -> object: return 'app: {} - version: {}'.format(os.environ.get("TSURU_APPNAME"), os.environ.get("TSURU_APPVERSION")) if __name__ == '__main__': app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 8888)))
0
1
0
0
1
0
scripts/digit.py
sumanthrao/sudo-sudoku
273
3233392
import cv2 import numpy as np import Queue class Digit(object): ''' Extracts the digit from a cell. Implements the classic `Largest connected component` algorithm. ''' def __init__(self, image): self.graph = image.copy() self.W, self.H = self.graph.shape self.visited = [[F...
0
0
0
0
0
0
tests/sandbox/test_settings.py
leduong/richie
174
3233401
""" Test suite for Richie's main module """ from unittest import mock from django.conf import settings from django.test import TestCase, override_settings from rest_framework.response import Response from rest_framework.settings import DEFAULTS, api_settings from richie.apps.search.viewsets.courses import CoursesVie...
0
0
0
0
0
0
chainerui/utils/tempdir.py
disktnk/chainerui
185
3233442
<gh_stars>100-1000 import contextlib import shutil import tempfile @contextlib.contextmanager def tempdir(**kwargs): # A context manager that defines a lifetime of a temporary directory. ignore_errors = kwargs.pop('ignore_errors', False) temp_dir = tempfile.mkdtemp(**kwargs) try: yield temp_d...
0
0
0
0
0
0
emukit/core/initial_designs/random_design.py
EmuKit/Emukit
272
3233461
<reponame>EmuKit/Emukit # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import numpy as np from .. import ParameterSpace from .base import ModelFreeDesignBase class RandomDesign(ModelFreeDesignBase): """ Random experiment design. Uniform ra...
0
0
0
0
0
0
tests/test_astroid.py
asafkahlon/asttokens
120
3233462
<reponame>asafkahlon/asttokens # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import astroid from astroid.node_classes import NodeNG from asttokens import ASTTokens from . import tools, test_mark_tokens class TestAstroid(test_mark_tokens.TestMarkTokens): is_astroid_test = True ...
0
0
0
0
0
0
OpenAttack/attack_eval/__init__.py
e-tornike/OpenAttack
444
3233467
<reponame>e-tornike/OpenAttack from .attack_eval import AttackEval
0
0
0
0
0
0
easytransfer/feat_ext_cli.py
bobmayuze/EasyTransfer
109
3233490
<filename>easytransfer/feat_ext_cli.py # coding=utf-8 # Copyright (c) 2019 Alibaba PAI team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
0
0
0
0
0
0
metadata-api/app.py
parsashojaei/opensea
481
3233493
<gh_stars>100-1000 from flask import Flask from flask import jsonify from google.cloud import storage from google.oauth2 import service_account from PIL import Image import os import mimetypes GOOGLE_STORAGE_PROJECT = os.environ['GOOGLE_STORAGE_PROJECT'] GOOGLE_STORAGE_BUCKET = os.environ['GOOGLE_STORAGE_BUCKET'] app...
0
0
0
0
0
0
code/doubanmovie.py
zefengdaguo/douban_crawler
116
3233497
from bs4 import BeautifulSoup import re import time import requests headers0 = {'User-Agent':"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36"} def getWishList(doubanid): firstpage='https://movie.douban.com/people/'+doubanid+'/wish?start=0&sort=time&rating=...
0
0
0
0
0
0
descarteslabs/client/addons.py
carderne/descarteslabs-python
167
3233502
<filename>descarteslabs/client/addons.py # Copyright 2018-2020 <NAME>. # # 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 b...
0
0
0
0
0
0
tests/utils/proxy/proxy.py
Tam-One/Requests
2,230
3233507
def request(flow): flow.request.headers["x-requests-proxy"] = "http" def response(flow): flow.response.headers[b"x-requests-proxied"] = "http"
0
0
0
0
0
0
pybits/ptghci/magic/past.py
litxio/ptghci-engine
331
3233518
<filename>pybits/ptghci/magic/past.py import math import argparse import shlex from ptghci.response import Response from ptghci.highlight import hl class ArgParseException(Exception): def __init__(self, message): self.message = message class AP(argparse.ArgumentParser): def __init__(self, *args, **k...
0
0
0
0
0
0
test_project/test_docs.py
admariner/django-sql-dashboard
293
3233540
import pytest import pathlib import re docs_dir = pathlib.Path(__file__).parent.parent / "docs" widgets_md = (docs_dir / "widgets.md").read_text() widget_templates_dir = ( pathlib.Path(__file__).parent.parent / "django_sql_dashboard" / "templates" / "django_sql_dashboard" / "widgets" ) header_re = ...
0
0
0
0
0
0
talos/model/output_layer.py
zazula/talos
1,536
3233577
def output_layer(task, last_activation, y_train, y_val) -> tuple[object, object]: import numpy as np # output layer if task == 'binary': activation = last_activation last_neuron = 1 elif task == 'multi_class': activation = last_activation last_neuron = len(np.unique(np...
0
1
0
0
1
0
RecoBTag/PerformanceDB/python/Pool_MISTAGSSVHEM.py
ckamtsikis/cmssw
852
3233580
<reponame>ckamtsikis/cmssw import FWCore.ParameterSet.Config as cms from CondCore.DBCommon.CondDBCommon_cfi import * PoolDBESSource = cms.ESSource("PoolDBESSource", CondDBCommon, toGet = cms.VPSet( # # working points # cms.PSet( record = ...
0
0
0
0
0
0
tests/api/endpoints/test_send_upload_link.py
weimens/seahub
420
3233627
#coding: UTF-8 import json from mock import patch from django.core import mail from django.urls import reverse from django.test import override_settings from seahub.utils import IS_EMAIL_CONFIGURED from seahub.share.models import UploadLinkShare from seahub.profile.models import Profile from seahub.profile.utils impor...
0
0
0
0
0
0
framework/generated/base_generators/base_struct_handle_mappers_body_generator.py
jbmcgee/gfxreconstruct
175
3233631
#!/usr/bin/python3 -i # # Copyright (c) 2019-2020 Valve Corporation # Copyright (c) 2019-2020 LunarG, 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 wit...
0
3
0
0
3
0
applications/cli/util/k8s/k8s_statistics.py
nparkstar/nauta
390
3233658
<reponame>nparkstar/nauta # # 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 a...
0
0
0
0
0
0
src/build/android/gyp/bundletool.py
Mr-Sheep/naiveproxy
575
3233674
#!/usr/bin/env python # Copyright 2018 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. """Simple wrapper around the bundletool tool. Bundletool is distributed as a versioned jar file. This script abstracts the location an...
0
0
0
0
0
1
sp_api/api/product_fees/product_fees.py
TahaMagdy/python-amazon-sp-api
213
3233730
from __future__ import annotations from sp_api.base.helpers import sp_endpoint, fill_query_params from sp_api.base import Client, ApiResponse class ProductFees(Client): """ :link: https://github.com/amzn/selling-partner-api-docs/tree/main/references/product-fees-api """ @sp_endpoint('/products/fees/v...
15
3
0
0
18
0
Trakttv.bundle/Contents/Libraries/Shared/oem_framework/models/core/base/media.py
disrupted/Trakttv.bundle
1,346
3233732
from __future__ import annotations from oem_framework.core.helpers import convert_keys_to_string from oem_framework.models.core.base.mapping import BaseMapping from oem_framework.models.core.base.model import Model from oem_framework.models.core.mixins.names import NamesMixin from bencode import bencode import collect...
7
6
2
0
15
0
calculator/calc.py
thepabloaguilar/lispy
118
3233751
################ Calculator: derived from lis.py for Python 3.10 ## (c) <NAME>, 2010-18; See http://norvig.com/lispy.html ## adapted by <NAME> with type hints and pattern matching. ################ Imports and Types import math import operator as op import random from collections import ChainMap from collections.abc...
8
9
6
0
23
0
mathematics_dataset/modules/calculus.py
PhysicsTeacher13/Mathematics_Dataset
1,577
3233780
# Copyright 2018 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
2
10
0
0
12
0
pypsrp/complex_objects.py
Samathy/pypsrp
228
3233785
# Copyright: (c) 2018, <NAME> (@jborean93) <<EMAIL>> # MIT License (see LICENSE or https://opensource.org/licenses/MIT) from copy import deepcopy from pypsrp._utils import to_string, version_equal_or_newer class ObjectMeta(object): def __init__(self, tag="*", name=None, optional=False, object=None): se...
0
0
0
0
0
1
analysis_engine/yahoo/extract_df_from_redis.py
virdesai/stock-analysis-engine
819
3233798
""" Extract an Yahoo dataset from Redis (S3 support coming soon) and load it into a ``pandas.DataFrame`` Supported environment variables: :: # verbose logging in this module export DEBUG_EXTRACT=1 # verbose logging for just Redis operations in this module export DEBUG_REDIS_EXTRACT=1 # verbose ...
0
0
0
0
0
0
Chapter4/gender-mapping.py
DSPOWER93/Course_AWS_Certified_Machine_Learning
123
3233808
import sys from awsglue.transforms import * from awsglue.utils import getResolvedOptions from pyspark.context import SparkContext from awsglue.context import GlueContext from awsglue.job import Job from itertools import chain from pyspark.sql.functions import create_map, lit from awsglue.dynamicframe import DynamicFram...
0
0
0
0
0
0
ansible/roles/vm_set/files/vm_resumer.py
shubav/sonic-mgmt
132
3233817
<reponame>shubav/sonic-mgmt<filename>ansible/roles/vm_set/files/vm_resumer.py<gh_stars>100-1000 #!/usr/bin/python # When there're no enough space on the disk, libvirt pauses some VMs. # This tool unpauses all paused VMs and rewire all connections back from pprint import pprint import subprocess from collections impo...
0
0
0
0
0
0
utils/preprocess/get_continuous_data_times.py
sf-wilbur/FAST
126
3233825
<reponame>sf-wilbur/FAST import glob import os import sys from obspy import read from obspy import UTCDateTime if __name__ == '__main__': network = sys.argv[1] station = sys.argv[2] channel = sys.argv[3] print network, station, channel # ------------------- INPUTS --------------------------------------...
0
0
0
0
0
0
example.py
BruegelN/svg3d
286
3233876
import numpy, svg3d, pyrr, math def get_octahedron_faces() -> object: f = math.sqrt(2.0) / 2.0 verts = numpy.float32( [(0, -1, 0), (-f, 0, f), (f, 0, f), (f, 0, -f), (-f, 0, -f), (0, 1, 0)] ) triangles = numpy.int32( [ (0, 2, 1), (0, 3, 2), (0, 4, 3)...
0
1
0
0
1
0
pymo/writers.py
onyalcin/PyMO
224
3233931
<filename>pymo/writers.py import numpy as np import pandas as pd class BVHWriter(): def __init__(self): pass def write(self, X, ofile): # Writing the skeleton info ofile.write('HIERARCHY\n') self.motions_ = [] self._printJoint(X, X.root_name, 0, of...
0
0
0
0
0
0
Data Structures/Stack/Python/Infix_postfix.py
abdzitter/Daily-Coding-DS-ALGO-Practice
289
3233936
<filename>Data Structures/Stack/Python/Infix_postfix.py class Convert: def __init__(self,n): self.top=-1 self.n=n self.array=[] self.output=[] self.precedence={'+':1,'-':1,'*':2,'/':2,'^':3} def isEmpty(self): if self.top==-1: return True else: return False def peek...
0
0
0
0
0
0
tests/Distributions/__init__.py
marrov/UQpy
132
3233943
from tests.Distributions import *
0
0
0
0
0
0
examples/zengl_logo.py
szabolcsdombi/zengl
116
3233944
import zengl from PIL import Image from window import Window window = Window(1280, 640) ctx = zengl.context() image = ctx.image(window.size, 'rgba8unorm-srgb', samples=16) depth = ctx.image(window.size, 'depth24plus', samples=16) image.clear_value = (0.0, 0.0, 0.0, 0.0) ctx.includes['perspective'] = ''' mat4 pe...
0
0
0
0
0
0
vispy/scene/__init__.py
hmaarrfk/vispy
2,617
3233948
<reponame>hmaarrfk/vispy<filename>vispy/scene/__init__.py # -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The vispy.scene subpackage provides high-level, flexible, and easy to use functionality for creatin...
0
0
0
0
0
0
src/python/common/error.py
annihilatethee/seedsync
255
3233976
<gh_stars>100-1000 # Copyright 2017, <NAME>, All rights reserved. class AppError(Exception): """ Exception indicating an error """ pass class ServiceExit(AppError): """ Custom exception which is used to trigger the clean exit of all running threads and the main program. """ pass ...
0
0
0
0
0
0
uniplot/options.py
olavolav/textplot
156
3234010
<reponame>olavolav/textplot<filename>uniplot/options.py from dataclasses import dataclass, field from typing import List, Optional import numpy as np # type: ignore def _default_gridlines() -> List[float]: return [0.0] def _default_lines() -> List[bool]: return [False] @dataclass class Options: # Col...
0
0
0
0
0
0
scripts/external_libs/scapy-2.4.5/scapy/contrib/ife.py
dariusgrassi/trex-core
250
3234024
<reponame>dariusgrassi/trex-core # scapy.contrib.description = ForCES Inter-FE LFB type (IFE) # scapy.contrib.status = loads """ IFE - ForCES Inter-FE LFB type ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :author: <NAME>, <EMAIL> :license: GPLv2 This module is free software; you can redistribute it an...
0
0
0
0
0
0
autosar/util/dcf.py
Warchant/autosar
199
3234048
from __future__ import annotations import ntpath import os import sys import xml.etree.ElementTree as ElementTree import autosar dvg_xml = """<?xml version="1.0" encoding="utf-8"?> <DVG> <Version>1.0</Version> <Contents> </Contents> </DVG>""" class XMLWriterSimple: def __init__(self): ...
11
10
0
41
62
0
docs/source/generate_opt_presets.py
twstewart42/ParlAI
9,228
3234051
<gh_stars>1000+ #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import pkg_resources from parlai.opt_presets.docs import PRESET_DESCRIPTIONS fout = open('...
0
0
0
0
0
0
packages/grid/backend/grid/core/celery_app.py
vishalbelsare/PySyft
8,428
3234056
# future from __future__ import annotations # third party from celery import Celery # relative from . import celery_config from . import celery_serde # noqa: 401 # backend is required to persist tasks celery_app = Celery( "worker", broker="amqp://guest@queue//", ) celery_app.config_from_object(celery_config...
0
0
0
0
0
0
hearthbreaker/cards/spells/mage.py
souserge/hearthbreaker
429
3234060
<filename>hearthbreaker/cards/spells/mage.py import copy from hearthbreaker.cards.base import SecretCard, SpellCard from hearthbreaker.cards.minions.mage import SpellbenderMinion, MirrorImageMinion from hearthbreaker.constants import CHARACTER_CLASS, CARD_RARITY from hearthbreaker.tags.base import BuffUntil, Buff from ...
0
0
0
0
0
0
agate/computations/__init__.py
andriyor/agate
663
3234082
#!/usr/bin/env python """ Computations create a new value for each :class:`.Row` in a :class:`.Table`. When used with :meth:`.Table.compute` these new values become a new column. For instance, the :class:`.PercentChange` computation takes two column names as arguments and computes the percentage change between them fo...
0
0
0
0
0
0
scar/parser/cli/parents.py
WinstonN/scar
589
3234083
# Copyright (C) GRyCAP - I3M - UPV # # 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...
0
5
0
0
5
0
muddery/server/events/event_actions/action_accept_quest.py
dongwudanci/muddery
127
3234098
<reponame>dongwudanci/muddery """ Event action. """ from muddery.server.events.base_event_action import BaseEventAction from muddery.server.database.worlddata.worlddata import WorldData from muddery.server.utils.localized_strings_handler import _ class ActionAcceptQuest(BaseEventAction): """ Accept a quest. ...
0
0
0
0
0
0
DQMOffline/L1Trigger/test/customDQM.py
ckamtsikis/cmssw
852
3234099
<reponame>ckamtsikis/cmssw import FWCore.ParameterSet.Config as cms def customise(process): # process.dtDataIntegrityUnpacker.inputLabel = cms.untracked.InputTag('rawDataCollector') # process.DQMOfflineCosmics.remove(process.hcalOfflineDQMSource) # process.load("FWCore.Modules.printContent_cfi") # proc...
0
0
0
0
0
0
tests/optimizers/test_local_best.py
goncalogteixeira/pyswarns
959
3234103
<filename>tests/optimizers/test_local_best.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Import modules import pytest import numpy as np # Import from pyswarms from pyswarms.single import LocalBestPSO from pyswarms.utils.functions.single_obj import sphere from .abc_test_optimizer import ABCTestOptimizer class...
0
0
0
0
0
0
tests/integration/html/test_daily_box_scores_page.py
tttgm/basketball_reference_web_scraper
325
3234108
<reponame>tttgm/basketball_reference_web_scraper from unittest import TestCase import requests from lxml import html from basketball_reference_web_scraper.html import DailyBoxScoresPage class TestDailyBoxScoresPage(TestCase): def setUp(self): response = requests.get('https://www.basketball-reference.com...
0
0
0
0
0
0
var/spack/repos/builtin/packages/r-fastmap/package.py
BenWibking/spack
2,360
3234123
<reponame>BenWibking/spack # 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 RFastmap(RPackage): """Fast Implementation of a Key-Value Store...
0
0
0
0
0
0