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
result/fig1_opt/plot.py
HongdaWu1226/FedPNS
0
34900
import sys import argparse import matplotlib.pyplot as plt import numpy as np import pickle def load_obj(name): pkl_path = "" with open(pkl_path + name + ".pkl", 'rb') as f: return pickle.load(f) def load_prun_obj(name): pkl_path = "" with open(pkl_path + name + ".pkl", 'rb') as f: r...
2.296875
2
tools/solViewer.py
afkummer/gecco2020-brkga
0
34901
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # # The MIT License (MIT) # # Copyright (c) 2020 # <NAME> (<EMAIL>), # <NAME> (<EMAIL>) and # <NAME> (<EMAIL>) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal i...
2.390625
2
test cases/unittest_homophone_module.py
johnbumgarner/wordhoard
40
34902
#!/usr/bin/env python3 """ This Python script is designed to perform unit testing of Wordhoard's Homophones module. """ __author__ = '<NAME>' __date__ = 'September 20, 2020' __status__ = 'Quality Assurance' __license__ = 'MIT' __copyright__ = "Copyright (C) 2021 <NAME>" import unittest from wordhoard import Homophon...
3.625
4
resist/types/models/message.py
an-dyy/Resist
4
34903
from __future__ import annotations from typing import Literal, TypedDict, Union, final from typing_extensions import NotRequired from .asset import AssetData class YoutubeLinkEmbedMetadata(TypedDict): type: Literal["YouTube"] id: str timestamp: NotRequired[str] class TwitchLinkEmbedMetadata(TypedDict...
2.59375
3
baseline/DRL/rpm.py
sugam45/CS771_project
0
34904
# from collections import deque import numpy as np import random import torch import pickle as pickle from torch.autograd import Variable class rpm(object): # replay memory def __init__(self, buffer_size): self.buffer_size = buffer_size self.buffer = [] self.priorities = [] ...
2.265625
2
Line bot/app/models_for_line.py
FatTtyLoser/LINE-Bot
0
34905
from app import handler from app import line_bot_api, handler from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, ImageSendMessage ) import random import re import urllib def google_isch(q_string): q_string= {'tbm': 'isch' , 'q' : q_string} url = f"http://www.google.com/search?{urllib...
2.40625
2
misc/m2g_script.py
PSSF23/neurodata.io
9
34906
<reponame>PSSF23/neurodata.io import boto3 import botocore from ruamel.yaml import YAML yaml = YAML() CLIENT = boto3.client('s3', # region_name='us-east-1', config=botocore.client.Config(signature_version=botocore.UNSIGNED)) RESOURCE = boto3.resource('s3') REF_DIFF = {'SWU4': 'http://fcon_1000....
1.648438
2
pip_services3_prometheus/count/__init__.py
pip-services-python/pip-services-prometheus-python
0
34907
<filename>pip_services3_prometheus/count/__init__.py # -*- coding: utf-8 -*- __all__ = ['PrometheusCounterConverter', 'PrometheusCounters'] from .PrometheusCounterConverter import PrometheusCounterConverter from .PrometheusCounters import PrometheusCounters
1.25
1
datenight/urls.py
SarahJaine/date-night
0
34908
<reponame>SarahJaine/date-night from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from datenight.views import HomePageView urlpatterns = [ # Examples: url(r'^$', HomePageView.as_view(), name='home'), # url(r'^blog/', include('blog.urls')), ur...
2.03125
2
plugins/view/tightening_controller_views.py
masami10/airflow
1
34909
# -*- coding: utf-8 -*- from flask import flash, make_response, request import json from flask_babel import lazy_gettext, gettext from datetime import datetime from flask_login import current_user from flask_appbuilder.actions import action from flask_appbuilder import expose from flask import redirect from plugins.com...
1.953125
2
src/python/nimbusml/internal/entrypoints/models_ovamodelcombiner.py
GalOshri/NimbusML
2
34910
# - Generated by tools/entrypoint_compiler.py: do not edit by hand """ Models.OvaModelCombiner """ from ..utils.entrypoints import EntryPoint from ..utils.utils import try_set, unlist def models_ovamodelcombiner( training_data, predictor_model=None, model_array=None, use_probabilitie...
2.46875
2
kraken/public/views.py
peterdemartini/KrakenMaster
1
34911
<filename>kraken/public/views.py # -*- coding: utf-8 -*- '''Public section, including homepage and signup.''' from flask import (Blueprint, request, render_template, flash, url_for, redirect, session) from flask.ext.login import login_user, login_required, logout_user from kraken.extensions import ...
2.296875
2
web/game/migrations/0002_message_visible.py
ihsgnef/kuiperbowl
0
34912
<filename>web/game/migrations/0002_message_visible.py # Generated by Django 2.2.7 on 2020-05-29 19:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('game', '0001_initial'), ] operations = [ migrations.AddField( model_name='...
1.546875
2
problem_49/test_prime_permutations.py
plilja/project-euler
0
34913
<filename>problem_49/test_prime_permutations.py import unittest from prime_permutations import * class PrimePermutationsTest(unittest.TestCase): def test_prime_permutations(self): self.assertEqual(sorted(prime_permutations()), sorted([2969, 6299, 9629])) if __name__ == '__main__': unittest.main()
2.875
3
lecture10/inventory_hitting_time.py
BenGravell/optimal-control-course
0
34914
<reponame>BenGravell/optimal-control-course<filename>lecture10/inventory_hitting_time.py import numpy as np import numpy.linalg as la import matplotlib.pyplot as plt capacity = 6 prob_demand_mass = np.array([0.7, 0.2, 0.1]) prob_demand_supp = np.array([0, 1, 2]) T = 50 P = np.array([[0, 0, 0, 0, prob_demand_mass[0],...
2.890625
3
mongoproj/First_Q_City/Paris.py
OuassimAKEBLI/MongoDB
0
34915
import requests import json from pprint import pprint from pymongo import MongoClient def get_vparis(): url = "https://opendata.paris.fr/api/records/1.0/search/?dataset=velib-disponibilite-en-temps-reel&q=&rows" \ "=251&facet=name&facet=is_installed&facet=is_renting&facet=is_returning&facet=nom_arrondis...
2.796875
3
Youcheng/twitter_REST.py
xiaoli-chen/Godel
0
34916
#from twython import Twython from twitter import Twitter, OAuth, TwitterHTTPError, TwitterStream import json CONSUMER_KEY = 'pxeqo0ylpUayIIl5Nlc2kBmkb' CONSUMER_SECRET = '<KEY>' ACCESS_TOKEN = '<KEY>' ACCESS_SECRET = '<KEY>' oauth = OAuth(ACCESS_TOKEN, ACCESS_SECRET, CONSUMER_KEY, CONSUMER_SECRET) # Initiate the co...
3.25
3
app/risk/RiskEngine.py
OuissalTAIM/jenkins
0
34917
# -*- coding: utf-8 -*- from app.data.DataManager import DataManager from app.model.Simulator import Simulator from app.data.Client import Driver from app.tools.Logger import logger_sensitivity as logger from app.model.ScenarioGenerator import ScenarioGeneratorFactory as SGF from app.config.env import ScenarioGenerat...
2.171875
2
upf/python/upf.py
aiplan4eu/upf-poc
0
34918
<reponame>aiplan4eu/upf-poc import importlib from dataclasses import dataclass from typing import FrozenSet, Callable, List @dataclass class Action: name: str precondition: FrozenSet[str] positive_effect: FrozenSet[str] negative_effect: FrozenSet[str] @dataclass class Problem: actions: List[Acti...
2.390625
2
rnnparser/RecursiveNN/tests/test_code_gen.py
uphere-co/nlp-prototype
0
34919
<filename>rnnparser/RecursiveNN/tests/test_code_gen.py # -*- coding: utf-8 -*- import numpy as np import pytest from recursiveNN.nodes import Val,Var,VSF, Add,Mul,Dot,CTimes,Transpose, Node def test_variables_of_expressions(): ran=lambda x : np.random.random(x)-0.5 x=Var('x',ran((1,4))) y=Var('y',ran((1,4...
2.5625
3
tests/api/schemas/test_product_schema.py
igor822/product-categorization
19
34920
<reponame>igor822/product-categorization import unittest import pytest from src.api.schemas.product_schema import ProductSchema class ProductSchemaTests(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_validate_valid_product(self): product = {"name": "P...
3.015625
3
InterAutoTest_W/testcase/t_pytest/pytest_class.py
xuguoyan/pytest_api3
7
34921
<filename>InterAutoTest_W/testcase/t_pytest/pytest_class.py<gh_stars>1-10 #coding=utf-8 """ 1.定义类; 2.创建测试方法test开头 3.创建setup_class, teardown_class 4.运行查看结果 """ import pytest class TestClass(): def test_a(self): print('test_a') def test_b(self): print('test_b') def setup_class(self): ...
2.0625
2
tests/test_cmd.py
mick88/poeditor-sync
6
34922
from unittest import TestCase from click.testing import CliRunner, Result from poeditor_sync.cmd import poeditor class CmdReadOnlyTokenTest(TestCase): def setUp(self) -> None: super().setUp() self.runner = CliRunner(env={ 'POEDITOR_CONFIG_FILE': 'tests/test.yml', 'POEDITO...
2.40625
2
cats/cats_simus/vortex.py
brunellacarlomagno/CATS
0
34923
import numpy as np import cv2 import proper from cats.cats_simus import * def vortex(wfo, CAL, charge, f_lens, path, Debug_print): n = int(proper.prop_get_gridsize(wfo)) ofst = 0 # no offset ramp_sign = 1 #sign of charge is positive #sampling = n ramp_oversamp = 11. # vortex is oversampled for a ...
2.28125
2
Search/rotated/Solution.py
Voley/AlgorithmicProblemsV2
0
34924
<gh_stars>0 # Problem code def search(nums, target): return search_helper(nums, target, 0, len(nums) - 1) def search_helper(nums, target, left, right): if left > right: return -1 mid = (left + right) // 2 # right part is good if nums[mid] <= nums[right]: # we fall for it i...
3.703125
4
src/util_walk_sftp.py
Chrisebell24/walk_sftp
0
34925
import paramiko class _FastTransport(paramiko.Transport): def __init__(self, sock): super(_FastTransport, self).__init__(sock) self.window_size = 2147483647 self.packetizer.REKEY_BYTES = pow(2, 40) self.packetizer.REKEY_PACKETS = pow(2, 40)
2.140625
2
Project_2/source/project_2.py
larsjbro/FYS4150
0
34926
<reponame>larsjbro/FYS4150<gh_stars>0 ''' Created on 14. sep. 2017 v2 @author: LJB ''' from __future__ import division, absolute_import from numba import jit, float64, int64, void import numpy as np import matplotlib.pyplot as plt import timeit _DPI = 250 _SIZE = 0.7 def figure_set_default_size(): F = plt.gcf(...
1.851563
2
L.py
tomerl20-meet/meet2018y1mini-proj
0
34927
import turtle screen = turtle.Screen() # this assures that the size of the screen will always be 400x400 ... screen.setup(400, 400) # ... which is the same size as our image # now set the background to our space image screen.bgpic("game.over") turtle.mainloop()
3.203125
3
demo.py
PAV-Laboratory/cryptoblotter
1
34928
#!/usr/bin/env python3 from cryptofeed import FeedHandler from cryptofeed.defines import TRADES from cryptoblotter.exchanges import CoinbaseBlotter from cryptoblotter.trades import SequentialIntegerTradeCallback, ThreshCallback from cryptoblotter.trades.constants import VOLUME async def trades(trade): print(tra...
2.296875
2
mars/tensor/datasource/tests/test_datasource.py
HarshCasper/mars
2
34929
<reponame>HarshCasper/mars # Copyright 1999-2020 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
1.5625
2
setup.py
n1k0r/tplink-wr-api
5
34930
#!/usr/bin/env python from setuptools import find_packages, setup with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() setup( name="tplink-wr-api", version="0.2.1", url="https://github.com/n1k0r/tplink-wr-api", author="n1k0r", author_email="<EMAIL>", description=...
1.390625
1
examples/qp2q/preprocessing/session_data_processing.py
xeisberg/pecos
288
34931
"""The module contains functions to preprocess input datasets into usable format.""" import gc import gzip import json import logging import multiprocessing as mp import pathlib import sys from itertools import repeat import numpy as np import scipy.sparse as smat logging.basicConfig( stream=sys.stdout, format...
2.6875
3
tests/test_policyengine_deviceManager.py
Brewgarten/c4-policy-engine
0
34932
import logging import pytest from c4.devices.policyengine import PolicyEngineManager from c4.messaging import Router, RouterClient from c4.system.configuration import States, Roles from c4.system.deviceManager import DeviceManager from c4.system.messages import (LocalStartDeviceManager, LocalStopDeviceManager, ...
2.046875
2
astropy/wcs/tests/test_tabprm.py
MatiasRepetto/astropy
4
34933
<filename>astropy/wcs/tests/test_tabprm.py # Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import pytest import numpy as np from astropy import wcs from . helper import SimModelTAB def test_wcsprm_tab_basic(tab_wcs_2di): assert len(tab_wcs_2di.wcs.tab) == 1 t = t...
1.742188
2
services/dts/tests/unit/test_physical_appliance.py
honzajavorek/oci-cli
0
34934
# coding: utf-8 # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. import os import random import shutil import string import tempfile import unittest try: import unittest.mock as mock except ImportError: import mock from OpenSSL import crypto from services.dts.src.oci_cli_dts.a...
2.46875
2
collect.py
peitur/colag
1
34935
#!/usr/bin/env python3 import sys,re,os,re, datetime import requests import json import hashlib import getopt from pprint import pprint from pathlib import Path ################################################################################ ## Hashing large files ####################################################...
2.46875
2
common.py
camillescott/explotiv
1
34936
import os pkg_path = os.path.dirname(__file__) static_folder = os.path.join(pkg_path, 'static') template_folder = os.path.join(pkg_path, 'templates')
1.820313
2
ALDS/ALDS1_12_C.py
yu8ikmnbgt6y/MyAOJ
1
34937
import sys import io import time import pprint input_txt = """ 10 0 2 1 1 2 3 1 2 3 3 2 1 2 2 3 1 6 10 3 1 4 1 4 1 7 1 5 2 3 1 6 1 6 2 3 1 8 1 7 2 5 1 8 4 8 1 9 100000 9 0 """ #sys.stdin = open("ALDS1_11_D_in11.txt","r")#io.StringIO(input_txt) #sys.stdin = io.StringIO(input_txt) sys.stdin = ope...
3.1875
3
ejercicios/mayores_de_edad.py
carlosviveros/Soluciones
4
34938
<reponame>carlosviveros/Soluciones<filename>ejercicios/mayores_de_edad.py """AyudaEnPython: https://www.facebook.com/groups/ayudapython # ------------------------ REDACCION ORIGINAL ------------------------ 1. Crear un programa que pida un número entero e imprimirlo, si no se ingresa deberá preguntar otra vez por el n...
3.984375
4
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
Polidea/SiriusObfuscator
427
34939
<reponame>Polidea/SiriusObfuscator """ Test expression command options. Test cases: o test_expr_options: Test expression command options. """ from __future__ import print_function import os import time import lldb import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest import * class ExprOption...
1.765625
2
lib_bgp_data/collectors/mrt/mrt_base/tables.py
jfuruness/lib_bgp_data
16
34940
<gh_stars>10-100 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """This module contains class MRT_Announcements_Table Announcements_Table inherits from the Generic_Table class. The Generic_Table class allows for the conection to a database upon initialization. Also upon initialization the _create_tables function is c...
2.734375
3
src/permission/backends.py
dkopitsa/django-permission
234
34941
# coding=utf-8 """ Logical permission backends module """ from permission.conf import settings from permission.utils.handlers import registry from permission.utils.permissions import perm_to_permission __all__ = ('PermissionBackend',) class PermissionBackend(object): """ A handler based permission backen...
2.5
2
watex/core/erp.py
WEgeophysics/watex
3
34942
<reponame>WEgeophysics/watex # -*- coding: utf-8 -*- # Copyright (c) 2021 <NAME>, zju-ufhb # This module is part of the WATex core package, which is released under a # MIT- licence. """ =============================================================================== Copyright (c) 2021 <NAME> Permission is hereby grant...
1.476563
1
py_tdlib/constructors/location.py
Mr-TelegramBot/python-tdlib
24
34943
<gh_stars>10-100 from ..factory import Type class location(Type): latitude = None # type: "double" longitude = None # type: "double"
1.90625
2
Task2G.py
caizicharles/IA-Floodwarning
0
34944
<gh_stars>0 from floodsystem.flood import stations_level_over_threshold from floodsystem.stationdata import build_station_list, update_water_levels from floodsystem.analysis import polyfit from floodsystem.datafetcher import fetch_measure_levels from floodsystem.utils import sorted_by_key import numpy as np from dateti...
2.578125
3
simplecoin_rpc_client/scheduler.py
uingei/simplecoin_rpc_client_20171208
2
34945
import logging import os import sqlalchemy import setproctitle import argparse import yaml from apscheduler.scheduler import Scheduler from cryptokit.rpc_wrapper import CoinRPC from simplecoin_rpc_client.sc_rpc import SCRPCClient logger = logging.getLogger('apscheduler.scheduler') os_root = os.path.abspath(os.path.di...
2.109375
2
SpeakyTo/interfaces/irc2.py
SpeakyTo/SCORE
0
34946
<reponame>SpeakyTo/SCORE from iconservice import * class IRC2Interface(InterfaceScore): """ An interface of ICON Token Standard, IRC-2""" @interface def name(self) -> str: pass @interface def symbol(self) -> str: pass @interface def decimals(self) -> int: pass ...
2.421875
2
io_import_planar_code.py
tsurutana/planer_code-importer-blender
0
34947
bl_info = { "name": "Import Planar Code", "author": "<NAME>", "version": (1, 0), "blender": (2, 80, 0), "location": "File > Import > Planar Code", "description": "Import planar code and construct mesh by assigning vertex positions.", "warning": "", "support": "TESTING", "wik...
2.25
2
webtool/server/models/equipment.py
wodo/WebTool3
13
34948
<filename>webtool/server/models/equipment.py # -*- coding: utf-8 -*- from django.db import models from .mixins import SeasonsMixin from .time_base import TimeMixin from . import fields class EquipmentManager(models.Manager): def get_by_natural_key(self, code): return self.get(code=code) class Equipmen...
2.125
2
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/NV/draw_vulkan_image.py
JE-Chen/je_old_repo
0
34949
<reponame>JE-Chen/je_old_repo '''OpenGL extension NV.draw_vulkan_image This module customises the behaviour of the OpenGL.raw.GL.NV.draw_vulkan_image to provide a more Python-friendly API Overview (from the spec) This extension provides a new function, DrawVkImageNV(), allowing applications to draw a s...
1.96875
2
orders/urls.py
techonerd/kobbyshop
4
34950
<filename>orders/urls.py from django.urls import path from django.utils.translation import gettext_lazy as _ from .views import create_order_view, order_detail_view, generate_order_pdf_view urlpatterns = [ path('admin/order/<int:order_id>/', order_detail_view, name='admin_order_detail'), path('admin/order/<in...
1.742188
2
ncov_ism/_visualization.py
z2e2/ncov_ism
0
34951
<gh_stars>0 import logging import matplotlib import pickle matplotlib.use('Agg') import matplotlib.colors as mcolors import numpy as np import matplotlib.pyplot as plt plt.ioff() font = {# 'family' : 'serif', # Times (source: https://matplotlib.org/tutorials/introductory/customizing.html) 'family': 'sans-serif'...
2.40625
2
gsh/plugins/executors/ssh.py
varunl/gsh
23
34952
import gevent from gevent.queue import Queue, Empty from gevent_subprocess import Popen, PIPE from gsh.plugin import BaseExecutor, BaseInnerExecutor class SshExecutor(BaseExecutor): def __init__(self, args, kwargs): self.ssh_opts = kwargs.get("ssh_opts", []) super(SshExecutor, self).__init__(args,...
2.3125
2
algDev/visualization/plot_indicators.py
ajmal017/ralph-usa
0
34953
from models.indicators import Indicators import numpy as np import matplotlib.pyplot as plt def plot_prices(ax, prices, line_style): i = np.arange(len(prices)) ax.plot(ax, prices, line_style) return ax def plot_macd(ax, prices, slow_period, fast_period, line_style='k-'): macd = Indicators.macd(price...
2.515625
3
app/db_worker.py
ryan-rushton/Basement
5
34954
<reponame>ryan-rushton/Basement from multiprocessing import Process, Queue from app.es_search import add_to_es, delete_all_es, reindex_es, delete_from_es from logging import getLogger from flask_sqlalchemy import SQLAlchemy import sys from app import app from .models import Paste logger = getLogger(__name__) def del...
2.65625
3
tests/strings/test_basic.py
jaebradley/python_problems
0
34955
""" Unit Test for strings.basic problems """ from unittest import TestCase from strings.basic import alphabetize class TestAlphabetize(TestCase): """ Unit Test for alphabetize method """ def test_should_return_alphabet(self): """ Test alphabetize method using every uppercase and low...
3.953125
4
Python3/HayStack_API.py
ConsensusGroup/Haystack
1
34956
<gh_stars>1-10 #This script is going to be used API calls but first it will serve as a testing script. from IOTA_Module import * from Configuration_Module import * from Tools_Module import * from UserProfile_Module import * from Cryptography_Module import * from NodeFinder_Module import * from DynamicPublicLedger_Modu...
2.34375
2
clickctl/cli.py
ciscochina/click-demo
7
34957
<reponame>ciscochina/click-demo<filename>clickctl/cli.py # Copyright 2017 Cisco Systems, 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:...
2.1875
2
database/Database.py
TADebastiani/SistemasEspecialistas
0
34958
<gh_stars>0 import sqlite3 from pathlib import Path class Database: def _cursor(self): root = Path(__file__).parent self._conn = sqlite3.connect(f'{root}/knowledge.sqlite') return self._conn.cursor() def _commit(self): self._conn.commit() def _close(self): self._...
3.125
3
setup.py
Mr-TelegramBot/python-tdlib
24
34959
#!/usr/bin/env python from distutils.core import setup setup( name="python-tdlib", version="1.4.0", author="andrew-ld", license="MIT", url="https://github.com/andrew-ld/python-tdlib", packages=["py_tdlib", "py_tdlib.constructors", "py_tdlib.factory"], install_requires=["werkzeug", "simplej...
1.1875
1
viz_funcs.py
cjsmith015/phytochemical-diversity-cannabis
0
34960
import numpy as np import pandas as pd import scipy.stats as scs import itertools from collections import defaultdict import textwrap import pingouin as pg from statsmodels.stats.multicomp import pairwise_tukeyhsd from sklearn.neighbors import NearestNeighbors from sklearn.decomposition import PCA from sklearn.cluster...
1.960938
2
app.py
yumei86/iRamen_linebot
16
34961
<gh_stars>10-100 from flask import Flask, request, abort from linebot import (LineBotApi, WebhookHandler) from linebot.exceptions import (InvalidSignatureError) from linebot.models import * import json import os from linebot.exceptions import LineBotApiError from flask_sqlalchemy import SQLAlchemy from sqlalchemy.exc ...
2.1875
2
PyOpenWorm/quantity.py
nheffelman/pyopdata
0
34962
<filename>PyOpenWorm/quantity.py<gh_stars>0 import pint as Q class Quantity: """ Enables the use of measurement units in our statements """ ur = Q.UnitRegistry() @classmethod def parse(self, s): q = self.ur.Quantity(s) my_q = Quantity(0,"mL") my_q._quant = q return m...
3.375
3
rhapsody_web/models.py
wbadart/rhapsody
0
34963
from itertools import chain from django.db import models from random import choices class Node(object): def neighbors(self): raise NotImplementedError def graph(self, depth=1): if not depth: return {self: set()} elif depth == 1: return {self: set(self.neighbors...
2.609375
3
examples/kddcup2011/track1.py
zenogantner/MML-KDD
1
34964
#!/usr/bin/env ipy import clr clr.AddReference("MyMediaLite.dll") clr.AddReference("MyMediaLiteExperimental.dll") from MyMediaLite import * train_file = "trainIdx1.firstLines.txt" validation_file = "validationIdx1.firstLines.txt" test_file = "testIdx1.firstLines.txt" # load the data training_data = IO.K...
2.203125
2
resdk/resources/kb/mapping.py
tristanbrown/resolwe-bio-py
0
34965
"""KB mapping resource.""" from __future__ import absolute_import, division, print_function, unicode_literals from ..base import BaseResource class Mapping(BaseResource): """Knowledge base Mapping resource.""" endpoint = 'kb.mapping.admin' query_endpoint = 'kb.mapping.search' query_method = 'POST' ...
2.203125
2
wavshape.py
IngoKl/wavlength
0
34966
<reponame>IngoKl/wavlength<gh_stars>0 """Scans a given path (folder) for .wav files recursively and plots them all into files.""" from pathlib import Path, PurePath import matplotlib.pyplot as plt import numpy as np from numpy import fft as fft import click import scipy.io.wavfile from wavlength import get_files, plot_...
3.21875
3
lib/ocr.py
jabbalaci/Bash-Utils
73
34967
#!/usr/bin/env python3 """ OCR with the Tesseract engine from Google this is a wrapper around pytesser (http://code.google.com/p/pytesser/) """ import config as cfg from lib.process import get_simple_cmd_output def image_file_to_string(fname): """Convert an image file to text using OCR.""" cmd = "{tesseract...
2.953125
3
geiger-counter/remote-logging.py
SaintGimp/BeagleBoneHardware
2
34968
<reponame>SaintGimp/BeagleBoneHardware #!/usr/bin/env python3 import gimpbbio.gpio as gpio import serial import re import http.client import urllib import threading import queue import sys import datetime import time import socket import logging import logging.handlers import argparse import Adafruit_BMP.BMP085 as BMP...
2.28125
2
migrations/versions/0e26a2d71475_.py
Toluwalemi/flask-audiofile-server
0
34969
"""empty message Revision ID: 0e26a2d71475 Revises: Create Date: 2021-03-19 00:13:23.019330 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '0e26a2d71475' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
1.351563
1
2_functions.py
codernayeem/python-cheat-sheet
0
34970
<reponame>codernayeem/python-cheat-sheet # Functions print("************* Function ***********") # Simple function without any arguments/parameters def say_welocme(): return print('Welocme') # Simple function with arguments/parameters def say_helo(name, age): print('Helo', name, age) # this function retur...
4
4
Learning Scripts/helper.py
n3urovirtual/EyeTracking_Experiment
2
34971
screen_resX=1920 screen_resY=1080 img_id=['1.JPG_HIGH_', '2.JPG_HIGH_', '7.JPG_HIGH_', '12.JPG_HIGH_', '13.JPG_HIGH_', '15.JPG_HIGH_', '19.JPG_HIGH_', '25.JPG_HIGH_', '27.JPG_HIGH_', '29.JPG_HIGH_', '41.JPG_HIGH_', '42.JPG_HIGH_',...
1.367188
1
twython_auth/views.py
tsaylor/nepal
0
34972
<filename>twython_auth/views.py from django.contrib.auth import authenticate, login, logout as django_logout from django.contrib.auth import get_user_model from django.http import HttpResponseRedirect from django.conf import settings from django.core.urlresolvers import reverse from twython import Twython from profiles...
2.65625
3
hello.py
alee8542/cs3240-labdemo
0
34973
import helper from helper import greeting def main(): #print("called hello") helper.greeting("hello") if __name__ == '__main__': main()
2.5625
3
Multidimensional_Lists/05_square_with_maximum_sum.py
MihailMarkovski/Python-Advanced-2020
4
34974
<reponame>MihailMarkovski/Python-Advanced-2020 def create_matrix(rows_count): matrix = [] for _ in range(rows_count): matrix.append([int(x) for x in input().split(', ')]) return matrix def get_square_sum(row, col, matrix): square_sum = 0 for r in range(row, row + 2): for c in range...
3.890625
4
algorithms/Python/sorting/selection_sort.py
Tanmoy07tech/DSA
247
34975
''' Find the largest element and place that element at the bottom of the list. Repeat for each sub-array. O(n^2) time complexity. ''' from string import ascii_letters arrays = ( [12, 3, 7, 22, -12, 100, 1], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0], [4, 1, 3, 9, 7], [0, -1.5, 1.5, 1.3, -1.3, -1.01, 1.01], list(revers...
4.3125
4
djangocms_html_tags/cms_plugins.py
radity/djangocms-html-tags
0
34976
<reponame>radity/djangocms-html-tags from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext_lazy as _ from djangocms_html_tags.forms import HTMLTextInputForm, HTMLFormForm, HTMLTextareaForm from djangocms_html_tags.models import HTMLTag, HTMLText...
2.03125
2
handlers/rights_users.py
itcosplay/cryptobot
0
34977
# команда меню "права пользователей" from aiogram.types import Message, CallbackQuery, ReplyKeyboardRemove from filters import IsAdmin from loader import dp, db, bot from keyboards.inline.callback_data import change_button_data from keyboards.inline.callback_data import set_status_data from keyboards.inline.callback_...
2.203125
2
qa327/frontend/sessions.py
rickyzhangca/CISC-327
0
34978
<reponame>rickyzhangca/CISC-327<filename>qa327/frontend/sessions.py<gh_stars>0 import helpers import exceptions import datetime as dt ''' This is the sessions module: ''' ''' Base class with the basic structure of all frontend sessions. ''' class Session: # username is None when no one logged in. def __init_...
2.484375
2
parts/edag_diodes.py
baryluk/edag
0
34979
<reponame>baryluk/edag #!/usr/bin/env python3 # Diodes "1N4148" "1N5817G" "BAT43" # Zener "1N457" # bc junction of many transistors can also be used as dioded, i.e. 2SC1815, 2SA9012, etc. with very small leakage current (~1pA at -4V).
1.992188
2
PageObjectLibrary/loginpage_v2_using_composition.py
rama-bornfree/simple-pageobject
0
34980
from pageobject import PageObject from homepage import HomePage from locatormap import LocatorMap from robot.api import logger class LoginPage(): PAGE_TITLE = "Login - PageObjectLibrary Demo" PAGE_URL = "/login.html" # these are accessible via dot notaton with self.locator # (eg: self.locator.usernam...
3.265625
3
reefbot-controller/bin/ButtonMapper.py
MRSD2018/reefbot-1
0
34981
'''Maps buttons for the Reefbot control.''' import roslib; roslib.load_manifest('reefbot-controller') import rospy class JoystickButtons: DPAD_LR = 4 DPAD_UD = 5 ALOG_LEFT_UD = 1 ALOG_LEFT_LR = 0 ALOG_RIGHT_UD = 3 ALOG_RIGHT_LR = 2 BUTTON_1 = 0 BUTTON_2 = 1 BUTTON_3 = 2 BUTTON_4 = 3 BUTTON_...
2.921875
3
env.py
Code-Institute-Submissions/Lordph8-Project3
0
34982
<gh_stars>0 import os os.environ.setdefault("MONGO_URI", "mongodb+srv://root:Thisisarandompassword@myfirstcluster-qpzww.mongodb.net/theRecipe?retryWrites=true&w=majority")
1.171875
1
tests/v1/test_synthetics_test_config.py
MichaelTROEHLER/datadog-api-client-python
0
34983
<filename>tests/v1/test_synthetics_test_config.py # coding: utf-8 # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019-Present Datadog, Inc. from __future__ imp...
2.0625
2
parlai/tasks/saferdialogues/agents.py
twstewart42/ParlAI
1
34984
<filename>parlai/tasks/saferdialogues/agents.py #!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Optional from parlai.core.params import ParlaiParse...
2.078125
2
FatherSon/HelloWorld2_source_code/listing_7-1.py
axetang/AxePython
1
34985
# Listing_7-1.py # Copyright Warren & <NAME>, 2013 # Released under MIT license http://www.opensource.org/licenses/mit-license.php # Version $version ---------------------------- # Using comparison operators num1 = float(raw_input("Enter the first number: ")) num2 = float(raw_input("Enter the second number...
3.875
4
landmark.py
Ank221199/cnn-facial-landmark
0
34986
<filename>landmark.py """ Convolutional Neural Network for facial landmarks detection. """ import argparse import cv2 import numpy as np import tensorflow as tf from model import LandmarkModel # Add arguments parser to accept user specified arguments. parser = argparse.ArgumentParser() parser.add_argument('--train_r...
3.109375
3
read_testdata.py
veralily/MLKD-mission3-resentForIC
0
34987
<gh_stars>0 import skimage.io # bug. need to import this before tensorflow import skimage.transform # bug. need to import this before tensorflow from resnet_train import train from resnet import inference import tensorflow as tf import time import os import sys import re import numpy as np from image_processing impo...
2.125
2
userbot/plugins/thordp.py
indianSammy07/Wolf
0
34988
import os from datetime import datetime from PIL import Image, ImageDraw, ImageFont from pySmartDL import SmartDL from telethon.tl import functions from uniborg.util import admin_cmd import asyncio import shutil import random, re FONT_FILE_TO_USE = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" #Add telegraph ...
2.140625
2
visualize/preprocess.py
peitaosu/SpectralClustering
0
34989
<reponame>peitaosu/SpectralClustering<filename>visualize/preprocess.py import os, sys class Preprocesser(): def __init__(self): self.data = { "X": [], "Y": [] } def process(self, input): if not os.path.isfile(input): print(input + " is not exists.") ...
2.84375
3
cogs/information.py
BioKZM/Colonist
5
34990
# import discord # import asyncio # import json # from discord.ext import commands # from discord.utils import get # # from cogs.personalPoint import PersonalPoint # from main import client # from discord_ui import UI,Button # from functions.userClass import User,experiences,levelNames # from cogs.rank import getSorted...
2.46875
2
infoblox_netmri/api/remote/models/wireless_hot_standby_grid_remote.py
IngmarVG-IB/infoblox-netmri
0
34991
<gh_stars>0 from ..remote import RemoteModel from infoblox_netmri.utils.utils import check_api_availability class WirelessHotStandbyGridRemote(RemoteModel): """ | ``id:`` none | ``attribute type:`` string | ``WlsHotSbTimestamp:`` none | ``attribute type:`` string | ``...
2.0625
2
tests/test_geometric_tests.py
mxrie-eve/Pyrr
0
34992
<gh_stars>0 from pyrr.geometric_tests import ray_intersect_sphere try: import unittest2 as unittest except: import unittest import numpy as np from pyrr import geometric_tests as gt from pyrr import line, plane, ray, sphere class test_geometric_tests(unittest.TestCase): def test_import(self): imp...
2.625
3
python/tvm/micro/base.py
uwsampl/tvm
2
34993
<reponame>uwsampl/tvm # 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, Version 2.0 (the # "Li...
1.671875
2
tests/test_connect_nets.py
enics-labs/salamandra
1
34994
<gh_stars>1-10 # Copyright 2021 EnICS Labs, Bar-Ilan University. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 import sys, os sys.path.append(os.path.abspath('..')) from salamandra import * def main(): test(is_metatest=False) def test(is_metate...
2.15625
2
rl_dobot/algos/learn.py
sandipan1/rl_dobot
2
34995
<gh_stars>1-10 ''' update rule for the DQN model is defined ''' ''' Preprocessing : give only hsv value or masked end efforctor image Downsample pixel and convert RGB to grayscale Use nn.functional where there is no trainable parameter like relu or maxpool Try pooling vs not pooling In Atari they consider multiple fra...
2.921875
3
backend/app/utils.py
williamsyb/StockTick
2
34996
from .protocol import Resp from flask import make_response import pandas as pd class Utils: @staticmethod def build_resp(error_no: int, msg: str, data: dict): return make_response(Resp(error_no, msg, data).to_json()) @staticmethod def treat_bar(data: pd.DataFrame) -> dict: # data = da...
2.65625
3
app/recipe/views.py
juancarestre/recipe-app-api2
0
34997
<filename>app/recipe/views.py from rest_framework import viewsets, mixins from rest_framework.authentication import TokenAuthentication from rest_framework.permissions import IsAuthenticated import redis import os import json from core.models import Tag, Ingredient from recipe import serializers # Connect to our Red...
2.3125
2
torchbenchmark/models/mlp_larger/__init__.py
VectorInstitute/benchmark
1
34998
import random import numpy as np import torch from torch import nn from torchbenchmark.tasks import OTHER from ...util.model import BenchmarkModel torch.manual_seed(1337) random.seed(1337) np.random.seed(1337) # pretend we are using MLP to predict CIFAR images class MLP(nn.Module): def __init__(self): ...
2.671875
3
args.py
NiranjanVRam/spotify-downloader
7
34999
clientId = 'CLIENT_ID' clientSecret = 'CLIENT_SECRET' geniusToken = '<PASSWORD>' bitrate = '320'
0.953125
1