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
cracking_the_coding_interview_qs/8.7-8.8/get_all_permutations_of_string_test.py
angelusualle/algorithms
0
18200
<filename>cracking_the_coding_interview_qs/8.7-8.8/get_all_permutations_of_string_test.py import unittest from get_all_permutations_of_string import get_all_permutations_of_string, get_all_permutations_of_string_with_dups class Test_Case_Get_All_Permutations_Of_String(unittest.TestCase): def test_get_all_permutati...
3.640625
4
third-party/webscalesqlclient/mysql-5.6/xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_partial_test.py
hkirsman/hhvm_centos7_builds
2
18201
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 <NAME> # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Found...
2.125
2
filter.py
Gerrydh/MPP-Recursion
0
18202
print filter((lambda x: (x%2) ==0 ), [1,2,3,4,5,6]) print filter((lambda x: (x%2) !=0 ), [1,2,3,4,5,6])
3.125
3
project euler/q2.py
milkmeat/thomas
0
18203
l=[0]*100 l[0]=1 l[1]=2 for x in range (2,100): l[x]=l[x-1]+l[x-2] #print l f=0 for c in l: if c%2==0 and c<4000000: f=f+c print f
2.84375
3
recipes/LibriSpeech/ASR/CTC/train_with_wav2vec.py
mj-kh/speechbrain
3,913
18204
#!/usr/bin/env/python3 """Recipe for training a wav2vec-based ctc ASR system with librispeech. The system employs wav2vec as its encoder. Decoding is performed with ctc greedy decoder. To run this recipe, do the following: > python train_with_wav2vec.py hparams/train_with_wav2vec.yaml The neural network is trained on C...
2.84375
3
src/dask_awkward/tests/test_utils.py
douglasdavis/dask-awkward
21
18205
<reponame>douglasdavis/dask-awkward from __future__ import annotations from ..utils import normalize_single_outer_inner_index def test_normalize_single_outer_inner_index() -> None: divisions = (0, 12, 14, 20, 23, 24) indices = [0, 1, 2, 8, 12, 13, 14, 15, 17, 20, 21, 22] results = [ (0, 0), ...
2.4375
2
core/client_socket.py
schalekamp/ibapipy
1
18206
<filename>core/client_socket.py """Implements the EClientSocket interface for the Interactive Brokers API.""" import threading import ibapipy.config as config from ibapipy.core.network_handler import NetworkHandler class ClientSocket: """Provides methods for sending requests to TWS.""" def __init__(self): ...
2.609375
3
common.py
shawnau/DataScienceBowl2018
0
18207
<filename>common.py<gh_stars>0 import os from datetime import datetime PROJECT_PATH = os.path.dirname(os.path.realpath(__file__)) IDENTIFIER = datetime.now().strftime('%Y-%m-%d_%H-%M-%S') #numerical libs import numpy as np import random import matplotlib matplotlib.use('TkAgg') import cv2 # torch libs import torc...
1.984375
2
NumberExtractor.py
Dikshit15/SolveSudoku
54
18208
<filename>NumberExtractor.py import numpy as np import cv2 import matplotlib.pyplot as plt import numpy as np from keras.models import model_from_json # Load the saved model json_file = open('models/model.json', 'r') loaded_model_json = json_file.read() json_file.close() loaded_model = model_from_json(loaded_model_jso...
3.15625
3
code/Rts.py
andreschristen/RTs
0
18209
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue May 12 18:28:54 2020 @author: Dr <NAME> (CIMAT-CONACYT, Mexico) jac at cimat.mx Instantaneous reproduction numbers calculations. Rts_P, Implementation of Cori et al (2013) Rts_AR, new filtering version using an autoregressive linear model of Capistrá...
2.1875
2
zombieclusters.py
tnkteja/notthisagain
0
18210
<filename>zombieclusters.py class cluster(object): def __init__(self,members=[]): self.s=set(members) def merge(self, other): self.s.union(other.s) return self class clusterManager(object): def __init__(self,clusters={}): self.c=clusters def merge(self, i, j): ...
3.1875
3
CondTools/Ecal/python/EcalO2O_laser_online_cfg.py
SWuchterl/cmssw
6
18211
import FWCore.ParameterSet.Config as cms process = cms.Process("ProcessOne") process.load("CondCore.DBCommon.CondDBCommon_cfi") process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' # # Choose the output database # process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_42X_ECAL_...
1.570313
2
algofi/v1/staking.py
zhengxunWu3/algofi-py-sdk
0
18212
from algosdk import logic from algosdk.future.transaction import ApplicationOptInTxn, AssetOptInTxn, ApplicationNoOpTxn, PaymentTxn, AssetTransferTxn from ..contract_strings import algofi_manager_strings as manager_strings from .prepend import get_init_txns from ..utils import TransactionGroup, Transactions, randint, i...
2.09375
2
main.py
kirantambe/koinex-status-ticker
0
18213
import rumps import requests import json API_URL = 'https://koinex.in/api/ticker' UPDATE_INTERVAL = 60 CURRENCIES = { 'Bitcoin': 'BTC', 'Ethereum': 'ETH', 'Ripple': 'XRP', 'Litecoin': 'LTC', 'Bitcoin Cash': 'BCH', } class KoinexStatusBarApp(rumps.App): def __init__(self): super(Koin...
2.578125
3
app.py
migueljunior/docker
0
18214
<gh_stars>0 from flask import Flask, jsonify from time import strftime from socket import gethostname from socket import gethostbyname app = Flask(__name__) @app.route('/') def welcome(): message = 'Please add /docker after the port 8888' return message @app.route('/docker') def docker(): currentDate =...
2.8125
3
knn_and_regression/src/free_response.py
WallabyLester/Machine_Learning_From_Scratch
0
18215
import numpy as np from numpy.core.fromnumeric import mean from numpy.core.numeric import True_ from numpy.testing._private.utils import rand from polynomial_regression import PolynomialRegression from generate_regression_data import generate_regression_data from metrics import mean_squared_error # mse from math impor...
3.0625
3
chapter10/exercises/EG10-20 Twinkle Twinkle classes.py
munnep/begin_to_code_with_python
0
18216
# EG10-20 Twinkle Twinkle classes import time import snaps class Note: def __init__(self, note, duration): self.__note = note self.__duration = duration def play(self): snaps.play_note(self.__note) time.sleep(self.__duration) tune = [Note(note=0, duration=0.4), Note(note=0, d...
2.765625
3
tests/python/gpu/test_forward.py
xudong-sun/mxnet
31
18217
<filename>tests/python/gpu/test_forward.py # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, V...
1.960938
2
docs/src/conf.py
rbeucher/LavaVu
23
18218
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # LavaVu conf based on conf.py from underworld2 # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------...
1.203125
1
experiments/pamogk_exp.py
tastanlab/pamogk
6
18219
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import collections import mkkm_mr import networkx as nx from sklearn.cluster import KMeans, SpectralClustering from snf_simple import SNF from pamogk import config from pamogk import label_mapper from pamogk.data_processor import rnaseq_processor as rp, synapse_rppa_pro...
1.96875
2
d3network/data/handschriftencensus_scrap.py
GusRiva/GusRiva
0
18220
<gh_stars>0 import requests from lxml import html from bs4 import BeautifulSoup import json import codecs import re #In this variable I will store the information as a dictionary with this structure: # {number : "Name"} ms_dict = {} links_dict = {"links" : []} for index in range(1,27000): print(index) page = requ...
2.890625
3
tests/emukit/quadrature/test_quadrature_acquisitions.py
alexgessner/emukit
6
18221
<reponame>alexgessner/emukit # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import numpy as np import pytest import GPy from math import isclose from emukit.model_wrappers.gpy_quadrature_wrappers import QuadratureRBF, RBFGPy, BaseGaussianProcessGPy fro...
1.953125
2
tests/test_ProtocolService/test_ProtocolService.py
danilocgsilva/awsinstances
0
18222
<filename>tests/test_ProtocolService/test_ProtocolService.py import unittest import sys sys.path.insert(2, "..") from awsec2instances_includes.ProtocolService import ProtocolService class test_ProtocolService(unittest.TestCase): def test_execption_wrong_argument(self): wrong_argument = "some-invalid" ...
3.046875
3
mltoolkit/mldp/utils/helpers/nlp/token_matching.py
mancunian1792/FewSum
28
18223
from .constants import SPECIAL_TOKENS try: import re2 as re except ImportError: import re def twitter_sentiment_token_matching(token): """Special token matching function for twitter sentiment data.""" if 'URL_TOKEN' in SPECIAL_TOKENS and re.match(r'https?:\/\/[^\s]+', token): return SPECIAL_TO...
3.09375
3
setup.py
geirem/pyconfig
1
18224
<filename>setup.py """A setuptools based setup module. See: https://packaging.python.org/guides/distributing-packages-using-setuptools/ """ from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: l...
1.726563
2
pybamm/solvers/scipy_solver.py
danieljtait/PyBaMM
0
18225
# # Solver class using Scipy's adaptive time stepper # import casadi import pybamm import scipy.integrate as it import numpy as np class ScipySolver(pybamm.BaseSolver): """Solve a discretised model, using scipy._integrate.solve_ivp. Parameters ---------- method : str, optional The method to ...
2.953125
3
crits/core/fields.py
dutrow/crits
738
18226
import datetime from dateutil.parser import parse from mongoengine import DateTimeField, FileField from mongoengine.connection import DEFAULT_CONNECTION_NAME #from mongoengine.python_support import str_types from six import string_types as str_types import io from django.conf import settings if settings.FILE_DB == se...
2.25
2
custom_uss/custom_widgets/outlog.py
shuanet/dss
2
18227
<filename>custom_uss/custom_widgets/outlog.py<gh_stars>1-10 import sys from PySide6 import QtGui class OutLog: def __init__(self, edit, out=None, color=None): """(edit, out=None, color=None) -> can write stdout, stderr to a QTextEdit. edit = QTextEdit out = alternate stream ( can be...
2.671875
3
2020/day07/day07.py
maxschalz/advent_of_code
0
18228
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re import unittest COLOR = "shiny gold" FNAME = "input.txt" N_ITER = 1e7 TEST_FNAME = "test_input.txt" def main(): """Main function.""" data = load_input(FNAME) part1(data) part2(data) print("\nUnittests") unittest.main() def part1(d...
3.796875
4
cluster/image/pro_seafile_7.1/scripts_7.1/start.py
chaosbunker/seafile-docker
503
18229
#!/usr/bin/env python3 #coding: UTF-8 import os import sys import time import json import argparse from os.path import join, exists, dirname from upgrade import check_upgrade from utils import call, get_conf, get_script, get_command_output, get_install_dir installdir = get_install_dir() topdir = dirname(installdir) ...
1.914063
2
codit/stats/de_duplication_stat.py
saikat107/OpenNMT-py
0
18230
import sys, os import nltk import numpy as np class Patch(): def __init__(self): self.id = -1 self.parent_code = '' self.child_code = '' self.patches = [] self.verdict = False self.distance = 0 self.verdict_token = False pass def __repr__(self): ...
2.65625
3
pysnark/qaptools/runqapgen.py
Charterhouse/pysnark
65
18231
# Copyright (c) 2016-2018 <NAME>. All rights reserved. A # copyright license for redistribution and use in source and binary forms, # with or without modification, is hereby granted for non-commercial, # experimental and research purposes, provided that the following conditions # are met: # - Redistributions of source ...
1.28125
1
tubee/utils/__init__.py
tomy0000000/Tubee
8
18232
<filename>tubee/utils/__init__.py """Helper Functions Some Misc Functions used in this app """ import secrets import string from functools import wraps from urllib.parse import urljoin, urlparse from dateutil import parser from flask import abort, current_app, request from flask_login import current_user from flask_m...
2.25
2
HourlyCrime/hour.py
pauljrodriguezcs/Chicago_Crime_Analysis
1
18233
<filename>HourlyCrime/hour.py<gh_stars>1-10 import numpy as np import matplotlib import matplotlib.pyplot as plt import scipy.linalg as la print("loading time series... ") plt.figure(figsize=(16,9)) timeSeries = np.loadtxt('TheftTS.txt',delimiter=',',dtype=float) # load data hourly = timeSeries[:,0] plt.plot(hourly,'...
2.859375
3
scripts/annotation_csv.py
RulerOf/keras-yolo3
37
18234
<gh_stars>10-100 """ Creating training file from own custom dataset >> python annotation_csv.py \ --path_dataset ~/Data/PeopleDetections \ --path_output ../model_data """ import os import sys import glob import argparse import logging import pandas as pd import tqdm sys.path += [os.path.abspath('.'), os.pat...
2.609375
3
Assignment_2/one_vs_one.py
hthuwal/mcs-ml-assignments
3
18235
<filename>Assignment_2/one_vs_one.py from pegasos import bgd_pegasos import numpy as np import pandas as pd import pickle import sys def read_data(file): x = pd.read_csv(file, header=None) if x.shape[1] > 784: y = np.array(x[[784]]).flatten() x = x.drop(columns=[784]) else: y = np...
2.75
3
tools/numpy-examples.py
martinahogg/machinelearning
2
18236
<reponame>martinahogg/machinelearning<filename>tools/numpy-examples.py import numpy as np # Inner (or dot) product a = np.array([1,2]) b = np.array([3,4]) np.inner(a, b) a.dot(b) # Outer product a = np.array([1,2]) b = np.array([3,4]) np.outer(a, b) # Inverse m = np.array([[1,2], [3,4]]) np.linalg.inv(m) # Inner (...
3.203125
3
src/relstorage/tests/util.py
lungj/relstorage
0
18237
import os import platform import unittest # ZODB >= 3.9. The blob directory can be a private cache. shared_blob_dir_choices = (False, True) RUNNING_ON_TRAVIS = os.environ.get('TRAVIS') RUNNING_ON_APPVEYOR = os.environ.get('APPVEYOR') RUNNING_ON_CI = RUNNING_ON_TRAVIS or RUNNING_ON_APPVEYOR def _do_not_skip(reason):...
2.125
2
sktime/datatypes/_panel/_examples.py
marcio55afr/sktime
5,349
18238
<filename>sktime/datatypes/_panel/_examples.py<gh_stars>1000+ # -*- coding: utf-8 -*- """Example generation for testing. Exports dict of examples, useful for testing as fixtures. example_dict: dict indexed by triple 1st element = mtype - str 2nd element = considered as this scitype - str 3rd element = int - ind...
2.71875
3
ipfnlite/get_los_diaggeom.py
guimarais/AUGlite
0
18239
<filename>ipfnlite/get_los_diaggeom.py<gh_stars>0 #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jul 9 15:34:36 2019 @author: eseliuni """ from __future__ import print_function #from builtins import str #from builtins import range import os def get_coordinate_from_line(coordinate, line): """ ...
3.125
3
src/mock/webrepl.py
hipek/esp32-heating-control
0
18240
<reponame>hipek/esp32-heating-control def start(password=<PASSWORD>): pass
1.054688
1
app.py
univoid/a3x
0
18241
<reponame>univoid/a3x import os import base64 import botocore import boto3 import json import urllib from chalice import BadRequestError from chalice import ChaliceViewError from chalice import Chalice app = Chalice(app_name='a3x') app.debug = True REGION = 'us-east-1' BUCKET = 'freko-001' S3 = boto3.resource('s3') ...
2.1875
2
nnutils/laplacian_loss.py
lolrudy/GPV_pose
10
18242
<filename>nnutils/laplacian_loss.py # -------------------------------------------------------- # Written by <NAME> (https://github.com/JudyYe) # -------------------------------------------------------- from __future__ import print_function from __future__ import absolute_import from __future__ import division # Copyrig...
2.640625
3
bioimageio/spec/commands.py
esgomezm/spec-bioimage-io
0
18243
<reponame>esgomezm/spec-bioimage-io import shutil import traceback from pathlib import Path from pprint import pprint from typing import List, Optional, Union from marshmallow import ValidationError from bioimageio.spec import export_resource_package, load_raw_resource_description from bioimageio.spec.shared.raw_node...
2
2
pettingzoo/test/max_cycles_test.py
RedTachyon/PettingZoo
846
18244
<filename>pettingzoo/test/max_cycles_test.py import numpy as np def max_cycles_test(mod): max_cycles = 4 parallel_env = mod.parallel_env(max_cycles=max_cycles) observations = parallel_env.reset() dones = {agent: False for agent in parallel_env.agents} test_cycles = max_cycles + 10 # allows envir...
2.484375
2
models/models.py
nv-tlabs/DIB-R-Single-Image-3D-Reconstruction
8
18245
''' MIT License Copyright (c) 2020 Autonomous Vision Group (AVG), Max Planck Institute for Intelligent Systems Tübingen 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, inclu...
1.140625
1
slixmpp/plugins/xep_0223.py
marconfus/slixmpp
0
18246
""" Slixmpp: The Slick XMPP Library Copyright (C) 2012 <NAME>, <NAME> This file is part of Slixmpp. See the file LICENSE for copying permission. """ import logging from slixmpp.xmlstream import register_stanza_plugin from slixmpp.plugins.base import BasePlugin, register_plugin log = logging.getLogg...
2.15625
2
merge_pdf/merge.py
DariHernandez/merge_pdf
0
18247
#! python3 # Combines all the pafs in the current working directory into a single pdf import PyPDF2, os, sys, logging class Merge (): """ Merge all pdfs in the current folder, or specific list of files, by name, into a single pdf file """ def __init__ (self, file_output = "", replace = False, d...
3.515625
4
test/inprogress/mock/JobBrowserBFF_get_job_log_mock_test.py
eapearson/kbase-skd-module-job-browser-bff
0
18248
# -*- coding: utf-8 -*- import traceback from JobBrowserBFF.TestBase import TestBase from biokbase.Errors import ServiceError import unittest import re UPSTREAM_SERVICE = 'mock' ENV = 'mock' JOB_ID_WITH_LOGS = '59820c93e4b06f68bf751eeb' # non-admin JOB_ID_NO_LOGS = '5cf1522aaa5a4d298c5dc2ff' # non-admin JOB_ID_NOT_F...
1.976563
2
migrations/versions/323f8d77567b_index_related_entity_names.py
yaelmi3/backslash
17
18249
"""Index related entity names Revision ID: 323f8d77567b Revises: 82b34e2<PASSWORD> Create Date: 2016-11-16 13:00:25.782487 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '82b34e2777a4' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by...
1.34375
1
learn/02week/code/cc_dicegame.py
tmax818/nucamp_intro_python
0
18250
import random high_score = 0 def dice_game(): global high_score while True: print("Current High Score: ", high_score) print("1) Roll Dice") print("2) Leave Game") choice = input("Enter your choice: ") if choice == "2": print("Goodbye") break ...
4.03125
4
tests/development/destination/gcs/test_delete_bucket.py
denssk/backup
69
18251
<reponame>denssk/backup<filename>tests/development/destination/gcs/test_delete_bucket.py def test_delete_bucket(gs): gs.delete_bucket()
1.289063
1
SVS/model/utils/utils.py
ftshijt/SVS_system
0
18252
<reponame>ftshijt/SVS_system """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 or agree...
1.523438
2
run_classifier.py
to-aoki/my-pytorch-bert
21
18253
# Author <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # di...
2.125
2
dev/urls.py
ledgku/utilscombine
2
18254
from django.urls import path from dev.views import FindMyIp,FindMyGps app_name = 'dev' urlpatterns = [ # path('', Main.as_view(), name = 'index'), path('findmyip', FindMyIp.as_view(), name = 'findmyip'), path('findmygps', FindMyGps.as_view(), name = 'findmygps'), ]
1.71875
2
cookbook/c02/p17_html_xml.py
itpubs/python3-cookbook
3
18255
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ Topic: 处理html和xml文本 Desc : """ import html def html_xml(): s = 'Elements are written as "<tag>text</tag>".' print(s) print(html.escape(s)) # Disable escaping of quotes print(html.escape(s, quote=False)) s = 'Spicy Jalapeño' print(s.enc...
2.90625
3
utils/__init__.py
Rfam/rfam-production
7
18256
<gh_stars>1-10 __all__ = ['db_utils', 'RfamDB', 'parse_taxbrowser']
1.070313
1
jina/drivers/craft.py
slettner/jina
0
18257
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" from typing import Optional from . import FlatRecursiveMixin, BaseExecutableDriver, DocsExtractUpdateMixin class CraftDriver(DocsExtractUpdateMixin, FlatRecursiveMixin, BaseExecutableDriver): """Drivers inherit...
2.203125
2
solutionbox/structured_data/mltoolbox/_structured_data/preprocess/local_preprocess.py
freyrsae/pydatalab
198
18258
<gh_stars>100-1000 # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
2.453125
2
habitrac/habits/api/resolvers.py
IgnisDa/habitrac
0
18259
<gh_stars>0 import datetime import json from ariadne import MutationType, QueryType, convert_kwargs_to_snake_case from ariadne_token_auth.decorators import login_required from django.contrib.auth import get_user_model from habits import models as habit_models from utils.general import get_user from utils.handlers.erro...
2.234375
2
src/target_matrix.py
smusali/rightwhalerecognition
0
18260
import csv, pylab as pl, re DB = dict(); BD = dict(); whales_ = []; classes = []; line_num = 0; with open('data/train.csv', 'rb') as train_class_data: data = csv.reader(train_class_data, delimiter=','); for line in data: if (line_num == 0): line_num += 1; continue; keys...
2.359375
2
src/fsec/yammler.py
HiggsHydra/permian-frac-exchange
0
18261
<reponame>HiggsHydra/permian-frac-exchange from typing import Union from datetime import datetime import os import tempfile from contextlib import contextmanager import logging from collections import Counter import yaml logger = logging.getLogger(__name__) class Yammler(dict): _no_dump = ["changed"] _metav...
2.25
2
pricecalc/pricecalc/apps/calc/migrations/0024_ldstp_alter_furnitureincalc_options.py
oocemb/Calculation
0
18262
<filename>pricecalc/pricecalc/apps/calc/migrations/0024_ldstp_alter_furnitureincalc_options.py<gh_stars>0 # Generated by Django 4.0.2 on 2022-03-25 11:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('calc', '0023_delete_handle_alter_calctag_options_an...
1.242188
1
aiida_siesta/calculations/stm.py
mailhexu/aiida_siesta_plugin
0
18263
<reponame>mailhexu/aiida_siesta_plugin # -*- coding: utf-8 -*- import os # Module with fdf-aware dictionary from tkdict import FDFDict from aiida.orm.calculation.job import JobCalculation from aiida.common.exceptions import InputValidationError from aiida.common.datastructures import CalcInfo from aiida.common.utils ...
1.820313
2
backend/api/fixtures/test/functional_test/load_ft_data.py
amichard/tfrs
18
18264
<filename>backend/api/fixtures/test/functional_test/load_ft_data.py import uuid import os from datetime import datetime from django.db import transaction from api.management.data_script import OperationalDataScript from api.models.CompliancePeriod import CompliancePeriod from api.models.Organization import Organizat...
2
2
challenge/agoda_cancellation_prediction.py
ZebraForce9/IML.HUJI
0
18265
<reponame>ZebraForce9/IML.HUJI from challenge.agoda_cancellation_estimator import AgodaCancellationEstimator from IMLearn.utils import split_train_test from IMLearn.base import BaseEstimator import numpy as np import pandas as pd def load_data(filename: str): """ Load Agoda booking cancellation dataset P...
2.703125
3
example2.py
presidento/scripthelper
0
18266
<reponame>presidento/scripthelper<filename>example2.py #!/usr/bin/env python3 import scripthelper scripthelper.add_argument("-n", "--name", help="Name to greet") logger, args = scripthelper.bootstrap_args() if args.name: logger.debug("Name was provided") logger.info(f"Hello {args.name}") else: logger.warn...
2.578125
3
Chapter 01/Chap01_Example1.40.py
Anancha/Programming-Techniques-using-Python
0
18267
<filename>Chapter 01/Chap01_Example1.40.py<gh_stars>0 #backslash and new line ignored print("one\ two\ three")
1.9375
2
turbo_seti/find_event/find_event_pipeline.py
savinshynu/turbo_seti
0
18268
<reponame>savinshynu/turbo_seti<gh_stars>0 #!/usr/bin/env python r""" Front-facing script to find drifting, narrowband events in a set of generalized cadences of ON-OFF radio SETI observations. The main function contained in this file is :func:`find_event_pipeline` calls find_events from find_events.py to read a list...
2.34375
2
scripts/plot_snaps.py
wordsworthgroup/libode
11
18269
import numpy as np import matplotlib.pyplot as plt #Dahlquist test #sol1ex = lambda t: np.exp(-t) #sol2ex = lambda t: np.exp(-2*t) #oscillator 1 sol1ex = lambda t: np.cos(t**2/2) sol2ex = lambda t: np.sin(t**2/2) #oscillator 2 #sol1ex = lambda t: np.exp(np.sin(t**2)) #sol2ex = lambda t: np.exp(np.cos(t**2)) name = 'O...
2.53125
3
mne/datasets/kiloword/__init__.py
fmamashli/mne-python
1,953
18270
"""MNE visual_92_categories dataset.""" from .kiloword import data_path, get_version
0.871094
1
app/framework/tagger_framework/tagger/pos/evaluation.py
kislerdm/nlp_pos_demo
0
18271
<filename>app/framework/tagger_framework/tagger/pos/evaluation.py # <NAME> © 2020-present # www.dkisler.com from typing import List, Dict from sklearn.metrics import f1_score, accuracy_score def model_performance(y_true: List[List[str]], y_pred: List[List[str]]) -> Dict[str, float]: """Accu...
2.5625
3
tools/interpret.py
Notgnoshi/generative
5
18272
#!/usr/bin/env python3 """Interpret an L-String as a set of 3D Turtle commands and record the turtle's path. Multiple lines of input will be treated as a continuation of a single L-String. Default commandset: F,G - Step forward while drawing f,g - Step forward without drawing -,+ - Yaw around the normal ...
2.78125
3
PointsToRobot.py
chuong/robot-arm-manipulation
0
18273
""" @author: yuboya """ ### pins position to be sent to robot ## from TransformationCalculation: import numpy as np import math def PointsToRobot(alpha, deltax,deltay,deltaz,xyzc): sina = math.sin(alpha) cosa = math.cos(alpha) pointrs = [] for pointc in xyzc: # ...
2.828125
3
plugins/module_utils/github_api.py
zp4rker/ansible-github-api
0
18274
import requests import json from json import JSONDecodeError base_uri = "https://api.github.com/" licenses = ['afl-3.0', 'apache-2.0', 'artistic-2.0', 'bsl-1.0', 'bsd-2-clause', 'license bsd-3-clause', 'bsd-3-clause-clear', 'cc', 'cc0-1.0', 'cc-by-4.0', 'cc-by-sa-4.0', 'wtfpl', 'ecl-2.0', 'epl-1.0', 'epl-2.0', 'eu...
2.78125
3
src/onegov/core/datamanager.py
politbuero-kampagnen/onegov-cloud
0
18275
import os import tempfile import transaction from onegov.core import log from onegov.core.utils import safe_move class MailDataManager(object): """ Takes a postman and an envelope and sends it when the transaction is commited. Since we can't really know if a mail can be sent until it happens, we sim...
2.671875
3
djangocms_modules/models.py
crydotsnake/djangocms-modules
8
18276
from django.conf import settings from django.db import models from django.dispatch import receiver from django.urls import Resolver404, resolve from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ from cms import operations from cms.models import CMSPlugin, Placeho...
1.8125
2
do_tasks.py
youqingkui/zhihufav
0
18277
#!/usr/bin/env python #coding=utf-8 import json from lib.sqs import zhihufav_sqs from lib.tasks import add_note def get_sqs_queue(): sqs_info = zhihufav_sqs.get_messages(10) for sqs in sqs_info: sqs_body = sqs.get_body() receipt_handle = sqs.receipt_handle sqs_json = json.loads(sqs_bo...
2.265625
2
books/SystemProgramming/ch4_advanced/echo_command.py
zeroam/TIL
0
18278
from subprocess import Popen, PIPE cmd = "echo hello world" p = Popen(cmd, shell=True, stdout=PIPE) ret, err = p.communicate()
2.5625
3
NiaPy/algorithms/basic/bbfwa.py
Flyzoor/NiaPy
0
18279
<gh_stars>0 # encoding=utf8 # pylint: disable=mixed-indentation, trailing-whitespace, multiple-statements, attribute-defined-outside-init, logging-not-lazy import logging from numpy import apply_along_axis, argmin from NiaPy.algorithms.algorithm import Algorithm logging.basicConfig() logger = logging.getLogger('NiaPy....
2.234375
2
ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/ripng_template.py
Vibaswan/ixnetwork_restpy
0
18280
<filename>ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/ripng_template.py from ixnetwork_restpy.base import Base from ixnetwork_restpy.files import Files class RIPng(Base): __slots__ = () _SDM_NAME = 'ripng' _SDM_ATT_MAP = { 'RIPng Header': 'ripng.header....
1.890625
2
backend/feedback/migrations/0001_initial.py
kylecarter/ict4510-advwebdvlp
0
18281
# Generated by Django 2.1.3 on 2018-11-18 02:34 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Conversation', fields=[ ('id', models.AutoF...
2
2
ktaned/bomb.py
MartinHarding/ktaned
1
18282
<reponame>MartinHarding/ktaned import random class Bomb(object): """Represents the Bomb context that modules should compute against""" def __init__(self): super(Bomb, self).__init__() self.valid_battery_types = ['AA', 'D'] self.valid_ports = ['DVI-D', 'Parallel', 'PS/2', ...
3.453125
3
Aula19/ex09.py
danicon/MD3-Curso_Python
0
18283
jogador = dict() partidas = list() jogador['nome'] = str(input('Nome do jogador: ')) tot = int(input(f'Quantas partidas {jogador["nome"]} jogou? ')) for c in range(0, tot): partidas.append(int(input(f' Quantos gols na partida {c}? '))) jogador['gols'] = partidas[:] jogador['total'] = sum(partidas) print(30*'-=')...
3.734375
4
hummingbot/core/data_type/kline_stream_tracker.py
gmfang/hummingbot
0
18284
<gh_stars>0 #!/usr/bin/env python import asyncio from abc import abstractmethod, ABC from enum import Enum import logging from typing import ( Optional, List, Deque ) from hummingbot.logger import HummingbotLogger from hummingbot.core.data_type.kline_stream_tracker_data_source import \ KlineStreamTrack...
1.945313
2
cogs/management.py
xthecoolboy/MizaBOT
0
18285
import discord from discord.ext import commands import asyncio from datetime import datetime, timedelta import psutil # Bot related commands class Management(commands.Cog): """Bot related commands. Might require some mod powers in your server""" def __init__(self, bot): self.bot = bot ...
2.53125
3
interpreter.py
Wheatwizard/Lost
13
18286
<reponame>Wheatwizard/Lost from Stack import Stack from random import randint class Interpreter(object): def __init__(self,source,input,startx=None,starty=None,dir=None): source = source.strip().split("\n") dim = max(map(len,source)+[len(source)]) self.source = [list(x.ljust(dim,"."))for x in source] self.dim...
3.046875
3
masterStock.py
Coway/premeStock
69
18287
import requests from bs4 import BeautifulSoup import json def loadMasterStock(): url = "http://www.supremenewyork.com/mobile_stock.json" user = {"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1"} # user = {"User-Ag...
3.09375
3
tests/WebkitGtkDriverBenchmarkTest.py
hiroshitoda/WebDriverBenchmark.py
0
18288
<gh_stars>0 import unittest from selenium import webdriver from tests import Base class WebKitGTKDriverBenchmarkTest(Base.Base): def getDriver(self): return webdriver.WebKitGTK() if __name__ == "__main__": unittest.main()
2.0625
2
utils/create_cropped_motion_dataset.py
maheriya/tennisLabels
0
18289
<reponame>maheriya/tennisLabels #!/usr/bin/env python # # Given a VOC dataset of TENNIS videos dumped at 1920x1080 resolution, this script creates a # scaled and cropped dataset. Even though the cropped zone size is static (1280x720/640x360) # crop scale), the zones themselves are dynamically selected based on the obj...
2.734375
3
tests/unit/core/test_core_config.py
Mbompr/fromconfig
19
18290
<gh_stars>10-100 """Tests for core.config.""" import json import yaml from pathlib import Path import pytest import fromconfig def test_core_config_no_jsonnet(tmpdir, monkeypatch): """Test jsonnet missing handling.""" monkeypatch.setattr(fromconfig.core.config, "_jsonnet", None) # No issue to dump eve...
2.21875
2
release.py
dhleong/beholder
4
18291
#!/usr/bin/env python # # Release script for beholder # import hashlib import urllib from collections import OrderedDict try: from hostage import * #pylint: disable=unused-wildcard-import,wildcard-import except ImportError: print "!! Release library unavailable." print "!! Use `pip install hostage` to fi...
2.34375
2
cmsplugin_cascade/migrations/0003_inlinecascadeelement.py
aDENTinTIME/djangocms-cascade
0
18292
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('cmsplugin_cascade', '0002_auto_20150530_1018'), ] operations = [ migrations.CreateModel(...
1.734375
2
SmartWaiterAPI/API/collections/goeswellwith_operations.py
KyrumX/project78-api
0
18293
from API.models import GoesWellWith, Menu def get_goeswellwith_items(menuitem1): entries = GoesWellWith.objects.filter(menuitem1=menuitem1) result = [] if entries.count() <= 0: result.append('None') return result else: for e in entries: result.append(Menu.objects.g...
2.484375
2
src/simulator/simulator.py
ed741/PathBench
46
18294
from typing import Optional from algorithms.basic_testing import BasicTesting from simulator.controllers.main_controller import MainController from simulator.controllers.map.map_controller import MapController from simulator.controllers.gui.gui_controller import GuiController from simulator.models.main_model import M...
2.796875
3
apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/mrp_byproduct/models/mrp_subproduct.py
gtfarng/Odoo_migrade
1
18295
<gh_stars>1-10 # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.addons import decimal_precision as dp class MrpSubProduct(models.Model): _name = 'mrp.subproduct' _description = 'Byproduct' product_id = fi...
1.992188
2
contacts/urls.py
HaraDev001/RealEstate-Backend
2
18296
<reponame>HaraDev001/RealEstate-Backend from django.urls import path from .views import ContactCreateView urlpatterns = [ path('',ContactCreateView.as_view()), ]
1.53125
2
Python_do_zero_Guanabara/04_CondiçõesEmPython/aula/aula15.py
HenriqueSOliver/Projetos_Python
0
18297
<filename>Python_do_zero_Guanabara/04_CondiçõesEmPython/aula/aula15.py # modelo anterior - Enquanto cont até 10 for verdade, será repetido cont = 1 while cont <= 10: print(cont, ' ...', end='') cont += 1 print('FIM') # Usando o Enquanto VERDADE ele vai repetir para sempre, temos que colocar uma condição PARA=...
3.75
4
internal/handlers/lebanon.py
fillingthemoon/cartogram-web
0
18298
import settings import handlers.base_handler import csv class CartogramHandler(handlers.base_handler.BaseCartogramHandler): def get_name(self): return "Lebanon" def get_gen_file(self): return "{}/lbn_processedmap.json".format(settings.CARTOGRAM_DATA_DIR) def validate_values(self, val...
2.703125
3
routes/GetFeed/insta_crawling 복사본/ScrollFeed.py
akalswl14/styltebox_manageweb
0
18299
<filename>routes/GetFeed/insta_crawling 복사본/ScrollFeed.py # -*- coding: utf-8 -*- import os import urllib.request from urllib.request import urlopen # 인터넷 url를 열어주는 패키지 from urllib.parse import quote_plus # 한글을 유니코드 형식으로 변환해줌 from bs4 import BeautifulSoup from selenium import webdriver # webdriver 가져오기 import time...
2.640625
3