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
widgets/CustomCoinsNumberLabel/CustomCoinsNumberLabel.py
JaviCDiaz/Crypto-Info
0
43300
<filename>widgets/CustomCoinsNumberLabel/CustomCoinsNumberLabel.py from utils.QtCore import * from utils.functions import get_exchange_icon class CustomCoinsNumberLabel (QLabel): def __init__( self ): super().__init__() self._coins_number = 0 self._text_prefix = 'Number of coi...
3
3
dxleposervice/app.py
opendxl/opendxl-epo-service-python
5
43301
from __future__ import absolute_import import logging import os import json from dxlbootstrap.app import Application from dxlclient.service import ServiceRegistrationInfo from dxlclient.callbacks import RequestCallback from dxlclient.message import ErrorResponse, Response from ._epo import _Epo # Configure local log...
2.234375
2
validator/base_validator.py
yanzhicong/VAE-GAN
33
43302
<reponame>yanzhicong/VAE-GAN<filename>validator/base_validator.py # -*- coding: utf-8 -*- # MIT License # # Copyright (c) 2018 ZhicongYan # # 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 wi...
1.867188
2
tools/migration/db/migration_harbor/versions/1_5_0.py
eirinikos/harbor
1
43303
# Copyright (c) 2008-2018 VMware, 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 applicabl...
1.648438
2
dynamic programing/change_dp.py
younes-assou/some-data-structures-and-algos
0
43304
import math def get_change(m, denominations=[1,3,4], memo={}): #write your code here if m in memo: return memo[m] if m<0: return math.inf if m==0: return 0 memo[m] = min(get_change(m-denominations[0])+1,get_change(m-denominations[1])+1,get_change(m-denominations[2])+1) return memo[m] m = int(inp...
3.53125
4
evaluation/comp_rec.py
OmranKaddah/Multi-Object-Tracking-in-The-Driving-Scene
2
43305
from __future__ import print_function import pandas import matplotlib; matplotlib.use('Agg') import sys, os, copy, math, numpy as np, matplotlib.pyplot as plt from tabulate import tabulate from munkres import Munkres from collections import defaultdict try: from ordereddict import OrderedDict # can be installed u...
2.09375
2
location_register/serializers/ratu_serializers.py
Anntroy/Data_converter
0
43306
<filename>location_register/serializers/ratu_serializers.py from rest_framework import serializers from location_register.models.ratu_models import Region, District, City, CityDistrict, Street class RegionSerializer(serializers.ModelSerializer): class Meta: model = Region fields = ('id', 'name', '...
2.140625
2
obqa/models/qa/multi_choice/qa_multi_choice_know_reader_v1.py
dirkgr/OpenBookQA
66
43307
<gh_stars>10-100 import numpy from allennlp.data.dataset import Batch from allennlp.modules.matrix_attention import LegacyMatrixAttention from typing import Dict, Optional, List, Any import torch from allennlp.common import Params from allennlp.common.checks import ConfigurationError from allennlp.data import Vocabul...
2.28125
2
dogebuild_fpc/__init__.py
dogebuild/dogebuild-fpc
0
43308
__author__ = 'kir'
0.992188
1
examples/read_input.py
MartinKondor/ArduinoControl
2
43309
import time from datetime import datetime from serial import Serial # Library needed to open serial connection PIN = 'a5' PORT = 'COM11' PORT = Serial(port=PORT, baudrate=9600, timeout=0) # Open the Serial port def encode_command(command): return bytearray(command, encoding='utf-8') print('-' * 50) print('...
3.40625
3
evaluation/code/data/transform.py
JiwanChung/acav100m
27
43310
<filename>evaluation/code/data/transform.py<gh_stars>10-100 import math import numpy as np import torch import torchaudio def random_short_side_scale_jitter( images, min_size, max_size, ): """ Perform a spatial short scale jittering on the given images. Args: images (tensor): images to perform...
2.765625
3
src/deploy/builder/stacks/admin.py
werelaxe/drapo
0
43311
<reponame>werelaxe/drapo from django.contrib import admin from . import models class StackAdmin(admin.ModelAdmin): list_display = ('name', 'status', 'error_text', 'context', 'download_url') admin.site.register(models.Stack, StackAdmin)
1.742188
2
bigflow_python/python/bigflow/util/log.py
advancedxy/bigflow_python
1,236
43312
#!/usr/bin/env python #encoding=utf-8 # Copyright (c) 2012 Baidu, 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 #...
2.171875
2
opus/application/apps/cart/views.py
juzen2003/pds-opus
0
43313
<gh_stars>0 ################################################################################ # # cart/views.py # # The (private) API interface for adding and removing items from the cart # and creating download .zip and .csv files. # # Format: __cart/view.json # Format: __cart/status.json # Format: __cart/data...
1.914063
2
microcosm_daemon/tests/test_state_machine.py
globality-corp/microcosm-daemon
0
43314
<filename>microcosm_daemon/tests/test_state_machine.py """ State machine tests. """ from unittest.mock import patch from hamcrest import ( assert_that, calling, equal_to, is_, raises, ) from microcosm.api import create_object_graph from microcosm_daemon.error_policy import FatalError from microco...
2.53125
3
src/evaluate.py
chloechsu/combining-evolutionary-and-assay-labelled-data
14
43315
<filename>src/evaluate.py ''' Evaluate predictive performance of predictors in parallel with multiprocessing. ''' import argparse from multiprocessing import Process, JoinableQueue from multiprocessing import set_start_method import os import pandas as pd from utils import parse_vars, merge_dfs from evaluate_multipro...
2.625
3
Advanced Network Management/Assignment 1/A1.py
Sahandfer/Tsinghua
1
43316
<gh_stars>1-10 import glob, os import matplotlib import numpy as np import pandas as pd import datetime as dt import matplotlib.dates as mdates import matplotlib.pyplot as plt %matplotlib inline # Reading the files csv_files = glob.glob("dataset/*.csv") dataset = [] def sort_file_name(filename): return int(os.pa...
2.796875
3
awx/main/utils/generate_yml.py
kanayabuno/awx
0
43317
import json import yaml import os import requests from git import Repo ### convert device config in json to ansible playbook and run the playbook PATH_TO_REPO = os.path.expanduser('~') + "/awx-playbooks/" URL = 'http://10.4.19.251:32121/api/v2/' USER = 'admin' PWD = '<PASSWORD>' ### Set proper headers headers = {"Con...
2.46875
2
pyleecan/Methods/Simulation/VarSimu/gen_datakeeper_list.py
carbon-drive/pyleecan
95
43318
<reponame>carbon-drive/pyleecan from ....Classes.DataKeeper import DataKeeper from ....Functions.Load.import_class import import_class def gen_datakeeper_list(self, ref_simu): """Generate default DataKeepers according the reference simulation type""" datakeeper_list = [] # To avoid adding twice a DataKee...
2.375
2
src/models/snyk_api_response.py
Andrii-Grytsenko-OWASP/SnykVulnCheck
0
43319
<filename>src/models/snyk_api_response.py from alchemize import Attr, JsonMappedModel from src.models.snyk_api_classes import SnykVulnerability class SnykApiResponse(JsonMappedModel): __mapping__ = { "status": Attr("status", str), "vulnerabilities": Attr("vulnerabilities", [SnykVulnerability]), ...
2.546875
3
MachineLearning/facial_detection/n_faces.py
jagath-jaikumar/AI-Server-Docker
1
43320
import cv2 import sys import json from image_encoder.image_encoder import decode import numpy import requests # Get user supplied values def get_image(fpath): with open(fpath) as f: record = [json.loads(line) for line in f] img = decode(record[0]["image"]) return img def n_faces(fpath): cascP...
2.875
3
render_chat.py
fdalvi/groupme-archiver
7
43321
import argparse from datetime import datetime import glob import html import json import os import pytz import shutil import sys import time from yattag import Doc # Constants __SYSTEM__ = "GroupMe" FONT_URL = "https://fonts.googleapis.com/css?family=Open+Sans" def css_file(): return """ .message_container ...
2.390625
2
tests/slack_bolt/app/test_dev_server.py
hirosassa/bolt-python
504
43322
from slack_sdk import WebClient from slack_bolt.app.app import SlackAppDevelopmentServer, App from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env class TestDevServer: signing_secret = "secret" ...
1.992188
2
d2r_image/processing_data.py
mgleed/d2r_image
1
43323
from enum import Enum import numpy as np from d2r_image.data_models import ItemQuality GAUS_FILTER = (19, 1) EXPECTED_HEIGHT_RANGE = [round(num) for num in [x / 1.5 for x in [14, 40]]] EXPECTED_WIDTH_RANGE = [round(num) for num in [x / 1.5 for x in [60, 1280]]] BOX_EXPECTED_WIDTH_RANGE = [200, 900] BOX_EXPECTED_HEIGH...
2.28125
2
fibonacci.py
irajtaghlidi/fibonacci-calculator
0
43324
def fibonacci_element(n, computed = {0: 0, 1: 1}): """ calculate N'th Fibonacci number. """ if n not in computed: computed[n] = fibonacci_element(n-1, computed) + fibonacci_element(n-2, computed) return computed[n] def sequence_calc(nterms = 1): """ Calculate Fibonacci sequence from start """...
4.34375
4
Demo/sgi/al/playold.py
1byte2bytes/cpython
5
43325
# Play old style sound files (Guido's private format) import al, sys, time import AL BUFSIZE = 8000 def main(): if len(sys.argv) < 2: f = sys.stdin filename = sys.argv[0] else: if len(sys.argv) <> 2: sys.stderr.write('usage: ' + \ sys.argv[0] + ' filename\n') sys.exit(2) filename = sys.argv[1] ...
2.421875
2
src/repair_mesh.py
vg-lab/MeshReconstruct
0
43326
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import optparse import os import re import sys import vtk from multiprocessing import Process import parse_imx RADIUS = 3 # For Open and Gauss SCALE = 50.0 # For Rasterization class RepairMeshParser(optparse.OptionParser): def __init__(self): ...
2.296875
2
tests/e2e/scale/test_scale_amq.py
nbalacha/ocs-ci
0
43327
<filename>tests/e2e/scale/test_scale_amq.py<gh_stars>0 import logging import pytest import time from ocs_ci.framework.testlib import E2ETest, scale from ocs_ci.ocs import constants from ocs_ci.ocs.amq import AMQ from ocs_ci.helpers.helpers import default_storage_class log = logging.getLogger(__name__) @pytest.fixtu...
2.15625
2
pygin/engine.py
CarlosMatheus/Engine
22
43328
<reponame>CarlosMatheus/Engine<filename>pygin/engine.py import pygame from .draw import Draw from pygin.scene import Scene from pygin.time import Time from pygin.input import Input class Engine: screen_width = 240 screen_height = 426 game_name = "Untitled" game_display = None scenes = None @...
3.15625
3
ancilla/ancilla/foundation/api/resources/wifi.py
frenzylabs/ancilla
7
43329
''' service.py ancilla Created by <NAME> (<EMAIL>) on 01/08/20 Copyright 2019 FrenzyLabs, LLC. ''' import json from .base import BaseHandler import importlib import socket from ...data.models import Service import asyncio import functools import requests class WifiResource(BaseHandler): def initializ...
1.859375
2
train.py
Sumityg/Image-Classifier
1
43330
<reponame>Sumityg/Image-Classifier import numpy as np import torch from torch import nn from torch import optim import matplotlib.pyplot as plt from torchvision import datasets,transforms,models import torch.nn.functional as F from collections import OrderedDict import json from torch.autograd import Variable import ar...
2.453125
2
bioimageio/spec/model/v0_3/schema.py
esgomezm/spec-bioimage-io
0
43331
<reponame>esgomezm/spec-bioimage-io<filename>bioimageio/spec/model/v0_3/schema.py import typing import warnings from copy import deepcopy from marshmallow import ( RAISE, Schema, ValidationError, missing as missing_, post_load, pre_dump, pre_load, validates_schema, ) from bioimageio.sp...
1.859375
2
python/apogee_drp/apred/through.py
sdss/apogee_drp
0
43332
#!/usr/bin/env python from holtztools import plots,html from astropy.io import fits,ascii import numpy as np import math import pdb import argparse import os import matplotlib.pyplot as plt def throughplot(instrument='apogee-s',outfile=None,inter=False) : ''' Routine to make zeropoint/throughput plots from ap...
2.578125
3
plugins/operators/load_stats_redshift.py
slatawa/Airflow-Batch-Pipeline-S3-Redshift
0
43333
<gh_stars>0 from airflow.models.baseoperator import BaseOperator from airflow.providers.amazon.aws.hooks.s3 import S3Hook from airflow.providers.postgres.hooks.postgres import PostgresHook import tempfile import pandas as pd import numpy as np class LoadStatsRedshift(BaseOperator): load_search_stats_sql = """ ...
2.09375
2
classifiers/pseudolabel_sents.py
thinkmpink/police-fatalities-sample
0
43334
import argparse, functools as ft, getpass import itertools as it, json, numpy as np, time from spacy.en import English from spacy.tokens.doc import Doc from pathos.pp import ParallelPool from pathos.threading import ThreadPool FATAL_SYNSET = set(["dead","death","died","die","fatal","killed", "kill","l...
2.625
3
graph_as923.py
tanupoo/lorawan_toa
22
43335
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import sys import matplotlib.pyplot as plt from lorawan_toa import * def get_line(list_size, n_sf, bw=125): return [ get_toa(i, n_sf, n_bw=bw)["t_packet"] for i in list_size ] ######### # fig = plt.figure(num=None, figsize=(16, ...
2.296875
2
twitter_api_analysis.py
oliuba/twitter_friends_map
2
43336
<reponame>oliuba/twitter_friends_map<filename>twitter_api_analysis.py """ This module works with Twitter API and gets user's friends' locations. """ import requests def get_twitter_info(screen_name: str, bearer_token: str) -> dict: """ Returns a dictionary with a user's twitter actions and other data....
3.640625
4
Python Project/AlphaZero/utility/merge_model.py
staticbrightight/hajsdfh
24
43337
import tensorflow as tf if __name__ == "__main__": with tf.Session() as sess: game_dir = "Gobang" model_dir = "model2_10_10_5" batch = "11000" # 初始化变量 sess.run(tf.global_variables_initializer()) # 获取最新的checkpoint,其实就是解析了checkpoint文件 latest_ckpt = tf.train....
2.234375
2
examples/django/0_drf_base_no_db/example_app/views.py
e-kor/yappa
41
43338
from django.db import connection from rest_framework.decorators import api_view from rest_framework.response import Response @api_view() def root(request): return Response({"message": "Hello, from Yappa!", "next step": "go to the next example: " "connect you ...
1.945313
2
gui/wellplot/settings/layout/widgets/checkboxtable/loglayouttablemodel.py
adriangrepo/qreservoir
2
43339
from PyQt4.QtCore import (QAbstractTableModel, QModelIndex, QVariant, Qt, SIGNAL) import operator import logging from globalvalues.constants.plottingconstants import PlottingConstants from PyQt4 import QtGui, QtCore from globalvalues.appsettings import AppSettings logger = logging.getLogger('console') class LogL...
2.46875
2
visualization/read_mp_structures_to_pickle.py
rartino/hands-on-2
0
43340
<reponame>rartino/hands-on-2 #!/usr/bin/env python3 import json, io, pickle import numpy from numpy.lib.recfunctions import append_fields import ase.io def read_mp_structures_to_pickle(jsonfile, picklefile): with open(jsonfile, 'r') as f: data = json.load(f) structs = [] N = len(data["response"]) ...
2.890625
3
Aula_6/exercico3.py
Mateus-Silva11/AulasPython
0
43341
#--- Exercício 3 - Foreach #--- Escreva programa que leia as notas (4) de 10 alunos #--- Armazene as notas e os nomes em listas #--- Imprima: # 1- O nome dos alunos # 2- Média do aluno # 3- Resuldo (Aprovado>=7.0) notas =[] nomes = [] media = 0 a = 0 b = 1 c = 2 d = 3 for d in range(1,1...
3.578125
4
sas_kernel/magics/sas_session_magic.py
gvelasq/sas_kernel
207
43342
# # Copyright SAS Institute # # 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...
2.0625
2
backend/save_routes.py
saatchibhalla/metrics-mvp
0
43343
from datetime import date from models import gtfs, config, util, nextbus, routeconfig import argparse import shapely import partridge as ptg import numpy as np from pathlib import Path import requests import json import boto3 import gzip import hashlib import math import zipfile # Downloads and parses the GTFS specifi...
2.40625
2
Datasets/avletters.py
elendres00/subspace-learning
0
43344
"""AVLetters lip dataset. The original dataset is available from http://www.ee.surrey.ac.uk/Projects/LILiR/datasets/avletters1/index.html This dataset consists of three repetitions by each of 10 talkers, five male (two with moustaches) and five female, of the isolated letters A-Z, a total of 780 utterances Refe...
2.875
3
collections_loops.py
grzegorzwojdyga/SDA_excercises_3
0
43345
def task1(s): """ Function which receives a sequence of comma-separated numbers and generate a list and a tuple which contains every number Input: string with comma separated numbers Output: list and tuple with all the numbers """ pass def task2(): """ Function which receives a se...
4.28125
4
python/tests/dataframe_extension_test.py
juhoautio-rovio/rovio-ingest
24
43346
# # Copyright 2021 Rovio Entertainment 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 agre...
2.09375
2
examples/protocols/http_server/file_serving/http_server_file_serving_test.py
iPlon-org/esp-idf
8,747
43347
#!/usr/bin/env python # # Copyright 2021 Espressif Systems (Shanghai) CO LTD # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
2.1875
2
cave/com.raytheon.viz.gfe/localization/gfe/userPython/smartTools/MoveFeatureBySpeed.py
srcarter3/awips2
0
43348
<gh_stars>0 ## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Disseminat...
1.578125
2
sqlite_dissect/file/journal/jounal.py
Defense-Cyber-Crime-Center/sqlite-dissect
12
43349
<gh_stars>10-100 from re import sub from sqlite_dissect.constants import FILE_TYPE from sqlite_dissect.file.file_handle import FileHandle """ journal.py This script holds the class to parse the rollback journal file. This script holds the following object(s): RollbackJournal(object) """ class RollbackJournal(obj...
2.90625
3
main_app/needs/__init__.py
sashalavrus/cost_app
0
43350
from flask import Blueprint needs = Blueprint('needs', __name__) from . import views from ..models import Permission @needs.app_context_processor def inject_permissions(): return dict(Permission=Permission)
1.828125
2
mal/parsers/anime/pictures.py
Nearata/myanimelist-rest-api
1
43351
from bs4 import BeautifulSoup class Pictures: def __init__(self, soup: BeautifulSoup) -> None: self.soup = soup def __call__(self) -> dict: return { "data": [ { "large": i.select_one("img") .get("data-src") ...
2.9375
3
afternoon_sessions/alive/boilerplate/manager.py
renewfrl/python2
0
43352
<filename>afternoon_sessions/alive/boilerplate/manager.py #!/usr/bin/env python3 from flask_script import Manager from flask import Flask from task import check_alive # use Flask framework app = Flask(__name__) manager = Manager(app) @manager.command def confidence_check(): print("do someting") res = check...
1.929688
2
main.py
vehne/Maiwagen
0
43353
<reponame>vehne/Maiwagen<gh_stars>0 import kivy kivy.require('1.10.0') # Aktuell verwendete Kivy Version from kivy.app import App meineAnwendung=App() print(meineAnwendung) meineAnwendung.run()
1.8125
2
src/data/common.py
mnschmit/lm-lexical-inference
5
43354
<filename>src/data/common.py from typing import Optional, List, TypeVar, Iterable import re PREM_KEY = 'premise' HYPO_KEY = 'hypothesis' LABEL_KEY = 'label' SENT_KEY = 'sentence' ANTI_KEY = 'neg_sentence' MASKED_SENT_KEY = 'masked_sentence' MASKED_ANTI_KEY = 'masked_neg_sentence' PATTERNS = [ "{pal} {prem} {par}...
2.71875
3
ztlearn/dl/__init__.py
jefkine/zeta-learn
30
43355
# -*- coding: utf-8 -*- # import packages(s) from . import layers from . import models
1.0625
1
setup.py
danicarrion/carto-python
0
43356
# -*- coding: utf-8 -*- from setuptools import setup try: with open('requirements.txt') as f: required = f.read().splitlines() except: required = ['requests>=2.7.0', 'pyrestcli>=0.6.4'] try: with open('test_requirements.txt') as f: test_required = f.read().splitlines() except: pass se...
1.796875
2
proc/updatepreprint/setup.py
paratiuid/search-journals
0
43357
<filename>proc/updatepreprint/setup.py #!/usr/bin/env python from setuptools import setup setup( name="UpdatePrePrint", version='0.1-beta', description="Update Pre-Print articles to Solr", author="SciELO", author_email="<EMAIL>", license="BSD", url="https://github.com/scieloorg/search-journ...
1.023438
1
needle/modules/comms/certs/install_ca_mitm.py
yeyintminthuhtut/needle
2
43358
<reponame>yeyintminthuhtut/needle from core.framework.module import BaseModule from core.utils.constants import Constants class Module(BaseModule): meta = { 'name': 'Install MitmProxy CA Certificate', 'author': '@LanciniMarco (@MWRLabs)', 'description': 'Install the CA Certificate of MitmP...
2.015625
2
dotdrop/dotdrop/templategen.py
pouya-barzegar/nerdyDots
4
43359
<filename>dotdrop/dotdrop/templategen.py """ author: deadc0de6 (https://github.com/deadc0de6) Copyright (c) 2017, deadc0de6 jinja2 template generator """ import os import utils from jinja2 import Environment, Template, FileSystemLoader BLOCK_START = '{%@@' BLOCK_END = '@@%}' VAR_START = '{{@@' VAR_END = '@@}}' COMMEN...
2.75
3
Source/LCD/GooglyScreen/MicroPython/main.py
McNerdius/GooglyEyes
0
43360
import machine from machine import Pin, I2C import googlyscreen, functions i2c_builtin = I2C(scl=Pin(5), sda=Pin(4), freq=400000) # 5 = D1, 4 = D2 screen = googlyscreen.GooglyScreen(i2c_builtin) def push_data(): data = screen.environment_data functions.push_data(data) def main_loop(): count = 0 ...
2.90625
3
service/e2e_tests/elasticsearch_fixtures/elasticsearch.py
surfedushare/search-portal
2
43361
<reponame>surfedushare/search-portal NL_MATERIAL = { "math": { "title": "Didactiek van wiskundig denken", "text": "Leermateriaal over wiskunde en didactiek op de universiteit.", "url": "https://maken.wikiwijs.nl/91192/Wiskundedidactiek_en_ICT", "files": [ [{ ...
1.351563
1
modules/dbnd/test_dbnd/py2only/test_python2_newstr.py
busunkim96/dbnd
224
43362
<reponame>busunkim96/dbnd from __future__ import absolute_import import logging import pytest import six from dbnd import parameter, task from dbnd._core.current import try_get_current_task from dbnd._core.task_ctrl.task_ctrl import TaskCtrl from targets.values import ObjectValueType, StrValueType if six.PY2: ...
2.015625
2
SET/difference.py
ragulkesavan/Python-75-Hackathon
0
43363
phone=set(["mi","apple","samsung","giomee","jio","nokia","karbon"]) tv=set(["samsung","apple","onida","vediocon"]) brand=phone.difference(tv) print "brands in phone : ",phone print "brands in tv : ",tv print "phone brands that do not have tv : ",brand ''' OUTPUT: brands in phone : set(['apple', 'samsung', 'jio', 'nok...
3.828125
4
src/ocr/word_image.py
fgulan/PyOCR
0
43364
<reponame>fgulan/PyOCR import cv2 import numpy as np from ocr_image import OCRImage from utils.helpers import debug_plot_array, debug_display_image from utils import hist, constants from char_image import CharImage from skimage.morphology import skeletonize, thin from skimage import img_as_ubyte class WordImage(OCRIm...
2.546875
3
society_manage/api/tests.py
JeekStudio/StudentPlatform
4
43365
<gh_stars>1-10 import os, json from PIL import Image, ImageChops from rest_framework.test import APIClient from django.utils import timezone from testing.testcases import TestCase from society.constants import SocietyType, SocietyStatus, JoinSocietyRequestStatus, ActivityRequestStatus from society.models import JoinS...
2.109375
2
python/easy/1304_Find_N_Unique_Integers_Sum_up_to_Zero.py
JackWang0107/leetcode
1
43366
from typing import * class Solution: # 24 ms, faster than 98.52% of Python3 online submissions for Find N Unique Integers Sum up to Zero. # 14.2 MB, less than 91.76% of Python3 online submissions for Find N Unique Integers Sum up to Zero. def sumZero(self, n: int) -> List[int]: ans = [] if ...
3.609375
4
casparser/analysis/gains.py
rathishg/casparser
0
43367
import csv from collections import deque from dataclasses import dataclass from decimal import Decimal from datetime import date import io import itertools from typing import List, Optional from dateutil.parser import parse as dateparse from dateutil.relativedelta import relativedelta from casparser.exceptions import...
2.359375
2
src/main.py
mjovanc/mvc-simple-registry
0
43368
from controller.user import User from view.console import Console from model.registry import Registry def main(): user = User() registry = Registry() view = Console(registry) user.start_app(view) if __name__ == '__main__': main()
1.726563
2
src/botModerationCommands.py
ScrappyCocco/ScroccoDiscordBot
1
43369
<filename>src/botModerationCommands.py # --------------------------------------------------------------------- # IMPORTS from discord.ext import commands import discord from botMethodsClass import BotMethods # --------------------------------------------------------------------- class BotModerationCommands(comma...
2.75
3
template-mpy.py
peter-conalgo/binfonter
0
43370
<gh_stars>0 from ucollections import namedtuple GlyphInfo = namedtuple('GlyphInfo', 'x y w h bits') class FontBase: @classmethod def lookup(cls, cp): # lookup glyph data for a single codepoint, or return None for r,d in cls._code_points: if cp not in r: continue ptr = ...
2.75
3
backend/youngun/youngun/apps/content/helpers/tw_post.py
aakashbajaj/Youngun-Campaign-Tracking
0
43371
import requests import json from datetime import datetime, timedelta import pytz import re import dateutil.parser from pprint import pprint from django.conf import settings class TwitterPostScraper: def __init__(self, post_link, resp): self.resp = resp self.data = {"link": post_link} def get...
2.34375
2
setup.py
MorelLaw228/ocr-web-api-project
0
43372
<filename>setup.py from setuptools import setup setup( name='ocr-web-api-project', version='1.1', packages=[''], url='https://github.com/MorelLaw228/ocr-web-api-project', license='', author='morellatel', author_email='<EMAIL>', description='Projet d\'OCR de données médicales réalisé dan...
0.992188
1
dongguanSpider/dongguanSpider/spiders/Xixi.py
qq453388937/Scarapy_Git
0
43373
<gh_stars>0 # -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule, Spider from dongguanSpider.items import DongguanspiderItem class DongguanSpider(Spider): """ # 放到请求队列里,出队,交给下载器去下载,响应提取链接通过LinkExtractor """ """ fro...
2.8125
3
labbench/_traits.py
usnistgov/gpsdata
0
43374
<gh_stars>0 # This software was developed by employees of the National Institute of # Standards and Technology (NIST), an agency of the Federal Government. # Pursuant to title 17 United States Code Section 105, works of NIST employees # are not subject to copyright protection in the United States and are # considered t...
1.460938
1
src/auth.py
AnarbekB/screen
0
43375
import yadisk import sys import os def auth(): y = yadisk.YaDisk("7d9ca04e4fe848bbb1d1c6ba4916a5b4", "b7400bc636e144d988e749333afa388b") url = y.get_code_url() print("Go to the following url: %s" % url) code = input("Enter the confirmation code: ") try: response = y.get_token(code) ex...
2.90625
3
testing/merge_scripts/code_coverage/merge_lib_test.py
zealoussnow/chromium
14,668
43376
<filename>testing/merge_scripts/code_coverage/merge_lib_test.py #!/usr/bin/env vpython # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import subprocess import sys import unittest import mock i...
2.25
2
POP1/worksheets/one/ex15/code.py
silvafj/BBK-MSCCS-2017-18
1
43377
<filename>POP1/worksheets/one/ex15/code.py # Suppose the cover price of a book is $24.95, but bookstores get a 40% discount. # Shipping costs $3 for the first copy and 75 cents for each additional copy. # What is the total wholesale cost for 60 copies? print(round((24.95 - (24.95 * (40 / 100))) * 60 + 3 + 0.75 * 59, 2...
3.09375
3
pycolims/menus/Menu_Factory.py
daniel-avalos/pycolims
1
43378
from pycolims.menus import _menu_single, _menu_multi class SingleMenu(_menu_single.SelectSingle): """Given a list, prompt for selection of a single item\n Returns the selected item\n""" class MultiMenu(_menu_multi.SelectMulti): """Given a list, prompt for selection of items in a list.\n Returns a li...
2.765625
3
pureskillgg_dsdk/ds_models/__init__.py
pureskillgg/dsdk
0
43379
<filename>pureskillgg_dsdk/ds_models/__init__.py from .model import create_ds_models
1.117188
1
scraper1830/scraper_cli.py
SiddharthNVenkatesh/1830-game-log-scraper
0
43380
""" Created on Sat Oct 30 19:29:30 2021 @author: siddharthvenkatesh This is a command line interface for scraper1830. """ import click from .scraper1830 import Scraper1830 @click.group() def cli_entry(): pass @cli_entry.command() @click.option( "--id", prompt="Enter Game ID", help="The id for the 1830 ga...
2.953125
3
supg/selector/base_selector.py
stanford-futuredata/supg
3
43381
<reponame>stanford-futuredata/supg from typing import Sequence import numpy as np import math from supg.datasource import DataSource class ApproxQuery: def __init__( self, qtype:str="pt", min_precision=None, min_recall=None, delta=0.01, budg...
2.46875
2
Tests/fTestThread.py
SkyLined/mWindowsAPI
7
43382
import re, sys, time; from mWindowsAPI import *; from mWindowsSDK import *; from mConsole import oConsole; def fDumpThreadInfo(oThread, sISA, bDumpContext): oConsole.fOutput(" * Thread: %s" % (repr(oThread),)); o0TEB = oThread.fo0GetTEB(); if o0TEB: oConsole.fOutput(" * TEB:"); for sLine in oThread.o...
1.859375
2
ledgereth/objects.py
unparalleled-js/ledger-eth-lib
10
43383
<gh_stars>1-10 from __future__ import annotations from abc import ABC, abstractmethod from enum import IntEnum from typing import Any, Dict, List, Optional, Tuple from eth_utils import encode_hex, to_checksum_address from rlp import Serializable, decode, encode from rlp.sedes import BigEndianInt, Binary, CountableLis...
1.953125
2
app/validator/client_validator.py
JunFuruya/Ratsnake
0
43384
# -*- coding: UTF-8 -*- from app.validator.base_validator import BaseValidator class ClientValidator(BaseValidator): def __init__(self): pass def get_error_messages(self): #self.__language_name = language_name #self.__validate() return super().get_error_messages() ...
2.5625
3
snafulib/executors/openshift.py
isabella232/snafu
31
43385
# Snafu: Snake Functions - OpenShift Executor import requests import os import configparser import subprocess container = "jszhaw/snafu" endpoints = {} def executecontrol(flaskrequest, tenant): if not tenant in endpoints: username = os.getenv("OPENSHIFT_USERNAME") password = os.getenv("OPENSHIFT_PASSWORD") p...
2.296875
2
pex/tools/command.py
ShellAddicted/pex
2,160
43386
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import from abc import abstractmethod from pex.commands.command import Command, Result from pex.pex import PEX class PEXCommand(Command): @abstractm...
2.328125
2
root_gnn/src/optimizers/optimizer_utils.py
Calvin-Qiu/TopReco
0
43387
# Copyright 2019 The Sonnet Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
1.796875
2
blog/models.py
pythoncali/portal
1
43388
<filename>blog/models.py<gh_stars>1-10 # -*- coding: utf-8 -*- from django.db import models from taggit.managers import TaggableManager from autoslug import AutoSlugField from django.conf import settings """ ## TODO ## 1. Como el direccionamiento estara ligado al uso de slugs, tanto en el caso de las categorias como ...
2.328125
2
commons.py
ruslanrf/LoadBus-Scheduler
0
43389
<filename>commons.py<gh_stars>0 # -*- coding: utf-8 -*- #burden -> n # нагрузка #bandage -> k # шина import numpy import collections class RepresentationBasic(object): """ Basic Representation of the current solution """ def __init__(self, burdens, bandage_n, zero_assignments=False, ...
2.703125
3
apis/v1/movies/serializers.py
sunil28rana/flask-imdb-sample-project
0
43390
from flask_restplus import fields from apis.v1.v1_api import api movie_ns = api.namespace('movies', description='Movie Module') movie = movie_ns.model('Movie', { 'id': fields.Integer(required=True, description='Movie id'), '99popularity': fields.Float(attribute='ninety_nine_popularity', required=True), ...
2.515625
3
giturlparse/platforms/__init__.py
JulianVolodia/giturlparse
20
43391
from .assembla import AssemblaPlatform from .base import BasePlatform from .bitbucket import BitbucketPlatform from .friendcode import FriendCodePlatform from .github import GitHubPlatform from .gitlab import GitLabPlatform # Supported platforms PLATFORMS = [ # name -> Platform object ("github", GitHubPlatform...
1.765625
2
chain/crypto/objects/transactions/vote.py
tsifrer/ark
5
43392
import logging from .base import BaseTransaction logger = logging.getLogger(__name__) class VoteTransaction(BaseTransaction): def can_be_applied_to_wallet(self, wallet, wallet_manager, block_height): vote = self.asset["votes"][0] if vote.startswith("+"): if wallet.vote: ...
2.421875
2
pyreach/gyms/force_torque_sensor_element.py
google-research/pyreach
13
43393
# Copyright 2021 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 in writing, ...
2.1875
2
visual_change_analysis/bin_data.py
Barry-lab/Publication_TanniDeCothiBarry2021
0
43394
<reponame>Barry-lab/Publication_TanniDeCothiBarry2021 import numpy as np def bin_data(var_to_bin_by, bin_size, limits, var_to_bin = []): """ Creates N-d histogram of var_to_bin_by using bins of size bin_size. If var_to_bin is provided then it creates a weighted histogram using var_to_bin as the weights...
3.15625
3
formatter.py
dvhh/fastly-prometheus-exporter
1
43395
''' Create format report from json to html using jinja2 ''' import json import sys import argparse from jinja2 import Template def get_template(argument: str): ''' get template content ''' if argument == '-': return Template(sys.stdin.read()) return Template(open(argument).read()) def ge...
3.234375
3
gubbing/models/networks/temporal_net.py
mychiux413/gubbing
0
43396
<reponame>mychiux413/gubbing<gh_stars>0 import tensorflow as tf from tensorflow.keras import layers, Model class TemporalNetwork(Model): pass
1.5625
2
trajectories.py
ZJYgrp/React_Traj_Analysis
4
43397
<filename>trajectories.py # TS Extraction and Trajectory classification class import os import matplotlib as mpl import numpy as np mpl.use('Agg') class Trajectories: def __init__(self, file, atoms, mode): # trajectory format for ProgDyn output self.name = os.path.basename(file) # print (...
2.90625
3
networking_fujitsu/ml2/cfab/mech_cfab.py
mail2nsrajesh/networking-fujitsu
0
43398
# Copyright 2015-2017 FUJITSU 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
1.46875
1
nlphug/promatching.py
readall/mlgitpod
1
43399
<gh_stars>1-10 from transformers import ReformerConfig, PyTorchBenchmark, PyTorchBenchmarkArguments from transformers import ReformerModelWithLMHead, ReformerTokenizer import torch import pandas as pd import numpy as np import nltk nltk.download('stopwords', download_dir='/workspace/conda/hugface/nltk_data') nltk.down...
2.40625
2