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
migrations/versions/03f014e8d128_added_basic_prefix.py
charlestondance/amoslims
0
12770151
<gh_stars>0 """added basic prefix Revision ID: 03f014e8d128 Revises: fed23b3ce53a Create Date: 2017-01-15 10:25:37.768783 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '03f014e8d128' down_revision = 'fed23b3ce53a' bra...
1.453125
1
Codeforces/A_Linear_Keyboard.py
anubhab-code/Competitive-Programming
0
12770152
for _ in range(int(input())): a=input() b=input() s={} ans=0 for i in range(26): s[a[i]]=i+1 temp=[] for j in b: temp.append(s[j]) for k in range(len(temp)-1): ans+=abs(temp[k]-temp[k+1]) print(ans)
2.96875
3
src/kata/data/io/network.py
FlorianKempenich/kata
0
12770153
import requests from kata.domain.exceptions import ApiLimitReached, InvalidAuthToken class GithubApi: """ Basic wrapper around the Github Api """ def __init__(self, auth_token: str): self._requests = requests self._auth_token = auth_token def contents(self, user, repo, path=''):...
2.890625
3
utils.py
karthigb/mturk-object-detection
0
12770154
import boto3 import json MTURK_SANDBOX = 'https://mturk-requester-sandbox.us-east-1.amazonaws.com' def get_mturk_client(): with open('config.json', 'r') as f: config = json.load(f) mturk = boto3.client('mturk', aws_access_key_id = config['SANDBOX']['aws_access_key_id'], aws_s...
2.140625
2
cosmic_ray/plugins.py
jkblume/cosmic-ray
0
12770155
from stevedore import driver, ExtensionManager def get_operator(name): """Get an operator class from a plugin. Attrs: name: The name of the plugin containing the operator class. Returns: The operator *class object* (i.e. not an instance) provided by the plugin named `name`. """ r...
2.6875
3
backend/lists/admin.py
xelam11/TaskPlanner
0
12770156
from django.contrib import admin from .models import List class ListAdmin(admin.ModelAdmin): list_filter = ('board', 'name') admin.site.register(List, ListAdmin)
1.554688
2
DEFLECTION_ANGLE.py
Sketos/PyGlafic
0
12770157
<reponame>Sketos/PyGlafic import os as os import sys as sys import numpy as np import matplotlib.pyplot as plt from astropy.io import fits from PyGlafic import PyGlafic class DEFLECTION_ANGLE(PyGlafic): def __init__(self, COSMOLOGICAL_PARAMETERS = None, LEN_REDSHIFT = None, SRC_REDSHIFT = None, ANGULAR_DISTANCE ...
2.328125
2
xlnet/datasets/squad_tfrecords.py
fanshiqing/DAPPLE
50
12770158
<filename>xlnet/datasets/squad_tfrecords.py import tensorflow as tf from tensorflow.contrib.distribute.python import prefetching_ops_v2 def input_fn_builder(input_glob, batch_size, is_training, seq_length=512): name_to_features = { "input_ids": tf.FixedLenFeature([seq_length], tf.int64), "input_mas...
2.390625
2
src/utils/filesys.py
dmitry-vorobiev/nlp_headline_rus
0
12770159
<gh_stars>0 import json import os from pathlib import Path def save_json(content, path, indent=4, **json_dump_kwargs): with open(path, "w") as f: json.dump(content, f, indent=indent, sort_keys=True, **json_dump_kwargs) def write_txt_file(ordered_tgt, path): f = Path(path).open("w") for ln in ord...
2.65625
3
Models/kNN.py
AlgoAIBoss/Data-Mining-Cup
0
12770160
import pandas as pd import numpy as np from sklearn.metrics.pairwise import euclidean_distances, cosine_similarity, manhattan_distances def top_5(book, items, similarity_measure): """ This function extracts the top-five similar books for a given book and similarity measure. This function takes t...
3.40625
3
demos/python/sdk_wireless_camera_control/open_gopro/util.py
hypoxic/OpenGoPro
1
12770161
# util.py/Open GoPro, Version 1.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). # This copyright was auto-generated on Tue May 18 22:08:50 UTC 2021 """Miscellaneous utilities for the GoPro package.""" import sys import queue import logging import subprocess from pathlib import Path from typing import D...
2.5
2
tests/unit_tests.py
tylerscave/OS_Simulator
0
12770162
<filename>tests/unit_tests.py import sys import os def main(): python3 = 'python3' # List of tests to run test_modules = [ 'test_random_generator.py', 'test_process_generator.py' ] # Loops through all tests, outputs to stdout for test_file in test_modules: cmd = pytho...
2.859375
3
bits_wilp/isPalindrome.py
deepak5998/Py
726
12770163
def isPalindrome(str): result = False if str == str[::-1]: result = True return result print("Please enter a string: ") x = input() flag = isPalindrome(x) if flag: print(x, "is a Palindrome") else: print(x, "is NOT a Palindrome")
4.25
4
dezero/__init__.py
teijeong/deeplearning-from-scratch
0
12770164
_IS_SIMPLE_CORE = False if _IS_SIMPLE_CORE: from dezero.core_simple import Variable from dezero.core_simple import Function from dezero.core_simple import using_config from dezero.core_simple import no_grad from dezero.core_simple import as_array from dezero.core_simple import as_variable f...
1.421875
1
src/python/WMCore/WMBS/Oracle/Jobs/GetCouchID.py
hufnagel/WMCore
21
12770165
#!/usr/bin/env python """ _GetCouchID_ Oracle implementation of Jobs.GetCouchID """ from WMCore.WMBS.MySQL.Jobs.GetCouchID import GetCouchID as MySQLGetCouchID class GetCouchID(MySQLGetCouchID): """ Identical to MySQL version. """ pass
1.78125
2
lab6_named_entity_recognition/named_entity_recognition/tag_with_wikidata_sparql.py
hckr/semantic-data-labs
0
12770166
import time import urllib from typing import List, Tuple from SPARQLWrapper import JSON, SPARQLWrapper from named_entity_recognition.utils import (join_with_newlines, load_list, save_text) LIMIT = 0 def main(): names = load_list('output/nltk.txt') sparql = SPARQL...
2.796875
3
Conteudo das Aulas/126/gabarito.py
cerberus707/lab-python
0
12770167
""" Faça uma "fabrica decoradora" que retorna um decorador que decora funções com um único argumento. A fábrica deverá receber um argumento, um tipo, e retornar um decorador em que a função verifica se o argumento passado é do tipo correto, senão levanta um TypeError. """ def decorador(função, tipo): def nova_funç...
3.890625
4
stanCode_Projects/hangman_game/similarity.py
calvin0123/sc-projects
0
12770168
<filename>stanCode_Projects/hangman_game/similarity.py """ File: similarity.py Name: <NAME> ---------------------------- This program compares short dna sequence, s2, with sub sequences of a long dna sequence, s1 The way of approaching this task is the same as what people are doing in the bio industry. """ def main()...
4.375
4
tests/builders/test_simple_bib_drone.py
munrojm/maggma
0
12770169
from datetime import datetime from pathlib import Path import pytest from maggma.stores import MemoryStore from .simple_bib_drone import SimpleBibDrone @pytest.fixture def init_drone(test_dir): """ Initialize the drone, do not initialize the connection with the database :return: initialized dr...
2.421875
2
websubsub/migrations/0011_subscription_static.py
Fak3/websubsub
4
12770170
# Generated by Django 2.0.13 on 2020-02-16 13:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('websubsub', '0010_subscription_time_last_event_received'), ] operations = [ migrations.AddField( model_name='subscription', ...
1.515625
2
pybat/workflow/workflows.py
zezhong-zhang/pybat
1
12770171
# coding: utf8 # Copyright (c) <NAME>, University of Antwerp # Distributed under the terms of the MIT License import os import numpy as np from fireworks import Firework, LaunchPad, PyTask, Workflow from pymongo.errors import ServerSelectionTimeoutError from ruamel.yaml import YAML from pybat.cli.commands.define imp...
2.046875
2
tests/test_fastapi/test_more_reallife_fastapi.py
ivangirko/ormar
905
12770172
<filename>tests/test_fastapi/test_more_reallife_fastapi.py import asyncio from typing import List, Optional import databases import pytest import sqlalchemy from fastapi import FastAPI from starlette.testclient import TestClient import ormar from tests.settings import DATABASE_URL app = FastAPI() metadata = sqlalche...
2.15625
2
client_net.py
Args-Engine/rb-distributed-helloworld
0
12770173
<filename>client_net.py import socket import application_params as ap import messages class Client: def __init__(self, addr: str, middleware): self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) while self.sock.connect_ex((addr, ap.PORT)) != 0: print("Connection failed, host ...
2.734375
3
sdk/python/pulumi_aws/storagegateway/stored_iscsi_volume.py
sibuthomasmathew/pulumi-aws
0
12770174
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilitie...
1.65625
2
2021/day01.py
valogonor/advent-of-code
1
12770175
import sys sys.stdout = open('output.txt', 'w') sys.stdin = open('input.txt') # Part Two from collections import deque ans = 0 last = None t = 2000 q = deque() sm = 0 for _ in range(t): if len(q) == 3: sm -= q.popleft() num = int(input()) sm += num q.append(num) if last is None and len(q) =...
3.015625
3
LinkedList.py
SergioMD15/LinkedList-Sorting
0
12770176
class Node: def __init__(self, val): self.val = val self.next = None def add(self, val): if not self.next: self.next = Node(val) else: self.next.add(val) def remove(self, val): if self.next.val == val: self.next = self.next.next ...
3.703125
4
framework/project_spdk.py
spdk/tests
3
12770177
# BSD LICENSE # # Copyright(c) 2010-2014 Intel Corporation. All rights reserved. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copy...
1.484375
1
dashboard/views/_general/_classes.py
beta-nu-theta-chi/ox-dashboard
0
12770178
<reponame>beta-nu-theta-chi/ox-dashboard from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.shortcuts import render from django.urls import reverse, reverse_lazy from dashboard.forms import ClassTakenForm from dashboard...
2.140625
2
bitcodin/test/core/__init__.py
bitmovin/bitcodin-python
27
12770179
__author__ = '<NAME> <<EMAIL>>' from unittest import TestSuite from .testcase_api_key_authorized import ApiKeyAuthorizedTestCase from .testcase_api_key_unauthorized import ApiKeyUnauthorizedTestCase from .testcase_create_headers import CreateHttpHeadersTestCase from .testcase_convert import ConvertTestCase from .test...
2.03125
2
chsdi/models/vector/zeitreihen.py
procrastinatio/mf-chsdi3
29
12770180
# -*- coding: utf-8 -*- from sqlalchemy import Column, Integer from sqlalchemy.types import Numeric, Unicode from sqlalchemy.dialects import postgresql from chsdi.models import register, bases from chsdi.models.vector import Vector, Geometry2D Base = bases['zeitreihen'] class Zeitreihen15(Base, Vector): __tab...
2.15625
2
test/smallTests/test_WithoutOGS.py
mcwimm/pyMANGA
1
12770181
<filename>test/smallTests/test_WithoutOGS.py # This script tests pyMANGA using seven setups # The first test only checks whether the setups can be calculated without # errors # The second test compares the calculated results with reference results import sys from os import path import os sys.path.append( path.dir...
2.390625
2
domintell/controller.py
yaccri/python-domintell
1
12770182
<gh_stars>1-10 """ :author: <NAME> <<EMAIL>> Port for Domintell :author: <NAME> <<EMAIL>> """ import logging import time import json import domintell from domintell.utils import ModuleJSONEncoder MODULE_CATEGORIES = { # todo: fix modules 'switch': ['VMB4RYLD', 'VMB4RYNO'], 'sensor': ['VMB6IN', 'VMB7IN'] ...
2.578125
3
python/quicksort.py
tushariscoolster/algorithm
2
12770183
<gh_stars>1-10 def quickSort(toSort): if len(toSort) <= 1: return toSort end = len(toSort) - 1 pivot = toSort[end] low = [] high = [] for num in toSort[:end]: if num <= pivot: low.append(num) else: high.append(num) #print pivot ...
3.78125
4
svc-websocket/app/controllers/api/example_api.py
jamessaldo/knowledge-chatbot
0
12770184
<reponame>jamessaldo/knowledge-chatbot from flask_restful import Resource from flask_restful import reqparse from app.helpers import rest class ExampleAPIById(Resource): def get(self, id): data = { "get": "ok" } return rest.response(200, data=data, message="GET ok"+id) class ...
2.640625
3
souper/main.py
spookey/souper
0
12770185
<filename>souper/main.py from logging import getLogger from souper.base import APP_NAME from souper.lib.args import arguments from souper.lib.note import keep_args, setup_logging from souper.load import Load from souper.page import Page from souper.site import Site LOG = getLogger(__name__) def main(): args = a...
2.28125
2
server/data.py
ParkingPrediXion/ParkingPrediXion
2
12770186
import json import numpy as np def get_timestamps(evts): return [c['timestamp'] for c in evts['content']] def get_bucket(dt): return dt.weekday() * 24 + dt.hour from collections import namedtuple AllData = namedtuple('AllData', ['spots', 'trends', 'total']) def load_data(): pass
2.796875
3
effective_python/metaclass_property/getattr_demo.py
ftconan/python3
1
12770187
<reponame>ftconan/python3 """ @author: magician @file: getattr_demo.py @date: 2020/1/14 """ class LazyDB(object): """ LazyDB """ def __init__(self): self.exists = 5 def __getattr__(self, name): value = 'Value for %s' % name setattr(self, name, value) return v...
2.96875
3
towhee/pipelines/image_embedding_pipeline.py
L-Net-1992/towhee
0
12770188
# Copyright 2021 Zilliz. 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 law or agree...
2.046875
2
gallery/urls.py
D-GopalKrishna/RobotixWeb2021
0
12770189
<reponame>D-GopalKrishna/RobotixWeb2021 from django.urls import path from . import views urlpatterns = [ path('',views.gallery,name='gallery'), path('api/',views.gallery_api,name='gallery_api') ]
1.742188
2
projects/rich.py
Acemyzoe/data_anasylsis
0
12770190
from rich import print #print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals()) from rich.console import Console console = Console() console.print("Hello", "World!", style="bold red") console.print("Hello", style="5") console.print("Hello", style="#af00ff") console.print("Hello", style="rgb(175,0,2...
3.203125
3
factorial_recursion.py
amalshehu/Python-Introduction
0
12770191
# File: factorial_recursion.py # Purpose: Example: FActorial using recursion # Programmer: <NAME> # Course: Practice # Date: Sunday 28th August 2016, 11:10 PM num = int(input("Enter a number")) # Convert to an int def factorial(num): if (num == 0): return else: return...
4.59375
5
reqcli/source/__init__.py
shiftinv/reqcli
0
12770192
from .basesource import BaseSource from .config import SourceConfig from .reqdata import CertType, ReqData from .status import StatusCheckMode from .unloadable import UnloadableType
1.046875
1
tests/kernel_duration/gpt.py
drunkcoding/model-inference
1
12770193
<gh_stars>1-10 from dataclasses import dataclass, field from functools import partial import logging import os import time from transformers import ( AutoModelWithLMHead, GPT2Tokenizer, HfArgumentParser, AutoTokenizer ) import pandas as pd from datasets import load_dataset from tqdm import tqdm import n...
2.328125
2
oslo_versionedobjects/fields.py
openstack/oslo.versionedobjects
37
12770194
<filename>oslo_versionedobjects/fields.py # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
1.875
2
scripts/normalization.py
ysy6868/STPF
958
12770195
#! /usr/bin/python ''' Data Normalization ''' from sklearn import preprocessing def normalize(file_dataframe, cols): ''' Data Normalization. ''' for col in cols: preprocessing.normalize(file_dataframe[col], \ axis=1, norm='l2', copy=False) return file_dataframe
3.3125
3
code/tests/unit/mock_data_for_tests.py
CiscoSecurity/tr-05-serverless-palo-alto-autofocus
0
12770196
from datetime import timedelta AUTOFOCUS_IP_RESPONSE_MOCK = { "indicator": { "indicatorValue": "172.16.31.10", "indicatorType": "IPV4_ADDRESS", "summaryGenerationTs": 1607951568568, "firstSeenTsGlobal": None, "lastSeenTsGlobal": None, "latestPanVerdicts": { ...
1.875
2
scripts/plot_uc.py
wyolum/uControl_v3
0
12770197
<reponame>wyolum/uControl_v3 from uControl import * from pylab import * import util def load(fn): data = pickle.load(open(fn)) try: out = data['hirate'] except ValueError: out = data return out def plot_hirate(hirate): times = hirate[:,0] gage = hirate[:,1] flow = hira...
2.171875
2
LPDM-Volttron/volttron/applications/lbnl/LPDM/SupervisorAgent/supervisor/supervisor_logic.py
LBNL-ETA/LPDM-Volttron
0
12770198
<reponame>LBNL-ETA/LPDM-Volttron<filename>LPDM-Volttron/volttron/applications/lbnl/LPDM/SupervisorAgent/supervisor/supervisor_logic.py # -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: from uuid import uuid4 import os import json # Thjis is a hack since it is a back dependency from VOLTT...
1.976563
2
utils/global_settings.py
kchiang6997/toxicity
0
12770199
UNKNOWN_WORD = "<unk>" embedding_dimension = 50 min_count = 5 window_size = 3 sample = 1e-3 negative = 5 vocab_size = None train_words = None # Special parameters MIN_SENTENCE_LENGTH = 3
1.773438
2
setup.py
d4mi1/python-ipx800
4
12770200
# -*- coding: utf-8 -*- # @Author: <NAME> # @Date: 2018-05-10 17:57:07 # @Last Modified by: <NAME> # @Last Modified time: 2018-05-28 21:50:38 from distutils.core import setup setup( name = 'IPX800', packages = ['IPX800'], version = '0.1.5', description = 'Library for controlling GCE-Electronics IPX800', ...
1.007813
1
ros_ws/src/baxter_interface/src/baxter_interface/settings.py
mesneym/Baxter-Arm-PP
0
12770201
<reponame>mesneym/Baxter-Arm-PP<filename>ros_ws/src/baxter_interface/src/baxter_interface/settings.py<gh_stars>0 version https://git-lfs.github.com/spec/v1 oid sha256:ecf7c6e4073ed731198a562b6cb7ecaae49c80b9594f3e2dfeef108ea4868bc0 size 2045
0.96875
1
services/service-template/service_template_gae_handlers.py
google/dnae
6
12770202
# Copyright 2018 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
2.140625
2
sim21/provider/nrtl.py
kpatvt/sim21
7
12770203
<filename>sim21/provider/nrtl.py import numpy as np import math from sim21.data import nrtl from sim21.provider.ideal import IdealVapLiq def nrtl_model_log_gamma(given_temp, liq_vol_mole, x, ip_g, ip_alpha, valid=None): n = len(x) log_gamma = np.zeros(n) if valid is None: valid = range(n) # I...
1.9375
2
src/load.py
peferso/pegaso-collect
0
12770204
<reponame>peferso/pegaso-collect ''' Created on 18 ene. 2022 @author: pedfernandez ''' import logging import time import datetime import os import json import pandas as pd import pymysql import subprocess import hashlib from utils import AWSOperations, AWSNotifications logging.basicConfig( format="%(asctime)-15s ...
1.992188
2
credit_calculator.py
ChameleonTartu/NorwegianLoanCalculator
0
12770205
#!/usr/bin/python DNB_YEARLY_PERCENTAGE = 2.10 / 100 DNB_MONTHLY_PERCENTAGE = DNB_YEARLY_PERCENTAGE / 12 DNB_FEE = 50 DNB_INITIAL_PAYMENT = 10000 NORDEA_YEARLY_PERCENTAGE = 2.15 / 100 NORDEA_MONTHLY_PERCENTAGE = NORDEA_YEARLY_PERCENTAGE / 12 NORDEA_FEE = 65 NORDEA_INITIAL_PAYMENT = 0 def months_until_paid_out(credit...
3.90625
4
users/views.py
Yttrium40/quiz_site
0
12770206
<reponame>Yttrium40/quiz_site<filename>users/views.py import django.contrib.auth as django_auth from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, render fro...
2.375
2
lino_book/projects/dumps/settings/memory.py
lino-framework/lino_book
3
12770207
<filename>lino_book/projects/dumps/settings/memory.py from .a import * SITE.verbose_name = SITE.verbose_name + " (:memory:)" DATABASES['default']['NAME'] = ':memory:'
1.507813
2
veles/loader/pickles.py
AkshayJainG/veles
1,007
12770208
# -*- coding: utf-8 -*- """ .. invisible: _ _ _____ _ _____ _____ | | | | ___| | | ___/ ___| | | | | |__ | | | |__ \ `--. | | | | __|| | | __| `--. \ \ \_/ / |___| |___| |___/\__/ / \___/\____/\_____|____/\____/ Created on Jan 25, 2015 Loaders which get data from pickles ██...
1.6875
2
checkov/version.py
meghaddn/checkov
0
12770209
version = '2.0.396'
1.085938
1
tests/datastructures/test_queue.py
TristenSeth/campy
5
12770210
<filename>tests/datastructures/test_queue.py """Tests for the :mod:`campy.datastructures.queue` module."""
1.09375
1
creation/lib/cvWParams.py
bbockelm/glideinWMS
0
12770211
<reponame>bbockelm/glideinWMS # # Project: # glideinWMS # # File Version: # # Description: # This module contains the create_frontend params class # # Author: # <NAME> # import os import copy import re import imp import os.path import imp import string import socket from glideinwms.lib import xmlParse import cW...
2.125
2
tests/test_config.py
aalexanderkevin/midtrans-python-client
0
12770212
import pytest from .context import ApiConfig from pprint import pprint def test_api_config_class(): apiconfig = ApiConfig(is_production=False, server_key='sk-abc', client_key='ck-123') assert apiconfig.is_production == False assert apiconfig.server_key == 'sk-abc' assert apiconfig.client_key == 'ck...
2.328125
2
solutions/00_based/sol/enc.py
GiacomoFerro/crypto-challenges-2020
0
12770213
<reponame>GiacomoFerro/crypto-challenges-2020 text="ANCHE TU BRUTO FIGLIO MIO?"; s=4; result=""; text=text.upper(); for i in range(len(text)): c = text[i]; if(c.isupper()): result+=chr((ord(c)+s-65)%26+65); else: result+=chr((ord(c)+s-97)%26+97); print(result);
3.75
4
cincanregistry/checkers/didierstevens.py
cincanproject/cincan-registry
0
12770214
<gh_stars>0 from ._checker import NO_VERSION from .github import GitHubChecker import base64 class DidierStevensChecker(GitHubChecker): """ Class for checking latests possible tool releases of Didier Stevens. """ def __init__(self, tool_info: dict, **kwargs): super().__init__(tool_info, **kwa...
2.59375
3
Pipers/Telegram2VK.py
Andrew-Morozko/Funnel
0
12770215
import Piper import html import os import DB class Telegram2VK(Piper.Piper): def __init__(self, source, dest): """ Gets 2 handlers """ super(Telegram2VK, self).__init__(source, dest) def converter(self, in_q, out_q): while True: telegram_msg = in_q.get(block=True) ...
2.640625
3
tb_gen.py
masipcat/VHDL-TestbenchGen
6
12770216
#!/usr/bin/python # -*- coding: utf-8 -*- import sys from vhdl import * from vParser import * print """ dP dP dP dP 888888ba dP 88 88 88 88 88 `8b 88 88 .8P 88aaaaa88a 88 88 88 88 d8' 88 88 88 88 88 88 .d8P 88 88 88 .8P 88 8888...
2.453125
2
thirdparty/RobotCarDataset-Scraper/get_datasets.py
mingu6/hfnet
0
12770217
<gh_stars>0 ''' Gets a list of available datasets from the Oxford Robotcar Dataset website. <NAME> Mar 2019 Oxford Robotics Institute, Oxford University. ''' import requests import re from scrape_mrgdatashare import datasets_url def main(): # open session session_requests = requests.session() # get h...
3.03125
3
diameterOfBinaryTree.py
passionzhan/LeetCode
1
12770218
# -*- encoding: utf-8 -*- ''' @project : LeetCode @File : diameterOfBinaryTree.py @Contact : <EMAIL> @Desc : @Modify Time @Author @Version @Desciption ------------ ------- -------- ----------- 2020-03-10 zhan 1.0 None ''' # Definition for a bi...
3.609375
4
source/import_sql.py
ykjason/MSFlames
0
12770219
import sqlite3 if __name__ == '__main__': SQL_FILE_NAME = "main_solo_vals_flame_advantaged.sql" DB_FILE_NAME = "solo_values_FA.db" connection = sqlite3.connect(DB_FILE_NAME) cursor = connection.cursor() file = open(SQL_FILE_NAME) read_file = file.read() cursor.executescript(read_fi...
2.234375
2
wyze_sdk/service/__init__.py
RebelTat/wyze-sdk
132
12770220
from .api_service import ApiServiceClient # noqa from .auth_service import AuthServiceClient # noqa from .earth_service import EarthServiceClient # noqa from .ford_service import FordServiceClient # noqa from .general_api_service import GeneralApiServiceClient # noqa from .platform_service import PlatformServiceCl...
1.09375
1
config.py
SpikeKing/stylegan2encoder-my
4
12770221
<reponame>SpikeKing/stylegan2encoder-my<gh_stars>1-10 #!/usr/bin/env python # -- coding: utf-8 -- """ Copyright (c) 2019. All rights reserved. Created by <NAME> on 2020/1/9 """ dlatents_dir = 'latent_representations' generated_dir = 'generated_images' result_dir = 'results'
0.996094
1
service/urls.py
zingbretsen/diplomacy
0
12770222
from django.urls import path, include from . import views urlpatterns = [ path( 'game-filter-choices', views.GameFilterChoicesView.as_view(), name='game-filter-choices' ), path( 'games', views.ListGames.as_view(), name='list-games' ), path( ...
1.953125
2
backend/apps/transfer/dropbox_adapter.py
kevindice/cnap-dms
1
12770223
<reponame>kevindice/cnap-dms from allauth.socialaccount.models import SocialAccount, SocialToken import dropbox import os from django.core.exceptions import PermissionDenied class DropboxAdapter(): def download(self, localPath, remotePath, user, uniqueBatchId): token_query = user.profile.tokens.filter(app...
2.109375
2
Tensorflow/my_tensorflow/src/activations/__init__.py
hywel1994/mac-workspace
37
12770224
<gh_stars>10-100 """激活函数""" from .relu import * def linear(x): """""" return x def identity(x): """""" return tf.identity(x) def sigmoid(x): """""" return tf.nn.sigmoid(x) def hard_sigmoid(x): """ x = 0. x < -2.5 = 1. x > 2.5 = 0.2 *...
2.84375
3
EXAMPLES/scripts/scenes/collision.py
K9Kraken/EZpanda
0
12770225
<reponame>K9Kraken/EZpanda render = ez.Node() aspect2D = ez.Node() camera = ez.Camera(parent=render) camera.y = -20 # Create collision shapes: # Collision Sphere: sphere = ez.collision.shapes.Sphere(0.25, parent=render) sphere.parent = None sphere.parent = render # Collide from mask 2: ez.collision.set_mask(sphere,...
2.921875
3
tests/west/project/test_project.py
maciejjo/west
0
12770226
<reponame>maciejjo/west import os from os.path import dirname import shlex import shutil import subprocess import sys import textwrap import pytest from west import config GIT = shutil.which('git') # Assumes this file is west/tests/west/project/test_project.py, returns # path to toplevel 'west' THIS_WEST = os.path.a...
2.1875
2
scripts/get_sample_dataset.py
hankehly/metabase-clickhouse-containerized-deployment
0
12770227
<gh_stars>0 try: from pathlib import Path from urllib.request import urlopen except ImportError: print("python version 3+ required") exit(1) try: import pandas as pd except ImportError: print("sorry, please install pandas too") exit(1) BASE_DIR = Path(__file__).parent.parent.absolute() #...
3.015625
3
numba/tests/test_guvectorize_scalar.py
meawoppl/numba
1
12770228
<filename>numba/tests/test_guvectorize_scalar.py<gh_stars>1-10 """ Tests for guvectorize scalar arguments """ from __future__ import print_function, absolute_import, division import numpy as np from numba import guvectorize from numba import unittest_support as unittest class TestGUVectorizeScalar(unittest.TestCase):...
2.75
3
wavelet.py
fmndantas/wavelet
0
12770229
<reponame>fmndantas/wavelet #!/bin/python3 import numpy as np class Wavelet: def __init__(self, m, g): self.m = m self.g = g self.mg = m * g self.A = None self.mcw = None def _allocate_a_matrix(self): if self.A is None: self.A = np.zeros((self.m, s...
3.21875
3
Mundo 01/daniellindo.py
lucsap/Python3
0
12770230
a, b, c = input().split(' ') def age (dias): dias = dias anos = dias // 360 meses = (((dias / 360) - (dias // 360) * 360) // 30 dyas = ((((dias / 360) - (dias // 360) * 360) / 30) - (((dias / 360) - (dias // 360) * 360) // 30)) *30 print(f'{anos} ano(s), {meses} mes(es) e {dyas} dia(s)') age_a = a...
3.359375
3
migrations/versions/0e4285fb2929_add_newsletter_history.py
betagouv/ecosante
3
12770231
"""Add newsletter history Revision ID: <KEY> Revises: 2<PASSWORD>a6ada0d Create Date: 2020-11-03 12:01:49.481652 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '28165a6ada0d' branch_labels = Non...
1.445313
1
PythonM3/senha.py
MiguelTeixeiraUFPB/PythonM3
0
12770232
<gh_stars>0 while True: senha=int(input('digite sua senha : ')) if senha==2: print('acesso permitido') break else: print('senha invalida, tente novamente')
3.734375
4
learn-python/simple-scripts/2.py
sirius1024/qwer
0
12770233
<filename>learn-python/simple-scripts/2.py #!/usr/bin/env python3 def myFunc(x, y): if not isinstance(x, (int, float)): raise TypeError('x has wrong type') if not isinstance(y, (int, float)): raise TypeError('y has wrong type') else: print(x + y) myFunc(1, 3)
4.15625
4
api/polls/views.py
vetordev/django-api
0
12770234
from django.shortcuts import render from django.http import HttpResponse, HttpRequest # Create your views here. def index(request: HttpRequest): return HttpResponse("Hello, world.")
1.8125
2
back/utils/CommonUtils.py
xiaomogui/json-databook
0
12770235
<reponame>xiaomogui/json-databook<gh_stars>0 import time def formatTime(longtime): # 格式化时间的函数 return time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(longtime)) def formatByte(number): # 格式化文件大小的函数 for(scale, label) in [(1024*1024*1024,"GB"),(1024*1024,"MB"),(1024,"KB")]: if number>=scale: ...
2.734375
3
pyscf/pbc/df/test/test_incore.py
robert-anderson/pyscf
2
12770236
<gh_stars>1-10 # Copyright 2014-2018 The PySCF Developers. 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 r...
1.96875
2
espnet2/text/symbols.py
unparalleled-ysj/espnet
0
12770237
<filename>espnet2/text/symbols.py from espnet2.text.bilingual import thchs_phoneme, cmu_phoneme from espnet2.text.minnan import minnan_phoneme def get_pinyin_list(): thchs_tonebeep = "../../../espnet2/text/bilingual/dictionary/thchs_tonebeep" pinyin_list = [] with open(thchs_tonebeep, 'r', encoding='utf-8...
2.9375
3
pysal/model/spreg/tests/test_error_sp_hom.py
ocefpaf/pysal
1
12770238
''' Unittests for pysal.model.spreg.error_sp_hom module ''' import unittest import pysal.lib from pysal.model.spreg import error_sp_hom as HOM import numpy as np from pysal.lib.common import RTOL import pysal.model.spreg class BaseGM_Error_Hom_Tester(unittest.TestCase): def setUp(self): db=pysal.lib.io.op...
2.234375
2
dictionaries.py
dylancmartin/Voice-Enabled-Record-Search
0
12770239
phonetic_alphabet = {"alpha": "A", "adam": "A", "boy": "B", "bravo": "B", "charlie": "C", "delta": "D", "david": "D", "echo": "E", "edward": "E", "foxtrot": "F", "frank": "F", "golf": "G", "george": "G", "hotel": "H", "henry": "H", "india": "I", "ida": "I", "aida": "I", "juliette": "J", "john": "J", "kilo":...
2.359375
2
exer11.py
KauanLL/excercises-cv
0
12770240
#ref Exercício Python 094 - Unindo dicionários e listas do Curso em vídeo dici = {} lista = [] mulher = [] mmedi = [] m = 0 while True: dici['nome'] = str(input(f'Qual o nome ? ')) dici['sexo'] = str(input(f'Qual o sexo do {dici["nome"]} ? ')) dici['idade'] = int(input(f'Qual a idade do {dici["nome"]} ? '))...
3.59375
4
feature_extraction/demo_utils.py
v-iashin/SpecVQGAN
81
12770241
''' The code is partially borrowed from: https://github.com/v-iashin/video_features/blob/861efaa4ed67/utils/utils.py and https://github.com/PeihaoChen/regnet/blob/199609/extract_audio_and_video.py ''' import os import shutil import subprocess from glob import glob from pathlib import Path from typing import Dict impor...
2.1875
2
build_tools/patch_configure.py
kosyak/naclports_samsung-smart-tv
2
12770242
<reponame>kosyak/naclports_samsung-smart-tv<gh_stars>1-10 #!/usr/bin/env python # Copyright (c) 2013 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Script to patch a configure script in-place such that the libtool ...
1.828125
2
runai/profiler/tf/hooks/__init__.py
bamps53/runai
86
12770243
<reponame>bamps53/runai from .session_run import session_run
0.988281
1
pyquil/experiment/tests/test_group.py
Tommy-Moffat/pyquil
1
12770244
<filename>pyquil/experiment/tests/test_group.py import itertools import pytest from pyquil.experiment._main import TomographyExperiment from pyquil.experiment._result import ExperimentResult from pyquil.experiment._setting import ( ExperimentSetting, plusX, minusX, plusZ, minusZ, plusY, Ten...
2.125
2
resources/_py/_req.py
gabru-md/faces
0
12770245
# PYTHON # <NAME> # https://github.com/gabru-md #BEGIN #Containing import modules import sys import os import cv2 import numpy as np import math import matplotlib.pyplot as plt #END
1.554688
2
appengine/monorail/framework/test/framework_helpers_test.py
allaparthi/monorail
0
12770246
<reponame>allaparthi/monorail # Copyright 2016 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 or at # https://developers.google.com/open-source/licenses/bsd """Unit tests for the framework_helpers module.""" from __future_...
1.742188
2
src/enstore_log_file_search_cgi.py
moibenko/enstore
4
12770247
<reponame>moibenko/enstore #!/usr/bin/env python ###################################################################### # src/$RCSfile$ $Revision$ # import cgi import string import os import posixpath import sys import tempfile import re import getpass import enstore_utils_cgi def go(): # first print the two lin...
2.84375
3
brats_competition/model_training/common/datasets/__init__.py
andriiaprysiazhnyk/brats_competition
2
12770248
from .brats_2d import * from .brats_3d import *
1.195313
1
Caesar cipher/Decrypt.py
ChetanSP8698/Cryptography
0
12770249
<reponame>ChetanSP8698/Cryptography<gh_stars>0 def decrypt(ciphertext, s): pltext = "" for i in range(len(ciphertext)): char = ciphertext[i] if (char.isupper()): pltext += chr((ord(char) - s-65) % 26 + 65) else: pltext += chr((ord(char) - s - 97) % 26 + 97...
3.875
4
aiida/backends/sqlalchemy/migrations/versions/162b99bca4a2_drop_dbcalcstate.py
azadoks/aiida-core
180
12770250
<reponame>azadoks/aiida-core<filename>aiida/backends/sqlalchemy/migrations/versions/162b99bca4a2_drop_dbcalcstate.py # -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the ...
1.523438
2