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
mwtab/mwschema.py
MoseleyBioinformaticsLab/mwtab
7
12900
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ mwtab.mwschema ~~~~~~~~~~~~~~ This module provides schema definitions for different sections of the ``mwTab`` Metabolomics Workbench format. """ import sys from schema import Schema, Optional, Or if sys.version_info.major == 2: str = unicode metabolomics_wor...
2.078125
2
functions/asmm_xml.py
EUFAR/asmm-eufar
0
12901
<reponame>EUFAR/asmm-eufar<filename>functions/asmm_xml.py import datetime import xml.dom.minidom import logging from PyQt5 import QtCore, QtWidgets from functions.button_functions import add_read NAMESPACE_URI = 'http://www.eufar.net/ASMM' def create_asmm_xml(self, out_file_name): logging.debug('asmm_xml.py - cr...
2.375
2
github/models.py
pyprism/Hiren-Git-Commit-Reminder
0
12902
<reponame>pyprism/Hiren-Git-Commit-Reminder from django.db import models # Create your models here. class Hiren(models.Model): access_token = models.CharField(max_length=200) authorized = models.BooleanField(default=False)
2.078125
2
linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Axon/idGen.py
mdavid/nuxleus
1
12903
#!/usr/bin/python # # Copyright (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser Gener...
1.84375
2
pyCEvNS/flux.py
athompson-tamu/pyCEvNS
0
12904
""" flux related class and functions """ from scipy.integrate import quad import pandas as pd from .helper import LinearInterp, polar_to_cartesian, lorentz_boost, lorentz_matrix from .oscillation import survival_solar from .parameters import * def _invs(ev): return 1/ev**2 class FluxBaseContinuous: def ...
2.625
3
enso/contrib/minimessages.py
blackdaemon/enso-launcher-continued
7
12905
# Author : <NAME> "blackdaemon" # Email : <EMAIL> # # Copyright (c) 2010, <NAME> <<EMAIL>> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the...
1.117188
1
article_curation/test_article_curation.py
mrkarezina/graph-recommendation-api
0
12906
<gh_stars>0 import unittest from unittest.mock import Mock import json from processor import scrape_article import main class ArticleCurationTestCase(unittest.TestCase): def test_article_fetch(self): response = scrape_article( url='https://www.cnn.com/2019/03/25/us/yale-rescinds-student-admi...
3.265625
3
test.py
chdre/noise-randomized
0
12907
import unittest class PerlinTestCase(unittest.TestCase): def test_perlin_1d_range(self): from noise import pnoise1 for i in range(-10000, 10000): x = i * 0.49 n = pnoise1(x) self.assertTrue(-1.0 <= n <= 1.0, (x, n)) def test_perlin_1d_octaves_range(self): ...
2.875
3
pipelines/controllers/datasets.py
platiagro/pipeline-generator
1
12908
<gh_stars>1-10 # -*- coding: utf-8 -*- import platiagro import pandas as pd from werkzeug.exceptions import NotFound from pipelines.database import db_session from pipelines.models import Operator from pipelines.models.utils import raise_if_experiment_does_not_exist def get_dataset_name(experiment_id, operator_id,)...
2.484375
2
tests/test_message.py
jfkinslow/flask-mailing
0
12909
<reponame>jfkinslow/flask-mailing import pytest from flask_mailing.schemas import Message, MultipartSubtypeEnum from flask_mailing.msg import MailMsg import os CONTENT = "file test content" def test_initialize(): message = Message( subject="test subject", recipients=["<EMAIL>"], body="tes...
2.578125
3
utils/checks.py
JDJGInc/JDBot
12
12910
import discord def check(ctx): def inner(m): return m.author == ctx.author return inner def Membercheck(ctx): def inner(m): return m.author == ctx.guild.me return inner def warn_permission(ctx, Member): if isinstance(ctx.channel, discord.TextChannel): return ctx.author.guild_permissions.ma...
2.3125
2
scripts/mgear/rigbits/eye_rigger.py
stormstudios/rigbits
1
12911
<reponame>stormstudios/rigbits """Rigbits eye rigger tool""" import json import traceback from functools import partial import mgear.core.pyqt as gqt import pymel.core as pm from maya.app.general.mayaMixin import MayaQWidgetDockableMixin from mgear.core import meshNavigation, curve, applyop, node, primitive, icon fro...
1.875
2
Python/expert/interact_with_linux/solution.py
fpichl/ProgrammingTasks
2
12912
#!/usr/bin/env python3 import os import shutil import sys import pathlib import logging # I will NEVER EVER use subproccess again # At least not for something like Popen try: from sh import wget except Exception: print('[!] Just install sh right now!(pip install --user sh)') sys.exit(0) # Dumb Python2 sup...
2.8125
3
Asap-3.8.4/Projects/NanoparticleMC/misc/viewatomsmc.py
auag92/n2dm
1
12913
import ase from ase import Atoms from ase.atom import Atom import sys from ase.visualize import view import pickle f = open(sys.argv[1],'r') #The .amc file p = pickle.load(f) positions = p['atomspositions'] atms = Atoms() for p0 in positions: a = Atom('Au',position=p0) atms.append(a) atms.center(vacuum=2) view(atm...
2.8125
3
bot_settings_example.py
nikmedoed/BalanceBot
0
12914
# это dev среда TELEGRAM_TOKEN = "..." RELATIVE_CHAT_IDS = [ "...", '...'] TEXT = { "bot_info": ('Привет, я бот, который отвечает за равномерное распределение участников по комнатам.\n\n' 'Нажми кнопку, если готов сменить комнату'), "get_link": "Получить рекомендацию", "new_room": "Ваша н...
2.0625
2
test/xslt/borrowed/sm_20000304.py
zepheira/amara
6
12915
######################################################################## # test/xslt/sm20000304.py # Example from <NAME> <<EMAIL>> # to <NAME> <<EMAIL>> # on 4 March 2000 """ From: "<NAME>" <<EMAIL>> To: <<EMAIL>> Subject: Re: SVG charts and graphs from XML input Date: Sat, 4 Mar 2000 18:02:53 -0800 (19:02 MST) This ...
2.65625
3
model-server/config.py
campos537/deep-fashion-system
1
12916
import json def Config(config_path): with open(config_path) as config_file: return json.load(config_file)
2.171875
2
pmfp/entrypoint/grpc/build_/build_pb_go.py
Python-Tools/pmfp
4
12917
"""编译go语言模块.""" import warnings from typing import List, Optional from pathlib import Path from pmfp.utils.run_command_utils import run def _build_grpc(includes: str, flag: str, to: str, target: str, cwd: Path) -> None: command = f"protoc {includes} {flag} --go_out={to} --go-grpc_out={to} {target}" try: ...
2.375
2
instapp/migrations/0003_auto_20190522_0007.py
imekenye/Instagram-clone
0
12918
<reponame>imekenye/Instagram-clone # Generated by Django 2.2.1 on 2019-05-22 00:07 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('instapp', '0002_auto_20190522_0006'), ] operations = [ migrations.RenameField( model_name='image', ...
1.492188
1
app/api/v1_0/users.py
daichi-yoshikawa/flask-boilerplate
1
12919
import json import logging from flask import jsonify, make_response, request from flask_jwt_extended import jwt_required from flask_restful import Resource from http import HTTPStatus from marshmallow import ValidationError, Schema from werkzeug.security import generate_password_hash from app.models import db from ap...
2.359375
2
src/count_targets.py
kahvel/MAProject
0
12920
from main import readData, getTrueLabels, binariseLabels, removePacketsAfterChange label_data = list() label_data.append(readData("..\\data\\test5_targets_1.csv")) label_data.append(readData("..\\data\\test5_targets_2.csv")) label_data.append(readData("..\\data\\test5_targets_3.csv")) labels = [getTrueLabels(label) ...
2.546875
3
src/imagine/goal_sampler.py
jordyantunes/Imagine
20
12921
import numpy as np from mpi4py import MPI from src.imagine.goal_generator.simple_sentence_generator import SentenceGeneratorHeuristic from src import logger class GoalSampler: def __init__(self, policy_language_model, reward_language_model, goal_dim, ...
2.203125
2
src/actionsold.py
Grumpy-Old-Tech/WorkshopAssistant
0
12922
#!/usr/bin/env python #This is different from AIY Kit's actions #Copying and Pasting AIY Kit's actions commands will not work from googleapiclient.discovery import build from googleapiclient.errors import HttpError from gmusicapi import Mobileclient from googletrans import Translator from gtts import gTTS import req...
1.75
2
openpype/tools/settings/settings/widgets/window.py
dangerstudios/OpenPype
0
12923
from Qt import QtWidgets, QtGui from .categories import ( CategoryState, SystemWidget, ProjectWidget ) from .widgets import ShadowWidget from .. import style class MainWidget(QtWidgets.QWidget): widget_width = 1000 widget_height = 600 def __init__(self, user_role, parent=None): super(...
2.09375
2
azkaban_zip_uploader/tests/lambda_handler_tests.py
uk-gov-mirror/dwp.aws-azkaban
0
12924
<gh_stars>0 import lambda_handler from unittest import TestCase from mock import call, patch, Mock from datetime import datetime import boto3 import json from botocore.stub import Stubber import urllib3 mock_s3_client = boto3.client('s3') s3_stubber = Stubber(mock_s3_client) list_objects_response = { 'IsTruncated'...
2.078125
2
cripts/usernames/username.py
lakiw/cripts
2
12925
import uuid from mongoengine import Document, StringField, ListField, UUIDField from django.conf import settings from cripts.core.cripts_mongoengine import CriptsBaseAttributes, CriptsSourceDocument from cripts.core.cripts_mongoengine import CriptsActionsDocument class UserName(CriptsBaseAttributes, CriptsSourceDoc...
2.265625
2
sweetpea/tests/test_encoding_diagram.py
anniecherk/sweetpea-py
1
12926
import pytest import operator as op from sweetpea import fully_cross_block from sweetpea.primitives import Factor, DerivedLevel, WithinTrial, Transition, Window from sweetpea.encoding_diagram import __generate_encoding_diagram color = Factor("color", ["red", "blue"]) text = Factor("text", ["red", "blue"]) con_lev...
2.28125
2
Source_Code/Python/ConductedTest/case_generator.py
fenglwh/instruments
0
12927
<gh_stars>0 import json from labinstrument.SS.CMW500.CMW500_WIFI.CMW500_WIFI import * if __name__ == '__main__': new_config_name='emm' new_config=CMW_WIFI(17).get_parameters() config=json.load(open('config.txt')) config[new_config_name]=new_config json.dump(config,open('config.txt','w'))
1.84375
2
internal-export-file/export-report-pdf/src/export-report-pdf.py
aakloul/connectors
0
12928
import yaml import os import time import datetime from pycti.utils.constants import StixCyberObservableTypes from weasyprint import HTML from pycti import OpenCTIConnectorHelper, get_config_variable from jinja2 import Environment, FileSystemLoader class ExportReportPdf: def __init__(self): # Instantiate t...
2.28125
2
Lyft-Dental/payments/pay/urls.py
Abhik1998/Lyft-sample_project
1
12929
from django.urls import path from .views import initiate_payment, callback urlpatterns = [ path('', initiate_payment, name='pay'), path('callback/', callback, name='callback'), ]
1.539063
2
ibmsecurity/isam/base/overview.py
zone-zero/ibmsecurity
46
12930
<reponame>zone-zero/ibmsecurity def get(isamAppliance, check_mode=False, force=False): """ Retrieve an overview of updates and licensing information """ return isamAppliance.invoke_get("Retrieve an overview of updates and licensing information", "/updates/overview") ...
1.992188
2
src/sweetrpg_library_api/application/config.py
paulyhedral/sweetrpg-library-api
0
12931
# -*- coding: utf-8 -*- __author__ = "<NAME> <<EMAIL>>" """ config.py - settings for the flask application object """ import os import redis from sweetrpg_library_api.application import constants class BaseConfig(object): DEBUG = bool(os.environ.get(constants.DEBUG) or True) PORT = os.environ.get(constant...
2.125
2
frames.py
mppc12/special_subject_tea
0
12932
<filename>frames.py<gh_stars>0 import pandas as pd from group import Group class Frames: def __init__(self, frame=None): self.cleanups = Cleanup() self.groups = Group() class Cleanup: def __init__(self, frame=None): self.frame = frame def __call__(self...
2.96875
3
msm/mycroft_skills_manager.py
forslund/mycroft-skills-manager
0
12933
<reponame>forslund/mycroft-skills-manager # Copyright (c) 2018 Mycroft AI, Inc. # # This file is part of Mycroft Skills Manager # (see https://github.com/MatthewScholefield/mycroft-light). # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # dis...
1.578125
2
ietf/utils/resources.py
wpjesus/codematch
1
12934
<reponame>wpjesus/codematch # Autogenerated by the mkresources management command 2014-11-13 05:39 from tastypie.resources import ModelResource from tastypie.fields import CharField from tastypie.constants import ALL from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType...
1.90625
2
maskrcnn_benchmark/data/datasets/concat_dataset.py
dukebw/maskrcnn-benchmark
0
12935
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import bisect import numpy as np from torch.utils.data.dataset import ConcatDataset as _ConcatDataset class ConcatDataset(_ConcatDataset): """ Same as torch.utils.data.dataset.ConcatDataset, but exposes an extra method for querying t...
2.734375
3
153_find_minimum_in_rotated_sorted_array.py
gengwg/leetcode
2
12936
# 153. Find Minimum in Rotated Sorted Array # # Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. # # (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). # # Find the minimum element. # # You may assume no duplicate exists in the array. class Solution(object): # http://b...
3.5625
4
tests/bridge/test_bridge.py
shuklaayush/badger-system
99
12937
<reponame>shuklaayush/badger-system<gh_stars>10-100 import pytest from brownie import ( accounts, interface, MockVault, BadgerBridgeAdapter, CurveSwapStrategy, CurveTokenWrapper, ) from helpers.constants import AddressZero from helpers.registry import registry from config.badger_config import b...
2.171875
2
babylon_server/babylon/config.py
ajponte/babylon
0
12938
import os class Config: # Statement for enabling the development environment DEBUG = True # Define the application directory BASE_DIR = os.path.abspath(os.path.dirname(__file__)) # Logging config. LOG_DIR = "logs" LOG_TYPE = ["LOG_TYPE", "watched"] LOG_LEVEL = "DEBUG" APP_LOG_NAM...
2.265625
2
etherscan_py/__init__.py
saltduck/etherscan_py
6
12939
"""Top-level package for etherscan-py.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
1
1
realtime/realtime.py
mikerah13/python_samples
0
12940
from subprocess import Popen, PIPE def run_command(command): process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE) while True: output = process.stdout.readline() if output == '' and process.poll() is not None: break if output: print output.str...
2.96875
3
resources/model/agenda.py
diegohideky/climatempoworkshop
0
12941
from db_connection import db class Agenda(db.Model): __tablename__ = "agendas" id = db.Column(db.Integer, primary_key=True) date = db.Column(db.Date) work_start = db.Column(db.Time) work_end = db.Column(db.Time) rest_start = db.Column(db.Time) rest_end = db.Column(db.Time) user_id = db...
2.359375
2
data/models.py
sarfarazstark/To-Do-Bot
4
12942
<filename>data/models.py """Database models""" from sqlalchemy import orm import sqlalchemy from .db_session import SqlAlchemyBase # Task database model class Task(SqlAlchemyBase): __tablename__ = 'tasks' id = sqlalchemy.Column( sqlalchemy.Integer, primary_key=True, autoincrement=True ) use...
2.609375
3
graduated_site/migrations/0029_auto_20191218_2109.py
vbacaksiz/KTU-MEBSIS
0
12943
<gh_stars>0 # Generated by Django 3.0 on 2019-12-18 21:09 import ckeditor.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('graduated_site', '0028_auto_20191218_2028'), ] operations = [ migrations.AlterField( model_name='user_i...
1.585938
2
tests/test_obj.py
runapp/M2Crypto
58
12944
<gh_stars>10-100 #!/usr/bin/env python """Unit tests for M2Crypto.m2 obj_* functions. """ from M2Crypto import ASN1, BIO, Rand, X509, m2, six from tests import unittest """ These functions must be cleaned up and moved to some python module Taken from CA managment code """ def x509_name2list(name): for i in rang...
2.5
2
new_scraper.py
Baw25/HomeSavvy
0
12945
<reponame>Baw25/HomeSavvy #!/bin/python # -*- coding: utf-8 -*- # Droplet Name: ubuntu-512mb-sfo2-01 # IP Address: 192.168.3.11 # Username: root # Password: <PASSWORD> # New Password: <PASSWORD> # https://medium.com/@hoppy/how-to-test-or-scrape-javascript-rendered-websites-with-python-selenium-a-beginner-step-by-c137...
3.125
3
gdsfactory/simulation/gmeep/__init__.py
gdsfactory/gdsfactory
42
12946
<reponame>gdsfactory/gdsfactory from gdsfactory.simulation.gmeep.add_monitors import add_monitors from gdsfactory.simulation.gmeep.get_simulation import get_simulation from gdsfactory.simulation.gmeep.get_transmission_2ports import ( get_transmission_2ports, plot2D, plot3D, ) from gdsfactory.simulation.gmee...
1.234375
1
coreos-ostree-importer/coreos_ostree_importer.py
dustymabe/fedora-coreos-releng-automation
0
12947
<filename>coreos-ostree-importer/coreos_ostree_importer.py<gh_stars>0 #!/usr/bin/python3 import boto3 import botocore import fedora_messaging import fedora_messaging.api import hashlib import json import logging import os import subprocess import sys import tarfile import tempfile import traceback # Set local logging...
1.609375
2
deepscm/datasets/medical/ukbb.py
mobarakol/deepscm
0
12948
<gh_stars>0 from torch.utils.data.dataset import Dataset import numpy as np import pandas as pd import os import nibabel as nib from nilearn.image import resample_img import torch class UKBBDataset(Dataset): def __init__(self, csv_path, base_path='/vol/biobank/12579/brain/rigid_to_mni/images', crop_type=None, crop...
2.265625
2
external/mmdetection/detection_tasks/extension/utils/pipelines.py
bes-dev/training_extensions
44
12949
# Copyright (C) 2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
2.453125
2
Leetcode/Competition/180_1.py
ZR-Huang/AlgorithmPractices
1
12950
<gh_stars>1-10 from typing import List class Solution: def luckyNumbers (self, matrix: List[List[int]]) -> List[int]: m = len(matrix) n = len(matrix[0]) ans = [] for i in range(m): row_min_index = 0 row_min = 10**5+1 for j in range(n): ...
3.1875
3
GUITests/UC10.sikuli/UC10.py
gabrielganzer/EZGas
0
12951
<reponame>gabrielganzer/EZGas # UC10 - Evaluate price # # User U exists and has valid account # We create two Users, User1_UC10, User2_UC10 and one new gasStation GasStationUC10 # # Registered on a 1920x1080p, Google Chrome 100% zoom ### SETUP #User1 click("1590678880209.png") click("15906...
1.71875
2
basic/migrations/0003_entrypoint_entry_function.py
kgdunn/django-peer-review-system
0
12952
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-27 16:14 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('basic', '0002_auto_20170727_1741'), ] operations = [ migrations.AddField( ...
1.734375
2
test_net_with_srgan.py
jasonlai777/Faster-R-CNN
0
12953
<reponame>jasonlai777/Faster-R-CNN<gh_stars>0 # -------------------------------------------------------- # Pytorch Multi-GPU Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>, <NAME>, based on code from Ross Girshick # -------------------------------------------------------- fr...
1.59375
2
app.py
iio1989/oshite
0
12954
<gh_stars>0 from flask import Flask, render_template, request, redirect, url_for, Markup import app_helper as apHelp app = Flask(__name__) @app.route('/') def root(): return render_template('home.html') # click convetBtn. get HttpParam. @app.route('/post', methods=['GET', 'POST']) def post(): if request.meth...
2.453125
2
build/cls/tp/slices.py
amunoz1/mines
1
12955
""" Makes subdirectories with slices of seismic time or depth images. For example, the directory with name "s3_84" contains a constant-i3 slice, where i3 = 84. """ from tputils import * #setupForSubset("subz_401_4_600") setupForSubset("subt_251_4_500") seismicDir = getSeismicDir() #####################################...
2.96875
3
lldb/examples/summaries/cocoa/NSException.py
bytesnake/Enzyme
427
12956
<filename>lldb/examples/summaries/cocoa/NSException.py """ LLDB AppKit formatters part of The LLVM Compiler Infrastructure This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details. """ # summary provider for class NSException import lldb.runtime.objc.objc_runtime impor...
2.15625
2
pacman-arch/test/pacman/tests/upgrade084.py
Maxython/pacman-for-termux
23
12957
<reponame>Maxython/pacman-for-termux<filename>pacman-arch/test/pacman/tests/upgrade084.py self.description = "Install a package ('any' architecture)" p = pmpkg("dummy") p.files = ["bin/dummy", "usr/man/man1/dummy.1"] p.arch = 'any' self.addpkg(p) self.option["Architecture"] = ['auto'] self.args = "-U %s" ...
2.171875
2
Examples And Benchmarks/HTTP over Raw Connection/SERVERS/http_server__http_tools.py
FI-Mihej/FI-ASockIOCore
0
12958
from simple_network.tcp_app_server import * import httptools """ Module Docstring Docstrings: http://www.python.org/dev/peps/pep-0257/ """ __author__ = 'ButenkoMS <<EMAIL>>' # ====================================================================== # ===================GLOBAL SETTINGS FOR ALL TESTS===================...
2.25
2
bamboomba_description/launch/robot_state_publisher.launch.py
RIF-Robotics/bamboomba
0
12959
<filename>bamboomba_description/launch/robot_state_publisher.launch.py<gh_stars>0 from os import path from launch import LaunchDescription from ament_index_python.packages import get_package_share_directory from launch_ros.actions import Node from launch.actions import DeclareLaunchArgument from launch.substitutions im...
2.25
2
tests/test__event.py
alpha-health-ai/pyformance
4
12960
<filename>tests/test__event.py from pyformance.meters import Event, EventPoint from tests import TimedTestCase class EventTestCase(TimedTestCase): def setUp(self): super(EventTestCase, self).setUp() self.event = Event( clock=TimedTestCase.clock, key="test_event", ...
2.59375
3
problem_#43_30032019.py
vivek28111992/DailyCoding
0
12961
<gh_stars>0 """ Good morning! Here's your coding interview problem for today. This problem was asked by Amazon. Implement a stack that has the following methods: push(val), which pushes an element onto the stack pop(), which pops off and returns the topmost element of the stack. If there are no elements in the stack...
3.890625
4
scrapy/contrib/linkextractors/lxmlhtml.py
emschorsch/scrapy
1
12962
""" Link extractor based on lxml.html """ import lxml.html from scrapy.link import Link from scrapy.utils.python import unique as unique_list class LxmlParserLinkExtractor(object): def __init__(self, tag="a", attr="href", process=None, unique=False): self.scan_tag = tag if callable(tag) else lambda t: t ...
3.03125
3
src/meetings/admin.py
Yalnyra/office-meeting-reservation
0
12963
<reponame>Yalnyra/office-meeting-reservation from django.contrib import admin from .models import Meeting admin.site.register(Meeting)
1.242188
1
app/templates/init.py
arudmin/generator-flask-heroku
0
12964
from flask import Flask, url_for import os app = Flask(__name__) app.config['DEBUG'] = True app.config['SECRET_KEY'] = 'SECRET_KEY_CH1ng3me' # Determines the destination of the build. Only usefull if you're using Frozen-Flask app.config['FREEZER_DESTINATION'] = os.path.dirname(os.path.abspath(__file__))+'/../build' ...
1.929688
2
sigmod2021-exdra-p523/experiments/code/other/l2svm.py
damslab/reproducibility
4
12965
import numpy as np import argparse from sklearn.svm import LinearSVR from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.datasets import make_regression parser = argparse.ArgumentParser() parser.add_argument('-x', '--datapath', type=str, required=True) parser.add_a...
2.625
3
libs/fm_mission_planner/python/fm_mission_planner/target_viz.py
ethz-asl/mav_findmine
3
12966
<filename>libs/fm_mission_planner/python/fm_mission_planner/target_viz.py #!/usr/bin/env python # MIT License # # Copyright (c) 2020 <NAME>, ASL, ETH Zurich, Switzerland # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software...
1.765625
2
capirca/lib/gcp_hf.py
PhillSimonds/capirca
0
12967
<reponame>PhillSimonds/capirca """Google Cloud Hierarchical Firewall Generator. Hierarchical Firewalls (HF) are represented in a SecurityPolicy GCP resouce. """ import copy import re from typing import Dict, Any from absl import logging from capirca.lib import gcp from capirca.lib import nacaddr class ExceededCos...
2.15625
2
src/caracara/_kits.py
LaudateCorpus1/caracara
1
12968
"""Kits class defines the available Toolboxes.""" from enum import Enum class Kits(Enum): """Enumerator for toolbox class name lookups.""" HOSTS = "HostsToolbox" RTR = "RTRToolbox"
2.296875
2
hackerrank/algorithms/time_conversion.py
ontana/mystudy
0
12969
#!/bin/python3 # https://www.hackerrank.com/challenges/time-conversion import sys def timeConversion(s): # Complete this function ar = s.split(':') tail = ar[-1][-2:].lower() addition_hours = 0 if (tail == 'pm' and ar[0] != '12') or (tail == 'am' and ar[0] == '12'): addition_hours ...
4.125
4
supplychainpy/demand/economic_order_quantity.py
supplybi/supplychainpy
5
12970
<filename>supplychainpy/demand/economic_order_quantity.py from decimal import Decimal, getcontext, ROUND_HALF_UP from supplychainpy.demand import analyse_uncertain_demand from supplychainpy.demand.eoq import minimum_variable_cost, economic_order_quantity class EconomicOrderQuantity(analyse_uncertain_demand.UncertainD...
2.625
3
tests/test_arraymisc.py
XinYangDong/mmcv-0.2.10
1
12971
<gh_stars>1-10 from __future__ import division import mmcv import numpy as np import pytest def test_quantize(): arr = np.random.randn(10, 10) levels = 20 qarr = mmcv.quantize(arr, -1, 1, levels) assert qarr.shape == arr.shape assert qarr.dtype == np.dtype('int64') for i in range(arr.shape[0...
1.898438
2
train.py
jmribeiro/NumPyNeuralNetworkFromScratch
1
12972
<filename>train.py #!/usr/bin/env python """ Author: <NAME> """ import argparse import numpy as np from model import FeedForwardNetwork from utils import load_ocr_dataset, plot if __name__ == '__main__': parser = argparse.ArgumentParser() # Hyperparams parser.add_argument('-epochs', default=20, type...
2.875
3
varify/samples/views.py
chop-dbhi/varify
6
12973
from guardian.shortcuts import get_objects_for_user from django.http import Http404, HttpResponseRedirect from django.db.models import Count from django.core.urlresolvers import reverse from django.shortcuts import render, get_object_or_404 from vdw.samples.models import Sample, Project, Batch, Cohort from .forms impor...
2.015625
2
dumbai.py
CapKenway/dumbai
0
12974
import sys from pprint import pprint import os #--------------------------------------------------------------------------# class CsPP(): def __init__(self, domains): self.domains = domains self.maindict = {} self.keyitems = [] pass def check_if(self): emptylist = [] ...
2.90625
3
napari_plugin_test/widgets/warp_image_volume.py
krentzd/napari-test
0
12975
#!/usr/bin/env python3 # coding: utf-8 # Adapted from: https://github.com/zpincus/celltool/blob/master/celltool/numerics/image_warp.py from scipy import ndimage import numpy as np from probreg import bcpd import tifffile import matplotlib.pyplot as plt import napari from magicgui import magic_factory, widgets from nap...
2.265625
2
main/tests/test_celery.py
OpenHumans/oh-23andme-source
0
12976
from django.test import TestCase, RequestFactory import vcr from django.conf import settings from django.core.management import call_command from open_humans.models import OpenHumansMember from main.celery import read_reference, clean_raw_23andme from main.celery_helper import vcf_header import os import tempfile impor...
2.34375
2
apps/tracking/admin.py
Codeidea/budget-tracker
0
12977
<reponame>Codeidea/budget-tracker from django.contrib import admin from .models import LogCategory, BudgetLog # Register your models here. admin.site.register(LogCategory) admin.site.register(BudgetLog)
1.210938
1
nn_model/embedding_layer.py
onlyrico/mling_sdgms
4
12978
# -*- coding: UTF-8 -*- #!/usr/bin/python3 """ Embedding Layer """ #************************************************************ # Imported Libraries #************************************************************ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from gensim.models i...
2.65625
3
grpclib/server.py
panaetov/grpclib
0
12979
import abc import socket import logging import asyncio import warnings import h2.config import h2.exceptions from .utils import DeadlineWrapper from .const import Status from .stream import send_message, recv_message from .stream import StreamIterator from .metadata import Metadata, Deadline from .protocol import H2P...
2.8125
3
examples/vector_dot.py
Wheest/EVA
0
12980
#!/usr/bin/env python import argparse from eva import EvaProgram, Input, Output from eva.ckks import CKKSCompiler from eva.seal import generate_keys import numpy as np import time from eva.std.numeric import horizontal_sum def dot(x, y): return np.dot(x, y) def generate_inputs_naive(size, label="x"): inputs...
2.90625
3
ramcache.py
Lopez6969/chromium-dashboard
0
12981
from __future__ import division from __future__ import print_function # -*- coding: utf-8 -*- # Copyright 2020 Google 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.a...
2.203125
2
src/sales/migrations/0029_auto_20191025_1058.py
vladimirtkach/yesjob
0
12982
<filename>src/sales/migrations/0029_auto_20191025_1058.py # Generated by Django 2.2 on 2019-10-25 10:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sales', '0028_auto_20191024_1736'), ] operations = [ migrations.AlterField( ...
1.210938
1
maintenance/pymelControlPanel.py
GlenWalker/pymel
0
12983
""" UI for controlling how api classes and mel commands are combined into pymel classes. This UI modifies factories.apiToMelData which is pickled out to apiMelBridge. It controls: which mel methods correspond to api methods disabling of api methods preference for overloaded methods (since currently only o...
2.46875
2
src/test/data/pa3/sample/list_get_element_oob_3.py
Leo-Enrique-Wu/chocopy_compiler_code_generation
7
12984
<filename>src/test/data/pa3/sample/list_get_element_oob_3.py x:[int] = None x = [] print(x[0])
1.476563
1
modules/vqvc/__init__.py
reppy4620/VCon
4
12985
from .model import VQVCModel from .pl_model import VQVCModule
1.085938
1
kornia/constants.py
carlosb1/kornia
1
12986
<gh_stars>1-10 from typing import Union, TypeVar from enum import Enum import torch pi = torch.tensor(3.14159265358979323846) T = TypeVar('T', bound='Resample') U = TypeVar('U', bound='BorderType') class Resample(Enum): NEAREST = 0 BILINEAR = 1 BICUBIC = 2 @classmethod def get(cls, value: Union...
2.328125
2
intrepyd/tests/test_openplc.py
bobosoft/intrepyd
2
12987
import intrepyd from intrepyd.iec611312py.plcopen import parse_plc_open_file from intrepyd.iec611312py.stmtprinter import StmtPrinter import unittest from . import from_fixture_path class TestOpenPLC(unittest.TestCase): def test_simple_1(self): pous = parse_plc_open_file(from_fixture_path('openplc/simple1....
2.34375
2
reveal_graph_embedding/datautil/asu_datautil/asu_read_data.py
MKLab-ITI/reveal-graph-embedding
31
12988
<gh_stars>10-100 __author__ = '<NAME> (<EMAIL>)' import numpy as np import scipy.sparse as sparse from reveal_graph_embedding.common import get_file_row_generator def read_adjacency_matrix(file_path, separator): """ Reads an edge list in csv format and returns the adjacency matrix in SciPy Sparse COOrdinate...
3.296875
3
create_tweet_classes.py
jmcguinness11/StockPredictor
0
12989
# create_tweet_classes.py # this assumes the existence of a get_class(day, hour, ticker) function # that returns the class (0, 1, or -1) for a given hour and ticker import collections import json import random refined_tweets = collections.defaultdict(list) #returns label for company and time def getLabel(ticker, mon...
3.109375
3
integration_tests/test_router.py
madfish-solutions/quipuswap-token2token-core
0
12990
from unittest import TestCase import json from helpers import * from pytezos import ContractInterface, pytezos, MichelsonRuntimeError from pytezos.context.mixin import ExecutionContext token_a = "<KEY>" token_b = "<KEY>" token_c = "<KEY>" token_d = "<KEY>" pair_ab = { "token_a_type" : { "fa2": { ...
2.078125
2
practice/practice_perfect/ex7.py
recursivelycurious/wordnik-repl
0
12991
def remove_duplicates(lst): new = [] for x in lst: if x not in new: new.append(x) return new
3.65625
4
run.py
evilspyboy/twitch-relay-monitor
1
12992
<reponame>evilspyboy/twitch-relay-monitor<gh_stars>1-10 import datetime from datetime import timedelta import pprint from config import * from helper import * import time import logging from logging.handlers import RotatingFileHandler logger = logging.getLogger('Twitch Relay Monitor') logger.setLevel(logging.DEBUG) ha...
2.46875
2
aiassistants/assistants/ptype/src/Config.py
wrattler/wrattler
56
12993
class Config: # helps to store settings for an experiment. def __init__(self, _experiments_folder_path='experiments', _dataset_name='dataset', _column_names='unknown', _types={1:'integer', 2:'string', 3:'float', 4:'boolean', 5:'gender', 6:'unknown', 7:'date-iso-8601', 8:'date-eu', 9:'date-non-s...
2.65625
3
rbc/tests/test_omnisci_array.py
guilhermeleobas/rbc
0
12994
import os from collections import defaultdict from rbc.omnisci_backend import Array from rbc.errors import OmnisciServerError from numba import types as nb_types import pytest rbc_omnisci = pytest.importorskip('rbc.omniscidb') available_version, reason = rbc_omnisci.is_available() pytestmark = pytest.mark.skipif(not a...
1.71875
2
env/lib/python3.8/site-packages/unidecode/x093.py
avdhari/enigma
48
12995
<filename>env/lib/python3.8/site-packages/unidecode/x093.py<gh_stars>10-100 data = ( 'Lun ', # 0x00 'Kua ', # 0x01 'Ling ', # 0x02 'Bei ', # 0x03 'Lu ', # 0x04 'Li ', # 0x05 'Qiang ', # 0x06 'Pou ', # 0x07 'Juan ', # 0x08 'Min ', # 0x09 'Zui ', # 0x0a 'Peng ', # 0x0b 'An ', # 0x0c...
1.484375
1
src/core/default/commands/bucket/utils.py
cdev-framework/cdev-sdk
2
12996
from dataclasses import dataclass import re from tokenize import group from core.constructs.resource import ResourceModel from core.constructs.workspace import Workspace RUUID = "cdev::simple::bucket" def get_cloud_output_from_cdev_name(component_name: str, cdev_name: str) -> str: try: ws = Workspace.in...
2.484375
2
examples/blank_cylinders.py
reflectometry/osrefl
2
12997
<reponame>reflectometry/osrefl from greens_thm_form import greens_form_line, greens_form_shape from numpy import arange, linspace, float64, indices, zeros_like, ones_like, pi, sin, complex128, array, exp, newaxis, cumsum, sum, cos, sin, log, log10 from osrefl.theory.DWBAGISANS import dwbaWavefunction class shape: ...
2.46875
2
EXAMPLE/test_backtest/MACD_JCSC.py
evsteel/QUANTAXIS
2
12998
# -*- coding: utf-8 -*- # Demo: MACD strategy # src: ./test_backtest/MACD_JCSC.py # jupyter: ./test_backtest/QUANTAXIS回测分析全过程讲解.ipynb # paper: ./test_backtest/QUANTAXIS回测分析全过程讲解.md import QUANTAXIS as QA import numpy as np import pandas as pd import datetime st1=datetime.datetime.now() # define the MACD strategy def M...
2.375
2
tests/zquantum/qaoa/ansatzes/farhi_ansatz_test.py
zapatacomputing/z-quantum-qaoa
3
12999
<gh_stars>1-10 from zquantum.core.interfaces.ansatz_test import AnsatzTests from zquantum.core.circuits import Circuit, H, RX, RZ from zquantum.core.utils import compare_unitary from zquantum.core.openfermion import change_operator_type from zquantum.qaoa.ansatzes.farhi_ansatz import ( QAOAFarhiAnsatz, create_f...
2.03125
2