max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
annotations/rip_annotated_junctions.py
ChristopherWilks/snaptron
25
3800
#!/usr/bin/env python """ rip_annotated_junctions.py Non-reference/species verson of this script, no lift-over Rips junctions from annotation files contained in jan_24_2016_annotations.tar.gz, as described in annotation_definition.md. Junctions are dumped to stdout, which we record as annotated_junctions.tsv.gz in ru...
2.1875
2
dramkit/_tmp/VMD.py
Genlovy-Hoo/dramkit
0
3801
<gh_stars>0 # -*- coding: utf-8 -*- import numpy as np def vmd( signal, alpha, tau, K, DC, init, tol): ''' 用VMD分解算法时只要把信号输入进行分解就行了,只是对信号进行分解,和采样频率没有关系, VMD的输入参数也没有采样频率。 VMD分解出的各分量在输出量 u 中,这个和信号的长度、信号的采样频率没有关系。 迭代时各分量的中心频率在输出量omega,可以用2*pi/fs*omega求出中心频率, 但迭代时的频率是变化的。 Input and Parameters:...
2.453125
2
src/PyDS/Queue/Deque.py
AoWangPhilly/PyDS
0
3802
<reponame>AoWangPhilly/PyDS<gh_stars>0 class Deque: def add_first(self, value): ... def add_last(self, value): ... def delete_first(self): ... def delete_last(self): ... def first(self): ... def last(self): ... def is_empty(self): ...
2.671875
3
forum/main.py
asmaasalih/my_project
1
3803
<gh_stars>1-10 import models import stores member1 =models.Member("ahmed",33) member2 =models.Member("mohamed",30) post1=models.Post("Post1", "Content1") post2= models.Post("Post2", "Content2") post3= models.Post("Post3", "Content3") #member store member_store=stores.MemberStore() member_store.add(member1) member_s...
2.265625
2
shellfind.py
bhavyanshu/Shell-Finder
4
3804
<gh_stars>1-10 #!/usr/bin/env python ''' Author : <NAME> Email : <EMAIL> Description : shellfind.py is a Python command line utility which lets you look for shells on a site that the hacker must have uploaded. It considers all the shells available and tries all possibilities via dictionary match. ''' import socket impo...
2.8125
3
question3.py
nosisky/algo-solution
1
3805
<gh_stars>1-10 # A string S consisting of N characters is considered to be properly nested if any of the following conditions is true: # S is empty; # S has the form "(U)" or "[U]" or "{U}" where U is a properly nested string; S has the form "VW" where V and W are properly nested strings. # For example, the string "{[(...
3.9375
4
Teil_27_Game_of_Life_3d.py
chrMenzel/A-beautiful-code-in-Python
50
3806
import bpy import random as rnd from collections import Counter import itertools as iter feld_von, feld_bis = -4, 4 spielfeld_von, spielfeld_bis = feld_von-6, feld_bis+6 anz = int((feld_bis-feld_von)**3*.3) spielfeld = {(rnd.randint(feld_von, feld_bis), rnd.randint( feld_von, feld_bis), rnd.randint(feld_von, fe...
2.25
2
power_perceiver/xr_batch_processor/reduce_num_pv_systems.py
openclimatefix/power_perceiver
0
3807
from dataclasses import dataclass import numpy as np import xarray as xr from power_perceiver.load_prepared_batches.data_sources import PV from power_perceiver.load_prepared_batches.data_sources.prepared_data_source import XarrayBatch @dataclass class ReduceNumPVSystems: """Reduce the number of PV systems per e...
2.921875
3
HelloWorld_python/log/demo_log_3.py
wang153723482/HelloWorld_my
0
3808
#encoding=utf8 # 按天生成文件 import logging import time from logging.handlers import TimedRotatingFileHandler #---------------------------------------------------------------------- if __name__ == "__main__": logFilePath = "timed_test.log" logger = logging.getLogger("YouLoggerName") logger.setLevel(logging....
2.90625
3
bot_da_os/statemachine/person/person_action.py
Atsocs/bot-da-os
0
3809
from operator import eq class PersonAction: def __init__(self, action): self.action = action def __str__(self): return self.action def __eq__(self, other): return eq(self.action, other.action) # Necessary when __cmp__ or __eq__ is defined # in order to make this class usable as ...
3.546875
4
MyServer.py
bisw1jit/MyServer
3
3810
# Tool Name :- MyServer # Author :- LordReaper # Date :- 13/11/2018 - 9/11/2019 # Powered By :- H1ckPro Software's import sys import os from time import sleep from core.system import * if len(sys.argv)>1: pass else: print ("error : invalid arguments !!") print ("use : myserver --help for more information") s...
2.4375
2
tests/test_gen_epub.py
ffreemt/tmx2epub
0
3811
""" test gen_epub. """ from tmx2epub.gen_epub import gen_epub def test_gen_epub2(): """ test_gen_epub2. """ from pathlib import Path infile = r"tests\2.tmx" stem = Path(infile).absolute().stem outfile = f"{Path(infile).absolute().parent / stem}.epub" assert gen_epub(infile, debug=True) == out...
2.15625
2
pub_sub/python/http/checkout/app.py
amulyavarote/quickstarts
0
3812
import json import time import random import logging import requests import os logging.basicConfig(level=logging.INFO) base_url = os.getenv('BASE_URL', 'http://localhost') + ':' + os.getenv( 'DAPR_HTTP_PORT', '3500') PUBSUB_NAME = 'order_pub_sub' TOPIC = 'orders' logging.info('Publishing to baseUR...
2.59375
3
jj.py
smailedge/pro
1
3813
<gh_stars>1-10 # -*- coding: utf-8 -*- from linepy import * from datetime import datetime from time import sleep from humanfriendly import format_timespan, format_size, format_number, format_length import time, random, sys, json, codecs, threading, glob, re, string, os, requests, subprocess, six, ast, pytz, urllib, ur...
2.171875
2
dd_app/messaging/backend.py
datadealer/dd_app
2
3814
<gh_stars>1-10 class RedisBackend(object): def __init__(self, settings={}, *args, **kwargs): self.settings = settings @property def connection(self): # cached redis connection if not hasattr(self, '_connection'): self._connection = self.settings.get('redis.connector').g...
2.46875
2
fetch_data.py
bitfag/bt-macd-binance
0
3815
<gh_stars>0 #!/usr/bin/env python from btmacd.binance_fetcher import BinanceFetcher def main(): fetcher = BinanceFetcher("BTCUSDT", filename="binance_ohlc.csv", start_date="01.01.2018") fetcher.fetch() if __name__ == "__main__": main()
1.828125
2
tensorflow_probability/python/mcmc/diagnostic.py
Frightera/probability
1
3816
# Copyright 2018 The TensorFlow Probability 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 law o...
1.695313
2
mpl/models/leaf.py
jiangyuang/ModelPruningLibrary
13
3817
from torch import nn as nn from .base_model import BaseModel from ..nn.conv2d import DenseConv2d from ..nn.linear import DenseLinear __all__ = ["Conv2", "conv2", "Conv4", "conv4"] class Conv2(BaseModel): def __init__(self): super(Conv2, self).__init__() self.features = nn.Sequential(DenseConv2d(...
2.859375
3
scripts/generate_network_interactomix.py
quimaguirre/NetworkAnalysis
1
3818
<reponame>quimaguirre/NetworkAnalysis import argparse import ConfigParser import sys, os, re import biana try: from biana import * except: sys.exit(10) import methods_dictionaries as methods_dicts def main(): options = parse_user_arguments() generate_network(options) def parse_user_argumen...
2.671875
3
tests/data/s3_scrape_config.py
kids-first/kf-api-study-creator
3
3819
<gh_stars>1-10 """ This is an extract config intended for S3 object manifests produced by TBD. To use it, you must import it in another extract config and override at least the `source_data_url`. You may also append additional operations to the `operations` list as well. For example you could have the following in yo...
1.765625
2
hard-gists/5c973ec1b5ab2e387646/snippet.py
jjhenkel/dockerizeme
21
3820
import bpy from bpy.app.handlers import persistent bl_info = { "name": "Playback Once", "author": "<NAME>", "version": (1, 0, 0), "blender": (2, 67, 3), "location": "", "description": "Playback once.", "warning": "", "wiki_url": "", "tracker_url": "", "category": "Animation"} @...
2.453125
2
Py3Challenges/saves/challenges/c6_min.py
AlbertUnruh/Py3Challenges
2
3821
<filename>Py3Challenges/saves/challenges/c6_min.py """ To master this you should consider using the builtin-``min``-function. """ from ...challenge import Challenge from random import randint x = [] for _ in range(randint(2, 10)): x.append(randint(1, 100)) intro = f"You have to print the lowest value of {', '.jo...
3.8125
4
services/web/server/tests/unit/with_dbs/01/test_director_v2.py
mrnicegyu11/osparc-simcore
0
3822
# pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name from typing import AsyncIterator import pytest from aioresponses import aioresponses from faker import Faker from hypothesis import HealthCheck, given, settings from hypothesis import strategies as st from models_...
1.828125
2
tools/py/heatmap.py
sriramreddyM/pLitter
5
3823
''' converts video to frames and saves images by different interval, or overlap, etc ''' import folium from folium import plugins from folium.plugins import HeatMap import csv # class plitterMap(): # def __int__(self, file_path): # self.data = file_path # df = [] # with open(self.data) as f...
3.046875
3
generator.py
Geoalert/emergency-mapping
3
3824
import numpy as np def random_augmentation(img, mask): #you can add any augmentations you need return img, mask def batch_generator(image, mask, batch_size=1, crop_size=0, patch_size=256, bbox= None, augment...
3.28125
3
awx/api/metadata.py
Avinesh/awx
1
3825
# Copyright (c) 2016 Ansible, Inc. # All Rights Reserved. from collections import OrderedDict # Django from django.core.exceptions import PermissionDenied from django.db.models.fields import PositiveIntegerField, BooleanField from django.db.models.fields.related import ForeignKey from django.http import Http404 from ...
1.8125
2
plugins/python/tasks.py
BBVA/deeptracy
85
3826
import json from washer.worker.actions import AppendStdout, AppendStderr from washer.worker.actions import CreateNamedLog, AppendToLog from washer.worker.actions import SetProperty from washer.worker.commands import washertask def pipenv_graph2deps(rawgraph): graph = json.loads(rawgraph) def build_entry(dat...
2.40625
2
senity/utils/getSiteProfile.py
pkokkinos/senity
1
3827
<filename>senity/utils/getSiteProfile.py import json import os # get site profile def getSiteProfile(site_file): with open(site_file) as json_file: json_data = json.load(json_file) return json_data # get all site profile def getAllSiteProfiles(site_folder): allSiteProfiles = {} allSiteFile...
2.796875
3
ppo_new/baseline.py
QingXinHu123/Lane_change_RL
1
3828
<gh_stars>1-10 import os, sys from env.LaneChangeEnv import LaneChangeEnv import random import numpy as np if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], 'tools') sys.path.append(tools) print('success') else: sys.exit("please declare environment variable 'SUMO_HOME'") import...
2.046875
2
clean_data.py
toogy/pendigits-hmm
0
3829
import numpy as np import pickle from collections import defaultdict from parsing import parser from analysis import training def main(): parse = parser.Parser(); train_digits = parse.parse_file('data/pendigits-train'); test_digits = parse.parse_file('data/pendigits-test') centroids = training.get_d...
2.765625
3
scripts/commit_validation/commit_validation/commit_validation.py
cypherdotXd/o3de
8
3830
# # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # import abc import importlib import os import pkgutil import re import time from typing import Dict, List, ...
2.640625
3
matrixprofile/algorithms/snippets.py
KSaiRahul21/matrixprofile
0
3831
<filename>matrixprofile/algorithms/snippets.py #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals range = getattr(__builtins__, 'xrange', range) # end of py2 compatability boi...
2.9375
3
jina/logging/formatter.py
yk/jina
1
3832
import json import re from copy import copy from logging import Formatter from .profile import used_memory from ..helper import colored class ColorFormatter(Formatter): """Format the log into colored logs based on the log-level. """ MAPPING = { 'DEBUG': dict(color='white', on_color=None), # white ...
2.40625
2
atcoder/abc191/b.py
sugitanishi/competitive-programming
0
3833
import sys sys.setrecursionlimit(10000000) input=lambda : sys.stdin.readline().rstrip() n,x=map(int,input().split()) a=list(map(int,input().split())) aa=list(filter(lambda b:b!=x,a)) print(*aa)
2.546875
3
tests/integration/test_streaming_e2e.py
cfogg/python-client
0
3834
<gh_stars>0 """Streaming integration tests.""" # pylint:disable=no-self-use,invalid-name,too-many-arguments,too-few-public-methods,line-too-long # pylint:disable=too-many-statements,too-many-locals,too-many-lines import threading import time import json from queue import Queue from splitio.client.factory import get_fac...
2.1875
2
venues/abstract_venue.py
weezel/BandEventNotifier
0
3835
import re from abc import ABC, abstractmethod from typing import Any, Dict, Generator class IncorrectVenueImplementation(Exception): pass # class AbstractVenue(metaclass=ABC): class AbstractVenue(ABC): def __init__(self): self.url = "" self.name = "" self.city = "" self.count...
3.15625
3
mtl/util/pipeline.py
vandurme/TFMTL
10
3836
# Copyright 2018 Johns Hopkins University. 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...
2.1875
2
src/py65/devices/mpu65c02.py
dabeaz/py65
5
3837
from py65.devices import mpu6502 from py65.utils.devices import make_instruction_decorator class MPU(mpu6502.MPU): def __init__(self, *args, **kwargs): mpu6502.MPU.__init__(self, *args, **kwargs) self.name = '65C02' self.waiting = False def step(self): if self.waiting: ...
2.609375
3
tests/test__io.py
soerendip/ms-mint
1
3838
import pandas as pd import shutil import os import io from ms_mint.Mint import Mint from pathlib import Path as P from ms_mint.io import ( ms_file_to_df, mzml_to_pandas_df_pyteomics, convert_ms_file_to_feather, convert_ms_file_to_parquet, MZMLB_AVAILABLE, ) from paths import ( TEST_MZML, ...
2.390625
2
core/views.py
moiyad/image
0
3839
<filename>core/views.py from django.core.files.storage import FileSystemStorage from django.shortcuts import render, redirect from core.forms import DocumentForm from core.models import Document from media import image_cv2 def home(request): documents = Document.objects.all() number = len(image_cv2.myList) ...
2.21875
2
python/verifair/benchmarks/fairsquare/M_BN_F_SVM_A_Q.py
obastani/verifair
5
3840
<reponame>obastani/verifair from .helper import * def sample(flag): sex = step([(0,1,0.3307), (1,2,0.6693)]) if sex < 1: capital_gain = gaussian(568.4105, 24248365.5428) if capital_gain < 7298.0000: age = gaussian(38.4208, 184.9151) capital_loss = gaussian(86.5949, 15773...
2.28125
2
ml4chem/atomistic/models/neuralnetwork.py
muammar/mlchem
77
3841
<filename>ml4chem/atomistic/models/neuralnetwork.py import dask import datetime import logging import time import torch import numpy as np import pandas as pd from collections import OrderedDict from ml4chem.metrics import compute_rmse from ml4chem.atomistic.models.base import DeepLearningModel, DeepLearningTrainer fr...
2.328125
2
hatsploit/core/db/db.py
EntySec/HatSploit
139
3842
#!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2022 EntySec # # 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...
2.03125
2
bluesky/tests/test_simulators.py
NSLS-II/bluesky
43
3843
from bluesky.plans import scan from bluesky.simulators import (print_summary, print_summary_wrapper, summarize_plan, check_limits, plot_raster_path) import pytest from bluesky.plans import grid_scan def test_print_summary(...
2.109375
2
shutTheBox/main.py
robi1467/shut-the-box
0
3844
<filename>shutTheBox/main.py import random numbers_list = [1,2,3,4,5,6,7,8,9,10] game_won = False game_completed = False #Stats games_played = 0 games_won = 0 games_lost = 0 average_score = 0 total_score = 0 def welcome(): welcome_message = "Welcome to shut the box" print(welcome_message) i = 0 result ...
4.125
4
repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_selinux.py
sm00th/leapp-repository
21
3845
import warnings import pytest from leapp.libraries.actor.systemfacts import get_selinux_status from leapp.models import SELinuxFacts no_selinux = False try: import selinux except ImportError: no_selinux = True warnings.warn( 'Tests which uses `selinux` will be skipped' ' due to library un...
2.375
2
Phase-1/Python Basic 2/Day-24.py
emetowinner/python-challenges
3
3846
<gh_stars>1-10 """ 1. Write a Python program to reverse only the vowels of a given string. Sample Output: w3resuorce Python Perl ASU 2. Write a Python program to check whether a given integer is a palindrome or not. Note: An integer is a palindrome when it reads the same backward as forward. Negative numbers are not ...
4.1875
4
etl/parsers/etw/Microsoft_Windows_IPxlatCfg.py
IMULMUL/etl-parser
104
3847
# -*- coding: utf-8 -*- """ Microsoft-Windows-IPxlatCfg GUID : 3e5ac668-af52-4c15-b99b-a3e7a6616ebd """ from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct from etl.utils import WString, CString, SystemTime, Guid from etl.dtyp import Sid from etl.p...
1.765625
2
microservices/users/config.py
Levakin/sanic-test-app
0
3848
<reponame>Levakin/sanic-test-app # -*- coding: utf-8 -*- import os from distutils.util import strtobool class Config: DEBUG = bool(strtobool(os.getenv('DEBUG', "False"))) DATABASE_URI = os.getenv('DATABASE_URI', '127.0.0.1:27017') WORKERS = int(os.getenv('WORKERS', 2)) LOGO = os.getenv('LOGO', None) ...
1.929688
2
semantic-python/test/fixtures/4-01-lambda-literals.py
Temurson/semantic
8,844
3849
<reponame>Temurson/semantic<gh_stars>1000+ # CHECK-TREE: { const <- \x -> \y -> x; y <- const #true #true; z <- const #false #false; #record { const: const, y : y, z: z, }} const = lambda x, y: x y = const(True, True) z = const(False, False)
1.117188
1
main.py
mithi/semantic-segmentation
33
3850
<filename>main.py import tensorflow as tf import os.path import warnings from distutils.version import LooseVersion import glob import helper import project_tests as tests #-------------------------- # USER-SPECIFIED DATA #-------------------------- # Tune these parameters NUMBER_OF_CLASSES = 2 IMAGE_SHAPE = (160, ...
2.609375
3
tests/scanner/audit/log_sink_rules_engine_test.py
BrunoReboul/forseti-security
0
3851
<gh_stars>0 # Copyright 2018 The Forseti Security 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 re...
1.820313
2
backend/api/ulca-ums-service/user-management/utilities/orgUtils.py
agupta54/ulca
3
3852
import uuid from config import USR_ORG_MONGO_COLLECTION, USR_MONGO_COLLECTION import db from models.response import post_error import logging log = logging.getLogger('file') class OrgUtils: def __init__(self): pass #orgId generation @staticmethod def generate_org_id(): """UUID gener...
2.515625
3
setup.py
AntonBiryukovUofC/diffvg
0
3853
<reponame>AntonBiryukovUofC/diffvg # Adapted from https://github.com/pybind/cmake_example/blob/master/setup.py import os import re import sys import platform import subprocess import importlib from sysconfig import get_paths import importlib from setuptools import setup, Extension from setuptools.command.build_ext imp...
1.851563
2
robotpy_ext/common_drivers/navx/registerio.py
twinters007/robotpy-wpilib-utilities
2
3854
# validated: 2017-02-19 DS c5e3a8a9b642 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO.java #---------------------------------------------------------------------------- # Copyright (c) <NAME> 2015. All Rights Reserved. # # Created in support of Team 2465 (Kauaibots). Go Purple Wave! # # Open Source Softw...
1.695313
2
RigolWFM/channel.py
wvdv2002/RigolWFM
0
3855
#pylint: disable=invalid-name #pylint: disable=too-many-instance-attributes #pylint: disable=too-many-return-statements #pylint: disable=too-many-statements """ Class structure and methods for an oscilloscope channel. The idea is to collect all the relevant information from all the Rigol scope waveforms into a single ...
2.953125
3
configs/raubtierv2a/faster_rcnn_x101_64x4d_fpn_1x_raubtierv2a_nofreeze_4gpu.py
esf-bt2020/mmdetection
0
3856
_base_ = '../faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py' model = dict( backbone=dict( num_stages=4, #frozen_stages=4 ), roi_head=dict( bbox_head=dict( num_classes=3 ) ) ) dataset_type = 'COCODataset' classes = ('luchs', 'rotfuchs', 'wolf') data = dict...
1.757813
2
driver/python/setup.py
wbaweto/QConf
2,056
3857
<filename>driver/python/setup.py from distutils.core import setup, Extension setup(name = 'qconf_py', version = '1.2.2', ext_modules = [Extension('qconf_py', ['lib/python_qconf.cc'], include_dirs=['/usr/local/include/qconf'], extra_objects=['/usr/local/qconf/lib/libqconf.a'] )])
1.3125
1
abc153/d.py
Lockdef/kyopro-code
0
3858
h = int(input()) i = 1 a = 1 b = 1 c = 1 while h >= a: a = 2 ** i i += 1 s = 0 t = True for j in range(1, i-1): c += 2 ** j print(c)
3.4375
3
demos/python/sdk_wireless_camera_control/open_gopro/demos/log_battery.py
Natureshadow/OpenGoPro
210
3859
<filename>demos/python/sdk_wireless_camera_control/open_gopro/demos/log_battery.py<gh_stars>100-1000 # log_battery.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). # This copyright was auto-generated on Wed, Sep 1, 2021 5:05:45 PM """Example to continuously read the battery (wi...
2.703125
3
tumbleweed/models.py
mcroydon/django-tumbleweed
1
3860
<reponame>mcroydon/django-tumbleweed<filename>tumbleweed/models.py # These are not the droids you are looking for.
1.164063
1
xos/hpc_observer/steps/sync_originserver.py
wathsalav/xos
0
3861
import os import sys import base64 from django.db.models import F, Q from xos.config import Config from observer.syncstep import SyncStep from core.models import Service from hpc.models import ServiceProvider, ContentProvider, CDNPrefix, OriginServer from util.logger import Logger, logging # hpclibrary will be in ste...
1.929688
2
main.py
aroxby/pixel-processor
0
3862
#!/usr/bin/env python3 from PIL import Image def tranform(r, g, b): tmp = b b = g // 2 g = tmp r = r // 2 return r, g, b def main(): im = Image.open('blue-flames.jpg') input_pixels = im.getdata() output_pixels = tuple(tranform(*pixel) for pixel in input_pixels) im.putdata(output_...
3.4375
3
scipy/weave/examples/swig2_example.py
lesserwhirls/scipy-cwt
8
3863
<reponame>lesserwhirls/scipy-cwt<filename>scipy/weave/examples/swig2_example.py """Simple example to show how to use weave.inline on SWIG2 wrapped objects. SWIG2 refers to SWIG versions >= 1.3. To run this example you must build the trivial SWIG2 extension called swig2_ext. To do this you need to do something like t...
2.34375
2
src/simplify.py
denghz/Probabilistic-Programming
0
3864
<filename>src/simplify.py from wolframclient.language.expression import WLSymbol from nnDiff import * def parseGlobalSymbol(s): if isinstance(s, numbers.Number): return s if isinstance(s, WLSymbol): if s.name == 'E': return 'E' else: return s.name[7:] de...
3.015625
3
setup.py
EdWard680/python-firetv
0
3865
from setuptools import setup setup( name='firetv', version='1.0.7', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='<EMAIL>', packages=['firetv'], ...
1.523438
2
neo/io/exampleio.py
Mario-Kart-Felix/python-neo
199
3866
<gh_stars>100-1000 """ neo.io have been split in 2 level API: * neo.io: this API give neo object * neo.rawio: this API give raw data as they are in files. Developper are encourage to use neo.rawio. When this is done the neo.io is done automagically with this king of following code. Author: sgarcia """ from neo...
2.546875
3
scrapyproject/migrations/0003_auto_20170209_1025.py
sap9433/Distributed-Multi-User-Scrapy-System-with-a-Web-UI
108
3867
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scrapyproject', '0002_auto_20170208_1738'), ] operations = [ migrations.AlterField( model_name='project', ...
1.460938
1
src/cart/forms.py
cbsBiram/xarala__ssr
0
3868
from django import forms from django.utils.translation import gettext_lazy as _ COURSE_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 21)] class CartAddCourseForm(forms.Form): quantity = forms.TypedChoiceField( choices=COURSE_QUANTITY_CHOICES, coerce=int, label=_("Quantité") ) override = form...
2.375
2
patches/datasets/__init__.py
sflippl/patches
0
3869
<reponame>sflippl/patches<gh_stars>0 """Datasets of latent predictability tasks. """ from .pilgrimm import *
0.972656
1
appengine/components/tests/datastore_utils_properties_test.py
pombreda/swarming
0
3870
<filename>appengine/components/tests/datastore_utils_properties_test.py #!/usr/bin/env python # Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. import sys import unittest import test_env test_env.setup_...
2.1875
2
neutron/tests/unit/services/qos/test_qos_plugin.py
dangervon/neutron
0
3871
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
1.140625
1
covfefe/covfefe.py
fixator10/Trusty-cogs
148
3872
import re import discord from redbot.core import commands class Covfefe(commands.Cog): """ Convert almost any word into covfefe """ def __init__(self, bot): self.bot = bot async def covfefe(self, x, k="aeiouy])"): """ https://codegolf.stackexchange.com/a/123697 "...
2.890625
3
src/api/bkuser_core/audit/views.py
trueware/bk-user
0
3873
<reponame>trueware/bk-user # -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except...
1.507813
2
exp_gqa/test.py
ronghanghu/gqa_single_hop_baseline
19
3874
import os import numpy as np import tensorflow as tf from models_gqa.model import Model from models_gqa.config import build_cfg_from_argparse from util.gqa_train.data_reader import DataReader import json # Load config cfg = build_cfg_from_argparse() # Start session os.environ["CUDA_VISIBLE_DEVICES"] = str(cfg.GPU_ID...
1.953125
2
extract_gear/armor_visitor.py
kamerons/dde-extract-gear
0
3875
<filename>extract_gear/armor_visitor.py class ArmorVisitor: def __init__(self, num_pages, first_page_col_start, first_page_row_start, last_page_row_start, last_page_col_end, last_page_row_end, num_col_page=5, num_row_page=3): self.num_pages = num_pages self.first_page_col_start = first_page_col_start ...
2.84375
3
gamla/url_utils_test.py
hyroai/gamla
17
3876
<filename>gamla/url_utils_test.py from gamla import url_utils def test_add_to_query_string1(): assert ( url_utils.add_to_query_string( {"a": 123}, "https://www.domain.com/path?param1=param1#anchor", ) == "https://www.domain.com/path?param1=param1&a=123#anchor" )...
2.859375
3
examples/temp_feie_shetland.py
nilsmkMET/roppy
0
3877
import numpy as np from netCDF4 import Dataset # Import development version of roppy import sys sys.path = ['..'] + sys.path import roppy # --- EDIT ----------------- # ROMS file romsfile = 'data/ocean_avg_example.nc' # Section definition lon0, lat0 = -0.67, 60.75 # Shetland lon1, lat1 = 4.72, 60.75 # Feie # --...
2.671875
3
examples/test_scalar_field.py
gemini3d/pv-gemini
0
3878
#!/usr/bin/env python3 """ example of 3D scalar field If you get this error, ParaView doesn't know your data file format: TypeError: TestFileReadability argument %Id: %V """ from pathlib import Path import argparse import paraview.simple as pvs p = argparse.ArgumentParser() p.add_argument("fn", help="data file to l...
2.6875
3
src/cms/forms/languages/language_form.py
S10MC2015/cms-django
0
3879
<filename>src/cms/forms/languages/language_form.py from django import forms from ...models import Language class LanguageForm(forms.ModelForm): """ Form for creating and modifying language objects """ class Meta: model = Language fields = [ "code", "english_na...
2.109375
2
search/forms.py
gregneagle/sal
2
3880
from django import forms from .models import * from server.models import * class ChoiceFieldNoValidation(forms.ChoiceField): def validate(self, value): pass class SaveSearchForm(forms.ModelForm): class Meta: model = SavedSearch fields = ('name',) class SearchRowForm(forms.ModelForm):...
2.3125
2
newsparser.py
antoreep-jana/BBC-News-Analyzer
1
3881
<reponame>antoreep-jana/BBC-News-Analyzer from bs4 import BeautifulSoup as bs import requests class BBC: def __init__(self, url:str): article = requests.get(url) self.soup = bs(article.content, "html.parser") #print(dir(self.soup)) #print(self.soup.h1.text) self.body = self...
3.03125
3
SIR_model-Copy.Caroline.1.py
Caroline-Odevall/final-project-team-18
0
3882
# In[42]: from scipy.integrate import odeint import numpy as np import matplotlib.pyplot as plt # In[43]: # describe the model def deriv(y, t, N, beta, gamma, delta): S, E, I, R = y dSdt = -beta * S * I / N # S(t) – susceptible (de som är mottagliga för infektion). dEdt = beta * S * I / N - gamma * ...
2.84375
3
Condicionales anidados.py
gcardosov/PythonAprendeOrg
1
3883
pregunta = input('trabajas desde casa? ') if pregunta == True: print 'Eres afortunado' if pregunta == False: print 'Trabajas fuera de casa' tiempo = input('Cuantos minutos haces al trabajo: ') if tiempo == 0: print 'trabajas desde casa' elif tiempo <=20: print 'Es po...
3.921875
4
app/middleware/cache_headers.py
Niclnx/service-stac
9
3884
<gh_stars>1-10 import logging import re from urllib.parse import urlparse from django.conf import settings from django.utils.cache import add_never_cache_headers from django.utils.cache import patch_cache_control from django.utils.cache import patch_response_headers logger = logging.getLogger(__name__) STAC_BASE = s...
2.1875
2
mmdet/models/detectors/knowledge_distilling/kd_single_stage.py
anorthman/mmdetection
5
3885
<filename>mmdet/models/detectors/knowledge_distilling/kd_single_stage.py # author huangchuanhong import torch from mmcv.runner import load_checkpoint from ..base import BaseDetector from ..single_stage import SingleStageDetector from ...registry import DETECTORS from ...builder import build_detector @DETECTORS.regist...
1.75
2
metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_dial_turn_v2.py
yiwc/robotics-world
681
3886
<gh_stars>100-1000 import numpy as np from gym.spaces import Box from metaworld.envs import reward_utils from metaworld.envs.asset_path_utils import full_v2_path_for from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set class SawyerDialTurnEnvV2(SawyerXYZEnv): TARGET_RADIU...
1.96875
2
yezdi/parser/parser.py
ragsagar/yezdi
1
3887
from yezdi.lexer.token import TokenType from yezdi.parser.ast import Program, Statement, Participant, Title, LineStatement class Parser: def __init__(self, lexer): self.lexer = lexer self.current_token = None self.peek_token = None self.next_token() self.next_token() ...
2.515625
3
scripts/check_categories.py
oberron/entolusis
0
3888
# list categories in category folder from os import walk from os.path import abspath,join, pardir categories_folder = abspath(join(__file__,pardir,pardir,"category")) post_folder = abspath(join(__file__,pardir,pardir,"_posts")) site_categories = [] for root,directories,files in walk(categories_folder): for f in ...
2.96875
3
docsrc/makedoc.py
syoyo/soloud
1
3889
<reponame>syoyo/soloud<filename>docsrc/makedoc.py #!/usr/bin/env python3 """ builds documentation files from multimarkdown (mmd) source to various formats, including the web site and pdf. """ import subprocess import glob import os import sys import time import shutil src = [ "intro.mmd", "downloads.mmd"...
1.976563
2
arch/api/base/utils/party.py
yzjba/FATE
32
3890
<filename>arch/api/base/utils/party.py # # Copyright 2019 The FATE 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/LI...
2.21875
2
src/sentry/options/defaults.py
faulkner/sentry
0
3891
""" sentry.options.defaults ~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function from sentry.logging import LoggingFormat from sentry.options import ( FLAG_IMMUTAB...
1.59375
2
tools/unidatadownload.py
henryiii/backrefs
0
3892
"""Download `Unicodedata` files.""" from __future__ import unicode_literals import os import zipfile import codecs from urllib.request import urlopen __version__ = '2.2.0' HOME = os.path.dirname(os.path.abspath(__file__)) def zip_unicode(output, version): """Zip the Unicode files.""" zipper = zipfile.ZipFi...
3.375
3
generator/cache/cache.py
biarmic/OpenCache
5
3893
# See LICENSE for licensing information. # # Copyright (c) 2021 Regents of the University of California and The Board # of Regents for the Oklahoma Agricultural and Mechanical College # (acting for and on behalf of Oklahoma State University) # All rights reserved. # import debug import datetime from policy import assoc...
2.265625
2
utils/data_loader.py
elieser1101/loglizer
0
3894
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = '<NAME>' import pandas as pd import os import numpy as np def hdfs_data_loader(para): """ load the log sequence matrix and labels from the file path. Args: -------- para: the parameters dictionary Returns: -------- raw_data: log sequenc...
2.921875
3
aspx2url/aspx2url.py
marcocucinato/aspx2url
0
3895
<reponame>marcocucinato/aspx2url<filename>aspx2url/aspx2url.py from __future__ import print_function import re, sys, glob, getopt, os def usage(): print('aspx2url v1.0') print('Usage:') print(sys.argv[0]+' -d -h filename(s)') print('-d : Delete original file') print('-h : This help') def main(): ...
2.859375
3
pytype/tests/py2/test_stdlib.py
souravbadami/pytype
1
3896
<reponame>souravbadami/pytype """Tests of selected stdlib functions.""" from pytype.tests import test_base class StdlibTests(test_base.TargetPython27FeatureTest): """Tests for files in typeshed/stdlib.""" def testPosix(self): ty = self.Infer(""" import posix x = posix.urandom(10) """) se...
2.421875
2
smmips/__init__.py
oicr-gsi/pysmmips
0
3897
<reponame>oicr-gsi/pysmmips # -*- coding: utf-8 -*- """ Created on Tue Oct 20 16:04:52 2020 @author: rjovelin """
0.90625
1
tarentsocialwall/MongoDBClient.py
tarent/socialwall-backend
0
3898
<filename>tarentsocialwall/MongoDBClient.py import random from datetime import datetime from passlib.handlers.sha2_crypt import sha256_crypt from pymongo import MongoClient from pymongo.errors import ConnectionFailure from tarentsocialwall.SocialPost import SocialPost from tarentsocialwall.User import User from taren...
2.5
2
src/mount_efs/__init__.py
Sodki/efs-utils
0
3899
#!/usr/bin/env python # # Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. # # Licensed under the MIT License. See the LICENSE accompanying this file # for the specific language governing permissions and limitations under # the License. # # # Copy this script to /sbin/mount.efs and make sur...
2.015625
2