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
src/debugpy/_vendored/pydevd/tests_python/resources/not_my_code/not_my_coroutine.py
r3m0t/debugpy
695
165821
<gh_stars>100-1000 async def call1(callback): await callback()
0
0
0
0
0
0
torchreid/optimizers.py
yyyjoe/deep-person-reid
244
165840
<filename>torchreid/optimizers.py from __future__ import absolute_import import torch def init_optimizer(params, optim='adam', lr=0.003, weight_decay=5e-4, momentum=0.9, # momentum factor for sgd and rmsprop sgd_dampening=...
0
0
0
0
0
0
Trakttv.bundle/Contents/Libraries/Shared/stash/serializers/s_jsonpickle.py
disrupted/Trakttv.bundle
1,346
165855
<filename>Trakttv.bundle/Contents/Libraries/Shared/stash/serializers/s_jsonpickle.py from stash.serializers.core.base import Serializer try: import jsonpickle except ImportError: jsonpickle = None class JsonPickleSerializer(Serializer): __key__ = 'jsonpickle' def dumps(self, value): if jsonp...
0
0
0
0
0
0
tests/book/ch05/eval_perceptron_cws.py
xchaoinfo/pyhanlp
2,792
165871
<reponame>xchaoinfo/pyhanlp<gh_stars>1000+ # -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-06-01 11:07 # 《自然语言处理入门》5.6 基于结构化感知机的中文分词 # 配套书籍:http://nlp.hankcs.com/book.php # 讨论答疑:https://bbs.hankcs.com/ from pyhanlp import * from tests.book.ch03.msr import msr_train, msr_model, msr_test, msr_gold, msr_output, msr_...
0
0
0
0
0
0
MacroPad_RPC_Home_Assistant/rpc.py
gamblor21/Adafruit_Learning_System_Guides
665
165889
<gh_stars>100-1000 # SPDX-FileCopyrightText: Copyright (c) 2021 <NAME> for Adafruit Industries # # SPDX-License-Identifier: Unlicense """ USB CDC Remote Procedure Call class """ import time import json try: import serial import adafruit_board_toolkit.circuitpython_serial json_decode_exception = json.decode...
0
0
0
0
0
0
scripts/binary_reader/vpic_binary_reader.py
tnakaicode/vpic
110
165902
<filename>scripts/binary_reader/vpic_binary_reader.py import struct import sys import numpy from collections import Counter def read_header(inputfile): f = inputfile header = {} f.seek(0,2) # go to end of file end_byte = f.tell() f.seek(0,0) # go to beginning of file start_byte = f.tell() ...
0
0
0
0
0
0
VirtualStage/BackgroundMatting/prepare_data.py
nicolasdeory/ailab
4,537
165917
import os def prepare_videos( videos, extension, start, duration, kinect_mask: bool=True, width: int=1920, height: int=1080 ): video_start_secs = start % 60 video_start_mins = start // 60 print(f"Dumping frames and segmenting {len(videos)} input videos") for i, video in enumerate(videos): ...
3
0
0
0
3
0
data_structures/Graphs/graphsearch/graph_coloring/python/graph_color_greedy.py
CarbonDDR/al-go-rithms
1,253
165925
from collections import defaultdict class Graph: def __init__(self,V,directed: bool=False): self.V = V self.directed = directed self.graph = defaultdict(list) def add_edge(self,a,b): self.graph[a].append(b) if not self.directed: self.graph[b].append(a) def color_greedy(self) -> tuple[object, obj...
1
1
0
0
2
0
eval/multi_bin/network-facing/binary_dependency_graph/bdp_enum.py
cpbscholten/karonte
294
165927
<gh_stars>100-1000 from enum import Enum class Role(Enum): SETTER = 0 GETTER = 1 UNKNOWN = 2 SETTER_GETTER = 3 class BuffType(Enum): HEAP = 0 STACK = 1 GLOBAL = 2 class RoleInfo(Enum): ROLE = 'role' STRING = 'string' X_REF_FUN = 'x_ref_function' CALLER_BB = 'block_caller...
0
0
0
0
0
0
src/10-async-web/cityscape_api/services/location_service.py
NissesSenap/async-techniques-python-course
380
165979
<gh_stars>100-1000 import random import time from typing import Tuple import requests use_cached_data = False measured_latency_in_sec = [ 0.28844, 0.334694, 0.33468, 0.343911, 0.339515, 0.344329, 0.341594, 0.352366, 0.535646, 0.527148, 0.533472, 0.53351, 0.523462] def get_lat_long(zip_code: str, country: st...
0
0
0
0
0
0
gaphor/UML/profiles/tests/test_stereotypepropertypages.py
mrmonkington/gaphor
867
165984
<gh_stars>100-1000 from gaphor import UML from gaphor.diagram.tests.fixtures import find from gaphor.UML.profiles.stereotypepropertypages import ( StereotypePage, set_value, toggle_stereotype, ) def test_stereotype_property_page_without_stereotype(diagram, element_factory): item = diagram.create( ...
0
0
0
0
0
0
imaginaire/evaluation/lpips.py
hw07216/imaginaire
3,308
165999
<reponame>hw07216/imaginaire # Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # This work is made available under the Nvidia Source Code License-NC. # To view a copy of this license, check out LICENSE.md from collections import namedtuple import torch from torch import nn, distributed as d...
0
0
0
0
0
0
Practice/Coding Blocks/Competitive Warriors Challenge 1.0/Unique Numbers - II.py
cnm06/Competitive-Programming
994
166010
n = int(raw_input()) data = [int(i) for i in raw_input().split()] data = sorted(data) ans = 0 for i in xrange(0, n, 2): if data[i] != data[i + 1]: print str(data[i]), i -= 1 ans += 1 if ans != 2: print str(data[n-1]) + " ",
0
0
0
0
0
0
moz_sp/schema_consistency_checker.py
sythello/TabularSemanticParsing
141
166036
from __future__ import annotations """ Copyright (c) 2020, salesforce.com, inc. All rights reserved. SPDX-License-Identifier: BSD-3-Clause For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause """ from __future__ import absolute_import from __future__ import di...
2
11
1
1
15
0
tests/test_client.py
DoubleCai/django-redis
727
166062
<reponame>DoubleCai/django-redis from typing import Iterable from unittest.mock import Mock, patch import pytest from django.core.cache import DEFAULT_CACHE_ALIAS from pytest_django.fixtures import SettingsWrapper from pytest_mock import MockerFixture from django_redis.cache import RedisCache from django_redis.client...
0
0
0
0
0
0
web/data_labelling/routes/misc.py
thu-coai/CrossWOZ
414
166107
<gh_stars>100-1000 import os import json from peewee import prefetch, fn from datetime import datetime, date from flask import Blueprint, render_template, request, url_for, jsonify from ..utils import * bp = Blueprint('misc_bp', __name__) @bp.route('/login') def login(): return render_template('login.html') if ...
0
0
0
0
0
0
test/test_docker.py
siddheshsalunke/aardvark
429
166163
''' Test cases for docker container creation. ''' #adding for py3 support from __future__ import absolute_import import logging import os import random import re import shutil import tempfile import unittest import pexpect # Configure logging. Troubleshooting the pexpect interactions in # particular needs a lot o...
0
0
0
0
0
0
tools/chrome_proxy/webdriver/proxy_connection.py
zipated/src
2,151
166189
<gh_stars>1000+ # 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 common from common import TestDriver from common import IntegrationTest from decorators import ChromeVersionEqualOrAfterM from emulat...
0
0
0
0
0
0
grr/server/grr_response_server/flows/local/__init__.py
nkrios/grr
4,238
166222
<reponame>nkrios/grr #!/usr/bin/env python """Flows that are private to local installation."""
0
0
0
0
0
0
Tools/benchmarks/fannkuch_static_basic2_lib.py
mananpal1997/cinder
1,886
166224
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) """ The Computer Language Benchmarks Game http://benchmarksgame.alioth.debian.org/ Contributed by <NAME>, modified by Tupteq. """ from __future__ import annotations import __static__ from __static__ import int64, box from typing import Callab...
1
1
11
0
13
0
Chapter 08/mcb_ext.pyw
roelr1/python-1
143
166249
#!/usr/bin/env python3 """Saves, loads and deletes pieces of text to the clipboard. Usage: py.exe mcb_ext.pyw save <keyword> - Saves clipboard to keyword py.exe mcb_ext.pyw <keyword> - Loads keyword contents to clipboard py.exe mcb_ext.pyw list - Loads all keywords to clipboard py.exe mcb_ext.pyw delete <keyword>- De...
0
0
0
0
0
0
apps/reader/admin.py
starsep/NewsBlur
3,073
166260
<reponame>starsep/NewsBlur<gh_stars>1000+ from apps.reader.models import UserSubscription, UserSubscriptionFolders, Feature from django.contrib import admin admin.site.register(UserSubscription) admin.site.register(UserSubscriptionFolders) admin.site.register(Feature)
0
0
0
0
0
0
data/operator/bbox/utility/image.py
zhangzhengde0225/SwinTrack
143
166277
from data.types.pixel_coordinate_system import PixelCoordinateSystem from data.types.bounding_box_format import BoundingBoxFormat from data.types.bounding_box_coordinate_system import BoundingBoxCoordinateSystem from data.types.pixel_definition import PixelDefinition def _common_routine(bounding_box, image_size, boun...
11
3
0
0
14
0
scripts/mi_tests/test_mutual_information_vs_ring.py
vishalbelsare/crosscat
207
166288
<gh_stars>100-1000 # # Copyright (c) 2010-2016, MIT Probabilistic Computing Project # # Lead Developers: <NAME> and <NAME> # Authors: <NAME>, <NAME>, <NAME>, <NAME> # Research Leads: <NAME>, <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in comp...
0
0
0
0
0
0
openchat/utils/class_utils.py
mgorkove/openchat
383
166297
<reponame>mgorkove/openchat import logging from parlai.core.agents import NOCOPY_ARGS, compare_init_model_opts from parlai.core.opt import Opt from parlai.utils.io import PathManager from parlai.utils.misc import warn_once def inherit(obj, superclasses): obj.__class__ = type(obj.__class__.__name__, superclasses, ...
0
0
0
0
0
0
tools/azure-sdk-tools/pypi_tools/pypi.py
rsdoherty/azure-sdk-for-python
2,728
166319
from packaging.version import parse as Version import sys import requests def get_pypi_xmlrpc_client() -> object: """This is actually deprecated client.""" import xmlrpc.client return xmlrpc.client.ServerProxy("https://pypi.python.org/pypi", use_datetime=True) class PyPIClient: def __init__(self, ...
2
6
0
0
8
0
L1TriggerConfig/L1GtConfigProducers/python/L1GtPrescaleFactorsTechTrigConfig_cff.py
ckamtsikis/cmssw
852
166353
import FWCore.ParameterSet.Config as cms from L1TriggerConfig.L1GtConfigProducers.l1GtPrescaleFactorsTechTrig_cfi import * # L1GtPrescaleFactorsTechTrigRcdSource = cms.ESSource("EmptyESSource", recordName = cms.string('L1GtPrescaleFactorsTechTrigRcd'), iovIsRunNotTime = cms.bool(True), firstValid = cms.vui...
0
0
0
0
0
0
dialogue-engine/test/programytest/config/file/test_xml.py
cotobadesign/cotoba-agent-oss
104
166374
""" Copyright (c) 2020 COTOBA DESIGN, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
0
0
0
0
0
0
tapiriik/services/statistic_calculator.py
prohfesor/tapiriik
1,445
166379
from __future__ import annotations from datetime import timedelta from .interchange import WaypointType class ActivityStatisticCalculator: ImplicitPauseTime = timedelta(minutes=1, seconds=5) def CalculateDistance(act, startWpt: object | None=None, endWpt: object | None=None) -> object: import math ...
6
3
0
0
9
0
pandas/tseries/api.py
CJL89/pandas
28,899
166383
""" Timeseries API """ # flake8: noqa from pandas.tseries.frequencies import infer_freq import pandas.tseries.offsets as offsets
0
0
0
0
0
0
sealion/ensemble_learning.py
anish-lakkapragada/sealion
341
166398
from __future__ import annotations """ @author : <NAME> @date : 1-10-2021 Ensemble Learning is an often overshadowed and underestimated field of machine learning. Here we provide 2 algorithms central to the game - random forests and ensemble/voting classifier. Random Forests are very especially fast with parallel proc...
5
8
0
1
14
0
crop_img.py
Weifeng-Chen/tools
122
166424
<gh_stars>100-1000 """ yolo格式数据,裁剪图像中心区域,生成一批新数据。 """ import cv2 import os from tqdm import tqdm def plot_bbox(img, gt=None ,line_thickness=None): # 可视化测试 colorlist = [] # 5^3种颜色。 for i in range(30,256,50): for j in range(40,256,50): for k in range(50,256,50): col...
0
0
0
0
0
0
testing/MLDB-694_external_python_procedure.py
kstepanmpmg/mldb
665
166430
# # MLDB-694_external_python_procedure.py # mldb.ai inc, 2015 # this file is part of mldb. copyright 2015 mldb.ai inc. all rights reserved. # from mldb import mldb conf = { "type": "experimental.external.procedure", "params": { "stdInData": "pwet", "scriptConfig": { "source": """ i...
0
0
0
0
0
0
kale/embed/attention_cnn.py
Be-Secure/pykale
324
166434
<reponame>Be-Secure/pykale<filename>kale/embed/attention_cnn.py from typing import Tuple import torch import torch.nn as nn from kale.embed.positional_encoding import PositionalEncoding from kale.prepdata.tensor_reshape import seq_to_spatial, spatial_to_seq class ContextCNNGeneric(nn.Module): """ A template...
0
0
0
0
0
0
chemml/chem/magpie_python/attributes/generators/composition/YangOmegaAttributeGenerator.py
iamchetry/DataChallenge-Fall2021
108
166443
# coding=utf-8 import math import types import numpy as np import pandas as pd from ....data.materials.CompositionEntry import CompositionEntry from ....data.materials.util.LookUpData import LookUpData class YangOmegaAttributeGenerator: """Class to compute the attributes :math:`\Omega` and :math:`\delta` devel...
0
1
0
0
1
0
api/resources/market.py
NathanBMcNamara/Speculator
106
166464
# TODO: Only require market stats that are being used by ML models # TODO: Allow storage/retrieval of multiple markets """ Allows storage/retrieval for custom market data instead of automatic gathering """ from api import api, db from api.helpers import HTTP_CODES, query_to_dict, validate_db from api.models.market impo...
0
4
0
0
4
0
bnpy/datasets/zzz_unsupported/SpeakerDiar.py
jun2tong/bnp-anomaly
184
166474
''' SpeakDiar.py 21 audio recordings of academic conferences making up the NIST speaker diarization dataset, created to asses the ability of different models to segment speech data into unique speakers. The 21 recordings are meant to be trained on independently. Thus, get_data() takes a meetingNum parameter (default ...
6
2
0
0
8
0
ppapi/native_client/tools/browser_tester/browsertester/server.py
zealoussnow/chromium
14,668
166477
# Copyright (c) 2011 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. from __future__ import annotations import BaseHTTPServer import cgi import mimetypes import os import os.path import posixpath import SimpleHTTPServer im...
2
9
0
0
11
0
veriloggen/fsm/__init__.py
akmaru/veriloggen
232
166481
from __future__ import absolute_import from __future__ import print_function from .fsm import reset
0
0
0
0
0
0
Hello World Programs/Python/Hayloworld.py
TeacherManoj0131/HacktoberFest2020-Contributions
256
166482
<filename>Hello World Programs/Python/Hayloworld.py # Using list to print hello world my_list = ["H", "e", "l", "l", "o", " ", "W", "o", "r", "l", "d"] s = "" for i in my_list: s = s + i print(s)
0
0
0
0
0
0
tests/test_adb.py
RakhithJK/andriller
883
166498
import sys import pytest import tempfile import subprocess from unittest import mock from andriller import adb_conn fake_adb = tempfile.NamedTemporaryFile() @pytest.fixture def ADB(mocker) -> object: mocker.patch('andriller.adb_conn.ADBConn.kill') mocker.patch('andriller.adb_conn.ADBConn._opt_use_capture', r...
0
3
0
0
3
0
qark/issue.py
op01/qark
2,943
166543
<reponame>op01/qark<gh_stars>1000+ import logging from copy import deepcopy from enum import Enum from json import JSONEncoder, dumps log = logging.getLogger(__name__) class Issue(object): def __init__(self, category, name, severity, description, line_number=None, file_object=None, apk_exploit_dict=None): ...
0
0
0
0
0
0
HRI/TFVT_HRI/perception/common/visualize.py
WorldEditors/PaddleRobotics
146
166547
from __future__ import annotations import cv2 import numpy as np from PIL import Image from PIL import ImageDraw from subprocess import Popen, PIPE import pycocotools.mask as coco_mask_util def draw_bboxes(image, bboxes, labels: object | None=None, output_file: object | None=None, fill: str='red') -> object: """ ...
5
2
0
0
7
0
tests/server/execute_test.py
jwminton/voila
2,977
166550
# test basics of Voilà running a notebook async def test_hello_world(http_server_client, print_notebook_url): response = await http_server_client.fetch(print_notebook_url) assert response.code == 200 html_text = response.body.decode('utf-8') assert 'Hi Voilà' in html_text assert 'print(' not in ht...
0
0
0
0
0
0
tests/test_dask_image/test_ndinterp/test_spline_filter.py
anlavandier/dask-image
144
166571
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations from packaging import version import dask import dask.array as da import numpy as np import pytest import scipy import scipy.ndimage import dask_image.ndinterp # mode lists for the case with prefilter = False _supported_modes = ['const...
10
0
0
0
10
0
test/run/t458.py
timmartin/skulpt
2,671
166573
<reponame>timmartin/skulpt print "0 % 10 =", 0 % 10 print "3 % 10 =", 3 % 10 print "6 % 10 =", 6 % 10 print "10 % 10 =", 10 % 10 print "14 % 10 =", 14 % 10 print "-3 % 10 =", -3 % 10 print "-6 % 10 =", -6 % 10 print "-10 % 10 =", -10 % 10 print "-14 % 10 =", -14 % 10 print "3.6 % 10 =", 3.6 % 10 print "-3.6 % 10 =", -3...
0
0
0
0
0
0
n26/util.py
rxall/python-n26
163
166603
<reponame>rxall/python-n26<gh_stars>100-1000 def create_request_url(url: str, params: dict = None): """ Adds query params to the given url :param url: the url to extend :param params: query params as a keyed dictionary :return: the url including the given query params """ if params: ...
0
0
0
0
0
0
LeetCode/1604_Alert_Using_Same_Key_Card_Three_or_More_Times_in_a_One_Hour_Period.py
Achyut-sudo/PythonAlgorithms
144
166607
class Solution(object): def alertNames(self, keyName, keyTime) -> object: """ :type keyName: List[str] :type keyTime: List[str] :rtype: List[str] """ mapp = {} for i in range(len(keyName)): name = keyName[i] if(name not in mapp): ...
0
1
0
0
1
0
python/bootmenu.py
3mdeb/bits
215
166609
<gh_stars>100-1000 # Copyright (c) 2015, Intel Corporation # 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, # ...
0
0
0
0
0
0
reddit_place/models.py
dkasper/reddit-plugin-place-opensource
780
166615
<gh_stars>100-1000 from datetime import datetime import json import struct import time from pycassa.system_manager import TIME_UUID_TYPE, INT_TYPE from pycassa.types import CompositeType, IntegerType from pycassa.util import convert_uuid_to_time from pylons import app_globals as g from pylons import tmpl_context as c ...
0
0
0
0
0
0
test/modules/tls/test_13_proxy.py
tititiou36/httpd
2,529
166645
from datetime import timedelta import pytest from .conf import TlsTestConf class TestProxy: @pytest.fixture(autouse=True, scope='class') def _class_scope(self, env): conf = TlsTestConf(env=env, extras={ 'base': "LogLevel proxy:trace1 proxy_http:trace1 ssl:trace1", env.domain...
2
0
0
0
2
0
dirigible/fts/tests/test_2557_ClickAwaySavesUsercode.py
EnoX1/dirigible-spreadsheet
168
166666
# Copyright (c) 2010 Resolver Systems Ltd. # All Rights Reserved # from functionaltest import FunctionalTest class Test_2557_ClickAwaySavesUsercode(FunctionalTest): def test_blur_on_edit_textarea_saves_usercode(self): # * Harold logs in to Dirigible and creates a new sheet self.login_and_create_...
0
0
0
0
0
0
pccold/bypyrm.py
davidkingzyb/pccold
184
166701
<reponame>davidkingzyb/pccold # 2018/12/31 by DKZ from .tools import sendEmail import psutil import subprocess import logging from .config import conf def doBypy(): global conf logging.info('doBypy') cmd='cd '+conf.download_path+';bypy upload' logging.info('$ '+cmd) shell=subprocess.Popen(cmd,she...
0
0
0
0
0
0
poco/drivers/cocosjs/__init__.py
kaluluosi/Poco
1,444
166736
# -*- coding: utf-8 -*- # @Author: gzliuxin # @Email: <EMAIL> # @Date: 2017-07-14 19:47:51 from __future__ import annotations from poco.pocofw import Poco from poco.agent import PocoAgent from poco.freezeui.hierarchy import FrozenUIHierarchy, FrozenUIDumper from poco.utils.simplerpc.utils import sync_wrapper from p...
3
3
0
0
6
0
up/tasks/seg/data/seg_transfomer.py
ModelTC/EOD
196
166750
from __future__ import annotations import numpy as np import cv2 import collections import numbers import random import math import copy from up.data.datasets.transforms import Augmentation from up.utils.general.registry_factory import AUGMENTATION_REGISTRY @AUGMENTATION_REGISTRY.register('color_jitter_mmseg') class...
11
14
0
1
26
0
test/test_mittens.py
akanshajainn/mittens
234
166752
<gh_stars>100-1000 """test_mittens.py Test Mittens and GloVe using both NumPy and TensorFlow (if available). If TensorFlow is not installed, those tests are skipped. If it is, all tests are run twice: first with NumPy and then with TensorFlow, according to the `framework` fixture. Tests use pytest: from the command ...
0
0
0
0
0
0
yolo/model/backbone/path_aggregation_network.py
f-fl0/YOLOv5-PyTorch
125
166762
import torch from torch import nn from .utils import Conv, ConcatBlock class PathAggregationNetwork(nn.Module): def __init__(self, in_channels_list, depth): super().__init__() self.inner_blocks = nn.ModuleList() self.layer_blocks = nn.ModuleList() self.upsample_blocks = nn.ModuleL...
0
1
0
0
1
0
zip_creator/zip_creator.py
jae-yong-2/awesomeScripts
245
166790
<filename>zip_creator/zip_creator.py import os from zipfile import ZipFile # asking user to input the directory path dir_path = input("Enter Path Of Directory \t") # resolving directory and zip file name based on OS of the user dir_name = os.path.abspath(dir_path) zip_name = os.path.basename(os.path.normpath(dir_path...
0
0
0
0
0
0
src/zvt/recorders/exchange/api/cs_index_stock_api.py
vishalbelsare/zvt
2,032
166797
# -*- coding: utf-8 -*- from __future__ import annotations import io import logging import pandas as pd import requests from zvt.api import china_stock_code_to_id from zvt.recorders.consts import DEFAULT_HEADER from zvt.utils import now_pd_timestamp logger = logging.getLogger(__name__) original_page_url = "http://w...
1
1
0
0
2
0
scripts/build_tag.py
LaudateCorpus1/coremltools
2,740
166806
#!/usr/bin/env python # # Copyright (c) 2021, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause # Construct a valid wheel build tag with ``git describe``. # # We do this with p...
0
0
0
0
0
0
DeepAlignmentNetwork/menpofit/aps/__init__.py
chiawei-liu/DeepAlignmentNetwork
220
166811
from .base import GenerativeAPS from .fitter import GaussNewtonAPSFitter from .algorithm import Inverse, Forward
0
0
0
0
0
0
tests/test_circuit/test_new_style_syntax.py
leonardt/magma
167
166822
import magma as m from magma.testing.utils import has_warning, has_error def _check_foo_interface(Foo): assert list(Foo.interface.ports.keys()) == ["I", "O"] assert isinstance(Foo.interface.ports["I"], m.Bit) assert Foo.interface.ports["I"].is_output() assert isinstance(Foo.interface.ports["O"], m.Bit...
0
0
0
0
0
0
admin_tools_stats/utils.py
afkmamunbd/django-admin-tools-stats
204
166850
<reponame>afkmamunbd/django-admin-tools-stats # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2014 Star2Billing S.L. # # The Initial Developer o...
0
0
0
0
0
0
mmdet/models/mask_heads/grid_head.py
Pandinosaurus/Grid-R-CNN
272
166870
<reponame>Pandinosaurus/Grid-R-CNN import mmcv import numpy as np import pycocotools.mask as mask_util import torch import torch.nn as nn import functools import torch.nn.functional as F from torch.distributed import get_world_size, get_rank import random from ..registry import HEADS from ..utils import ConvModule fro...
0
0
0
0
0
0
mayan/apps/databases/patches.py
nattangwiwat/Mayan-EDMS-recitation
343
166894
<reponame>nattangwiwat/Mayan-EDMS-recitation import datetime from django.conf import settings from django.db.migrations import Migration def patch_Migration(): _method_original__apply = Migration.apply _method_original__unapply = Migration.unapply def _method_patched__apply(self, *args, **kwargs): ...
0
0
0
0
0
0
lightly/openapi_generated/swagger_client/api/mappings_api.py
Tekrific/lightly
1,515
166905
# coding: utf-8 from __future__ import annotations """ Lightly API Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501 OpenAPI spec version:...
1
2
0
0
3
0
Introducing_Gemma_M0/Gemma_I2Csi7021.py
joewalk102/Adafruit_Learning_System_Guides
665
166943
<reponame>joewalk102/Adafruit_Learning_System_Guides<filename>Introducing_Gemma_M0/Gemma_I2Csi7021.py # I2C sensor demo import time import adafruit_si7021 import board import busio i2c = busio.I2C(board.SCL, board.SDA) # lock the I2C device before we try to scan while not i2c.try_lock(): pass print("I2C address...
0
0
0
0
0
0
lib/models/decode.py
shachargluska/centerpose
245
166950
<reponame>shachargluska/centerpose from __future__ import absolute_import, division, print_function import torch import torch.nn as nn import torch.nn.functional as F from .utils import _gather_feat, _transpose_and_gather_feat def _nms(heat, kernel=3): pad = (kernel - 1) // 2 hmax = nn.functional.max_pool2...
0
0
0
0
0
0
release/stubs.min/System/Windows/Forms/__init___parts/Screen.py
htlcnn/ironpython-stubs
182
166957
<gh_stars>100-1000 class Screen(object): """ Represents a display device or multiple display devices on a single system. """ def Equals(self,obj): """ Equals(self: Screen,obj: object) -> bool Gets or sets a value indicating whether the specified object is equal to this Screen. obj: The...
0
0
0
0
0
0
py/kubeflow/kfctl/testing/ci/update_jupyter_web_app.py
Bobgy/kfctl
145
166995
<filename>py/kubeflow/kfctl/testing/ci/update_jupyter_web_app.py """Script to build and update the Jupyter WebApp image. Requires python3 hub CLI depends on an OAuth token with repo permissions: https://hub.github.com/hub.1.html * It will look for environment variable GITHUB_TOKEN """ import logging import os impo...
0
0
0
0
0
0
ldapper.py
shellster/LDAPPER
163
167000
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Version 1.6 import argparse import json import os import re import sys import yaml import colorama from queries import custom_search from utilities import escape_ldap from ldap_connector import LDAP3Connector from ldap_connector import ImpacketLDAPConn...
1
2
0
0
3
0
LineSketch/LineSketch.py
avinashkranjan/PraticalPythonProjects
930
167002
import turtle as t tim = t.Turtle() scr = t.Screen() def move_forward(): tim.forward(10) def move_backward(): tim.backward(10) def clockwise(): tim.setheading(tim.heading() - 10) def anticlockwise(): tim.setheading(tim.heading() + 10) def clear(): tim.clear() tim.penup() tim.home(...
0
0
0
0
0
0
tests/grammar/test_evaluator_test_cases.py
AlexandreH/securify2
258
167018
class EvaluatorTestCases: expressions: list[tuple[str, float, object, int] | tuple[str, object, object, int]] = [ ("1 2 + 2.5 * 2 5 SUM", 14.5, float, 3), ("1 2 3 SUM 4 5 SUM 6 7 SUM", sum(range(8)), int, 3), ("1 2 3 SUM 4 5 SUM 6 7 SUM 8.5 *", sum(range(8)) * 8.5, float, 4), ] not_...
0
0
3
0
3
0
src/pyfme/models/constants.py
gaofeng2020/PyFME
199
167077
<filename>src/pyfme/models/constants.py # -*- coding: utf-8 -*- """ Python Flight Mechanics Engine (PyFME). Copyright (c) AeroPython Development Team. Distributed under the terms of the MIT License. Constant variables ------------------ Sources: [1] - COESA standard - U.S. Standard Atmosphere, 1976, U.S. Government P...
0
0
0
0
0
0
moe/bandit/bla/__init__.py
dstoeckel/MOE
966
167095
# -*- coding: utf-8 -*- """Bandit directory containing multi-armed bandit implementations of BLA policies in python. **Files in this package** * :mod:`moe.bandit.bla.bla`: :class:`~moe.bandit.bla.bla.BLA` object for allocating bandit arms and choosing the winning arm based on BLA policy. """
0
0
0
0
0
0
python/fcdd/models/fcdd_vark.py
kyungmin96/myfcdd
152
167099
import torch.nn as nn import torch.nn.functional as F from fcdd.models.bases import FCDDNet class FCDD_CNN224_VARK(FCDDNet): def __init__(self, in_shape, k: int=3, **kwargs): assert k % 2 == 1, 'kernel size needs to be uneven' p = (k - 1) // 2 super().__init__(in_shape, **kwargs) s...
4
2
0
1
7
0
examples/roberta_medical_ner_train.py
6666ev/bert_seq2seq
795
167120
<filename>examples/roberta_medical_ner_train.py import torch import codecs from tqdm import tqdm import time import unicodedata from torch.utils.data import Dataset, DataLoader from bert_seq2seq import Tokenizer, load_chinese_base_vocab from bert_seq2seq import load_bert # target = ["O", "B-DRUG", "B-DRUG_INGREDIENT"...
0
0
0
0
0
0
algorithms/sherlock-and-squares.py
gajubadge11/HackerRank-1
340
167121
<filename>algorithms/sherlock-and-squares.py #!/bin/python3 import sys from math import ceil, floor def squares(a, b): res = 0 res = floor(b**0.5)+1 - ceil(a**0.5) return res if __name__ == "__main__": q = int(input().strip()) for a0 in range(q): a, b = input().strip().split(' ') ...
0
0
0
0
0
0
equip/visitors/blocks.py
neuroo/equip
102
167136
<reponame>neuroo/equip # -*- coding: utf-8 -*- """ equip.visitors.blocks ~~~~~~~~~~~~~~~~~~~~~ Callback the visit basic blocks in the program. :copyright: (c) 2014 by <NAME> (@rgaucher) :license: Apache 2, see LICENSE for more details. """ class BlockVisitor(object): """ A basic block visitor. It fir...
0
0
0
0
0
0
idaes/util/update_workshop_materials.py
eyoung55/idaes-pse
112
167144
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
0
2
0
0
2
0
master-node-docker/sentinel/config/swaps.py
ramesh-kr/sentinel
342
167147
# coding=utf-8 BTC_BASED_COINS = { 'PIVX': { 'ip': '', 'port': 3000, 'url': '' } } ETHEREUM_BASED_COINS = ['ETH', 'BNB', 'SENT'] ADDRESS = ''.lower() PRIVATE_KEY = '' FEE_PERCENTAGE = 0.01 TOKENS = [ { 'address': ADDRESS, 'decimals': 18, 'logo_url': 'https://...
0
0
0
0
0
0
mnemonics-training/1_train/trainer/baseline.py
mhd-medfa/class-incremental-learning
241
167177
import copy import os import torch import torchvision import warnings import math import utils.misc import numpy as np import os.path as osp import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import models.modified_resnet_cifar as modified_resnet_cifar import models.modified_resnetmtl_cif...
0
1
0
3
4
0
videoflow/engines/task_functions.py
Muflhi01/videoflow
1,022
167190
<gh_stars>1000+ from __future__ import print_function from __future__ import division from __future__ import absolute_import import logging import os from multiprocessing import Process, Queue, Event, Lock from ..core.task import Task def task_executor_fn(task : Task): os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS...
0
0
0
0
0
0
pytorch_pfn_extras/runtime/_to.py
belltailjp/pytorch-pfn-extras
243
167212
<gh_stars>100-1000 from typing import Any, Dict, Optional, Type, TypeVar import torch import pytorch_pfn_extras as ppe from pytorch_pfn_extras.runtime._runtime import DeviceLike, BaseRuntime ModuleOrTensor = TypeVar('ModuleOrTensor', torch.nn.Module, torch.Tensor) def to( module_or_tensor: ModuleOrTensor,...
0
0
0
0
0
0
tilecloud/filter/inboundingpyramid.py
camptocamp/tilecloud
134
167244
from typing import Optional from tilecloud import BoundingPyramid, Tile class InBoundingPyramid: """ Creates a filter that filters out tiles that are not in the specified bounding pyramid. When called the filter returns ``None`` if the tile is not in the bounding pyramid. bounding_pyramid: ...
2
1
0
0
3
0
src/genie/libs/parser/iosxe/tests/ShowIpv6Neighbors/cli/equal/golden_output3_expected.py
balmasea/genieparser
204
167256
expected_output = { "interface": { "GigabitEthernet3.90": { "interface": "GigabitEthernet3.90", "neighbors": { "FE80::5C00:40FF:FEFF:209": { "age": "22", "ip": "FE80::5C00:40FF:FEFF:209", "link_layer_address"...
0
0
0
0
0
0
sdk/python/pulumi_gcp/billing/sub_account.py
sisisin/pulumi-gcp
121
167298
<filename>sdk/python/pulumi_gcp/billing/sub_account.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapp...
0
0
0
0
0
0
configs/cascade_rcnn/ranksort_cascade_rcnn_r50_fpn_1x_coco_stdw.py
yinchimaoliang/ranksortloss
210
167302
<reponame>yinchimaoliang/ranksortloss _base_ = 'ranksort_cascade_rcnn_r50_fpn_1x_coco.py' model = dict(roi_head=dict(stage_loss_weights=[1, 0.50, 0.25]))
0
0
0
0
0
0
office365/teams/chatMessageAttachment.py
wreiner/Office365-REST-Python-Client
544
167368
from office365.runtime.client_value import ClientValue class ChatMessageAttachment(ClientValue): pass
0
0
0
0
0
0
cantools/version.py
rettenbs/cantools
1,063
167378
__version__ = '37.0.1'
0
0
0
0
0
0
python/allelebayes.py
tprodanov/freebayes
452
167389
#!/usr/bin/env python3 # calculates data likelihoods for sets of alleles from __future__ import print_function, division import multiset import sys import cjson import phred import json import math import operator from logsumexp import logsumexp from dirichlet import dirichlet_maximum_likelihood_ratio, dirichlet, mult...
0
0
0
0
0
0
statistical_testing/chisq_p_value_dist.py
nategri/uranium_dice
172
167401
<gh_stars>100-1000 # Must have the 'ent' randomness tester utility installed # https://www.fourmilab.ch/random/ import os import subprocess import sys from matplotlib import pyplot if __name__ == "__main__": rand_bytes_filename = sys.argv[1] num_bytes = sys.argv[2] subprocess.run(['split', '-b', num_byt...
0
0
0
0
0
0
tools/pot/tests/test_sanity_layerwise_finetuning.py
pazamelin/openvino
2,406
167409
# Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from collections import OrderedDict import warnings import numpy as np import pytest from openvino.tools.pot.algorithms.sparsity.default.utils import check_model_sparsity_level from openvino.tools.pot.data_loaders.creator import create...
0
3
0
0
3
0
src/backend/api/api_trusted_parsers/json_rankings_parser.py
bovlb/the-blue-alliance
266
167416
<reponame>bovlb/the-blue-alliance from typing import AnyStr, Dict, List, Sequence, TypedDict from pyre_extensions import safe_json from backend.common.datafeed_parsers.exceptions import ParserInputException from backend.common.helpers.rankings_helper import RankingsHelper from backend.common.models.event_ranking impo...
0
0
0
0
0
0
tests/operators/test_datetime.py
npodewitz/airflow
8,092
167422
<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
package/awesome_panel/application/models/resource.py
slamer59/awesome-panel
179
167440
<reponame>slamer59/awesome-panel """In this Module we define the Resource model""" import param from .author import Author _IMAGE_DICT = { " ": "-", "#": "", } class Resource(param.Parameterized): """Model of a Resource Args: name (str): The name of the Resource ur...
0
0
0
0
0
0
test/python/tests/test_conversion.py
bh107/bohrium
236
167472
<reponame>bh107/bohrium import sys class test_conversion: def init(self): yield "a = M.arange(1);" def test_float(self, cmd): cmd += "res = float(a);" return cmd def test_int(self, cmd): cmd += "res = int(a);" return cmd if sys.version_info[0] < 3: de...
0
0
0
0
0
0
DeformationLearningSolver/scripts/DLS/widget/axisOptionWindow.py
WebberHuang/DeformationLearningSolver
160
167474
<reponame>WebberHuang/DeformationLearningSolver __author__ = "<NAME>" __contact__ = "<EMAIL>" __website__ = "http://riggingtd.com" import os try: from PySide import QtGui, QtCore from PySide.QtGui import * from PySide.QtCore import * except ImportError: from PySide2 import QtGui, QtCore, QtWidgets ...
0
0
0
0
0
0
examples/healthcare/mimic_MVAE_mixed.py
kapikantzari/MultiBench
148
167484
import sys import os import torch from torch import nn sys.path.append(os.getcwd()) from unimodals.MVAE import MLPEncoder, TSEncoder, TSDecoder # noqa from objective_functions.recon import elbo_loss, sigmloss1d # noqa from training_structures.Supervised_Learning import train, test # noqa from datasets.mimic.get_data i...
0
0
0
0
0
0
ivis/nn/network.py
wna26/ivis
271
167492
<filename>ivis/nn/network.py<gh_stars>100-1000 """Contains helper functions for creating Siamese networks from base network architectures. Additionally, provides several base network constructors as default options.""" from functools import partial import numpy as np from tensorflow.keras import regularizers from tens...
0
0
0
0
0
0