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
Lincoln/Rougue/main.py
gcvalderrama/Jarvis
0
12776951
from pythonrouge import pythonrouge ROUGE = './RELEASE-1.5.5/ROUGE-1.5.5.pl' data_path = './RELEASE-1.5.5/data' peer = "Tokyo is the one of the biggest city in the world." model = "The capital of Japan, Tokyo, is the center of Japanese economy." score = pythonrouge.pythonrouge(peer, model, ROUGE, data_path) print(sco...
2.5625
3
rest/microscopy/__init__.py
informatics-isi-edu/microscopy
3
12776952
#!/usr/bin/env python3 # # Copyright 2013-2014 University of Southern California # # 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 # # Unles...
2.171875
2
setup.py
SeanNobel/d4rl-pybullet
130
12776953
<gh_stars>100-1000 from setuptools import setup, find_packages setup(name="d4rl_pybullet", version="0.1", license="MIT", description="Datasets for data-driven deep reinforcement learnig with Pybullet environments", url="https://github.com/takuseno/d4rl-pybullet", install_requires=["gym",...
1.351563
1
test/unit/services/eth/test_eth_extension_block_cleanup_service.py
doubleukay/bxgateway
21
12776954
import os from mock import MagicMock from bxcommon.services.extension_transaction_service import ExtensionTransactionService from bxcommon.services.transaction_service import TransactionService from bxcommon.test_utils import helpers from bxcommon.utils import convert from bxcommon.utils.object_hash import Sha256Hash,...
1.9375
2
peartree/__init__.py
yiyange/peartree
0
12776955
<reponame>yiyange/peartree from . import parallel # noqa: F401 from peartree.__version__ import __version__ # noqa: F401 from peartree.paths import ( load_feed_as_graph, get_representative_feed, load_synthetic_network_as_graph) # noqa: F401 from peartree.plot import generate_plot # noqa: F4...
1.382813
1
typeform_viz/migrations/0001_initial.py
jacobs-hack/jh16_typeform_wrapper
0
12776956
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-18 21:46 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
1.476563
1
old/pepper1/src/libpepper/vals/functions/pepfunction.py
andybalaam/pepper
2
12776957
<filename>old/pepper1/src/libpepper/vals/functions/pepfunction.py # Copyright (C) 2011-2013 <NAME> and The Pepper Developers # Released under the MIT License. See the file COPYING.txt for details. # For just as each of us has one body with many members, and these members # do not all have the same function, Romans 12...
1.945313
2
repokid/plugin.py
boost-entropy-repos-org/repokid
999
12776958
# Copyright 2021 Netflix, 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 w...
2.109375
2
07/07.py
stevenpclark/aoc2019
0
12776959
<reponame>stevenpclark/aoc2019<gh_stars>0 import itertools class Amplifier(object): def __init__(self, x, phase): self.x = x[:] self.inputs = [phase] self.i = 0 def get_output(self, input): self.inputs.append(input) i = self.i x = self.x while True: ...
3.109375
3
tbump/test/project/version_info.py
achary/tbump
50
12776960
<filename>tbump/test/project/version_info.py version_info = (1, 2, 41, "alpha", 1)
1.078125
1
problem-003/Rithvik.py
arnavb/lockheed-martin-practice
2
12776961
with open("Prob03.in.txt") as f: content = f.readlines() content = [x.strip() for x in content] nola = content.pop(0) for x in content: x = x.strip(" ") x = x.split() add = int(x[0]) + int(x[1]) multi = int(x[0]) * int(x[1]) print( str(add) + " " + str(multi))
3.28125
3
simple_autocorrect_pt/insertion_filter.py
brenoskuk/simple_autocorrect_pt
0
12776962
<filename>simple_autocorrect_pt/insertion_filter.py #important https://docs.python.org/3/library/stdtypes.html#string-methods import string from unicodedata import normalize import os #cria versões sem acentos das palavras def delete_acentos(text_input, codif='utf-8'): return normalize('NFKD', text_input).encode('...
2.921875
3
gaphor/C4Model/c4model.py
mrmonkington/gaphor
867
12776963
<reponame>mrmonkington/gaphor # This file is generated by profile_coder.py. DO NOT EDIT! from __future__ import annotations from gaphor.core.modeling.properties import ( association, attribute, relation_many, relation_one, ) from gaphor.UML import Actor, Package class C4Container(Package): descr...
2.09375
2
src/layoutparser/elements/utils.py
frankiert/layout-parser
2,931
12776964
<reponame>frankiert/layout-parser # Copyright 2021 The Layout Parser team. 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-...
1.78125
2
if97/h2o.py
nikolai-kummer/iapws
5
12776965
from if97 import region1, region2, region3, region4 ########################################################### ##### Pressure-Temperature Formulation ##### ########################################################### def idRegion(P, T): """Identification of region from IF97 specification using p...
2.515625
3
apps/users/backends.py
gene1wood/spark
3
12776966
import hashlib import os from django.contrib.auth import models as auth_models from django.contrib.auth.backends import ModelBackend # http://fredericiana.com/2010/10/12/adding-support-for-stronger-password-hashes-to-django/ """ from future import django_sha256_support Monkey-patch SHA-256 support into Django's aut...
2.609375
3
emell/computation/__init__.py
jakevoytko/emell
2
12776967
"""Pure math functions used by the ML routines.""" from emell.computation.constant import constant from emell.computation.identity import identity from emell.computation.l1_loss import l1_loss from emell.computation.l2_loss import l2_loss from emell.computation.quadratic_cost import quadratic_cost from emell.computati...
2.15625
2
ebc/cafe/skins/ebc_cafe_custom_templates/getFotoCapa.py
lflrocha/ebc.cafe
0
12776968
<gh_stars>0 ## Script (Python) "getFotoCapa" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title=Retorna um nome de arquivo para ser usado como foto da capa padrao = [ 'capa01.jpg','capa02.jpg','capa03.jpg','capa04.jpg','capa05...
2.6875
3
wallet/admin.py
dacom-dark-sun/dacom-api
0
12776969
from django.contrib import admin from wallet.models import Wallet, Transaction admin.site.register([ Wallet, Transaction, ])
1.328125
1
flask_project/campaign_manager/insights_functions/count_feature.py
russbiggs/MapCampaigner
24
12776970
<filename>flask_project/campaign_manager/insights_functions/count_feature.py<gh_stars>10-100 __author__ = '<NAME> <<EMAIL>>' __date__ = '17/05/17' from campaign_manager.insights_functions._abstract_overpass_insight_function \ import AbstractOverpassInsightFunction class CountFeature(AbstractOverpassInsightFuncti...
2.546875
3
tutorials/overview.py
fatiando-bot/erizo
0
12776971
<filename>tutorials/overview.py """ .. _overview: Overview ======== Brief description of Erizo and the main functionality. It's a good idea to explain the package conventions. The library ----------- Most classes and functions are available through the :mod:`erizo` top level package. """ import erizo ##########...
2.140625
2
VideoTools/__init__.py
ausport/labelImg
0
12776972
<reponame>ausport/labelImg<gh_stars>0 from .Video import VideoObject
1.109375
1
wxc_sdk/person_settings/monitoring.py
jeokrohn/wxc_sdk
0
12776973
""" call monitoring API """ from typing import Optional, Union from pydantic import Field from .common import PersonSettingsApiChild from ..base import ApiModel, webex_id_to_uuid from ..common import MonitoredMember, CallParkExtension __all__ = ['MonitoredElementMember', 'MonitoredElement', 'Monitoring', ...
2.265625
2
rcsnn/nn_ext/bd_mon.py
pgfeldman/RCSNN
1
12776974
<reponame>pgfeldman/RCSNN<gh_stars>1-10 from rcsnn.nn_ext.CruiserController import CruiserController from rcsnn.nn_ext.MissileController import MissileController from rcsnn.nn_ext.NavigateController import NavigateController from rcsnn.base.DataDictionary import DataDictionary, DictionaryTypes, DictionaryEntry from rcs...
2.9375
3
ssig_site/context_processors.py
LeoMcA/103P_2018_team51
0
12776975
from django.conf import settings as s def settings(request): return { 'GOOGLE_MAPS_KEY': s.GOOGLE_MAPS_KEY, }
1.414063
1
scrapyinfo/urls.py
ToonoW/SpiderManager
34
12776976
from django.urls import path from scrapyinfo import views urlpatterns = [ path('refresh_platform_information', views.RefreshPlatformView.as_view()), path('scrapyds', views.ScrapydList.as_view()), path('scrapyd/<pk>', views.ScrapydDetial.as_view()), path('projects', views.ProjectList.as_view()), p...
1.789063
2
dsp_ap/signals.py
jpauwels/city_dsp_ap
0
12776977
from .util import Audio from abc import ABC, abstractmethod import numpy as np from scipy import fft, signal from IPython.display import display from bokeh.plotting import figure, show from bokeh.layouts import gridplot from bokeh.models.mappers import LinearColorMapper from bokeh.models.ranges import DataRange1d from ...
2.375
2
zksync_sdk/wallet.py
mmagician/zksync-python
0
12776978
<gh_stars>0 from decimal import Decimal from typing import List, Optional, Tuple, Union from zksync_sdk.ethereum_provider import EthereumProvider from zksync_sdk.ethereum_signer import EthereumSignerInterface from zksync_sdk.types import (ChangePubKey, ChangePubKeyCREATE2, ChangePubKeyEcdsa, ...
2.125
2
src/dataset.py
florianvonunold/DYME
5
12776979
<filename>src/dataset.py<gh_stars>1-10 import torch class Dataset(torch.utils.data.Dataset): def __init__(self, encodings, labels, numerical_features, prediction_positions): self.encodings = encodings self.labels = labels self.numerical_features = numerical_features self.prediction...
2.703125
3
tests/integration/relation_name_tests/test_relation_name.py
dlb8685/dbt-redshift
18
12776980
<reponame>dlb8685/dbt-redshift from tests.integration.base import DBTIntegrationTest, use_profile class TestAdapterDDL(DBTIntegrationTest): def setUp(self): DBTIntegrationTest.setUp(self) self.run_dbt(["seed"]) @property def schema(self): return "adapter_ddl" @property de...
2.109375
2
experiments/xor_rxor_spiral_exp/spiral_appendix_plot.py
jdey4/progressive-learning
1
12776981
<reponame>jdey4/progressive-learning<filename>experiments/xor_rxor_spiral_exp/spiral_appendix_plot.py #%% import random import matplotlib.pyplot as plt import tensorflow as tf import tensorflow.keras as keras import seaborn as sns import numpy as np import pickle from sklearn.model_selection import StratifiedKFold f...
2.46875
2
desafio005.py
RickChaves29/Desafios-Python
0
12776982
numero = int(input('Digite um número: ')) a = numero - 1 s = numero + 1 print('Seu número é {} o antecessor é {} e o sucessor é {}'.format(numero, a, s))
4.125
4
nlp/src/aad/aad_session_middleware.py
dupuyjs/lis-project
0
12776983
from starlette.authentication import ( AuthCredentials, AuthenticationBackend, UnauthenticatedUser, ) from .aad_authentication_client import AadAuthenticationClient class AadSessionMiddleware(AuthenticationBackend): async def authenticate(self, request): """Authenticate a request. If ...
2.609375
3
src/lib/bigcities.py
taygetea/weather
1
12776984
<reponame>taygetea/weather import json """ This code cleans the city data from here, and puts it into a JSON file if the city has a population over some threshold. This is used to create a heuristic as to what is meant when a user inputs the name of a city. """ threshold = 100000 with open('worldcitiespop.txt') as...
3.515625
4
Desafios/034 desafio.py
Grigolo/python-aprendizado
0
12776985
''' Escreva um programa que pergunte o salário de um funcionário e calcule o valor do seu aumento -> Para salários superiores a R$ 1250,00 calcule aumento de 10% -> Para os inferiores ou iguais, o aumento é de 15%. ''' salario = float(input("Digite o seu salário: ")) s = salario if salario > 1250: salario = sa...
3.84375
4
src/analyze/track/analyze_exit_points.py
kishorekolli/deep_racer_guru
0
12776986
# # DeepRacer Guru # # Version 3.0 onwards # # Copyright (c) 2021 dmh23 # import tkinter as tk from src.analyze.track.track_analyzer import TrackAnalyzer from src.episode.episode import LAP_COMPLETE, OFF_TRACK, CRASHED, REVERSED, LOST_CONTROL from src.graphics.track_graphics import TrackGraphics from src.analyze.cor...
2.390625
2
treasure/Phase1/Basic Python1/hello.py
treasurechristain/python-challenge-solutions
0
12776987
print('My name is <NAME>')
1.875
2
load_embedding.py
vinayakaraj-t/CIKM2020
1
12776988
import pandas as pd import numpy as np from urllib.parse import urlparse import io import gc import re import string from utils import * import tensorflow as tf def load_vectors(fname,count_words): fin = io.open(fname, 'r', encoding='utf-8', newline='\n', errors='ignore') n, d = map(int, fin.readline()...
2.53125
3
shapelets/phs/ModColor.py
richarms/shapelets
18
12776989
<reponame>richarms/shapelets HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' bold='\033[1m' nobold='\033[0m' Separator="================================%s==================================" silent=0 def Str(strin0,col="red",Bold=True):...
2.453125
2
server.py
teovoinea/opv
1
12776990
<filename>server.py import socket import time UDP_IP = "127.0.0.1" UDP_PORT = 4242 sock = socket.socket(socket.AF_INET, # Internet socket.SOCK_DGRAM) # UDP sock.bind((UDP_IP, UDP_PORT)) start_time = time.time() while True: data, addr = sock.recvfrom(1500) # buffer size is 1024 bytes ...
2.796875
3
pypeit/core/wavecal/spectrographs/templ_keck_deimos.py
mcoughlin/PypeIt
0
12776991
""" Generate the wavelength templates for Keck/DEIMOS""" import os from pypeit.core.wavecal import templates # Keck/DEIMOS def keck_deimos_600ZD(): binspec = 1 slits = [0, 1] lcut = [7192.] xidl_file = os.path.join(templates.template_path, 'Keck_DEIMOS', '600ZD', 'deimos_600.sav') outroot = 'kec...
1.953125
2
setup.py
USGS-EROS/lcmap-merlin
0
12776992
from setuptools import find_packages from setuptools import setup def readme(): with open('README.rst') as f: return f.read() setup(name='lcmap-merlin', version='2.3.1', description='Python client library for LCMAP rasters', long_description=readme(), classifiers=[ 'Devel...
1.453125
1
Day66-75/code/douban/douban/pipelines.py
EngrSaad2/Python-100-Days
37
12776993
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html class DoubanPipeline(object): # def __init__(self, server, port): # pass # @classmethod # def from_craw...
2.078125
2
core/dataset/loader_multi_ocrtoc.py
rakeshshrestha31/DIST-Renderer
0
12776994
<gh_stars>0 ''' This file is partly adapted from the original PMO repository [*] https://github.com/chenhsuanlin/photometric-mesh-optim ''' import numpy as np import os, sys import copy import json import torch import trimesh import open3d as o3d import torch.utils.data import cv2 sys.path.append(os.path.join(os.path....
1.71875
2
tests/test_models/test_state.py
lowercaselife/AirBnB_clone
0
12776995
<reponame>lowercaselife/AirBnB_clone #!/usr/bin/python3 """State unittests""" import unittest from models.state import State import datetime import time class TestState(unittest.TestCase): """class TestState""" def test_state_class_membership_and_attributes(self): """State is right class with correct...
3.0625
3
reproschema/models/tests/test_schema.py
sanuann/reproschema-py
3
12776996
<filename>reproschema/models/tests/test_schema.py from .. import Protocol, Activity, Item def test_constructors(): Protocol() Activity() Item() version = "1.0.0-rc2" proto = Protocol(version=version) assert proto.schema["schemaVersion"] == version act = Activity(version) assert act.sch...
2.203125
2
core/views/__init__.py
capy-pl/nccu-grade-system
2
12776997
from .DeleteView import DeleteView from .ListView import ListView from .View import View from .CreateView import CreateView from .UpdateView import UpdateView from .DetailView import DetailView
1.164063
1
tests/test_services.py
cornelius-muhatia/flask-resource-chassis
0
12776998
from datetime import datetime from unittest import TestCase from flask import Flask from flask_sqlalchemy import SQLAlchemy, Model from sqlalchemy import Integer, String, Column, func from flask_resource_chassis import ChassisService, ValidationError class Test(Model): id = Column(Integer, primary_key=True) ...
3
3
intrinsic/evaluation/classifiers/dataset_readers/word_vector_reader.py
UKPLab/linspector
21
12776999
from typing import Dict, List, Iterator import json import logging from overrides import overrides import tqdm import os import sys import codecs import numpy as np from allennlp.common import Params from allennlp.common.file_utils import cached_path from allennlp.data.dataset_readers.dataset_reader import DatasetRe...
2.359375
2
DictionaryCreator.py
Ramin-RX7/DramaX
14
12777000
<reponame>Ramin-RX7/DramaX import sys import argparse import rx7 as rx from LIB import Dictionary from LIB.Functions import wait_for_input, get_files, pause # TODO: add write to file directly print = rx.style.print BANNER = ''' `7MM"""Yb. .g8"""bgd MM `Yb. .dP' `M M...
2.921875
3
pysnmp/CISCO-LAG-CAPABILITY.py
agustinhenze/mibs.snmplabs.com
11
12777001
<filename>pysnmp/CISCO-LAG-CAPABILITY.py # # PySNMP MIB module CISCO-LAG-CAPABILITY (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-LAG-CAPABILITY # Produced by pysmi-0.3.4 at Mon Apr 29 17:47:12 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user dav...
1.734375
2
src/nodemgr/common/docker_containers.py
jnpr-pranav/contrail-controller
37
12777002
import docker import logging from nodemgr.common.docker_mem_cpu import DockerMemCpuUsageData class DockerContainersInterface: def __init__(self): self._client = docker.from_env() if hasattr(self._client, 'api'): self._client = self._client.api def list(self, all_=True): re...
2.21875
2
basics/solutions/get-data-urllib.py
carlosal1015/ACM-Python-Tutorials-KAUST-2015
5
12777003
<gh_stars>1-10 import urllib urllib.urlretrieve("http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.data", "data") urllib.urlretrieve("http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.names", "description") !cat description
1.898438
2
Ta-Irikulau/framework/pomdp/agent/proxy.py
mjtsai1974/DevBlog
0
12777004
<filename>Ta-Irikulau/framework/pomdp/agent/proxy.py from framework.pomdp.basics.histree import HisTreeNode from framework.pomdp.basics.histree import HisTree import numpy as np """ The design/implementation of the agent in POMDP world """ class Agent(object): def __init__(self): self._transition_model = ...
2.703125
3
experiments/mj60/wf_cutter.py
sweigart/pygama
13
12777005
#!/usr/bin/env python3 import os, time, json import numpy as np import pandas as pd from pprint import pprint import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.colors as mcolors from matplotlib.colors import LogNorm import scipy.signal as signal import argparse import pdb import tinydb as db f...
2.140625
2
TranskribusDU/tasks/DU_Table/DU_Table_Annotator.py
Transkribus/TranskribusDU
20
12777006
# -*- coding: utf-8 -*- """ USAGE: DU_Table_Annotator.py input-folder You must run this on your GT collection to create a training collection. If you pass a folder, you get a new folder with name postfixed by a_ Does 2 things: - 1 - Annotate textlines for Table understan...
2.703125
3
src/spaceone/core/scheduler/scheduler.py
ku524/python-core
0
12777007
# -*- coding: utf-8 -*- import json import logging import time from multiprocessing import Process from uuid import uuid4 import schedule from jsonschema import validate from scheduler import Scheduler as CronSchedulerServer from spaceone.core import queue from spaceone.core.error import ERROR_CONFIGURATION from spac...
2.09375
2
pyros_interfaces_mock/mockpublisher.py
pyros-dev/pyros-common
0
12777008
from __future__ import absolute_import from pyros_interfaces_common.transient_if import TransientIf class MockPublisher(TransientIf): """ MockPublisher is a mock of the class handling conversion from Python API to Publisher call """ def __init__(self, topic_name, topic_type): # getting the ...
2.421875
2
asyncdns/utils.py
rdrey/asyncdns
12
12777009
import base64 as b64 import struct import encodings from .wireformat import * from . import constants MAX_PACKET_SIZE = 4000 _rcode_strings = [ 'No error', 'Format error', 'Server failure', 'Non-existent domain', 'Not implemented', ...
1.382813
1
hobbies/migrations/0004_auto_20200309_1310.py
ablades/sideline
1
12777010
# Generated by Django 3.0.4 on 2020-03-09 20:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hobbies', '0003_userhobbies'), ] operations = [ migrations.AlterField( model_name='hobbies', name='img_url', ...
1.382813
1
tools/xdl/xdlrcviz.py
leonardt/magma
167
12777011
<filename>tools/xdl/xdlrcviz.py import sexpr import sys import os from pprint import pprint from subprocess import Popen, PIPE fname = sys.argv[1] name = os.path.basename(fname).split('.')[0] file = open(fname) source = "" for line in file.readlines(): if line[0] != "#": source += line sexpr.input(source) s = s...
2.65625
3
ming_person_wiki/wiki_crawler/spiders/main.py
RUiN-jiarun/Chinese-Traditional-Art-KG
0
12777012
<reponame>RUiN-jiarun/Chinese-Traditional-Art-KG<gh_stars>0 import scrapy from scrapy.loader import ItemLoader import pymongo from wiki_crawler.items import WikiCrawlerItem import zhconv import re def inter(a,b): return list(set(a)&set(b)) class MainSpider(scrapy.Spider): name = 'main' allowed_domains = [...
2.703125
3
cascade_config.py
ArthurDeclercq/cascade-config
0
12777013
"""Cascading configuration from the CLI and config files.""" __version__ = "0.2.0" import json import os from abc import ABC, abstractmethod from argparse import ArgumentParser, Namespace from typing import Dict import jsonschema class CascadeConfig: """Cascading configuration.""" def __init__(self, valid...
2.921875
3
MINTConformance/src/org/nema/medical/mint/MintDicomCompare.py
aweigold/medical-imaging-network-transport
0
12777014
#!/usr/bin/python # ----------------------------------------------------------------------------- # $Id$ # # Copyright (C) 2010 MINT Working group. All rights reserved. # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this w...
1.546875
2
text_analysis.py
doctorparadox/pyTwintel
2
12777015
import nltk ## helper function to create a word/count dict from a List of tweets def wordCount(tweetlist): words_dict = {} # Remove "common" words cw = open('common_words.txt', 'r') cw_str = cw.read() cw_tokens = nltk.word_tokenize(cw_str) for tweet in tweetlist: line_words = tweet.sp...
3.578125
4
tasks.py
volpatto/pysodes
2
12777016
from invoke import task from invoke.exceptions import Exit from pathlib import Path from typing import Optional import os import shutil import sys BUILD_DIR_DEFAULT = Path(os.environ['BUILD_DIR'].replace(":", "")) def _get_vcvars_paths(): template = r"%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\{edition}\VC...
2.171875
2
setup.py
lucasdavid/convolutional-cuda
5
12777017
<gh_stars>1-10 try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='convolutional', description='Convolutional Networks implemented in CUDA.', long_description=open('README.md').read(), version='0.1', packages=['convolutional'], scripts=[],...
1.289063
1
lazy_vasping/calc_parser.py
alexsquires/lazy_vasping
0
12777018
<reponame>alexsquires/lazy_vasping import time, os, yaml import pandas as pd from tqdm import tqdm from vasppy.summary import find_vasp_calculations from pymatgen.io.vasp import Poscar, Xdatcar, Vasprun from pathlib import Path from monty.serialization import loadfn MODULE_DIR = Path(__file__).resolve().parent def lo...
2.265625
2
tests/test_DB2.py
kschweiger/Mimir3
0
12777019
import sys import os import shutil import json from glob import glob #sys.path.insert(0, os.path.abspath('..')) #sys.path.insert(0, os.path.abspath('.')) #print(sys.path) import mimir.backend.database from mimir.backend.database import DataBase, Model from mimir.backend.entry import Item, ListItem import unittest impor...
2.078125
2
data_loader.py
LiamLYJ/scene_seg
6
12777020
import numpy as np import torch import torchvision.transforms as transforms import torch.utils.data as data import os import pickle import numpy as np import nltk from PIL import Image import cv2 import glob import random # depracated # def get_data_direct(img_size, texture_size, # imgs_fn = None, ...
2.40625
2
dynibatch/utils/segment_container.py
dynilib/dynibatch
4
12777021
<reponame>dynilib/dynibatch #The MIT License # #Copyright (c) 2017 DYNI machine learning & bioacoustics team - Univ. Toulon # #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,...
1.851563
2
api_v3/tests/misc/test_oauth2.py
DrWhax/id-backend
3
12777022
<reponame>DrWhax/id-backend<filename>api_v3/tests/misc/test_oauth2.py from django.test import TestCase from api_v3.factories import SubscriberFactory, ProfileFactory from api_v3.misc import oauth2 from api_v3.models import Subscriber, Action class TicketAttachmentCommentFactoryMixin(TestCase): def setUp(self): ...
2.203125
2
util/loader.py
kangtastic/cryptopals
1
12777023
# -*- coding: utf-8 -*- import base64 import os def loader(file, decoder, split=True): file_dir = os.path.dirname(os.path.abspath(os.path.realpath(__file__))) cdata_path = os.path.join(os.path.split(file_dir)[0], "static", file) if decoder == "hexstring": decoder = bytes.fromhex elif decoder ...
2.78125
3
dbcron/tests/test_calendar.py
cloudspectatordevelopment/django-dbcron
0
12777024
from django.test import TestCase from dbcron.calendar import JobCalendar from dbcron import models from dbcron.tests.factories import JobFactory class JobCalendarFormatMonthTest(TestCase): factory = JobFactory jobs = models.Job.objects.all() def test_meth(self): self.factory.create_batch(5, min=0...
2.484375
2
src/vfxnaming/naming.py
xiancg/naming
8
12777025
<filename>src/vfxnaming/naming.py # coding=utf-8 # MIT License # Copyright (c) 2017 <NAME> and modified by <NAME>- Xian # 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, in...
1.960938
2
mirsnp/formatpt.py
ghkly/miRsnp
0
12777026
#!/usr/bin/python3 # _*_ coding: utf-8 _*_ # @Time : 2022/1/31 19:21 import re import os import pandas as pd from mirsnp.parse_rnahybrid import parse_rnahybrid, get_position, get_mirna_name, get_trans_name from mirsnp.utils import check_outputf, DEFAULT_ENERGY, INTERVAL def get_pt_map(pt): pt_map = {} w...
2.65625
3
tests/test_docs.py
qinfeng2011/wltp
0
12777027
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright 2015-2019 European Commission (JRC); # Licensed under the EUPL (the 'Licence'); # You may not use this work except in compliance with the Licence. # You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl import doctest import io import re imp...
1.960938
2
testsuite/tests/QB13-061__module_config_file/run_test.py
AdaCore/style_checker
2
12777028
def test_epl_single_year_mtl(style_checker): """Style check test against epl_single_year.mtl """ style_checker.set_year(2017) p = style_checker.run_style_checker('--config=module_config.yaml', 'whatever', 'epl_single_year.mtl') style_checker.assertEqual(p.stat...
2.546875
3
tests/test_scripts/test_solph/test_connect_invest/test_connect_invest.py
jnnr/oemof
0
12777029
# -*- coding: utf-8 -*- """Connecting different investment variables. This file is part of project oemof (github.com/oemof/oemof). It's copyrighted by the contributors recorded in the version control history of the file, available from its original location oemof/tests/test_scripts/test_solph/test_connect_invest/test...
2.90625
3
050.py
wittycoder/project_euler
0
12777030
# this method sucks, takes over 30 hours to run on machine!!! from functools import reduce from fast_prime import primes, is_prime import time start = time.time() p = primes(1000000) #p = primes(100000) long_num = 0 long_sum = 0 print('prime time = ', time.time() - start) start = time.time() for x in p[::-1]: ...
3.296875
3
setup.py
oortega/django-async-messages-redux
2
12777031
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='django-async-messages-redux', version='0.4.1', url='https://github.com/maurizi/django-async-messages', author='<NAME>', author_email='<EMAIL>', description="Send asynchronous messages to users (eg from offline s...
1.09375
1
while_num.py
ISE2012/ch5
0
12777032
# -*- coding: utf-8 -*- """ Created on Wed Oct 14 07:44:37 2020 @author: ucobiz """ values = [] # initialize the list to be empty userVal = 1 # give our loop variable a value while userVal != 0: userVal = int(input("Enter a number, 0 to stop: ")) if userVal != 0: # only append if it's v...
4.1875
4
migrations/versions/13934f10a019_.py
dev-johnlopez/offerly
0
12777033
"""empty message Revision ID: 13934f10a019 Revises: Create Date: 2019-10-04 16:58:16.891916 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '13934f10a019' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
1.6875
2
examples/hdx_wizard.py
orest-d/liquer
3
12777034
<reponame>orest-d/liquer<filename>examples/hdx_wizard.py # Example of a wizard for Humanitarian Data Exchange # Make it run from the examples directory import sys sys.path.append("..") # Flask-related imports import logging import webbrowser from flask import Flask import liquer.blueprint as bp # This is the LiQuer b...
2.421875
2
setup.py
ariestiyansyah/SpotiPy
5
12777035
<gh_stars>1-10 from distutils.core import setup from setuptools import find_packages setup( name='SpotiPy', version='1.0.0', scripts=['SpotiPy'], packages=find_packages(exclude=['tests*']), license='WTFPL', description='Spotify player using Python and AppleScript', long_description='Spotify...
1.1875
1
oru_walk_control.py
asherikov/oru_walk_module
9
12777036
<reponame>asherikov/oru_walk_module #!/usr/bin/python #-*- coding: iso-8859-15 -*- # Remote control of walking module import os import sys import time from naoqi import ALProxy from optparse import OptionParser parser = OptionParser() parser.add_option("-a", "--action", action="store", type="int", dest="nao_action...
2.46875
2
tests/workspace/test_geopackage.py
dvntucker/geoscript-py
22
12777037
<filename>tests/workspace/test_geopackage.py<gh_stars>10-100 import unittest from tests.workspace.workspacetest import WorkspaceTest from geoscript.workspace import GeoPackage class GeoPackageWorkspace_Test(WorkspaceTest): def setUp(self): self.ws = GeoPackage('work/data.gpkg') self.remove('widgets') se...
2.015625
2
main.py
nishantchy/python-starter
0
12777038
mylist = ["banana", "apple", "pineapple"] print(mylist) item = mylist[2] print(item) if "banana" in mylist: print("yes") else: print("no") mylist.append("lemon") print(mylist) mylist.insert(2, "grapes") print(mylist) # /item = [0] * 5 # print(item)
3.8125
4
src/python/test/test_wasserstein_distance.py
KirillErofeev/gudhi-devel
0
12777039
from gudhi.wasserstein import wasserstein_distance import numpy as np """ This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. Author(s): <NAME> Copyright (C) 2019 Inria ...
2.234375
2
app/urls.py
brianbrunner/cheddar-oauth-demo
1
12777040
from django.conf.urls import patterns, include, url urlpatterns = patterns('app.views', (r'^$', 'home'), (r'^account/(?P<account_id>.+)$', 'account'), )
1.6875
2
tech/__init__.py
A1eXFei/StockMarket3
0
12777041
import logging from logging.config import fileConfig from util import DatabaseUtil as dbu class StockTechIndicator(object): def __init__(self): self.logger = logging.getLogger(__name__) pass def save_tech_data(self, stock_code, date, dict): update_tech_sql = "update pdtb_stock_tech_dat...
2.890625
3
clarity-ext-scripts/deployment/slices.py
ctmrbio/claritylims
4
12777042
import os import click from subprocess import call import yaml from datetime import datetime import logging logging.basicConfig(level="INFO") tool = "./bin/config-slicer/config-slicer-3.1.14.7.jar" # Fetches a manifest file from the staging server @click.group() def cli(): pass def read_config(): with open...
2.265625
2
microraiden/examples/ticker_client.py
andrevmatos/microraiden
417
12777043
<filename>microraiden/examples/ticker_client.py from tkinter import ttk import tkinter import logging import gevent import click import sys from microraiden import Session from microraiden import utils log = logging.getLogger(__name__) class ETHTickerClient(ttk.Frame): def __init__( self, ...
2.46875
2
deepspeech_pytorch/modules/batch_rnn.py
NikolaiBabkin/deepspeech.pytorch
0
12777044
<gh_stars>0 import torch.nn as nn from .sequence_wise import SequenceWise class BatchRNN(nn.Module): def __init__(self, input_size, hidden_size, rnn_type=nn.LSTM, bidirectional=False, batch_norm=True): super(BatchRNN, self).__init__() self.input_size = input_size self.hidden_size = hidden_...
2.40625
2
spotidl/downloader.py
good-times-ahead/spoti-dl
8
12777045
from yt_dlp import YoutubeDL from dataclasses import dataclass from spotidl.spotify import SpotifySong from spotidl.utils import make_song_title, check_file @dataclass class YoutubeSong: id: str title: str video_url: str def get_config(user_params: dict, song: SpotifySong) -> dict: """ Prepare...
3.125
3
train.py
xhelenfu/Lung-Nodule-Attributes-CT-Network
0
12777046
<reponame>xhelenfu/Lung-Nodule-Attributes-CT-Network import argparse import logging import sys import torch from torch.utils.data import DataLoader from dataio.dataset_lidc import DatasetLIDC from model.model import Network from utils.utils import * import numpy as np def main(config): json_opts = json_file_to...
2.359375
2
Medium/787.py
Hellofafar/Leetcode
6
12777047
# ------------------------------ # 787. Cheapest Flights Within K Stops # # Description: # There are n cities connected by m flights. Each fight starts from city u and arrives at # v with a price w. # # Now given all the cities and flights, together with starting city src and the destination # dst, your task is to ...
3.578125
4
openapi_core/contrib/flask/responses.py
Yarn-e/openapi-core
160
12777048
<reponame>Yarn-e/openapi-core """OpenAPI core contrib flask responses module""" from werkzeug.datastructures import Headers from openapi_core.validation.response.datatypes import OpenAPIResponse class FlaskOpenAPIResponseFactory: @classmethod def create(cls, response): header = Headers(response.heade...
1.585938
2
app.py
rejreign/Docufix-Page-Summary
0
12777049
<filename>app.py<gh_stars>0 from __future__ import absolute_import from __future__ import division, print_function, unicode_literals from flask import Flask, request, jsonify, render_template, redirect # from sumy.parsers.html import HtmlParser from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizer...
2.5625
3
support-script/compare-ilist.py
yxtj/Daiger
0
12777050
<reponame>yxtj/Daiger<gh_stars>0 import os, sys, re def get_file_names(graph_folder): l=os.listdir(graph_folder); rpat=re.compile(r'^ilist-\d+$') rfiles=[] for fn in l: if rpat.match(fn): rfiles.append(fn) rfiles.sort() return rfiles def loadInList(fn): with open(fn) as...
2.421875
2