max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
7
115
max_stars_count
int64
101
368k
id
stringlengths
2
8
content
stringlengths
6
1.03M
NLP/2-NaiveBayes_N-gram/language_detector/language_detector.py
excelsimon/AI
119
110836
<reponame>excelsimon/AI # -*- coding:utf-8 -*- import re from sklearn.model_selection import train_test_split from sklearn.naive_bayes import MultinomialNB from sklearn.feature_extraction.text import CountVectorizer class LanguageDetector(): def __init__(self,classifier=MultinomialNB()): self.class...
extrabacon-2.0/improved/shellcode_8_4(6)5.py
JS-Burns/CVE-2016-6366
171
110852
## ## this file autogenerated ## 8.4(6)5 ## jmp_esp_offset = "192.168.3.11" saferet_offset = "172.16.17.32" fix_ebp = "72" pmcheck_bounds = "0.176.88.9" pmcheck_offset = "96.186.88.9" pmcheck_code = "192.168.3.11" admauth_bounds = "0.32.8.8" admauth_offset = "240.33.8.8" admauth_code = "172.16.31.10" # "8.4(6)5" = [...
tests/utils/stac_io_mock.py
jisantuc/pystac
130
110879
from typing import Any, Union from unittest.mock import Mock import pystac class MockStacIO(pystac.StacIO): """Creates a mock that records StacIO calls for testing and allows clients to replace StacIO functionality, all within a context scope. """ def __init__(self) -> None: self.mock = Mock...
entangle/http.py
radiantone/entangle
102
110889
<filename>entangle/http.py """ http.py - Module that provides http oriented decorators """ from functools import partial import requests def request(function=None, timeout=None, url=None, method='GET', sleep=None): """ :param function: :param timeout: :...
ikalog/utils/image_loader.py
fetus-hina/IkaLog
285
110908
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 <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/L...
SimGeneral/DataMixingModule/python/supplementary/ReconstructionLocalCosmics_cff.py
ckamtsikis/cmssw
852
110910
import FWCore.ParameterSet.Config as cms # # tracker # from RecoLocalTracker.Configuration.RecoLocalTracker_Cosmics_cff import * from RecoTracker.Configuration.RecoTrackerP5_cff import * from RecoVertex.BeamSpotProducer.BeamSpot_cff import * from RecoTracker.Configuration.RecoTrackerBHM_cff import * from RecoTracker.D...
fusion/affineFace.py
bj80heyue/One_Shot_Face_Reenactment
183
110920
from fusion.points2heatmap import * from fusion.calcAffine import * from fusion.warper import warping as warp import matplotlib.pyplot as plt from fusion.parts2lms import parts2lms import time from tqdm import * import random import multiprocessing import sys def gammaTrans(img, gamma): gamma_table = [np.power(x/255...
tensorflow_datasets/ranking/istella/istella.py
vanshhhhh/datasets
3,380
110934
<reponame>vanshhhhh/datasets # coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
tests/basics/class2.py
LabAixBidouille/micropython
303
110940
# class with __init__ class C1: def __init__(self): self.x = 1 c1 = C1() print(type(c1) == C1) print(c1.x) class C2: def __init__(self, x): self.x = x c2 = C2(4) print(type(c2) == C2) print(c2.x)
src/azure-cli/azure/cli/command_modules/serviceconnector/__init__.py
YuanyuanNi/azure-cli
3,287
110948
<filename>src/azure-cli/azure/cli/command_modules/serviceconnector/__init__.py # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license info...
users/migrations/0014_auto_20210801_2332.py
Manny27nyc/pythondotorg
911
110974
# Generated by Django 3.2.5 on 2021-08-01 23:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0013_auto_20180705_0348'), ] operations = [ migrations.AlterField( model_name='membership', name='psf_annou...
fooof/tests/__init__.py
varman-m/eeg_notebooks_doc
154
110981
"""Tests for FOOOF."""
moonlight/structure/section_barlines.py
lithomas1/moonlight
288
111035
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
importer/migrations/0003_auto_20180709_0933.py
juliecentofanti172/juliecentofanti.github.io
134
111041
# Generated by Django 2.0.7 on 2018-07-09 09:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("importer", "0002_auto_20180709_0833")] operations = [ migrations.AlterField( model_name="campaignitemassetcount", name="campaign_...
tensorflow/python/util/keyword_args.py
abhaikollara/tensorflow
848
111066
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
hypergan/layers/residual.py
limberc/HyperGAN
889
111082
import torch.nn as nn import hypergan as hg class Residual(hg.Layer): """ --- description: 'layer residual for configurable component' --- # residual layer `residual` adds one or more residual blocks https://paperswithcode.com/method/residual-block ## optional arg...
plugins/Operations/main.py
nmantani/FileInsight-plugins
120
111087
<reponame>nmantani/FileInsight-plugins<filename>plugins/Operations/main.py # # Copyright (c) 2020, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source co...
src/Gon/realtime_starter_cnstock.py
majiajue/Listed-company-news-crawl-and-text-analysis
635
111185
<filename>src/Gon/realtime_starter_cnstock.py import __init__ import time import redis import logging import threading from Kite import config from Kite.database import Database from Killua.denull import DeNull from Killua.deduplication import Deduplication from Gon.cnstockspyder import CnStockSpyder redis_clien...
tests/sfko/sfko/obj/stage.py
Public-Cloud-Projects/Zenko
453
111193
<filename>tests/sfko/sfko/obj/stage.py from pipewrench.pipeline import Filter from pipewrench.pipeline import Router as BaseRouter from ..execute import (CheckPipeline, ControllerPipeline, TestPipeline, WorkerPipeline) from ..register import CHECKS, TESTS from .backend import BackendsWrapper fro...
davarocr/davarocr/davar_table/core/mask/structures.py
hikopensource/DAVAR-Lab-OCR
387
111201
<gh_stars>100-1000 """ ################################################################################################## # Copyright Info : Copyright (c) <NAME> @ Hikvision Research Institute. All rights reserved. # Filename : structures.py # Abstract : BitmapMasks designed for LGPMA # Current Ve...
xcessiv/tests/myrf.py
KhaledTo/xcessiv
1,362
111217
<reponame>KhaledTo/xcessiv from sklearn.ensemble import RandomForestClassifier import joblib class MyClassifier(RandomForestClassifier): def save(self, filepath): joblib.dump(self, filepath, 3) @staticmethod def load(filepath): return joblib.load(filepath)
dtu_test_project/core/views.py
foarsitter/django-tenant-users
165
111253
from django.views.generic import TemplateView class MainView(TemplateView): template_name = 'core/main.html'
examples/puma560_animation.py
rodosha98/FRPGitHomework
214
111268
<gh_stars>100-1000 import robopy.base.model as model import numpy as np def main(): robot = model.Puma560() a = np.transpose(np.asmatrix(np.linspace(1, -180, 500))) b = np.transpose(np.asmatrix(np.linspace(1, 180, 500))) c = np.transpose(np.asmatrix(np.linspace(1, 90, 500))) d = np.transpose(np.a...
test/gyppies/make_global_settings/test.gyp
indutny/gyp.js
188
111275
<filename>test/gyppies/make_global_settings/test.gyp { "target_defaults": { "make_global_settings": [ [ "CC", "echo" ], [ "LD", "echo" ], ], }, "targets": [{ "target_name": "test", "type": "executable", "sources": [ "main.c", ], }], }
data/cancer/print_tfrecords_files.py
liujh168/tensorflow_template_application
1,131
111283
<gh_stars>1000+ #!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf def print_tfrecords_file(input_filename): print("Try to print the tfrecords file: {}".format(input_filename...
Sobolev/main.py
inamori/DeepLearningImplementations
2,010
111345
<filename>Sobolev/main.py import argparse import sobolev_training # Training settings parser = argparse.ArgumentParser(description='Sobolev experiments') # Training params parser.add_argument('--nb_epoch', default=100, type=int, help="Number of training epochs") parser.add_argument('--batch_size', default=8, type=int...
demo/run_linucb_on_maxcomponent.py
simonoso/EasyRL
125
111349
# Copyright (c) 2019 Alibaba Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
alipay/aop/api/response/AlipayCommerceLogisticsWaybillIstddetailQueryResponse.py
antopen/alipay-sdk-python-all
213
111350
<reponame>antopen/alipay-sdk-python-all<filename>alipay/aop/api/response/AlipayCommerceLogisticsWaybillIstddetailQueryResponse.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayCommerceLogisticsWaybillIstddetailQueryResponse(Ali...
tests/components/goalzero/test_init.py
MrDelik/core
22,481
111376
"""Test Goal Zero integration.""" from datetime import timedelta from unittest.mock import patch from goalzero import exceptions from homeassistant.components.goalzero.const import DEFAULT_NAME, DOMAIN, MANUFACTURER from homeassistant.config_entries import ConfigEntryState from homeassistant.const import STATE_ON, ST...
model/sequential_recommender/GRU4RecPlus.py
jasonshere/NeuRec
978
111396
<gh_stars>100-1000 """ Paper: Recurrent Neural Networks with Top-k Gains for Session-based Recommendations Author: <NAME>, and <NAME> Reference: https://github.com/hidasib/GRU4Rec https://github.com/Songweiping/GRU4Rec_TensorFlow @author: <NAME> """ import numpy as np from model.AbstractRecommender import S...
common/src/stack/pylib/stack/dist.py
kmcm0/stacki
123
111402
#! /opt/stack/bin/python # # @copyright@ # Copyright (c) 2006 - 2019 Teradata # All rights reserved. Stacki(r) v5.x stacki.com # https://github.com/Teradata/stacki/blob/master/LICENSE.txt # @copyright@ # # @rocks@ # Copyright (c) 2000 - 2010 The Regents of the University of California # All rights reserved. Rocks(r) v5...
river/linear_model/perceptron.py
fox-ds/river
2,184
111406
from river import optim from .log_reg import LogisticRegression class Perceptron(LogisticRegression): """Perceptron classifier. In this implementation, the Perceptron is viewed as a special case of the logistic regression. The loss function that is used is the Hinge loss with a threshold set to 0, whils...
raspberryturk/embedded/__init__.py
Dzhuks/raspberryturk
169
111409
<gh_stars>100-1000 from raspberryturk import is_running_on_raspberryturk, RaspberryTurkError if not is_running_on_raspberryturk(): raise RaspberryTurkError("Must be running on Raspberry Turk to use {} module.".format(__name__))
tests/namespaced/api/urls.py
pavanv/django-tastypie
1,570
111415
from django.conf import settings from django.conf.urls import include, url from tastypie.api import NamespacedApi from namespaced.api.resources import NamespacedNoteResource, NamespacedUserResource api = NamespacedApi(api_name='v1', urlconf_namespace='special') api.register(NamespacedNoteResource(), canonical=True) a...
presto-benchto-benchmarks/generate_schemas/generate-tpch.py
sreekanth370/presto
9,782
111432
#!/usr/bin/env python schemas = [ # (new_schema, source_schema) ('tpch_10gb_orc', 'tpch.sf10'), ('tpch_100gb_orc', 'tpch.sf100'), ('tpch_1tb_orc', 'tpch.sf1000'), ('tpch_10tb_orc', 'tpch.sf10000'), ('tpch_10gb_text', 'hive.tpch_10gb_orc'), ('tpch_100gb_text', 'hive.tpch_100gb_orc'), ('...
examples/primitives.py
microprediction/simdkalman
148
111459
import numpy as np from simdkalman.primitives import predict, update # define model state_transition = np.array([[1,1],[0,1]]) process_noise = np.eye(2)*0.01 observation_model = np.array([[1,0]]) observation_noise = np.array([[1.0]]) # initial state m = np.array([0, 1]) P = np.eye(2) # predict next state m, P = pred...
tools/utils/elf.py
arcilat-adsk/arnold-usd
171
111563
<filename>tools/utils/elf.py # vim: filetype=python # Copyright 2019 Autodesk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
tests/components/roku/test_remote.py
MrDelik/core
30,023
111565
"""The tests for the Roku remote platform.""" from unittest.mock import MagicMock from homeassistant.components.remote import ( ATTR_COMMAND, DOMAIN as REMOTE_DOMAIN, SERVICE_SEND_COMMAND, ) from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON from homeassistant.core import Hom...
core/company.py
Meliueada/Starup-Game-Python
160
111574
''' Time: 2015.10.2 Author: Lionel Content: Company ''' class Company(object): def __init__(self, name=None): self.__name = name @property def name(self): return self.__name @name.setter def name(self, name): self.__name = name
tempest/lib/api_schema/response/compute/v2_36/quotas.py
rishabh20111990/tempest
254
111611
<filename>tempest/lib/api_schema/response/compute/v2_36/quotas.py # Copyright 2018 ZTE Corporation. 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 # # ...
src/main/anonymization/base_anonymization.py
BMW-InnovationLab/BMW-Anonymization-API
108
111619
<filename>src/main/anonymization/base_anonymization.py<gh_stars>100-1000 from abc import ABC, abstractmethod class BaseAnonymization(ABC): """ Base anonymization class for the detection and the semantic anonymization """ @abstractmethod def blurring(self, image, response, degree=None, id=None, mas...
python/depthcharge/memory/writer.py
justinforbes/depthcharge
133
111626
# SPDX-License-Identifier: BSD-3-Clause # Depthcharge: <https://github.com/nccgroup/depthcharge> """ Provides MemoryWriter base class """ from ..operation import Operation class MemoryWriter(Operation): """ This base class extends :py:class:`~depthcharge.Operation` to provide memory :py:meth:`write()` an...
models/SFMnet.py
jytime/Deep-SfM-Revisited
126
111667
<gh_stars>100-1000 from __future__ import print_function import torch import numpy as np import cv2 import utils import time from models import DICL_shallow from models.RAFT.core.raft import RAFT from models import PSNet as PSNet import essential_matrix from epipolar_utils import * from models.PoseNet import ResNet,Bo...
datapackage/cli.py
chris48s/datapackage-py
183
111672
<reponame>chris48s/datapackage-py # -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from __future__ import absolute_import # from __future__ import unicode_literals import click import json import datapackage from . import config click.disable_unicode_literals_warning = True...
stp_zmq/test/test_large_messages.py
andkononykhin/plenum
148
111708
<gh_stars>100-1000 import json import zmq from stp_core.crypto.util import randomSeed from stp_core.network.port_dispenser import genHa from stp_core.test.helper import SMotor from stp_zmq.test.helper import genKeys from stp_zmq.simple_zstack import SimpleZStack def testSimpleZStacksMsgs(tdir, looper): names = [...
tests/__init__.py
joshuadavidthomas/django_coverage_plugin
172
111716
<gh_stars>100-1000 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt """The tests for the Django Coverage Plugin.""" # Define URLs here so we can use ROOT_URLCONF="tests" try: from django.urls imp...
tests/resillience_tests/process_wait.py
pycampers/zproc
106
111733
<filename>tests/resillience_tests/process_wait.py<gh_stars>100-1000 import zproc ctx = zproc.Context() for i in range(250): @ctx.spawn def my_process(ctx): assert isinstance(ctx, zproc.Context) state = ctx.create_state() assert isinstance(state, zproc.State) print(i) r...
h5Nastran/h5Nastran/h5nastran/_punch.py
ACea15/pyNastran
293
111735
from __future__ import print_function, absolute_import from collections import OrderedDict from ._result_base import H5NastranResultBase from h5Nastran.post_process.result_readers.punch import PunchReader import numpy as np import tables from six import iteritems class H5NastranResultPunch(H5NastranResultBase): ...
examples/class_a.py
maxschommer/pcbdl
117
111737
#!/usr/bin/env python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
setup.py
Symbo1/wsltools
412
111763
<reponame>Symbo1/wsltools # -*- coding: utf-8 -*- #!/usr/bin/env python from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup(name="wsltools", version="0.2.4", description="Web Scan Lazy Tools", long_description=long_description, ...
project/utils/logger.py
MahjongRepository/tenhou-python-bot
201
111804
import datetime import hashlib import logging import os from logging.handlers import SysLogHandler from utils.settings_handler import settings LOG_FORMAT = "%(asctime)s %(levelname)s: %(message)s" DATE_FORMAT = "%Y-%m-%d %H:%M:%S" class ColoredFormatter(logging.Formatter): """ Apply only to the console hand...
ursina/prefabs/animator.py
jtiai/ursina
1,431
111844
<filename>ursina/prefabs/animator.py from ursina import * class Animator(): def __init__(self, animations=None, start_state=''): self.animations = animations # dict if not start_state and self.animations: start_state = list(self.animations)[0] self.start_state = start_sta...
flexneuart/models/base_bert.py
gitter-badger/FlexNeuART
101
111870
# # This code is a modified version of CEDR: https://github.com/Georgetown-IR-Lab/cedr # # (c) Georgetown IR lab & Carnegie Mellon University # # It's distributed under the MIT License # MIT License is compatible with Apache 2 license for the code in this repo. # from flexneuart.models.base import BaseModel from flexne...
src/estimator_utils.py
ruohoruotsi/harmonixset
101
111890
<reponame>ruohoruotsi/harmonixset """ Created 10-13-19 by <NAME> """ # Local imports from audio_utils import mp3_to_wav # Third party imports # None. # Python standard library imports from multiprocessing import Pool import os import tempfile import traceback from functools import wraps import logging def estimat...
py2app_tests/argv_app/main.py
flupke/py2app
193
111896
import sys import os root = os.path.dirname( os.path.dirname( os.path.dirname( os.path.dirname( os.path.abspath(__file__) ) ) ) ) sys.argv[0] = os.path.realpath(sys.argv[0]) fp = open(os.path.join(root, "argv.txt"), "w") ...
rele/management/commands/runrele.py
Itsindigo/rele
183
111916
<filename>rele/management/commands/runrele.py import logging from django.conf import settings from django.core.management import BaseCommand from rele import config from rele.management.discover import discover_subs_modules from rele.worker import create_and_run logger = logging.getLogger(__name__) class Command(B...
vyapp/plugins/jsonfmt.py
iogf/vy
927
111983
""" Overview ======== This plugin implements a key-command to format JSON strings. You select the region containing the JSON then issue the key-command to format it will print any errors on the status bar. Key-Commands ============ Namespace: jsonfmt Mode: EXTRA Event: <Key-j> Description: Format the selected JSON ...
tests/testapp/migrate/page/0001_initial.py
mjl/feincms
325
111990
<reponame>mjl/feincms<filename>tests/testapp/migrate/page/0001_initial.py # Generated by Django 3.0.2 on 2020-01-21 15:21 import django.db.models.deletion from django.db import migrations, models import feincms.contrib.fields import feincms.extensions.base import feincms.extensions.datepublisher import feincms.module...
retriever/lib/download.py
Nageshbansal/retriever
254
112001
import os from retriever.engines import choose_engine from retriever.lib.defaults import SCRIPT_WRITE_PATH from retriever.lib.rdatasets import create_rdataset, update_rdataset_catalog from retriever.lib.repository import check_for_updates from retriever.lib.scripts import SCRIPT_LIST, name_matches from retriever.lib.s...
pipeline/Serverless/common/dynamodb.py
Rkauff/Klayers
1,096
112015
import json import decimal from datetime import datetime # Helper class to convert a DynamoDB item to JSON. class DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): if o % 1 > 0: return float(o) else: return int...
descarteslabs/client/services/catalog/tests/test_catalog.py
carderne/descarteslabs-python
167
112088
<reponame>carderne/descarteslabs-python<gh_stars>100-1000 # Copyright 2018-2020 Descartes Labs. # # 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-...
malib/utils/exp_tools/tune_type.py
zbzhu99/malib
258
112105
<reponame>zbzhu99/malib<filename>malib/utils/exp_tools/tune_type.py from abc import ABCMeta from typing import Sequence class TuneUnit(metaclass=ABCMeta): def __init__(self): pass class Grid(TuneUnit): def __init__(self, data: Sequence): super().__init__() self._data = data @pro...
tests/test_decode.py
entn-at/fast-ctc-decode
120
112113
<filename>tests/test_decode.py #!/usr/env/bin python3 import numpy as np from unittest import TestCase, main from fast_ctc_decode import * class Test1DBeamSearch(TestCase): def setUp(self): self.beam_size = 5 self.alphabet = "NACGT" self.beam_cut_threshold = 0.1 self.probs = self....
python/tests/setup-qfunctions.py
AdelekeBankole/libCEED
123
112116
<gh_stars>100-1000 # Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707. # All Rights reserved. See files LICENSE and NOTICE for details. # # This file is part of CEED, a collection of benchmarks, miniapps, software # libraries ...
parakeet/models/parallel_wavegan/parallel_wavegan.py
zh794390558/DeepSpeech
501
112117
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
dojo/db_migrations/0114_cyclonedx_vuln_uniqu.py
mtcolman/django-DefectDojo
1,772
112148
<filename>dojo/db_migrations/0114_cyclonedx_vuln_uniqu.py<gh_stars>1000+ from django.db import migrations from django.db.models import F class Migration(migrations.Migration): def rename_cyclonedx_parser_vuln_uniq(apps, schema_editor): """ 1) rename test type to reflect changes in the parser ...
tests/core/segment_tree_test.py
stjordanis/rlmeta
258
112154
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import pickle import unittest from math import prod import numpy as np import torch from rlmeta.core.segment_tree import SumSegmentTree, ...
experiments/cifar10/train.py
vishalbelsare/tanda
166
112166
<reponame>vishalbelsare/tanda<gh_stars>100-1000 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from dataset import load_cifar10_data from experiments.train_scripts import flags, select_fold, train from experiments.tfs...
sdk/python/pulumi_gcp/iot/outputs.py
sisisin/pulumi-gcp
121
112172
# 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, Mapping, Optional, Sequence, Union, overload from .. import...
test/augmentation/apply/test_tf_applier.py
HazyResearch/snorkel
2,906
112192
<gh_stars>1000+ import unittest from types import SimpleNamespace from typing import List import pandas as pd from snorkel.augmentation import ( ApplyOnePolicy, PandasTFApplier, RandomPolicy, TFApplier, transformation_function, ) from snorkel.types import DataPoint @transformation_function() def...
redis/commands/bf/info.py
salty-horse/redis-py
483
112242
from ..helpers import nativestr class BFInfo(object): capacity = None size = None filterNum = None insertedNum = None expansionRate = None def __init__(self, args): response = dict(zip(map(nativestr, args[::2]), args[1::2])) self.capacity = response["Capacity"] self.si...
.github/release_log.py
Psycojoker/uvloop
9,084
112254
<reponame>Psycojoker/uvloop<filename>.github/release_log.py #!/usr/bin/env python3 import argparse import json import requests import re BASE_URL = 'https://api.github.com/repos/magicstack/uvloop/compare' def main(): parser = argparse.ArgumentParser( description='Generate release log.') parser.add...
replay.py
Pandinosaurus/pyLiDAR-SLAM
130
112325
<gh_stars>100-1000 # Hydra and OmegaConf from dataclasses import MISSING, dataclass, field import numpy as np from pathlib import Path from typing import Optional from slam.common.modules import _with_viz3d if _with_viz3d: from viz3d.window import OpenGLWindow from omegaconf import DictConfig, OmegaConf # Projec...
utils/bin/add_program.py
RohitAthithya/learntosolveit
136
112343
#!/usr/bin/python """ BUGS: 1. make cprogramming and cprogs dir into a single dir name. """ import os import sys import time LANGUAGE_PATH = '../../languages/' NOW_FORMAT = '%d-%m-%Y %H:%M' PROGRAM_NAME_TEMPLATE = 'PROGRAMNAME' SOURCE_PATH = '../../source/' TEMPLATE_FORMAT = '../{0}_template.rst' INVALID_EXIT =...
cli/jobs/train/tensorflow/iris/src/main.py
denniseik/azureml-examples
331
112360
<reponame>denniseik/azureml-examples<gh_stars>100-1000 # imports import os import mlflow import argparse import pandas as pd import matplotlib.pyplot as plt import tensorflow_decision_forests as tfdf # define functions def main(args): # enable auto logging mlflow.autolog() # read in data df = pd.read...
sample_creation.py
CharlesAuthier/geo-deep-learning
121
112379
<reponame>CharlesAuthier/geo-deep-learning import argparse from datetime import datetime import os import numpy as np np.random.seed(1234) # Set random seed for reproducibility import warnings import rasterio import fiona import shutil import time import json from pathlib import Path from tqdm import tqdm from colle...
desktop/core/ext-py/nose-1.3.7/functional_tests/support/ltfn/test_pak1/__init__.py
kokosing/hue
5,079
112399
from state import called def setup(): called.append('test_pak1.setup') def teardown(): called.append('test_pak1.teardown') def test_one_one(): called.append('test_pak1.test_one_one') def test_one_two(): called.append('test_pak1.test_one_two')
pyvi/__init__.py
minhpqn/pyvi
161
112446
<reponame>minhpqn/pyvi<filename>pyvi/__init__.py __author__ = 'trungtv'
Easy Challenges/Challenge #0007 [Easy]/solutions/solution.py
doctorBeast/challenges
331
112482
<filename>Easy Challenges/Challenge #0007 [Easy]/solutions/solution.py<gh_stars>100-1000 #Python 3.X solution for Easy Challenge #0007 #GitHub: https://github.com/Ashkore #https://www.reddit.com/user/Ashkoree/ alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y...
py/riscv/exception_handlers/SyncDispatcher.py
noahsherrill/force-riscv
111
112492
<gh_stars>100-1000 # # Copyright (C) [2020] Futurewei Technologies, Inc. # # FORCE-RISCV is 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 # # ...
Unit 3 Reservoir Statics/functions/extrapolatepressure.py
datasolver/reservoir-engineering
139
112622
<gh_stars>100-1000 def extrapolatepressure_gas(sg, pressure, temp, delta): import numpy as np R = 10.732 rhogas = (28.97 * sg * pressure) / (z * R * (temp + 459)) # temp convert to Rankine # gas density gradient rhogas_grad = rhogas / 144 # extrapolate using Eq 3.1 pressure_extrapolated_below = press...
sopel.py
Gizmokid2005/sopel
555
112664
#!/usr/bin/env python3 from __future__ import generator_stop import sys # Different from setuptools script, because we want the one in this dir. from sopel.cli import run sys.exit(run.main())
Python3/327.py
rakhi2001/ecom7
854
112666
__________________________________________________________________________________________________ sample 148 ms submission from bisect import bisect_left, bisect_right, insort class Solution: def countRangeSum(self, nums: List[int], lower: int, upper: int) -> int: if(lower > upper): return 0 ...
external/source/meterpreter/source/bionic/libc/kernel/tools/find_headers.py
truekonrads/mirv-metasploit
264
112707
<reponame>truekonrads/mirv-metasploit #!/usr/bin/env python # # this program is used to find source code that includes linux kernel headers directly # (e.g. with #include <linux/...> or #include <asm/...>) # # then it lists import sys, cpp, glob, os, re, getopt, kernel from utils import * from defaults import * progr...
plugin/RunTransfer/RunTransfer.py
iontorrent/TS
125
112710
<reponame>iontorrent/TS #!/usr/bin/env python # Copyright (C) 2013 Ion Torrent Systems, Inc. All Rights Reserved # RunTransfer plugin import os import json import logging import glob import requests import traceback import zipfile from distutils.version import LooseVersion from ion.plugin import * from ion.utils.explog...
ants/utils/multi_label_morphology.py
xemio/ANTsPy
338
112734
""" Morphology operations on multi-label ANTsImage types """ __all__ = ['multi_label_morphology'] import numpy as np def multi_label_morphology(image, operation, radius, dilation_mask=None, label_list=None, force=False): """ Morphology on multi label images. Wraps calls to iMath binary morphology. A...
public-engines/sms-spam-engine/marvin_sms_spam_engine/data_handler/acquisitor_and_cleaner.py
tallandroid/incubator-marvin
101
112745
<reponame>tallandroid/incubator-marvin #!/usr/bin/env python # coding=utf-8 """AcquisitorAndCleaner engine action. Use this module to add the project main code. """ from .._compatibility import six from .._logging import get_logger from marvin_python_toolbox.engine_base import EngineBaseDataHandler from marvin_pytho...
openaps/init.py
ijustlovemath/openaps
525
112749
import os def init (args): shell_cmd = ['git-openaps-init' ] + args.args os.execvp(shell_cmd[0], shell_cmd)
docs/Tutorials/NetlistParser/bookshelf_parser.py
mabrains/ALIGN-public
119
112755
<filename>docs/Tutorials/NetlistParser/bookshelf_parser.py import re from collections import namedtuple from collections import OrderedDict import json # Token specification COMMENT = r'(?P<COMMENT>\#.*\n)' EOLN = r'(?P<EOLN>\n)' NUM = r'(?P<NUM>-?\d*\.\d+|-?\d+\.?)' SEMI = r'(?P<SEMI>;)' LPAREN = r'(?P<LPAREN>\()'...
ghostwriter/rolodex/migrations/0017_projectobjective_position.py
bbhunter/Ghostwriter
601
112766
<filename>ghostwriter/rolodex/migrations/0017_projectobjective_position.py # Generated by Django 3.0.10 on 2021-02-27 00:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rolodex', '0016_auto_20210224_0645'), ] operations = [ migration...
suplemon/modules/rstrip.py
johnmbaughman/suplemon
912
112768
# -*- encoding: utf-8 from suplemon.suplemon_module import Module class RStrip(Module): """Trim whitespace from the end of lines.""" def run(self, app, editor, args): line_nums = editor.get_lines_with_cursors() for n in line_nums: line = editor.lines[n] line.set_data(...
components/aws/sagemaker/tests/unit_tests/tests/deploy/test_deploy_spec.py
nostro-im/pipelines
2,860
112796
from deploy.src.sagemaker_deploy_spec import SageMakerDeploySpec import unittest class DeploySpecTestCase(unittest.TestCase): REQUIRED_ARGS = ["--region", "us-west-2", "--model_name_1", "model-test"] def test_minimum_required_args(self): # Will raise if the inputs are incorrect spec = SageMa...
tonic/agents/__init__.py
Eyalcohenx/tonic
350
112797
<gh_stars>100-1000 from .agent import Agent from .basic import Constant, NormalRandom, OrnsteinUhlenbeck, UniformRandom __all__ = [Agent, Constant, NormalRandom, OrnsteinUhlenbeck, UniformRandom]
terrascript/mysql/__init__.py
hugovk/python-terrascript
507
112819
# terrascript/mysql/__init__.py import terrascript class mysql(terrascript.Provider): pass
build/android/pylib/utils/decorators.py
zealoussnow/chromium
14,668
112821
<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 functools import logging def Memoize(f): """Decorator to cache return values of function.""" memoize_dict = {} @functools.wrap...
configs/benchmarks/classification/imagenet/imagenet_10percent/resnet50_head1_4xb64-steplr1e-2-20e_in1k-10pct.py
mitming/mmselfsup
355
112880
_base_ = 'resnet50_head1_4xb64-steplr1e-1-20e_in1k-10pct.py' # optimizer optimizer = dict(lr=0.01)
Competitions/Skillenza/Blume Fellows Challenge/IntouchApp Recruitment Test/Merge Candidates.py
cnm06/Competitive-Programming
994
112891
contacts = [['p1', 'e1'],['p2', 'e2'],['p2', 'e3'],['e3', 'p4'],['e2', 'p5'],['p3', 'e4', 'p6'],['e4'],['p6', 'e5']] visited = [False]*len(contacts) contacts = map(set, contacts) def dfs(node,index, temp): visited[index] = True result = node for i,item in enumerate(contacts): if not visited[i] and not result.isdi...
tests/trac/test-issue-0069.py
eLBati/pyxb
123
112901
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import pyxb.binding.generate import pyxb.utils.domutils from xml.dom import Node import os.path xsd='''<?xml version="1.0" encoding="utf-8"?> <xs:schema...
trinity/protocol/les/managers.py
pipermerriam/py-evm
137
112912
<filename>trinity/protocol/les/managers.py from typing import ( Any, Dict, Tuple, Type, TYPE_CHECKING, ) from eth_typing import BlockIdentifier from eth.rlp.headers import BlockHeader from p2p.exceptions import ( MalformedMessage, ) from p2p.protocol import ( Command, ) from trinity.prot...
src/super_gradients/common/factories/losses_factory.py
Deci-AI/super-gradients
308
112949
from super_gradients.common.factories.base_factory import BaseFactory from super_gradients.training.losses import LOSSES class LossesFactory(BaseFactory): def __init__(self): super().__init__(LOSSES)