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
coredis/response/callbacks/script.py
alisaifee/aredis
0
14400
from __future__ import annotations from coredis.response.callbacks import ResponseCallback from coredis.response.types import LibraryDefinition from coredis.response.utils import flat_pairs_to_dict from coredis.typing import Any, AnyStr, Mapping, Union from coredis.utils import EncodingInsensitiveDict class Function...
2.078125
2
controllers/editor.py
matumaros/BomberApe
0
14401
from models.tilemap import TileMap class EditorController: def __init__(self, view): self.view = view self.tilemap = TileMap() def place_tile(self, coord, ttype): self.tilemap.add_tile(coord, ttype) self.view.board.update_tiles({coord: ttype}) def place_spawn(self, coor...
2.59375
3
src/Pages/LoginPage.py
Artem0791/Hackathon18_09
1
14402
<filename>src/Pages/LoginPage.py from .BasePage import BasePage from src.Locators import LoginPage from src.Services.Faker.FakeDataGenerator import DataGenerator class Login(BasePage): def create_account(self): data = DataGenerator() self.select(LoginPage.CreateCustomer.title, 'Mr.') self....
2.3125
2
setup.py
willamm/dragonchain
3
14403
<filename>setup.py """ Copyright 2016 Disney Connected and Advanced Technologies Licensed under the Apache License, Version 2.0 (the "Apache License") with the following modification; you may not use this file except in compliance with the Apache License and the following modification to it: Section 6. Trademarks. is ...
1.890625
2
feeds.py
yoursantu/indiannewsplus
0
14404
<reponame>yoursantu/indiannewsplus """RSS feeds for the `multilingual_news` app.""" from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sites.shortcuts import get_current_site from django.contrib.syndication.views import Feed from django.core.urlresolvers impo...
2.390625
2
config/settings/base.py
kingsdigitallab/field-django
0
14405
<filename>config/settings/base.py """ Base settings to build other settings files upon. """ import os from pathlib import Path import environ ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent # field/ APPS_DIR = ROOT_DIR / "field" env = environ.Env() READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_EN...
2.28125
2
tests/test_subtyping_processing.py
phac-nml/biohansel
25
14406
# -*- coding: utf-8 -*- import pandas as pd import pytest from bio_hansel.qc import QC from bio_hansel.subtype import Subtype from bio_hansel.subtype_stats import SubtypeCounts from bio_hansel.subtyper import absent_downstream_subtypes, sorted_subtype_ints, empty_results, \ get_missing_internal_subtypes from bio_...
2.25
2
capreolus/benchmark/codesearchnet.py
seanmacavaney/capreolus
0
14407
import gzip import json import pickle from collections import defaultdict from pathlib import Path from zipfile import ZipFile from tqdm import tqdm from capreolus import ConfigOption, Dependency, constants from capreolus.utils.common import download_file, remove_newline from capreolus.utils.loginit import get_logger...
1.9375
2
tests/cli.py
chriswmackey/honeybee-radiance-folder
0
14408
from click.testing import CliRunner from honeybee_radiance_folder.cli import filter_json_file import json import os def test_filter_file(): runner = CliRunner() input_file = './tests/assets/project_folder/grid_info.json' output_file = './tests/assets/temp/grid_filtered_0.json' result = runner.invoke( ...
2.296875
2
perma_web/perma/forms.py
leppert/perma
0
14409
<reponame>leppert/perma<filename>perma_web/perma/forms.py import logging from django import forms from django.forms import ModelForm from django.forms.widgets import flatatt from django.utils.html import mark_safe from perma.models import Registrar, Organization, LinkUser logger = logging.getLogger(__name__) class ...
2.359375
2
samples/sample-2.py
shoriwe/LVaED
0
14410
<gh_stars>0 import io import os import re import zipfile import flask import markdown import blueprints.example import blueprints.home import blueprints.presentation import blueprints.transformations class Zipper(object): def __init__(self): self._content = None self._content_handler = io.BytesIO() def appen...
2.71875
3
yexinyang/scripts/main.py
TheSignPainter/MLproject-docknet
0
14411
import os, time import numpy as np import logging import fire import torch import torch.optim as optim import torch.nn as nn from torch.utils.data import DataLoader from model import * from dataset import * def train(dataloader, model, optimizer, criterion, device): epoch_loss = 0.0 total_nu...
2.453125
2
myconnectome/utils/download_file.py
poldrack/myconnectome
28
14412
<filename>myconnectome/utils/download_file.py<gh_stars>10-100 # -*- coding: utf-8 -*- """ download file using requests Created on Fri Jul 3 09:13:04 2015 @author: poldrack """ import requests import os from requests.packages.urllib3.util import Retry from requests.adapters import HTTPAdapter from requests import Ses...
3.359375
3
django-openstack/django_openstack/syspanel/views/instances.py
tylesmit/openstack-dashboard
2
14413
<filename>django-openstack/django_openstack/syspanel/views/instances.py # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Fourth Paradigm Development...
1.78125
2
image_png.py
tomasdisk/tommGL-py
1
14414
<filename>image_png.py from datetime import datetime as dt from bitmap import Bitmap, PilBitmap h = 500 w = 500 image = Bitmap(w, h, alpha=True) pil_image = PilBitmap(w, h, alpha=True) color_red = 0 for i in range(h): for j in range(w): image.set_rgba_pixel(j, i, color_red, 0, 0, 150) pil_image.se...
3.484375
3
src/memberdef.py
alljoyn/devtools-codegen
0
14415
<filename>src/memberdef.py # Copyright AllSeen Alliance. All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROV...
2.09375
2
ddcz/migrations/0010_creativepage_creativepageconcept_creativepagesection.py
Nathaka/graveyard
6
14416
# Generated by Django 2.0.2 on 2018-06-13 22:10 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("ddcz", "0009_auto_201806...
1.820313
2
libml/preprocess.py
isabella232/l2p
45
14417
# coding=utf-8 # Copyright 2020 The Learning-to-Prompt 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 appli...
2.40625
2
glue/viewers/matplotlib/qt/toolbar.py
tiagopereira/glue
1
14418
from __future__ import absolute_import, division, print_function from matplotlib.backends.backend_qt5 import NavigationToolbar2QT from glue.config import viewer_tool from glue.viewers.common.tool import CheckableTool, Tool __all__ = ['MatplotlibTool', 'MatplotlibCheckableTool', 'HomeTool', 'SaveTool', 'P...
2.015625
2
2_4_overfitting_underfitting/utils_overfitting.py
layerwise/training
0
14419
import matplotlib.pyplot as plt import numpy as np from ipywidgets import interactive, interactive_output, fixed, HBox, VBox import ipywidgets as widgets def true_function_old(x): x_copy = -1 * x f = 2 * x_copy * np.sin(0.8*x_copy) + 0.5 * x_copy**2 - 5 return f def sigmoid(x, L=10, k=2, x_0=20): re...
2.75
3
analyze.py
sveitser/mandarin
0
14420
#!/usr/bin/env python import os import sys import jieba import numpy as np jieba.setLogLevel(60) # quiet fname = sys.argv[1] with open(fname) as f: text = f.read() tokenizer = jieba.Tokenizer() tokens = list(tokenizer.cut(text)) occurences = np.array([tokenizer.FREQ[w] for w in tokens if w in tokenizer.FREQ])...
3.015625
3
brown_clustering/data.py
helpmefindaname/BrownClustering
7
14421
from itertools import tee from typing import Dict, Iterator, List, Sequence, Tuple from brown_clustering.defaultvaluedict import DefaultValueDict Corpus = Sequence[Sequence[str]] class BigramCorpus: def __init__( self, corpus: Corpus, alpha: float = 1, start_symbo...
2.78125
3
xs/layers/ops.py
eLeVeNnN/xshinnosuke
290
14422
from .base import * class Input(Layer): def __init__(self, input_shape: Union[List, Tuple], **kwargs): super(Input, self).__init__(input_shape=input_shape, **kwargs) self._shape = input_shape def call(self, x: F.Tensor, *args, **kwargs) -> F.Tensor: self._data = x return self....
2.765625
3
fcore/util.py
superwhyun/farmos
0
14423
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2018 JiNong, Inc. # All right reserved. # """ Utility Functions를 정의함. """ import time import math import logging import logging.handlers def getdefaultlogger(): _logger = logging.getLogger('mate') _logger.setLevel(logging.DEBUG) ...
2.5625
3
src/lib/__init__.py
gfjiangly/RCNet
0
14424
# -*- encoding:utf-8 -*- # @Time : 2019/10/23 15:45 # @Author : gfjiang # @Site : # @File : __init__.py # @Software: PyCharm
0.984375
1
tests/manual/i3wmcommands.py
diegoperezm/screencast-script
0
14425
import sys # for development sys.path.append('../../src') from screencastscript import ScreencastScript # noqa: E402 screencast = ScreencastScript() screencast.sleep(1) screencast.i3wm_focus_left() screencast.sleep(1) screencast.i3wm_zoom_in() screencast.sleep(1) screencast.i3wm_zoom_out() screencast.sleep(1) sc...
1.609375
2
hippocampus/scripts/s04_hipp_cortex_fc_mean.py
CNG-LAB/cng-open
0
14426
<filename>hippocampus/scripts/s04_hipp_cortex_fc_mean.py """ computes the mean hippocampal-cortical functional connectivity (fc) matrix, for the left hemisphere subfields """ import os import h5py import numpy as np # data dirs ddir = '../data/' conndir = '../data/tout_hippoc/' odir = '../data/tout_group/...
2.140625
2
setup.py
sgp79/reptools
0
14427
<filename>setup.py """A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ #To install: # py -3 setup.py sdist # pip3 install . # Always prefer setuptools over distutils from setuptools import setup, find_packages from os import ...
1.890625
2
peeldb/migrations/0033_auto_20171018_1423.py
ashwin31/opensource-job-portal
1
14428
<filename>peeldb/migrations/0033_auto_20171018_1423.py # -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-10-18 14:23 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('peeldb', '0032_skill_skill_type'), ...
1.515625
2
application/modules/post/windows-priv-check/wpc/report/issues.py
cys3c/viper-shell
2
14429
<filename>application/modules/post/windows-priv-check/wpc/report/issues.py from wpc.report.issue import issue import xml.etree.cElementTree as etree from lxml import etree as letree from operator import itemgetter, attrgetter, methodcaller # TODO should this class contain info about the scan? or define a new class c...
2.390625
2
util/doxify.py
lanfangping/ravel
9
14430
<filename>util/doxify.py<gh_stars>1-10 #!/usr/bin/python """ From Mininet 2.2.1: convert simple documentation to epydoc/pydoctor-compatible markup """ from sys import stdin, stdout, argv import os from tempfile import mkstemp from subprocess import call import re spaces = re.compile(r'\s+') singleLineExp = re.compi...
2.828125
3
mysite/stock/views.py
flohh-py/django-tutorial
0
14431
from django.views.generic import ListView, DetailView from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.urls import reverse_lazy, reverse from django.shortcuts import redirect from .models import StockEntry, StockEntryLine from .forms import StockEntryForm, StockEntryLineForm, StockEn...
2.109375
2
src/sentry/web/frontend/generic.py
erhuabushuo/sentry
0
14432
<reponame>erhuabushuo/sentry """ sentry.web.frontend.generic ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :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 from django.http import HttpResponseRedirect from django.core.url...
2.046875
2
setup.py
harsh020/synthetic_metric
1
14433
import setuptools setuptools.setup( name="synmetric", version="0.2.dev1", license='MIT', author="<NAME>", author_email="<EMAIL>", description="Metric to evaluate data quality for synthetic data.", url="https://github.com/harsh020/synthetic_metric", download_url = 'https://github.com/ha...
1.171875
1
neurokit2/microstates/__init__.py
danibene/NeuroKit
1
14434
<reponame>danibene/NeuroKit """Submodule for NeuroKit.""" from .microstates_clean import microstates_clean from .microstates_peaks import microstates_peaks from .microstates_static import microstates_static from .microstates_dynamic import microstates_dynamic from .microstates_complexity import microstates_complexity ...
1.0625
1
notario/tests/validators/test_hybrid.py
alfredodeza/notario
4
14435
<gh_stars>1-10 from pytest import raises from notario.validators import Hybrid from notario.exceptions import Invalid from notario.decorators import optional from notario import validate def validator(x): assert x, 'fail' class TestHybrid(object): def test_use_validator_passes(self): schema = () ...
2.6875
3
players/urls.py
OnerInce/nfl-rest_api
2
14436
from django.urls import path, include from . import views from rest_framework import routers router = routers.SimpleRouter() router.register(r'players', views.PlayerView, basename='players') router.register(r'teams', views.TeamView, basename='teams') urlpatterns = [ path('', views.APIWelcomeView), path('', ...
1.875
2
watch/migrations/0014_auto_20201101_2304.py
msyoki/Neighborhood
0
14437
<reponame>msyoki/Neighborhood<gh_stars>0 # Generated by Django 2.0.2 on 2020-11-01 20:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('watch', '0013_alert'), ] operations = [ migrations.AlterField( model_name='alert', ...
1.53125
2
torchx/examples/apps/lightning_classy_vision/test/component_test.py
LaudateCorpus1/torchx
101
14438
<reponame>LaudateCorpus1/torchx<gh_stars>100-1000 # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import torchx.examples.apps.lightning_classy_vision.component...
1.789063
2
app.py
cykreet/getV
0
14439
import requests from sanic import Sanic from sanic.response import json from sanic_limiter import Limiter, get_remote_address from bs4 import BeautifulSoup async def ratelimit_handler(request, exception): return json({"error": f"Ratelimit exceeded {exception}."}, status=429) app = Sanic() app.error_handler.add(...
2.453125
2
third_party/xiuminglib/xiuminglib/vis/video.py
leehsiu/nerfactor
183
14440
<filename>third_party/xiuminglib/xiuminglib/vis/video.py from os.path import join, dirname import numpy as np from .text import put_text from .. import const from ..os import makedirs from ..imprt import preset_import from ..log import get_logger logger = get_logger() def make_video( imgs, fps=24, outpath=N...
2.625
3
shipfunk_python/__init__.py
vilkasgroup/shipfunk_python
0
14441
<filename>shipfunk_python/__init__.py # -*- coding: utf-8 -*- """Top-level package for Shipfunk.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.1'
1.25
1
vpc/nos/driver/ovs/ne.py
zhufawuwo/baton
0
14442
#! python3 # coding: utf-8 from vpc.nos import NetworkElement,NetworkElementEvent,event_t,EventChain class OVSEvent(NetworkElementEvent): def __init__(self,ne_id,type): super().__init__(ne_id,type) class OVS(NetworkElement): def __init__(self,channel,datapath): super().__init__() self...
2.296875
2
cumulusci/core/config/BaseConfig.py
leboff/CumulusCI
163
14443
<reponame>leboff/CumulusCI<filename>cumulusci/core/config/BaseConfig.py<gh_stars>100-1000 import logging class BaseConfig(object): """BaseConfig provides a common interface for nested access for all Config objects in CCI.""" defaults = {} def __init__(self, config=None, keychain=None): if config...
2.65625
3
scikit_algo/All.py
sankar-mukherjee/CoFee
0
14444
<gh_stars>0 """ Created on Tue Feb 24 16:08:39 2015 @author: mukherjee """ import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import preprocessing, metrics from sklearn.learning_curve import learning_curve # read Form data DATA_FORM_FILE = 'all-merged-cat.csv' #rawdata ...
2.4375
2
tests/test_client.py
KazkiMatz/py-googletrans
0
14445
<reponame>KazkiMatz/py-googletrans from httpcore import TimeoutException from httpcore._exceptions import ConnectError from httpx import Timeout, Client, ConnectTimeout from unittest.mock import patch from pytest import raises from googletrans import Translator def test_bind_multiple_service_urls(): service_urls...
2.296875
2
Network/class_func.py
Mobad225/S-DCNet
153
14446
# -*- coding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F import numpy as np # Func1: change density map into count map # density map: batch size * 1 * w * h def get_local_count(density_map,psize,pstride): IF_gpu = torch.cuda.is_available() # if gpu, return gpu IF_r...
2.453125
2
src/python/pants/backend/codegen/avro/avro_subsystem.py
danxmoran/pants
0
14447
<reponame>danxmoran/pants # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from pants.option.option_types import BoolOption from pants.option.subsystem import Subsystem class AvroSubsystem(Subsystem)...
1.742188
2
shade/tests/unit/test_shade.py
mail2nsrajesh/shade
0
14448
# 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 # distributed under t...
1.890625
2
plots_tournament.py
rradules/opponent_modelling_monfg
1
14449
<reponame>rradules/opponent_modelling_monfg import matplotlib import pandas as pd matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 import matplotlib.pyplot as plt import seaborn as sns from utils.utils import mkdir_p sns.set() sns.despine() sns.set_context("paper", rc={"font.size": 18,...
2.609375
3
test/test_wrapper.py
bertsky/ocrd_keraslm
0
14450
<gh_stars>0 import os, sys import shutil from unittest import TestCase, main from ocrd.resolver import Resolver from ocrd_models.ocrd_page import to_xml from ocrd_modelfactory import page_from_file from ocrd_utils import MIMETYPE_PAGE from ocrd_tesserocr.recognize import TesserocrRecognize from ocrd_keraslm.wrapper im...
2.28125
2
meltingpot/python/configs/substrates/territory_rooms.py
Rohan138/meltingpot
0
14451
<gh_stars>0 # Copyright 2020 DeepMind Technologies Limited. # # 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 applicab...
2.1875
2
aptitudetech_private/tasks.py
CloudGround/aptitudetech_private
0
14452
<filename>aptitudetech_private/tasks.py #-*- coding: utf-8 -*- import frappe import boto3 import boto3.session import rows import json import zipfile import tempfile import sqlite3 from io import BytesIO from frappe import _ from frappe.utils import cint, flt, today, getdate, get_first_day, add_to_date try: from frap...
2.234375
2
udfs/tests/test_run_udfs.py
tslr/bigquery-utils
0
14453
<gh_stars>0 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
2.28125
2
pandas/tests/generic/test_panel.py
EternalLearner42/pandas
0
14454
# -*- coding: utf-8 -*- # pylint: disable-msg=E1101,W0612 from warnings import catch_warnings, simplefilter from pandas import Panel from pandas.util.testing import assert_panel_equal from .test_generic import Generic class TestPanel(Generic): _typ = Panel _comparator = lambda self, x, y: assert_panel_equa...
2.140625
2
shortest-paths.py
SAUSy-Lab/map-speed-test
2
14455
# calculate shortest paths between OD pairs # in the map_speed_od postgis table # update the shortest path geometry into the table import requests, json, psycopg2 # get OD pairs from DB conn_string = ( "host='localhost' dbname='' user='' password=''" ) connection = psycopg2.connect(conn_string) connection.autocommit ...
2.875
3
my_tools/tools_for_os/for_file.py
Alex2Yang97/waiting_time_project
0
14456
<gh_stars>0 #-*- coding:utf-8 -*- # @Time : 2020-02-15 15:49 # @Author : Zhirui(<NAME> # @Function : import os def create_folder(folder_name): if not os.path.exists(folder_name): os.makedirs(folder_name) print(folder_name, 'has created!') else: print(folder_name, 'already exist...
3.15625
3
tcp_tls_tunnel/hyper_http2_adapter.py
DSAdv/tcp-tls-tunnel-py
1
14457
<filename>tcp_tls_tunnel/hyper_http2_adapter.py import ssl import socket from typing import Tuple from hyper.common.util import to_native_string from urllib.parse import urlparse from hyper import HTTP11Connection, HTTPConnection from hyper.common.bufsocket import BufferedSocket from hyper.common.exceptions import TLS...
3.109375
3
get_variances.py
OmnesRes/GRIMMER
4
14458
<filename>get_variances.py from itertools import * import time import os BASE_DIR = os.path.dirname(os.path.abspath(__file__)) #my own variance function runs much faster than numpy or the Python 3 ported statistics module def variance(data,u): return sum([(i-u)**2 for i in data])/len(data) ##rounding the means...
2.6875
3
utils/pagenation.py
Andrewpqc/URL-shortener
9
14459
# coding: utf-8 """ paginate.py ``````````` : 分页api """ from flask import url_for def pagination(lit, page, perpage,endpoint): """ 返回当前分页的列表对象, next、last链接 {current: next_lit} """ _yu = len(lit) % perpage _chu = len(lit) // perpage if _yu == 0: last = _chu else:...
3.265625
3
app/default/rest_train.py
dbhack-aquila/aquila
1
14460
<filename>app/default/rest_train.py<gh_stars>1-10 import pandas as pd from . import default import wikipedia import json from flask import jsonify import re import os import multiprocessing import requests import urllib import hashlib df = 0 wikipedia.set_lang("de") def init(): path = os.path.dirname(os.path.ab...
2.703125
3
tools/python_api_Easytest/out.py
xutongxin1/UnitAi-project
5
14461
<gh_stars>1-10 import json,requests def test(): url='http://localhost:5000/login' headers = {'Content-Type':'application/json'} data={ "user": "xutongxin" } req = requests.post(url, json.dumps(data), headers) result = json.loads(req.text) print(test)
2.71875
3
src/cam_loop.py
stay-whimsical/screamchess
2
14462
<filename>src/cam_loop.py<gh_stars>1-10 from camera import board_image_processor as bip from chess.models import * import cv2 import numpy as np from media.sound import * def show_webcam(mirror=False): cam = cv2.VideoCapture(0) while True: ret_val, img = cam.read() #chess_state = process_image(...
2.6875
3
__train/preprocessing.py
aiddun/jazzCNN
1
14463
<reponame>aiddun/jazzCNN import numpy as np from numpy import random import glob import scipy.io.wavfile np.random.seed(4) def preprocess(periods, testCategoryNum): periodList = periods catNum = len(periodList) def createpathlist(): print("Loading file paths.") x = [] y = [] ...
2.578125
3
test/fixtures/python/analysis/main1.py
matsubara0507/semantic
8,844
14464
import a as b import b.c as e b.foo(1) e.baz(1)
1.242188
1
app/views.py
allthingsclowd/K5_User_Onboarding_Example
0
14465
<reponame>allthingsclowd/K5_User_Onboarding_Example #!/usr/bin/python """Summary - Flask Views Used to Control/Wrap a web UI around the Add User Python Script Author: <NAME> Date: 08/12/16 Twitter: @allthingsclowd Github: https://github.com/allthingscloud Blog: https://allthingscloud.eu """ fro...
2.484375
2
src/users/models.py
gabrielstork/django-to-do-list
6
14466
<filename>src/users/models.py<gh_stars>1-10 from django.contrib.auth.models import AbstractUser from django.core.validators import MinLengthValidator from django.utils.translation import gettext_lazy as _ from django.db import models from . import validators class User(AbstractUser): min_length_validator = MinLen...
2.375
2
readux/books/abbyyocr.py
jpkarlsberg/readux
0
14467
''' :class:`eulxml.xmlmap.XmlObject` classes for working with ABBYY FineReadux OCR XML. Currently supports **FineReader6-schema-v1** and **FineReader8-schema-v2**. ---- ''' from eulxml import xmlmap class Base(xmlmap.XmlObject): '''Base :class:`eulxml.xmlmap.XmlObject` for ABBYY OCR XML with common namespace...
2.5625
3
Aulas/aula14.py
adonaifariasdev/cursoemvideo-python3
0
14468
<gh_stars>0 '''for c in range(1, 10): print(c) print('FIM')''' '''c = 1 while c < 10: print(c) c += 1 print('FIM')''' '''n = 1 while n != 0: #flag ou condição de parada n = int(input('Digite um valor: ')) print('FIM')''' '''r = 'S' while r == 'S': n = int(input('Digite um valor: ')) r = str(i...
3.609375
4
tests/test_markdown_in_code_cells.py
st--/jupytext
5,378
14469
<filename>tests/test_markdown_in_code_cells.py """Issue #712""" from nbformat.v4.nbbase import new_code_cell, new_notebook from jupytext import reads, writes from jupytext.cell_to_text import three_backticks_or_more from jupytext.compare import compare, compare_notebooks from .utils import requires_myst def test_th...
2.625
3
amy/workshops/migrations/0152_event_open_ttt_applications.py
code-review-doctor/amy
53
14470
<gh_stars>10-100 # Generated by Django 2.1 on 2018-09-02 14:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('workshops', '0151_auto_20180902_0409'), ] operations = [ migrations.AddField( model_name='event', nam...
1.765625
2
example/cifar10/fast_at.py
KuanKuanQAQ/ares
206
14471
<reponame>KuanKuanQAQ/ares ''' This file provides a wrapper class for Fast_AT (https://github.com/locuslab/fast_adversarial) model for CIFAR-10 dataset. ''' import sys import os import torch import torch.nn as nn import torch.nn.functional as F import tensorflow as tf from ares.model.pytorch_wrapper import pytorch_c...
2.328125
2
auto_pilot/common/registrable.py
farrellsc/zAutoPilot
1
14472
from typing import Callable, TypeVar, List T = TypeVar('T') class Registrable(object): reg_list = dict() @classmethod def register(cls, class_name: str) -> Callable: def register_inner(class_type: T) -> None: cls.reg_list[class_name] = class_type return register_inner @c...
2.921875
3
noheavenbot/cogs/commands/testing.py
Molanito13/noheaven-bot
3
14473
<reponame>Molanito13/noheaven-bot<filename>noheavenbot/cogs/commands/testing.py from discord.ext.commands import command, Cog from noheavenbot.utils.constants import TEXTCHANNELS from discord import Member from noheavenbot.utils.database_tables.table_users import Users from noheavenbot.utils.validator import has_role a...
1.867188
2
mayan/apps/linking/tests/test_smart_link_condition_views.py
atitaya1412/Mayan-EDMS
343
14474
<gh_stars>100-1000 from mayan.apps.testing.tests.base import GenericViewTestCase from ..events import event_smart_link_edited from ..permissions import permission_smart_link_edit from .mixins import ( SmartLinkConditionViewTestMixin, SmartLinkTestMixin, SmartLinkViewTestMixin ) class SmartLinkConditionViewT...
1.945313
2
P1.py
chinmaydas96/CarND-LaneLines-P1
0
14475
#!/usr/bin/env python # coding: utf-8 # # Self-Driving Car Engineer Nanodegree # # # ## Project: **Finding Lane Lines on the Road** # *** # In this project, you will use the tools you learned about in the lesson to identify lane lines on the road. You can develop your pipeline on a series of individual images, and...
3.859375
4
notebooks/container/__init__.py
DanieleBaranzini/sktime-tutorial-pydata-amsterdam-2020
114
14476
<gh_stars>100-1000 from container.base import TimeBase from container.array import TimeArray, TimeDtype from container.timeseries import TimeSeries from container.timeframe import TimeFrame
1.3125
1
spiketools/utils/base.py
claire98han/SpikeTools
1
14477
"""Base utility functions, that manipulate basic data structures, etc.""" ################################################################################################### ################################################################################################### def flatten(lst): """Flatten a list of l...
3.53125
4
zentral/contrib/osquery/forms.py
mikemcdonald/zentral
0
14478
from django import forms from zentral.core.probes.forms import BaseCreateProbeForm from zentral.utils.forms import validate_sha256 from .probes import (OsqueryProbe, OsqueryComplianceProbe, OsqueryDistributedQueryProbe, OsqueryFileCarveProbe, OsqueryFIMProbe) # OsqueryProbe ...
2.125
2
src/dataclay/communication/grpc/messages/logicmodule/__init__.py
kpavel/pyclay
1
14479
""" Class description goes here. """ """Package containing gRPC classes.""" __author__ = '<NAME> <<EMAIL>>' __copyright__ = '2017 Barcelona Supercomputing Center (BSC-CNS)'
0.890625
1
src/cms/models/offers/__init__.py
mckinly/cms-django
14
14480
""" This package contains :class:`~cms.models.offers.offer_template.OfferTemplate` """
1.132813
1
service/audio_trigger_test.py
nicolas-f/noisesensor
2
14481
import numpy from scipy.spatial import distance import matplotlib.pyplot as plt import math import matplotlib.ticker as mtick freqs = [20, 25, 31.5, 40, 50, 63, 80, 100, 125, 160, 200, 250, 315, 400, 500, 630, 800, 1000, 1250, 1600, 2000, 2500, 3150, 4000, 5000, 6300, 8000, 10000, 12500] def cosine_distance(a, b, we...
2.640625
3
Python/6-hc_sr04-sensor.py
matr1xprogrammer/raspberry_pi-iot
2
14482
#!/usr/bin/python # # HC-SR04 Ultrasonic ranging sensor # import RPi.GPIO as GPIO import sys, time try: GPIO.setmode(GPIO.BCM) TRIG = 23 ECHO = 24 print "Distance measurement in progress..." GPIO.setup(TRIG, GPIO.OUT) GPIO.setup(ECHO, GPIO.IN) GPIO.output(TRIG, False) whi...
3.046875
3
venv/lib/python3.6/site-packages/ansible_collections/arista/eos/plugins/module_utils/network/eos/config/ospfv3/ospfv3.py
usegalaxy-no/usegalaxy
1
14483
<reponame>usegalaxy-no/usegalaxy # # -*- coding: utf-8 -*- # Copyright 2020 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from __future__ import absolute_import, division, print_function __metaclass__ = type """ The eos_ospfv3 config file. It is in this file...
1.609375
2
platypush/plugins/logger/__init__.py
BlackLight/runbullet
3
14484
from platypush.plugins import Plugin, action class LoggerPlugin(Plugin): """ Plugin to log traces on the standard Platypush logger """ @action def trace(self, msg, *args, **kwargs): """ logger.trace wrapper """ self.logger.trace(msg, *args, **kwargs) @action ...
2.484375
2
hc/front/tests/test_add_pdc.py
IfBkg/healthchecks
1
14485
from django.test.utils import override_settings from hc.api.models import Channel from hc.test import BaseTestCase @override_settings(PD_VENDOR_KEY="foo") class AddPdConnectTestCase(BaseTestCase): def setUp(self): super().setUp() self.url = "/projects/%s/add_pdc/" % self.project.code def test...
2.203125
2
atcoder/corp/codethxfes2014b_e.py
knuu/competitive-programming
1
14486
import sys sys.setrecursionlimit(3000) def check(rs, cs): table[rs][cs] = 2 if (rs, cs) == (rg, cg): return True if rs > 0 and table[rs - 1][cs] == 1 and check(rs - 1, cs): return True if cs > 0 and table[rs][cs - 1] == 1 and check(rs, cs - 1): return True if rs < r - 1 and table[rs...
2.859375
3
tests/test_bullet_train.py
masschallenge/bullet-train-python-client
0
14487
import json import logging from unittest import mock, TestCase from bullet_train import BulletTrain import os logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) TEST_API_URL = 'https://test.bullet-train.io/api' TEST_IDENTIFIER = 'test-identity' TEST_FEATURE = 'test-feature' class MockResponse: ...
2.515625
3
plim/console.py
spollard/Plim
85
14488
""" This module contains entry points for command-line utilities provided by Plim package. """ import sys import os import argparse import codecs from pkg_resources import get_distribution from pkg_resources import EntryPoint from mako.template import Template from mako.lookup import TemplateLookup from .util import ...
2.515625
3
devel_notes/test_class_speed.py
mekhub/alphafold
3
14489
<reponame>mekhub/alphafold #!/usr/bin/python import time import sys import os from copy import deepcopy sys.path.append(os.path.join(os.getcwd(), '..')) from alphafold.partition import DynamicProgrammingData as DP def getval( DP, idx ): return DP.X[ idx ][ idx ] x = [[]]*500 for i in range( 500 ): x[i] = [0.0]*50...
2.453125
2
testRead.py
BichonCby/BaseBSPython
0
14490
<reponame>BichonCby/BaseBSPython #!/usr/bin/env python3 # -*-coding:Latin-1 -* import time from Definitions import * #from ev3dev2.motor import OUTPUT_B,LargeMotor from ev3dev2.sensor import * from AddSensors import AngleSensor from ev3dev2.sensor.lego import TouchSensor import Trace trace = Trace.Trace() i=0 touche...
2.59375
3
circular-queue/circular-queue.py
tywmick/data-structures
0
14491
class CircularQueue: """ A circlular queue: a first-in-first-out data structure with a fixed buffer size. """ def __init__(self, size): if type(size) is not int: raise TypeError("Queue size must be a postive integer.") if size <= 0: raise ValueError("Queue size m...
4.0625
4
infer.py
vic9527/ViClassifier
1
14492
def load_model(model_path, device_type='cuda'): import torch from viclassifier.utils import dev_opt device = dev_opt.usingDevice(device_type) model = torch.load(model_path, map_location=device) model.to(device) # 测试时不启用 BatchNormalization 和 Dropout model.eval() return model def predic...
2.609375
3
compiler/router/tests/10_supply_grid_test.py
bsg-external/OpenRAM
43
14493
<filename>compiler/router/tests/10_supply_grid_test.py # See LICENSE for licensing information. # # Copyright (c) 2016-2019 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 reser...
2.296875
2
sources/decoding/analyse_model.py
int-brain-lab/paper-ephys-atlas
0
14494
# -*- coding: utf-8 -*- """ Created on Sat May 21 17:05:48 2022 @author: <NAME> """ import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score, balanced_accuracy_score, confusion_matrix from ibllib.atlas import BrainRegions from joblib import l...
2.03125
2
Lab04_82773/ex4_4/ex4_4.py
viniciusbenite/cdb
0
14495
<gh_stars>0 # <NAME> # Nmec 82773 # Make sure to run pip3 install -r requirements.txt and load the .dump at Neo4j # https://neo4j.com/docs/operations-manual/current/tools/dump-load/ # Dataset: https://neo4j.com/graphgist/beer-amp-breweries-graphgist#_create_nodes_and_relationships import sys from neo4j import GraphDa...
2.46875
2
readthedocs/code-tabs/python/tests/test_directory_listing_recursive.py
xenon-middleware/xenon-tutorial
2
14496
#!/usr/bin/env python import pytest from pyxenon_snippets import directory_listing_recursive def test_directory_listing_recursive(): directory_listing_recursive.run_example()
1.648438
2
submissions/past201912-open/i.py
m-star18/atcoder
1
14497
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) from itertools import product n, m = map(int, readline().split()) inf = float('inf') dp = [inf] * (2 ** n) dp[0] = 0 for _ in range(m): s, c = readline().rstrip().deco...
2.375
2
google/cloud/dlp_v2/services/dlp_service/transports/grpc_asyncio.py
LaudateCorpus1/python-dlp
32
14498
# -*- coding: utf-8 -*- # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
1.671875
2
tym.py
tsyogesh40/Finger_recognition-Python-
0
14499
<reponame>tsyogesh40/Finger_recognition-Python- import datetime t=datetime.datetime.now() #date format weekday=t.strftime("%a") # %A for abbr day=t.strftime("%d") month=t.strftime("%b") #%B for abbr month_num=t.strftime("%m") year=t.strftime("%Y") date=t.strftime("%Y-%m-%d") print(date) #time format hour_12=t.st...
3.34375
3