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
yt_dlp/extractor/imdb.py
trassshhub/yt-dlp
1
12763651
from __future__ import unicode_literals import base64 import json import re from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, mimetype2ext, qualities, traverse_obj, try_get, url_or_none, ) class ImdbIE(InfoExtractor): IE_NAME = 'imdb' IE_DESC = '...
2.1875
2
pkg/tasks.py
snackattas/ShutTheBox
1
12763652
<reponame>snackattas/ShutTheBox<filename>pkg/tasks.py """tasks.py - This file contains handlers that are called by cronjobs.""" import webapp2 import datetime from models import User, Game from collections import namedtuple from google.appengine.api import mail, app_identity class SendReminderEmail(webapp2.RequestHa...
2.609375
3
kiestze_django/kiestze/migrations/0006_auto_20180721_0951.py
oSoc18/kiest_ze
3
12763653
<filename>kiestze_django/kiestze/migrations/0006_auto_20180721_0951.py # Generated by Django 2.0.7 on 2018-07-21 09:51 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('kiestze', '0005_auto_20180721_0945'), ] operations = [ migrations.RenameModel...
1.617188
2
backend/serializers.py
Total-Conversion/eco4coin
0
12763654
# from django.contrib.auth.models import User # from django.contrib.auth.models import User import uuid from django.core.exceptions import ObjectDoesNotExist from django.db import transaction from .models import Trade, Sale, Purchase, ApplicationVersion from accounts.models import CustomUser from rest_framework impor...
2.1875
2
db_sqlite3.py
umarsear/solar-energy-notification
0
12763655
__author__ = '<NAME>' import os import sqlite3 as lite def open_database(db): """ :rtype : sqlite3 database connection """ if os.path.isfile(db): db_connection = lite.connect(db) else: db_connection = lite.connect(db) db_cursor = db_connection.cursor() db_cursor.ex...
2.84375
3
d2go/data/dataset_mappers/rotated_dataset_mapper.py
wenliangzhao2018/d2go
687
12763656
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import copy import logging import numpy as np import torch from d2go.data.dataset_mappers.d2go_dataset_mapper import D2GoDatasetMapper from detectron2.data import detection_utils as utils, transforms as T from detectron2.st...
2.21875
2
SVG_Prepare_Photos/prepare_svg-photos.py
jpenrici/Extensions_Inkscape
0
12763657
<reponame>jpenrici/Extensions_Inkscape # -*- Mode: Python3; coding: utf-8; indent-tabs-mpythoode: nil; tab-width: 4 -*- ''' Objective: Insert images (photos) in SVG files. Details: Files in the Images directory. Txt list with the names of the files. Requires: Python Imag...
2.90625
3
setup.py
anarkiwi/dovesnap
16
12763658
<filename>setup.py """package setup.""" from setuptools import setup setup( name='dovesnap', version=[ f.split('"')[1] for f in open('main.go', 'r').readlines() if 'version' in f ][0], license='Apache License 2.0', description='graphviz generator of dovesnap networks', url='https://github.com/IQTL...
1.304688
1
oop 1-1.py
DirkTayab/OOP-1-1
0
12763659
<reponame>DirkTayab/OOP-1-1<gh_stars>0 from tkinter import * window = Tk() window.geometry("400x300") window.title("Welcome to Python Programming") #Button Widget btn = Button(window, text = "Click to add", fg = "Blue") btn.place(x = 50, y = 120) #Label Widget lbl = Label(window, text = "Student Perso...
3.71875
4
lang/py/pylib/code/difflib/difflib_unified.py
ch1huizong/learning
13
12763660
<filename>lang/py/pylib/code/difflib/difflib_unified.py #!/usr/bin/env python # # Copyright 2007 <NAME>. # """Unified diff example """ #end_pymotw_header import difflib from difflib_data import * diff = difflib.unified_diff(text1_lines, text2_lines, lineterm=''...
2.09375
2
src/advanced python/monitor.py
sudeep0901/python
0
12763661
<filename>src/advanced python/monitor.py from time import sleep import os print(os.getpid()) def set_proc_name(newname): from ctypes import cdll, byref, create_string_buffer libc = cdll.LoadLibrary('libc.so.6') buff = create_string_buffer(len(newname)+1) buff.value = newname libc.prctl(15, byref(bu...
2.5
2
bvp/DB.py
marklescroart/bvp
2
12763662
<reponame>marklescroart/bvp """ each class should have: from_docdict(doc), from_blender(blender_object), docdict [property], to_blender [sets blend props?] - Actions - Action - must be linked to specific class of armatures (which will be a property of bvpObjects) - Armature_class - wordnet_label -...
1.890625
2
gltf/converter.py
rdb/panda3d-gltf
1
12763663
import base64 import collections import itertools import os import math import struct import pprint # pylint: disable=unused-import from panda3d.core import * # pylint: disable=wildcard-import try: from panda3d import bullet HAVE_BULLET = True except ImportError: HAVE_BULLET = False load_prc_file_data( ...
1.882813
2
HW7/zipcode_map_Yang.py
MengyuanZoe/HomeIn
5
12763664
# -*- coding: utf-8 -*- """ Folium interact with GeoJSON data Examples: overlay another GeoJSON zipcode map to the original map Author: <NAME> """ import pandas as pd import folium def show_zipcode_map(zipcode_path, data, col): """ Interact zipcode GeoJSON data with other data set (house price o...
3.796875
4
src/ufoLib2/pointPens/glyphPointPen.py
JeremieHornus/ufoLib2
0
12763665
<gh_stars>0 from typing import TYPE_CHECKING, Any, Optional, Tuple from fontTools.misc.transform import Transform from fontTools.pens.pointPen import AbstractPointPen from ufoLib2.objects.component import Component from ufoLib2.objects.deepComponent import DeepComponent from ufoLib2.objects.contour import Contour fro...
2.34375
2
backend/polzyFunctions/tests/test_misc.py
Athos1972/PoLZy
0
12763666
import os import sys from polzyFunctions.utils import get_file_path from polzyFunctions.tests.utils import company, user from polzyFunctions.scripts.AddNotification import * from polzyFunctions.LogLevelUpdater import LogLevelUpdater from polzyFunctions.FileManager.AddressParser import Parser def test_get_file_path():...
2.25
2
Strings/example_10.py
abdullahfareed454/PythonCourses
0
12763667
# -*- coding: utf-8 -*- string1 = "Becomes" string2 = "becomes" string3 = "BEAR" string4 = " bEautiful" string1 = string1.lower() # (string2 will pass unmodified) string3 = string3.lower() string4 = string4.strip().lower() print(string1.startswith("be")) print(string2.startswith("be")) print(string3.startswith("be")) p...
3.65625
4
src/shart/__init__.py
insert-username/shart
0
12763668
<reponame>insert-username/shart<gh_stars>0 #!/usr/bin/env python3 import math import numpy as np import shapely as sh import shapely.affinity import shapely.geometry __all__ = [ "box", "coordinates", "group", "utils" ]
1.234375
1
pytest_tests/test_repositories.py
koichiro8/learning
0
12763669
from datetime import datetime import pytest from sqlalchemy import select from learning.database import get_session from learning.entities import Todo from learning.repositories import TodoRepository from learning.schemas import CreateTodo from .utils import create_todo pytestmark = [pytest.mark.asyncio, pytest.mar...
2.265625
2
torchflare/metrics/meters.py
glenn-jocher/torchflare
1
12763670
"""Implementation of utilities for metrics.""" from typing import Tuple import torch from einops import reduce class _BaseMetric: """A Class which decides type of classification i.e. binary,multilabel or multiclass.""" def __init__(self, multilabel: bool = False): """Constructor class for BaseMetric...
2.9375
3
tests/functional/modules/ims_psb_gen/seq_dataset/test_valid_input.py
thedoubl3j/ibm_zos_ims
7
12763671
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from ansible.module_utils.basic import AnsibleModule from pprint import pprint import pytest import ansible.utils import ansible.errors import ansible.constants import warnings import os import sys CURR_DIR = os.path.dirname(__f...
1.765625
2
codes/2_image_prediction_multiThreading.py
nguyenanhtuan1008/ImageAI
0
12763672
from tmodules.Prediction import ImagePrediction import os import threading class PredictionThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): multiple_prediction = ImagePrediction() multiple_prediction.setModelTypeAsDenseNet() multiple...
2.484375
2
integration/python/integration_api/models/identification.py
sumit4-ttn/SDK
0
12763673
# coding: utf-8 """ Hydrogen Integration API The Hydrogen Integration API # noqa: E501 OpenAPI spec version: 1.2.1 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class Identification(object): """NOTE...
1.726563
2
cinderella/modules/cleaner.py
jerinjohny-ktnm/MarvinBot
2
12763674
import html from typing import List from telegram import Bot, Update, ParseMode from telegram.ext import CommandHandler, MessageHandler, Filters, run_async from cinderella import ALLOW_EXCL, dispatcher, CustomCommandHandler from cinderella.modules.disable import DisableAbleCommandHandler from cinderella.modules.help...
2.046875
2
pplot/geo.py
thorwhalen/ut
4
12763675
<filename>pplot/geo.py __author__ = 'thor' from numpy import * from mpl_toolkits.basemap import Basemap def map_records(d, basemap_kwargs={}, plot_kwargs={}, lat_col='latitude', lng_col='longitude'): # Create the Basemap basemap_kwargs = dict(dict(projection='merc', # there are other choices though ...
2.546875
3
src/apistblz/downloadonce.py
nfwstg/apistblz
0
12763676
import pickle import os import copy import shutil import hashlib from .exceptions import * # External Variables dumpdir = '.dlo_dump' force_on_disk = False reportmode = None # Internal Variables dlo_memory = {} prefix_list = [] keytable = {} # Common def _generate_keystring(is_method, prefix, args, kwargs): if...
2.296875
2
nipy/core/image/affine_image.py
neurospin/nipy
1
12763677
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ The base image interface. """ import numpy as np from scipy import ndimage # Local imports from .image import Image from ..transforms.affines import to_matrix_vector from ..reference.coordinate_system...
2.390625
2
solutions/binary_search_tree/insert_bst.py
cmok4290/jubilant-octo-adventure
0
12763678
class Node(object): def __init__(self, data=None, left=None, right=None): self.data = data self.left = left self.right = right class BinarySearchTree(object): def __init__(self, root=None): self.root = root def get_root(self): return self.root def insert(self,...
3.921875
4
ethereum_common/src/ethereum_common/nodes.py
Vourhey/robonomics_comm
16
12763679
# -*- coding: utf-8 -*- # # ethereum common related nodes. # from .erc20_services import ERC20Services from .eth_services import ETHServices from .signer import Signer def erc20_node(): ERC20Services().spin() def eth_node(): ETHServices().spin() def signer_node(): Signer().spin()
1.8125
2
programming/5.3/main.py
Sasha-hk/saceit-practice
1
12763680
<filename>programming/5.3/main.py from random import randint n = 9 arr = [[randint(0, 100) for i in range(n)] for j in range(n)] max_value = arr[0][0] min_value = arr[0][0] tt = 0 for i in range(0, int(n / 2 + 1)): for j in range(tt, n - tt): if arr[i][j] > max_value: max_value = arr[i][j] tt += 1 ...
3.25
3
leetcode/0073_set-matrix-zeroes.py
heyf/cloaked-octo-adventure
0
12763681
# # @lc app=leetcode id=73 lang=python3 # # [73] Set Matrix Zeroes # from typing import List # @lc code=start class Solution: def setZeroes(self, matrix: List[List[int]]) -> None: """ Do not return anything, modify matrix in-place instead. """ # null check if not matrix and...
3.734375
4
source/lambda/invite_accounts/index.py
stackArmor/compliant-framework-for-federal-and-dod-workloads-in-aws-govcloud-us
36
12763682
<reponame>stackArmor/compliant-framework-for-federal-and-dod-workloads-in-aws-govcloud-us<filename>source/lambda/invite_accounts/index.py ###################################################################################################################### # Copyright 2020 Amazon.com, Inc. or its affiliates. All Right...
1.171875
1
tests/helpers/test_temperature.py
don66/home-assistant
37
12763683
<gh_stars>10-100 """Tests Home Assistant temperature helpers.""" import unittest from tests.common import get_test_home_assistant from homeassistant.const import ( TEMP_CELSIUS, PRECISION_WHOLE, TEMP_FAHRENHEIT, PRECISION_HALVES, PRECISION_TENTHS) from homeassistant.helpers.temperature import display_temp fro...
2.828125
3
covid19/covid19/spiders/Covid19.py
mzs9540/covid19-scrapy
0
12763684
<reponame>mzs9540/covid19-scrapy import scrapy import locale from ..items import Covid19Item locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') class FirstSpider(scrapy.Spider): name = 'covid19' start_urls = [ 'https://www.worldometers.info/coronavirus/' ] def parse(self, response): ite...
2.734375
3
speedysvc/serialisation/ArrowSerialisation.py
mcyph/shmrpc
4
12763685
<filename>speedysvc/serialisation/ArrowSerialisation.py import pyarrow class ArrowSerialisation: """ TODO! """ mimetype = 'application/octet-stream' @staticmethod def dumps(o): return pyarrow.serialize(o).to_buffer() @staticmethod def loads(o): return pyarrow.deseri...
2.390625
2
roots/visualization.py
bingsome/Roots
2
12763686
import numpy as np from mayavi import mlab import os from roots.swcToolkit import swcToolkit class swcVisualizer(): """ mfile = 'fileonpath.swc' visualizer = swcVisualizer() visualizer.mplot_mfile(mfile) """ def __init__(self): self.swcTool = swcToolkit() def create_cylinders(self,coords,diams,data...
2.546875
3
deeplearning.py
thanakijwanavit/flowerai
1
12763687
<filename>deeplearning.py import torch # method for validation def validation(model, validloader, criterion): valid_loss = 0 accuracy = 0 for images, labels in validloader: images, labels = images.to('cuda'), labels.to('cuda') output = model.forward(images) valid_loss += criterio...
3
3
specs/default/chef/site-cookbooks/pbspro/files/default/autoscale_hook.py
themorey/cyclecloud-pbspro
8
12763688
<filename>specs/default/chef/site-cookbooks/pbspro/files/default/autoscale_hook.py # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # import json import os import shutil import subprocess import traceback import pbs def debug(msg): pbs.logmsg(pbs.EVENT_DEBUG, "azpbs...
1.929688
2
B站/Python自动化办公 · 一课通(适合小白)/Chapter2/S2-1-2/PracticeAnswer/2.1.2exercise.py
zhaofeng092/python_auto_office
46
12763689
from docx import Document from docx.enum.style import WD_STYLE_TYPE document = Document() styles = document.styles for i in styles: if i.type == WD_STYLE_TYPE.TABLE: document.add_paragraph("表格样式 : " + i.name) table = document.add_table(4, 5, style=i) document.add_paragraph("\n\n") docume...
2.640625
3
test.py
appfirst/python-hbase-client
0
12763690
<reponame>appfirst/python-hbase-client # # Testing integration of libhdfs with Python # import argparse import sys import hbase diag = False def debug(): import pdb pdb.set_trace() def modRead(connect, args, data): hbase.Get(connect, args.rdtable, args.rdrow, args.rdcolfam, ...
2.375
2
remove_duplicates.py
AnneliektH/EVEs_arthropod
0
12763691
<reponame>AnneliektH/EVEs_arthropod #<NAME>, 2017 # load pandas import pandas as pd import sys # load dataframe df = pd.DataFrame.from_csv(sys.argv[1]) # sort on postion query start to keep highest later on df.sort_values('position_on_query_start', inplace=True) # drop duplicates based on start and direction keep f...
2.984375
3
setup.py
explabs/ad-ctf-paas-lib
0
12763692
from setuptools import setup setup( name='ad-ctf-paas-lib', version='0.0.3', packages=['checker'], url='', license='', author='ivanh', author_email='<EMAIL>', description='Library that help to write checkers' )
1.0625
1
2015/2015_07a.py
davidxiao93/Advent-of-Code
0
12763693
input = """af AND ah -> ai NOT lk -> ll hz RSHIFT 1 -> is NOT go -> gp du OR dt -> dv x RSHIFT 5 -> aa at OR az -> ba eo LSHIFT 15 -> es ci OR ct -> cu b RSHIFT 5 -> f fm OR fn -> fo NOT ag -> ah v OR w -> x g AND i -> j an LSHIFT 15 -> ar 1 AND cx -> cy jq AND jw -> jy iu RSHIFT 5 -> ix gl AND gm -> go NOT bw -> bx jp...
2.03125
2
projects/CenterNet2/centernet/modeling/dense_heads/centernet_head.py
collector-m/CenterNet2
2
12763694
<filename>projects/CenterNet2/centernet/modeling/dense_heads/centernet_head.py import math from typing import List import torch from torch import nn from torch.nn import functional as F from detectron2.layers import ShapeSpec, get_norm from ..layers.deform_conv import DFConv2d __all__ = ["CenterNetHead"] class Scale...
2.203125
2
packages/M2Crypto-0.21.1/demo/medusa/virtual_handler.py
RaphaelPrevost/Back2Shops
0
12763695
<gh_stars>0 # -*- Mode: Python; tab-width: 4 -*- import socket import default_handler import re HOST = re.compile ('Host: ([^:/]+).*', re.IGNORECASE) get_header = default_handler.get_header class virtual_handler: """HTTP request handler for an HTTP/1.0-style virtual host. Each Virtual host must have a different...
3.0625
3
4/main.py
misterwilliam/advent-of-code
0
12763696
<filename>4/main.py<gh_stars>0 import md5 import unittest def GetDigest(string): m = md5.new() m.update(string) return m.hexdigest() def DoesStartWithZeros(string, numZeros): return string[:numZeros] == "".join("0" for i in xrange(numZeros)) def Mine(string): i = 1 while True: digest...
2.96875
3
keyboards/inline/menu_profile_inline.py
vR4eslav/DatingBot
0
12763697
<filename>keyboards/inline/menu_profile_inline.py<gh_stars>0 from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton async def get_profile_keyboard(verification): markup = InlineKeyboardMarkup() if not verification: verification_btn = InlineKeyboardButton(text="✅ Верификация", callback_da...
2.5625
3
pylark/api_service_drive_comment_patch.py
chyroc/pylark
7
12763698
<filename>pylark/api_service_drive_comment_patch.py # Code generated by lark_sdk_gen. DO NOT EDIT. from pylark.lark_request import RawRequestReq, _new_method_option from pylark import lark_type, lark_type_sheet, lark_type_approval import attr import typing import io @attr.s class UpdateDriveCommentPatchReq(object): ...
1.804688
2
src/edubot/snapext/joystick/__init__.py
wendlers/edubot-snap
0
12763699
<filename>src/edubot/snapext/joystick/__init__.py ## # The MIT License (MIT) # # Copyright (c) 2016 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including wit...
2.125
2
enwiki/inactive_interface_admins.py
JJMC89/JJMC89_bot
5
12763700
#!/usr/bin/env python3 """Report inactive interface admins.""" # Author : JJMC89 # License: MIT from functools import lru_cache from itertools import chain from typing import Optional, Set, Tuple, Union import pywikibot from dateutil.relativedelta import relativedelta from pywikibot.logentries import LogEntry PageSo...
2.546875
3
Commented/dfirwizard-v2.py
dlcowen/dfirwizard
60
12763701
<reponame>dlcowen/dfirwizard<filename>Commented/dfirwizard-v2.py #!/usr/bin/python # Sample program or step 2 in becoming a DFIR Wizard! # No license as this code is simple and free! import sys import pytsk3 # Import for manipulation of timestamps into user readable information import datetime # Hardcode the name of t...
2.625
3
ecs/settings.py
programmierfabrik/ecs
9
12763702
<reponame>programmierfabrik/ecs # Django settings for ecs project. import os, sys, platform, logging from datetime import timedelta from urllib.parse import urlparse # root dir of project PROJECT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # standard django settings #########################...
2.078125
2
app/db/migrations/versions/ed535bd21f09_add_three_time_filed.py
zyxyuanxiao/fastapi-1
2
12763703
<gh_stars>1-10 """add three time filed Revision ID: ed<PASSWORD> Revises: 0a43<PASSWORD> Create Date: 2019-12-12 13:44:51.913300 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<PASSWORD>' down_revision = '0a43<PASSWORD>' branch_labels = None depends_on = None...
1.101563
1
src/waclient/service_controller/__init__.py
WitnessAngel/witness-angel-sensor
4
12763704
from kivy.utils import platform if platform == "android": from .android_service_controller import ServiceController else: from .subprocess_service_controller import ServiceController
1.828125
2
notifyme.py
vsr/pyscripts
0
12763705
<filename>notifyme.py<gh_stars>0 #!/usr/bin/python """ Notifies with a fortune cookie every X minutes. Usage: "python notifyme.py 10" to notify every 10 minutes """ import os import sys import datetime import time import pynotify def notify(count): fortune = os.popen('fortune -n 100 -s', 'r').read() time = d...
3.015625
3
corus/sources/toloka.py
Ilseyar/corus
205
12763706
from corus.record import Record from corus.io import ( load_lines, parse_tsv, skip_header, ) class LRWCRecord(Record): __attributes__ = ['hyponym', 'hypernym', 'genitive', 'judgement', 'confidence'] def __init__(self, hyponym, hypernym, genitive, judgement, confidence): self.hyponym = hy...
2.671875
3
ckan_cloud_operator/providers/users/gcloud/constants.py
MuhammadIsmailShahzad/ckan-cloud-operator
14
12763707
PROVIDER_ID='gcloud'
1.117188
1
genmol/vae/samples.py
bayeslabs/genmol
17
12763708
# -*- coding: utf-8 -*- from tqdm import tqdm import pandas as pd n_samples = 3000 n_jobs = 1 max_len = 100 class sample(): def take_samples(model,n_batch): n = n_samples samples = [] with tqdm(total=n_samples, desc='Generating samples') as T: while n > 0: current_samples = model.sample(min...
2.84375
3
Code/python/Py/PostProcess.py
cy15196/FastCAE
117
12763709
#-------关联C++库--------------- import ctypes import platform system = platform.system() if system == "Windows": pre = "./" suff = ".dll" else: pre = "./lib" suff = ".so" libfile = ctypes.cdll.LoadLibrary filename = pre+"GraphicsAnalyse"+suff postPro = libfile(filename) import MainWindow #--------------------...
2.3125
2
unit_test.py
cakel/ppomppu_naver_point_telegram_bot
2
12763710
<filename>unit_test.py import unittest import os import json from unittest.mock import patch from _url import get_sending_list_from_record, fetch_html_to_string, get_record_list_info_from_html from _file import load_db_from_file, save_db_to_file class TestSuite(unittest.TestCase): def test_save_and_load(self): ...
3.015625
3
mopidy_local/library.py
jodal/mopidy-local
59
12763711
import logging import operator import sqlite3 import uritools from mopidy import backend, models from mopidy.models import Ref, SearchResult from . import Extension, schema logger = logging.getLogger(__name__) def date_ref(date): return Ref.directory( uri=uritools.uricompose("local", None, "directory",...
2.28125
2
cohesity_management_sdk/models/centrify_schema_enum.py
nick6655/management-sdk-python
18
12763712
# -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. class CentrifySchemaEnum(object): """Implementation of the 'CentrifySchema' enum. Specifies the schema of this Centrify zone. The below list of schemas and their values are taken from the document Centrify Server Suite 2016 Windows API Programmer...
1.664063
2
Project/UnitTests/test_utility_weights.py
Itsuke/PurchaseAdvisor
0
12763713
""" Unit tests to verify utility_rank module. """ import unittest import numpy as np from pymcdm import weights from utility_weights import UtilityWeights class TestUtilityNormalization(unittest.TestCase): """ Class used for the verification of implementation of normalization formulas """ def setUp(sel...
3.1875
3
PythonExercicios/ex016.py
cedricgenaro/Python
0
12763714
<gh_stars>0 # Quebrando um número '''Minha Solução''' '''from math import floor valor = float(input('Digite um valor: ')) numQuebrado = floor(valor) print('O valor digitado foi {} e a sua porção inteira é {}'.format(valor, numQuebrado))''' '''Solução Professor ''' '''from math import trunc num = float(input('Digite u...
3.921875
4
examples/legacy/signs/sign.py
jameszha/ARENA-py
4
12763715
<reponame>jameszha/ARENA-py # robot-arm.py # import time import arena import random import os import json import sys # export HOST=arenaxr.org # export REALM=realm # export MQTTH=arenaxr.org # export MID=MID_1234 # Optional: # export LINKS = "Link1,https://www.duckduckgo.com,Link 2,https:www.f1.com,Link 3,https://www...
2.484375
2
jigsaw/models/linear_models/base_model.py
alexvishnevskiy/jigsaw
0
12763716
<gh_stars>0 from sklearn.feature_extraction.text import TfidfVectorizer from ...utils.glove import convert_glove_to_features, load_glove from ...utils.fast_text import convert_fasttext_to_features from sklearn.base import BaseEstimator from sklearn.linear_model import Ridge from sklearn.kernel_ridge import KernelRidge ...
2.296875
2
sauronx/sensors.py
dmyersturnbull/sauronx
0
12763717
import datetime import logging import multiprocessing as mp import threading import wave from enum import Enum from multiprocessing import Process from os.path import dirname from typing import Dict, List import numpy as np import pandas as pd import pyaudio # from scipy.io import wavfile # TODO broken from hipsterp...
2.296875
2
fractal/core/command_bus/command_handler.py
douwevandermeij/fractal
2
12763718
from abc import ABC, abstractmethod from typing import List, Type from fractal.core.command_bus.command import Command class CommandHandler(ABC): @abstractmethod def commands(self) -> List[Type[Command]]: """Returns list of commands that this handler can handle.""" @abstractmethod def handle...
3.15625
3
setup.py
namin/docker-echo-kernel
32
12763719
from distutils.core import setup with open('README.rst') as f: readme = f.read() setup( name='echo_kernel', version='1.1', packages=['echo_kernel'], description='Simple example kernel for Jupyter', long_description=readme, author='<NAME>', author_email='<EMAIL>', url='https://githu...
1.273438
1
Aula12/app.py
refatorando/curso_python_iniciantes
3
12763720
<gh_stars>1-10 #open("caminho","r") # Mode # r - Leitura # a - Append / incrementar # w - Escrita # x - Criar Arquivo # r+ - Leitura + Escrita arquivo = open("Aula12/test3.txt","x") print(arquivo.readable()) print(arquivo.read()) print(arquivo.readline()) print(arquivo.readline()) print(arquivo.readline()) print(arq...
2.8125
3
regex_search/regex_search.py
zspatter/automate-the-boring-stuff
15
12763721
#! /usr/bin/env python3 # regex_search.py - simple text search utilizing regex engine import re from pathlib import Path def regex_search(regex, path): """ Searches text file at path for matches to the specified pattern :param re.Pattern regex: pattern to search for :param Path path: path to source ...
4.1875
4
tests/test_permissions.py
amehta1/t1-python
24
12763722
<filename>tests/test_permissions.py from __future__ import print_function from __future__ import absolute_import import unittest import responses import requests from .requests_patch import patched_extract_cookies_to_jar from terminalone import T1 mock_credentials = { 'username': 'user;', 'password': 'passwo...
2.15625
2
output/models/ms_data/complex_type/ct_d033_xsd/__init__.py
tefra/xsdata-w3c-tests
1
12763723
from output.models.ms_data.complex_type.ct_d033_xsd.ct_d033 import ( FooType, MyType, Root, ) __all__ = [ "FooType", "MyType", "Root", ]
1.203125
1
app/PartitionMethods.py
karrnb/Region-Graph-Exploration
0
12763724
<gh_stars>0 import graph_tool.all as gt # import networkx as nx import numpy as np from subprocess import Popen, PIPE from HierarchicalPartitioningTree import PartitionTree, PartitionNode # from networkx.algorithms.flow import edmonds_karp, shortest_augmenting_path def connected_components(G, vertex_indices=None, edg...
2.359375
2
examples/ocean_examples/sim_3/config_sim3.py
idax4325/veropt
2
12763725
<reponame>idax4325/veropt<filename>examples/ocean_examples/sim_3/config_sim3.py<gh_stars>1-10 from veropt import BayesOptimiser from veropt.obj_funcs.ocean_sims import OceanObjFunction from veropt.slurm_support import slurm_set_up class OceanObjSimThree(OceanObjFunction): def __init__(self, target_min_vsf_depth_2...
1.914063
2
qiskit/aqua/utils/summarize_circuits.py
pistoia/qiskit-aqua
1
12763726
# -*- coding: utf-8 -*- # Copyright 2018 IBM RESEARCH. 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 requ...
1.976563
2
nao_player_label.py
robogeekcanada/pybullet-tutorials
0
12763727
<reponame>robogeekcanada/pybullet-tutorials import time import pybullet as p import pybullet_data from qibullet import NaoVirtual client = p.connect(p.GUI) p.setAdditionalSearchPath(pybullet_data.getDataPath()) p.loadURDF("plane.urdf") p.setRealTimeSimulation(1) p.setGravity(0, 0, -10) robot = NaoVirtual() robot....
2.53125
3
torch_ecg/train/train_unet_cpsc2019/metrics.py
busyyang/torch_ecg
0
12763728
""" References: ----------- [1] http://2019.icbeb.org/Challenge.html """ import math from typing import Union, Optional, Sequence from numbers import Real import numpy as np __all__ = [ "compute_metrics", ] def compute_metrics(rpeaks_truths:Sequence[Union[np.ndarray,Sequence[int]]], rpeaks_preds:Sequence[Union...
2.859375
3
lang/Python/equilibrium-index-4.py
ethansaxenian/RosettaDecode
5
12763729
<gh_stars>1-10 from collections import defaultdict def eqindex1Pass(data): "One pass" l, h = 0, defaultdict(list) for i, c in enumerate(data): l += c h[l * 2 - c].append(i) return h[l]
2.328125
2
model/api/loader.py
mvxxx/mimuw-hats
0
12763730
<gh_stars>0 import numpy as np import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=FutureWarning) from keras.preprocessing import image as imageK def load_image(img_path, shape): """Loads image in KERAS mdoe Args: img_path (string): path to image ...
2.78125
3
back-end/aula/admin.py
Cicero-Forks/lccv-desafio-final
3
12763731
from django.contrib import admin from . import models from . import actions class FornecedoresForm(admin.ModelAdmin): readonly_fields = ['id_user_cad', 'id_user_alt'] search_fields = ['razao_social', 'cnpj', 'email', 'telefone'] list_filter = ['id_user_cad', 'id_user_alt'] actions = [actions.at...
2.03125
2
atp_classes/Rentrak.py
davidottogonzalez/Data-Fetcher
0
12763732
import atp_classes, requests, json class Rentrak: __user_token = None __current_user = None def __init__(self, api_url=None, username=None, password=<PASSWORD>): config = atp_classes.Config().get_config() if api_url: self.api_url = api_url else: self.api_u...
2.671875
3
pycqed/analysis_v3/tomography_analysis.py
QudevETH/PycQED_py3
7
12763733
<filename>pycqed/analysis_v3/tomography_analysis.py import logging log = logging.getLogger(__name__) import itertools import scipy as sp import numpy as np import qutip as qtp import matplotlib as mpl from collections import OrderedDict from pycqed.analysis_v2 import tomography_qudev as tomo from pycqed.analysis_v3 im...
2.28125
2
mailase/api/controllers/root.py
greghaynes/Mailase
1
12763734
import os from pecan import conf from pecan.rest import RestController from wsmeext.pecan import wsexpose from mailase.api.model import (Mail, Mailbox, MailBrief, MailSearchRecentResult) import mailase.search.dbapi as search_...
2.15625
2
pychron/pipeline/nodes/base.py
ASUPychron/pychron
31
12763735
<filename>pychron/pipeline/nodes/base.py # =============================================================================== # Copyright 2015 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
1.554688
2
estudo/urls.py
bcunhasa/nutriodonto
0
12763736
"""Define os padrões de URL para a aplicação""" from django.conf.urls import url from . import views app_name="estudo" urlpatterns = [ # Acompanhamento dos resultados do estudo url(r'^estudo/$', views.EstudoView.as_view(), name='estudo'), ]
2.40625
2
control/excalibur/testing/test_detector.py
dls-controls/excalibur-detector
0
12763737
<reponame>dls-controls/excalibur-detector """ Test cases for the ExcaliburDetector class of the ODIN server EXCALIBUR plugin <NAME>, STFC Application Engineering Group """ from nose.tools import * import logging from excalibur.detector import ExcaliburDetector, ExcaliburDetectorError from excalibur.fem import Excali...
2.28125
2
tenark/cataloguer/json_cataloguer.py
knowark/tenark
1
12763738
<reponame>knowark/tenark<filename>tenark/cataloguer/json_cataloguer.py import json from pathlib import Path from typing import List, Dict, Any from ..common import ( QueryParser, QueryDomain, TenantRetrievalError) from ..models import Tenant from .cataloguer import Cataloguer class JsonCataloguer(Cataloguer): ...
2.359375
2
recipes/o3tanks/utils/containers.py
loherangrin/o3tanks
13
12763739
<reponame>loherangrin/o3tanks # Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
1.53125
2
thelma/tools/iso/poolcreation/execution.py
fogathmann/TheLMA
1
12763740
<filename>thelma/tools/iso/poolcreation/execution.py """ This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Tools involved the execution of pool stock sample creation worklists. AAB """ from thelma.tools.semicon...
1.445313
1
visualization/polus-precompute-slide-plugin/src/utils.py
mmvih/polus-plugins
0
12763741
import copy, os, json, filepattern, imageio, pathlib, typing, abc, zarr import bfio import numpy as np from numcodecs import Blosc from concurrent.futures import ThreadPoolExecutor from preadator import ProcessManager from bfio.OmeXml import OMEXML import logging logging.getLogger("bfio").setLevel(logging.CRITICAL) #...
2.265625
2
DEPENDENCIES/seash/tests/ut_seash_splitjoin.py
kevinkenzhao/Repy2
0
12763742
""" Joins two nodes owned by guest0 and splits them again using resources.offcut to test if the two commands work properly on the basic scale. """ #pragma out import seash import sys command_list = [ 'loadkeys guest3', 'as guest3', 'browse', 'on browsegood', 'update', 'join', 'on %3', 'split re...
2.03125
2
telegram.py
Santistox/instasavebot
2
12763743
<reponame>Santistox/instasavebot import telebot from time import gmtime, strftime from private import teletoken from instalooter.looters import PostLooter bot = telebot.TeleBot(teletoken) def log(time, message): log_print(time, message.from_user.username, message.chat.id, message.text) def log_print(time, user...
2.546875
3
app/email.py
lootfee/writerrific
0
12763744
<gh_stars>0 from flask import render_template from flask_mail import Message from app import mail, app from threading import Thread def send_email(subject, sender, recipients, html_body): msg = Message(subject, sender=sender, recipients=recipients) #msg.body = text_body msg.html = html_body ma...
2.40625
2
app/models.py
FikaNote/FikaNote
2
12763745
from django.db import models import mongoengine from mongoengine import Document, EmbeddedDocument from mongoengine.fields import * import os # Create your models here. class Greeting(models.Model): when = models.DateTimeField('date created', auto_now_add=True) MONGODB_USER = os.environ.get("DATABASE_USER") MONG...
2.421875
2
examples/pin_input_irq_debounce.py
charkster/u2if
79
12763746
<gh_stars>10-100 import time from machine import u2if, Pin def irq_callback(pin, event=None): is_rising = event & Pin.IRQ_RISING is_falling = event & Pin.IRQ_FALLING info_interrupt = '%s pin %d =>' % (time.time()*1000, pin) if is_rising: info_interrupt += ' RISING' if is_falling: i...
2.8125
3
src/config/svc-monitor/svc_monitor/tests/test_lbaas_custom_attributes.py
jnpr-pranav/contrail-controller
37
12763747
<gh_stars>10-100 # Copyright (c) 2016 Symantec # 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 # # Un...
1.828125
2
twisted/plugins/txgsm_plugin.py
smn/txgsm
12
12763748
from txgsm.service import TxGSMServiceMaker serviceMaker = TxGSMServiceMaker()
1.25
1
nbaspa/data/tasks/__init__.py
ak-gupta/nbaspa
1
12763749
"""Import the cleaning tasks.""" from typing import List from .gamelog import AddWinPercentage, GamesInLastXDays from .io import ( GenericLoader, FactoryGetter, PlayByPlayLoader, WinProbabilityLoader, GameLogLoader, LineupLoader, RotationLoader, ShotChartLoader, BoxScoreLoader, ...
1.851563
2
2019/20b.py
msullivan/advent-of-code
8
12763750
#!/usr/bin/env python3 from __future__ import print_function from collections import defaultdict, deque import sys import time import math DIRS = [(0, -1), (1, 0), (0, 1), (-1, 0)] def add(v1, v2): return tuple(x + y for x, y in zip(v1, v2)) def main(args): data = [s.rstrip() for s in sys.stdin] boar...
3.25
3