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
openfda/deploy/tests/adae/test_endpoint.py
hobochili/openfda
388
29300
<filename>openfda/deploy/tests/adae/test_endpoint.py # coding=utf-8 import inspect import sys from openfda.tests.api_test_helpers import * def test_nullified_records(): NULLIFIED = ['USA-FDACVM-2018-US-045311', 'USA-FDACVM-2018-US-048571', 'USA-FDACVM-2018-US-046672', 'USA-FDACVM-2017-US-070108', 'U...
2.109375
2
dutil.py
Zverik/podcast_duration
1
29301
import requests import re import json import datetime import os DATE_FORMAT = '%Y-%m-%d' DATA_PATH = 'rupodcast_lengths.json' def extract_hms(g): return float(g[0] or 0) * 60 + float(g[1]) + float(g[2]) / 60 def extract_rss(dur): g = dur.split(':') while len(g) < 3: g = [0] + g return floa...
2.90625
3
apps/rates/urls.py
ExpoAshique/ProveBanking__s
0
29302
from django.conf.urls import patterns, include, url from . import views urlpatterns = [ url(r'^$', views.rate_list, name='list'), url(r'^(?P<pk>\d+)/$', views.rate_as_field, name='as_field'), url(r'^suggestions/$', views.suggestions, name='suggestions'), url(r'^create/$', views.create_rate, name='creat...
2.015625
2
icasf/utils.py
human-ai2025/Intent_detection_slot_filling
0
29303
# importing libraries import numpy as np import pandas as pd import random import torch def set_seeds(seed=1234): """[Set seeds for reproducibility.] Keyword Arguments: seed {int} -- [The seed value] (default: {1234}) """ np.random.seed(seed) random.seed(seed) torch.manual_seed(seed) ...
2.71875
3
back/treatments/apps.py
EDario333/idia
0
29304
<gh_stars>0 from django.apps import AppConfig class TreatmentsConfig(AppConfig): name = 'treatments'
1.0625
1
Numbers/alarm.py
arindampradhan/Projects
10
29305
""" Alarm Clock - A simple clock where it plays a sound after X number of minutes/seconds or at a particular time. Dependencies: pyglet pip install pyglet """ import time import winsound import pyglet def play(hh, mm): not_alarmed = 1 while(not_alarmed): cur_time = list(time.loc...
4.1875
4
tests/test_in_serializers.py
expobrain/drf-compound-fields
0
29306
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_in_serializers ------------------- Tests of the fields cooperation in the serializer interfaces for serialization, de-serialization, and validation. """ # Django settings: import os os.environ['DJANGO_SETTINGS_MODULE'] = __name__ from django.conf.global_sett...
2.375
2
reframe/utility/json.py
stevenvdb/reframe
0
29307
<reponame>stevenvdb/reframe # Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import json class _ReframeJsonEncoder(json.JSONEncoder): def default(self, obj): if ...
2.03125
2
occo/enactor/upkeep.py
occopus/enactor
0
29308
### Copyright 2014, MTA SZTAKI, www.sztaki.hu ### ### 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 applicab...
1.859375
2
Chapter08/chapter8_sflowtool_1.py
stavsta/Mastering-Python-Networking-Second-Edition
107
29309
#!/usr/bin/env python3 import sys, re for line in iter(sys.stdin.readline, ''): if re.search('agent ', line): print(line.strip())
3.109375
3
examples/fuzz.py
defparam/haptyc
74
29310
from haptyc import * from base64 import b64encode, b64decode import json class TestLogic(Transform): # # test_h1: Decodes base64, fuzzes using random_insert, Re-encodes base64 # Number of tests: 50 # @ApplyIteration(50) def test_h1(self, data, state): data = b64decode(data) ...
2.328125
2
nginx-with-mtls-and-appserver/appserver/app.py
fshmcallister/examples
6
29311
<gh_stars>1-10 import re from flask import Flask, request app = Flask(__name__) def generate_whitelist(): whitelist = [] with open('/whitelist.txt', 'r') as f: for line in f.readlines(): if line.strip().endswith('d.wott.local'): whitelist.append(line.strip()) return wh...
3.15625
3
Database/flask-sqlalchemy/one_to_many.py
amamov/cs001
5
29312
from flask import Flask from flask_sqlalchemy import SQLAlchemy from pathlib import Path app = Flask(__name__) BASE_DIR = Path(__file__).resolve().parent DB_PATH = str(BASE_DIR / "one_to_many.sqlite") app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + DB_PATH app.config["SQLALCHEMY_COMMIT_ON_SUBMIT"] = True app...
2.875
3
hcap_utils/contrib/material/views/__init__.py
fabiommendes/capacidade_hospitalar
0
29313
<reponame>fabiommendes/capacidade_hospitalar from .create_model_view import CreateModelView from .delete_model_view import DeleteModelView from .detail_model_view import DetailModelView from .list_model_view import ListModelView from .update_model_view import UpdateModelView
1.03125
1
src/emr/scripts/util.py
anorth848/aws-data-analytics
1
29314
<reponame>anorth848/aws-data-analytics import boto3 import logging import json def get_secret(secret): client = boto3.client('secretsmanager') logging.info(f'Retrieving secret {secret}') response = client.get_secret_value(SecretId=secret) logging.debug(f'Retrieved Secret ARN {response["ARN"]} VersionI...
2.3125
2
boids/boids.py
PaulAustin/sb7-pgz
1
29315
<filename>boids/boids.py # Ported from JavaSript version to Python and Pygame Zero # Designed to work well with mu-editor environment. # # Original by <NAME> at https://github.com/beneater/boids (MIT License) # No endorsement implied. import random HEIGHT = 600 # window height WIDTH = 700 ...
2.796875
3
notebook/03-udacityIntroductionToMachineLearning/projects/datasets_questions/utils/read_names.py
EmanuelFontelles/machineLearning
2
29316
import pandas as pd import sys from os import system sys.path.append('../final_project/') sys.path.append('../') def readNames(inputFile='new_poi_names.txt'): ''' A function to read names data from a file create by a data cache Returns: Returns a data frame that contains data from 'poi_names.txt' ...
3.296875
3
launch/test/legacy/launch_counter.py
stonier/launch
0
29317
# Copyright 2015 Open Source Robotics Foundation, 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 # # Unless required by applicable law...
2.109375
2
exporter/config.py
TaIos/code_generator
2
29318
<reponame>TaIos/code_generator import pathlib class ExporterConfig: def __init__(self, github_token, gitlab_token): self.github_token = github_token self.gitlab_token = gitlab_token class ConfigLoader: @classmethod def load(cls, cfg): """ Load and validate application c...
2.40625
2
mars/learn/tests/test_wrappers.py
wjsi/mars
1
29319
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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 a...
2.328125
2
setup.py
mayankgiri619/Speech-Recognizer-cum-Voice-Typing-Editor
3
29320
import cx_Freeze import sys base = None if sys.platform == 'win32': base = "Win32GUI" executables = [cx_Freeze.Executable("Speech_Recognizer.py", base=base, icon = "icon.ico")] cx_Freeze.setup( name = "Speech Recognizer", author = "<NAME>", options = {"build_exe":{"packages":["tkinter",...
2.515625
3
checkers/checker_optimization_knapsack.py
aosokin/assignment_checker_email
4
29321
<filename>checkers/checker_optimization_knapsack.py import sys import numpy as np import os import math import chardet import io COMPARISON_ACCURACY = 1e-2 MAX_SCORE = 1.0 HALF_SCORE = 0.5 SUBMISSION_SCORE = 0.0 MESSAGES_SCORE = {} MESSAGES_SCORE[SUBMISSION_SCORE] = lambda value, value_to_get : \ ...
2.921875
3
src/485-max-consecutive-ones.py
sahilrider/LeetCode-Solutions
2
29322
<gh_stars>1-10 '''https://leetcode.com/problems/max-consecutive-ones/''' class Solution: def findMaxConsecutiveOnes(self, nums: List[int]) -> int: i, j = 0, 0 ans = 0 while j<len(nums): if nums[j]==0: ans = max(ans, j-i) i = j+1 j+=1 ...
3.015625
3
setup.py
milnus/Phupa
1
29323
#!/usr/bin/env python from setuptools import setup LONG_DESCRIPTION = \ '''The program extracts regions of interest from Fasta or Genome Feature Format (GFF) genomes. This is done given a set of seed sequences given as nucleotide strings in a multi-line fasta file. The program can output fasta and GFF outputs or re...
1.867188
2
tests/__init__.py
EmmanuelObo/python-coord
0
29324
from tests import test_bike from tests import test_curb
0.960938
1
tranquil/solve.py
skyeto/actf2021
0
29325
<gh_stars>0 from pwn import * from pwnlib.elf import * ## Get the offset ## Should be @ ► 0x401260 <vuln+92> ret <0x6161617461616173> ## cyclic -c amd64 -l 0x61616174 ## 72 #payload = cyclic(100) #p = process('./tranquil') #gdb.attach(p, gdbscript=""" #continue #""") #print(p.readline()) #p.sendline(payload) #p...
1.765625
2
Matrix/Leetcode 909. Snakes and Ladders.py
kaizhengny/LeetCode
31
29326
<reponame>kaizhengny/LeetCode<filename>Matrix/Leetcode 909. Snakes and Ladders.py class Solution: def snakesAndLadders(self, board: List[List[int]]) -> int: n = len(board) q = collections.deque() q.append(1) visited = set() visited.add(1) step = 0 while q: ...
3.53125
4
model.py
Vishal2188/TherISuRNet---A-Computationally-Efficient-Thermal-Image-Super-Resolution-Network
12
29327
import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim class Generator: def __init__(self, learning_rate=1e-4, num_blocks=6): self.learning_rate = learning_rate self.num_blocks = num_blocks def pelu(self, x): with tf.variable_scope(x.op.name + '_activation', initializer=tf.c...
2.8125
3
authordetect/tokenizers/nltk.py
fabianfallasmoya/authorship_classification
2
29328
import nltk from .base import BaseTokenizer from typing import ( Tuple, Iterator, ) __all__ = ['NLTKTokenizer'] class NLTKTokenizer(BaseTokenizer): """NLTK-based Treebank tokenizer. Args: sentencizer (str): Name of sentencizer for text. chunker (str): Phrase chunker where 'noun' us...
2.828125
3
vcs/editors/marker.py
scottwittenburg/vcs
11
29329
from vcs import vtk_ui from vcs.colorpicker import ColorPicker from vcs.vtk_ui import behaviors from vcs.VCS_validation_functions import checkMarker import vtk import vcs.vcs2vtk from . import priority import sys class MarkerEditor( behaviors.ClickableMixin, behaviors.DraggableMixin, priority.PriorityEditor):...
2.28125
2
tinkoff/invest/_errors.py
forked-group/invest-python
41
29330
from functools import wraps from typing import Any, Callable, TypeVar, cast from grpc import Call, RpcError from grpc.aio import AioRpcError from .exceptions import AioRequestError, RequestError from .logging import get_metadata_from_aio_error, get_metadata_from_call, log_error TFunc = TypeVar("TFunc", bound=Callabl...
2.15625
2
src/controllerarena/controllers/refVec.py
VerifiableRobotics/controller-arena
0
29331
# code for python reference dipole vector field controller # these functions require stuff #from mathFuns import * from numpy import * from math import * class refVec: # define the constructor def __init__(self, q_0, controller_flag): # Initialize controller state self.phi_prev = None sel...
3.1875
3
script/trainer/trainer.py
Intelligent-Systems-Lab/ISL-BCFL
0
29332
import torch import torch.nn as nn from torchvision import transforms from torch.utils.data import DataLoader, TensorDataset, Dataset from torch.utils.data.sampler import SubsetRandomSampler from torch import optim import pandas as pd import sys sys.path.append('./proto') import trainer_pb2 import trainer_pb2_grpc impo...
2.34375
2
polls/views.py
alejandro-medici/django_docker
1
29333
from django.shortcuts import render from django.http import HttpResponse from django.template.loader import get_template from .models import Poll from time import timezone from datetime import date # Create your views here. def index(request): myTemplate = get_template('./index.html') print(myTemplate) r...
2.390625
2
train.py
lyth031/ptb_lm
0
29334
<filename>train.py<gh_stars>0 # -*- coding: utf-8 -*- import tensorflow as tf import time import input as ip import lm import config as cf import numpy as np def run_epoch(session, model, eval_op=None, verbose=False): start_time = time.time() costs = 0.0 iters = 0 state = session.run(model.initial_sta...
2.140625
2
PICdecompression.py
lukestaniscia/PIC
2
29335
<reponame>lukestaniscia/PIC # PIC Decompressor # By: <NAME> #import used libraries/packages import math from PIL import Image, ImageOps, ImageEnhance import time def key0(x): return x[0] def key1(x): return (x[0]*maxBits + x[1])*1800 + int(x[2][2:],2) def sph2Cart(cord, precision = 3): az = cord[0] elev = cord[...
2.84375
3
FlyBIDS/utils.py
PennLINC/FlyBIDS
0
29336
<filename>FlyBIDS/utils.py import re def get_nested(dct, *keys): for key in keys: try: dct = dct[key] except (KeyError, TypeError): return None return dct def extract(string, pattern): found = re.search(pattern, string) if found: return found.group(0) ...
2.859375
3
bayes_optim/acquisition_optim/one_plus_one_cma_es.py
zdanial/Bayesian-Optimization
0
29337
<gh_stars>0 import logging from copy import copy from typing import Callable, Dict, List, Union import numpy as np from scipy.linalg import solve_triangular from ..search_space import RealSpace, SearchSpace from ..utils import dynamic_penalty, get_logger, handle_box_constraint, set_bounds Vector = List[float] Matrix...
2.171875
2
app/models.py
emmapraise/tweekners
1
29338
<gh_stars>1-10 from . import db class User(db.Model): """ Data Model for User Account""" __tablename__ = 'Users'
1.929688
2
tests/tests/test_provides_depends.py
NilsOlavKJohansen/integration
0
29339
#!/usr/bin/python # Copyright 2021 Northern.tech AS # # 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 ap...
1.882813
2
tests/_support/docstrings.py
techtonik/invoke
0
29340
from invoke import task @task def no_docstring(): pass @task def one_line(): """foo """ @task def two_lines(): """foo bar """ @task def leading_whitespace(): """ foo """ @task(aliases=('a', 'b')) def with_aliases(): """foo """
2.109375
2
love_release/utils.py
toxinu/pylove-release
1
29341
from subprocess import PIPE from subprocess import Popen def run(command): assert (isinstance(command, list)), "Command must be a list" p = Popen(command, stdout=PIPE, stderr=PIPE) s, e = p.communicate() return s.decode('utf-8'), e.decode('utf-8'), p.returncode
2.765625
3
gender_converter/model/loss.py
roebel/DeepGC
0
29342
import tensorflow as tf from tensorflow.keras.layers import Layer from debugprint import print_debug from .utils import get_mask_from_lengths class ParrotLoss(): def __init__(self, hparams): super(ParrotLoss, self).__init__() self.hidden_dim = hparams.encoder_embedding_dim self.mel_hidden_...
2.328125
2
pkgs/nbconvert-4.1.0-py27_0/lib/python2.7/site-packages/nbconvert/filters/markdown.py
wangyum/anaconda
652
29343
<gh_stars>100-1000 """Markdown filters This file contains a collection of utility filters for dealing with markdown within Jinja templates. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import os import subprocess from ...
2.203125
2
tests/test_python_simulation_function.py
tanxicccc/rsopt
0
29344
<reponame>tanxicccc/rsopt<gh_stars>0 import unittest import sys import inspect from unittest import mock import numpy as np import rsopt.libe_tools.simulation_functions.python_simulation_functions as pyfunc import rsopt.optimizer as opt radiamodule = mock.MagicMock() sys.modules["radia"] = radiamodule from rsopt.codes....
1.820313
2
ranker/views.py
shreyashc/firecube
1
29345
import datetime import json import os import random import re from urllib.parse import quote import lxml import pafy import requests import youtube_dl from bs4 import BeautifulSoup from django.conf import settings from django.core.files.storage import FileSystemStorage from django.http import (Http404, HttpResponse, H...
2.484375
2
spotdl/get-file-name.py
Shaxadhere/spotdl
25
29346
from spotdl import handle from spotdl import const from spotdl import downloader import os import sys const.args = handle.get_arguments(to_group=True) track = downloader.Downloader(raw_song=const.args.song[0]) track_title = track.refine_songname(track.content.title) track_filename = track_title + const.args.output_...
2.328125
2
jax/_src/numpy/ndarray.py
tianjuchen/jax
0
29347
<gh_stars>0 # 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 ...
2.140625
2
tests/cursor_test.py
lunixbochs/bearfield
1
29348
"""Tests for the cursor module.""" from __future__ import absolute_import from . import common from bearfield import cursor, Document, Field, Query class TestCursor(common.TestCase): """Test the Cursor class.""" class Document(Document): class Meta: connection = 'test' index = Fie...
2.75
3
probability_combinatorics/combinatoric.py
codecakes/random_games
0
29349
<filename>probability_combinatorics/combinatoric.py<gh_stars>0 from decimal import Decimal from math import e, factorial def combination(num, den): """ Find nCr or (n r), the Binomial Coefficients """ dec1 = dec2 = Decimal(1) if 0 <= den <= num: diff = num - den if num-diff < num-de...
3.609375
4
tests/conftest.py
bcsummers/falcon-provider-redis
0
29350
<reponame>bcsummers/falcon-provider-redis # -*- coding: utf-8 -*- """Testing conf module.""" # third-party import pytest from falcon import testing from .app import app_hook, app_middleware @pytest.fixture def client_hook() -> testing.TestClient: """Create testing client fixture for hook app""" return testin...
1.617188
2
sortingview/SpikeSortingView/create_position_pdf_plot.py
garrettmflynn/sortingview
2
29351
from typing import List, Union import numpy as np from .Figure import Figure def create_position_pdf_plot(*, start_time_sec: np.float32, sampling_frequency: np.float32, pdf: np.ndarray, label: str): # Nt = pdf.shape[0] # Np = pdf.shape[1] A = pdf B = A / np.reshape(np.repeat(np.max(A, axis=1), A.shape...
2.53125
3
Prototype Pygame/arrays.py
KValexander/own_rts
0
29352
# Connect files from configs import * # Arrays items = [] selectedItems = [] # Interface arrays buttons = [] surfaces = [] # Getting item def getItemById(ident): for item in items: if item.id == ident: return item # Removing item def removeItem(item): items.remove(item) # Removing items def removeItems(): ...
2.59375
3
webapp/app.py
liaosvcaf/earlyAlertOfLaws
0
29353
<gh_stars>0 import os import markdown2 from forms import AddKeywordForm, SubscribeEmailForm, TimeWindowForm from flask import (flash, render_template, request, escape, redirect, url_for, session, abort) from flask_paginate import Pagination, get_page_parameter from parsing.notifications import send...
2.53125
3
colossalai/nn/layer/parallel_1d/layers.py
jiangz17THU/ColossalAI
0
29354
<filename>colossalai/nn/layer/parallel_1d/layers.py #!/usr/bin/env python # -*- encoding: utf-8 -*- import math from collections import OrderedDict from typing import Callable, Tuple import torch import torch.nn.functional as F from colossalai.communication import broadcast from colossalai.context import ParallelMode...
2.046875
2
3rdparty/wsgi_intercept/test/test_mechanoid.py
arda2525/fixofx
50
29355
<filename>3rdparty/wsgi_intercept/test/test_mechanoid.py #! /usr/bin/env python2.3 from wsgi_intercept.mechanoid_intercept import Browser from nose.tools import with_setup import wsgi_intercept from wsgi_intercept import test_wsgi_app ### _saved_debuglevel = None def install(port=80): _saved_debuglevel, wsgi_int...
1.890625
2
kneejerk/cli.py
NapsterInBlue/kneejerk
0
29356
import click import pathlib import os from kneejerk.image_server import score_images_in_dir from kneejerk.data.saver import persist_scores, persist_metadata from kneejerk.data.transfer import segment_data_from_csv, transfer_normalized_image_data from kneejerk.data.utils import _get_classes, _get_max_image_dim, _ensure...
2.484375
2
magic.py
githoniel/ac7-ultrawide
0
29357
import sys, os, shutil, binascii, urllib.request, zipfile, ctypes, math, glob # Must be in game root folder. if not os.path.isfile('Ace7Game.exe'): wait = input('Ace7Game.exe not found in this folder. Press any key to close...') sys.exit(0) # Get resolution from OS. u32 = ctypes.windll.user32 u32.SetProcessDP...
2.796875
3
DigitRecognition.py
Michael-Kidd/4th-Year---Emerging-Technology
0
29358
# Tkinter is Python's de-facto standard GUI (Graphical User Interface) package. import tkinter as tk import keras as kr import numpy as np import matplotlib.pyplot as plt import math import sklearn.preprocessing as pre import gzip import PIL from PIL import Image, ImageDraw import os.path width = 280 height = 280 ce...
3.453125
3
sort/insertion.py
Wind2esg/python3sort
1
29359
<filename>sort/insertion.py<gh_stars>1-10 # python3 sort <http://github.com/Wind2esg/python3sort> # Copyright 2018 Wind2esg # Released under the MIT license <http://github.com/Wind2esg/python3sort/LICENSE> # Build a sorted range from 0 to i - 1, then try to find the position for the i item # Because it is sorted in th...
4.0625
4
organization/urls.py
adwait-thattey/raygun_api
0
29360
<filename>organization/urls.py from django.urls import path from .views import OrganizationView, ServiceView, ServiceListView from registration import views app_name = "organization" urlpatterns = [ path('<org_name>/service/<ticket>/', ServiceView.as_view(), name='service_view_get'), path('<org_name>/service...
1.804688
2
examples/layer_metrics.py
rolandproud/pyechometrics
0
29361
# -*- coding: utf-8 -*- """ Summarise Sound Scattering Layers (SSLs) @author: <NAME> """ ## import packages import matplotlib.pyplot as plt import gzip import pickle import numpy as np from pyechoplot.plotting import plot_pseudo_SSL, save_png_plot, plot_Sv ## import pyechometrics modules from pyechometrics.metrics i...
2.90625
3
chb/graphics/DotCfg.py
orinatic/CodeHawk-Binary
0
29362
# ------------------------------------------------------------------------------ # CodeHawk Binary Analyzer # Author: <NAME> # ------------------------------------------------------------------------------ # The MIT License (MIT) # # Copyright (c) 2016-2020 Kestrel Technology LLC # Copyright (c) 2020 <NAME> # Copy...
1.257813
1
AEC.py
apayeur/GIF-Ca
1
29363
import abc from Experiment import * class AEC : """ Abstract class defining an interface for performing active electrode compensation. """ __metaclass__ = abc.ABCMeta @abc.abstractmethod def performAEC(self, experiment): """ This method should preprocess al...
3.265625
3
locust/test/test_env.py
radhakrishnaakamat/locust
1
29364
from locust import ( constant, ) from locust.env import Environment, LoadTestShape from locust.user import ( User, task, ) from locust.user.task import TaskSet from .testcases import LocustTestCase from .fake_module1_for_env_test import MyUserWithSameName as MyUserWithSameName1 from .fake_module2_for_env_te...
2.265625
2
datasets/__init__.py
Masterchef365/pvcnn
477
29365
from datasets.s3dis import S3DIS
1.070313
1
schedule/main/utils/fetch_data.py
DSD-ESDC-EDSC/dynamic-org-chart-scripts
0
29366
import csv from io import BytesIO import pandas as pd from urllib.request import urlopen from zipfile import ZipFile def fetch_geds(url, subset=None): ''' Fetches the geds dataset from Canada's Open Data Portal Args: url: A string containing the url to the Canada Open Data Portal web ...
3.734375
4
grid.py
Data-Mechanics/bps-simulated-students
2
29367
<reponame>Data-Mechanics/bps-simulated-students """ grid.py Module containing class for working with a street grid. """ import json import geojson import geopy.distance import shapely.geometry from geoql import geoql import geoleaflet import folium import rtree import networkx from tqdm import tqdm class Grid(): ...
2.921875
3
lost_ds/vis/vis.py
l3p-cv/lost_ds
1
29368
import os from tqdm import tqdm from joblib import Parallel, delayed try: import seaborn as sns except: pass import numpy as np import cv2 from lost_ds.util import get_fs from lost_ds.geometry.lost_geom import LOSTGeometries from lost_ds.functional.api import remove_empty def get_fontscale(fontscale, thic...
2.21875
2
cadnano/views/pathview/prexovermanager.py
mctrinh/cadnano2.5
1
29369
from collections import deque from PyQt5.QtCore import Qt from PyQt5.QtGui import QColor from PyQt5.QtWidgets import QGraphicsRectItem from cadnano.gui.palette import getNoPen from cadnano.proxies.cnenum import StrandType from .pathextras import PreXoverItem class PreXoverManager(QGraphicsRectItem): """Summary ...
2.25
2
tests/api_test.py
pmav99/sysfacts
2
29370
<filename>tests/api_test.py import json import pytest import sysfacts @pytest.fixture(scope="module") def collected_data(): return sysfacts.collect_facts() def test_imports(): from sysfacts import collect_facts def test_return_type(collected_data): assert isinstance(collected_data, dict) def test_...
2.296875
2
MerginLetters.py
SandraCoburn/python-code-challenges
0
29371
<reponame>SandraCoburn/python-code-challenges<filename>MerginLetters.py def mergingLetters(s, t): #edge cases mergedStr = "" firstChar = list(s) secondChar = list(t) for i, ele in enumerate(secondChar): if i < len(firstChar): mergedStr = mergedStr + firstChar[i] p...
3.765625
4
loutilities/flask_helpers/decorators.py
louking/loutilities
1
29372
''' decorators - decorators to help with flask applications ''' # standard from datetime import timedelta from functools import update_wrapper # pypi from flask import make_response, request, current_app def crossdomain(origin=None, methods=None, headers=None, max_age=21600, attach_to_all=True, ...
2.890625
3
modules/secondarybase64_layer5.py
bobombobo/python-obfuscator
1
29373
def secondarybase64_layer5(nearing_the_end_script): import base64 print("Secondary base64 encrypting") joe = (nearing_the_end_script) spliting = joe.encode('utf-8') spliting = base64.b64encode(spliting) spliting = spliting.decode('utf-8') split_strings = [] n = int((len(spliting))/20) for index in r...
2.875
3
Forms/InstagramLoginForm.py
CT83/PyMultiPoster
0
29374
from flask_wtf import FlaskForm from wtforms import PasswordField, SubmitField, StringField from wtforms.validators import DataRequired, Length class InstagramLoginForm(FlaskForm): username = StringField('Instagram Username', validators=[DataRequired(), ...
2.734375
3
tests/flask/test_oauth2/test_token_introspection.py
tk193192/authlib
2
29375
<reponame>tk193192/authlib from flask import json from authlib.flask.oauth2.sqla import create_query_token_func from authlib.oauth2.rfc7662 import IntrospectionEndpoint from .models import db, User, Client, Token from .oauth2_server import TestCase from .oauth2_server import create_authorization_server query_token = ...
2.65625
3
modules/database.py
MrEluzium/UlvicationBot
0
29376
<filename>modules/database.py # Copyright 2020 <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 ...
3.109375
3
common-mk/mojom_bindings_generator_wrapper.py
strassek/chromiumos-platform2
4
29377
<filename>common-mk/mojom_bindings_generator_wrapper.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2018 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Thin wrapper of Mojo's mojom_bindings_generato...
1.835938
2
script.module.placenta/lib/resources/lib/sources/en/to_be_fixed/sitedown/onlinemovies.py
parser4life/tantrumrepo
1
29378
# NEEDS FIXING # -*- coding: UTF-8 -*- ####################################################################### # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # @tantrumdev wrote this file. As long as you retain this notice you # can do whate...
2.046875
2
venv/src/pages/forms.py
ddelgadoJS/ProyectoWeb
1
29379
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from .models import * class EmpresaCreateForm(forms.ModelForm): class Meta: model = Empresa fields = [ 'nombre', 'description', 'direccion...
2.21875
2
tests/test_connections.py
iparaskev/py_connect
5
29380
<filename>tests/test_connections.py """test_connections.py""" import unittest import os from py_connect import ConnectionsHandler from py_connect import Board, Peripheral, SensorTypes cons_path = \ "/".join(os.path.abspath(__file__).split("/")[:-2]) + "/test_connections/" class TestConnection(unittest.TestCase...
3.203125
3
p3iv_utils/src/p3iv_utils/coordinate_transformation.py
fzi-forschungszentrum-informatik/P3IV
4
29381
<filename>p3iv_utils/src/p3iv_utils/coordinate_transformation.py # This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV), # copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory) import numpy as np import lanelet...
2.546875
3
web/pyserver/workers/board/views/board.py
abhatikar/training_extensions
2
29382
<filename>web/pyserver/workers/board/views/board.py<gh_stars>1-10 import aiohttp_cors from aiohttp import web from common.utils.run_cmd import run class Tensorboard(web.View, aiohttp_cors.CorsViewMixin): async def get(self): print("Start") folder = self.request.query.get("folder") cmd_ch...
2.203125
2
molecule/default/tests/test_role.py
boutetnico/ansible-role-nodejs
0
29383
import pytest import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') @pytest.mark.parametrize('name', [ ('nodejs'), ]) def test_packages_are_installed(host, name): package = host.package(name)...
2.046875
2
losses/__init__.py
xieqk/SEF
0
29384
<gh_stars>0 from .ranking import Triplet
1.039063
1
GTFtools.py
zhenglabuthscsa/PRADA2
0
29385
""" created by <NAME> at 1/8/19 """ import os import pandas as pd def export_to_bed(gtf,intermediate_file_dir, lincRNA): if lincRNA: lincRNAIDs = pd.read_csv(os.path.join(intermediate_file_dir, 'intersect_total.txt'), names=['ids'], sep='\t') exons = gtf[(gtf.feature == 'exon') & (gtf.seqname != '...
2.484375
2
dlclabel/io.py
jonmatthis/napari-DeepLabCut
0
29386
import glob import numpy as np import os import pandas as pd import yaml from dask_image.imread import imread from dlclabel import misc from itertools import groupby from napari.layers import Shapes from napari.plugins._builtins import napari_write_shapes from napari.types import LayerData from skimage.io import imsave...
2.1875
2
mathematics/reverse-integer.py
Neulana/leetcode
2
29387
""" 题目: 给定一个 32 位有符号整数,将整数中的数字进行反转。 示例 1: 输入: 123 输出: 321 示例 2: 输入: -123 输出: -321 示例 3: 输入: 120 输出: 21 注意: 假设我们的环境只能存储 32 位有符号整数,其数值范围是 [−2**31, 2**31 − 1]。根据这个假设,如果反转后的整数溢出,则返回 0。 """ class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ if ...
3.765625
4
lib/datatools/build/__init__.py
JokerWDL/PyAnomaly
1
29388
<gh_stars>1-10 from .. import dataclass # trigger the register in the dataclass package
1.273438
1
src/github3/repos/branch.py
thebrid/github3.py
0
29389
"""Implementation of a branch on a repository.""" import typing as t from . import commit from .. import decorators from .. import models if t.TYPE_CHECKING: from .. import apps as tapps from .. import users as tusers from . import orgs class _Branch(models.GitHubCore): """A representation of a bran...
2.90625
3
buildings/gui/menu_frame.py
strk/nz-buildings
2
29390
<filename>buildings/gui/menu_frame.py # -*- coding: utf-8 -*- import os.path from qgis.PyQt import uic from qgis.PyQt.QtWidgets import QFrame from buildings.utilities.layers import LayerRegistry # Get the path for the parent directory of this file. __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.d...
2.3125
2
helpers.py
denizumutdereli/dialogflow_nlp_ai_powered_chat_bot
1
29391
<reponame>denizumutdereli/dialogflow_nlp_ai_powered_chat_bot import os import sys import re import emoji import string import time import winsound from bs4 import BeautifulSoup from rich.progress import track def clear(): os.system('cls' if os.name=='nt' else'clear') def BeautifulSoupOp(text): soup = BeautifulSoup(...
2.453125
2
gitver/config.py
movermeyer/gitver
12
29392
#!/usr/bin/env python2 # coding=utf-8 """ The default per-repository configuration """ import sys import json import string from os.path import exists, dirname from gitver.defines import CFGFILE from termcolors import term, bold default_config_text = """{ # automatically generated configuration file # # ...
2.09375
2
oracle/TLOracle/property_R2_2.py
fatmaf/ROSMonitoring
11
29393
# MIT License # # Copyright (c) [2020] [<NAME>] # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, p...
2.140625
2
3. Others/Python_OOP_Passenger_Registration.py
PurveshMakode24/snippets
1
29394
from random import randint import re; import json class Passenger: def __init__(self, passengerId, passengerName, email, password, address, contact): self.passengerId = passengerId self.passengerName = passengerName self.email = email self.password = password self.address = ...
3.359375
3
software/examples/python/03-multiplexer/main.py
esysberlin/lufo-ifez-datenkonzentrator
2
29395
<reponame>esysberlin/lufo-ifez-datenkonzentrator #!/usr/bin/env python3 # -*- coding: utf-8 -*- import random from common import spi def main(): multiplexer_state = spi.parse_response(spi.query('multiplexer', 'get_outputs')) print("Current multiplexer state:") _print_state(multiplexer_state) print('') fo...
2.375
2
test/a.py
atsuoishimoto/pyjf3
0
29396
<filename>test/a.py # -*- coding: utf-8 -*- import pyjf print repr(u'使'.encode('euc-jp')) print repr(pyjf.sjistoeuc(u'使'.encode('sjis')))
2.4375
2
rl_sandbox/priors/uniform.py
chanb/rl_sandbox_public
14
29397
import torch from torch.distributions import Uniform from rl_sandbox.constants import CPU class UniformPrior: def __init__(self, low, high, device=torch.device(CPU)): self.device = device self.dist = Uniform(low=low, high=high) def sample(self, num_samples): return self.dist.rsample...
2.5625
3
preprocess/conll_to_factors.py
thilakshiK/wmt16-scripts
132
29398
<reponame>thilakshiK/wmt16-scripts<filename>preprocess/conll_to_factors.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Author: <NAME> # Distributed under MIT license # take conll file, and bpe-segmented text, and produce factored output import sys import re from collections import namedtuple Word = namedtuple(...
2.625
3
Training/Auto_Labelling/tests/test_utils.py
evamok/knowledge-extraction-recipes-forms
93
29399
<gh_stars>10-100 #!/usr/bin/python # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import pytest import os import json from mock import MagicMock, patch, mock_open from shared_code import utils def test_is_url_returns_true_when_url_passed_in(): #arrange input = ...
2.40625
2