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
Modulo 3/HelloWorld.py
antonio343/clase
0
15500
<reponame>antonio343/clase import sys print("Hello world, I am",sys.executable, sys.version) x=input("Dame un numero mayor que cero: ") x = int(x) if x < 0: print('Negative changed to zero') x = 0 print(f"El valor final de x es: {x}")
3.734375
4
rasiberryPiGPIOBaseController/driver/test.py
onwebbe/rasiberryPiBaseController
0
15501
<gh_stars>0 def convertToHEXForChar(charList): convertedCharList = [] for message in charList: convertedCharList.append(ord(message)) return convertedCharList def displayChar(line, *args): concatedList = [] for argItem in args: concatedList.extend(argItem) print(len(concatedList)) for ...
3.328125
3
Acquire/Client/_user.py
michellab/BioSimSpaceCloud
2
15502
<filename>Acquire/Client/_user.py import os as _os from enum import Enum as _Enum from datetime import datetime as _datetime import time as _time from Acquire.Service import call_function as _call_function from Acquire.Service import Service as _Service from Acquire.ObjectStore import bytes_to_string as _bytes_to_...
2.328125
2
botasky/utils/MyMAIL.py
5atouristspot/sql_audit
0
15503
<gh_stars>0 #! /usr/bin/python2.7 # -*- coding: utf-8 -*- """ Created on 2017-4-06 @module: MyMAIL @used: send mail """ import smtplib import mimetypes from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.image import MIMEImage from MyLOG import MyL...
2.5
2
db_adapter/curw_fcst/source/source_utils.py
CUrW-SL/curw_db_adapter
2
15504
import json import traceback from db_adapter.exceptions import DatabaseAdapterError from db_adapter.logger import logger """ Source JSON Object would looks like this e.g.: { 'model' : 'wrfSE', 'version' : 'v3', 'parameters': { } } { 'model' : 'OBS_WATER_LEVEL', ...
2.828125
3
tests/kyu_7_tests/test_binary_addition.py
the-zebulan/CodeWars
40
15505
import unittest from katas.kyu_7.binary_addition import add_binary class AddBinaryTestCase(unittest.TestCase): def test_equals(self): self.assertEqual(add_binary(1, 1), '10') def test_equals_2(self): self.assertEqual(add_binary(0, 1), '1') def test_equals_3(self): self.assertEqu...
3.46875
3
var/spack/repos/builtin/packages/netdata/package.py
MiddelkoopT/spack
0
15506
<filename>var/spack/repos/builtin/packages/netdata/package.py # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Netdata(AutotoolsPackage): "...
1.421875
1
examples/my_quickstart.py
87boy/sisu
0
15507
<reponame>87boy/sisu<filename>examples/my_quickstart.py import flask import flask.ext.sqlalchemy import flask.ext.restless # Create the Flask application and the Flask-SQLAlchemy object. app = flask.Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db' db = flask.e...
3.0625
3
src/crypto_wallet/crypto_wallet.py
Sedosa/Blockchain-Analytics
0
15508
<reponame>Sedosa/Blockchain-Analytics """ This is a script that takes a calculates the value of a cryptocurrency portfolio It uses JSON in the with quantities of different cryptocurrencies in the form { "ticker" : volume, "ticker" : volume } gets the live price from an API endpoint and returns the price of ea...
2.9375
3
np43s.py
Muraru-taketa/100_knocks
0
15509
<reponame>Muraru-taketa/100_knocks #np43.py #43. 名詞を含む文節が動詞を含む文節に係るものを抽出 """名詞を含む文節が,動詞を含む文節に係るとき, これらをタブ区切り形式で抽出せよ.ただし,句読点などの記号は出力しないようにせよ. """ import re # 区切り文字 separator = re.compile('\t|,') # かかりうけ kakari = re.compile(r'''(?:\*\s\d+\s) # キャプチャ対象外 (-?\d+) # 数字(係り先) ...
2.765625
3
backend/presentation/Viewsets/comment_view.py
Weida-W/CMPUT404-project-socialdistribution
0
15510
from presentation.models import Author, Follower, Post, Comment from django.shortcuts import get_object_or_404 from presentation.Serializers.comment_serializer import CommentSerializer from rest_framework import viewsets, status from django.http import JsonResponse from rest_framework.response import Response import uu...
2.3125
2
bundle/vim-pandoc-master/python3/vim_pandoc/command.py
ian-mitchell-001/my-vim-configs
0
15511
<reponame>ian-mitchell-001/my-vim-configs<filename>bundle/vim-pandoc-master/python3/vim_pandoc/command.py # encoding=utf-8 import vim import re import sys import os.path import argparse import shlex from subprocess import Popen, PIPE from itertools import chain from vim_pandoc.utils import plugin_enabled_modules, ensu...
2.046875
2
databricks/koalas/strings.py
mercileesb/koalas
1
15512
# # Copyright (C) 2019 Databricks, 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 i...
2.6875
3
python/turbodbc_test/test_cursor_async_io.py
fjetter/turbodbc
0
15513
<filename>python/turbodbc_test/test_cursor_async_io.py import pytest import six from turbodbc import connect from query_fixture import query_fixture from helpers import for_one_database, open_cursor @for_one_database def test_many_batches_with_async_io(dsn, configuration): with open_cursor(configuration, use_as...
2.359375
2
llist_gameboard/urls.py
Plongesam/data-structures-game
2
15514
<filename>llist_gameboard/urls.py """ URL's for the LList Game Board app. """ from django.urls import path from llist_gameboard.api import llist_api from . import views urlpatterns = [ # Views path('', views.llist_game_board, name='llist-game-board'), #Game Play API Calls For Linked List path('l...
2.171875
2
tests/test_most_invoices.py
swimmio/sqlalchemy_swimm
0
15515
from src import most_invoices EXPECTED_RESULT = (14, 'Berlin') def test_most_invoices() -> None: tested_result = most_invoices.get_city_with_most_invoices() assert tested_result == EXPECTED_RESULT
1.835938
2
VIP_modules/widgets/ResultCanvas_QTAgg.py
Nikolaj-K/lab-control-GUI
17
15516
import random import numpy as np import operator from scipy import optimize from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg from matplotlib.figure import Figure as MatplotlibFigure from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm as color_map from matplotlib.ticker import Lin...
2.078125
2
data/external/repositories_2to3/42139/KDDCup13Track2-master/cluster_kruskal.py
Keesiu/meta-kaggle
0
15517
#!/usr/bin/env python # Given weighted graph, perform kruskal-based clustering from common import * from cluster_common import * import argparse import csv import pickle as pickle from collections import defaultdict class unionfind: mp = {} blacklisted_edges = set() # blacklisted_e_nodes = set() # bla...
2.828125
3
third_party/gsutil/oauth2_plugin/oauth2_helper.py
bdero/depot_tools
20
15518
<gh_stars>10-100 # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
2.3125
2
csl-tracking-dependents.py
Marcool04/utilities
10
15519
<gh_stars>1-10 # -*- coding: utf-8 -*- # Python script to manage automatically generated dependents # Author: <NAME> # Version: 2014-04-17 # * Requires lxml library (http://lxml.de/) import os, glob, re, inspect, shutil from lxml import etree # http://stackoverflow.com/questions/50499 folderPath = os.path.dirname(os...
2.28125
2
selenium_browser/__resources/constants.py
kkristof200/selenium_browser
1
15520
# ------------------------------------------------------- class: Constants ------------------------------------------------------- # class Constants: # --------------------------------------------------- Public properties -------------------------------------------------- # USER_AGENT_FILE_NAME = 'ua....
1.40625
1
api/models/__init__.py
victorabarros/challenge-alloy-card
0
15521
<filename>api/models/__init__.py class Game: def __init__(self, *args, **kwargs): self.player_0 = 'white' self.player_1 = 'black' self._new_pieces_game() self.current_player_turn = self.player_0 def _new_pieces_game(self): self.board = { 0: { ...
3.296875
3
spinta/manifests/tabular/helpers.py
atviriduomenys/spinta
2
15522
from __future__ import annotations import csv import pathlib import textwrap from operator import itemgetter from typing import Any from typing import Callable from typing import Dict from typing import IO from typing import Iterable from typing import Iterator from typing import List from typing import NamedTuple fro...
1.515625
2
python/mxnet/context.py
feevos/incubator-mxnet
0
15523
<reponame>feevos/incubator-mxnet<gh_stars>0 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, ...
1.984375
2
theory/model/tconfig.py
ralfonso/theory
4
15524
# theory MPD client # Copyright (C) 2008 <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pr...
1.960938
2
tests/test_error.py
iotanbo/iotanbo_py_utils
0
15525
<reponame>iotanbo/iotanbo_py_utils<gh_stars>0 """Test `iotanbo_py_utils.error.py`.""" from iotanbo_py_utils.error import Error from iotanbo_py_utils.error import ErrorKind def test_error_one_of_arithmetic_errors() -> None: errs = ( Error(ErrorKind.ArithmeticError), Error(ErrorKind.FloatingPointErr...
2.40625
2
setup.py
wontonst/orvibo
0
15526
<filename>setup.py<gh_stars>0 from setuptools import setup, find_packages from os import path from io import open here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name...
1.578125
2
autograder-master/autograder/test_runner.py
Diana1320622/AILabs
0
15527
import glob, os import subprocess from difflib import context_diff class TestRunner(object): def __init__(self, context): self.context = context self.error_count = 0 self.test_count = 0 self.success_count = 0 def run(self): os.getcwd() os.chdir(self.context.repo...
2.640625
3
amazon/model/admin.py
Lakshmivijaykrishnan/mini-amazon
0
15528
from amazon.model import db def __search_by_admin_name(username): query={'username': username} matching_user = db['users'].find(query) if matching_user.count() > 0: return matching_user.next() else: return None
2.796875
3
NER-BiLSTM-CRF-PyTorch-main/src/eval.py
OscarChang46/de-identify-sensitive-data-for-cybersecurity-use-cases-e.g.-PII-and-PHI-data-in-unstructured-text-an
22
15529
# coding=utf-8 import optparse import torch import time import pickle from torch.autograd import Variable from loader import * from utils import * # python -m visdom.server optparser = optparse.OptionParser() optparser.add_option( "-t", "--test", default="data/eng.testb", help="Test set location" ) optparse...
2.171875
2
src/openbiolink/graph_creation/metadata_db_file/edge/dbMetaEdgeSiderInd.py
cthoyt/OpenBioLink
0
15530
<filename>src/openbiolink/graph_creation/metadata_db_file/edge/dbMetaEdgeSiderInd.py<gh_stars>0 from openbiolink.graph_creation.metadata_db_file.edge.dbMetadataEdge import DbMetadataEdge from openbiolink.graph_creation.types.dbType import DbType class DbMetaEdgeSiderInd(DbMetadataEdge): NAME = 'Edge - Sider - Ind...
1.664063
2
rename_files.py
ssinhaleite/util
1
15531
<reponame>ssinhaleite/util import mahotas as mh import glob import os # rename files from 0 to number of files. files = glob.glob("/path/*") files.sort() if not os.path.isdir("/path/renamed/"): os.mkdir("/path/renamed/") for i in range(len(files)): print("Processing " + files[i]) renamedFile = mh.imrea...
2.734375
3
scripts/download_lookml.py
orf/lkml
110
15532
<filename>scripts/download_lookml.py import os import re from base64 import b64decode from pathlib import Path import requests username = os.environ["GITHUB_USERNAME"] password = os.environ["GITHUB_PERSONAL_ACCESS_TOKEN"] auth = requests.auth.HTTPBasicAuth(username, password) directory = Path(__file__).resolve().par...
2.96875
3
docs/conf.py
RTBHOUSE/carreralib
0
15533
import os import sys sys.path.insert(0, os.path.abspath('..')) def get_version(filename): from re import findall with open(filename) as f: metadata = dict(findall(r"__([a-z]+)__ = '([^']+)'", f.read())) return metadata['version'] project = 'carreralib' copyright = '2015-2017 <NAME>' version = g...
2.21875
2
algos/lcs.py
asaini/algo-py
1
15534
def lcs(x, y): """ Longest Common Subsequence """ n = len(x) + 1 m = len(y) + 1 table = [ [0]*m for i in range(n) ] for i in range(n): for j in range(m): # If either string is empty, then lcs = 0 if i == 0 or j == 0: table[i][j] = 0 elif x[i - 1] == y[j - 1]: table[i][j] = 1 + table[i-1]...
3.6875
4
app/models/methods/set_device_info_method.py
luisalvesmartins/TAPO-P100
0
15535
from models.methods import method from typing import Any class SetDeviceInfoMethod(method.Method): def __init__(self, params: Any): super().__init__("set_device_info", params) def set_request_time_milis(self, t: float): self.requestTimeMils = t def set_terminal_uuid(self, uuid: str): ...
2.640625
3
projects/InterpretationReID/train_net.py
SheldongChen/AMD.github.io
17
15536
#!/usr/bin/env python # encoding: utf-8 """ @author: sherlock @contact: <EMAIL> """ import logging import os import sys sys.path.append('.') from fastreid.config import get_cfg from projects.InterpretationReID.interpretationreid.engine import DefaultTrainer, default_argument_parser, default_setup, launch from fastr...
2.109375
2
asynciomeasures/collectors.py
Poogles/aiomeasures
2
15537
from collections import deque from asynciomeasures.events import Event class Collector(deque): """Caped list of metrics """ def flush(self, rate=None, formatter=None): while True: try: metric = self.popleft() if isinstance(metric, Event): ...
2.90625
3
hardware/testbenches/common/drivers/state/driver.py
Intuity/nexus
6
15538
<filename>hardware/testbenches/common/drivers/state/driver.py # Copyright 2021, <NAME>, mailto:<EMAIL> # # 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/LICEN...
2.0625
2
python/primsAlgo.py
Ayushd70/RetartedCodes
0
15539
# Prim's Algorithm in Python INF = 9999999 # number of vertices in graph V = 5 # create a 2d array of size 5x5 # for adjacency matrix to represent graph G = [ [0, 9, 75, 0, 0], [9, 0, 95, 19, 42], [75, 95, 0, 51, 66], [0, 19, 51, 0, 31], [0, 42, 66, 31, 0], ] # create a array to track...
3.609375
4
tests/test_likelihood.py
sa2c/care-home-fit
0
15540
#!/usr/bin/env python '''Tests for the likelihood.py module''' from time import perf_counter_ns import pytest import numpy as np from numpy.testing import assert_array_equal, assert_almost_equal from scipy.stats import gamma import likelihood SMALL_FIT_PARAMS = { 'baseline_intensities': np.asarray([1, 2, np.na...
2.125
2
HalleyComet/bit/models.py
ryanduan/Halley_Comet
0
15541
<reponame>ryanduan/Halley_Comet from django.db import models class Url(models.Model): long_url = models.CharField(max_length=200) short_url = models.CharField(max_length=100) visit_time = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.long_url
2.296875
2
data-structure/queue.py
66chenbiao/sleepace_verification_tool
0
15542
<reponame>66chenbiao/sleepace_verification_tool<filename>data-structure/queue.py<gh_stars>0 import unittest class Queue: """Simple Queue implementation - First in First Out""" def __init__(self): self.__data = [] def enqueue(self, text): """Add new element to queue Arguments: ...
3.671875
4
m2-modified/ims/common/agentless-system-crawler/crawler/plugins/emitters/http_emitter.py
CCI-MOC/ABMI
108
15543
<reponame>CCI-MOC/ABMI<filename>m2-modified/ims/common/agentless-system-crawler/crawler/plugins/emitters/http_emitter.py import logging from iemit_plugin import IEmitter from plugins.emitters.base_http_emitter import BaseHttpEmitter logger = logging.getLogger('crawlutils') class HttpEmitter(BaseHttpEmitter, IEmitte...
1.703125
2
frequency_domain/dwt.py
StephenTaylor1998/Research
0
15544
<filename>frequency_domain/dwt.py<gh_stars>0 import torch import torch.nn as nn import numpy as np import torch.nn.functional as F import pywt class DWTForward(nn.Module): def __init__(self, wave_name="haar"): super(DWTForward, self).__init__() wavelet = pywt.Wavelet(wave_name) ll = np.out...
2.21875
2
facebook_messenger_conversation.py
davidkrantz/FacebookChatStatistics
35
15545
<reponame>davidkrantz/FacebookChatStatistics import sys import numpy as np import json import matplotlib.pyplot as plt from matplotlib.dates import DateFormatter from matplotlib.backends.backend_pdf import PdfPages from datetime import datetime, timedelta import matplotlib.dates as mdates import emoji class FacebookM...
3.03125
3
setup.py
stevearc/pyramid_duh
5
15546
<reponame>stevearc/pyramid_duh<filename>setup.py<gh_stars>1-10 """ Setup file """ import os import sys from setuptools import setup, find_packages HERE = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(HERE, 'README.rst')).read() CHANGES = open(os.path.join(HERE, 'CHANGES.rst')).read() REQUIRE...
1.75
2
telegramhelpers.py
olgamirete/log-public-ip
0
15547
import requests, os from dotenv import load_dotenv load_dotenv() API_TOKEN = os.getenv('API_TOKEN') def sendMessage(user_id: str, text: str, max_retries: int = 1): url = f'https://api.telegram.org/bot{API_TOKEN}/sendMessage' payload = { "chat_id": user_id, "text": text } for i in rang...
2.484375
2
datawinners/questionnaire/tests/test_questionnaire_template.py
ICT4H/dcs-web
1
15548
<reponame>ICT4H/dcs-web<gh_stars>1-10 from unittest import TestCase from mock import patch, MagicMock from mangrove.datastore.database import DatabaseManager from datawinners.questionnaire.library import QuestionnaireLibrary class TestQuestionnaireTemplate(TestCase): def test_get_category_to_doc_mappings(self):...
2.390625
2
chainer_chemistry/links/update/ggnn_update.py
pfnet/chainerchem
184
15549
<gh_stars>100-1000 import chainer from chainer import functions from chainer import links import chainer_chemistry from chainer_chemistry.links.connection.graph_linear import GraphLinear from chainer_chemistry.utils import is_sparse class GGNNUpdate(chainer.Chain): """GGNN submodule for update part. Args: ...
2.265625
2
samples/ast/test.py
Ryoich/python_zero
203
15550
def func(a, b): return a + b def func2(a): print(a) print("Hello")
3.09375
3
badboids/test/test_simulation_parameters.py
RiannaK/Coursework2
0
15551
from numpy.testing import assert_array_almost_equal as array_assert from badboids.boids import SimulationParameters def test_simulation_parameters_init(): """Tests Simulation Parameters constructor""" # Arrange formation_flying_distance = 800 formation_flying_strength = 0.10 alert_distance = 8 ...
2.78125
3
django_town/oauth2/models.py
uptown/django-town
0
15552
#-*- coding: utf-8 -*- from django_town.core.settings import OAUTH2_SETTINGS try: if not OAUTH2_SETTINGS.ACCESS_TOKEN_SECRET_KEY: raise ImportError except KeyError: # import traceback # traceback.print_exc() raise ImportError from django.db import models from django.conf import settings from ...
1.992188
2
util_list_files.py
jhu-alistair/image_utilities
0
15553
# List files in a directory. Useful for testing the path from local_tools import * from image_renamer import ImageRenamer if confirm_config('path'): img_path = get_config('path') fl = ImageRenamer(img_path) for ff in fl.image_files(): print(ff)
2.59375
3
deepmedic_config.py
farrokhkarimi/deepmedic_project
2
15554
<reponame>farrokhkarimi/deepmedic_project import os def deepmedic_config(config_files_path, niftis_path, test_flair_file_name, test_t1c_file_name, mask, prediction_file_name, output_path): with open(os.path.join(config_files_path, 'model', 'modelConfig.cfg'), 'r') as f: lines = f.readlines() ...
2.078125
2
configs/models/aott.py
yoxu515/aot-benchmark
105
15555
import os from .default import DefaultModelConfig class ModelConfig(DefaultModelConfig): def __init__(self): super().__init__() self.MODEL_NAME = 'AOTT'
1.992188
2
main.py
philipperemy/tensorflow-fifo-queue-example
42
15556
<gh_stars>10-100 from __future__ import print_function import time import tensorflow as tf from data import DataGenerator def define_net(input_batch): return input_batch + 20 # simplest network I could think of. def main(): batch_size = 1 coord = tf.train.Coordinator() with tf.name_scope('creat...
2.828125
3
Chapter_3/OO_DimmerSwitch_Model1.py
zjwillie/Object-Oriented-Python-Code
38
15557
<reponame>zjwillie/Object-Oriented-Python-Code # Dimmer Switch class class DimmerSwitch(): def __init__(self, label): self.label = label self.isOn = False self.brightness = 0 def turnOn(self): self.isOn = True # turn the light on at self.brightness def turn...
3.96875
4
python/vosk/transcriber/cli.py
madkote/vosk-api
33
15558
#!/usr/bin/env python3 import logging import argparse from pathlib import Path from vosk import list_models, list_languages from vosk.transcriber.transcriber import Transcriber parser = argparse.ArgumentParser( description = 'Transcribe audio file and save result in selected format') parser.add_argument( ...
2.796875
3
OCR-Flask-app-master/tesseract.py
ChungNPH/OCR
0
15559
import numpy as np import cv2 from imutils.object_detection import non_max_suppression import pytesseract from matplotlib import pyplot as plt def ocr(images): results = [] for image in images: args = {"image": image, "east": "frozen_east_text_detection.pb", "min_confidence": 0.5, "width": 320, ...
2.796875
3
Scripts/autotest/bug/migrations/0003_auto_20180128_2144.py
ludechu/DJevn
0
15560
<reponame>ludechu/DJevn<gh_stars>0 # Generated by Django 2.0 on 2018-01-28 21:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bug', '0002_auto_20180110_1107'), ] operations = [ migrations.AlterField( model_name='bug', ...
1.8125
2
tests/test_validators.py
STYLER-Inc/styler-validation
0
15561
""" Tests for validators """ from decimal import Decimal from unittest.mock import Mock import random import string from styler_validation import validators as va from styler_validation import messages as msg class MyModel: pass class TestIsRequired: def test_is_required(self): val = va.is_require...
3.140625
3
blog/models.py
Libor03/django-final
0
15562
from django.core.files.storage import FileSystemStorage from django.db import models # Create your models here. from datetime import date from django.urls import reverse #Used to generate URLs by reversing the URL patterns from django.contrib.auth.models import User #Blog author or commenter def attachment_path(ins...
2.734375
3
1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 11/E1.py
codeclubbentleigh/Python
12
15563
print(list(range(10, 0, -2))) # if start > end and step > 0: # a list generated from start to no more than end with step as constant increment # if start > end and step < 0: # an empty list generated # if start < end and step > 0: # an empty list generated # if start < end and step < 0 # a list generated from start to ...
4.09375
4
DeepModels/KerasConvNetMNIST.py
amingolnari/Deep-Learning-Course
17
15564
""" github : https://github.com/amingolnari/Deep-Learning-Course Author : <NAME> Keras Version : 2.2.4 Date : 4/12/2018 Keras CNN Classification on MNIST Data Code 301 """ ## If your GPU is AMD , you can use PlaidML Backend # import os # os.environ["KERAS_BACKEND"] = "plaidml.keras.backend" from keras.models import ...
3.90625
4
armstrong.py
Sanchr-sys/Letsupgrade_python7
0
15565
<filename>armstrong.py start = 104200 end = 702648265 for arm1 in range(start, end + 1): exp = len(str(arm1)) num_sum = 0 c = arm1 while c > 0: num = c % 10 num_sum += num ** exp c //= 10 if arm1 != num_sum: continue else: if...
3.4375
3
neji.py
NejiViraj/Viraj
0
15566
<filename>neji.py import requests import json def Neji_version(): # import neji # print(neji.Neji_version()) # output: Hydrogen-0.0.0.1 return "Hydrogen-0.0.0.1" def Neji_upload(put_file_directory_in_string_format): # import neji # print(neji.Neji_upload(r"C:\...\Pictures\trial\black1 - C...
2.796875
3
xmaintnote/ticketing.py
0xmc/maint-notification
0
15567
<gh_stars>0 #!/bin/env python3 """Handling events as tickets The goal here is, provided a maintenance event, create an event if not a duplicate. To determine if not duplicate, use some combination of values to form a key. Methods to delete, update, and otherwise transform the ticket should be available A base class,...
3.21875
3
pycell/prologue/native/set_.py
andybalaam/cell
118
15568
<reponame>andybalaam/cell<filename>pycell/prologue/native/set_.py def _do_set(env, name, value): if env.contains(name): env.set(name, value) elif env.parent is not None: _do_set(env.parent, name, value) else: raise Exception( "Attempted to set name '%s' but it does not e...
2.78125
3
tests/commands/types/test_flag_param.py
cicdenv/cicdenv
8
15569
<reponame>cicdenv/cicdenv<gh_stars>1-10 from cicdctl.commands.types.flag import FlagParamType def test_flag(): flag = '-no-color' parsed = FlagParamType().convert(value=flag, param=None, context={}) assert flag == parsed
2.125
2
modules/util/objects/query_parts/postgres_query_part.py
stevekineeve88/doubloon
0
15570
<filename>modules/util/objects/query_parts/postgres_query_part.py class PostgresQueryPart: """ Object representing Postgres query part """ def get_query(self) -> str: """ Get query Returns: str """ pass
2.046875
2
tools/merge_messages.py
cclauss/personfinder
1
15571
#!/usr/bin/env python # Copyright 2010 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 ...
1.75
2
misc/derwin.py
ssebs/nccsv
0
15572
# derwin.py - testing a window within a window import curses def main(stdscr): # Create container window from stdscr sh, sw = stdscr.getmaxyx() container_win = curses.newwin(sh-1, sw-1, 1, 1) # Create inner window from container win bh, bw = container_win.getmaxyx() box_win = container_win.de...
3.03125
3
test/z_emulator_autoload.py
DXCyber409/AndroidNativeEmulator
3
15573
import sys import logging from unicorn import * from unicorn.arm_const import * from androidemu.emulator import Emulator from UnicornTraceDebugger import udbg logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format="%(asctime)s %(levelname)7s %(name)34s | %(message)s") logger = logging.getLogger(__n...
2.0625
2
community_ext/__init__.py
altsoph/community_loglike
16
15574
#!/usr/bin/python # -*- coding: utf-8 -*- """ This package implements several community detection. Originally based on community aka python-louvain library from Thomas Aynaud (https://github.com/taynaud/python-louvain) """ from .community_ext import ( partition_at_level, modularity, best_partition, ge...
1.632813
2
youbot_gazebo_publisher/src/listener.py
ingjavierpinilla/youBot-Gazebo-Publisher
0
15575
#!/usr/bin/env python import rospy from std_msgs.msg import String from nav_msgs.msg import Odometry from trajectory_msgs.msg import JointTrajectory from control_msgs.msg import JointTrajectoryControllerState def callback_odom(data): print("odom\n" + str(data)) def callback_JointTrajectory(data): print("gri...
2.40625
2
main.py
hustleer/Discord-Encouragement-Bot
0
15576
#Botpic:https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/Red_Rose_Photography.jpg/800px-Red_Rose_Photography.jpg #Botpic:https://commons.wikimedia.org/wiki/File:Red_Rose_Photography.jpg #reference:https://www.youtube.com/watch?v=SPTfmiYiuok import discord import os import requests import json import math, ra...
3.0625
3
mwp_solver/module/Layer/transformer_layer.py
max-stack/MWP-SS-Metrics
0
15577
# Code Taken from https://github.com/LYH-YF/MWPToolkit # -*- encoding: utf-8 -*- # @Author: <NAME> # @Time: 2021/08/29 22:05:03 # @File: transformer_layer.py import torch import math from torch import nn from torch.nn import functional as F from transformers.activations import gelu_new as gelu_bert from module.Att...
2.609375
3
tests/4_ckks_basics.py
TimTam725/SEAL-true
0
15578
import math from seal import * from seal_helper import * def example_ckks_basics(): print_example_banner("Example: CKKS Basics") parms = EncryptionParameters(scheme_type.CKKS) poly_modulus_degree = 8192 parms.set_poly_modulus_degree(poly_modulus_degree) parms.set_coeff_modulus(CoeffModulus.Creat...
2.859375
3
FigureTable/NeuroPathRegions/barplots.py
vkola-lab/multi-task
1
15579
from correlate import * import matplotlib import matplotlib.pyplot as plt import seaborn as sns from matplotlib import rc, rcParams rc('axes', linewidth=1) rc('font', weight='bold', size=10) def barplots(prefixes, regions, stains, corre, error, name, folder, ylim): for stain in stains: barplot(prefixes, r...
2.59375
3
examples/distributed_autofaiss_n_indices.py
Rexiome/autofaiss
0
15580
<reponame>Rexiome/autofaiss """ An example of running autofaiss by pyspark to produce N indices. You need to install pyspark before using the following example. """ from typing import Dict import faiss import numpy as np from autofaiss import build_index # You'd better create a spark session before calling build_in...
2.4375
2
rbkcli/core/handlers/callback.py
rubrikinc/rbkcli
10
15581
<gh_stars>1-10 """Callback module for rbkcli.""" import json from rbkcli.core.handlers.inputs import InputHandler from rbkcli.base.essentials import DotDict, RbkcliException from rbkcli.core.handlers import ApiTargetTools from rbkcli.core.handlers.outputs import OutputHandler class CallBack(ApiTargetTools):...
2.328125
2
portrait/webapp/migrations/0001_initial.py
andela-sjames/Portrait
0
15582
# Generated by Django 2.2.1 on 2019-05-16 23:28 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
1.726563
2
src/greenbudget/app/group/serializers.py
nickmflorin/django-proper-architecture-testing
0
15583
from rest_framework import serializers, exceptions from greenbudget.lib.rest_framework_utils.serializers import ( EnhancedModelSerializer) from greenbudget.app.account.models import BudgetAccount, TemplateAccount from greenbudget.app.tagging.serializers import ColorField from greenbudget.app.subaccount.models imp...
1.914063
2
vaccine_tracker/email.py
Shishir-Bondre/content-alerts
0
15584
<reponame>Shishir-Bondre/content-alerts def email_subject(center_name): return f"[Urgent Reminder] Vaccine slot is now available at {center_name}" def email_body(email_data): return f"Hi, \n" \ f"Vaccine slot is available for below centers \n " \ f"Center name and available data \n {ema...
1.851563
2
objects/CSCG/_2d/mesh/domain/inputs/base.py
mathischeap/mifem
1
15585
# -*- coding: utf-8 -*- """ INTRO @author: <NAME>. Created on Tue May 21 11:57:52 2019 Department of Aerodynamics Faculty of Aerospace Engineering TU Delft, Delft, the Netherlands """ import inspect from screws.freeze.main import FrozenOnly from typing import Dict, Union import nu...
2.203125
2
src/sage/modules/vector_symbolic_dense.py
sloebrich/sage
1
15586
<reponame>sloebrich/sage """ Vectors over the symbolic ring. Implements vectors over the symbolic ring. AUTHORS: - <NAME> (2011-05-25): Added more element-wise simplification methods - <NAME> (2011-05-15): Initial version EXAMPLES:: sage: x, y = var('x, y') sage: u = vector([sin(x)^2 + cos(x)^2, log(2*y) ...
2.4375
2
backend/app/models/weather.py
francoiscolombo/webnews
0
15587
from app import db from app.models.serializer import Serializer class Weather(db.Model, Serializer): id = db.Column(db.Integer, primary_key=True) ip = db.Column(db.String(15), index=True, unique=True) country = db.Column(db.String(80)) flag = db.Column(db.String(512)) town = db.Column(db.String(80...
2.859375
3
conu/backend/nspawn/constants.py
lslebodn/conu
95
15588
<reponame>lslebodn/conu<gh_stars>10-100 # -*- coding: utf-8 -*- # # Copyright Contributors to the Conu project. # SPDX-License-Identifier: MIT # # TODO: move this line to some generic constants, instead of same in # docker and nspawn CONU_ARTIFACT_TAG = 'CONU.' CONU_IMAGES_STORE = "/opt/conu-nspawn-images/" CONU_NSPA...
1.359375
1
onnxruntime/python/tools/quantization/operators/qdq_base_operator.py
mszhanyi/onnxruntime
669
15589
<gh_stars>100-1000 import itertools from ..quant_utils import QuantizedValue, QuantizedValueType, attribute_to_kwarg, quantize_nparray from .base_operator import QuantOperatorBase class QDQOperatorBase: def __init__(self, onnx_quantizer, onnx_node): self.quantizer = onnx_quantizer self.node = onn...
2.078125
2
baya/tests/models.py
hrichards/baya
0
15590
<reponame>hrichards/baya<filename>baya/tests/models.py from django.db import models # Create your models here. class Blag(models.Model): name = models.CharField(max_length=128) class BlagEntry(models.Model): blag = models.ForeignKey(Blag) title = models.CharField(max_length=255) body = models.TextF...
2.28125
2
code/rec_eval.py
dawenl/content_wmf
24
15591
<gh_stars>10-100 import bottleneck as bn import numpy as np from scipy import sparse """ All the data should be in the shape of (n_users, n_items) All the latent factors should in the shape of (n_users/n_items, n_components) 1. train_data refers to the data that was used to train the model 2. heldout_data refers to...
2.390625
2
pgdrive/tests/vis_block/vis_std_t_intersection.py
decisionforce/pgdrive
97
15592
from pgdrive.component.blocks.curve import Curve from pgdrive.component.blocks.first_block import FirstPGBlock from pgdrive.component.blocks.std_t_intersection import StdTInterSection from pgdrive.component.blocks.straight import Straight from pgdrive.component.road.road_network import RoadNetwork from pgdrive.tests.vi...
2.234375
2
version/v 4.0/spider/config.py
zhong-yan/neteasenews
0
15593
<gh_stars>0 from selenium import webdriver BASE_URL = 'http://news.163.com/' # 首页ajax内容,无人机ajax,其实后面?callback=data_callback'可以省略 # 如何快速找到json链接?现在只能手工完成..添加每一个json文档 JSON_INDEX_URLS = [ 'http://temp.163.com/special/00804KVA/cm_yaowen.js?callback=data_callback', 'http://house.163.com/special/00078GU7/guangzhou_...
2.109375
2
assignments/10_conserved/conserved.py
brianUA/be434-fall-2021
0
15594
#!/usr/bin/env python3 """ Author : <NAME> <<EMAIL>> Date : 2021-11-09 Purpose: FInd the similarities between sequences. """ import argparse # -------------------------------------------------- def get_args(): """Get command-line arguments""" parser = argparse.ArgumentParser( description='Rock the...
3.6875
4
ldss_spec/tools/spec_red.py
dsanmartim/ldss_specred
0
15595
<reponame>dsanmartim/ldss_specred #!/usr/bin/env python # -*- coding: utf8 -*- # Loading a few python packages import os import glob import warnings from astropy import log from astropy.io import fits as pyfits import json # Loading iraf packages from pyraf import iraf from pyraf.iraf import onedspec from pyraf.iraf ...
2.203125
2
lookupService/helpers/job_scheduler.py
selfjell/MirMachine
1
15596
<gh_stars>1-10 from ..models import Job from engine.scripts.mirmachine_args import run_mirmachine from .socket_helper import announce_status_change, announce_queue_position, announce_initiation, announce_completed from .maintainer import clean_up_temporary_files from django.utils import timezone from MirMachineWebapp i...
2.109375
2
Exercicios Colecoes Python/exercicio 33 - secao 7 - p1.py
cristinamais/exercicios_python
0
15597
<filename>Exercicios Colecoes Python/exercicio 33 - secao 7 - p1.py """ 33 - Faca um programa que leia um vetor de 15 posicoes e o compacte, ou seja, elimine as posicoes com valor zero. Para isso, todos os elementos a frente do valor zero, devem ser movidos uma posicao para tras no vetor. """ """ vetor = [] count = 0 ...
3.671875
4
multimedia/Pygame/02-plot_pixels.py
vicente-gonzalez-ruiz/python-tutorial
4
15598
import pygame import my_colors as color pygame.init() screen_width = 800 screen_height = 600 screen_size = (screen_width, screen_height) screen = pygame.display.set_mode(screen_size) pygame.display.set_caption("Search the green pixel at the coordinates (x=10, y=100)") running = True while running: screen.set_at((...
3.46875
3
bin/models_vs_uniprot_check/ViPhOG_chunks_rank_summ.py
alexcorm/emg-viral-pipeline
30
15599
#!/usr/bin/env python3 import os import re import glob import sys import operator import ast import argparse ############################################################################################### # This script was written as part of the analysis conducted on the output generated by # # hmmsearch, when...
2.671875
3