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
test/tst_refcount.py
timgates42/netcdf4-python
574
11186538
import unittest, netCDF4, tempfile, os file_name = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name class RefCountTestCase(unittest.TestCase): def setUp(self): nc = netCDF4.Dataset(file_name, mode='w', keepweakref=True, format='NETCDF4') d = nc.createDimension('fred', 2000) v ...
imdb-wiki-dir/download_imdb_wiki.py
mzl9039/imbalanced-regression
370
11186576
<gh_stars>100-1000 import os import wget print("Downloading IMDB faces...") imdb_file = "./data/imdb_crop.tar" wget.download("https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/static/imdb_crop.tar", out=imdb_file) print("Downloading WIKI faces...") wiki_file = "./data/wiki_crop.tar" wget.download("https://data.visio...
nxt_editor/integration/blender/nxt_blender.py
Mikfr83/nxt_editor
131
11186586
<gh_stars>100-1000 """ Loosely based on the example addon from this repo: https://github.com/robertguetzkow/blender-python-examples """ # Builtin import os import sys import subprocess # External import bpy try: # External from Qt import QtCore, QtWidgets # Internal from nxt_editor.constants import NX...
transformer/fairseq/modules/dropout_select.py
joaompereira/adahessian
162
11186605
<gh_stars>100-1000 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch import torch.nn as nn import torch.nn.init as init import torch.nn.functional as F from torch.nn.parameter imp...
nbviewer/providers/url/__init__.py
AI-Collaboratory/nbviewer
1,840
11186614
<filename>nbviewer/providers/url/__init__.py from .handlers import default_handlers from .handlers import uri_rewrites
examples/rbcd.py
kamnsv/impacket
6,612
11186636
<reponame>kamnsv/impacket #!/usr/bin/env python3 # Impacket - Collection of Python classes for working with network protocols. # # SECUREAUTH LABS. Copyright (C) 2021 SecureAuth Corporation. All rights reserved. # # This software is provided under a slightly modified version # of the Apache Software License. See the ac...
Python/Port_Scanner.py
thefool76/hacktoberfest2021
448
11186656
<filename>Python/Port_Scanner.py import socket import time portlist = { "20" : "ftp data transfer", "21" : "ftp command control", "22" : "ssh", "23" : "telnet", "25" : "smpt", "53" : "dns", "80" : "http", "110" : "pop3", "111" : "rpcbind", "119" : "nntp", "123" : "ntp", ...
bugtests/test339c.py
jeff5/jython-whinchat
577
11186696
import java import test339c class spam(java.lang.Object): pass class eggs1(spam): pass class eggs2(test339c.spam): pass
utils/misc.py
yihui-he2020/epipolar-transformers
360
11186697
import errno import os def mkdir(path): try: os.makedirs(path) except OSError as e: if e.errno != errno.EEXIST: raise def prefix_dict(d, prefix): return {'/'.join([prefix, k]): v for k, v in d.items()}
tests/openbb_terminal/core/log/generation/test_settings.py
tehcoderer/GamestonkTerminal
255
11186738
<gh_stars>100-1000 from openbb_terminal.core.log.generation.settings import ( AppSettings, AWSSettings, LogSettings, Settings, ) def test_aws_settings(): aws_access_key_id = "MOCK_AWS_ACCESS_KEY_ID" aws_secret_access_key = "MOCK_AWS_SECRET_ACCESS_KEY" aws_settings = AWSSettings( a...
pcdet/models/roi_heads/__init__.py
s-ryosky/ST3D
184
11186749
<gh_stars>100-1000 from .roi_head_template import RoIHeadTemplate from .partA2_head import PartA2FCHead from .pvrcnn_head import PVRCNNHead from .second_head import SECONDHead __all__ = { 'RoIHeadTemplate': RoIHeadTemplate, 'PartA2FCHead': PartA2FCHead, 'PVRCNNHead': PVRCNNHead, 'SECONDHead': SECONDHea...
scenic/projects/fast_vit/tests/test_model_utils.py
techthiyanes/scenic
688
11186750
<filename>scenic/projects/fast_vit/tests/test_model_utils.py """Tests for model_utils.py.""" import functools from absl.testing import absltest from absl.testing import parameterized import jax from jax import random import jax.numpy as jnp import numpy as np from scenic.projects.fast_vit import model_utils class At...
smzdm/smzdm/smzdm/smzdm.py
jinzaizhichi/ledesoft
1,491
11186784
# coding: utf-8 import urllib import urllib2 import re import pdb import os import cookielib import StringIO import ConfigParser class Smzdm: def __init__(self): self.cookies = cookielib.CookieJar() self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookies)) self.headers...
corehq/ex-submodules/pillowtop/management/commands/update_es_settings.py
dimagilg/commcare-hq
471
11186834
<reponame>dimagilg/commcare-hq<filename>corehq/ex-submodules/pillowtop/management/commands/update_es_settings.py from django.core.management.base import BaseCommand, CommandError from corehq.elastic import get_es_new from corehq.pillows.utils import get_all_expected_es_indices class Command(BaseCommand): help = ...
SSR-Net/data/TYY_IMDBWIKI_create_db.py
bleakie/MaskInsightface
269
11186869
<reponame>bleakie/MaskInsightface import numpy as np import cv2 import os import csv import argparse from tqdm import tqdm from TYY_utils import get_meta def get_args(): parser = argparse.ArgumentParser(description="This script cleans-up noisy labels " "and creates...
mlens/index/temporal.py
mehrdad-shokri/mlens
760
11186872
<filename>mlens/index/temporal.py<gh_stars>100-1000 """ML-ENSEMBLE :author: <NAME> :copyright: 2017-2018 :licence: MIT Temporal (time series) indexing. """ from __future__ import division from numbers import Integral import numpy as np from .base import BaseIndex from ._checks import check_temporal_index class Te...
test/python/algorithms/evolvers/test_evolution_result.py
ikkoham/qiskit-core
1,456
11186884
<gh_stars>1000+ # This code is part of Qiskit. # # (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications ...
PyObjCTest/test_nsindexset.py
Khan/pyobjc-framework-Cocoa
132
11186895
<gh_stars>100-1000 from PyObjCTools.TestSupport import * from Foundation import * class TestNSIndexSet (TestCase): def testMethods(self): self.assertResultIsBOOL(NSIndexSet.isEqualToIndexSet_) self.assertResultIsBOOL(NSIndexSet.containsIndex_) self.assertResultIsBOOL(NSIndexSet.containsInd...
hooks/gin_config_hook_builder.py
slowy07/tensor2robot
456
11186902
# coding=utf-8 # Copyright 2021 The Tensor2Robot Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
examples/PyObjC/ICSharingWatcher/TableModelAppDelegate.py
flupke/py2app
193
11186934
<reponame>flupke/py2app import os from Cocoa import * import objc import leases FILENAME = '/var/db/dhcpd_leases' def getLeases(fn): if os.path.exists(fn): lines = file(fn, 'U') else: lines = leases.EXAMPLE.splitlines() return list(leases.leases(lines)) class TableModelAppDelegate (NSObje...
zentral/conf/config.py
janheise/zentral
634
11186939
<reponame>janheise/zentral import base64 import itertools import json import logging import os import re import time from .buckets import get_bucket_client from .params import get_param_client from .secrets import get_secret_client logger = logging.getLogger("zentral.conf.config") class Proxy: pass class EnvP...
WebMirror/management/rss_parser_funcs/feed_parse_extractSecondlifetranslationsCom.py
fake-name/ReadableWebProxy
193
11186982
<reponame>fake-name/ReadableWebProxy def extractSecondlifetranslationsCom(item): ''' Parser for 'secondlifetranslations.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('IH', ...
Chapter05/zip_processor.py
4n3i5v74/Python-3-Object-Oriented-Programming-Third-Edition
393
11186987
import sys import shutil import zipfile from pathlib import Path from PIL import Image class ZipProcessor: def __init__(self, zipname): self.zipname = zipname self.temp_directory = Path(f"unzipped-{zipname[:-4]}") def process_zip(self): self.unzip_files() self.process_files() ...
src/network/losses.py
haleqiu/TLIO
127
11186989
<gh_stars>100-1000 import torch from network.covariance_parametrization import DiagonalParam """ MSE loss between prediction and target, no covariance input: pred: Nx3 vector of network displacement output targ: Nx3 vector of gt displacement output: loss: Nx3 vector of MSE loss on x,y,z """ def loss_mse(pre...
run_BOA.py
cyy111/metaheuristics
104
11186994
from models.multiple_solution.swarm_based.BOA import BaseBOA, OriginalBOA, AdaptiveBOA from utils.FunctionUtil import * ## Setting parameters root_paras = { "problem_size": 100, "domain_range": [-100, 100], "print_train": True, "objective_func": C30 } boa_paras = { "epoch": 500, "pop_size": 100...
algorithms/PPO/env_wrapper.py
borgwang/reinforce_py
119
11186997
<gh_stars>100-1000 import time import csv import json import gym from gym.core import Wrapper import os.path as osp import numpy as np from utils import RunningMeanStd class BaseVecEnv(object): """ Vectorized environment base class """ def step(self, vac): """ Apply sequence of actio...
Python/String/ParseStringUpperRemoveSpace.py
piovezan/SOpt
148
11187009
frase = input("Escreva uma frase: ") fraseNova = "" for chr in frase: if chr != " ": fraseNova += chr.upper() print(fraseNova) #https://pt.stackoverflow.com/q/340130/101
mapchete/tile.py
Scartography/mapchete
161
11187047
<filename>mapchete/tile.py """Mapchtete handling tiles.""" from cached_property import cached_property from itertools import product from shapely.geometry import box from tilematrix import Tile, TilePyramid class BufferedTilePyramid(TilePyramid): """ A special tile pyramid with fixed pixelbuffer and metatilin...
codigo_das_aulas/aula_17/exemplo_10.py
VeirichR/curso-python-selenium
234
11187069
from selene.support.shared import browser from selene.support.conditions import be from selene.support.conditions import have browser.open( 'http://selenium.dunossauro.live/aula_07' ) label = browser.element( '[for="nome"]' ) label.should(have.text('nome')) browser.all( 'input' ).should(have.size(4))....
artemis/remote/plotting/utils.py
peteroconnor-bc/artemis
235
11187118
<reponame>peteroconnor-bc/artemis from six.moves import queue import threading import time from collections import namedtuple from artemis.remote.utils import recv_size, send_size def _queue_get_all_no_wait(q, max_items_to_retreive): """ Empties the queue, but takes maximally maxItemsToRetreive from the queue...
bandits/__init__.py
jadkins99/bandits
686
11187135
<reponame>jadkins99/bandits from .agent import Agent, GradientAgent, BetaAgent from .bandit import GaussianBandit, BinomialBandit, BernoulliBandit from .environment import Environment from .policy import (EpsilonGreedyPolicy, GreedyPolicy, RandomPolicy, UCBPolicy, SoftmaxPolicy)
day12/Python/boyerMoore.py
Grace0Hud/dailycodebase
249
11187140
''' @author prateek3255 @date 05/01/2018 ''' def boyerMoore(string,pattern): n=len(string) m=len(pattern) i=0 while i<=n-m: k=m-1 j=m+i-1 while string[j]==pattern[k]: k=k-1 j=j-1 if k==0: return i if pattern.rfind(s...
rex/enums.py
shellphish/rex
471
11187188
<gh_stars>100-1000 class CrashInputType: STDIN = "stdin" POV_FILE = "pov_file" TCP = "tcp" UDP = "udp" TCP6 = "tcp6" UDP6 = "udp6"
Datasets/Terrain/alos_topo_diversity.py
monocilindro/qgis-earthengine-examples
646
11187208
import ee from ee_plugin import Map dataset = ee.Image('CSP/ERGo/1_0/Global/ALOS_topoDiversity') alosTopographicDiversity = dataset.select('constant') alosTopographicDiversityVis = { 'min': 0.0, 'max': 1.0, } Map.setCenter(-111.313, 39.724, 6) Map.addLayer( alosTopographicDiversity, alosTopographicDiversityV...
climin/initialize.py
farhansabir123/climin
140
11187250
<reponame>farhansabir123/climin # -*- coding: utf-8 -*- """Module that contains functionality to initialize parameters to starting values.""" from __future__ import absolute_import import random import numpy as np from . import mathadapt as ma from .compat import range def sparsify_columns(arr, n_non_zero, keep_...
isegm/utils/log.py
XavierCHEN34/ClickSEG
278
11187274
import io import time import logging from datetime import datetime import numpy as np from torch.utils.tensorboard import SummaryWriter LOGGER_NAME = 'root' LOGGER_DATEFMT = '%Y-%m-%d %H:%M:%S' handler = logging.StreamHandler() logger = logging.getLogger(LOGGER_NAME) logger.setLevel(logging.INFO) logger.addHandler(...
common/migrations/0034_auto_20210913_1918.py
jordanm88/Django-CRM
1,334
11187288
<filename>common/migrations/0034_auto_20210913_1918.py # Generated by Django 3.2 on 2021-09-13 13:48 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import phonenumber_field.modelfields class Migration(migrations.Migration): dependencies = [ ('c...
python/ql/test/query-tests/Security/lib/twisted/web/resource.py
vadi2/codeql
4,036
11187329
<gh_stars>1000+ class Resource(object): pass
subliminal/subtitle.py
jtwill/subliminal
152
11187346
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import os.path import babelfish import chardet import guessit.matchtree import guessit.transfo import pysrt from .video import Episode, Movie logger = logging.getLogger(__name__) class Subtitle(object): """Base class for subtitle ...
koalixcrm/djangoUserExtension/user_extension/text_paragraph.py
Cataldir/koalixcrm
290
11187380
# -*- coding: utf-8 -*- from django.db import models from django.contrib import admin from django.utils.translation import ugettext as _ from koalixcrm.crm.const.purpose import * class TextParagraphInDocumentTemplate(models.Model): document_template = models.ForeignKey("djangoUserExtension.DocumentTemplate") ...
astropy/tests/tests/test_runner.py
jayvdb/astropy
445
11187383
<filename>astropy/tests/tests/test_runner.py<gh_stars>100-1000 import pytest # Renamed these imports so that them being in the namespace will not # cause pytest 3 to discover them as tests and then complain that # they have __init__ defined. from astropy.tests.runner import TestRunner as _TestRunner from astropy.tests...
corehq/tabs/extension_points.py
dimagilg/commcare-hq
471
11187411
from typing import List, Tuple from corehq.extensions import extension_point, ResultFormat @extension_point(result_format=ResultFormat.FLATTEN) def uitab_dropdown_items(tab_name, tab, domain, request) -> List[dict]: """Add dropdown items to UI Tabs. Parameters: :param tab_name: Name of the tab that ...
norminette/lexer/__init__.py
kohkubo/norminette
460
11187430
from norminette.lexer.lexer import Lexer from norminette.lexer.lexer import TokenError from norminette.lexer.tokens import Token __all__ = ["Lexer", "TokenError", "Token"]
convert_labels.py
QzAnsel/Person-Segmentation-Keras
155
11187461
<reponame>QzAnsel/Person-Segmentation-Keras<gh_stars>100-1000 import os import cv2 from tqdm import tqdm import argparse parse = argparse.ArgumentParser() parse.add_argument('--img-path', type=str, default='') parse.add_argument('--save-path', type=str, default='') parse.add_argument('--mode', type=str, default='segme...
tests/utils.py
projectoriented/tools
142
11187464
<filename>tests/utils.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Helper functions for tests """ import functools import tempfile def with_temporary_folder(func): """ Call the decorated funtion under the tempfile.TemporaryDirectory context manager. Pass the temporary directory name to the decor...
examples/bench/django/templatetags/bench.py
LordAro/mako
207
11187496
<reponame>LordAro/mako<gh_stars>100-1000 from django.template import Library, Node, resolve_variable from django.utils.html import escape register = Library() def greeting(name): return "Hello, %s!" % escape(name) greeting = register.simple_tag(greeting)
tests/canary/agent/canary.py
02strich/aws-embedded-metrics-python
130
11187502
<reponame>02strich/aws-embedded-metrics-python import asyncio import aws_embedded_metrics from aws_embedded_metrics import metric_scope from aws_embedded_metrics.config import get_config from getversion import get_module_version import os import psutil import time import logging log = logging.getLogger(__name__) vers...
src/related/functions.py
RodrigoDeRosa/related
190
11187526
from __future__ import absolute_import, division, print_function from collections import OrderedDict from enum import Enum import yaml import json from attr._make import fields try: from functools import singledispatch except ImportError: from singledispatch import singledispatch @singledispatch def to_di...
vaas-app/src/vaas/purger/urls.py
allegro/vaas
251
11187542
# -*- coding: utf-8 -*- from django.conf.urls import url from vaas.purger.views import purge_view urlpatterns = [ url(r'^$', purge_view, name='purge_view'), ]
sdk/avalon_sdk/connector/blockchains/fabric/fabric_worker_registry_list.py
ikegawa-koshi/avalon
127
11187580
# Copyright 2019 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
src/connection-monitor-preview/azext_connection_monitor_preview/_help.py
Mannan2812/azure-cli-extensions
207
11187612
# 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. # -----------------------------------------------------...
kafka/coordinator/heartbeat.py
timgates42/kafka-python
4,389
11187616
from __future__ import absolute_import, division import copy import time class Heartbeat(object): DEFAULT_CONFIG = { 'group_id': None, 'heartbeat_interval_ms': 3000, 'session_timeout_ms': 10000, 'max_poll_interval_ms': 300000, 'retry_backoff_ms': 100, } def __init...
tools/test_idf_py/test_idf_extensions/test_ext/__init__.py
DCNick3/esp-idf
8,747
11187646
from .test_extension import action_extensions # noqa: F401
malspider_django/dashboard/forms.py
andrewhenke/malspider
453
11187681
from django import forms class LoginForm(forms.Form): username = forms.CharField(label='Username', max_length=100, widget=forms.TextInput(attrs={'class':'form-control', 'placeholder':'username'})) password = forms.CharField(label='Password', widget=forms.PasswordInput(attrs={'class':'form-control', 'placeholde...
tests/spinful_fermion_tensor_test.py
anton-buyskikh/QuSpin
195
11187684
<filename>tests/spinful_fermion_tensor_test.py from __future__ import print_function, division import sys,os quspin_path = os.path.join(os.getcwd(),"../") sys.path.insert(0,quspin_path) from quspin.operators import hamiltonian from quspin.basis import tensor_basis,spinless_fermion_basis_1d,spinful_fermion_basis_1d # ...
test/common/parameterized_utils.py
parmeet/text
3,172
11187685
<gh_stars>1000+ import json from parameterized import param import os.path _TEST_DIR_PATH = os.path.realpath( os.path.join(os.path.dirname(__file__), '..')) def get_asset_path(*paths): """Return full path of a test asset""" return os.path.join(_TEST_DIR_PATH, 'asset', *paths) def load_params(*paths): ...
scale/product/test/utils.py
kaydoh/scale
121
11187710
"""Defines utility methods for testing products""" from __future__ import unicode_literals import hashlib import django.utils.timezone as timezone from job.test import utils as job_utils from product.models import FileAncestryLink from storage.models import ScaleFile from storage.test import utils as storage_utils ...
env/Lib/site-packages/OpenGL/GLES2/APPLE/texture_packed_float.py
5gconnectedbike/Navio2
210
11187726
'''OpenGL extension APPLE.texture_packed_float This module customises the behaviour of the OpenGL.raw.GLES2.APPLE.texture_packed_float to provide a more Python-friendly API Overview (from the spec) This extension adds two new 3-component floating-point texture formats that fit within a single 32-bit word called...
rpython/jit/metainterp/optimizeopt/test/test_intdiv.py
nanjekyejoannah/pypy
381
11187738
<reponame>nanjekyejoannah/pypy<gh_stars>100-1000 import sys import py from hypothesis import given, strategies from rpython.jit.metainterp.optimizeopt.intdiv import magic_numbers, LONG_BIT from rpython.jit.metainterp.optimizeopt.intdiv import division_operations from rpython.jit.metainterp.optimizeopt.intdiv import mo...
bag/simulation/__init__.py
felixonmars/BAG_framework
123
11187748
<reponame>felixonmars/BAG_framework # -*- coding: utf-8 -*- """This package defines various utility classes for running simulations and data post-processing. """
special/kfold/model/model_interface.py
dumpmemory/pytorch-lightning-template
257
11187749
# Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
Flask/helloworld.py
Zhgx/bili
166
11187795
<reponame>Zhgx/bili from flask import Flask, request, jsonify, session from werkzeug.utils import redirect app = Flask(__name__) app.secret_key = "asdasdasdasdasdsaa" @app.route("/", methods=["GET"]) def hello_world(): return "hello 音宫" @app.route("/hey/<username>") def hey_yingong(username): return "我是 %s...
causalinference/causal.py
youngminju-phd/Causalinference
392
11187920
from __future__ import division import numpy as np from itertools import combinations_with_replacement from .core import Data, Summary, Propensity, PropensitySelect, Strata from .estimators import OLS, Blocking, Weighting, Matching, Estimators class CausalModel(object): """ Class that provides the main tools of C...
lib/disco/sysutil.py
pooya/disco
786
11187987
<reponame>pooya/disco<filename>lib/disco/sysutil.py import sys, resource from ctypes import * import ctypes.util if sys.platform == "darwin": def available_memory(): libc = cdll.LoadLibrary(ctypes.util.find_library("libc")) mem = c_uint64(0) size = c_size_t(sizeof(mem)) libc.sysctlb...
us-weather-history/wunderground_scraper.py
h4ckfu/data
16,124
11187988
# coding: utf-8 from datetime import datetime, timedelta from urllib.request import urlopen import os def scrape_station(station): ''' This function scrapes the weather data web pages from wunderground.com for the station you provide it. You can look up your city's weather station by performing a se...
parser.py
fossasia/open-event-scraper
2,140
11188026
# result is a dictionary of the excel sheet def get_linkedin_url(result): if result.has_key("linkedin"): return result["linkedin"] elif result.has_key("Linkedin"): return result["Linkedin"] elif result.has_key("LinkedIn"): return result["LinkedIn"] elif result.has_key("linkedIn")...
flask_editablesite/settings.py
Jaza/flask-editablesite
115
11188029
<gh_stars>100-1000 # -*- coding: utf-8 -*- import ast import os import pymemcache.client.base as memcached os_env = os.environ class Config(object): SECRET_KEY = os_env.get( 'FLASK_EDITABLESITE_SECRET', 'secret-key') # TODO: Change me APP_DIR = os.path.abspath( os.path.dirname(__file...
submitit/local/_local.py
sidsamsi/submitit
602
11188056
<reponame>sidsamsi/submitit # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # import sys from pathlib import Path from .local import Controller if __name__ == "__main__": assert len(sy...
examples/signal_bkg_mass_fit.py
simonthor/zfit
129
11188107
<filename>examples/signal_bkg_mass_fit.py # Copyright (c) 2020 zfit import zfit # create space obs = zfit.Space("x", limits=(-10, 10)) # parameters mu = zfit.Parameter("mu", 1., -4, 6) sigma = zfit.Parameter("sigma", 1., 0.1, 10) lambd = zfit.Parameter("lambda", -0.06, -1, -0.01) frac = zfit.Parameter("fraction", 0...
2022/CVE-2022-0824/poc/pocsploit/CVE-2022-0824.py
hjyuan/reapoc
421
11188111
<gh_stars>100-1000 import requests from plugins.oob import verify_request, gen_oob_domain # Vuln Base Info def info(): return { "author": "cckuailong", "name": '''Webmin below 1.990 - File Manager privilege exploit''', "description": '''Improper Access Control to Remote Code Execution in ...
docs/manual/inputs/python_control_port.py
cpick/mongrel2
299
11188121
import zmq from mongrel2 import tnetstrings from pprint import pprint CTX = zmq.Context() addr = "ipc://run/control" ctl = CTX.socket(zmq.REQ) print "CONNECTING" ctl.connect(addr) while True: cmd = raw_input("> ") # will only work with simple commands that have no arguments ctl.send(tnetstrings.dump([c...
th_pocket/tests.py
Leopere/django-th
1,069
11188130
<reponame>Leopere/django-th # coding: utf-8 import arrow import datetime from django.conf import settings from django_th.tests.test_main import MainTest from pocket import Pocket from th_pocket.forms import PocketProviderForm, PocketConsumerForm from th_pocket.models import Pocket as PocketModel from th_pocket.my_po...
configs/repvgg/deploy/repvgg-A2_deploy_4xb64-coslr-120e_in1k.py
YuxinZou/mmclassification
1,190
11188161
_base_ = '../repvgg-A2_4xb64-coslr-120e_in1k.py' model = dict(backbone=dict(deploy=True))
tests/unit/analysis/test_grid.py
CartoDB/cartoframes
236
11188172
# """Unit tests for cartoframes.analysis.grid""" import os import pytest import numpy as np from pandas import read_csv from geopandas import GeoDataFrame from shapely.geometry import box, shape from cartoframes.analysis.grid import QuadGrid from cartoframes.utils.geom_utils import set_geometry from geopandas.testi...
test.py
fxia22/kdnet.pytorch
116
11188198
from datasets import PartDataset import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torch.optim as optim from kdtree import make_cKDTree import sys num_points = 2048 class KDNet(nn.Module): def __init__(self, k = 16): super(KDNe...
tests/cgd_test.py
SachinKumar105/Implicit-Competitive-Regularization
107
11188199
<reponame>SachinKumar105/Implicit-Competitive-Regularization from optims.cgd_utils import conjugate_gradient, Hvp_vec import unittest import torch import torch.nn as nn import torch.autograd as autograd from optims import BCGD, LCGD from optims.testOptim import testLCGD, ICR, testBCGD from tensorboardX import SummaryW...
tests/epyccel/modules/call_user_defined_funcs.py
dina-fouad/pyccel
206
11188201
# pylint: disable=missing-function-docstring, missing-module-docstring/ # This module test call user defined functions # through nested functions from pyccel.decorators import types def do_nothing(): x = 0 x *= 0 @types('real') def not_change(s): s *= s @types('real', 'real') def my_div(a, b): retur...
google/datalab/bigquery/_query_stats.py
freyrsae/pydatalab
198
11188230
<gh_stars>100-1000 # Copyright 2015 Google 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 applic...
src/postprocessing/clean_list_with_wordnet.py
paperplanet/SegPhrase
275
11188231
<gh_stars>100-1000 from nltk.corpus import wordnet as wn from nltk.corpus.reader import NOUN import argparse parser = argparse.ArgumentParser() parser.add_argument("-input", help="input path for concepts file") parser.add_argument("-output", help="output path for noise file") args = parser.parse_args() poor_results =...
Lib/test/test_classdecorators.py
jimmyyu2004/jython
332
11188233
<gh_stars>100-1000 # This test is temporary until we can import test_decorators from CPython 3.x # The reason for not doing that already is that in Python 3.x the name of a # function is stored in func.__name__, in 2.x it's func.func_name import unittest from test import support class TestClassDecorators(unittest.Test...
python/iog/eval.py
Suveksha/labelflow
164
11188239
import os.path from torch.utils.data import DataLoader from evaluation.eval import eval_one_result import dataloaders.pascal as pascal exp_root_dir = "./" method_names = [] method_names.append("run_0") if __name__ == "__main__": # Dataloader dataset = pascal.VOCSegmentation(transform=None, retname=True) ...
magma/passes/passes.py
leonardt/magma
167
11188240
<filename>magma/passes/passes.py from abc import ABC, abstractmethod from magma.is_definition import isdefinition from magma.linking import get_all_linked_modules, has_any_linked_modules from magma.passes.tsort import tsort __all__ = ['Pass', 'InstancePass', 'DefinitionPass', 'InstanceGraphPass', 'pass_la...
src/PlugIns/PE/StringPlug.py
codexgigassys/codex-backend
161
11188266
<filename>src/PlugIns/PE/StringPlug.py # Copyright (C) 2016 <NAME>. # This file is part of CodexGigas - https://github.com/codexgigassys/ # See the file 'LICENSE' for copying permission. from PlugIns.PlugIn import PlugIn from Modules.MetaDataModule import * from Modules.PEFileModule import PEFileModule import validator...
tests/problems/test_santa.py
bahia14/Evol
161
11188278
import math import pytest from evol.problems.routing import MagicSanta @pytest.fixture def base_problem(): return MagicSanta(city_coordinates=[(0, 1), (1, 0), (1, 1)], home_coordinate=(0, 0), gift_weight=[0, 0, 0]) @pytest.fixture def adv_problem(): return Magic...
inpainting/models/utils.py
m-svo/video-object-removal
2,462
11188302
import torch import torch.nn as nn from torch.autograd import Variable from torch.backends import cudnn from random import * import numpy as np import matplotlib.pyplot as plt import torch.nn.functional as F def down_sample(x, size=None, scale_factor=None, mode='nearest'): # define size if user has specified scale...
walrus/counter.py
pavel-francirek/walrus
1,039
11188337
<filename>walrus/counter.py class Counter(object): """ Simple counter. """ def __init__(self, database, name): """ :param database: A walrus ``Database`` instance. :param str name: The name for the counter. """ self.database = database self.name = name ...
z3/get.py
ElvisTheKing/z3
287
11188369
import argparse import sys import re import boto3 import botocore from boto3.s3.transfer import TransferConfig from z3.config import get_config MB = 1024 ** 2 def main(): cfg = get_config() parser = argparse.ArgumentParser( description='Read a key from s3 and write the content to stdout', ) ...
speech_recognition/rnnt/pytorch/dataset.py
CaoZhongZ/inference
388
11188376
<filename>speech_recognition/rnnt/pytorch/dataset.py # Copyright (c) 2019, NVIDIA 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 # # http://www.apache.o...
pi3d/util/PostProcess.py
helgeerbe/pi3d
177
11188378
import ctypes from pi3d.constants import (opengles, GL_SCISSOR_TEST, GLint, GLsizei, GL_RGBA, GLubyte, GL_UNSIGNED_BYTE) from pi3d.Shader import Shader from pi3d.Camera import Camera from pi3d.shape.LodSprite import LodSprite from pi3d.util.OffScreenTexture import OffScreenTexture class PostProcess(Of...
routes/api.py
RobbiNespu/forget
157
11188412
<gh_stars>100-1000 from app import app, db, imgproxy from libforget.auth import require_auth_api, get_viewer from flask import jsonify, redirect, make_response, request, Response from model import Account import libforget.settings import libforget.json import random @app.route('/api/health_check') # deprecated 2021-03...
tencentcloud/ams/v20201229/errorcodes.py
PlasticMem/tencentcloud-sdk-python
465
11188465
<reponame>PlasticMem/tencentcloud-sdk-python # -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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 Lic...
homeassistant/components/motioneye/sensor.py
MrDelik/core
30,023
11188473
<reponame>MrDelik/core<gh_stars>1000+ """Sensor platform for motionEye.""" from __future__ import annotations import logging from types import MappingProxyType from typing import Any from motioneye_client.client import MotionEyeClient from motioneye_client.const import KEY_ACTIONS, KEY_NAME from homeassistant.compon...
bzi/dec/bzi.py
shyamjangid07/Reverse-Engineering
337
11188485
# Deobfuscated BY HTR-TECH | <NAME> # Github : https://github.com/htr-tech # Instagram : https://www.instagram.com/tahmid.rayat # Facebook : https://fb.com/tahmid.rayat.oficial # Messenger : https://m.me/tahmid.rayat.oficial try: import os,sys,time,datetime,random,hashlib,re,threading,json,urllib,cookielib...
socket__tcp__examples/hello_world__with_RSA_AES__commands_in_JSON__client=public_and_server=private/utils.py
DazEB2/SimplePyScripts
117
11188518
<reponame>DazEB2/SimplePyScripts #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import enum class CommandEnum(enum.Enum): CURRENT_DATETIME = enum.auto() CURRENT_TIMESTAMP = enum.auto() RANDOM = enum.auto() GUID = enum.auto() FILE_NAME_PUBLIC_KEY = 'keys/public.pem' FILE_NA...
platypush/backend/http/app/routes/plugins/qrcode/__init__.py
RichardChiang/platypush
228
11188536
<gh_stars>100-1000 import base64 from flask import abort, request, Blueprint, Response from platypush.backend.http.app import template_folder from platypush.context import get_plugin qrcode = Blueprint('qrcode', __name__, template_folder=template_folder) # Declare routes list __routes__ = [ qrcode, ] @qrcode....
applications/pytorch/bert/tests/accuracy_test.py
payoto/graphcore_examples
260
11188569
<reponame>payoto/graphcore_examples # Copyright (c) 2021 Graphcore Ltd. 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....
Algebraic-Diagrammatic-Construction/IP_EA_ADC2.py
andyj10224/psi4numpy
214
11188611
<reponame>andyj10224/psi4numpy ''' A reference implementation of ADC(2) for the calculation of ionization potentials and electron affinities for a restricted Hartree-Fock reference. A spin orbital formulation is used, as it simplifies the equations. References: <NAME>, <NAME>, <NAME> and <NAME>, J. Chem. Phys., ...
pyclustering/cluster/tests/unit/ut_bsas.py
JosephChataignon/pyclustering
1,013
11188651
"""! @brief Unit-tests for BSAS algorithm. @authors <NAME> (<EMAIL>) @date 2014-2020 @copyright BSD-3-Clause """ import unittest # Generate images without having a window appear. import matplotlib matplotlib.use('Agg') from pyclustering.cluster.tests.bsas_templates import bsas_test_template from pyclustering.clu...
src/users/urls.py
denkasyanov/education-backend
151
11188690
from django.urls import path from users.api.views import SelfView urlpatterns = [ path('me/', SelfView.as_view()), ]
examples/wordfreq.py
ShadowJonathan/txredisapi
104
11188708
<filename>examples/wordfreq.py #!/usr/bin/env python # coding: utf-8 from __future__ import print_function import sys import txredisapi as redis from twisted.internet import defer from twisted.internet import reactor def wordfreq(file): try: f = open(file, 'r') words = f.read() f.close(...