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 |
|---|---|---|---|---|---|---|
gooey/python_bindings/coms.py | geosaleh/Gooey | 1 | 12798351 | """
Because Gooey communicates with the host program
over stdin/out, we have to be able to differentiate what's
coming from gooey and structured, versus what is arbitrary
junk coming from the host's own logging.
To do this, we just prefix all written by gooey with the
literal string 'gooey::'. This lets us dig through... | 2.375 | 2 |
src/day6.py | blu3r4y/AdventOfCode2018 | 2 | 12798352 | <gh_stars>1-10
# Advent of Code 2018, Day 6
# (c) blu3r4y
import numpy as np
def part1(coordinates):
# create a matrix filled with -1 big enough to hold all coordinates
shape = np.amax(coordinates, axis=0) + (1, 1)
matrix = np.full(shape, -1)
for cell, _ in np.ndenumerate(matrix):
# calculat... | 2.71875 | 3 |
tests/test_linalg_util.py | saroad2/snake_learner | 0 | 12798353 | import numpy as np
from pytest_cases import parametrize_with_cases, case
from snake_learner.direction import Direction
from snake_learner.linalg_util import block_distance, closest_direction, \
project_to_direction
CLOSEST_DIRECTION = "closest_direction"
PROJECT_TO_DIRECTION = "project_to_direction"
@case(tags=... | 2.390625 | 2 |
backend/chatbot_back/forms.py | karenrios2208/ProyectoAplicacionesWeb | 0 | 12798354 | <gh_stars>0
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, BooleanField, DateField, IntegerField
from wtforms.validators import DataRequired, Email, EqualTo, ValidationError
import wtforms_json
from chatbot_back.models import Cuenta, Cliente
wtforms_json.init()
class Reg... | 2.59375 | 3 |
binding.gyp | MakiPool/hasher-mtp | 5 | 12798355 | <reponame>MakiPool/hasher-mtp
{
"targets": [
{
"target_name": "hashermtp",
"sources": [
"src/argon2ref/argon2.c",
"src/argon2ref/blake2ba.c",
"src/argon2ref/core.c",
"src/argon2ref/encoding.c",
"src/argon... | 1.085938 | 1 |
hmdb_web_db.py | Andreymcz/jmapy | 0 | 12798356 | <filename>hmdb_web_db.py
import cutils as utils
def search_metabolite_info_by_id(hmdb_id, info_titles):
request_result = utils.__http_req('https://hmdb.ca/metabolites/' + hmdb_id)
info_values = {value: "" for value in info_titles}
for title in info_titles:
th = request_result.find("th", string=titl... | 2.8125 | 3 |
app/modules/news/migrations/0013_merge_20200415_0747.py | nickmoreton/nhsx-website | 50 | 12798357 | <gh_stars>10-100
# Generated by Django 3.0.4 on 2020-04-15 07:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("news", "0012_auto_20200409_1452"),
("news", "0009_auto_20200414_0913"),
]
operations = []
| 1.257813 | 1 |
pyttributionio/pyttributionio.py | loehnertz/Pyttribution.io | 0 | 12798358 | # -*- coding: utf-8 -*-
import logging
import json
import random
import string
import time
import requests
from requests import RequestException
logger = logging.getLogger(__name__)
class PyttributionIo:
"""
A Python wrapper around the Attribution.io API (by <NAME> – www.jakob.codes)
"""
GET_REQUE... | 2.421875 | 2 |
setup.py | ribeirogab/google-docs | 0 | 12798359 | from setuptools import setup
setup(
name="google-doc",
version="0.1",
description="Manipulating files pragmatically",
url="https://github.com/ribeirogab/google-doc",
author="<NAME>",
author_email="<EMAIL>",
license="MIT",
packages=["app"],
zip_safe=False,
)
| 1.15625 | 1 |
mundo 3/des084.py | Pedroluis1/python | 0 | 12798360 | temp = []
princ = []
mai = men = 0
while True:
temp.append(str(input('nome: ')))
temp.append(float(input('peso: ')))
if len(princ) == 0:
mai = men = temp[1]
else:
if temp[1] > mai:
mai = temp[1]
if temp[1] < men:
men = temp[1]
princ.append(temp[:])
... | 3.453125 | 3 |
trace/_unsafe.py | dyedgreen/labs-ray-tracing | 0 | 12798361 | """
Provides Volatile type
"""
class Volatile:
pass
| 1.203125 | 1 |
app/apps/core/migrations/0033_ocrmodel_job.py | lawi21/escriptorium | 4 | 12798362 | # Generated by Django 2.1.4 on 2019-10-03 13:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0032_auto_20190729_1249'),
]
operations = [
migrations.AddField(
model_name='ocrmodel',
name='job',
... | 1.695313 | 2 |
etl/storage_clients/__init__.py | The-Animals/data-pipeline | 0 | 12798363 | <reponame>The-Animals/data-pipeline
from __future__ import absolute_import
from .minio_client import MinioClient
from .mysql_client import MySqlClient
from .utils import get_config
from .schema import DbSchema | 1.015625 | 1 |
network-http-requests/check.py | atolstikov/yacontest-cheatsheet | 2 | 12798364 | <gh_stars>1-10
from flake8.api import legacy as flake8
import sys
if __name__ == '__main__':
ignored_errors = ['W', 'E126']
excluded_files = ['check.py']
line_length = 121
style_guide = flake8.get_style_guide(ignore=ignored_errors,
excluded=excluded_files,
... | 1.929688 | 2 |
evacsim/manhattan.py | selverob/lcmae | 0 | 12798365 | <gh_stars>0
from .level import Level
from .graph.interface import Node
class ManhattanDistanceHeuristic():
def __init__(self, level: Level):
self.level = level
def manhattan_distance(self, x: Node, y: Node) -> int:
x_coords = self.level.id_to_coords(x.pos())
y_coords = self.level.id_t... | 3.109375 | 3 |
jasy/http/Request.py | sebastian-software/jasy | 2 | 12798366 | #
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
# Copyright 2013-2014 <NAME>
#
import shutil
import json
import base64
import os
import re
import random
import sys
import mimetypes
import http.client
import urllib.parse
import hashlib
import jasy.core.Console as Console
__all__ = ("requestUrl", "upl... | 2.546875 | 3 |
tools/authors.py | roboterclubaachen/xpcc | 161 | 12798367 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017, <NAME>
# All rights reserved.
#
# The file is part of the xpcc library and is released under the 3-clause BSD
# license. See the file `LICENSE` for the full license governing this code.
# ---------------------------------------------------------------... | 1.679688 | 2 |
twiml/voice/pay/pay-tokenize-connector/pay-tokenize-connector.6.x.py | stuyy/api-snippets | 0 | 12798368 | <filename>twiml/voice/pay/pay-tokenize-connector/pay-tokenize-connector.6.x.py<gh_stars>0
from twilio.twiml.voice_response import Pay, VoiceResponse
response = VoiceResponse()
response.pay(charge_amount='0', payment_connector='My_Pay_Connector', action='https://your-callback-function-url.com/pay')
print(response)
| 2.53125 | 3 |
day13_transparent-origami/day13.py | notromanramirez/advent-of-code_2021 | 0 | 12798369 | <filename>day13_transparent-origami/day13.py
# <NAME>, <EMAIL>
# Advent of Code 2021, Day 13: Transparent Origami
#%% LONG INPUT
my_input = []
with open('input_roman.txt', 'r') as f:
for line in f:
my_input.append(line.strip('\n'))
#%% EXAMPLE INPUT
my_input = [
'6,10',
'0,14',
'9,10',
'0,... | 3.328125 | 3 |
tests/test_ksic10.py | sayari-analytics/pyisic | 3 | 12798370 | import pytest
from pyisic import KSIC10_to_ISIC4
from pyisic.types import Standards
@pytest.mark.parametrize(
"code,expected",
[
("DOESNT EXIST", set()),
("A", set()),
("14112", {(Standards.ISIC4, "1410")}),
],
)
def test_ksic10_to_isic4_concordance(code: str, expected: str):
... | 2.390625 | 2 |
Notes/Python/WeChat.py | lzz42/Notes | 2 | 12798371 | <reponame>lzz42/Notes<gh_stars>1-10
# -*- coding:UTF-8 -*-
import os
import re
import time
import itchat
from itchat.content import *
# itchat: https://itchat.readthedocs.io/zh/latest/
def main():
LogIn()
def LogIn():
itchat.auto_login()
itchat.send('Hello, filehelper', toUserName='filehelper')
@it... | 2.421875 | 2 |
test/test_pronunciation.py | kord123/ko_pron | 6 | 12798372 | from unittest import TestCase, main
from ko_pron import romanise
def mr_romanize(word):
return romanise(word, "mr")
class TestKoPron(TestCase):
def test_kosinga(self):
self.assertEqual("kŏsin'ga", mr_romanize("것인가"))
def test_kosida(self):
self.assertEqual("kŏsida", mr_romanize("것이다"))... | 3.03125 | 3 |
examples/learn_product.py | tbekolay/nengodocs-rtd | 0 | 12798373 | <gh_stars>0
# coding: utf-8
# # Nengo Example: Learning to compute a product
#
# Unlike the communication channel and the element-wise square,
# the product is a nonlinear function on multiple inputs.
# This represents a difficult case for learning rules
# that aim to generalize a function given many
# input-output ... | 3.34375 | 3 |
tests/test_provider_hashicorp_hashicups.py | mjuenema/python-terrascript | 507 | 12798374 | <gh_stars>100-1000
# tests/test_provider_hashicorp_hashicups.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:18:02 UTC)
def test_provider_import():
import terrascript.provider.hashicorp.hashicups
def test_resource_import():
from terrascript.resource.hashicorp.hashicups import hashicups_ord... | 1.742188 | 2 |
src/memory/pagetable.py | tylerscave/OS_Simulator | 0 | 12798375 | import sys
try: from Queue import PriorityQueue
except: from queue import PriorityQueue
try: from memory import page
except: import page
from collections import OrderedDict
# Disable bytecode generation
sys.dont_write_bytecode = True
class PageTable(object):
'''
Simulates the operations of the Memory Mana... | 3.125 | 3 |
libkol/request/clan_rumpus_meat.py | danheath/pykol-lib | 6 | 12798376 | <reponame>danheath/pykol-lib
from enum import Enum
import libkol
from ..util import parsing
from .clan_rumpus import Furniture
from .request import Request
class MeatFurniture(Enum):
Orchid = Furniture.MeatOrchid
Tree = Furniture.MeatTree
Bush = Furniture.MeatBush
class clan_rumpus_meat(Request[int]):... | 2.4375 | 2 |
12-Cloud_Computing-Using_Computing_as_a_Service/reboot.py | gennaromellone/A001026 | 0 | 12798377 | # Code to reboot an EC2 instance (configured with 'aws configure')
import boto3
from botocore.exceptions import ClientError
def getFirstInstanceID(ec2):
# Get all EC2 instances
all_instances = ec2.describe_instances()
# Select the first
first = all_instances['Reservations'][0]['Instances'][0]
# Re... | 2.796875 | 3 |
scfw2d/StoryManager.py | lines-of-codes/StablerCharacter | 7 | 12798378 | from dataclasses import dataclass
@dataclass
class Dialog:
message: str
sideObjects: tuple = ()
extraEvents: tuple = ()
@dataclass
class Branch:
dialogsList: list
class Chapter:
def __init__(self, branchList: dict):
self.branchList = branchList
self.currentBranch = branchList["main"]
self.dialogIndex =... | 2.921875 | 3 |
interface.py | Kapil-Shyam-M/riscv-isac | 5 | 12798379 | <reponame>Kapil-Shyam-M/riscv-isac
import importlib
import pluggy
from riscv_isac.plugins.specification import *
import riscv_isac.plugins as plugins
def interface (trace, arch, mode):
'''
Arguments:
Trace - Log_file_path
Arch - Architecture
Mode - Execution trace format
'''
... | 2.1875 | 2 |
BasicApp/migrations/0009_auto_20200215_1610.py | bozcani/borsa-scraper-app | 3 | 12798380 | <reponame>bozcani/borsa-scraper-app
# Generated by Django 3.0.2 on 2020-02-15 16:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('BasicApp', '0008_auto_20200215_1605'),
]
operations = [
migrations.AlterField(
model_name='s... | 1.585938 | 2 |
profiles_api/views.py | ray-abel12/django-profile-api | 0 | 12798381 | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from profiles_api import serializers
class HelloApiView(APIView):
"""Test the Api view"""
serializers_class = serializers.HelloSerializer
def get(self, request, format=None):
""... | 2.75 | 3 |
a10sdk/core/ipv6/ipv6_pmtu.py | deepfield/a10sdk-python | 16 | 12798382 | <filename>a10sdk/core/ipv6/ipv6_pmtu.py
from a10sdk.common.A10BaseClass import A10BaseClass
class Pmtu(A10BaseClass):
"""Class Description::
Configure Path MTU option.
Class pmtu supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.... | 2.3125 | 2 |
drepr/old_code/prototype/drepr/services/ra_reader/multi_ra_reader.py | scorpio975/d-repr | 5 | 12798383 | from typing import List, Dict, Tuple, Callable, Any, Optional, Union
from drepr.models import Variable, Location
from drepr.services.ra_iterator import RAIterator
from drepr.services.ra_reader.ra_reader import RAReader
class MultiRAReader(RAReader):
def __init__(self, ra_readers: Dict[str, RAReader]):
se... | 2.203125 | 2 |
python-core/src/Dates.py | NSnietol/python-core-and-advanced | 2 | 12798384 | '''
Created on Nov 14, 2018
@author: nilson.nieto
'''
import time, datetime
# Using Epoch
print(time.ctime(time.time()))
print('Current day')
print(datetime.datetime.today())
| 3.59375 | 4 |
aoc/day04/part1.py | hron/advent-of-code-2021 | 0 | 12798385 | <filename>aoc/day04/part1.py<gh_stars>0
# Advent of Code - Day 4 - Part One
from aoc.day04.game import Game
def result(raw_bingo_game: list[str]):
game = Game(raw_bingo_game)
game.perform()
return sum(game.all_unmarked_numbers(game.winning_board)) * game.winning_number
| 2.359375 | 2 |
backend/api/trades/serializers.py | rbose85/bounce-cars | 0 | 12798386 | <reponame>rbose85/bounce-cars<gh_stars>0
from rest_framework import serializers
from trades.models import Trade
class TradeSerializer(serializers.HyperlinkedModelSerializer):
"""
Regulate what goes over the wire for a `Trade` resource.
"""
class Meta:
model = Trade
exclude = ("create... | 2.625 | 3 |
ipf/step.py | pauldalewilliams/ipf | 1 | 12798387 |
###############################################################################
# Copyright 2011,2012 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... | 2.125 | 2 |
Room/wechat_try.py | 39xdgy/Self_study | 0 | 12798388 | import itchat
import datetime, os, platform, time
import cv2
import face_recognition as face
from sklearn.externals import joblib
def send_move(friends_name, text):
users = itchat.search_friends(name = friends_name)
print(users)
userName = users[0]['UserName']
itchat.send(text, toUserName = userName)
... | 2.84375 | 3 |
src/kpdetector/concatenate_results.py | gathierry/FashionAI-KeyPointsDetectionOfApparel | 174 | 12798389 | import pandas as pd
from src.config import Config
config = Config()
dfs = []
for cloth in ['blouse', 'skirt', 'outwear', 'dress', 'trousers']:
df = pd.read_csv(config.proj_path + 'kp_predictions/' + cloth + '.csv')
dfs.append(df)
res_df = pd.concat(dfs)
res_df.to_csv(config.proj_path +'kp_prediction... | 2.671875 | 3 |
K-means.py | Piyush9323/K-means | 0 | 12798390 |
### Author : <NAME>
# --> Implementation of **K-MEANS** algorithim.
"""
#Importing the Libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import random
#Reading the dataset
iris = pd.read_csv('https://raw.githubusercontent.com/Piyush9323/NaiveBayes_in_Python/main/iris.csv')
#iris.head(... | 3.59375 | 4 |
utilipy/tests/test_init_subpackages.py | nstarman/utilipy | 2 | 12798391 | # -*- coding: utf-8 -*-
"""Tests for :mod:`~utilipy.utils`."""
__all__ = [
"test_init_data_utils",
"test_init_decorators",
"test_init_imports",
"test_init_ipython",
"test_init_math",
"test_init_plot",
"test_init_scripts",
"test_init_utils",
"test_utils_top_level_imports",
]
####... | 1.726563 | 2 |
test/test_data.py | sei-nmvanhoudnos/Juneberry | 0 | 12798392 | <filename>test/test_data.py
#! /usr/bin/env python3
# ==========================================================================================================================================================
# Copyright 2021 Carnegie Mellon University.
#
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE E... | 1.671875 | 2 |
trainer/craft/utils/inference_boxes.py | ishine/EasyOCR | 56 | 12798393 | import os
import re
import itertools
import cv2
import time
import numpy as np
import torch
from torch.autograd import Variable
from utils.craft_utils import getDetBoxes, adjustResultCoordinates
from data import imgproc
from data.dataset import SynthTextDataSet
import math
import xml.etree.ElementTree as elemTree
#... | 1.898438 | 2 |
examples/upload.py | Tangerino/telemetry-datastore | 0 | 12798394 | from time import time
from telemetry_datastore import Datastore
def data_push_to_cloud(data_points):
last_id = 0
for data_point in data_points:
last_id = data_point["id"]
return last_id
if __name__ == '__main__':
start_time = time()
total = 0
index = 0
batch_size = 1000
with... | 2.859375 | 3 |
src/server/helpers.py | Fisab/life_simulation | 0 | 12798395 | <gh_stars>0
import time
import numpy as np
def log(*argv):
"""
Maybe someday i make normal logging...
:return:
"""
msg = ''
for i in argv:
msg += i + ' '
print(msg)
def blend(alpha, base=(255, 255, 255), color=(0, 0, 0)):
"""
:param color should be a 3-element iterable, elements in [0,255]
:param alpha... | 2.953125 | 3 |
Sapphire/TupleOfExpression.py | Rhodolite/Parser-py | 0 | 12798396 | #
# Copyright (c) 2017 <NAME>. All rights reserved.
#
@gem('Sapphire.TupleOfExpression')
def gem():
require_gem('Sapphire.Cache')
require_gem('Sapphire.TokenTuple')
tuple_of_expression_cache = {}
class TupleOfExpression(TokenTuple):
__slots__ = (())
display_name = 'expression-*... | 2.359375 | 2 |
Voting/admin.py | MihaiBorsu/EVS2 | 0 | 12798397 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import *
admin.site.register(VotingEvent)
admin.site.register(Question)
admin.site.register(Choice)
| 1.242188 | 1 |
purchase/urls.py | rajeshr188/one | 0 | 12798398 | <reponame>rajeshr188/one
from django.urls import path, include
from rest_framework import routers
from . import api
from . import views
router = routers.DefaultRouter()
router.register(r'invoice', api.InvoiceViewSet)
router.register(r'invoiceitem', api.InvoiceItemViewSet)
router.register(r'payment', api.PaymentViewSe... | 2.109375 | 2 |
tests/integration/cattletest/core/test_ha.py | pranavs18/cattle | 0 | 12798399 | from common_fixtures import * # NOQA
def _process_names(processes):
return set([x.processName for x in processes])
def test_container_ha_default(admin_client, sim_context):
c = admin_client.create_container(imageUuid=sim_context['imageUuid'],
data={'simForgetImmediatel... | 2 | 2 |
pybilt/mda_tools/mda_msd.py | blakeaw/ORBILT | 11 | 12798400 | <gh_stars>10-100
#we are going to use the MDAnalysis to read in topo and traj
#numpy
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
#import my running stats class
from pybilt.common.running_stats import RunningStats
# import the coordinate... | 2.3125 | 2 |
mokocchi/tomoko/repaint/__init__.py | mvasilkov/scrapheap | 2 | 12798401 | <filename>mokocchi/tomoko/repaint/__init__.py
def int_to_pixel(n):
return (int(n & 0xff0000) >> 16,
int(n & 0x00ff00) >> 8,
int(n & 0x0000ff))
def pixel_to_int(p):
return p[0] << 16 | p[1] << 8 | p[2]
| 2.359375 | 2 |
manpage-bot/links.py | Shaptic/manpage-slackbot | 2 | 12798402 | import os
import errno
ERRNO_STRINGS = [
os.strerror(x).lower() for x in errno.errorcode.keys()
]
MANPAGE_MAPPING = {
'.ldaprc': ['http://man7.org/linux/man-pages/man5/.ldaprc.5.html'],
'30-systemd-environment-d-generator': ['http://man7.org/linux/man-pages/man7/30-systemd-environment-d-generator.7.html',
... | 2.09375 | 2 |
apps/photo/scan.py | aeraeg/first_leader | 0 | 12798403 | from PIL import Image
import pytesseract
import os
import openpyxl as xl
from pytesseract import Output
from pytesseract import pytesseract as pt
import numpy as np
from matplotlib import pyplot as plt
import cv2
from imutils.object_detection import non_max_suppression
class Scan():
def __init__(self,fol... | 2.78125 | 3 |
hotbox/__main__.py | bajaco/hotbox | 0 | 12798404 | from hotbox.managers import *
configManager = ConfigManager()
commandManager = CommandManager()
#Main class for controlling program state
class Main():
def __init__(self, configManager, commandManager):
self.state = 0
self.configManager = configManager
self.commandManager = commandManager... | 2.84375 | 3 |
utils/test/reporting/api/server.py | Thajudheen/opnfv | 0 | 12798405 | ##############################################################################
# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, ... | 2.5625 | 3 |
citywok_ms/utils/logging.py | HenriqueLin/CityWok-ManagementSystem | 0 | 12798406 | from flask import has_request_context, request
from flask_login import current_user as user
import logging
class MyFormatter(logging.Formatter): # test: no cover
def __init__(self, fmt, style) -> None:
super().__init__(fmt=fmt, style=style)
def format(self, record):
if user:
if u... | 2.734375 | 3 |
verticapy/tests/vModel/test_vM_tsa_tools.py | sitingren/VerticaPy | 0 | 12798407 | <gh_stars>0
# (c) Copyright [2018-2021] Micro Focus or one of its affiliates.
# 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.03125 | 2 |
src/qiskit_trebugger/views/widget/button_with_value.py | kdk/qiskit-timeline-debugger | 7 | 12798408 | import ipywidgets as widgets
class ButtonWithValue(widgets.Button):
def __init__(self, *args, **kwargs):
self.value = kwargs['value']
kwargs.pop('value', None)
super(ButtonWithValue, self).__init__(*args, **kwargs) | 2.75 | 3 |
Analysis/pynvml/pynvml_test.py | sequencer2014/TS | 0 | 12798409 | <reponame>sequencer2014/TS
#!/usr/bin/env python
# Copyright (C) 2011 Ion Torrent Systems, Inc. All Rights Reserved
from pynvml import *
nvmlInit()
print("Driver Version: %s" % nvmlSystemGetDriverVersion())
deviceCount = nvmlDeviceGetCount()
for i in range(deviceCount):
handle = nvmlDeviceGetHandleByIndex(i)
... | 2.1875 | 2 |
src/data/transform.py | musa-atlihan/spark-pm | 0 | 12798410 | <gh_stars>0
from pathlib import Path
import pandas as pd
import argparse
if __name__ == '__main__':
directory = Path('records')
directory.mkdir(exist_ok=True, parents=True)
for file in Path('./').glob('*.csv'):
df = pd.read_csv(file).to_parquet(directory / f'{file.stem}.parquet')
| 2.765625 | 3 |
climate_categories/__init__.py | rgieseke/climate_categories | 0 | 12798411 | """Access to all categorizations is provided directly at the module level, using the
names of categorizations. To access the example categorization `Excat`, simply use
`climate_categories.Excat` .
"""
__author__ = """<NAME>"""
__email__ = "<EMAIL>"
__version__ = "0.7.1"
import importlib
import importlib.resources
imp... | 2.375 | 2 |
wavespec/Spectrogram/Spectrogram3DOld.py | mattkjames7/wavespec | 1 | 12798412 | <filename>wavespec/Spectrogram/Spectrogram3DOld.py
import numpy as np
from .Spectrogram import Spectrogram
def Spectrogram3D(t,vx,vy,vz,wind,slip,Freq=None,Method='FFT',
WindowFunction=None,Param=None,Detrend=True,
FindGaps=False,GoodData=None,Threshold=0.0,
Fudge=False,OneSided=True,Tax=None,Steps=None... | 2.828125 | 3 |
Class_2/show-lldp.py | travism16/Python-Course | 0 | 12798413 | <reponame>travism16/Python-Course
import os
from netmiko import ConnectHandler
from getpass import getpass
from datetime import datetime
device = {
"host": "nxos1.lasthop.io",
"username": "pyclass",
"password": getpass(),
"device_type": "cisco_nxos",
"session_log": "nxos1_session.txt",
"global_delay_factor": 2
... | 2.578125 | 3 |
src/yarr_tools/utils/yarr_histo.py | dantrim/yarr-tools | 0 | 12798414 | import numpy as np
import json
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
class YarrHisto1d:
def __init__(self, data: np.array, metadata: json = {}) -> None:
# need to check shape
self._histogram = data
self._name = ""
self._overflow = 0.0
... | 2.78125 | 3 |
py/cvangysel/logging_utils.py | cvangysel/cvangysel-common | 0 | 12798415 | <gh_stars>0
import logging
import os
import socket
import subprocess
import sys
def get_formatter():
return logging.Formatter(
'%(asctime)s [%(threadName)s.{}] '
'[%(name)s] [%(levelname)s] '
'%(message)s'.format(get_hostname()))
def configure_logging(args, output_path=None):
loglev... | 2.34375 | 2 |
allennlp/data/dataset.py | pmulcaire/allennlp | 1 | 12798416 | """
A :class:`~Dataset` represents a collection of data suitable for feeding into a model.
For example, when you train a model, you will likely have a *training* dataset and a *validation* dataset.
"""
import logging
from collections import defaultdict
from typing import Dict, List, Union
import numpy
import tqdm
fr... | 3.515625 | 4 |
gen.py | firemark/stack-sim | 0 | 12798417 | #!/usr/bin/env python3
import os
from time import sleep
from glob import glob
from shutil import copytree, rmtree, ignore_patterns
from jinja2 import Environment, FileSystemLoader, select_autoescape
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
env = Environment(
loade... | 2.265625 | 2 |
api/routes/routes_general.py | cdagli/python-address-book | 0 | 12798418 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
from flask import Blueprint
from flask import request
from api.utils.responses import response_with
from api.utils import responses as resp
from api.models.person import Person, PersonSchema
from api.models.group import Group, GroupSchema
from api.models.email i... | 2.703125 | 3 |
generator/artaigen.py | SilentByte/artai | 8 | 12798419 | <filename>generator/artaigen.py
"""
ArtAI -- An Generative Art Project using Artificial Intelligence
Copyright (c) 2021 SilentByte <https://silentbyte.com/>
"""
import os
import time
import subprocess
import logging
import requests
from dotenv import load_dotenv
from shutil import move
load_dotenv()
ARTAI_GEN_ENDPO... | 2.28125 | 2 |
csaopt/model_loader/model_validator.py | d53dave/cgopt | 1 | 12798420 | <filename>csaopt/model_loader/model_validator.py
import inspect
import subprocess
from pyhocon import ConfigTree
from typing import Optional, List, Dict, Callable
from ..model import RequiredFunctions
from . import ValidationError
def _empty_function():
pass
class ModelValidator:
empty_function_bytecode =... | 2.484375 | 2 |
tests/lop/test_restriction.py | carnot-shailesh/cr-sparse | 42 | 12798421 | from .lop_setup import *
def test_resriction_0():
n = 4
index = jnp.array([0, 2])
T = lop.jit(lop.restriction(n, index))
x = random.normal(keys[0], (n,))
assert_allclose(T.times(x), x[index])
y = jnp.zeros_like(x).at[index].set(x[index])
assert lop.dot_test_real(keys[0], T)
assert_allc... | 1.679688 | 2 |
test/programytest/clients/polling/twitter/test_config.py | whackur/chatbot | 2 | 12798422 | import unittest
from programy.config.file.yaml_file import YamlConfigurationFile
from programy.clients.polling.twitter.config import TwitterConfiguration
from programy.clients.events.console.config import ConsoleConfiguration
class TwitterConfigurationTests(unittest.TestCase):
def test_init(self):
yaml ... | 2.515625 | 3 |
pokeman/coatings/messaging_endpoints/_abc_endpoint.py | wmarcuse/pokeman | 0 | 12798423 | <reponame>wmarcuse/pokeman
from pokeman.utils.custom_abc import ABCMeta, abstract_attribute
# TODO: Add more arguments https://pika.readthedocs.io/en/stable/modules/channel.html#pika.channel.Channel.basic_consume
class AbstractBasicMessagingEndpoint(metaclass=ABCMeta):
"""
Abstract base class for Enterprise I... | 2.421875 | 2 |
init_handler.py | LucidumInc/update-manager | 0 | 12798424 | <reponame>LucidumInc/update-manager
import os
import shutil
import sys
from loguru import logger
from config_handler import get_lucidum_dir
from exceptions import AppError
def change_permissions_recursive(path, mode):
os.chmod(path, mode)
for root, dirs, files in os.walk(path):
for dir_ in dirs:
... | 2.390625 | 2 |
examples/newskylabs/graphics/svg/library/vcard_example_data.py | newskylabs/newskylabs-corporate-design | 0 | 12798425 | ## =========================================================
## Copyright 2019 <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... | 1.375 | 1 |
src/sklearn/minist-tut.py | samehkamaleldin/pysci-tutorial | 0 | 12798426 | <gh_stars>0
#-------------------------------------------------------------------------------
# Project | pysci-tutorial
# Module | minsit-tut
# Author | <NAME>
# Description | minsit dataset tutorial
# Reference | http://scikit-learn.org/stable/tutorial/basic/tutorial.html
#-----------------------------... | 2.765625 | 3 |
test/test_dbstore.py | carolinux/OpenBazaar | 1 | 12798427 | #!/usr/bin/env python
#
# This library is free software, distributed under the terms of
# the GNU Lesser General Public License Version 3, or any later version.
# See the COPYING file included in this archive
#
# The docstrings in this module contain epytext markup; API documentation
# may be created by processing this... | 2.40625 | 2 |
server/handlers/BaseHandler.py | AKAMEDIASYSTEM/rf-immanence | 1 | 12798428 | #!/usr/bin/env python
# curriculum - semantic browsing for groups
# (c)nytlabs 2014
import datetime
import json
import tornado
import tornado.ioloop
import tornado.web
import tornado.options
import tornado.template
import ResponseObject
import traceback
class BaseHandler(tornado.web.RequestHandler):
def __init__... | 2.265625 | 2 |
2_Linear_And_Logistic_Regression/PythonSklearn/linear_logistic_regression_polynomial.py | vladiant/SoftUniMachineLearning2019 | 2 | 12798429 | import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression, RANSACRegressor
from sklearn.preprocessing import PolynomialFeatures
import matplotlib.pyplot as plt
# housing_data = pd.read_fwf("https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data", header=None)
hous... | 3.671875 | 4 |
codewof/programming/management/commands/__init__.py | taskmaker1/codewof | 3 | 12798430 | """Module for the custom commands for the programming appliation."""
| 1.101563 | 1 |
src/artifice/scraper/resources/metrics.py | artifice-project/artifice-scraper | 0 | 12798431 | <reponame>artifice-project/artifice-scraper
import logging
from flask import current_app
from flask import request
from flask_restful import Resource
from artifice.scraper.models import (
db,
Queue,
Content,
)
from artifice.scraper.utils import (
reply_success,
)
from artifice.scraper.supervisor import... | 2.140625 | 2 |
spinesTS/pipeline/_pipeline.py | BirchKwok/spinesTS | 2 | 12798432 | import copy
import numpy as np
from sklearn.base import RegressorMixin
from spinesTS.base import EstimatorMixin
class Pipeline(RegressorMixin, EstimatorMixin):
"""estimators pipeline """
def __init__(self, steps:[tuple]):
"""
Demo:
'''python
from spinesTS.... | 2.578125 | 3 |
scripts/6-estrutura-dados-python/dicionarios-python/ex092.py | dev-alissonalves/python-codes | 1 | 12798433 | <gh_stars>1-10
#Exercício Python 092: Crie um programa que leia nome, ano de nascimento e carteira de trabalho e cadastre-o (com idade) em um dicionário. Se por acaso a CTPS for diferente de ZERO, o dicionário receberá também o ano de contratação e o salário. Calcule e acrescente, além da idade, com quantos anos a pess... | 4.0625 | 4 |
src/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_pid_state.py | Toni-SM/omni.add_on.ros2_bridge | 0 | 12798434 | # generated from rosidl_generator_py/resource/_idl.py.em
# with input from control_msgs:msg/PidState.idl
# generated code does not contain a copyright notice
# Import statements for member types
import rosidl_parser.definition # noqa: E402, I100
class Metaclass_PidState(type):
"""Metaclass of message 'PidStat... | 1.84375 | 2 |
external/models/TransH_BERT_h2/__init__.py | swapUniba/Elliot_refactor-tesi-Ventrella | 0 | 12798435 | <filename>external/models/TransH_BERT_h2/__init__.py
from .TransH_BERT_h2 import TransH_BERT_h2
| 1.15625 | 1 |
frames_provider.py | Algokodabra/IdleBreakoutBot | 0 | 12798436 | <reponame>Algokodabra/IdleBreakoutBot<gh_stars>0
"""
This module contains class FramesProvider allowing to acquire frames by using take_frame() method.
These frames can be either images, which have been read from the disk, or the screen snapshots.
"""
import os
import enum
import numpy as np
import cv2
import p... | 2.734375 | 3 |
papers/paper-nsdi2013/data/tools/analysis/analysis.py | jcnelson/syndicate | 16 | 12798437 | <gh_stars>10-100
#!/usr/bin/python
import os
import sys
def parse_experiments( fd, ignore_blank=False ):
ret = {} # map experiment name to data
mode = "none"
experiment_name = ""
fc_distro = ""
experiment_lines = []
while True:
line = fd.readline()
if len(line) == 0:
bre... | 2.765625 | 3 |
deprecated/pycqed/analysis/old_tomo_code.py | nuttamas/PycQED_py3 | 60 | 12798438 |
# Commented out as this code does not run as is (missing imports etc)
# class Tomo_Analysis(MeasurementAnalysis):
# def __init__(self, num_qubits=2, quad='IQ', over_complete_set=False,
# plot_oper=True, folder=None, auto=False, **kw):
# self.num_qubits = num_qubits
# self.num_sta... | 2.34375 | 2 |
case_plaso/event_exporters/ntfs.py | casework/CASE-Implementation-Plaso | 1 | 12798439 |
from plaso.lib.eventdata import EventTimestamp
from case_plaso.event_exporter import EventExporter
@EventExporter.register('fs:stat:ntfs')
class NTFSExporter(EventExporter):
TIMESTAMP_MAP = {
EventTimestamp.CREATION_TIME: 'mftFileNameCreatedTime',
EventTimestamp.MODIFICATION_TIME: 'mftFileNameM... | 2.1875 | 2 |
src/fhir_types/FHIR_Patient_Contact.py | anthem-ai/fhir-types | 2 | 12798440 | from typing import Any, List, Literal, TypedDict
from .FHIR_Address import FHIR_Address
from .FHIR_CodeableConcept import FHIR_CodeableConcept
from .FHIR_ContactPoint import FHIR_ContactPoint
from .FHIR_Element import FHIR_Element
from .FHIR_HumanName import FHIR_HumanName
from .FHIR_Period import FHIR_Period
from .FH... | 1.640625 | 2 |
portfolio/portfolio_api/migrations/0001_initial.py | muniri92/django-react-blog | 0 | 12798441 | <reponame>muniri92/django-react-blog<filename>portfolio/portfolio_api/migrations/0001_initial.py
# Generated by Django 2.0.5 on 2018-05-21 10:41
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | 1.914063 | 2 |
packages/python/m/github/ci_dataclasses.py | LaudateCorpus1/m | 0 | 12798442 | from dataclasses import dataclass
from typing import List, Optional
from ..core.io import JsonStr
@dataclass
class Author(JsonStr):
"""An object representing a commiter."""
login: str
avatar_url: str
email: str
@dataclass
class AssociatedPullRequest(JsonStr):
"""Information for commits that are... | 3.0625 | 3 |
pegaTubo.py | wellingtonfs/fsek-pessoal | 0 | 12798443 | #!/usr/bin/env python3
from ev3dev.ev3 import *
from ev3dev2.motor import OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, MoveTank, MediumMotor, LargeMotor
from ev3dev2.sensor import INPUT_1, INPUT_2, INPUT_3
from ev3dev2.sensor.lego import GyroSensor
import time
tank = MoveTank(OUTPUT_C, OUTPUT_D)
Sensor_Cor[0].mode = 'COL-... | 2.640625 | 3 |
ncortex/optimization/naive_trajopt.py | pvarin/ncortex | 0 | 12798444 | ''' Naively optimize a trajectory of inputs.
'''
import tensorflow as tf
def run_naive_trajopt(env, x_0, u_init):
'''
Runs a naive trajectory optimization using built-in TensorFlow optimizers.
'''
# Validate u_init shape.
N = u_init.shape[0]
assert u_init.shape == (N, env.get_num_actuators)
... | 3.390625 | 3 |
LeetCodeSolutions/python/437_Path_Sum_III.py | ChuanleiGuo/AlgorithmsPlayground | 1 | 12798445 | <filename>LeetCodeSolutions/python/437_Path_Sum_III.py
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def pathSum(self, root, s):
"""
:type root: TreeNode
:type s: int
:rtype: int
... | 3.65625 | 4 |
patients/migrations/0005_auto_20180216_1200.py | josdavidmo/clinical_records | 0 | 12798446 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-16 12:00
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('patients', '0004_auto_20180215_1208'),
]
... | 1.6875 | 2 |
vkwave/bots/core/dispatching/handler/__init__.py | Stunnerr/vkwave | 222 | 12798447 | from .base import BaseHandler, DefaultHandler # noqa: F401
from .cast import caster as callback_caster # noqa: F401
| 1.335938 | 1 |
catalog/category.py | cyrildzumts/django-catalog | 0 | 12798448 | <reponame>cyrildzumts/django-catalog<gh_stars>0
# from django.db import models
from catalog.models import Category, Product
class CategoryEntry:
def __init__(self, category):
self.current = category
self.children = self.current.get_categories
def is_parent(self):
return self.children ... | 2.5625 | 3 |
diffpy/srxplanar/mask.py | yevgenyr/diffpy.srxplanar | 1 | 12798449 | <filename>diffpy/srxplanar/mask.py
#!/usr/bin/env python
##############################################################################
#
# diffpy.srxplanar by DANSE Diffraction group
# <NAME>
# (c) 2010 Trustees of the Columbia University
# in the City of Ne... | 2.28125 | 2 |
haxizhijiao/hzxi/haxi_simple_model_CRUD.py | 15354333388/haxizhijiao | 0 | 12798450 | # coding: utf-8
from . import database_operation
class HaxiSimpleCrud(object):
@staticmethod
def get(table, limit=None, skip=None, desc=None, fields=[], contions={}):
return database_operation.DatabaseOperation(table).find(fields=fields, contions=contions, limit=limit, skip=skip, desc=desc)
@sta... | 2.484375 | 2 |