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 |
|---|---|---|---|---|---|---|
transport/tests/uploader_test.py | zkdev/cc-utils | 15 | 12781351 | import processing.uploaders as uploaders
PREFIX_UPLOADERS = [
{
'context_url': 'registry.local:5000/context-dir',
'prefix': 'registry.local:5000',
'mangle': True,
'expected_target_ref': 'registry.local:5000/registry-source_local:1.2.3',
},
{
'context_url': 'registry... | 2.21875 | 2 |
tools/spaln/list_spaln_tables.py | ic4f/tools-iuc | 142 | 12781352 | #!/usr/bin/env python3
import argparse
import shlex
import sys
from subprocess import run
from typing import TextIO
def find_common_ancestor_distance(
taxon: str, other_taxon: str, taxonomy_db_path: str, only_canonical: bool
):
canonical = "--only_canonical" if only_canonical else ""
cmd_str = f"taxonomy... | 2.5625 | 3 |
test/test.py | franzmueller/analytics-operator-local-adder | 0 | 12781353 | <reponame>franzmueller/analytics-operator-local-adder
# Copyright 2020 InfAI (CC SES)
#
# 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
#
... | 2.625 | 3 |
cc2541/sensor.py | robotice-devices/cc2541-device | 1 | 12781354 | <gh_stars>1-10
from cc2541 import CC2541
def get_data(sensor):
name = sensor.get('name')
mac = sensor.get('mac')
data = []
cc2541 = CC2541(mac)
METRIC_STR = "%s.{0}.{0}" % name
data.append((METRIC_STR.format(mac, "temperature"), cc2541.temperature))
data.append((METRIC_STR.format(mac,... | 2.890625 | 3 |
tests/test_client.py | hmarment/rested | 0 | 12781355 | <reponame>hmarment/rested
import pytest
from rested import Integration, Rested
@pytest.fixture(scope='module')
def setup_integrations():
"""Set up a test resource."""
print('Setting up a test integrations for multiple APIs')
return [Integration(name='myapi1'),
Integration(name='myapi2'),
... | 2.453125 | 2 |
pybot/utils/timer.py | spillai/pybot | 78 | 12781356 | <filename>pybot/utils/timer.py
# Author: <NAME> <<EMAIL>>
# License: MIT
from __future__ import print_function
import time
from collections import OrderedDict
from functools import wraps
def print_green(prt): print("\033[92m {}\033[00m" .format(prt))
global g_timers
g_timers = OrderedDict()
def named_timer(name):
... | 2.765625 | 3 |
pyboletox/Contracts/Cnab/Retorno/Cnab400/header.py | lucasbrahm/pyboletox | 1 | 12781357 | <gh_stars>1-10
from abc import ABCMeta, abstractmethod
class Header(metaclass=ABCMeta):
@abstractmethod
def getOperacaoCodigo(self):
pass
@abstractmethod
def getOperacao(self):
pass
@abstractmethod
def getServicoCodigo(self):
pass
@abstractmethod
def get... | 3.140625 | 3 |
rcs_back/containers_app/migrations/0034_auto_20210826_2017.py | e-kondr01/rcs_back | 0 | 12781358 | <reponame>e-kondr01/rcs_back<filename>rcs_back/containers_app/migrations/0034_auto_20210826_2017.py<gh_stars>0
# Generated by Django 3.2.5 on 2021-08-26 17:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('containers_app', '0033_auto_20210826_2005'),
]
... | 1.414063 | 1 |
util.py | cmd410/VRoidBonesRenamer | 12 | 12781359 | <filename>util.py
import bpy
def unique_constraint(bone, t):
for constraint in bone.constraints:
if constraint.type == t:
return constraint
constraint = bone.constraints.new(type=t)
return constraint
def get_children(parent):
l = []
for obj in bpy.context.scene.objects:
... | 2.515625 | 3 |
6.whileloops/challenge3_rouillonh.py | rouillonh/ChallengePython | 0 | 12781360 | <reponame>rouillonh/ChallengePython<filename>6.whileloops/challenge3_rouillonh.py
#Importamos la libreria time
from time import time
print("\tWelcome to the Prime Number App")
#Creamos esta variable para el bucle sin fin
band = True
while band:
print("\nEnter 1 to determine if a specific number is prime.")
prin... | 4.125 | 4 |
Lib/site-packages/deriva/qt/common/table_widget.py | fochoao/cpython | 0 | 12781361 | from PyQt5.QtWidgets import QTableWidget
class TableWidget(QTableWidget):
def __init__(self, parent):
super(QTableWidget, self).__init__(parent)
def getCurrentTableRow(self):
row = self.currentRow()
if row == -1 and self.rowCount() > 0:
row = 0
return row
de... | 3.0625 | 3 |
setup.py | coisme/nanoleaf | 8 | 12781362 | <reponame>coisme/nanoleaf<filename>setup.py
from setuptools import setup
import subprocess
gitVersion = subprocess.check_output("git tag -l --points-at HEAD".split()).decode('UTF-8').strip()
setup(
name='nanoleaf',
packages=['nanoleaf'],
version=gitVersion,
description='Python interface for Nanoleaf A... | 1.28125 | 1 |
OmniMarkupLib/Renderers/MediaWikiRenderer.py | henumohe/OmniMarkupPreviewer | 476 | 12781363 | <filename>OmniMarkupLib/Renderers/MediaWikiRenderer.py<gh_stars>100-1000
from .base_renderer import *
import os.path
__file__ = os.path.normpath(os.path.abspath(__file__))
__path__ = os.path.dirname(__file__)
@renderer
class MediaWikiRenderer(CommandlineRenderer):
def __init__(self):
super(MediaWikiRend... | 2.34375 | 2 |
Python/Battery_Full_Charged_Notifier/battery_full_charged_notifier.pyw | iamakkkhil/Rotten-Scripts | 1,127 | 12781364 | import psutil #Library to get System details
import time
import pyttsx3 # Library for text to speech Offline
from win10toast import ToastNotifier # also need to install win32api (This is for Notifications)
import threading # To make notification and speech work at same time
toaster = ToastNotifier()
x=pyttsx3.init()
x... | 3.296875 | 3 |
akanda/router/drivers/ping.py | fzylogic/akanda-appliance | 0 | 12781365 | # Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, LLC
#
# 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 applicabl... | 2.203125 | 2 |
quantumflow/transform.py | BastianZim/quantumflow-dev | 51 | 12781366 | # Copyright 2019-, <NAME> and the QuantumFlow contributors
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
QuantumFlow: Translate, transform, and compile circuits.
"""
# Note: Beta Prototype
from typing import Call... | 1.984375 | 2 |
Diversity/accounts/admin.py | IAmAngelLiu/shellhack2021 | 0 | 12781367 | <filename>Diversity/accounts/admin.py
from django.contrib import admin
# Register your models here.
from .models import Employee
from .models import Data
from .models import Points
admin.site.register(Employee)
admin.site.register(Data)
admin.site.register(Points)
| 1.507813 | 2 |
setup.py | damcio/-Bio-Projekt-semestralny | 0 | 12781368 | <filename>setup.py<gh_stars>0
#!/usr/bin/env python
from setuptools import setup
setup(name='bio',
version='0.1',
description='Bioinformatics project',
author='<NAME>',
setup_requires=['pytest-runner'],
tests_require=['pytest']
)
| 0.910156 | 1 |
A1014280203/7/7.py | saurabh896/python-1 | 3,976 | 12781369 | import os
code_lines = list()
notation_lines = list()
blank_lines = list()
def process_file(filename):
global code_lines
global notation_lines
global blank_lines
with open(filename, 'r') as file:
for line in file.readlines():
_line = line.strip()
if not _... | 3.078125 | 3 |
SampleProject/POMObjectDemo/Pages/loginPage.py | MelissaQA/selenium-py-example | 0 | 12781370 | from ..Locators.locators import Locators
class LoginPage():
def __init__(self, driver):
self.driver = driver
self.username_textbox_id = Locators.username_textbox_id
self.password_textbox_id = Locators.password_textbox_id
self.login_button_id = Locators.login_button_id
self.... | 3.015625 | 3 |
main.py | mftnakrsu/Comparison-of-OCR | 10 | 12781371 | from ocr import OCR
ocr=OCR(image_folder="test/")
if __name__ == "__main__":
ocr.keras_ocr_works()
ocr.easyocr_model_works()
ocr.pytesseract_model_works()
| 1.65625 | 2 |
pygraff/generator.py | cryptolake/Graff | 1 | 12781372 | <reponame>cryptolake/Graff<filename>pygraff/generator.py
from bs4 import BeautifulSoup
from pathlib import Path
def gen_prevs(paths, title_tag, preview_tag, max_char, posts_dir):
"""generate post preview from each blog file
:returns: list of post previews
"""
posts = []
for page in paths:
... | 2.875 | 3 |
src/inbox/pipelines.py | Eforcers/inbox-cleaner | 1 | 12781373 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from datetime import datetime
import logging
import constants
from inbox.helpers import IMAPHelper
from inbox.models import MoveMessageProcess
from livecount import counter
import pipeline
from pipeline.common import List
from models import MoveProcess, MoveUserProcess
from tasks... | 2.0625 | 2 |
daily_messages/daily_messages.py | rohinigopalqxf2/qxf2-lambdas | 3 | 12781374 | <gh_stars>1-10
"""
Get messages for employees from daily-messages.qxf2.com
And post to Skype Sender
"""
import boto3
import requests
BASE_URL = 'http://daily-messages.qxf2.com'
QUEUE_URL = 'https://sqs.ap-south-1.amazonaws.com/285993504765/skype-sender'
def clean_message(message):
"Clean up the message received"
... | 2.859375 | 3 |
chef_admin/apps.py | pradeepdhankhar/chef24x7 | 0 | 12781375 | <gh_stars>0
from django.apps import AppConfig
class ChefAdminConfig(AppConfig):
name = 'chef_admin'
| 1.054688 | 1 |
setup.py | hanshoi/kapsi-git-manager | 0 | 12781376 | import os
from setuptools import setup
def read(fname):
"""
Read README.md as long description if found.
Otherwise just return short description.
"""
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return "Simple git management applicatio... | 1.789063 | 2 |
LocalGP.py | nick-terry/Splitting-GP | 1 | 12781377 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 7 10:57:53 2020
@author: pnter
"""
import torch
import gpytorch
# from gpytorch.utils.memoize import add_to_cache, is_in_cache
from gpytorch.lazy.root_lazy_tensor import RootLazyTensor
import copy
from UtilityFunctions import updateInverseCovarWoodbury
from math import ... | 2.546875 | 3 |
core/controls/run.py | intercellar/FLOOR-E | 0 | 12781378 | <filename>core/controls/run.py
#!/usr/bin/python -B
from __future__ import division
import threading
import Tkinter as tk
import urllib
import json
from time import sleep, time
from os import system, listdir
import tkMessageBox
import Robot
import os
import Adafruit_PCA9685
#import RPi.GPIO as GPIO
#GPIO.setmode... | 2.40625 | 2 |
smartteddy.basket.computer/web/smartteddydashboard/smartteddydashboard/settings.py | smart-teddy-project-hhs/SmartTeddy | 2 | 12781379 | from pathlib import Path
import environ
env = environ.Env(
# set casting, default value
DEBUG=(bool, False)
)
environ.Env.read_env()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# SECURITY WARNING: keep the secret key used in production se... | 1.796875 | 2 |
undergen/lib/audio.py | DigiDuncan/undergen | 0 | 12781380 | from typing import TYPE_CHECKING
import requests
if TYPE_CHECKING:
from undergen.lib.data import Character
url = "https://api.15.ai/app/getAudioFile5"
cdn_url = "https://cdn.15.ai/audio/"
headers = {'authority': 'api.15.ai',
'access-control-allow-origin': '*',
'accept': 'application/json, t... | 2.765625 | 3 |
setup.py | ben-hoover/django-tz-detect | 0 | 12781381 | <reponame>ben-hoover/django-tz-detect
#!/usr/bin/env python
import os
import re
import sys
import codecs
import subprocess
from setuptools import setup, find_packages
def read(*parts):
file_path = os.path.join(os.path.dirname(__file__), *parts)
return codecs.open(file_path, encoding='utf-8').read()
setup(... | 1.8125 | 2 |
backend/apps/projects/efficiency/serializers.py | wuchaofan1654/tester | 0 | 12781382 |
from django.contrib.auth import get_user_model
from rest_framework import serializers
from apps.basics.op_drf.serializers import CustomModelSerializer
from apps.projects.efficiency.models import Efficiency
from apps.projects.efficiency.models import Module
UserProfile = get_user_model()
class EfficiencySerializer(... | 2.21875 | 2 |
users/models.py | hrbhat/twissandra | 308 | 12781383 | # Nope, we're using Cassandra :) | 0.777344 | 1 |
config.py | IntershopCommunicationsAG/ish-monitoring-postgresqldb-exporter | 1 | 12781384 | """
This file stores all the possible configurations for the Flask app.
Changing configurations like the secret key or the database
url should be stored as environment variables and imported
using the 'os' library in Python.
"""
import os
class BaseConfig:
SQLALCHEMY_TRACK_MODIFICATIONS = False
SSL = os.gete... | 2.453125 | 2 |
envs/traffic_counter.py | iron88sk/Project | 0 | 12781385 | import os, sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
import configparser
import env
from envs.seoul_env import SeoulEnv, SeoulController
import numpy as np
import matplotlib
ilds_map ={'1_l', '1_r', '2_l', '2_r', '3_u', '3_d'}
class SeoulConuterEnv(SeoulEnv):
def __init__... | 2.28125 | 2 |
src/awkward/_v2/operations/structure/ak_is_none.py | BioGeek/awkward-1.0 | 0 | 12781386 | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import awkward as ak
np = ak.nplike.NumpyMetadata.instance()
def is_none(array, axis=0, highlevel=True, behavior=None):
raise NotImplementedError
# """
# Args:
# arra... | 2.140625 | 2 |
ci/release.py | steve-louis/mist-ce | 778 | 12781387 | <gh_stars>100-1000
#!/usr/bin/env python
import os
import sys
import hashlib
import argparse
import magic
import requests
def main():
args = parse_args()
request = Client(args.owner, args.repo, args.token)
update_release(
request, args.tag, msg=args.msg, files=args.files,
prerelease=args... | 2.90625 | 3 |
build/lib/jet_django/__init__.py | lukejamison/jet-dasboard | 193 | 12781388 | VERSION = '0.0.1'
default_app_config = 'jet_django.apps.JetDjangoConfig'
| 1.046875 | 1 |
pages.py | mjwalker19/oTree-Retainage-Game | 0 | 12781389 | from otree.api import Currency as c, currency_range
from ._builtin import Page, WaitPage
from .models import Constants
import random
class SellerBidding(Page):
form_model = 'player'
form_fields = ['seller_bid', 'seller_exit']
def is_displayed(self):
return self.player.role() == 'seller'
def s... | 2.578125 | 3 |
src/spaceone/inventory/model/collection_state_model.py | whdalsrnt/inventory | 9 | 12781390 | from mongoengine import *
from spaceone.core.model.mongo_model import MongoModel
class CollectionState(MongoModel):
collector_id = StringField(max_length=40)
job_task_id = StringField(max_length=40)
secret_id = StringField(max_length=40)
resource_id = StringField(max_length=40)
resource_type = Str... | 2.078125 | 2 |
setup.py | MartinThoma/vin_decoder | 11 | 12781391 | <filename>setup.py
# core modules
import os
import io
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(file_name):
"""Read a text file and return the content as a string."""
with io.open(os.path.join(os.path.dirname(__file__), file_name),
... | 2.203125 | 2 |
abiflows/fireworks/integration_tests/itest_phonon.py | gmatteo/abiflows | 4 | 12781392 | <gh_stars>1-10
import pytest
import os
import glob
import unittest
import tempfile
import filecmp
import numpy.testing.utils as nptu
import abipy.data as abidata
from abipy.abio.factories import phonons_from_gsinput, PhononsFromGsFactory
from abipy.flowtk.tasks import TaskManager
from fireworks.core.rocket_launcher im... | 1.804688 | 2 |
src/playlist.py | jnsougata/Ditch-YouTube-API | 14 | 12781393 | <reponame>jnsougata/Ditch-YouTube-API<gh_stars>10-100
import re
from .videobulk import _VideoBulk
from .auxiliary import _src, _filter
class Playlist:
def __init__(self, playlist_id: str):
"""
:param str playlist_id: the _id of the playlist
"""
if 'youtube.com' in playlist_id:
... | 3.140625 | 3 |
OOSqrt.py | sidhu177/pythonprog | 2 | 12781394 | <reponame>sidhu177/pythonprog
"""
Created on Sun Jun 10 17:33:07 2018
Taken from Python 3 Object Oriented Programming by <NAME>, Apress
"""
import math
class Point:
def move(self, x,y):
self.x = x
self.y = y
def reset(self):
self.move(0,0)
def calculate_distance... | 3.703125 | 4 |
pylib/tools/root_helpers.py | gnafit/gna | 5 | 12781395 | <filename>pylib/tools/root_helpers.py
import ROOT as R
class TFileContext(object):
"""A context for opening a ROOT file"""
def __init__(self, filename, mode='read'):
self.filename = filename
self.mode = mode
def __enter__(self):
self.file = R.TFile(self.filename, self.mode)
... | 2.703125 | 3 |
src/quantum/azext_quantum/vendored_sdks/azure_quantum/aio/_quantum_client.py | haroonf/azure-cli-extensions | 1 | 12781396 | <reponame>haroonf/azure-cli-extensions
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) ... | 1.375 | 1 |
app/view_models/articleclass.py | huzhipeng2388/Flask_Blog | 1 | 12781397 | class ArticleClassModel:
def __init__(self,data):
self.id = data.acid
self.name = data.name
| 2.1875 | 2 |
algorithm/strings/too-simple/missing-list-elements.py | atb00ker/scripts-lab | 2 | 12781398 | <reponame>atb00ker/scripts-lab
#!/bin/python3
# Twitter 2019 Internship Coding Interview Round
def missingWords(s, t):
sList = s.split()
tList = t.split()
nList = []
j = 0
tLen = len(tList)
for index, item in enumerate(sList):
if item == tList[j]:
j += 1
if j == ... | 3.640625 | 4 |
data_analysis_byPro/Day09-01.py | yunjung-lee/class_python_data | 0 | 12781399 | <gh_stars>0
# SQLite 접속하기.
import sqlite3
con = sqlite3.connect('c:/temp/userDB') # 데이터베이스 지정(또는 연결)
cur = con.cursor() # 연결 통로 생성 (쿼리문을 날릴 통로)
# 테이블 만들기
try :
sql = "CREATE TABLE userTable(userID CHAR(10), userName CHAR(5), userAge INT)"
cur.execute(sql)
except :
pass
sql = "INSERT INTO userTable VALUES... | 3.71875 | 4 |
Parser-hybrid/nparser/neural/recur_cells/rnn_cell.py | sb-b/BOUN-PARSE | 12 | 12781400 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 <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 require... | 2.453125 | 2 |
tests/suite/test_healthcheck_uri.py | snebel29/kubernetes-ingress | 3,803 | 12781401 | <reponame>snebel29/kubernetes-ingress
import pytest
import requests
from suite.resources_utils import ensure_connection
@pytest.mark.ingresses
@pytest.mark.parametrize('ingress_controller, expected_responses',
[
pytest.param({"extra_args": ["-health-status=true",... | 2.171875 | 2 |
src/s3.py | ytyaru/Python.Dynamic.Create.Type.20191229160958 | 0 | 12781402 | #!/usr/bin/env python3
# coding: utf8
class MyClass: pass
class MyClass1:
cls_attr = 1
| 1.859375 | 2 |
cocoa_folder/dealornodeal/neural/rl_trainer.py | s-akanksha/DialoGraph_ICLR21 | 12 | 12781403 | <filename>cocoa_folder/dealornodeal/neural/rl_trainer.py
import argparse
import random
import json
import numpy as np
import copy
from collections import defaultdict
import torch
import torch.nn as nn
from torch.autograd import Variable
from cocoa.neural.rl_trainer import Statistics
from core.controller import Contr... | 2.25 | 2 |
kino-webhook/handler.py | DongjunLee/kino-bot | 109 | 12781404 | import arrow
import json
import requests
def kanban_webhook(event, context):
input_body = json.loads(event['body'])
print(event['body'])
action = input_body["action"]
action_type = action["type"]
if action_type == "createCard":
list_name, card_name = get_create_card(action["data"])
... | 2.53125 | 3 |
usp-introducao-python/numerosimparesnaturais.py | kbcvcbk/cesar-school | 2 | 12781405 | <reponame>kbcvcbk/cesar-school
n=int(input("Digite o valor de n: "))
cont=1
while n!=0:
if cont%2!=0:
print(cont)
cont=cont+1
n=n-1
else:
cont=cont+1
| 3.5625 | 4 |
pytip/__main__.py | pybites/pybites-tips | 9 | 12781406 | <reponame>pybites/pybites-tips
import argparse
from pytip.tips import PyBitesTips
def main():
parser = argparse.ArgumentParser(description='Search term')
parser.add_argument("-s", "--search", type=str,
help='Search PyBites Python tips')
parser.add_argument("-p", "--pager", action=... | 2.890625 | 3 |
app/github_client/services/__init__.py | TennaGraph/TennaGraph | 7 | 12781407 | <gh_stars>1-10
from .git_hub_eip import GitHubEIP
from .git_hub_db import GitHubDB | 1.039063 | 1 |
apps/home/migrations/0009_auto_20220206_1717.py | Aimene-BAHRI/ecole_de_formation | 1 | 12781408 | # Generated by Django 3.2.6 on 2022-02-06 17:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0008_auto_20220202_1858'),
]
operations = [
migrations.RemoveField(
model_name='student',
name='activities',... | 1.59375 | 2 |
test/test_dca.py | petbox-dev/dca | 36 | 12781409 | <filename>test/test_dca.py
"""
Decline Curve Models
Unit Testing
Copyright © 2020 <NAME>
Author
------
<NAME>
<NAME>
Notes
-----
Created on August 5, 2019
"""
import sys
import warnings
from datetime import timedelta
import pytest # type: ignore
import hypothesis
from hypothesis import assume, given, settings, note, ... | 2.515625 | 3 |
uibcdf_biblio/demo/__init__.py | uibcdf/UIBCDF_biblio | 0 | 12781410 | import pathlib
bib = pathlib.Path(__file__).parent.absolute() / 'bibliography.bib'
del(pathlib)
| 1.34375 | 1 |
api/server/swagger_server/controllers_impl/catalog_service_controller_impl.py | srishtipithadia/mlx | 0 | 12781411 | # Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 1.59375 | 2 |
pegleg/engine/util/pegleg_managed_document.py | openstack/airship-pegleg | 9 | 12781412 | <gh_stars>1-10
# Copyright 2018 AT&T Intellectual Property. All other 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
#
# ... | 1.945313 | 2 |
test_Sony.py | starsdeep/15663-project | 16 | 12781413 | <reponame>starsdeep/15663-project<gh_stars>10-100
import argparse
import os
import torch
from data import SonyTestDataset
from torch.utils.data import DataLoader
from models import Unet
import scipy.io
from tqdm import tqdm
import numpy as np
def test(args):
# device
device = torch.device("cuda:%d" % args.gpu... | 2.046875 | 2 |
simuvex/procedures/libc___so___6/recvfrom.py | praetorian-inc/simuvex | 8 | 12781414 | <gh_stars>1-10
import simuvex
######################################
# recvfrom
######################################
class recvfrom(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, fd, dst, length, flags): #pylint:disable=unused-argument
data = self.state.posix.read(fd, length)... | 2.140625 | 2 |
tf_rl/examples/DAgger/Atari/DAgger_CartPole.py | Rowing0914/TF2_RL | 8 | 12781415 | <reponame>Rowing0914/TF2_RL
import gym, argparse
from gym.wrappers import Monitor
import numpy as np
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
from keras.optimizers import Adam
from run_expert import expert_play, OBS_FILE_PATH, ACT_FILE_PATH... | 2.6875 | 3 |
UT330BUI/view/readsave.py | duncanbarth/UT330B | 8 | 12781416 | <reponame>duncanbarth/UT330B<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on: 15:25:51 05-Jan-2020
Author: <NAME>
This code is licensed under the MIT license
"""
# %%---------------------------------------------------------------------------
# Imports
# ----------------------------------... | 2.5625 | 3 |
snowflake_connection/test_connect.py | BigMountainTiger/python-excercise-repository | 0 | 12781417 | # https://docs.snowflake.com/en/user-guide/python-connector-install.html
# https://pypi.org/project/python-dotenv/
# pip install snowflake-connector-python
import os
import snowflake.connector
from dotenv import load_dotenv
load_dotenv()
user = os.getenv('SNOWUSER')
pwd = os.getenv('<PASSWORD>')
account = os.getenv('... | 2.625 | 3 |
backend/api/pokemons/urls.py | jaenia/pokebattle | 0 | 12781418 | <gh_stars>0
from django.urls import path
from . import views
urlpatterns = [
path("", views.PokemonListEndpoint.as_view(), name="pokemon_list"),
]
| 1.507813 | 2 |
IMC_GAE_NEW/train.py | WesleyClode/MBIMC-GAE | 0 | 12781419 | """Training GCMC model on the MovieLens data set.
The script loads the full graph to the training device.
"""
import os, time
import argparse
import logging
import random
import string
import dgl
import scipy.sparse as sp
import pandas as pd
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.f... | 2.703125 | 3 |
sequence_analysis_test_1.py | hugodecasta/representron | 0 | 12781420 | seq1 = 'defdefdefLLLOOLLLdefdefdef'
seq2 = 'abcabcabcLLLOOLLLaaaaaaaaa'
def create_network(sequence):
net = {'@':sequence[0],None:[]}
for i in range(len(sequence)):
sym = sequence[i]
next_sym = None
if i < len(sequence)-1:
next_sym = sequence[i+1]
if sym not in net:
... | 2.703125 | 3 |
sample/ch6/ma-janome.py | wagase/scraping | 0 | 12781421 | <filename>sample/ch6/ma-janome.py
from janome.tokenizer import Tokenizer
t = Tokenizer()
malist = t.tokenize("庭には二羽鶏がいる。")
for n in malist:
print(n)
| 2.46875 | 2 |
website/CMS/models.py | bubai666sen/Visitor-Manager | 0 | 12781422 | from django.db import models
# Create your models here.
class Page(models.Model):
STATUS_CHOICES = (
(1, 'Active'),
(2, 'Inactive'),
)
PAGE_CHOICES = (
(1, 'Home'),
(2, 'About Us'),
)
page = models.PositiveSmallIntegerField(choices=PAGE_CHOICES,unique=True)
tit... | 2.328125 | 2 |
monroe/solver/solve.py | cypher-me/HAS-Qualifier-Challenges | 75 | 12781423 | <filename>monroe/solver/solve.py<gh_stars>10-100
#!/bin/python
import os,sys,time
from binascii import hexlify, unhexlify
from struct import pack, unpack
from pwnlib.tubes.remote import remote
from pwnlib.elf import ELF
def sendEnableTlm(sock):
msg = unhexlify("1880C0000011079A3132372E302E302E3100000000000000")... | 2.203125 | 2 |
kissim/api/__init__.py | volkamerlab/kissim | 15 | 12781424 | <filename>kissim/api/__init__.py
"""
Defines easy programmatic access for any entry point.
"""
from .encode import encode
from .normalize import normalize
from .compare import compare
from .weights import weights
from .outliers import outliers
from .subset import subset
| 1.265625 | 1 |
utils/genomes.py | AndersenLab/pyPipeline | 5 | 12781425 | <filename>utils/genomes.py
import os, sys
import yaml
from utils import *
def fetch_genome(reference_name):
"""
Downloads a reference genome and prepares for aligment
"""
from utils import script_dir
genome_list = yaml.load(open(script_dir + "/utils/genomes.yaml","r"))
makedir("genomes")
... | 2.96875 | 3 |
tests/unittests/load_functions/outside_main_code_in_main/main.py | anandagopal6/azure-functions-python-worker | 277 | 12781426 | <reponame>anandagopal6/azure-functions-python-worker
# This function app is to ensure the code outside main() function
# should only get loaded once in __init__.py
from .count import invoke, get_invoke_count, reset_count
invoke()
def main(req):
count = get_invoke_count()
reset_count()
return f'executed... | 2.1875 | 2 |
src/call_variants.py | NCBI-Hackathons/PSST | 5 | 12781427 | <reponame>NCBI-Hackathons/PSST<filename>src/call_variants.py
#!/usr/bin/env python
# Built-in python packages
from __future__ import division # This modifies Python 2.7 so that any expression of the form int/int returns a float
import getopt
import sys
import os
from itertools import combinations
from multiprocessing.... | 2.921875 | 3 |
scheme/tests/16.py | sfailsthy/CS-61A | 0 | 12781428 | test = {
'name': 'Problem 16',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> (define y 1)
7f8ce7b9b26d2b5922718b99265fafdc
# locked
scm> (define f (mu (x) (+ x y)))
17c5c9131eea78a6dfb3175a8e97e160
# locked
... | 1.757813 | 2 |
Torch_rl/model/Network.py | afei339/Torch-rl | 1 | 12781429 | <reponame>afei339/Torch-rl<gh_stars>1-10
import torch
import numpy as np
from torch import nn
from collections import OrderedDict
from torch.distributions import Normal, Categorical
from torch.autograd import Variable
from copy import deepcopy
# from graphviz import Digraph
#
# def make_dot(var, params=None):
# ""... | 2.390625 | 2 |
layers.py | gemilepus/ShadeSketch | 313 | 12781430 | """
ShadeSketch
https://github.com/qyzdao/ShadeSketch
Learning to Shadow Hand-drawn Sketches
<NAME>, <NAME>, <NAME>
Copyright (C) 2020 The respective authors and Project HAT. All rights reserved.
Licensed under MIT license.
"""
import tensorflow as tf
# import keras
keras = tf.keras
K = keras.backend
Layer = keras.... | 2.515625 | 3 |
generator.py | ugis22/creatingDCGAN | 0 | 12781431 | <gh_stars>0
from typing import Tuple, Union
import numpy as np
from keras.layers import (
Conv2DTranspose,
Reshape,
BatchNormalization,
Dense,
Activation
)
from keras.models import Sequential
from keras.optimizers import Adam
class Generator:
def __init__(self,
initial_dimens... | 3.3125 | 3 |
src/tests/kafka_test.py | dixonwhitmire/lib-kafka | 0 | 12781432 | <reponame>dixonwhitmire/lib-kafka<gh_stars>0
import importlib
import os
from unittest import mock
from unittest.mock import MagicMock
from lib_kafka import logging_codes
import unittest
import concurrent.futures
from confluent_kafka.admin import ClusterMetadata, TopicMetadata, PartitionMetadata
from confluent_kafka imp... | 2.078125 | 2 |
tests/app_test/actions.py | marcosschroh/django-history-actions | 1 | 12781433 | <reponame>marcosschroh/django-history-actions<filename>tests/app_test/actions.py
from django.utils.translation import ugettext_lazy as _
PROFILE_SAVE_ACTION = 'PROFILE_SAVE_ACTION'
ACTIONS = {
'PROFILE_SAVE_ACTION': _('profile save action')
}
| 1.515625 | 2 |
education/HADDOCK24/shape-small-molecule/scripts/lig2shape.py | amjjbonvin/haddocking.github.io | 12 | 12781434 | <filename>education/HADDOCK24/shape-small-molecule/scripts/lig2shape.py
import sys
def format_shape_pharm(lig):
ligFile = open(lig, 'r')
for line in ligFile:
if 'HETATM' in line or 'ATOM' in line:
resi = int(line.split( )[1])
x = float(line.split( )[6])
y = float(li... | 2.65625 | 3 |
src/MQTT/Message/Formatters/JsonFormatter.py | dashford/sentinel-client | 0 | 12781435 | import json
class JsonFormatter:
def __init__(self):
pass
def format(self, message):
return json.dumps(message)
| 2.5 | 2 |
plotCDF.py | faithcomesbyhearing/verse-timing | 0 | 12781436 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
file="/Users/spanta/Documents/batch_aeneas_scripts/batch_directory/QC_data/BMQBSMN2DA_epo_eng_plot_cdf.csv"
data_req = pd.read_table(file, sep=",")
arr = data_req.values
arr.sort(axis=0)
data_req = pd.DataFrame(arr, index=data_req.index, columns=... | 2.625 | 3 |
hawkweed/classes/future.py | hellerve/hawkweed | 20 | 12781437 | """A Future class"""
from hawkweed.functional.primitives import reduce
from hawkweed.classes.repr import Repr
class Future(Repr):
"""A Future class"""
def __init__(self, value):
"""
Takes a binary function (taking success and error, respectively)
and builds a Future from it.
Co... | 3.5 | 4 |
boatsandjoy_api/bookings/payment_gateways.py | bertini36/boatsandjoy-api | 0 | 12781438 | from abc import ABC, abstractmethod
from decimal import Decimal
import stripe
from django.conf import settings
class PaymentGateway(ABC):
@classmethod
@abstractmethod
def generate_checkout_session_id(
cls,
name: str,
description: str,
price: float,
) -> str:
pa... | 2.09375 | 2 |
chromium/tools/telemetry/telemetry/internal/backends/chrome_inspector/tracing_backend_unittest.py | wedataintelligence/vivaldi-source | 27 | 12781439 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
import unittest
from telemetry import decorators
from telemetry.internal.backends.chrome_inspector import tracing_backend
from telemetry.interna... | 2.046875 | 2 |
examples/engines/common.py | sergunya17/catalyst | 4 | 12781440 | from functools import partial
from catalyst import dl, SETTINGS
E2E = {
"de": dl.DeviceEngine,
"dp": dl.DataParallelEngine,
"ddp": dl.DistributedDataParallelEngine,
}
if SETTINGS.amp_required:
E2E.update(
{"amp-dp": dl.DataParallelAMPEngine, "amp-ddp": dl.DistributedDataParallelAMPEngine}
... | 1.992188 | 2 |
game-server/src/server/models.py | joniumGit/distributed-minesweeper | 0 | 12781441 | <gh_stars>0
import os
from typing import List, Optional, Iterable
from minesweeper.game import Minesweeper, Status
from pydantic import BaseModel, conint, Field, root_validator, validator
MAX_WIDTH = int(os.getenv('DS_MAX_WIDTH', '256'))
MAX_HEIGHT = int(os.getenv('DS_MAX_HEIGHT', '256'))
class Square(BaseModel):
... | 2.703125 | 3 |
example/avr/mk-avr-kalman-sim.e.py | martinmoene/kalman-estimator | 20 | 12781442 | #!/usr/bin/env python
# Copyright 2018 by <NAME>
#
# https://github.com/martinmoene/kalman-estimator
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import os
nt = 'double'
nt = 'fp32_t'
std = 'c++1... | 2 | 2 |
back-end/authorizer/authorizer.py | jjanczyszyn/serverless-instagram | 18 | 12781443 | <gh_stars>10-100
"""
based on https://github.com/awslabs/aws-apigateway-lambda-authorizer-blueprints/
blob/master/blueprints/python/api-gateway-authorizer-python.py
"""
import jwt
import os
import re
SECRET = os.environ['AUTH0_SECRET']
AUTH0_CLIENT_ID = os.environ['AUTH0_CLIENT_ID']
def handler(event, context):
... | 2.203125 | 2 |
lib/improver/wxcode/wxcode_utilities.py | TomekTrzeciak/improver | 0 | 12781444 | <filename>lib/improver/wxcode/wxcode_utilities.py
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are ... | 1.5 | 2 |
smartmin/perms.py | nickhargreaves/smartmin | 166 | 12781445 | from django.contrib.auth.models import Permission
def assign_perm(perm, group):
"""
Assigns a permission to a group
"""
if not isinstance(perm, Permission):
try:
app_label, codename = perm.split('.', 1)
except ValueError:
raise ValueError("For global permissions... | 2.40625 | 2 |
src/sst/elements/scheduler/simulations/python_scripts_Jan_2017/emberLoad.py | feldergast/sst-elements | 2 | 12781446 |
import sys,getopt
#sys.path.insert(0, 'PATH')
sys.path.insert(0, '/mnt/nokrb/fkaplan3/SST/git/sst/sst-elements/src/sst/elements/ember/test')
import sst
from sst.merlin import *
import loadInfo
from loadInfo import *
import networkConfig
from networkConfig import *
import random
import defaultParams
import defau... | 1.515625 | 2 |
tests/test_reply.py | LaudateCorpus1/apostello | 69 | 12781447 | <reponame>LaudateCorpus1/apostello<filename>tests/test_reply.py<gh_stars>10-100
import pytest
from tests.conftest import twilio_vcr
from apostello.models import Recipient, RecipientGroup
from apostello.reply import InboundSms
from apostello.utils import fetch_default_reply
@pytest.mark.django_db
class TestConstructR... | 2.28125 | 2 |
mockerena/models/schema.py | FanThreeSixty/mockerena | 1 | 12781448 | """Definition for mockerena schema
.. codeauthor:: <NAME> <<EMAIL>>
"""
from copy import deepcopy
SCHEMA = {
"item_title": "schema",
"schema": {
"schema": {
"type": "string",
"minlength": 3,
"maxlength": 64,
"unique": True,
"required": Tru... | 2.171875 | 2 |
examples/python/keras/func_cifar10_alexnet.py | NodLabs/FlexFlow | 1 | 12781449 | # Copyright 2020 Stanford University, Los Alamos National Laboratory
#
# 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 ... | 2.328125 | 2 |
intro/app/schemas.py | bmugenya/FastAPI | 0 | 12781450 | <filename>intro/app/schemas.py
from pydantic import BaseModel,EmailStr
from typing import Optional
from datetime import datetime
class Post(BaseModel):
title:str
content:str
class User(BaseModel):
email: EmailStr
password:str
class Token(BaseModel):
access_token: str
token_type: str
class ... | 2.53125 | 3 |