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
third_party/chromite/cbuildbot/stages/scheduler_stages.py
zipated/src
2,151
3226359
# -*- coding: utf-8 -*- # Copyright 2016 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module containing the scheduler stages.""" from __future__ import print_function import json import os import time from chro...
3
5
0
0
8
0
newrelic_plugin_agent/plugins/riak.py
channelgrabber/newrelic-plugin-agent
248
3226385
""" Riak Plugin """ import logging from newrelic_plugin_agent.plugins import base LOGGER = logging.getLogger(__name__) class Riak(base.JSONStatsPlugin): DEFAULT_PATH: str = '/stats' GUID: str = 'com.meetme.newrelic_riak_agent' def add_datapoints(self, stats): """Add all of the data points for...
0
0
2
0
2
0
video_cropper/video_cropper.py
anshul2807/Automation-scripts
496
3226393
import ffmpeg import argparse import sys import os def to_int(a, rel_to) -> object: ''' Converts string to integer. If string contains "%" it converts it to a float and multiplies by rel_to EG: 50% -> 0.5*rel_to ''' if type(a) == int: return a else: if '%' in a: ...
0
1
0
0
1
0
autogoal/experimental/stacking.py
lsuarez98/autogoal
157
3226395
<gh_stars>100-1000 # from autogoal.contrib import ensemble import numpy as np from sklearn.svm import SVC from sklearn.naive_bayes import GaussianNB from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier class StackingEnsemble: def __init__(self, layers=None, final=Non...
0
0
0
0
0
0
src/app/settings.py
denkasyanov/education-backend
151
3226401
<gh_stars>100-1000 from split_settings.tools import include from app.conf.environ import env # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = env('SECR...
0
0
0
0
0
0
lib/datasets/preprocess/face/celebmask_partition.py
shampooma/openseg.pytorch
1,069
3226404
#!/usr/bin/python # -*- encoding: utf-8 -*- # Reference: https://github.com/switchablenorms/CelebAMask-HQ/blob/master/face_parsing/Data_preprocessing/g_mask.py # import os import pdb import shutil import pandas as pd from shutil import copyfile def make_folder(path): if not os.path.exists(os.path.join...
0
0
0
0
0
0
ote_sdk/ote_sdk/entities/metrics.py
opencv/openvino_training_extensions
775
3226412
"""This module implements the Metric entities""" # Copyright (C) 2021-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # import abc import datetime import logging import math from enum import Enum from typing import Generic, List, Optional, Sequence, TypeVar, Union import numpy as np from ote_sdk.utils....
56
40
21
6
123
0
2_ExtractingInformation/solution_2_0.py
nathanawmk/neural-network-hacking
2,548
3226445
''' Solution to Exercise: The idea is to add a small network infront of the target we want to bypass. We want to train that small network to generate just one single image that gives us access. This sounds harder than it is: 1. Load up the target network and make it un-trainable (we don't want to change it) 2. Ad...
0
0
0
0
0
0
ryu/lib/bfdlib.py
umkcdcrg01/ryu_openflow
269
3226449
# Copyright (C) 2014 Xinguard, Inc. # Copyright (C) 2013 Nippon Telegraph and Telephone 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/LICE...
22
11
4
19
56
0
gfauto/gfauto/run_amber_android.py
KishkinJ10/graphicsfuzz
519
3226456
<gh_stars>100-1000 # -*- coding: utf-8 -*- # Copyright 2019 The GraphicsFuzz Project Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2...
0
0
0
0
0
0
tests/testcase.py
ProAek11/pyngrok
296
3226466
<reponame>ProAek11/pyngrok import logging import os import platform import shutil import sys import unittest import uuid from copy import copy import psutil from psutil import AccessDenied, NoSuchProcess from pyngrok.conf import PyngrokConfig from pyngrok import ngrok, installer, conf from pyngrok import process __a...
0
0
0
0
0
0
lncrawl/bots/console/login_info.py
mesmerlord/lncrawler
710
3226480
<reponame>mesmerlord/lncrawler # -*- coding: utf-8 -*- from typing import Optional, Tuple from questionary import prompt from ...core.arguments import get_args def get_login_info(self) -> Optional[Tuple[str, str]]: '''Returns the (email, password) pair for login''' args = get_args() if args.login: ...
0
0
0
0
0
0
dymos/examples/racecar/Track.py
kaushikponnapalli/dymos
104
3226481
<filename>dymos/examples/racecar/Track.py import numpy as np class Track: def __init__(self, segments): self.segments = segments self.cornerspeeds = np.zeros(len(segments), dtype=np.complex) def get_segment_type(self, num): return self.segments[num][0] def get_segment_length(self...
0
0
0
0
0
0
pandas/tests/frame/methods/test_compare.py
CJL89/pandas
28,899
3226493
import numpy as np import pytest import pandas as pd import pandas._testing as tm @pytest.mark.parametrize("align_axis", [0, 1, "index", "columns"]) def test_compare_axis(align_axis): # GH#30429 df = pd.DataFrame( {"col1": ["a", "b", "c"], "col2": [1.0, 2.0, np.nan], "col3": [1.0, 2.0, 3.0]}, ...
0
0
0
0
0
0
tests/dbobject/test_matview.py
renesugar/Pyrseas
269
3226525
<reponame>renesugar/Pyrseas<gh_stars>100-1000 # -*- coding: utf-8 -*- """Test materialized views""" import pytest from pyrseas.testutils import DatabaseToMapTestCase from pyrseas.testutils import InputMapToSqlTestCase, fix_indent CREATE_TABLE = "CREATE TABLE t1 (c1 INTEGER, c2 TEXT, c3 INTEGER)" VIEW_STMT = "SELECT ...
0
0
0
0
0
0
data/external/repositories/132416/caffe-windows-master/examples/kaggle-bowl/caffe_windows/utils/shuffle_lines.py
Keesiu/meta-kaggle
110
3226528
<filename>data/external/repositories/132416/caffe-windows-master/examples/kaggle-bowl/caffe_windows/utils/shuffle_lines.py #!/usr/bin/env python """ @file shuffle_lines.py @brief shuffle lines in a file @author ChenglongChen """ import sys import csv import random import numpy as np from string import atoi def main(...
0
0
0
0
0
0
django_gamification/migrations/0013_auto_20180324_0605.py
hhenrichsen/django-gamification
169
3226542
<filename>django_gamification/migrations/0013_auto_20180324_0605.py<gh_stars>100-1000 # Generated by Django 2.0.3 on 2018-03-24 06:05 from django.db import migrations import django.db.models.manager class Migration(migrations.Migration): dependencies = [ ('django_gamification', '0012_auto_20171006_0759'...
0
0
0
0
0
0
samples/detach_disk_from_vm.py
ArpitSharma2800/pyvmomi-community-samples
931
3226562
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Written by <NAME> # GitHub: https://github.com/carceneaux # Email: <EMAIL> # Website: http://arsano.ninja # # Note: Example code For testing purposes only # # This code has been released under the terms of the Apache-2.0 license # http://opensource.org/licenses/Apache-2...
0
3
0
0
3
0
exercises/protein-translation/protein_translation.py
kishankj/python
1,177
3226590
def proteins(strand): pass
0
0
0
0
0
0
python/cucim/src/cucim/clara/converter/tiff.py
aasthajh/cucim
131
3226592
<gh_stars>100-1000 # # Copyright (c) 2020, <NAME>ATION. # 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...
0
0
0
0
0
0
tests/basics/bytes.py
peterson79/pycom-micropython-sigfox
303
3226603
<filename>tests/basics/bytes.py # literals print(b'123') print(br'123') print(rb'123') print(b'\u1234') # construction print(bytes()) print(bytes(b'abc')) a = b"123" print(a) print(str(a)) print(repr(a)) print(a[0], a[2]) print(a[-1]) print(str(a, "utf-8")) print(str(a, "utf-8", "ignore")) try: str(a, "utf-8", "i...
0
0
0
0
0
0
recipes/Python/577920_Blocks_for_python/recipe-577920.py
tdiprima/code
2,023
3226609
''' @author: <NAME> ''' def block(code): code = 'def anon(*args, **kw):\n'+'\n'.join( "\t\t%s" % line for line in code.split('\n') if line.strip()) env = {} exec code in env return env['anon'] #@UndefinedVariable suppressed if __name__ == '__main__': from threading import Thr...
0
0
0
0
0
0
hello.py
marfgold1/HelloWorld
271
3226613
print('Hello World')
0
0
0
0
0
0
test-crates/pyo3-bin/check_installed/check_installed.py
PyO3/pyo3-pack
135
3226637
import os import platform import sys from subprocess import check_output def main(): if platform.system().lower() == "windows": # Add sys.base_prefix which contains python3y.dll to PATH # otherwise running `pyo3-bin` might return exit code 3221225781 path = os.environ["PATH"] path ...
0
0
0
0
0
0
flit_core/flit_core/tests/test_wheel.py
yoannmos/flit
156
3226659
<reponame>yoannmos/flit from pathlib import Path from zipfile import ZipFile from testpath import assert_isfile from flit_core.wheel import make_wheel_in, main samples_dir = Path(__file__).parent / 'samples' def test_licenses_dir(tmp_path): # Smoketest for https://github.com/pypa/flit/issues/399 info = make...
0
0
0
0
0
0
flake8_quotes/__init__.py
zheller/flake8-quotes
136
3226662
from __future__ import annotations import optparse import tokenize import warnings # Polyfill stdin loading/reading lines # https://gitlab.com/pycqa/flake8-polyfill/blob/1.0.1/src/flake8_polyfill/stdin.py#L52-57 try: from flake8.engine import pep8 stdin_get_value = pep8.stdin_get_value readlines = pep8.rea...
2
7
3
0
12
0
galpy/potential/linearPotential.py
gusbeane/galpy
147
3226665
from __future__ import annotations from __future__ import division, print_function import os, os.path import copy import pickle import numpy from ..util import plot, conversion, config from .Potential import PotentialError, flatten from ..util.conversion import physical_conversion,\ potential_physical_input, physi...
21
17
0
9
47
0
pdf/to_pdf.py
VladPodilnyk/Kalman-and-Bayesian-Filters-in-Python
12,315
3226668
<gh_stars>1000+ import nbconvert.exporters.pdf as pdf import sys if len(sys.argv) == 2: name = sys.argv[1] else: name = 'book.tex' f = open(name, 'r', encoding="iso-8859-1") filedata = f.read() f.close() newdata = filedata.replace('\chapter{Preface}', '\chapter*{Preface}') f = open(name, 'w', encoding=...
0
0
0
0
0
0
riko/modules/rssitembuilder.py
nerevu/riko
1,716
3226685
<reponame>nerevu/riko # -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko.modules.rssitembuilder ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides functions for creating a single-item RSS data source Can be used to create a single new RSS item from scratch, or reformat and restructure an existing item into an RSS structure...
0
0
0
0
0
0
wafw00f/plugins/secureiis.py
84KaliPleXon3/EnableSecurity-wafw00f
3,069
3226710
#!/usr/bin/env python ''' Copyright (C) 2020, WAFW00F Developers. See the LICENSE file for copying permission. ''' NAME = 'eEye SecureIIS (BeyondTrust)' def is_waf(self) -> bool: schemes = [ self.matchContent(r'SecureIIS is an internet security application'), self.matchContent(r'Download SecureII...
0
1
0
0
1
0
code/countwords.py
nqb/make-novice
152
3226711
#!/usr/bin/env python import sys DELIMITERS = ". , ; : ? $ @ ^ < > # % ` ! * - = ( ) [ ] { } / \" '".split() def load_text(filename) -> object: """ Load lines from a plain-text file and return these as a list, with trailing newlines stripped. """ with open(filename) as input_fd: lines = ...
3
6
0
0
9
0
espnet2/layers/global_mvn.py
texpomru13/espnet
5,053
3226740
from pathlib import Path from typing import Tuple from typing import Union import numpy as np import torch from typeguard import check_argument_types from espnet.nets.pytorch_backend.nets_utils import make_pad_mask from espnet2.layers.abs_normalize import AbsNormalize from espnet2.layers.inversible_interface import I...
8
3
0
0
11
0
tests/integration/plugins/idor_test.py
bbhunter/fuzz-lightyear
169
3226768
from fuzz_lightyear.request import FuzzingRequest from fuzz_lightyear.response import ResponseSequence from fuzz_lightyear.runner import validate_sequence def test_basic(mock_client): responses = validate_sequence( [ FuzzingRequest( tag='basic', operation_id='ge...
0
0
0
0
0
0
scripts/examples/OpenMV/06-Video-Recording/imageio_memory.py
jiskra/openmv
1,761
3226785
# Image Memory Stream I/O Example # # This example shows how to use the ImageIO stream to record frames in memory and play them back. # Note: While this should work on any board, the board should have an SDRAM to be of any use. import sensor, image, time # Number of frames to pre-allocate and record N_FRAMES = 500 se...
0
0
0
0
0
0
release/stubs.min/System/Runtime/InteropServices/__init___parts/InterfaceTypeAttribute.py
htlcnn/ironpython-stubs
182
3226797
class InterfaceTypeAttribute(Attribute,_Attribute): """ Indicates whether a managed interface is dual,dispatch-only,or IUnknown -only when exposed to COM. InterfaceTypeAttribute(interfaceType: ComInterfaceType) InterfaceTypeAttribute(interfaceType: Int16) """ def __init__(self,*args): """ x.__in...
0
0
0
0
0
0
OpenAttack/metric/algorithms/jaccard_word.py
e-tornike/OpenAttack
444
3226803
<filename>OpenAttack/metric/algorithms/jaccard_word.py<gh_stars>100-1000 from .base import AttackMetric from ...tags import * from ...text_process.tokenizer import Tokenizer class JaccardWord(AttackMetric): NAME = "Jaccard Word Similarity" def __init__(self, tokenizer : Tokenizer): """ Ar...
0
0
0
0
0
0
bindings/python/tests/test_bool.py
kamino/dragonffi
523
3226820
<gh_stars>100-1000 # Copyright 2018 <NAME> <<EMAIL>> # # 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 la...
0
0
0
0
0
0
Packs/DemistoRESTAPI/Scripts/SetIRProceduresMarkdown/SetIRProceduresMarkdown.py
diCagri/content
799
3226835
from CommonServerPython import * import traceback SECTIONS_TO_KEEP = ('Threat Hunting', 'Mitigation', 'Remediation', 'Eradication') HEADER_TRANSFORM = {'id': 'Task ID', 'name': 'Task Name', 'state': 'Task State', 'completedDate': 'Completion Time'} ''' COMMAND FUNCTION ''' def add_url_to_tasks(tasks: Dict, workpl...
5
4
1
0
10
0
hikari/events/message_events.py
Victorsitou/hikari
520
3226858
# -*- coding: utf-8 -*- # cython: language_level=3 # Copyright (c) 2020 Nekokatt # Copyright (c) 2021 davfsa # # 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 w...
0
41
32
0
73
0
twiml/voice/pay/pay-6/pay-6.6.x.py
deshartman/api-snippets
234
3226861
<reponame>deshartman/api-snippets from twilio.twiml.voice_response import Pay, Prompt, VoiceResponse, Say response = VoiceResponse() pay = Pay() prompt = Prompt(for_='payment-card-number') prompt.say('Please enter your 16 digit Visa or Mastercard number.') pay.append(prompt) response.append(pay) print(response)
0
0
0
0
0
0
samples/MoonWarriors/frameworks/runtime-src/proj.android/build_native.py
LaudateCorpus1/cocos2d-x-samples
1,587
3226862
#!/usr/bin/python ''' build_native.py This script will copy resources to assets and build native code with NDK. ''' import sys import os, os.path import shutil from optparse import OptionParser def get_num_of_cpu(): ''' The build process can be accelerated by running multiple concurrent job processes using the -...
0
0
0
0
0
0
src/log-analytics/azext_loganalytics/_format.py
Mannan2812/azure-cli-extensions
207
3226879
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
0
2
0
0
2
0
c7n/resources/workspaces.py
StevenGunn/cloud-custodian
1,787
3226884
<reponame>StevenGunn/cloud-custodian<filename>c7n/resources/workspaces.py # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import functools import itertools import jmespath from c7n.actions import BaseAction from c7n.filters import ValueFilter from c7n.filters.kms import KmsRelatedFilter ...
0
0
0
0
0
0
venv/Lib/site-packages/matplotlib/tests/test_backend_pdf.py
Kaalotaibi37/Minimum-Cost-Network-of-Computers
603
3226885
<filename>venv/Lib/site-packages/matplotlib/tests/test_backend_pdf.py<gh_stars>100-1000 import datetime import decimal import io import os from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import matplotlib as mpl from matplotlib import dviread, pyplot as plt, checkdep_...
0
0
0
0
0
0
autobahntestsuite/autobahntestsuite/testdb.py
rishabh-bector/autobahn-testsuite
595
3226887
<filename>autobahntestsuite/autobahntestsuite/testdb.py ############################################################################### ## ## Copyright (c) Crossbar.io Technologies GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the Li...
0
0
0
0
0
0
tests/h/views/admin/groups_test.py
pombredanne/h
2,103
3226896
from __future__ import annotations from unittest import mock import pytest from h_matchers import Any from h.traversal.group import GroupContext from h.views.admin import groups from h.views.admin.groups import GroupCreateViews, GroupEditViews class FakeForm: appstruct: None = None def set_appstruct(self, ...
0
24
1
0
25
0
code/posenet-py-torch/image_demo.py
sunyikang/paper
253
3226911
import cv2 import time import argparse import os import torch import posenet parser = argparse.ArgumentParser() parser.add_argument('--model', type=int, default=101) parser.add_argument('--scale_factor', type=float, default=1.0) parser.add_argument('--notxt', action='store_true') parser.add_argument('--image_dir', t...
0
0
0
0
0
0
examples/pervasive/modules/masked_convolution.py
EricLina/attn2d
490
3226931
from __future__ import annotations import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as cp from fairseq.incremental_decoding_utils import with_incremental_state @with_incremental_state class MaskedConvolution(nn.Conv2d): """ 2d convolution with masked kernel """ ...
8
4
0
0
12
0
OpenMatch/models/conv_knrm.py
vishalbelsare/OpenMatch
403
3226949
from typing import List, Tuple import torch import torch.nn as nn from OpenMatch.modules.embedders import Embedder from OpenMatch.modules.encoders import Conv1DEncoder from OpenMatch.modules.matchers import KernelMatcher class ConvKNRM(nn.Module): def __init__( self, vocab_size: int, embe...
11
2
0
0
13
0
sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/prediction/operations/_custom_vision_prediction_client_operations.py
rsdoherty/azure-sdk-for-python
2,728
3226975
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
24
8
0
0
32
0
src/ralph/data_center/migrations/0006_rack_require_position.py
DoNnMyTh/ralph
1,668
3226984
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('data_center', '0005_auto_20160121_1133'), ] operations: list[object] = [ migrations.AddField( ...
0
0
2
0
2
0
flows/tests/__init__.py
sergioisidoro/django-flows
104
3226986
from django.conf import settings settings.configure()
0
0
0
0
0
0
evaluate.py
VisualMine/PlaneNet
372
3227032
import tensorflow as tf import numpy as np np.set_printoptions(precision=2, linewidth=200) import cv2 import os import time import sys #import tf_nndistance import argparse import glob import PIL import scipy.ndimage as ndimage sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from utils imp...
0
8
0
0
8
0
gpytorch/means/__init__.py
llguo95/gpytorch
2,673
3227035
#!/usr/bin/env python3 from .constant_mean import ConstantMean from .constant_mean_grad import ConstantMeanGrad from .linear_mean import LinearMean from .mean import Mean from .multitask_mean import MultitaskMean from .zero_mean import ZeroMean __all__ = ["Mean", "ConstantMean", "ConstantMeanGrad", "LinearMean", "Mul...
0
0
0
0
0
0
setup.py
zeiss-microscopy/BSConv
132
3227037
<gh_stars>100-1000 import glob import os.path import re import setuptools package_name = "bsconv" package_dir = os.path.abspath(os.path.dirname(__file__)) source_dir = os.path.join(package_dir, package_name) bin_dir = os.path.join(package_dir, "bin") def get_version(): version_filename = os.path.join(source_...
0
0
0
0
0
0
tests/tracer/test_span.py
melancholy/dd-trace-py
308
3227056
<reponame>melancholy/dd-trace-py # -*- coding: utf-8 -*- import re import sys import time from unittest.case import SkipTest import mock import pytest import six from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY from ddtrace.constants import ENV_KEY from ddtrace.constants import ERROR_MSG from ddtrace.constants...
0
0
0
0
0
0
tests/conftest.py
P-EB/aiosmtplib
265
3227057
from __future__ import annotations """ Pytest fixtures and config. """ import asyncio import email.header import email.message import email.mime.multipart import email.mime.text import socket import ssl import sys import traceback from pathlib import Path import hypothesis import pytest from aiosmtplib import SMTP, S...
3
44
0
0
47
0
examples/matplotlib2/matplotlib_example.py
ardovm/wxGlade
225
3227058
<filename>examples/matplotlib2/matplotlib_example.py<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: UTF-8 -*- import wx import matplotlib_GUI class MyFrame(matplotlib_GUI.MyFrame): def on_button_plot(self, event): import numpy xmin = xmax = step = None try: xmin = fl...
0
0
0
0
0
0
env/lib/python3.8/site-packages/plotly/graph_objs/layout/template/data/_choropleth.py
acrucetta/Chicago_COVI_WebApp
11,750
3227078
<filename>env/lib/python3.8/site-packages/plotly/graph_objs/layout/template/data/_choropleth.py from plotly.graph_objs import Choropleth
0
0
0
0
0
0
setup.py
KennethNielsen/llvmpy
140
3227083
<reponame>KennethNielsen/llvmpy<gh_stars>100-1000 from __future__ import print_function import os import sys from subprocess import Popen, PIPE, check_call from distutils.core import setup, Extension import versioneer versioneer.versionfile_source = 'llvm/_version.py' versioneer.versionfile_build = 'llvm/_version.py...
0
0
0
0
0
0
detection/models/detectors/faster_rcnn.py
pskurochkin/tf-eager-fasterrcnn
106
3227089
from __future__ import annotations import tensorflow as tf from detection.models.backbones import resnet from detection.models.necks import fpn from detection.models.rpn_heads import rpn_head from detection.models.bbox_heads import bbox_head from detection.models.roi_extractors import roi_align from detection.models.d...
1
1
0
21
23
0
deep/__init__.py
imatge-upc/saliency
210
3227101
from __future__ import annotations import os import sys import cv2 import numpy as np #PYCAFFE_DIR = '/home/kevin/Development/caffe3/python' PYCAFFE_DIR = '/usr/local/opt/caffe-2015-07/python' def _create_net(specfile, modelfile) -> object: if not PYCAFFE_DIR in sys.path: sys.path.insert(0, PYCAFFE_DIR) ...
10
6
2
0
18
0
Chapter18/hw/libhw/hw_sensors/l3g4200d.py
haohaoxiao/Deep-Reinforcement-Learning-Hands-On-Second-Edition
621
3227104
""" Hyroscope sensor, datasheet: http://files.amperka.ru/datasheets/L3G4200D-hyroscope.pdf """ from . import st_family class L3G4200D(st_family.STSensor): WHOAMI_VAL: int = 0xD3 L3G4200D_SCALE_250DPS_MUL: float = 0.00875 L3G4200D_DEG_TO_RAD: float = 0.01745329252 def __init__(self, i2c, addr: int=104...
1
5
3
0
9
0
lldb/examples/summaries/cocoa/CFBitVector.py
medismailben/llvm-project
2,338
3227111
from __future__ import annotations """ LLDB AppKit formatters Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. See https://llvm.org/LICENSE.txt for license information. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """ from __future__ import print_function # summary provider for...
0
8
0
0
8
0
earthpy/tests/test_clip.py
nkorinek/earthpy
350
3227120
<reponame>nkorinek/earthpy<gh_stars>100-1000 """Tests for the clip module.""" import pytest import numpy as np from shapely.geometry import Polygon, Point, LineString import geopandas as gpd import earthpy.clip as cl @pytest.fixture def point_gdf(): """Create a point GeoDataFrame.""" pts = np.array([[2, 2], ...
0
0
0
0
0
0
ad_examples/aad/test_concept_drift.py
matwey/ad_examples
773
3227129
import numpy as np import logging from ..common.utils import get_command_args, configure_logger from ..common.gen_samples import read_anomaly_dataset from .aad_globals import ( IFOR_SCORE_TYPE_NEG_PATH_LEN, ENSEMBLE_SCORE_LINEAR, AAD_IFOREST, INIT_UNIF ) from .data_stream import DataStream, IdServer from .random...
0
1
0
0
1
0
kur/utils/logcolor.py
greedyuser/kur
867
3227186
""" Copyright 2016 Deepgram 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 distri...
0
2
0
0
2
0
src/einsteinpy/plotting/hypersurface/__init__.py
bibek22/einsteinpy
485
3227187
<reponame>bibek22/einsteinpy from einsteinpy.plotting.hypersurface.core import HypersurfacePlotter
0
0
0
0
0
0
easyrobust/easyrobust/models/DrViT.py
thu-ml/realsafe
107
3227194
import math import logging from functools import partial from collections import OrderedDict from copy import deepcopy from einops import rearrange import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_INCEPTI...
0
0
0
0
0
1
lessons/projects/snake/snake_game.py
befeleme/naucse.python.cz
482
3227223
<filename>lessons/projects/snake/snake_game.py import random from pathlib import Path import pyglet TILE_SIZE = 64 TILES_DIRECTORY = Path('static/snake-tiles') class State: def __init__(self): self.snake = [(0, 0), (1, 0)] self.snake_direction = 0, 1 self.width = 10 self.height = ...
0
0
0
0
0
0
hkust-gmission/gmission/controllers/task_controller.py
gmission/gmission
251
3227228
<filename>hkust-gmission/gmission/controllers/task_controller.py<gh_stars>100-1000 # -*- coding: utf-8 -*- __author__ = 'chenzhao' from gmission.controllers.message_controller import send_request_messages import dateutil import dateutil.tz from gmission.controllers.payment_controller import pay_image, pay_choice from ...
0
0
0
0
0
0
examples/testGraph.py
Dfenestrator/GooPyCharts
242
3227229
from gpcharts import figure #simple line graph, as described in the readme. fig1 = figure() fig1.plot([8,7,6,5,4]) #another line graph, but with two data types. Also adding title fig2 = figure(title='Two lines',xlabel='Days',ylabel='Count',height=600,width=600) xVals = ['Mon','Tues','Wed','Thurs','Fri'] yVals = [[5,4...
0
0
0
0
0
0
pappyproxy/config.py
Jab2870/pappy-proxy
440
3227234
<gh_stars>100-1000 import copy import json default_config = """{ "listeners": [ {"iface": "127.0.0.1", "port": 8080} ], "proxy": {"use_proxy": false, "host": "", "port": 0, "is_socks": false} }""" class ProxyConfig: def __init__(self): self._listeners = [('127.0.0.1', 8080, None)...
0
0
0
0
0
0
cloudflare/cloudflare-warp-plus-aff.py
mutouxia/some-scripts
669
3227239
<filename>cloudflare/cloudflare-warp-plus-aff.py import requests import json import datetime import random import string referrer = "YOUR REFERRER ID" timesToLoop = 10 retryTimes = 5 def genString(stringLength): letters = string.ascii_letters + string.digits return ''.join(random.choice(letters) for i in ran...
0
0
0
0
0
0
test/gallery/location/flow/__init__.py
jeanqasaur/jeeves
253
3227255
import macropy.activate import testLocationFlow
0
0
0
0
0
0
Python_12_scrape_finance_news.py
rogerolowski/SimpleStockAnalysisPython
195
3227262
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Created on Fri Dec 4 19:30:37 2020 @author: Tin """ # pip install newspaper3k import newspaper from newspaper import Article url = "https://finance.yahoo.com/" # download and parse article article = Article(url) article.download() article.parse() #...
0
0
0
0
0
0
chrome/updater/test/service/win/rpc_handler.py
zealoussnow/chromium
14,668
3227268
<reponame>zealoussnow/chromium # Copyright 2021 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 logging import os import subprocess import sys import impersonate import proc_util import uac class UpdaterTestRPCHan...
0
0
0
0
0
0
libraries/botframework-connector/botframework/connector/aiohttp_bf_pipeline.py
andreikop/botbuilder-python
388
3227271
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from msrest.pipeline import AsyncPipeline, AsyncHTTPPolicy, SansIOHTTPPolicy from msrest.universal_http.async_requests import AsyncRequestsHTTPSender as Driver from msrest.pipeline.async_requests import ( AsyncRequestsCre...
1
0
0
0
1
0
traffic/data/eurocontrol/ddr/freeroute.py
sfo/traffic
209
3227373
<filename>traffic/data/eurocontrol/ddr/freeroute.py import re from functools import lru_cache from io import StringIO from pathlib import Path from typing import Any, Set, Tuple import geopandas as gpd import pandas as pd from shapely.geometry import MultiPoint from shapely.ops import unary_union from ....data impor...
0
0
0
0
0
0
python/fcdd/datasets/outlier_exposure/cifar100.py
kyungmin96/myfcdd
152
3227380
<reponame>kyungmin96/myfcdd from torchvision.datasets import CIFAR100 from torch.utils.data import DataLoader import torchvision.transforms as transforms import os.path as pt import torch import numpy as np def ceil(x: float): return int(np.ceil(x)) class MYCIFAR100(CIFAR100): """ Reimplements get_item to t...
0
0
0
0
0
0
src/condor_tests/test_auth_protocol_token.py
datadvance/htcondor
217
3227415
#!/usr/bin/env pytest import classad import htcondor import logging import os import shutil import subprocess import time from ornithology import * from pathlib import Path logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) @standup def config_dir(test_dir) -> object: config_dir = test_dir / "...
0
8
0
0
8
0
plugins/modules/nsxt_policy_ip_block.py
madhukark/ansible-for-nsxt
127
3227432
<filename>plugins/modules/nsxt_policy_ip_block.py<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 VMware, Inc. # SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIE...
0
0
0
0
0
0
astra/dataset/__init__.py
JieyuZ2/ASTRA
101
3227464
<gh_stars>100-1000 from .preprocessed_dataset import PreprocessedDataset
0
0
0
0
0
0
tests/document/test_document_service.py
roor0/dispatch
3,417
3227481
def test_get(session, document): from dispatch.document.service import get t_document = get(db_session=session, document_id=document.id) assert t_document.id == document.id def test_get_all(session, document): from dispatch.document.service import get_all t_documents = get_all(db_session=session...
0
0
0
0
0
0
utils/finetune_utils.py
alexa/bort
469
3227486
<reponame>alexa/bort # Copyright 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
0
0
0
0
0
0
examples/generation/docking_generation/guacamol_tdc/guacamol/guacamol/goal_directed_score_contributions.py
Shicheng-Guo/TDC
577
3227517
<gh_stars>100-1000 from typing import List, Tuple, Dict class ScoreContributionSpecification: """ Specifies how to calculate the score of a goal-directed benchmark. The global score will be a weighted average of top-x scores. This class specifies which top-x to consider and what the corresponding wei...
0
0
0
0
0
0
fandogh_cli/secret_commands.py
behroozmirzaie7/fandogh-cli
131
3227548
<gh_stars>100-1000 import click from fandogh_cli.fandogh_client.secrets_client import list_secret, create_secret, put_secret, delete_secret from .utils import format_text, TextStyle from .presenter import present from .base_commands import FandoghCommand @click.group("secret") def secret(): """Secret management c...
0
0
0
0
0
0
tests/test_w3w.py
termim/geocoder
1,506
3227555
#!/usr/bin/python # coding: utf8 import geocoder location = 'index.home.raft' ottawa = (45.4215296, -75.6971930) def test_w3w(): g = geocoder.w3w(location) assert g.ok osm_count, fields_count = g.debug()[0] assert osm_count == 0 assert fields_count >= 7 def test_w3w_reverse(): g = geocoder....
0
0
0
0
0
0
pyxelate/pal.py
mdwelsh/pyxelate
1,311
3227590
import numpy as np from enum import Enum class BasePalette(Enum): """Palette Enum class with additional helper functions""" def __len__(self) -> object: """Number of colors in palette""" return len(self.value) def __iter__(self) -> object: self.n = 0 return self ...
0
6
39
0
45
0
simplemap/map.py
patrick--/simplemap
126
3227593
<filename>simplemap/map.py """ simplemap.map.py ~~~~~~~~~~~~~~~~ This module contains all core functionality related to map generation """ from jinja2 import Environment, FileSystemLoader from simplemap.html_render import SilentUndefined import json import os import sys import traceback TEMPLATES_DIR = FileSystemL...
0
0
0
0
0
0
Tests/interop/net/loadorder/t2h.py
aisk/ironpython3
1,872
3227609
<reponame>aisk/ironpython3<filename>Tests/interop/net/loadorder/t2h.py # Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. from iptest.assert_util import * ad...
0
0
0
0
0
0
apps/sketch_gan.py
AntonBiryukovUofC/diffvg
488
3227619
<reponame>AntonBiryukovUofC/diffvg<filename>apps/sketch_gan.py<gh_stars>100-1000 """A simple training interface using ttools.""" import argparse import os import logging import random import numpy as np import torch from torchvision.datasets import MNIST import torchvision.transforms as xforms from torch.utils.data im...
0
0
0
0
0
0
mkdocs_awesome_pages_plugin/tests/navigation/test_static.py
Owen-Liuyuxuan/mkdocs-awesome-pages-plugin
226
3227629
<filename>mkdocs_awesome_pages_plugin/tests/navigation/test_static.py from unittest import TestCase from mkdocs.structure.nav import Section from ...meta import Meta from ...navigation import AwesomeNavigation class TestSetTitle(TestCase): def setUp(self): self.section = Section('Section', []) def...
0
0
0
0
0
0
07_train/archive/extras/bert/fast-bert/fast_bert/data_qa.py
dpai/workshop
2,327
3227660
from __future__ import annotations import json import os import torch from pathlib import Path import pickle import logging import collections from io import open import shutil from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler from torch.utils.data.distributed import DistributedS...
30
7
0
4
41
0
pca/utils/tests/imports/b.py
pcah/python-clean-architecture
278
3227666
<reponame>pcah/python-clean-architecture __all__ = ["duplicated"] duplicated = "duplicated from b.py" not_imported = "not imported"
0
0
0
0
0
0
tutorials/setup-gcp/rdbox-gui/flask_rdbox/__init__.py
hamstick/rdbox
278
3227723
<reponame>hamstick/rdbox from flask import Flask import os app = Flask(__name__, static_url_path='', static_folder='../dist/rdbox-gui/') if os.environ.get('DEBUG_RDBOX_GUI', 'True').lower() in ("yes", "true", "t", "1"): app.config.from_object('flask_rdbox.config') else: app.config.from_object('flask_rdbox.co...
0
0
0
0
0
0
hs_script_resource/models.py
hydroshare/hydroshare
178
3227771
<filename>hs_script_resource/models.py from django.db import models, transaction from django.contrib.contenttypes.fields import GenericRelation from django.core.exceptions import ValidationError from mezzanine.pages.page_processors import processor_for from hs_core.models import BaseResource, ResourceManager, resourc...
0
0
0
0
0
0
cfgov/v1/tests/util/test_migrations.py
Colin-Seifer/consumerfinance.gov
156
3227800
from unittest import mock from django.apps import apps from django.test import SimpleTestCase, TestCase from wagtail.core import blocks from wagtail.core.models import Page from wagtail.tests.testapp.models import StreamPage from v1.tests.wagtail_pages.helpers import save_new_page from v1.util.migrations import ( ...
0
5
0
0
5
0
Hackerrank/Practice/Python/10.Built-Ins/70.Input().py
kushagra1212/Competitive-Programming
994
3227804
x,k=map(int,input().split()) fx=eval(input()) if fx==k: print("True") else: print("False")
0
0
0
0
0
0
server/www/packages/packages-windows/x86/wheezy/captcha/bezier.py
zhoulhb/teleport
640
3227809
""" """ tsequence = tuple([t / 20.0 for t in range(21)]) beziers = {} def pascal_row(n) -> object: """ Returns n-th row of Pascal's triangle """ result = [1] x, numerator = 1, n for denominator in range(1, n // 2 + 1): x *= numerator x /= denominator result.append(x) ...
0
2
0
0
2
0