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
assembler.py
craigthomas/Chip8Assembler
21
42600
<gh_stars>10-100 """ Copyright (C) 2014-2018 <NAME> This project uses an MIT style license - see LICENSE for details. A Chip 8 assembler - see the README.md file for details. """ # I M P O R T S ############################################################### import argparse from chip8asm.program import Program # F ...
2.984375
3
util/data_type_util.py
Chandru01061997/pythonDB
409
42601
from uuid import UUID from datetime import datetime def uuid_from_string(string): return UUID('{s}'.format(s=string)) def format_timestamp(string): if isinstance(string, str): return datetime.strptime(string, '%Y-%m-%dT%H:%M:%S.%fZ') if isinstance(string, datetime): return string
3.171875
3
gubernator/main.py
nikhiljindal/test-infra
0
42602
<gh_stars>0 #!/usr/bin/env python # Copyright 2016 The Kubernetes Authors 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.09375
2
src/pyvideoconverter/video.py
fherbine/pyvideoconverter
0
42603
<reponame>fherbine/pyvideoconverter<gh_stars>0 import os import re from subprocess import ( PIPE, Popen, ) FFMPEG_ARGS = { 'vcodec': 'libx265', 'crf': 28, } EXTS_INFO = { 'mp4': ['mp4', 'm4v'], 'mov': ['mov', 'qt'], 'avi': ['avi'], 'flv': ['flv'], 'wmv': ['wmv', 'asf'], 'mpeg':...
2.421875
2
sgh_stepperArm.py
davidramirezm30/scratch-orangepi
0
42604
# meArm.py - York Hack Space May 2014 # A motion control library for Phenoptix meArm using Adafruit 16-channel PWM servo driver from sgh_Adafruit_PWM_Servo_Driver import PWM import kinematics import time from math import pi class meArm(): def __init__(self, sweepMinBase = -206, sweepMaxBase = 206, angleMinBase = ...
2.4375
2
Module_3_Cython/time_analysis.py
dalexa10/HighPerformanceComputing
0
42605
import time def factorial(n): fact = 1 for x in range(2, n+1): fact = fact * x return fact # Timing function start = time.time() factorial(400000) end = time.time() print('Operation done in {} seconds'.format(end - start))
3.828125
4
app/moisturechecker/app.py
sapka12/growme-moisturechecker
0
42606
<filename>app/moisturechecker/app.py import paho.mqtt.client as mqtt from gpiozero import Button as Sensor import os def on_event(client, topics, message): def func(): for topic in topics: client.publish(topic, message) return func if __name__ == '__main__': mqtt_url = os.environ['g...
2.828125
3
theoneapi_sdk/movie/movie.py
eliram/LotR-Eliram-SDK
0
42607
<filename>theoneapi_sdk/movie/movie.py """Handle the movie endpoint.""" from typing import TYPE_CHECKING, List from theoneapi_sdk.movie.movie_dataclass import MovieData, MovieList from theoneapi_sdk.quote.quote_dataclass import QuotesList if TYPE_CHECKING: from theoneapi_sdk.request_handler import RequestHandler ...
2.796875
3
pymtl3_net/meshnet/test/MeshNetworkCL_test.py
cornell-brg/ocn-posh
3
42608
""" ========================================================================== MeshNetworkCL_test.py ========================================================================== Test for NetworkCL Author : <NAME> Date : May 19, 2019 """ import pytest from pymtl3_net.meshnet.MeshNetworkCL import MeshNetworkCL from pym...
1.757813
2
test cases/common/95 dep fallback/gensrc.py
NNemec/meson
0
42609
<reponame>NNemec/meson<filename>test cases/common/95 dep fallback/gensrc.py #!/usr/bin/env python import sys import shutil shutil.copyfile(sys.argv[1], sys.argv[2])
1.148438
1
goodread/config.py
frictionlessdata/goodread
2
42610
import os # Helpers def read_asset(*paths): dirname = os.path.dirname(__file__) return open(os.path.join(dirname, "assets", *paths)).read().strip() # General VERSION = read_asset("VERSION")
2.25
2
tools/makeDB.py
TheodorRene/DailyPuzzles
2
42611
<filename>tools/makeDB.py #!/home/theodorc/dev/Python-3.6.5/python import sqlite3 from sys import argv from os import path # \s*([rnbqkpRNBQKP1-8]+\/){7}([rnbqkpRNBQKP1-8]+)\s[bw-]\s(([a-hkqA-HKQ]{1,4})|(-))\s(([a-h][36])|(-))\s\d+\s\d+\s* possible regex for verifing FEN config = { "mod": 5, "offset": 1, ...
3.375
3
python/syndicate/rg/drivers/s3/config.py
jcnelson/syndicate
16
42612
<gh_stars>10-100 #!/usr/bin/python CONFIG = { "BUCKET": "sd_s3_testbucket", "EXEC_FMT": "/usr/bin/python -m syndicate.rg.gateway", "DRIVER": "syndicate.rg.drivers.s3" }
0.957031
1
mindpong/model/serial_communication.py
PolyCortex/MindPong
22
42613
import sys from glob import glob from serial import Serial, SerialException import numpy as np BAUD_RATE = 9600 PORT = 'COM5' READ_TIMEOUT = 1 LOWER_BOUND = 0.01 UPPER_BOUND = 0.4 class SerialCommunication(): """ Manages the communication and sends the data to the Arduino """ def __init__(self): s...
2.9375
3
ocd_backend/alembic/versions/4415298e147b_add_unique_constraint_to_source.py
aolieman/open-raadsinformatie
0
42614
"""add unique constraint to Source Revision ID: 4415298e147b Revises: 7392493a<PASSWORD> Create Date: 2020-01-02 16:41:03.424945 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '7392493a0768' branch_labels = None depends_on = None def ...
0.925781
1
gcb_web_auth/backends/oauth.py
Duke-GCB/gcb-web-auth
1
42615
<filename>gcb_web_auth/backends/oauth.py from ..utils import user_details_from_token, OAuthException from ..groupmanager import user_belongs_to_group from ..models import GroupManagerConnection from .base import BaseBackend from django.core.exceptions import PermissionDenied import logging # Maps django User attribute...
2.28125
2
tests/test_profiler.py
joshuahaertel/fullprofiler
0
42616
<filename>tests/test_profiler.py<gh_stars>0 import asyncio from time import sleep from unittest import TestCase from fullprofiler.profiler import Profiler class TestProfiler(TestCase): def setUp(self): Profiler.statistics.clear() def test_all(self): Profiler.enable() self.do_somethin...
2.515625
3
tools/pause.py
wangchenxi7/cassandra
1
42617
<filename>tools/pause.py #! /usr/bin/python3 """ Purpose: sum up total GC pause time from a Shenandoah GC log file Attention: !!!Only tested with default Cassandra GC log options and -Xlog:gc*!!! Usage: python3 .../pause.py <log_file_path> e.g. ${HOME}/cassandra/tools/pause.py ${HOME}/cassandra/logs/13-UInsert.log Last...
2.734375
3
src/ebsmapper.py
cpolanec/minecraft-server-controller
1
42618
"""Helper methods for parsing EBS-related data from AWS SDK.""" import logging import myutils logger = myutils.get_logger(__name__, logging.DEBUG) @myutils.log_calls(level=logging.DEBUG) def parse(sdk_snapshots): """Process raw EBS snapshot data.""" snapshots = [] snapshots.extend( map(map_snaps...
2.78125
3
backend/_tests/test_lambda.py
codemonkey800/napari-hub
0
42619
<filename>backend/_tests/test_lambda.py from unittest import mock import requests from requests.exceptions import HTTPError from backend.napari import get_plugin from backend.napari import get_plugins from backend.napari import get_download_url from backend.napari import get_license class FakeResponse: def __ini...
2.40625
2
src/webpage.py
Lanfei/hae
39
42620
import assets import webbrowser from PyQt5.Qt import QMessageBox from PyQt5.QtNetwork import QNetworkDiskCache from PyQt5.QtWebKitWidgets import QWebPage, QWebInspector class WebPage(QWebPage): def __init__(self): super(WebPage, self).__init__() self.inspector = QWebInspector() self.inspector.setPage(self) se...
2.609375
3
main.py
h-shukla/Random-wikipedia-aritcle
0
42621
<filename>main.py import wikipedia import webbrowser def getPage(): # 1 means number of random articles random_article = wikipedia.random(1) # print to the user the choice of random article print("The random generated wikipedia article is " + random_article) # User input to view the page or not choice = ...
4.0625
4
appaddrule/__init__.py
wanghaisheng/azure_func_pywebio_wsgi_starter
1
42622
import azure.functions as func from .add_url_rule import app def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: return func.WsgiMiddleware(app.wsgi_app).handle(req, context)
1.789063
2
app/__init__.py
simplg/Object-Detection-Flask-TF-VanillaJS
0
42623
from flask import Flask from app.services import model_manager from app.controllers.api_blueprint import api_router from app.controllers.main_blueprint import main_router def create_app(test_config=None): app = Flask(__name__) model_manager.init_app(app) app.register_blueprint(api_router) app.registe...
2
2
tests/test_tfs/test_tfs_throughtput.py
fossabot/Video-to-Online-Platform
82
42624
import sys import time import threading import grpc import numpy import soundfile as sf import tensorflow as tf import _init_paths import audioset.vggish_input as vggish_input from tensorflow_serving.apis import predict_pb2 from tensorflow_serving.apis import prediction_service_pb2_grpc tf.app.flags.DEFINE_integer...
2.03125
2
telnotif/service.py
cybernop/telegram-notifier
1
42625
<gh_stars>1-10 import logging from telnotif import server, notifier class Service: def __init__(self, server_host='', server_port=9000, notifier_name='', notifier_greeting='', notifier_token=''): self.notifier = notifier.Notifier(notifier_name, notifier_greeting, notifier_token) self.server = ser...
2.609375
3
Stats.py
DebugScientist78/domino_game_ics4ur
0
42626
import sqlite3 class Stats: con = sqlite3.connect("data.db") cur = con.cursor() stats_insert_com = "INSERT INTO Stats (Player, 'Win Count', 'Play Count', winPlayRatio) VALUES (?, ?, ?, ?);" matchhist_insert_com = "INSERT INTO MatchHistory (matchNum, playerList, 'Winner', numRounds) VALUES (?, ?, ?, ?);...
3.21875
3
models/__init__.py
jmojoo/MLMO
0
42627
<gh_stars>0 from .extractors import AlexNet
1.125
1
astroquery/ned/__init__.py
cdeil/astroquery
0
42628
<gh_stars>0 from .nedpy import *
1.109375
1
app/_mainRecordfunctions.py
PranavSudersan/Buggee
1
42629
# -*- coding: utf-8 -*- """ Created on Wed Jun 24 21:46:56 2020 @author: adwait """ import numpy as np import cv2 import pims from tkinter import messagebox, Tk from PIL import ImageFont, ImageDraw, Image from PyQt5.QtGui import QIcon import logging class MainRecordFunctions: def recordVideo(...
2.375
2
visa2.py
MA0R/Ref-Step-Algorithm
0
42630
""" A simple class to allow quick testing of GPIB programs without instruments. All reads from an instrument return a semi-randomised number regardless of the specific command that may have been sent prior to reading. """ import stuff import time ## VisaIOError = False """ Old pyvisa calls. """ def ge...
2.703125
3
sid/src/utils.py
theScrabi/kaldi_voxceleb_pytorch
3
42631
<reponame>theScrabi/kaldi_voxceleb_pytorch import numpy as np from math import isnan from math import floor from time import time from random import shuffle from random import randint import torch import kaldi_io as kio from threading import Thread from queue import Queue from time import sleep from torch import nn im...
2.265625
2
amazon_comments_scraper.py
ECNUwyzZL/amazon-reviews-scraper
0
42632
import argparse from core_extract_comments import * from core_utils import * def run(search, input_product_ids_filename): product_ids = list() if input_product_ids_filename is not None: with open(input_product_ids_filename, 'r') as r: for p in r.readlines(): pro_obj = p.st...
3.0625
3
python/ack.py
catseye/Dipple
5
42633
#!/usr/bin/env python import sys def ack(m, n): if m == 0: return n + 1 elif n == 0: return ack(m-1, 1) else: return ack(m-1, ack(m, n-1)) sys.setrecursionlimit(12000) for m in range(0, 4): for n in range(0, 10): print "ack(%s,%s)=%s" % (m, n, ack(m, n)) m = 4 n = 0 print ...
2.984375
3
routes/web.py
erikwestlund/zuhanden
3
42634
<gh_stars>1-10 """Web Routes.""" from masonite.routes import Get, Post ROUTES = [Get("/", "IndexController@show").name("index")] ROUTES = ROUTES + [ Get().route("/users/sign-in", "SignInController@show").name("sign_in"), Post().route("/users/sign-in", "SignInController@sign_in"), Get().route("/users/sign...
2.21875
2
Assignments/HW8/wireless_imu_test.py
bsaisudh/ENPM809T
0
42635
''' Message Example b'620901.02908, 3, 0.242, 0.606, 9.527, 4, 0.020, -0.006, 0.001, 5, -24.762,-223.451,-98.491, 81, 173.805, -3.304, 1.315' ''' import time import string import socket, traceback host="192.168.0.23" # ip address of port=5555 s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.setsockopt(so...
2.859375
3
setup.py
cvzi/foodemoji
1
42636
import setuptools import os import io with io.open("README.md", encoding="utf-8") as f: long_description = f.read().strip() version = None with io.open(os.path.join("foodemoji", "__init__.py"), encoding="utf-8") as f: for line in f: if line.strip().startswith("__version__"): ve...
1.734375
2
custom_auth/tests.py
qbrc-cnap/cnap
1
42637
<reponame>qbrc-cnap/cnap<gh_stars>1-10 from django.test import TestCase from rest_framework.test import APIClient from django.contrib.auth import get_user_model from django.urls import reverse from django.conf import settings def create_data(testcase_obj): # create two users-- one is admin, other is regular t...
2.484375
2
src/config/settings.py
crayzee/useful
2
42638
import os from .local_config import * PROJECT_NAME = "Useful" SERVER_HOST = 'http://127.0.0.1:8000' # Secret key SECRET_KEY = b"<KEY>" BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) API_V1_STR = "/api/v1" # Token 60 minutes * 24 hours * 7 days = 7 days ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 24...
1.78125
2
gitconsensusservice/www.py
tedivm/GitConsensusService
16
42639
<filename>gitconsensusservice/www.py from flask import Flask, session, redirect, url_for, escape, request, render_template, flash, send_from_directory from gitconsensusservice import app import gitconsensusservice.routes.webhooks @app.route('/') def index(): return redirect('https://www.gitconsensus.com/')
2.0625
2
fetch.py
oosidat/pyphotoanalytics
0
42640
import requests INSTAGRAM_MEDIA_LINK = "https://www.instagram.com/{username}/media/" def fetch_user_photos(username): print "fetching..." url = INSTAGRAM_MEDIA_LINK.format(username=username) response = requests.get(url); return response
2.890625
3
bluebottle/cms/migrations/0021_auto_20171017_2015.py
terrameijar/bluebottle
10
42641
<reponame>terrameijar/bluebottle<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2017-10-17 18:15 from __future__ import unicode_literals import adminsortable.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencie...
1.648438
2
codewars/8kyu/counting sheep/main_test.py
ictcubeMENA/Training_one
0
42642
<reponame>ictcubeMENA/Training_one import main import unittest class testsheep(unittest.TestCase): def testing(self): array1 = [True, True, True, False, True, True, True, True , True, False, True, False, True, False, False, True , True, True...
3.234375
3
pushkin/util/__init__.py
Nordeus/pushkin
281
42643
from . import pool from . import multiprocesslogging from . import tools
1.046875
1
utils/__init__.py
zhanglz95/RS-semantic-segmentation-pytorch-past
1
42644
from .augmentation import * from .optim import * from .metrics import * from .transfunction import *
1.0625
1
tzager/pdf_paper.py
tzagerAI/tzager
2
42645
import json import requests def analysis(password, path, title): from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import TextConverter from pdfminer.layout import LAParams from pdfminer.pdfpage import PDFPage from io import StringIO print('Converi...
2.65625
3
tests/config_test.py
akshaysharma096/clusterman
281
42646
<reponame>akshaysharma096/clusterman # Copyright 2019 Yelp 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 appli...
1.671875
2
usernado/torntriplets/api.py
reganto/usernado
3
42647
<gh_stars>1-10 from typing import Any, Dict, Optional import tornado.escape import tornado.web from usernado.torntriplets.base import BaseHandler class BaseValidationError(ValueError): pass class DataMalformedOrNotProvidedError(BaseValidationError): pass class APIHandler(BaseHandler): def get_json_a...
2.515625
3
mayan/apps/acls/permissions.py
eshbeata/open-paperless
2,743
42648
<filename>mayan/apps/acls/permissions.py from __future__ import absolute_import, unicode_literals from django.utils.translation import ugettext_lazy as _ from permissions import PermissionNamespace namespace = PermissionNamespace('acls', _('Access control lists')) permission_acl_edit = namespace.add_permission( ...
1.59375
2
raspi_components/light/rgb_light.py
builderdev212/raspi_components
1
42649
<filename>raspi_components/light/rgb_light.py import RPi.GPIO as GPIO from .light_errors import RGBLedError class RGBLed: """ This class is used to control a RGB LED via the GPIO. Please make sure you have 220 Ohm resistors between the 3 gpio pins and the LED. """ def __init__(self, red_pin, g...
3.65625
4
mark_face.py
paitoon/train-gender
0
42650
<filename>mark_face.py import os import glob import cv2 def mark_faces(classNo, imageNameList, outDir, trainStream): for imageName in imageNameList: imagePath = os.path.join(outDir, imageName) trainStream.write(imagePath) trainStream.write('\n') image = cv2.imread(imagePath) ...
2.90625
3
tests/browser/pages/domestic/contact_us_short_domestic.py
mayank-sfdc/directory-tests
4
42651
<gh_stars>1-10 # -*- coding: utf-8 -*- """Domestic - Sort Domestic Contact us form""" import logging import random from types import ModuleType from typing import Union from uuid import uuid4 from selenium.webdriver.common.by import By from selenium.webdriver.remote.webdriver import WebDriver from directory_tests_sha...
2.140625
2
ros/niryo_one_ros/niryo_one_commander/src/niryo_one_commander/moveit_utils.py
paubrunet97/astrocytes
5
42652
<reponame>paubrunet97/astrocytes<filename>ros/niryo_one_ros/niryo_one_commander/src/niryo_one_commander/moveit_utils.py #!/usr/bin/env python # moveit_utils.py # Copyright (C) 2018 Niryo # All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
2.171875
2
release/stubs.min/Tekla/Structures/ModelInternal.py
YKato521/ironpython-stubs
0
42653
# encoding: utf-8 # module Tekla.Structures.ModelInternal calls itself ModelInternal # from Tekla.Structures.Model,Version=2017.0.0.0,Culture=neutral,PublicKeyToken=2f04dbe497b71114 # by generator 1.145 # no doc # no imports # no functions # classes from ModelInternal_parts.AreWeUnitTesting import AreWeUnitTesting fro...
1.320313
1
examples/led-toggle.py
FFY00/python-libevdev
0
42654
<reponame>FFY00/python-libevdev<gh_stars>0 #!/usr/bin/python3 import libevdev import sys def toggle(path, ledstr): ledmap = { 'numlock': (libevdev.EV_LED.LED_NUML, libevdev.EV_KEY.KEY_NUMLOCK), 'capslock': (libevdev.EV_LED.LED_CAPSL, libevdev.EV_KEY.KEY_CAPSLOCK), 'scrolllock': (libevdev....
2.640625
3
advent_of_code_2017/day 13/solution.py
jvanelteren/advent_of_code
1
42655
#%% # read full assignment # think algo before implementing # dont use a dict when you need a list # assignment is still = and not == # dont use itertools when you can use np.roll # check mathemathical functions if the parentheses are ok # networkx is awesome # %% import os import re import numpy as np try: os.chdir(...
2.625
3
fluid/image_classification/caffe2fluid/kaffe/custom_layers/reshape.py
phlrain/models
3
42656
<reponame>phlrain/models """ a custom layer for 'reshape', maybe we should implement this in standard way. more info can be found here: http://caffe.berkeleyvision.org/tutorial/layers/reshape.html """ from .register import register def import_fluid(): import paddle.fluid as fluid return fluid def reshap...
2.90625
3
src/genie/libs/parser/ironware/tests/ShowMPLSLSP/cli/equal/golden_output1_expected.py
jamesditrapani/genieparser
0
42657
<reponame>jamesditrapani/genieparser expected_output = { 'lsps': { 'mlx8.1_to_ces.2': { 'destination': '1.1.1.1', 'admin': 'UP', 'operational': 'UP', 'flap_count': 1, 'retry_count': 0, 'tunnel_interface': 'tunnel0' }, 'm...
1.539063
2
django_world/admin.py
iamabhishekchakraborty/djangoProject
0
42658
from django.contrib import admin from .models import Succession,Succession_Seasons,Succession_Casts,Succession_Season_Episodes # Register your models here. # admin.site.register(Succession) # The model Succession is abstract so it can't be registered with admin admin.site.register(Succession_Seasons) ad...
1.5625
2
src/mbed_cloud/_backends/iam/models/user_invitation_resp.py
GQMai/mbed-cloud-sdk-python
12
42659
<filename>src/mbed_cloud/_backends/iam/models/user_invitation_resp.py<gh_stars>10-100 # coding: utf-8 """ Account Management API API for managing accounts, users, creating API keys, uploading trusted certificates OpenAPI spec version: v3 Generated by: https://github.com/swagger-api/swagger-codeg...
1.898438
2
src/orders/tests/order_content_type_replacement/tests_order_item.py
iNerV/education-backend
151
42660
<reponame>iNerV/education-backend<filename>src/orders/tests/order_content_type_replacement/tests_order_item.py<gh_stars>100-1000 import pytest pytestmark = [pytest.mark.django_db] def test_order_without_items(order): order = order() assert order.item is None def test_order_with_record(order, record): ...
2.0625
2
surround/django/simple_cors/decorators.py
sniegu/django-surround
1
42661
<filename>surround/django/simple_cors/decorators.py from __future__ import absolute_import import functools from . import headers from django.http import HttpResponse from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.conf import settings from django.utils.cache import patch_vary_hea...
1.929688
2
sdkcore/SdkCore/scripts/ff4compat_gen_consts.py
Parrot-Developers/groundsdk-ios
13
42662
#!/usr/bin/env python3 import sys, os import arsdkparser #=============================================================================== class Writer(object): def __init__(self, fileobj): self.fileobj = fileobj def write(self, fmt, *args): if args: self.fileobj.write(fmt % (args)...
2.984375
3
python/polyline.py
anjianli21/ilqgames
53
42663
<gh_stars>10-100 """ BSD 3-Clause License Copyright (c) 2019, HJ Reachability Group All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright noti...
1.039063
1
python/l0039.py
daidaifan/leetcode-problem-solver
0
42664
""" Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited number of times. Note: All numbers (including target) will be positive integers. The solution set must...
3.609375
4
src/constants/datasets.py
shivanip14/semisupclustering
0
42665
from src.runners.iris_runner import cluster as iris from src.runners.twentynewsgroups_runner import cluster as twentynewsgroups from src.runners.waveform_runner import cluster as waveform available_datasets = {'iris': {'runner': iris, 'name': 'iris'}, 'twentynewsgroups': {'runner': twentynewsgroup...
1.5
2
shared/mhx/rig_face_25.py
teddydragoone/makehuman1.0.0alpha7
2
42666
""" **Project Name:** MakeHuman **Product Home Page:** http://www.makehuman.org/ **Code Home Page:** http://code.google.com/p/makehuman/ **Authors:** <NAME> **Copyright(c):** MakeHuman Team 2001-2009 **Licensing:** GPL3 (see also http://sites.google.com/site/makehumandocs...
1.90625
2
vyperlogix/daemon/utils.py
raychorn/chrome_gui
1
42667
import os, sys import traceback from vyperlogix.misc import _utils from vyperlogix.hash import lists _metadata = lists.HashedLists2() def getDaemons(prefix, fpath): import re from vyperlogix import misc _name = misc.funcName() s_regex = r".+%s\.((py)|(pyc)|(pyo))" % ('_tasklet') s_svn_regex = '[._]svn...
2.078125
2
common-mk/external_dependencies.gyp
doitmovin/chromiumos-platform2
0
42668
{ 'targets': [ { 'target_name': 'modemmanager-dbus-proxies', 'type': 'none', 'variables': { 'xml2cpp_type': 'proxy', 'xml2cpp_in_dir': '<(sysroot)/usr/share/dbus-1/interfaces/', 'xml2cpp_out_dir': 'include/dbus_proxies', }, 'sources': [ '<(xml2cpp_in_d...
1.21875
1
OpenCV Python/4. Image Processing/10. histograms/3. 2D histogram.py
Ashleshk/Machine-Learning-Data-Science-Deep-Learning
1
42669
import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('home.jpg') hsv = cv2.cvtColor(img,cv2.COLOR_BGR2HSV) hist = cv2.calcHist( [hsv], [0, 1], None, [180, 256], [0, 180, 0, 256] ) plt.imshow(hist,interpolation = 'nearest') plt.show() # in numpy import cv2 import numpy as np from matplo...
2.9375
3
arike/visits/models.py
iamsdas/arike
0
42670
<reponame>iamsdas/arike<filename>arike/visits/models.py from django.contrib.auth import get_user_model from django.db import models from django.utils import timezone from arike.patients.models import Patient, Treatment User = get_user_model() class Hygiene(models.TextChoices): GOOD = "good" POOR = "poor" ...
2.34375
2
endpoints/Reports.py
uvoteam/python-hibob
0
42671
#!/usr/bin/env python3 # -*- coding: utf8 -*- from .BaseEndpoint import BaseEndpoint class Reports(BaseEndpoint): def list(self): """ Returns a list of all company defined reports, data is filtered based on the access level of the logged-in user. Only viewable categories are retu...
2.796875
3
task1.py
whalsey/misc
0
42672
import network2 import logging import numpy as np logging.basicConfig(level=logging.DEBUG) # read in the data # logging.info("READING IN DATA...") # for reading in normal dataset # training, validation, test = network2.load_data_wrapper("data/mnist.pkl.gz") ### I WILL ADD AND COMMENT OUT SECTIONS OF CODE BASED ...
2.828125
3
src/comment/views.py
mingyu-si/weibo
0
42673
<reponame>mingyu-si/weibo<filename>src/comment/views.py from flask import Blueprint from flask import abort from flask import abort from flask import request from flask import redirect from flask import session from libs.db import db from user.logics import login_required from .models import Comment comment_bp = Blue...
2.34375
2
cvsutils/evaluator.py
zpahuja/cvsutils
1
42674
from abc import ABC, abstractmethod import collections import statistics import numpy as np import sklearn.metrics import torch class Evaluator(ABC): """Class to evaluate model outputs and report the result. """ def __init__(self): self.reset() @abstractmethod def add_predictions(self, p...
2.921875
3
tests/unit/cli/format/test_table.py
manojn97/lmctl
3
42675
import unittest from lmctl.cli.format import TableFormat, Table, Column class DummyTable(Table): columns = [ Column('name', header='Name'), Column('status', header='Status', accessor=lambda x: 'OK' if x.get('status', None) in ['Excellent', 'Good'] else 'Unhealthy'), ] class DummyTableNoHeaders...
3.1875
3
NiceReferenceImageDBCreator/CreateDBFromRefImages/__init__.py
sudipta-rudra/test
0
42676
import logging import azure.functions as func import numpy as np import json import requests from os import path def readjson_from_file(filename): try: fp = open(filename, "r") except: logging.info(f"WARNING: cant open file {filename} ") return {} try: ob...
2.609375
3
main.py
frederikkoenigwork/my-python-sample-app
0
42677
import django print(django.get_version()) print(f"boa {111 * 6}") print(f"{6*6}") input = input("Hey abuser, enter some stuff!\n") cmp = 1 > 0 print(type(cmp)) print(input) try: int(asdf) except Exception: print("Oh no, it failed!") while False: print("False!") listeL = [1,2,3,45,6,4,3,6,8,6,3...
2.765625
3
ooobuild/lo/i18n/transliteration_modules.py
Amourspirit/ooo_uno_tmpl
0
42678
<gh_stars>0 # coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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...
2.171875
2
main.py
freakyLuffy/Teleuserbot
0
42679
from start import client from modules import codeforces,delete,notes,hastebin,pin,pm,user,spam,rextester white=[] from telethon import TelegramClient,events import logging logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.WARNING) client.start().run_u...
1.765625
2
multitag-code/src/test.py
terencelee-uni/multitag-heroku
0
42680
<gh_stars>0 import gc import torch gc.collect() torch.cuda.empty_cache()
1.367188
1
cpp_src/cmd/reindexer_server/test/specs/mixins/api_mixin.py
radiophysicist/reindexer
0
42681
<gh_stars>0 import http.client import json from urllib.parse import urlencode class ApiMixin(object): API_STATUS = { 'success': 200, 'moved_permanently': 301, 'bad_request': 400, 'unauthorized': 401, 'forbidden': 403, 'not_found': 404 } def _server_request(...
2.4375
2
30DayMapChallenge/23112020-Boundaries.py
vivekparasharr/Challenges-and-Competitions
6
42682
# Let’s make a map! Using Geopandas, Pandas and Matplotlib to make a Choropleth map # https://towardsdatascience.com/lets-make-a-map-using-geopandas-pandas-and-matplotlib-to-make-a-chloropleth-map-dddc31c1983d import pandas as pd import matplotlib.pyplot as plt import geopandas as gpd from shapely.geometry import...
3.265625
3
process_data/functions/sensors.py
mattmatt91/Promotion
0
42683
""" This module exrtacts features from the data, saves the feauters from all measurements to global results file and creates one file for every sensor with all measurements. :copyright: (c) 2022 by <NAME>, Hochschule-Bonn-Rhein-Sieg :license: see LICENSE for more details. """ from pyexpat import features import pan...
2.953125
3
unit_tests/sequence_tests.py
YuseqYaseq/gry-kombinatoryczne
2
42684
<gh_stars>1-10 from unit_tests.common import expect, is_none, is_arithmetic_sequnce from game.sequence import Sequence def search_with_startidx_equals_zero(): sequence = Sequence([2, 4, 6, 7, 11], 3) res = sequence.search(1, 0) expect(-1, res) res = sequence.search(5, 0) expect(-1, res) res...
2.90625
3
dcbench/common/artifact.py
data-centric-ai/dcbench
40
42685
from __future__ import annotations import json import os import shutil import subprocess import tempfile import uuid from abc import ABC, abstractmethod from typing import Any, Union from urllib.error import HTTPError from urllib.request import urlopen, urlretrieve import warnings import meerkat as mk import pandas a...
2.109375
2
utils.py
fourjr/rawbot
10
42686
import asyncio import json import zlib import aiohttp import errors API_BASE = 'https://discordapp.com/api/v6' CONFIG_FILE = json.load(open('data/config.json')) TOKEN = CONFIG_FILE['token'] HEADERS = {'Authorization': 'Bot ' + TOKEN, 'User-Agent': 'DiscordBot (https://www.github.com/fourjr/dapi-bot,\ ...
2.625
3
perm-comb-finder/count-uniques.py
catseye/NaNoGenLab
20
42687
<reponame>catseye/NaNoGenLab #!/usr/bin/env python import sys import re words = [] for line in sys.stdin: words.extend(line.strip().split()) def clean(w): w = w.replace("'", "") return re.match('^.*?([a-zA-Z0-9]+).*?$', w).group(1).upper() words = [clean(w) for w in words] print len(words), len(set(words))...
2.875
3
vcoffboard.py
tjarrettveracode/veracode-offboard
0
42688
import sys import requests import argparse import logging import json import datetime import anticrlf from veracode_api_py import VeracodeAPI as vapi log = logging.getLogger(__name__) def setup_logger(): handler = logging.FileHandler('vcoffboard.log', encoding='utf8') handler.setFormatter(anticrlf.LogFormatt...
2.3125
2
codigo/Live102/exemplo_2.py
cassiasamp/live-de-python
572
42689
from expects import expect, contain, be_an class Bacon: ... sanduiche = 'sanduiche com queijo' expect(sanduiche).to(contain('queijo')) expect(sanduiche).to_not(be_an(Bacon))
2.640625
3
HLTriggerOffline/Exotica/python/analyses/hltExoticaMonojetBackup_cff.py
pasmuss/cmssw
0
42690
<reponame>pasmuss/cmssw import FWCore.ParameterSet.Config as cms MonojetBackupPSet = cms.PSet( hltPathsToCheck = cms.vstring( #"HLT_PFJet260_v", # Run2 #"HLT_PFJetCen80_PFMETNoMu100_v", #"HLT_PFJetCen80_PFMHTNoPuNoMu100_v", #"HLT_PFCenJet140_PFMETNoMu100_PFMHTNoMu140_v", #"H...
1.515625
2
examples/learning-tpot/main.py
bahp/python-spare-code
0
42691
""" Main ============= Example """ # Import import numpy as np import pandas as pd # Specific from tpot import TPOTClassifier # Import own from pySML2.preprocessing.splitters import cvs_hos_split from pySML2.preprocessing.splitters import kfolds_split # --------------------------------------------- # Configuratio...
2.53125
3
sherlock.py
aggiebill/sherlock
0
42692
#!/usr/bin/env python3.6 """Sherlock: Find Usernames Across Social Networks Module This module contains the main logic to search for usernames at social networks. """ import requests import csv import json import os import re from argparse import ArgumentParser, RawDescriptionHelpFormatter import platform module_nam...
3.109375
3
find_entity/probable_acmation.py
Mleader2/bert_music_correct
6
42693
# 发现疑似实体,辅助训练 # 用ac自动机构建发现疑似实体的工具 import os from collections import defaultdict import json import re from .acmation import KeywordTree, add_to_ac, entity_files_folder, entity_folder from curLine_file import curLine, normal_transformer domain2entity_map = {} domain2entity_map["music"] = ["age", "singer", "song", "top...
2.375
2
scripts/merge.py
CHREC/drseus
1
42694
#!python/bin/python3 """ Copyright (c) 2018 NSF Center for Space, High-performance, and Resilient Computing (SHREC) University of Pittsburgh. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistribu...
1.492188
1
code/api/Monitor/newUser_backend.py
RandyCamacho/SeniorDesign-HomeCU
0
42695
<gh_stars>0 from django.contrib.auth.backends import BaseBackend from django.contrib.auth.hashers import check_password from .models import BsuOfficeusers class newUserBackend(BaseBackend): def checkusername(self, username=None): try: user = BsuOfficeusers.objects.get(user_name=username) return 1 except Bs...
2.28125
2
mcts/base.py
hwangyale/AlphaGomoku
3
42696
<filename>mcts/base.py import queue import numpy as np from ..global_constants import * from ..common import * from ..utils.thread_utils import CONDITION from ..board import Board from ..cpp import CPPBoard from ..utils.zobrist_utils import get_zobrist_key, hash_history BASE_BOARD = Board(toTensor=True, visualization...
2.078125
2
utils/config.py
monabf/structured_NODEs
0
42697
import logging import pickle import seaborn as sb import torch sb.set_style('whitegrid') # Class for efficiently handling configurations and parameters, enables to # easily set them and remember them when one config is reused # Read with config.key, set with config.update({'key': value}) or config[ # 'key'] = value ...
1.992188
2
Users/views.py
yaroslav-gwit/YK-Reverse-Proxy
0
42698
from django.shortcuts import render, redirect from django.db.models import F from pathlib import Path import os from HAProxyManager import settings from Users import models as user_models from django.http import HttpResponseRedirect from django.contrib.auth.models import User as system_users # Create your views here....
2.171875
2
par ou impar.py
Azultropico/exercicios_python
0
42699
<reponame>Azultropico/exercicios_python n1 = int(input("Digite um número: ")) if __name__ == '__main__': if n1 % 2 == 0: print("Número Par") elif n1 % 2 == 1: print("Número Ímpar") else: print("Valor Inválido")
3.921875
4