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
quasimodo/assertion_normalization/subject_removal_submodule.py
Aunsiels/CSK
16
12789451
<filename>quasimodo/assertion_normalization/subject_removal_submodule.py<gh_stars>10-100 from quasimodo.data_structures.submodule_interface import SubmoduleInterface from quasimodo.data_structures.subject import Subject import logging to_remove = ["it", "some", "one", "we", "a", "b", "c", "d", "e", "f", "...
2.40625
2
Nodes/Statements/Iterative/LegacyFor.py
Mohsin-Ul-Islam/YAPL
0
12789452
class Node: def __init__(self, initialization, condition, increment, body): self.initialization = initialization self.condition = condition self.increment = increment self.body = body def visit(self, context): rvalue = None self.initialization.visit(context) ...
3.09375
3
Lecture/Lecture06-Sorting/linearSearch.py
tonysulfaro/CSE-331
2
12789453
<filename>Lecture/Lecture06-Sorting/linearSearch.py<gh_stars>1-10 def linearSearch3(a,key): for i in range(len(a)): if(a[i]== key): return i return None def recLinearSearch(alist, l, r, key): if r<l: return -1 if alist[l]==key: return l return recLinearSearch(ali...
4.125
4
scrapybot/urls/da.py
roadt/scrapybot
0
12789454
from . import mongodb def art(**kwargs): '''generate urls of art with s= (search text), u= (","-separated author_names), t= (","-separated tags) ''' with mongodb() as db: cond = {} _fill_cond(cond, kwargs) urls = map(lambda e: e['url'], db.art.find(cond, {'url': 1})) return {...
2.8125
3
t_time.py
ibramuppal/learning_tensorflow
0
12789455
import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import tensorflow as tf #hello_constant = tf.constant('Hello World!') #with tf.Session() as sess: # output = sess.run(hello_constant) # print(output) # this is how you create an input field in Tensorflow # not the tf.string part but the tf.placeholder part # the...
3.0625
3
tests/test_lambda_assigning.py
GibranHL0/lime-lynter
0
12789456
"""Test the lambda assigning visitor.""" import ast import pytest from lime_lynter.Violations.correctness import LambdaAssigningViolation from lime_lynter.Visitors.Correctness.correctness import LambdaAssigningVisitor lambda_assigning = """ f = lambda x: 2 * x """ @pytest.mark.parametrize('code', [lambda_assigning...
2.890625
3
utils/losses.py
BaekduChoi/DescreenGAN
0
12789457
<filename>utils/losses.py<gh_stars>0 import sys import os sys.path.append(os.path.join(os.path.dirname(__file__),'.')) from torch import nn import torch from torch.nn import functional as F from torch.nn.utils import spectral_norm as SN import torchvision def klvloss(mu,logvar) : return torch.mean(-0.5*torch.sum(...
2.28125
2
leiaapi/generated/api/annotation_api.py
labinnovationdocapost/leia-api-python-sdk
0
12789458
<reponame>labinnovationdocapost/leia-api-python-sdk<filename>leiaapi/generated/api/annotation_api.py<gh_stars>0 # coding: utf-8 """ LEIA RESTful API for AI Leia API # noqa: E501 OpenAPI spec version: 1.0.0 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ fro...
1.9375
2
src/minifier.py
kraifpatrik/Xpanda
0
12789459
# -*- coding: utf-8 -*- import re def minify(code: str) -> str: # Mark end of directives code = re.sub(r"([^\S\n]*#[^\n]+)", "%NEWLINE%\\1%NEWLINE%", code) # Remove comments code = re.sub(r"//[^\n]*", "", code) code = re.sub(r"/\*(?:\*[^/]|[^*])*\*/", "", code) # Remove newlines code = re...
2.96875
3
foodProj/foodApp/admin.py
cs-fullstack-2019-spring/django-authentication-cw-ChelsGreg
0
12789460
<reponame>cs-fullstack-2019-spring/django-authentication-cw-ChelsGreg<filename>foodProj/foodApp/admin.py from django.contrib import admin from .models import FoodModel # Register your models here. admin.site.register(FoodModel)
1.296875
1
registration/migrations/0006_alter_child_birth_date.py
screw-pack/hazel
0
12789461
<filename>registration/migrations/0006_alter_child_birth_date.py # Generated by Django 3.2.4 on 2021-06-11 12:57 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('registration', '0005_auto_20210611_0904'), ] operations = [ migrations.Alte...
1.617188
2
Complexity/complexity.py
dykra/ComplexityEstimator
0
12789462
<reponame>dykra/ComplexityEstimator<gh_stars>0 # -*- coding: utf-8 -*- import numpy as np import signal import sys from Complexity.executionHelpers import exec_fun_with_time, create_loggers_helper, exec_fun_without_output from Complexity.exceptions import TimeOutException import importlib import time def create_logg...
2.578125
3
store/migrations/0009_auto_20200502_1612.py
it5prasoon/ShoppingCart
2
12789463
# Generated by Django 2.0 on 2020-05-02 10:42 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('store', '0008_variation'), ] operations = [ migrations.AddField( model_name='variation', ...
1.53125
2
apps/usuarios/models.py
Marthox1999/ProyectoDesarrolloII
0
12789464
from django.db import models import hashlib from django.core.validators import RegexValidator from inventario.models import DetallesProducto class Cliente(models.Model): TIPO_DOC = { ('PAS','Pasaporte'), ('CC','Cedula de Ciudadania'), ('TI','Tarjeta de Identidad'), } nombre = mo...
2.1875
2
rlpyt/distributions/discrete.py
cambel/rlpyt
17
12789465
<reponame>cambel/rlpyt import torch from rlpyt.utils.tensor import to_onehot, from_onehot class DiscreteMixin: def __init__(self, dim, dtype=torch.long, onehot_dtype=torch.float): self._dim = dim self.dtype = dtype self.onehot_dtype = onehot_dtype @property def dim(self): ...
2.28125
2
results-tables/test/test_experiments.py
alepulver/my-thesis
0
12789466
import experiments import stages from nose.tools import assert_equals import factory rows = None def setup_module(): global rows data = factory.Stages() rows = data.indexed_rows() class TestExperiments: @classmethod def setup_class(cls): stgs = [stages.stage_from(r) for r in rows] ...
2.328125
2
gateway/hmsGateway.py
rauterRaphael/HomeMonitoringSystem
0
12789467
import regex as re import requests from time import sleep from digi.xbee.devices import XBeeDevice, RemoteXBeeDevice, XBee64BitAddress from digi.xbee.exception import TimeoutException from datetime import datetime class MSG_TYPES: ACKN = 0 SYNC = 1 UPDA = 2 SYNACK = 3 class UpdatePayload: lightI...
2.609375
3
src/tests/unit/test_auth_hasher.py
DmitryBurnaev/podcast
1
12789468
import uuid from modules.auth.hasher import PBKDF2PasswordHasher def test_password_encode(): hasher = PBKDF2PasswordHasher() row_password = uuid.<PASSWORD>().hex encoded = hasher.encode(row_password, salt="<PASSWORD>") algorithm, iterations, salt, hash_ = encoded.split("$", 3) assert salt == "tes...
3.140625
3
et_micc_build/__init__.py
etijskens/et-micc-build
0
12789469
# -*- coding: utf-8 -*- """ Package et_micc_build ===================== Top-level package for et_micc_build. """ import et_micc_build.cli_micc_build import et_micc # et-micc and et--micc-build have identical version string, although # they are different packages. __version__ = et_micc.__version__
1.265625
1
apps/profiles/test/test_admin.py
ecoo-app/ecoo-backend
1
12789470
# TODO:FIXME: add tests for the admin pages and for the admin actions
0.90625
1
packjobs/packjobs.py
migueldiascosta/packjobs
0
12789471
#!/usr/bin/env python import os import sys import argparse from glob import glob from textwrap import dedent from collections import namedtuple __version__ = 20200612 __doc__ = """Pack multiple small jobs into large queue jobs * How it works * The script merely generates a queue job script and a (mpi-aware) pyth...
2.5
2
op_search.py
Yale-LILY/QueryReformulator
3
12789472
# -*- coding: utf-8 -*- ''' Custom theano class to query the search engine. ''' import numpy as np import theano from theano import gof from theano import tensor import parameters as prm import utils import average_precision import random class Search(theano.Op): __props__ = () def __init__(self,options): ...
2.296875
2
moe/moe_project.py
cgruber/make-open-easy
5
12789473
<filename>moe/moe_project.py #!/usr/bin/env python # # Copyright 2011 Google Inc. All Rights Reserved. """Objects to represent a MOE Project.""" __author__ = '<EMAIL> (<NAME>)' from moe import base from moe import config_utils from moe.translators import python_translators from moe.translators import translators fr...
2.5
2
print_nightscout_profiles.py
viq/print_nightscout_profiles
0
12789474
#!/usr/bin/env python """ Fetch profile changes from nightscout and display their contents """ # Make it work on both python 2 and 3 # Probably a bit wide, but I'm still learning from __future__ import absolute_import, with_statement, print_function, unicode_literals # Built-in modules import argparse from datetime i...
2.546875
3
duct/sources/redis.py
geostarling/duct
12
12789475
<reponame>geostarling/duct """ .. module:: redis :platform: Unix :synopsis: A source module for redis stats .. moduleauthor:: <NAME> <<EMAIL>> """ from zope.interface import implementer from twisted.internet import defer from twisted.python import log from duct.interfaces import IDuctSource from duct.objects i...
2.03125
2
baseframe/__init__.py
sauravsrijan/pydocstyle-test
0
12789476
<filename>baseframe/__init__.py # -*- coding: utf-8 -*- from __future__ import absolute_import import types import json import gettext from pytz import timezone, UTC from pytz.tzinfo import BaseTzInfo from speaklater import is_lazy_string import six from furl import furl import pycountry from flask import Blueprint...
1.710938
2
checksum_utils.py
piyushkumar2903/python-utils
0
12789477
import hashlib import logging import os import shutil import sys LOGGER = logging.getLogger() _MISSING_FILE_PATH_MSG = "Missing parameter file_path: %s" def generate_sha256_checksum(file_path): ''' Purpose: Calculate the SHA256 checksum of a given file Parameters: Path to file Returns: The SHA2...
3.671875
4
evalutils/evalutils.py
HolyGuacamole/evalutils
0
12789478
# -*- coding: utf-8 -*- import json import logging from abc import ABC, abstractmethod from pathlib import Path from typing import Tuple, Dict, Set, Callable from warnings import warn from pandas import DataFrame, merge, Series, concat from .exceptions import FileLoaderError, ValidationError, ConfigurationError from ...
2.09375
2
snakewm/apps/system/exit snakewm/__init__.py
Admicos/snakeware
0
12789479
import pygame def load(manager, params): return pygame.quit()
1.679688
2
hackerrank/4. sets/4.py
Eurydia/Xian-assignment
0
12789480
<reponame>Eurydia/Xian-assignment n = int(input().rstrip()) s = set() for _ in range(n): country = input().rstrip() s.add(country) print(len(s))
3.375
3
provarme_dashboard/migrations/0011_merge_20190626_1024.py
arferreira/dropazul_app
0
12789481
# Generated by Django 2.0.5 on 2019-06-26 10:24 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('provarme_dashboard', '0009_order'), ('provarme_dashboard', '0010_auto_20190625_2058'), ] operations = [ ]
1.296875
1
bot/botmain.py
TagesenergieBot/Tagesenergie-Twitterbot
0
12789482
<reponame>TagesenergieBot/Tagesenergie-Twitterbot<gh_stars>0 import tweepy from bot import timetool, loggingservice, grabber from secret import keys bot_username = 'Tagesenergie-Twitterbot' logfile_name = bot_username + ".log" def create_tweet(): """Creates the text of the tweet.""" try: text = "Di...
2.578125
3
deepforest/_version.py
ethanwhite/DeepForest-pytorch
0
12789483
__version__ = '__version__ = '0.1.43''
1.0625
1
Plots.py
airanmehr/Utils
0
12789484
<filename>Plots.py ''' Copyleft May 11, 2016 <NAME>, PhD Student, Bafna Lab, UC San Diego, Email: <EMAIL> ''' from __future__ import print_function import matplotlib as mpl import numpy as np import pandas as pd import pylab as plt import seaborn as sns import UTILS.Util as utl import UTILS.Hyperoxia as htl from UTIL...
2.3125
2
tests/test_parser.py
1st1/httptools
1
12789485
import httptools import unittest from unittest import mock RESPONSE1_HEAD = b'''HTTP/1.1 200 OK Date: Mon, 23 May 2005 22:38:34 GMT Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux) Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT ETag: "3f80f-1b6-3e1cb03b" Content-Type: text/html; charset=UTF-8 Content-Length: 13...
2.984375
3
integration_test/test_heartbeat_checker.py
lynix94/nbase-arc
176
12789486
<gh_stars>100-1000 # # Copyright 2015 <NAME>. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
1.710938
2
examples/nonogram/tests/cases.py
notechats/notegame
17
12789487
<reponame>notechats/notegame # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function from pynogram.core.common import ( BOX, SPACE, ) # TODO: more solved rows CASES = [ ([], '???', [SPACE, SPACE, SPACE]), ([1, 1, 5], '---#-- - # ', [ SPACE, SPACE, SPACE, BOX, ...
1.914063
2
weight_comparisons.py
bartulem/KISN-pancortical-kinematics
2
12789488
<gh_stars>1-10 """ Compares tuning-curve rate differences in weight/no-weight sessions. @author: bartulem """ import os import sys import json import scipy.stats import numpy as np from mpl_toolkits.mplot3d.art3d import Line3DCollection import matplotlib.patches as patches import matplotlib.colorbar as cbar import mat...
2.140625
2
neuronpp_gym/agents/agent1d.py
ziemowit-s/neuronpp_gym
1
12789489
from neuronpp_gym.core.agent_core import AgentCore class Agent1D(AgentCore): def build(self, input_size: int): """ Build Agent for 1 Dimensional input. Before Agent step() you need to call: 1. agent.build() 2. agent.init() """ if self._built: ...
3.34375
3
tethysapp/modflow/app.py
Aquaveo/tethysapp-modflow
0
12789490
<filename>tethysapp/modflow/app.py from tethys_sdk.base import TethysAppBase, url_map_maker from tethys_sdk.app_settings import PersistentStoreDatabaseSetting, PersistentStoreConnectionSetting, \ SpatialDatasetServiceSetting, CustomSetting from tethys_sdk.permissions import Permission import tethysapp.modflow.signa...
2.015625
2
mul.py
JohnBernad/Final-project--calculator
0
12789491
def mul(): num1 = float(input("Enter first number : ")) num2 = float(input("Enter second number : ")) p=num1*num2 print("the product is",p)
4
4
cernatschool/test_pixel.py
CERNatschool/beta-attenuation
1
12789492
#!/usr/bin/env python # -*- coding: utf-8 -*- #...the usual suspects. import os, inspect #...for the unit testing. import unittest #...for the logging. import logging as lg #...for the pixel wrapper class. from pixel import Pixel class PixelTest(unittest.TestCase): def setUp(self): pass def tearD...
2.734375
3
module_2/utils.py
JaRo123/ams-ml-python-course
3
12789493
"""Helper methods for Module 2.""" import errno import glob import os.path import pickle import time import calendar import numpy import pandas import matplotlib.colors import matplotlib.pyplot as pyplot import sklearn.metrics import sklearn.linear_model import sklearn.tree import sklearn.ensemble from module_4 import...
1.890625
2
api/resources_portal/views/organization_invitations.py
AlexsLemonade/resources-portal
0
12789494
<gh_stars>0 from rest_framework import serializers, status, viewsets from rest_framework.permissions import BasePermission, IsAuthenticated from rest_framework.response import Response from resources_portal.models import ( Organization, OrganizationInvitation, OrganizationUserSetting, User, ) from reso...
2
2
code/scripts/normalize_to_cpm.py
YimengYang/wol
0
12789495
#!/usr/bin/env python3 """Normalize a BIOM table of counts to copies per million sequences (cpm). Usage: normalize_to_cpm.py input.biom output.biom Notes: This is a pure BIOM solution, in contrast to the more complicated and slower Pandas solution. """ from sys import argv from biom import load_table fro...
2.53125
3
pmutt/tests/reaction/test_pmutt_reaction.py
wittregr/pMuTT
28
12789496
<gh_stars>10-100 # -*- coding: utf-8 -*- """ pmutt.test_pmutt_model_reaction Tests for pmutt module """ import unittest import numpy as np from ase.build import molecule from pmutt import constants as c from pmutt import reaction as rxn from pmutt.empirical.nasa import Nasa from pmutt.statmech import StatMech, presets ...
2.3125
2
src/pybel_tools/summary/visualization.py
cthoyt/pybel-tools
6
12789497
# -*- coding: utf-8 -*- """Functions for summarizing graphs. This module contains functions that provide aggregate summaries of graphs including visualization with matplotlib, printing summary information, and exporting summarized graphs """ import logging import matplotlib.pyplot as plt import pandas as pd import ...
3.640625
4
setup.py
noisyboiler/flask-wamp
4
12789498
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) # Get th...
1.664063
2
loadCal.py
weizy0219/loadBank
1
12789499
<reponame>weizy0219/loadBank<filename>loadCal.py from openpyxl import Workbook,load_workbook from itertools import product,chain ''' 从Excel文件中载入阻抗列表,经过计划并格式化 ''' def loadfromexcel ( excelfilename ): """ 从指定的Excel文件中读取所有有效行并返回所有行组成的元组 :param excelfilename :return:allrows """ wb=load_workbook(...
2.75
3
tests/test_categories_api.py
lv10/bestbuyapi
10
12789500
<gh_stars>1-10 import json from bestbuyapi import BASE_URL, BestBuyAPI api_name = "categories" def test_build_url(bbapi): sample_url = f"{BASE_URL}{api_name}(sku=43900)" payload = {"query": "sku=43900", "params": {"format": "json"}} url, thePayload = bbapi.category._build_url(payload) assert sampl...
2.765625
3
wildlifecompliance/migrations/0255_inspection_inspection_type.py
preranaandure/wildlifecompliance
1
12789501
<reponame>preranaandure/wildlifecompliance<filename>wildlifecompliance/migrations/0255_inspection_inspection_type.py # -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-07-17 02:20 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migrati...
1.203125
1
indico_chat_bot/bot.py
NRodriguezcuellar/indico-chat-bot
2
12789502
import atexit import hashlib import hmac import re import os import sys import time from datetime import datetime, timedelta import click import requests from pytz import timezone, utc from urllib.parse import urlencode, urljoin from . import notifiers from .util import read_config from .storage import Storage from.e...
2.421875
2
identity/ecrfs/setup/projects/dream.py
LCBRU/identity
0
12789503
from identity.ecrfs.setup.standard import SEX_MAP_1M2F3T_SEX from identity.setup.participant_identifier_types import ParticipantIdentifierTypeName from identity.setup.redcap_instances import REDCapInstanceDetail from identity.setup.studies import StudyName from identity.ecrfs.setup import crfs, RedCapEcrfDefinition cr...
2.015625
2
CarRegistration/__init__.py
infiniteloopltd/PyCarRegistrationAPI
0
12789504
#!/usr/bin/env python # Copyright 2012 Locu <<EMAIL>> <<EMAIL>> from api import *
1.015625
1
src/product/urls.py
aqifcse/django-coding-task
0
12789505
from django.urls import path from django.views.generic import TemplateView from product.views.product import CreateProductView from product.views.variant import VariantView, VariantCreateView, VariantEditView app_name = "product" urlpatterns = [ # Variants URLs path('variants/', VariantView.as_view(), name='...
1.828125
2
src/graph_gui/animations/bfs_animation.py
3ddelano/graph-visualizer-python
0
12789506
""" File: bfs_animation.py Author: <NAME> Repo: https://github.com/3ddelano/graph-visualizer-python License: MIT """ from ..constants import ( CURRENT_EDGE_COLOR, CURRENT_NODE_COLOR, SEEN_EDGE_COLOR, SEEN_NODE_COLOR, START_NODE_COLOR, ) from ..interfaces.animation_interface import AnimationInterfac...
2.984375
3
pyxtal/miscellaneous/bugs/bug.py
ubikpt/PyXtal
127
12789507
from pyxtal import pyxtal from ase.io import read from ase.spacegroup.symmetrize import prep_symmetry from spglib import get_symmetry_dataset #ans1 = get_symmetry_dataset(s, symprec=1e-2) #print(ans1) s = pyxtal() s.from_seed('bug.vasp', tol=1e-2) print(s) #s1=s.subgroup(eps=0.1, group_type='t+k', max_cell=4) #for a ...
2.328125
2
app/shared_code/queries.py
KubaTaba1uga/spam_recycler
2
12789508
import logging from mailboxes.models import MailboxModel, MailboxGuestModel from reports.models import ReportModel, MessageModel, MessageEvaluationModel def get_user_guest_mailboxes(user): """ Returns guest mailboxes of a user. """ return (guest_mailbox.mailbox for guest_mailbox in MailboxGuestModel.o...
2.421875
2
Code(Temp Identity)/Extra Code for testing cases/Barcode.py
ayushcv/TemperatureIdentity
2
12789509
import cv2 import numpy as np from pyzbar.pyzbar import decode #This is the barcode testing phase. This allowed me to create the validation of the accounts. img = cv2.imread('/home/pi/Resources12/frame (1).png') cap = cv2.VideoCapture(0) cap.set(3, 640) cap.set(4, 480) with open('/home.pi/Resources12\myDataFile.text...
2.921875
3
config.py
tomoyan/streamlit-main
0
12789510
<gh_stars>0 import streamlit as st import random from beem import Steem from beem.nodelist import NodeList from beem.instance import set_shared_blockchain_instance # Streamlit app settings def app_config(): st.set_page_config( page_title='Steemit Club', page_icon="🐟", initial_sidebar_stat...
2.1875
2
tests/test_reanimation.py
aybugealtay/expert-meme
0
12789511
import unittest from expert_meme import reanimate class TestReanimation(unittest.TestCase): def test_reanimate(self): """Tests reanimation works as planned, with no unintended consequences, such as evil monster barnacles""" x = reanimate.Reanimator('Chet') self.assertFalse(x.aliv...
3.203125
3
text-to-speech.py
mshaheerz/text-to-speech
1
12789512
import subprocess def execute_unix(inputcommand): p = subprocess.Popen(inputcommand, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() return output a = input("enter the text :") # create wav file # w = 'espeak -w temp.wav "%s" 2>>/dev/null' % a # execute_unix(w) # tts using espeak c = ...
2.9375
3
figures/pipeline/site_monthly_metrics.py
Groove-eLearning/figures
43
12789513
"""Populate Figures site monthly metrics data """ from __future__ import absolute_import from datetime import datetime from django.db import connection from django.db.models import IntegerField from django.utils.timezone import utc from dateutil.relativedelta import relativedelta from figures.compat import RELEASE_L...
2.421875
2
RPGBattle/battle.py
wdmwilcox/RPGBattle
0
12789514
<reponame>wdmwilcox/RPGBattle from character import Gnome from time import sleep class Battle(object): def __init__(self, player_level): self.player_level = player_level self.battle_over = False self.enemies = [Gnome(1)] self.loot = {} def generate_enemies(self): pass def display_informatio...
2.515625
3
web-app/app.py
radekv23/data-representation-project
0
12789515
from flask import Flask, request, render_template, redirect, jsonify, flash, session from flask.config import ConfigAttribute from flask.helpers import url_for import requests from functools import wraps import json import base64 from io import BytesIO from matplotlib.backends.backend_agg import FigureCanvasAgg as Fig...
2.90625
3
procsim/core/exceptions.py
stcorp/procsim
1
12789516
<reponame>stcorp/procsim ''' Copyright (C) 2021 S[&]T, The Netherlands. Exceptions ''' from typing import Any class ProcsimException(Exception): ''' Base for all procsim exceptions ''' pass class TerminateError(ProcsimException): ''' Program terminated externally (CTRL-C or SIGTERM) '...
2.328125
2
interpreter/interpreter/interpreter.py
Gu1nness/AsmInterpreter
1
12789517
<reponame>Gu1nness/AsmInterpreter # -*- coding:utf8 -*- from queue import Queue from copy import deepcopy from .memory import * from .number import Number from ..lexical_analysis.lexer import Lexer from ..lexical_analysis.token_type import * from ..syntax_analysis.parser import Parser from ..syntax_analysis.tree import...
2.28125
2
exercicios/ex001.py
OtavioMalta/PythonExercicios
1
12789518
<reponame>OtavioMalta/PythonExercicios n = int(input('digite um numero')) s = n + 1 a = n - 1 d = n*2 t = n*3 r =n**(1/2) print('o numero sucessor de {} é {} e o antecessor é {}'.format(n, s, a)) print('o dobro de {} é {} o triplo é {} e a raiz quadrada {}'.format(n, d, t, r)) print('a tabuada de {} é:'.format(n),n*1,n...
4.1875
4
deui/html/view/body_element.py
urushiyama/DeUI
1
12789519
from .element import Element class Body(Element): """ Represents content body. """ def __str__(self): return "body"
2.703125
3
freetrade/auth.py
DainisGorbunovs/freetrade
32
12789520
import json import logging import os import uuid from collections import OrderedDict from datetime import datetime from typing import Callable import jwt import requests from freetrade import Credentials logger = logging.getLogger(__name__) class Auth: def __init__(self, credentials: Credentials, email: str, u...
2.484375
2
src/rascore/util/functions/col.py
mitch-parker/rascore
7
12789521
<reponame>mitch-parker/rascore # -*- coding: utf-8 -*- """ Copyright 2022 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unl...
1.1875
1
src/functions.py
datapartnership/HospitalAccessibility
3
12789522
import requests, json, os, pickle import networkx as nx import GOSTnets as gn import matplotlib.pyplot as plt from matplotlib import gridspec from time import sleep import pandas as pd import geopandas as gpd import rasterio from rasterio.windows import Window from rasterio.plot import * from rasterio.mask import * i...
2.734375
3
instackup/sql_tools.py
Lavedonio/alexandria
0
12789523
<gh_stars>0 import os import logging import sqlite3 import psycopg2 import mysql.connector import pandas as pd from .general_tools import fetch_credentials # Logging Configuration logger = logging.getLogger(__name__) logger.setLevel(logging.WARNING) formatter = logging.Formatter("%(asctime)s:%(name)s:%(levelname)s: ...
2.703125
3
tests/test_1_os.py
malte70/OSDetect
3
12789524
import os import OSDetect def test_get_os(): OS = OSDetect.info.getOS() TRAVIS_OS_NAME = os.getenv("TRAVIS_OS_NAME") if TRAVIS_OS_NAME is None: assert isinstance(OS, str) elif TRAVIS_OS_NAME == "linux": assert OS.lower() == TRAVIS_OS_NAME.lower()
2.734375
3
src/common/services/domain.py
kei49/parse-web-python
0
12789525
from sqlalchemy import select from db.models import Domain, DomainModel from db.database import get_session def create_domain(domain_str): session = get_session() with session.begin(): domain = Domain(domain=domain_str) session.add(domain) return DomainModel.from_orm(domain) def read_a...
2.921875
3
src/kss/customer.py
yuriel-v/ks-shopification
0
12789526
<reponame>yuriel-v/ks-shopification """ Data structure for a particular customer Fields: - number: int - uid: int - name: str - email: str - reward_title: str - backing_minimum: float - reward_id: int - bonus_support: float - pledge_amount: float - pledged_at: str (could be a datetime) - rewards_sent: str - pledged_st...
2.9375
3
tests/testfile_bridge_the_gap.py
augmentedfabricationlab/bridge_the_gap
0
12789527
from __future__ import division from __future__ import absolute_import from __future__ import print_function from compas.geometry import Point, Frame, Vector from bridge_the_gap.assembly import BridgeAssembly from bridge_the_gap.assembly import BridgeElement my_assembly = BridgeAssembly() myFrameSet = [ Frame(Point...
1.742188
2
Bits/lengths.py
vit-shreyansh-kumar/DailyWorkAtHome
0
12789528
<reponame>vit-shreyansh-kumar/DailyWorkAtHome __about__ = """ Bit Lengths """ l = int(1).bit_length() print("BIT LENGTH:", l)
1.789063
2
wdhtools/view_tools.py
VPrincekin/wdhtools
0
12789529
#!/usr/bin/env python # coding: utf-8 # @Author: dehong # @Date: 2020-06-09 # @Time: 18:05 # @Name: view_tools import seaborn as sns import matplotlib.pyplot as plt import pandas as pd from featexp import get_univariate_plots, get_trend_stats def histogram_plot(data, feature): """ 利用直方图查看特征数据的具体分布情况(常用来查看目标...
2.5625
3
cs251tk/toolkit/__main__.py
renovate-tests/cs251-toolkit
0
12789530
<gh_stars>0 import datetime import functools import sys from concurrent.futures import ProcessPoolExecutor, as_completed from threading import Thread from os import makedirs, getcwd import os.path import logging from ..common import chdir, run from ..specs import load_all_specs, check_dependencies from .find_update im...
1.992188
2
StatRethinking/_build/jupyter_execute/chapter13-ModelsWithMemory.py
xishansnow/StatRethinking
0
12789531
<filename>StatRethinking/_build/jupyter_execute/chapter13-ModelsWithMemory.py<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # # 第 13 章 分层模型
1.289063
1
keyword_extraction/keywords_TR.py
luciabura/study-helper
2
12789532
""" Keyphrase extraction implementation based on the guidelines given in the paper on TextRank by Mihalcea et al This is """ import networkx as nx import operator import text_processing.preprocessing as preprocess from utilities.read_write import read_file WINDOW_SIZE = 2 INCLUDE_GRAPH_POS = ['NN', 'JJ', 'NNP', 'N...
3.328125
3
server/zmq_server_pirate.py
merlinran/acorn-precision-farming-rover
143
12789533
<gh_stars>100-1000 """ ********************************************************************* This file is part of: The Acorn Project https://wwww.twistedfields.com/research ********************************************************************* Copyright (c) 2019-2...
1.984375
2
simulateur/Troncon.py
Passaudage/PLD
0
12789534
<reponame>Passaudage/PLD import Coordonnees import Feu import Voie import Vehicule import random class Troncon: const_largeur_voie = 350 # centimètres def __init__(self, intersection_tete, intersection_queue, coordonnees_debut, coordonnees_fin, directions_sens_1, directions_sens_2): #sens1 : gauche vers droi...
2.5625
3
user_input_handling_functions.py
ShawnJSavoie2/ToBeRedoneOrDiscarded
0
12789535
# IDLE (Python 3.8.0) # user-input-handling functions def user_input_handling_function_first(): print() user_input = input('Enter: ') print() good_to_go = 'no' errors = [] while good_to_go == 'no': if ' ' in user_input: print('The sequence of characters contains one or more...
4.03125
4
woodwork/__init__.py
willsmithorg/woodwork
81
12789536
<filename>woodwork/__init__.py # flake8: noqa import pkg_resources from .config import config from .type_sys import type_system from .type_sys.utils import list_logical_types, list_semantic_tags from .utils import concat_columns, read_file from .version import __version__ import woodwork.column_accessor import woodwo...
1.828125
2
stock_correlation/anomaly.py
looselyconnected/fastai
0
12789537
import numpy as np import pandas as pd def get_anomaly_score(data, test_window, control_window): # Given a pd Series, return the anomaly score series. # The data given should be sorted in the time order. test_mean = data.rolling(test_window).mean() control_data = test_mean.rolling(control_window) ...
3.15625
3
dhub/dhub.py
datahub-projects/dhub
0
12789538
<gh_stars>0 #!/usr/bin/env python3 import os, sys, argparse, json, time, datetime, subprocess from dateutil.parser import parse as parsedate from blessings import Terminal # #the BDOL does not admire scripts which are also importable modules #well frack him # #so absolute imports work in script mode, we need to import...
2.203125
2
Assignments/HW3_NFA/problem1.py
Ursinus-CS373-F2021/CoursePage
0
12789539
<filename>Assignments/HW3_NFA/problem1.py import numpy as np import random num_examples = 10 to_print = True for seed in [0]: np.random.seed(seed) n_accept = 0 results = [] if to_print: print("<table style=\"width:200px;\"><tr><td>Input</td><td>Result</td></tr>") for i in range(num_examples...
3.625
4
sprites/__init__.py
ghandic/FinalSpace
0
12789540
from .earth import Earth from .enemy import Enemy from .player import Player from .explosion import Explosion
1.179688
1
controller/Base_controller.py
jvpersuhn/APIRest
0
12789541
<reponame>jvpersuhn/APIRest from flask_restful import Resource from flask import request,json from dao.Base_dao import BaseDao class BaseController(Resource): def __init__(self, model): self.db = BaseDao(model) def get(self, id=None): if id: return self.db.select_by_id(id) ...
2.65625
3
giter8.py
ochinchina/PyGiter8
0
12789542
#!/usr/bin/python import os import os.path import random import re import requests import shutil import sys import xml.etree.ElementTree as ET class TempField: """ the template field in the giter8 """ def __init__( self, fields_value ): self._format_methods = { 'upper': self._upper, ...
2.703125
3
FHEM/bindings/python/fhempy/lib/meross/meross_device.py
dominikkarall/fhempy
16
12789543
<reponame>dominikkarall/fhempy import asyncio from fhempy.lib.generic import FhemModule from fhempy.lib import fhem, fhem_pythonbinding from meross_iot.model.enums import OnlineStatus, Namespace class meross_device: def __init__(self, logger, fhemdevice: FhemModule): self.logger = logger self.fhem...
2.1875
2
src/commander/commands.py
anudeep22003/simple-langauge-pipeline
1
12789544
<reponame>anudeep22003/simple-langauge-pipeline<gh_stars>1-10 #### Python Package Imports #### import sys, os from termcolor import colored, cprint from collections import defaultdict #### Manual Import #### from abstract_factory import Command, CommandHandler sys.path.append(os.path.join(os.getcwd(),'src','interfacer...
2.328125
2
maillogger/exceptions.py
Natureshadow/maillogger
2
12789545
<gh_stars>1-10 class MailloggerError(Exception): """Maillogger base exception class""" class NotFoundFileError(MailloggerError): """Raised when a target file to load can not be found""" msg = 'Could not find "{filepath}"' def __init__(self, filepath: str) -> None: super().__init__(self.msg.f...
2.890625
3
swiftly/filelikeiter.py
haydendigital/swiftly
23
12789546
""" Wraps an iterable to behave as a file-like object. Copyright (c) 2010-2012 OpenStack Foundation 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 ...
3.28125
3
DQNs/memory_module.py
abr-98/Reinforcement-Learning
0
12789547
<reponame>abr-98/Reinforcement-Learning import random import numpy as np from collections import namedtuple,deque class replayBuffer: transition=namedtuple('Transition',['s','a','r','s_','nd']) def __init__(self,capacity): self.capacity=capacity self.memory=deque([],maxlen=self.capacity) ...
2.953125
3
mix_label_1.py
hififi/hello-VAD
1
12789548
# -*- coding: utf-8 -*- """ Created on Thu Aug 31 09:24:17 2017 @author: gao 得到语音和噪声的混合数据 以.pkl的形式存放在mix_data中 """ import librosa as lr import numpy as np import os import pickle import matplotlib.pyplot as plt from ams_extract import ams_extractor resample_rate=16000 nfft = 512 offset = int(nfft/2) def genAndSave...
2.109375
2
Task/Zebra-puzzle/Python/zebra-puzzle-2.py
djgoku/RosettaCodeData
0
12789549
from itertools import permutations import psyco psyco.full() class Number:elems= "One Two Three Four Five".split() class Color: elems= "Red Green Blue White Yellow".split() class Drink: elems= "Milk Coffee Water Beer Tea".split() class Smoke: elems= "PallMall Dunhill Blend BlueMaster Prince".split() class Pet: elems...
3.28125
3
Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/ph-8.11-uppercase-lowercase-capitalize.py
shihab4t/Books-Code
0
12789550
s1 = "Bangladesh" s_up = s1.upper() print(s_up) s_lo = s1.lower() print(s_lo) s_cap = s1.capitalize() print(s_cap)
3.6875
4