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 |
|---|---|---|---|---|---|---|
UE4Parse/Assets/Objects/FPropertyTag.py | zbx911/pyUE4Parse | 13 | 12777251 | from UE4Parse.BinaryReader import BinaryStream
from UE4Parse.Assets.Objects.FName import FName
from UE4Parse.Versions.EUnrealEngineObjectUE4Version import UE4Versions
from UE4Parse.Assets.Objects.FGuid import FGuid
from Usmap import StructProps
from Usmap.Objects.FPropertyTag import FPropertyTag as UsmapTag
class FPr... | 2.21875 | 2 |
test/unit/__init__.py | tonchik-tm/yookassa-sdk-python | 30 | 12777252 | <filename>test/unit/__init__.py
# -*- coding: utf-8 -*-
"""Top-level package for YooKassa API Python Client Library."""
| 1.007813 | 1 |
src/ampycloud/plots/core.py | MeteoSwiss/ampycloud | 0 | 12777253 | <reponame>MeteoSwiss/ampycloud
"""
Copyright (c) 2021-2022 MeteoSwiss, contributors listed in AUTHORS.
Distributed under the terms of the 3-Clause BSD License.
SPDX-License-Identifier: BSD-3-Clause
Module contains: core plotting routines
"""
# Import from Python
import logging
from typing import Union
# Import fro... | 2.375 | 2 |
Poker2.py | errore/python_poker | 2 | 12777254 | import sys
import random
import pygame
def create_player_cards():
# 创建卡片信息,player
_card = [x for x in range(13)]
cards = []
player = [[], [], [], []]
# 单副牌(除去大小王)
for x in range(4):
color = list(map(lambda n: (n, x), _card))
cards = cards + color
# 再加一副牌
ca... | 3.109375 | 3 |
Dataset/Leetcode/train/111/329.py | kkcookies99/UAST | 0 | 12777255 | class Solution:
def XXX(self, root: TreeNode) -> int:
if not root:
return 0
self.min_depth = float('inf')
def dfs(root, depth):
if not root:
return
if not root.left and not root.right:
self.min_depth = min(self.min_depth, d... | 3.203125 | 3 |
test/utils/testcaseparser.py | NiklasRosenstein/craftr-dsl | 1 | 12777256 | <gh_stars>1-10
from __future__ import annotations
import os
import re
import typing as t
from dataclasses import dataclass
from pathlib import Path
import pytest
from .sectionfileparser import Section, Type, parse_section_file
@dataclass
class CaseData:
filename: str
name: str
input: str
input_line: int
... | 2.65625 | 3 |
riboraptor/ribocode_utils.py | saketkc/riboraptor | 10 | 12777257 | <reponame>saketkc/riboraptor<filename>riboraptor/ribocode_utils.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
__author__ = "<NAME>"
from collections import namedtuple
import numpy as np
from scipy import stats
from scipy.stats import find_repeats, distributions, ttest_1samp
WilcoxonResult = namedtuple... | 2.578125 | 3 |
chaco/scatterplot_1d.py | martinRenou/chaco | 0 | 12777258 | """
Scatterplot in one dimension only
"""
from __future__ import absolute_import
from numpy import empty
# Enthought library imports
from enable.api import black_color_trait, ColorTrait, MarkerTrait
from traits.api import Any, Bool, Callable, Enum, Float, Str
# local imports
from .base_1d_plot import Base1DPlot
fr... | 2.765625 | 3 |
main_app/forms.py | m-code12/Rescue | 2 | 12777259 | from django.forms import ModelForm
from .models import contact
from django import forms
class ContactForm(ModelForm):
class Meta:
model = contact
fields = ['name', 'email', 'relation']
Father = 'Father'
Mother = 'Mother'
Brother = 'Brother'
Sister = 'Sister'
... | 2.5 | 2 |
backend/apps/volontulo/migrations/0001_initial.py | magul/volontulo | 16 | 12777260 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('... | 1.789063 | 2 |
phenoai/models/transformerlstm.py | Daniangio/pheno_phases | 0 | 12777261 | <filename>phenoai/models/transformerlstm.py
import logging
import os
from phenoai.models.base_model import BaseModel
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
import copy
import numpy as np
logger = logging.getLogger()
class Embedder(nn.Module):... | 2.296875 | 2 |
homeassistant/components/elgato/button.py | charithmadhuranga/core | 1 | 12777262 | """Support for Elgato button."""
from __future__ import annotations
import logging
from elgato import Elgato, ElgatoError, Info
from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from home... | 2.265625 | 2 |
Sketches/RJL/Torrent/TorrentTkGUI.py | sparkslabs/kamaelia_orig | 12 | 12777263 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | 2.765625 | 3 |
baseball/random.py | jconstam/baseball | 0 | 12777264 | <gh_stars>0
#!/usr/bin/env python3
import random
from typing import List
class D6s:
@staticmethod
def roll(count: int = 1) -> List[int]:
results = []
for _ in range(count):
results.append(random.randint(1, 6))
return results
| 3.09375 | 3 |
src/party3rd/elastic.py | yaroslavNikolaev/A.R.M.O.R. | 1 | 12777265 | <filename>src/party3rd/elastic.py<gh_stars>1-10
from utils.collectors import GitHubVersionCollector
from utils.configuration import Configuration
from abc import ABC
owner = "elastic"
class BeatsVersionCollector(GitHubVersionCollector, ABC):
repo = "beats"
def __init__(self, config: Configuration):
... | 2.171875 | 2 |
appi2c/ext/icon/icon_controller.py | andrequeiroz2/appi2c | 9 | 12777266 | from appi2c.ext.database import db
from appi2c.ext.icon.icon_models import Icon
def list_all_icon():
icon = Icon.query.all()
return icon
def list_icon_id(id: int) -> Icon:
icon = Icon.query.filter_by(id=id).first()
return icon
def create_icon(html_class: str):
icon = Icon(html_class=html_class... | 2.375 | 2 |
examples/human_control.py | Voyager1403/yumi-gym | 12 | 12777267 | import gym, yumi_gym
import pybullet as p
env = gym.make('yumi-v0')
env.render()
observation = env.reset()
motorsIds = []
for joint in env.joints:
motorsIds.append(p.addUserDebugParameter(joint, -1, 1, 0))
while True:
env.render()
action = []
for motorId in motorsIds:
action.append(p.readUse... | 2.171875 | 2 |
src/rdbms-connect/azext_rdbms_connect/vendored_sdks/postgresql_flexibleservers/models/_postgre_sql_management_client_enums.py | Mannan2812/azure-cli-extensions | 2 | 12777268 | <gh_stars>1-10
# 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) AutoRest Code Genera... | 1.976563 | 2 |
simplefasta.py | ljdursi/seek-vs-sequential | 0 | 12777269 | <filename>simplefasta.py
#!/usr/bin/env python
import os
import argparse
class FastaReader(object):
def __init__(self,infile):
self.__infile = infile
self.__havenext = False
self.__next = ""
self.__end = False
def readNext(self):
curlabel = None
sequences = []
... | 3.15625 | 3 |
scripts/create_dataset_definition.py | groadabike/DAMP-VSEP-Singles | 0 | 12777270 | import argparse
import pandas as pd
from multiprocessing import Pool, cpu_count
from tqdm import tqdm
from pathlib import Path
import json
import librosa
from utils import get_amplitude_scaling_factor, xcorr_searcher_max, load_data
# Filter out performances shorter than ```MIN_DURATION``` secs
MIN_DURATION = 15.0
# ... | 2.28125 | 2 |
visualize_result_files.py | CristobalM/lverlet_n_cells | 0 | 12777271 | import matplotlib.pyplot as plt
import numpy as np
import re
import os
import sys
from matplotlib import rcParams
from cycler import cycler
import itertools
if len(sys.argv) < 2:
print("Especifique la carpeta con resultados con la siguiente sintaxis:")
print("python %s carpeta_resultados" % sys.argv[0])
e... | 2.59375 | 3 |
populate/ropensci_libraries/throughputpy/checkNode.py | throughput-ec/throughputdb | 4 | 12777272 | <reponame>throughput-ec/throughputdb<gh_stars>1-10
from functools import reduce
def checkNode(graph, parentid):
graphquery = """MATCH (n:OBJECT {id: $id})-[]-(:ANNOTATION)-[]-(o:OBJECT)-\
[:isType]-(:TYPE {type:'schema:CodeRepository'})
RETURN COUNT(o) AS repos"""
silent = graph.run(gr... | 2.59375 | 3 |
drf_msal_jwt/exceptions.py | narongdejsrn/django-rest-framework-msal | 3 | 12777273 | <filename>drf_msal_jwt/exceptions.py
from rest_framework.exceptions import APIException
class CodeException(APIException):
status_code = 401
default_detail = 'Invalid authorization code'
default_code = 'code_error'
class DomainException(APIException):
status_code = 403
default_detail = "The acco... | 2.453125 | 2 |
sddr/__init__.py | felixGer/PySDDR | 14 | 12777274 | <filename>sddr/__init__.py
from .sddr import * | 1.132813 | 1 |
image_tweet.py | pipinstallyogi/Basic_scripts | 0 | 12777275 | <filename>image_tweet.py<gh_stars>0
from selenium import webdriver
from getpass import getpass
from time import sleep
usr = input("Enter your username or Email: ")
pwd = getpass("Enter your password: ") #getpass() will help your password remain hidden
image_path = input("Please enter your image path: ")
driver =webdr... | 3.046875 | 3 |
forum/utils/dates.py | kraft99/forum | 8 | 12777276 | import datetime
from django.conf import settings
from django.utils import dateformat
import pytz
from forum.models import ForumProfile
def user_timezone(dt, user):
"""
Converts the given datetime to the given User's timezone, if they
have one set in their forum profile.
Adapted from htt... | 3.53125 | 4 |
scripts/alignment/extract_fastq_from_bam.py | mahajrod/MAVR | 10 | 12777277 | #!/usr/bin/env python
__author__ = '<NAME>'
import argparse
from RouToolPa.Tools.Samtools import SamtoolsV1
from RouToolPa.Tools.Bedtools import BamToFastq
from RouToolPa.GeneralRoutines import FileRoutines
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", action="store", dest="input", required=... | 2.359375 | 2 |
azcam_soguiders/console_soguiders.py | mplesser/soguiders | 0 | 12777278 | <filename>azcam_soguiders/console_soguiders.py
# azcamconsole config file for soguiders
import os
import threading
import azcam
import azcam.shortcuts
from azcam_ds9.ds9display import Ds9Display
# ****************************************************************
# files and folders
# *******************************... | 1.914063 | 2 |
Sintactico.py | LawlietJH/PyCthon | 0 | 12777279 | # -*- coding: utf-8 -*-
import Lexico
import Arbol
import string
import sys
import os
class Sintactico():
def __init__(self):
with open('entrada.txt','r') as Archivo: self.Cadena = Archivo.read()+'$'
Archivo.close()
#===============================================================
self.Suma = Arbol.... | 3.375 | 3 |
jentry/entry/script/__init__.py | HansBug/jentry | 0 | 12777280 | <gh_stars>0
from .file import load_entries_from_file, load_entry_classes_from_code
from .project import load_entries_from_project
| 1.078125 | 1 |
httpolice/syntax/rfc3986.py | vfaronov/httpolice | 1,027 | 12777281 | from httpolice.citation import RFC
from httpolice.parse import (auto, empty, fill_names, literal, maybe_str,
octet_range, pivot, string, string1, string_times,
subst)
from httpolice.syntax.common import ALPHA, DIGIT, HEXDIG
pct_encoded = '%' + HEXDIG + HEXDIG ... | 2.171875 | 2 |
setup.py | dlshriver/Queryable | 5 | 12777282 | """
pylinq setup script.
"""
from distutils.core import setup
with open("README.rst", 'r') as f:
readme = f.read()
with open("HISTORY.rst", 'r') as f:
history = f.read()
setup(
name='pinq',
version='0.1.1',
description='LINQ for python.',
long_description="%s\n\n%s" % (readme, history),
l... | 1.648438 | 2 |
plot_sweep.py | yinghai/benchmark | 384 | 12777283 | <filename>plot_sweep.py
import argparse
import json
# import pandas as pd
import os
# import sys
# import re
import yaml
import itertools
# from bokeh.layouts import column, row, layout, gridplot
# from bokeh.plotting import figure, output_file, show
# from bokeh.sampledata.autompg import autompg
# from bokeh.transfor... | 2.578125 | 3 |
api/api.py | trompamusic/crowd_task_manager | 0 | 12777284 | <reponame>trompamusic/crowd_task_manager
# get slices from db
# list slices on home page
# make api endpoint for slice
# each shows slice image and xml, create this from template
from flask import Flask
from flask import render_template
app = Flask(__name__)
import pymongo
import re
import os
import yaml
import urllib.... | 2.234375 | 2 |
code.py | kasthuri28/hacktoberithms | 0 | 12777285 | <filename>code.py
const assert = require('assert')
function checkout_time(customers, n_cashier) {
let cashiers = Array(n_cashier).fill(0)
customers.forEach(customer => {
const minIndex = cashiers.reduce((accIdx, current, index) => {
return current < cashiers[accIdx] ? index : accIdx
... | 2.828125 | 3 |
urls.py | princeofdatamining/blueking-sample | 0 | 12777286 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obt... | 1.4375 | 1 |
altair_examples/simple_line_chart.py | progressivis/altair_examples | 1 | 12777287 | <filename>altair_examples/simple_line_chart.py
"""
Simple Line Chart
-----------------
This chart shows the most basic line chart, made from a dataframe with two
columns.
"""
# category: simple charts
import altair as alt
import numpy as np
x = np.arange(100)
source = alt.pd.DataFrame({"x": x, "f(x)": np.sin(x / 5)})... | 3.3125 | 3 |
labelfactory/Log.py | Orieus/one_def_classification | 0 | 12777288 | # -*- coding: utf-8 -*-
"""
Created on Fri May 22 08:52:50 2015
@author: sblanco
Modified by jcid to log messages to standard output
"""
import logging
import sys
class Log:
__logger__ = None
__error__ = False
def __init__(self, path, crear=False):
try:
... | 2.984375 | 3 |
code/stats.py | Aklaran/trickingGame | 0 | 12777289 | <reponame>Aklaran/trickingGame
from direct.gui.DirectGui import *
from menu import Menu
class Stats(Menu):
def __init__(self):
super().__init__()
self.parentNode = aspect2d.attachNewNode('Stats')
self.backButton = DirectButton(text=("back"), scale = 0.25,
command=self... | 2.453125 | 2 |
Day-111/list_index.py | arvimal/100DaysofCode-Python | 1 | 12777290 | #!/usr/bin/env python3
# Find the middle element in the list.
# Create a function called middle_element that has one parameter named lst.
# If there are an odd number of elements in lst, the function
# should return the middle element.
# If there are an even number of elements, the function should
# return the average... | 4.3125 | 4 |
Z3RO discord spammer/zspam.py | freebobuxsite/Z3RO-SERIES | 0 | 12777291 | <reponame>freebobuxsite/Z3RO-SERIES
import requests
import random
import time
"""
import requests
def join(token, server_invite):
header = {"authorization": token}
r = requests.post("https://discord.com/api/v8/invites/{}".format(server_invite), headers=header)
"""
tokens = []
am = int(input("Enter the amo... | 3.0625 | 3 |
code_dev/ipynbs/feature_visualizer.py | liud16/capstone18 | 0 | 12777292 | import matplotlib.pyplot as plt
import pandas as pd
def visualize(peak_dict):
for i in range(len(peak_dict)):
df = pd.DataFrame(peak_dict['peak_%s' % i],
columns=['Position', 'Height', 'Width', 'Time'])
plt.subplot(3, 1, 1)
plt.plot(df['Time'], df['Height'])
plt.ti... | 3.484375 | 3 |
frontend/manageFrontendDowntimes.py | ddbox/glideinwms | 0 | 12777293 | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
import os
import os.path
import re
import string
import sys
import time
from glideinwms.frontend import glideinFrontendConfig, glideinFrontendDowntimeLib
def usage():
print("Usage:")
pri... | 2.328125 | 2 |
airbnb.py | johnliu4/kaggle-airbnb-ny | 0 | 12777294 | import csv
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as tck
from PIL import Image
# for testing purposes, remove this later!
from sys import exit
"""Data visualization on the Airbnb New York dataset from Kaggle.
The dataset provides 16 pieces of data in the followi... | 3.234375 | 3 |
musicscore/musicxml/attributes/textdecoration.py | alexgorji/music_score | 2 | 12777295 | from musicscore.musicxml.attributes.attribute_abstract import AttributeAbstract
class Underline(AttributeAbstract):
""""""
def __init__(self, underline=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.generate_attribute('underline', underline, "TypeNumberOfLines")
class Overli... | 3.25 | 3 |
src/camera.py | trenchant7/Face_Recognition | 9 | 12777296 | # -*- coding: utf-8 -*-
import cv2
import argparse
import time
import numpy as np
from training import Model
classes = []
FRAME_SIZE = 256
font = cv2.FONT_HERSHEY_SIMPLEX
switch = False
def detect(image):
crop_image = image[112:112 + FRAME_SIZE, 192:192 + FRAME_SIZE]
result = model.predict(crop_image)
in... | 2.859375 | 3 |
advent2017_day2.py | coandco/advent2017 | 0 | 12777297 | <filename>advent2017_day2.py
INPUT = """1919 2959 82 507 3219 239 3494 1440 3107 259 3544 683 207 562 276 2963
587 878 229 2465 2575 1367 2017 154 152 157 2420 2480 138 2512 2605 876
744 6916 1853 1044 2831 4797 213 4874 187 6051 6086 7768 5571 6203 247 285
1210 1207 1130 116 1141 563 1056 155 227 1085 697 735 192 1... | 2.140625 | 2 |
hknweb/alumni/migrations/0003_auto_20220303_1955.py | jyxzhang/hknweb | 0 | 12777298 | <filename>hknweb/alumni/migrations/0003_auto_20220303_1955.py
# Generated by Django 2.2.8 on 2022-03-04 03:55
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('alumni', '0002_auto_20220228_1252'),
]
operations = [
... | 1.421875 | 1 |
sockets/bank_socket.py | aneeshads/EPAi4.0-Capstone | 0 | 12777299 | import bpy
import threading, time
from bpy.props import IntProperty, FloatProperty, StringProperty, FloatVectorProperty, CollectionProperty, EnumProperty
from bpy.types import NodeTree, Node, NodeSocket
class MyCustomSocketBank(NodeSocket):
'''Custom node socket type for creating data input points for bank inform... | 2.734375 | 3 |
sdk/python/pulumi_azure_native/network/v20151101/outputs.py | sebtelko/pulumi-azure-native | 0 | 12777300 | <gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _u... | 1.796875 | 2 |
package/awesome_streamlit/experiments/__init__.py | R-fred/awesome-streamlit | 1,194 | 12777301 | """Imports that should be exposed outside the package"""
from .hello_world import write as write_hello_world
| 1.335938 | 1 |
openktn/native/microstate.py | uibcdf/OpenKinNet | 0 | 12777302 | <gh_stars>0
class Microstate():
def __init__(self):
self.index = None
self.label = None
self.weight = 0.0
self.probability = 0.0
self.basin = None
self.coordinates = None
self.color = None
self.size = None
| 2.28125 | 2 |
examples/multiples.py | PictElm/grom | 1 | 12777303 | <filename>examples/multiples.py
from grom import Genome, util
util.DEBUG = False
# file size: 0x20 (32 char, raw text)
# mapping along words in first file (a.txt)
P = [
('ceci', range(0x00, 0x05)),
('est', range(0x05, 0x09)),
('un', range(0x09, 0x0C)),
('txt', ... | 2.125 | 2 |
pymatflow/vasp/base/intraband.py | DeqiTang/pymatflow | 6 | 12777304 | intraband_incharge = {
"WEIMIN": None,
"EBREAK": None,
"DEPER": None,
"TIME": None,
}
| 1.257813 | 1 |
searchlet/ds/PriorityQueue.py | DavidMChan/searchlet | 1 | 12777305 | # Copyright (c) 2018 <NAME>
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import itertools
import heapq
from typing import List, Any, Union
class PriorityQueue(object):
REMOVED = '<removed-element>'
EXISTS_LOWER_PRIORITY = 1
EXISTS_UPDATED = 2
NONEXIST ... | 3.5 | 4 |
giraf/const.py | amol9/imgur | 1 | 12777306 | <gh_stars>1-10
program_name = 'giraf'
program_desc = 'A command line utility to access imgur.com.'
| 1.226563 | 1 |
book/slackBot.py | JisunParkRea/naverSearchAPI_practice | 2 | 12777307 | <gh_stars>1-10
from slacker import Slacker
import os, sys, json
from django.core.exceptions import ImproperlyConfigured
# Get SLACK_BOT_TOKEN from secrets.json
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
secret_file = os.path.join(BASE_DIR, 'secrets.json') # secrets.json 파일 위치를 명시
with ope... | 2.203125 | 2 |
Ejercicio 1/biblioteca/admin.py | DiogenesPuig/Ejercicios-con-Django | 0 | 12777308 | from django.contrib import admin
from biblioteca.models import Autor
from biblioteca.models import Libro
from biblioteca.models import Ejemplar
from biblioteca.models import Usuario
class LibroInline(admin.TabularInline):
model = Libro
class LibroAdmin(admin.ModelAdmin):
list_display = ('Titulo','Editorial',... | 1.867188 | 2 |
src/act/client/clicommon.py | bryngemark/aCT | 0 | 12777309 | """
This module defines all functionality that is common to CLI programs.
"""
import sys
import act.client.proxymgr as proxymgr
from act.client.errors import NoSuchProxyError
from act.client.errors import NoProxyFileError
def getProxyIdFromProxy(proxyPath):
"""
Returns ID of proxy at the given path.
Ar... | 2.65625 | 3 |
run.py | tzom/yHydra | 0 | 12777310 | import sys,os
os.environ['YHYDRA_CONFIG'] = sys.argv[1]
import setup_device
from load_config import CONFIG
import glob
RAWs = glob.glob(CONFIG['RAWs'])
FASTA = glob.glob(CONFIG['FASTA'])[0]
from fasta2db import digest_fasta
f = digest_fasta(FASTA,REVERSE_DECOY=False)
r = digest_fasta(FASTA,REVERSE_DECOY=True)
fr... | 2.25 | 2 |
seeding/seed.py | yorkshirelandscape/musebot | 1 | 12777311 | <reponame>yorkshirelandscape/musebot
#! /bin/env python3
import argparse
import collections
import csv
import itertools
import math
import operator
import os
import random
import re
import sys
import unicodedata
import uuid
# Default values for these settings
# May be modified by command line arguments
BADNESS_MAX_AR... | 1.59375 | 2 |
src/ising_animate/examples/__init__.py | davifeliciano/ising_model | 2 | 12777312 | <reponame>davifeliciano/ising_model
"""
An set of examples written with the ising_animate package.
"""
| 1.4375 | 1 |
build/lib/jhu_primitives/dimselect/profile_likelihood_maximization.py | hhelm10/primitives-interfaces | 0 | 12777313 | def profile_likelihood_maximization(U, n_elbows, threshold):
"""
Inputs
U - An ordered or unordered list of eigenvalues
n - The number of elbows to return
Return
elbows - A numpy array containing elbows
"""
if type(U) == list: # cast to array for functionality later
... | 3.171875 | 3 |
eflow/_hidden/general_objects/enum.py | EricCacciavillani/eFlow | 1 | 12777314 | <filename>eflow/_hidden/general_objects/enum.py
__author__ = "<NAME>"
__copyright__ = "Copyright 2019, eFlow"
__credits__ = ["<NAME>"]
__license__ = "MIT"
__maintainer__ = "EricCacciavillani"
__email__ = "<EMAIL>"
def enum(**enums):
"""
Allows for constant like variables.
"""
return type('Enum', (... | 1.679688 | 2 |
tokens/urls.py | Shelo/cmdoc | 0 | 12777315 | <reponame>Shelo/cmdoc
from django.conf.urls import url
from tokens import views
urlpatterns = [
url(
r'^(?P<document_id>[0-9]+)/create/',
views.create,
name='create'
),
url(
r'^(?P<document_id>[0-9]+)/remove/(?P<token_key>[a-zA-Z_-]+)/',
views.remove,
name='... | 1.820313 | 2 |
stepik/python575/03_02_13.py | ornichola/learning-new | 2 | 12777316 | """
Возьмите тесты из шага — https://stepik.org/lesson/138920/step/11?unit=196194
Создайте новый файл
Создайте в нем класс с тестами, который должен наследоваться от unittest.TestCase по аналогии с предыдущим шагом
Перепишите в стиле unittest тест для страницы http://suninjuly.github.io/registration1.html
Перепишите в ... | 3.203125 | 3 |
IMDB/serializers.py | MrRobot100/api-Auth | 1 | 12777317 |
from rest_framework import serializers
from .models import Pelicula
from django.contrib.auth.models import User
from . import models
class PeliculaSerializer(serializers.ModelSerializer):
class Meta:
fields = ('id', 'titulo', 'descripcion', 'puntaje')
model = models.Pelicula
| 1.804688 | 2 |
Parte 1/lista 02/12 -pi.py | Raiane-nepomuceno/Python | 0 | 12777318 | <filename>Parte 1/lista 02/12 -pi.py
pi = 0
a = int(input('Num:'))
i = 0 # variavel de controle
b = a - 1 #controle do expoente
while i < a:
if i%2!=0:
pi = pi+ (a/b)
print('1:', pi)
else:
pi = (a - a/b)
print('2:',pi)
b = b + 2
i = i + 1
print(pi)
| 3.90625 | 4 |
dataset/disp_fig.py | jajatikr/Video-Inpainting | 16 | 12777319 | <reponame>jajatikr/Video-Inpainting
import matplotlib.pyplot as plt
import numpy as np
class disp_fig(object):
"""
Class to display video frames
Args:
Accepts video frames numpy array to display using matplotlib
Output:
Displays 8 video frames using matplotlib window
"""
def __init_... | 3.390625 | 3 |
proudcatowner/utils/helpers.py | cyanideph/proudcatowner | 0 | 12777320 |
import json
from functools import reduce
from base64 import b64decode
from typing import Union
import requests
def generate_device_info() -> dict:
return {
"device_id": device.deviceGenerator(),
"user_agent": "Dalvik/2.1.0 (Linux; U; Android 7.1.2; SM-G965N Build/star2ltexx-user 7.1.; com.... | 2.65625 | 3 |
bear/uncertainty_modeling/d4rl/test_rapp.py | junmokane/AI602_Project | 1 | 12777321 | <gh_stars>1-10
import torch
import argparse
import numpy as np
import matplotlib.pyplot as plt
from uncertainty_modeling.rapp.calc_uncertainty import get_diffs
def test_rapp_lunarlander(args):
fig = plt.figure(figsize=(10, 7))
for i in range(4):
path = f"{args.p}_{i}.pt"
model = torch.load(pa... | 2.0625 | 2 |
ABC_A/ABC021_A.py | ryosuke0825/atcoder_python | 0 | 12777322 | n = int(input())
ret_list = []
if n % 2 == 1:
n -= 1
ret_list.append(1)
for _ in range(n//2):
ret_list.append(2)
print(len(ret_list))
for i in ret_list:
print(i)
| 3.421875 | 3 |
specs/egg_spec.py | jaimegildesagredo/server-expects | 4 | 12777323 | <reponame>jaimegildesagredo/server-expects<filename>specs/egg_spec.py
# -*- coding: utf-8 -*-
import os.path
from expects import expect
from expects.testing import failure
from server_expects import *
from .constants import c
with describe('egg'):
with describe('be_installed'):
with it('passes if pack... | 2.546875 | 3 |
home/migrations/0012_homepage_sector_button_text.py | uktrade/invest | 1 | 12777324 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-05-09 10:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0011_auto_20180327_1341'),
]
operations = [
migrations.AddField(
... | 1.492188 | 1 |
fiscales/admin.py | fastslack/escrutinio-social | 10 | 12777325 | from django.db.models import Q
from django.urls import reverse
from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import Voluntario, AsignacionVoluntario, DatoDeContacto
from .forms import VoluntarioForm, DatoDeContactoModelForm
from django_admin_row_actions... | 1.914063 | 2 |
auto_learn.py | Dlut-lab-zmn/GRAA-for-data-protection | 0 | 12777326 | <reponame>Dlut-lab-zmn/GRAA-for-data-protection
#Author <NAME>
from models import *
import torch
import torch.nn as nn
__all__ = [
'auto_learn',
]
class Auto_learn(nn.Module):
def __init__(self,resume,attribute,joint,joint2,args):
super(Auto_learn, self).__init__()
self.net =ResNet18(args.in_ch... | 2.3125 | 2 |
infrastructure/gunicorn-config.py | bitraf/p2k16 | 5 | 12777327 | <gh_stars>1-10
import yaml
import logging.config
import os
with open(os.getenv("P2K16_LOGGING")) as f:
cfg = yaml.safe_load(f)
logging.config.dictConfig(cfg)
if not os.path.isdir("log"):
os.mkdir("log")
accesslog = "log/access.log"
bind = os.getenv("P2K16_BIND", "127.0.0.1:5000")
pidfile = "p2k16.pid"
ti... | 1.960938 | 2 |
relancer-exp/original_notebooks/camnugent_california-housing-prices/california-housing-tutorial.py | Chenguang-Zhu/relancer | 1 | 12777328 | <reponame>Chenguang-Zhu/relancer
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import os
import tarfile
from six.moves import urllib
import pandas as pd
DOWNLOAD_ROOT = "https://github.com/ageron/handson-ml/tree/master/"
HOUSING_PATH = "datasets/housing"
HOUSING_URL = DOWNLOAD_ROOT + HOUSING_PATH + "/housing.tgz"
... | 2.578125 | 3 |
vecLib/2tool.py | chenjl0710/arcpyTools | 1 | 12777329 | # -*- coding: utf8 -*-
import arcpy
import os
import setting
class ToolValidator(object):
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""
def __init__(self):
"""Setup arcpy and the list of tool parameters."""
self.params = arcpy.GetParameterInfo()
... | 2.53125 | 3 |
algs4/symbol_graph.py | dumpmemory/algs4-py | 230 | 12777330 | <reponame>dumpmemory/algs4-py
"""
Execution: python symbol_graph.py filename.txt delimiter
Data files: https://algs4.cs.princeton.edu/41graph/routes.txt
https://algs4.cs.princeton.edu/41graph/movies.txt
https://algs4.cs.princeton.edu/41graph/moviestiny.txt
h... | 2.75 | 3 |
basicsr/models/losses/__init__.py | Salah856/BasicSR | 20 | 12777331 | <gh_stars>10-100
from .losses import (CharbonnierLoss, GANLoss, GradientPenaltyLoss, L1Loss,
MSELoss, PerceptualLoss, WeightedTVLoss)
__all__ = [
'L1Loss', 'MSELoss', 'CharbonnierLoss', 'WeightedTVLoss', 'PerceptualLoss',
'GANLoss', 'GradientPenaltyLoss'
]
| 1.101563 | 1 |
nuggetemoji/plugins/guild_management.py | LimeProgramming/NuggetEmoji | 0 | 12777332 | <reponame>LimeProgramming/NuggetEmoji<filename>nuggetemoji/plugins/guild_management.py
import sys
import json
import discord
import asyncio
import datetime
from discord.ext import commands
from nuggetemoji.util import dataclasses
from .util import checks
from .util.misc import RANDOM_DISCORD_COLOUR, AVATAR_URL_AS, GUI... | 1.945313 | 2 |
python/pmercury/protocols/dhcp.py | raj-apoorv/mercury | 299 | 12777333 | """
Copyright (c) 2019 Cisco Systems, Inc. All rights reserved.
License at https://github.com/cisco/mercury/blob/master/LICENSE
"""
import os
import sys
import functools
from socket import AF_INET, AF_INET6, inet_ntop
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.dirname(os.pat... | 1.9375 | 2 |
setup.py | ATLASControlTower/aCT | 0 | 12777334 | from setuptools import setup, find_packages
setup(name='aCT',
version='0.1',
description='ARC Control Tower',
url='http://github.com/ARCControlTower/aCT',
python_requires='>=3.6',
author='aCT team',
author_email='<EMAIL>',
license='Apache 2.0',
package_dir = {'': 'src'},... | 1.625 | 2 |
philoseismos/segy/components/TextualFileHeader.py | sir-dio/old-philoseismos | 1 | 12777335 | """ philoseismos: with passion for the seismic method.
This file defines the TextualFileHeader object that represents
a Textual File Header of a SEG-Y file.
@author: <NAME>
e-mail: <EMAIL> """
class TextualFileHeader:
""" Textual File Header for the SEG-Y file.
Textual description of the file. Exactly 320... | 3.328125 | 3 |
utest/namespace/test_retrievercontextfactory.py | veryl-technologies/t24-tests-ide | 1 | 12777336 | <reponame>veryl-technologies/t24-tests-ide
import unittest
from robotide.namespace.namespace import _RetrieverContextFactory
from robot.parsing.model import ResourceFile
from robot.utils.asserts import assert_equals
def datafileWithVariables(vars):
data = ResourceFile()
for var in vars:
data.variable_... | 2.5625 | 3 |
contextual-repr-analysis/contexteval/data/__init__.py | Albert-Ma/bert-fine-tuned-gain | 2 | 12777337 | <gh_stars>1-10
from contexteval.data.dataset_readers import * # noqa: F401,F403
from contexteval.data.fields import * # noqa: F401,F403
| 1.203125 | 1 |
src/api/posts_api/serializers.py | DevHub-Azerbaycan/python_web_site | 25 | 12777338 | from rest_framework import serializers
from blog.models import Post
from django.contrib.auth.models import User
class UserSerializer(serializers.ModelSerializer):
fullName = serializers.SerializerMethodField()
class Meta:
model = User
fields = ['id','username','first_name','last_name','fullName... | 2.328125 | 2 |
src/checkvist/__main__.py | nuno-andre/checkvist | 0 | 12777339 | from checkvist.app import cli
import sys
sys.exit(cli.cli(prog_name='checkvist'))
| 1.320313 | 1 |
MinimalTriangle/Python/hello_triangle.py | vladiant/OpenGLsamples | 0 | 12777340 | <filename>MinimalTriangle/Python/hello_triangle.py
# https://stackabuse.com/brief-introduction-to-opengl-in-python-with-pyopengl
# pip3 install PyOpenGL PyOpenGL_accelerate
# https://pythonprogramming.net/opengl-rotating-cube-example-pyopengl-tutorial/
# https://gist.github.com/deepankarsharma/3494203
import OpenGL
f... | 3.203125 | 3 |
test/torch_optimizer_test.py | ymchen7/bluefog | 1 | 12777341 | <reponame>ymchen7/bluefog
# Copyright 2020 Bluefog Team. 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 req... | 2.265625 | 2 |
15_three_sum_sorting.py | ojhaanshu87/LeetCode | 0 | 12777342 | ```
Approach 1: Hashset
Since triplets must sum up to the target value, we can try the hash table approach from the Two Sum solution. This approach won't work, however, if the sum is not necessarily equal to the target, like in 3Sum Smaller and 3Sum Closest.
We move our pivot element nums[i] and analyze elements to it... | 3.703125 | 4 |
22.funcoes_lambda/10.exercicio2.py | robinson-1985/python-zero-dnc | 0 | 12777343 | <gh_stars>0
# 2. Utilize uma função filter para retornar somente os números pares da lista abaixo.
par = list(filter(lambda x: x %2==0, [5,2,5,7,4,2,6,10,342,54,23,6,7,9,12]))
print(par) | 3.015625 | 3 |
model.py | Estefaniajim/League-of-legends-helper | 0 | 12777344 | import app
import Data.dataAnalysis as da
import Data.liveDataLAN as lan
import Data.liveDataNA as na
import time
#summonerName,server,lane = app.getUser()
def getDataServer(server,summonerName):
if server == "LAN":
summonerId = lan.gettingSummonerId(summonerName)
tier, rank = lan.getRankedPositio... | 2.625 | 3 |
src/training/oct_resnet.py | yutake27/P3CMQA | 0 | 12777345 | <gh_stars>0
import chainer
import chainer.functions as F
import chainer.links as L
from octconv import OctConv
from octconv import OctConv_BN
from octconv import OctConv_BN_ACT
from octconv import oct_add, oct_function
class Building(chainer.Chain):
def __init__(self, n_in, n_mid, n_out, stride=1, alpha=0.25, bn... | 2.328125 | 2 |
inceptor/utils/utils.py | whitefi/inceptor | 1 | 12777346 | <reponame>whitefi/inceptor
import hashlib
import os
import re
import secrets
import subprocess
import tempfile
from binascii import hexlify, unhexlify
from random import random, randint
from pefile import *
from pathlib import Path
def get_project_root() -> Path:
return Path(__file__).parent.parent
def bin2sh(... | 2.46875 | 2 |
tracklib/init/__init__.py | xueyuelei/tracklib | 5 | 12777347 | from __future__ import division, absolute_import, print_function
from .init import * | 1.140625 | 1 |
py/ftpy.py | LauriHursti/visions | 2 | 12777348 | # This module is a simply a wrapper for libftpy.so that acts as a remainder how its interface is defined
# C++ library libftpy must exist in same folder for this module to work
import libftpy
"""Get bounding boxes for FASText connected components found with given parameters
Parameters
----------
image : numpy array
... | 2.53125 | 3 |
pdf_reader.py | abdullahwaqar/docsearx | 1 | 12777349 | """
* This file contains source code for reading and extracting data from pdfs
* @author: <NAME>
"""
import fitz
from storage import enumrateFilenames
def readAllPdf():
"""
* @def: Read all the pdf files from the stotage and return the text from all in a list and the file name
* @return: List of tuple, pdf... | 3.375 | 3 |
astroNN/__init__.py | igomezv/astroNN | 156 | 12777350 | r"""
Deep Learning for Astronomers with Tensorflow
"""
from pkg_resources import get_distribution
version = __version__ = get_distribution('astroNN').version
| 1.367188 | 1 |