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 |
|---|---|---|---|---|---|---|
tests/models.py | padeny/tastypie_api | 2 | 51800 | from django.db import models
from django.contrib.auth.models import User
class Entry(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
title = models.CharField(max_length=128, unique=True)
slug = models.CharField(max_length=128)
created = models.DateTimeField()
# I... | 2.28125 | 2 |
source/ball.py | matheusmmoliveira/BrickBreaker | 0 | 51801 | import pygame
from settings import *
from random import uniform
class Ball(pygame.sprite.Sprite):
def __init__(self, groups, paddle, blocks):
super().__init__(groups)
# Setup
# image is mandatory attribute for pygame sprites.
self.image = pygame.image.load(BASE_DIR / 'assets' / 'im... | 3.546875 | 4 |
utils/get_reference_coastline_files.py | minamyung/antarctic-coastline-mapping | 0 | 51802 | # Downloads all Sentinel 1 images from PolarView which were used for the latest Antarctic coastline mapping, in .tif format.
# Reference coastline: https://data.bas.ac.uk/collections/e74543c0-4c4e-4b41-aa33-5bb2f67df389/
import time
import requests
import csv
startTime = time.time()
base_URI = 'https://www.polarview... | 2.9375 | 3 |
coolplayer_plus/coolplayer_addreg.py | m1kemu/ExploitDev | 0 | 51803 | <reponame>m1kemu/ExploitDev<filename>coolplayer_plus/coolplayer_addreg.py
#!/usr/bin/python
# Author: <NAME>
# Date: 8/1/2019
# Description: Coolplayer+ Buffer Overflow Exploit
# Exercise in BOFs following the securitysift guide
# Tested on Windows XP
# Notes:
# I will be assuming that EBX is the only register poin... | 2.265625 | 2 |
src/cpp/model_benchmark.bzl | SanggunLee/edgetpu | 320 | 51804 | """Generate model benchmark source file using template.
"""
_TEMPLATE = "//src/cpp:models_benchmark.cc.template"
def _generate_models_benchmark_src_impl(ctx):
ctx.actions.expand_template(
template = ctx.file._template,
output = ctx.outputs.source_file,
substitutions = {
"{BENCH... | 2.03125 | 2 |
restless_dj_utils/utils/is_true.py | AdvancedThreatAnalytics/restless_dj_utils | 0 | 51805 | <reponame>AdvancedThreatAnalytics/restless_dj_utils
def is_true(value):
"""
Helper function for getting a bool form a query string.
"""
if hasattr(value, "lower"):
return value.lower() not in ("false", "0")
return bool(value)
| 2.65625 | 3 |
utils/pdf.py | uees/happyWork | 0 | 51806 | import os
from reportlab.pdfgen import canvas
from reportlab.lib.units import cm
from PyPDF2 import PdfFileWriter, PdfFileReader
def create_watermark(text, path=None):
if path:
f_pdf = os.path.join(path, 'mark.pdf')
else:
f_pdf = 'mark.pdf'
w_pdf = 20 * cm
h_pdf = 20 * ... | 2.984375 | 3 |
curves/curves/curves_main_util.py | yizaochen/smsl_na | 0 | 51807 | from os import path, remove
import subprocess
from glob import glob
from shutil import move
import MDAnalysis as mda
from miscell.file_util import check_dir_exist_and_make, check_file_exist, copy_verbose
from miscell.na_bp import d_n_bp, d_type_na
from pdb_util.pdb import PDBReader, PDBWriter
class PreliminaryAgent:
... | 2.09375 | 2 |
player_stats.py | FloPrm/ChampionsQueueTutorial | 1 | 51808 | import pandas as pd
import streamlit as st
def get_player_data(teams_data, player_name):
for team in teams_data:
for player in team['players']:
if player['name'] == player_name:
player['win'] = team['winner']
return player
return None
def get_player_team(t... | 3.4375 | 3 |
circle/migrations/0028_person_tags.py | Acids-Bases/Marketplace | 0 | 51809 | <gh_stars>0
# Generated by Django 3.2.5 on 2021-08-09 15:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('circle', '0027_auto_20210801_1047'),
]
operations = [
migrations.AddField(
model_name='person',
name='ta... | 1.664063 | 2 |
example/matrix_fun.py | tcvdijk/mini-ipe | 0 | 51810 | # Demonstrates the use of transformation matrices.
from miniipe import Document, Rotate, Translate, Scale, polyline
doc = Document()
doc.import_stylefile()
doc.add_layout( page=(640,640) )
doc.add_layer('alpha')
# Iteratively tweak a transformation matrix.
# (Matrix multiplication with the @ operator.)
ps = [(10,0),... | 2.953125 | 3 |
app/main/forms.py | apwao/Pitcher | 0 | 51811 | <gh_stars>0
from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField, SelectField
from wtforms.validators import Required
class UpdateProfile(FlaskForm):
"""
class UpdateProfile to model user Input on their profile information
to match class User in the database.
"""
... | 3.203125 | 3 |
tests/misc/aes.py | som-dev/QRL | 1 | 51812 | <gh_stars>1-10
# coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
import base64
import hashlib
from Crypto import Random, Cipher
class AES(object):
def __init__(self, key):
self.bs = 32
self.key =... | 2.890625 | 3 |
sheetsite/csv_spreadsheet.py | paulfitz/sheetsite | 33 | 51813 | <gh_stars>10-100
import csv
class CsvSpreadsheet(object):
def __init__(self, filename):
with open(filename, 'r') as fin:
reader = csv.reader(fin)
self.data = [row for row in reader]
def worksheets(self):
return [self]
def get_all_values(self):
return self... | 3 | 3 |
src/pychoreo/utils/stream_utils.py | yijiangh/pychoreo | 10 | 51814 | import random
import numpy as np
from pybullet_planning import multiply, interval_generator
from pybullet_planning import Pose, Point, Euler
def get_random_direction_generator(**kwargs):
lower = [-np.pi, -np.pi]
upper = [+np.pi, +np.pi]
for [roll, pitch] in interval_generator(lower, upper, **kwargs):
... | 2.71875 | 3 |
examples/perceptron.py | 7enTropy7/ravml | 7 | 51815 | <gh_stars>1-10
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import StandardScaler
import ravop.core as R
from ravml.linear.perceptron import Perceptron
iris_data = load_iris()
x_ = iris_data.dat... | 2.65625 | 3 |
explore_map_data.py | tussedrotten/sfm_example | 1 | 51816 | <filename>explore_map_data.py<gh_stars>1-10
import open3d as o3d
from dataset import read_dataset
def visualize_map(map, axis_size=1):
poses = map.get_keyframe_poses()
p, c = map.get_pointcloud()
axes = []
for pose in poses:
axes.append(o3d.geometry.TriangleMesh.create_coordinate_frame(size=a... | 2.625 | 3 |
src/tools/name.py | MorganeAudrain/Calcium_analysis | 0 | 51817 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Morgane
This program is for create a excel sheet where all the behavioral path are storage
"""
# Importation
import pandas as pd
df = pd.read_excel(r'calcium_analysis_checked_videos.xlsx')
mouse=pd.DataFrame(df, columns= ['mouse'])
date=pd.DataFr... | 2.609375 | 3 |
Testing/detect.py | sumanth13131/Hack-Covid | 8 | 51818 | # -*- coding: utf-8 -*-
"""
Created on Tue May 12 08:23:58 2020
@author: sumanth
"""
import numpy as np
import cv2
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from tensorflow.keras.preprocessing.image import img_to_array
def pre_dect(frame,faceNet,model):
(h, w) = frame.s... | 2.453125 | 2 |
catboost/benchmarks/kaggle/rossmann-store-sales/lightgbm_early_stopping.py | HeyLey/catboost | 6,989 | 51819 | #!/usr/bin/env python
import os.path
import config
import experiment_lib
import lightgbm as lgb
class LightGBMExperimentEarlyStopping(experiment_lib.ExperimentEarlyStopping):
def __init__(self, **kwargs):
super(LightGBMExperimentEarlyStopping, self).__init__(**kwargs)
def get_estimator(self, cat_... | 2.15625 | 2 |
codigos_diversos/Rascunho.py | rosacarla/100-days-of-python-code | 1 | 51820 | #teste
a = "<NAME>!"
print(a)
| 1.226563 | 1 |
adminlte/views/__init__.py | riffy/gta-adminlte-django | 2 | 51821 | from .index import index
from .dashboard import dashboard
from .player_list import player_list
from .player_info import player_info
from .server_statistics import server_statistics | 1.101563 | 1 |
reminder_system/event_manager.py | ProneToAdjust/Reminder-System | 0 | 51822 | <filename>reminder_system/event_manager.py
from .google_calendar import GoogleCalendar
import datetime
from . import utils
class EventManager(GoogleCalendar):
def __init__(self, service_account_file):
super().__init__(service_account_file)
self.upcoming_events = []
self.unconfirmed_events = []
self.confirmed... | 2.859375 | 3 |
quex/engine/counter.py | smmckay/quex-mirror | 0 | 51823 | <gh_stars>0
# (C) <NAME>
#
# .--( LineColumnCount )--------------------------------.
# | |
# | + count_command_map (map: count command --> value) |
# '-----------------------------------------------------'
#
#
# .--( IndentationCoun... | 2.046875 | 2 |
bin/synth/yosys-abc/share/yosys/merger.py | DanielTRYTRYLOOK/RDF-2020 | 3 | 51824 | #
# Incremental Def Writer -- Brown University
#
# Copyright (C) 2019 Brown University
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE S... | 2.3125 | 2 |
scripts/mkcontrol.py | charlie45000/corunners-example | 0 | 51825 | #! /usr/bin/env python3
import argparse
from pathlib import Path
import sys
from scriptutil import get_nodes_to_ea, decode_file, gen_json_data, calc
C0_OFF = "Task: C0, Corunner: OFF"
C0_ON = "Task: C0, Corunner: ON"
C0_ON_LOCAL = "Task: C0, Corunner: ON (Local)"
C1_OFF = "Task: C1, Corunner: OFF"
C1_ON = "Task: C1, ... | 2.21875 | 2 |
psdaq/psdaq/pyxpm/LclsTimingCore/EvrV2CoreTriggers.py | AntoineDujardin/lcls2 | 0 | 51826 | #!/usr/bin/env python
#-----------------------------------------------------------------------------
# Title : PyRogue LCLS-II EVR V2 Core Trigger Registers
#-----------------------------------------------------------------------------
# File : Device.py
# Created : 2018-09-17
#---------------------------... | 1.164063 | 1 |
_aulas/aula007d.py | CarlosJunn/Aprendendo_Python | 0 | 51827 | <reponame>CarlosJunn/Aprendendo_Python<gh_stars>0
m = float(input('Digite um valor em metros:'))
cm = m * 100
mm = m * 1000
print('Valor em centímetros: {:.2f}\nValor em milímetros: {:.2f}'.format(cm,mm)) | 3.953125 | 4 |
server/openslides/assignments/migrations/0017_vote_to_y.py | Gersdorfa/OpenSlides | 3 | 51828 | <filename>server/openslides/assignments/migrations/0017_vote_to_y.py
# Generated by <NAME> on 2020-11-24 06:44
from django.db import migrations
def votes_to_y(apps, schema_editor):
AssignmentPoll = apps.get_model("assignments", "AssignmentPoll")
for poll in AssignmentPoll.objects.all():
changed = Fal... | 2.015625 | 2 |
usuelles.py | Sup3Legacy/TIPE | 0 | 51829 | <gh_stars>0
import numpy as np
def moyenne(liste):
"""Renvoie la moyenne des éléments de la liste."""
n = len(liste)
comp = 0
for element in liste:
comp += element/n
return comp
def ecartType(liste, m = 0):
"""Retourne l'écart-type des valeurs de liste."""
n = len(liste... | 3.03125 | 3 |
data_logger_app/logdata/csv/device_data_csv_writer.py | id872/data_logger | 0 | 51830 | # -*- coding: utf-8 -*-
from csv import DictWriter
from os import path
from app_logger import app_logging
from execution_error import ExecutionError
class DeviceDataCsvWriter:
def __init__(self):
self.csv_writer = None
@staticmethod
def __get_merged_dict(log_date_time, dev_data, dev_names):
... | 2.734375 | 3 |
src/__init.py | asepscareer/cnnindonesia-api | 1 | 51831 | <gh_stars>1-10
from .base import GetData
from .utils import parse, headers, base_url | 1.179688 | 1 |
src/Sephrasto/UI/CharakterInfo.py | Ilaris-Tools/Sephrasto | 1 | 51832 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'CharakterInfo.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore... | 2 | 2 |
sortingview/tasks/workspace_list_subfeed.py | magland/sortingview | 2 | 51833 | <filename>sortingview/tasks/workspace_list_subfeed.py
import kachery_client as kc
from ..workspace_list import WorkspaceList
# @kc.taskfunction('sortingview_workspace_list_subfeed.2', type='query')
def task_sortingview_workspace_list_subfeed(name: str):
W = WorkspaceList(list_name=name)
return W.get_subfeed_ur... | 2 | 2 |
src/lab2/rawdata/WEB.py | ntuaha/NewsInsight2 | 1 | 51834 | <filename>src/lab2/rawdata/WEB.py
# -*- coding: utf-8 -*-
#import re
#處理掉unicode 和 str 在ascii上的問題
import sys
#import os
import psycopg2
import cookielib, urllib2,urllib
from lxml import html,etree
import StringIO
import datetime
import json
reload(sys)
sys.setdefaultencoding('utf8')
class WEB:
def getRawData(sel... | 2.953125 | 3 |
core/app.py | simyy/flask_app | 0 | 51835 | #!/usr/bin/env python
# encoding: utf-8
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from config import configs
db = SQLAlchemy()
def create_app(app_name, config_name):
app = Flask(app_name, template_folder="app/templates")
app = Flask(app_name)
app.config['SQLALCHEMY_TRACK_MODIFICAT... | 2.203125 | 2 |
sparse/repos/shane-breeze/atuproot/binder/atuproot/EventBuilder.py | yuvipanda/mybinder.org-analytics | 1 | 51836 | import uproot
from .BEvents import BEvents
class EventBuilder(object):
def __init__(self, config):
self.config = config
def __repr__(self):
return '{}({!r})'.format(
self.__class__.__name__,
self.config,
)
def __call__(self):
if len(self.config.inp... | 2.296875 | 2 |
posts/migrations/0011_auto_20200530_1544.py | olifirovai/yatube | 0 | 51837 | # Generated by Django 2.2.6 on 2020-05-30 22:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0010_auto_20200530_1531'),
]
operations = [
migrations.AlterField(
model_name='follow',
name='created',
... | 1.53125 | 2 |
actions/__init__.py | jroivas/klapi | 3 | 51838 | <reponame>jroivas/klapi
import actions
import client
| 0.945313 | 1 |
problem/01000~09999/01309/1309.py3.py | njw1204/BOJ-AC | 1 | 51839 | <filename>problem/01000~09999/01309/1309.py3.py
n=int(input())
dp=[[1]*3 for i in range(2)]
for i in range(1,n):
dp[i%2][0]=(dp[(i-1)%2][0]+dp[(i-1)%2][1]+dp[(i-1)%2][2])%9901
dp[i%2][1]=(dp[(i-1)%2][0]+dp[(i-1)%2][2])%9901
dp[i%2][2]=(dp[(i-1)%2][0]+dp[(i-1)%2][1])%9901
n-=1
print((dp[n%2][0]+dp[n%2][1]+dp[n%2][2])... | 2.9375 | 3 |
airflow/dags/split_into_time.py | zkan/try-airflow | 1 | 51840 | import os
AIRFLOW_HOME = os.environ.get('AIRFLOW_HOME')
with open(f'{AIRFLOW_HOME}/dags/data.txt') as f:
time_data = f.read()
time_list = time_data.split()
with open(f'{AIRFLOW_HOME}/dags/time.txt', 'w') as split_text:
split_text.write(str(time_list[3]))
| 2.21875 | 2 |
jinnan/baseline.py | keepangry/ai_application | 0 | 51841 | <reponame>keepangry/ai_application
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 19-1-6 下午4:06
# @Author : yangsen
# @Mail : <EMAIL>
# @File : baseline.py
# @Software: PyCharm
import numpy as np
import pandas as pd
import lightgbm as lgb
import xgboost as xgb
from sklearn.linear_model import Bayesia... | 2.15625 | 2 |
week1/w1e1.py | melphick/pybasics | 0 | 51842 | #!/usr/bin/env python
addr = 'FE80:0000:0000:0000:0101:A3EF:EE1E:1719'
ipv6 = addr.split(':')
print ipv6 | 2.640625 | 3 |
tests/test_integrations.py | ajbeach2/drf-elasticsearch-dsl | 3 | 51843 | <reponame>ajbeach2/drf-elasticsearch-dsl
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_drf-elasticsearch-dsl
------------
Tests for `drf-elasticsearch-dsl` models module.
"""
from django.test import TestCase
from .search_indexes import ContactSerializerDocument
from .factories import ContactFactory
class... | 2.390625 | 2 |
alchemist_lib/database/aum_history.py | Dodo33/alchemist-lib | 5 | 51844 | from sqlalchemy import DateTime, String, ForeignKey, Integer, Column, Float
from sqlalchemy.orm import relationship
from . import Base
class AumHistory(Base):
"""
Map class for table AumHistory.
- **aum_id**: Integer, primary_key.
- **aum_datetime**: DateTime, not null.
- **aum**: ... | 2.96875 | 3 |
ext.py | taipeithomas/adventure-wows | 0 | 51845 | <gh_stars>0
# coding: utf-8
"""
ext
~~~
Good place for pluggable extensions.
:copyright: (c) 2015 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
from flask.ext.debugtoolbar import DebugToolbarExtension
from flask.ext.gravatar import Gravatar
from flask.ext.login import LoginManager
... | 1.585938 | 2 |
notes/algo-ds-practice/problems/greedy/stock_buy_sell.py | Anmol-Singh-Jaggi/interview-notes | 6 | 51846 | '''
The cost of a stock on each day is given in an array.
Find the max profit that you can make by buying and selling in those days.
Only 1 stock can be held at a time.
For example:
Array = {100, 180, 260, 310, 40, 535, 695}
The maximum profit can earned by buying on day 0, selling on day 3.
Again buy on day 4 and sel... | 3.40625 | 3 |
.idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/imports/test_import_absolute_error/main2.py | Vladpetr/NewsPortal | 0 | 51847 | x = 103
| 1.8125 | 2 |
app/db/models.py | SiriusKoan/shorten-url-with-kv | 3 | 51848 | <filename>app/db/models.py
import datetime
from flask_sqlalchemy import SQLAlchemy
from werkzeug.security import generate_password_hash, check_password_hash
db = SQLAlchemy()
class Users(db.Model):
__tablename__ = "users"
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String, unique... | 2.875 | 3 |
tests/test_io_text.py | akki2825/CorpusTools | 97 | 51849 |
import pytest
import os
from corpustools.corpus.io.text_spelling import (load_discourse_spelling,
load_directory_spelling,
inspect_discourse_spelling,
export_discourse_spelli... | 2.28125 | 2 |
Files.py/1010.py | gomes-gabriel/URI | 0 | 51850 | <reponame>gomes-gabriel/URI
# data input
inp1 = input().split()
inp2 = input().split()
# data processing
code1 = inp1[0]
num_code1 = int(inp1[1])
unit_value1 = float(inp1[2])
code2 = inp2[0]
num_code2 = int(inp2[1])
unit_value2 = float(inp2[2])
price = num_code1 * unit_value1 + num_code2 * unit_value2
# data outpu... | 3.3125 | 3 |
xbradio_test.py | pramasoul/micropython-xbee | 0 | 51851 | """Test for XBee Pro S3B"""
from xbradio import XBRadio
from pyb import SPI, Pin, delay
def test_PacketBuffer():
import test_PacketBuffer
test_PacketBuffer.main()
def test_as(xb):
#xb.verbose = True
#g = xb.get_and_process_available_packets
#BUG, this doesn't work: print("values: %r" % xb.values)... | 2.5 | 2 |
myproxy.py | nolink/penetration | 0 | 51852 | <filename>myproxy.py
import os
import sys
import socket
import threading
def hexdump(src, length=16):
result = []
digits = 4 if isinstance(str, unicode) else 2
for i in xrange(0, len(str), length):
s = src[i:i+length]
hexa = b' '.join(["%0*X" % (digits, ord(x)) for x in s])
tex... | 2.6875 | 3 |
setup.py | cmheisel/django-baseboard | 1 | 51853 | <reponame>cmheisel/django-baseboard
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "django-baseboard",
version = "0.3",
url = 'http://github.com/cmheisel/django-baseboard',
license = 'MIT',
... | 1.4375 | 1 |
src/KWS.py | MaxTheHuman/MyKWS | 0 | 51854 | import torch
import torchaudio
import configparser
from torch import nn
from model import KWS
from prepare_big_wav import getBigWaveform
use_cuda = torch.cuda.is_available()
torch.manual_seed(7)
device = torch.device("cuda" if use_cuda else "cpu")
config = configparser.ConfigParser()
config.read('config.ini')
mel_... | 2.359375 | 2 |
part/mm/fixed_risk/part.py | fasiondog/hikyuu_house | 0 | 51855 | <gh_stars>0
from hikyuu import MM_FixedRisk
# 部件作者
author = "fasiondog"
# 版本
version = '20200825'
def part(risk=1000.00):
return MM_FixedRisk(risk)
part.__doc__ = MM_FixedRisk.__doc__
if __name__ == '__main__':
print(part()) | 1.546875 | 2 |
cogs/pins.py | lordclips/Spiders | 0 | 51856 | <gh_stars>0
import discord
import json
import time
import os
from discord.ext import commands
from discord.ext import tasks
PIN_EMOTE = "\U0001F4CC"
THRESHOLD = 5
THREE_DAYS = 259200
class Pins(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.pins = {}
self._checkrole_id = 458... | 2.453125 | 2 |
rnacentral_pipeline/databases/data/regions.py | RNAcentral/rnacentral-import-pipeline | 1 | 51857 | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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.890625 | 3 |
src/discord/checks.py | ttgc/zigotoland | 2 | 51858 | <gh_stars>1-10
#!usr/bin/env python3.7
#-*-coding:utf-8-*-
from src.utils.config import *
from src.games.poker.lobby import *
from src.discord.manage import *
from src.utils.logs import getlogger
def check_botowner(ctx):
config = Config()
return ctx.author.id in config.owners
def check_inserv(ctx):
confi... | 2.109375 | 2 |
loris/parameters/rotation.py | jpstroop/loris-redux | 7 | 51859 | from loris.constants import FEATURE_ROTATION_ARBITRARY
from loris.constants import FEATURE_ROTATION_BY_90S
from loris.constants import FEATURE_ROTATION_MIRRORING
from loris.exceptions import FeatureNotEnabledException
from loris.exceptions import RequestException
from loris.exceptions import SyntaxException
from loris.... | 2.390625 | 2 |
python/ymt_components/ymt_arm_2jnt_02/settingsUI.py | yamahigashi/mgear_shifter_components | 10 | 51860 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:/Pipeline/rez-packages/third/github.com/yamahigashi/ymtshiftercomponents/mgear_shifter_components/python/ymt_components/ymt_arm_2jnt_02/settingsUI.ui',
# licensing of 'D:/Pipeline/rez-packages/third/github.com/yamahigashi/ym... | 1.601563 | 2 |
examples/simple.py | bytewax/bytewax | 109 | 51861 | from bytewax import Dataflow, run
flow = Dataflow()
flow.map(lambda x: x * x)
flow.capture()
if __name__ == "__main__":
for epoch, y in sorted(run(flow, enumerate(range(10)))):
print(y)
| 2.328125 | 2 |
gfwanalysis/services/analysis/classification_service.py | archelogos/gfw-umd-gee | 5 | 51862 | <reponame>archelogos/gfw-umd-gee
"""CLASSIFICATION SERVICE"""
import logging
import ee
from gfwanalysis.errors import ClassificationError
class ClassificationService(object):
@staticmethod
def classify(img_id):
"""
For a given area classify the forest amount and return a image with the cla... | 3.015625 | 3 |
scitwi/users/user.py | vahndi/scitwi | 0 | 51863 | <gh_stars>0
from scitwi.users.user_entities import UserEntities
from scitwi.users.user_profile import UserProfile
from scitwi.utils.attrs import bool_attr, datetime_attr, str_attr, obj_attr
from scitwi.utils.attrs import int_attr
from scitwi.utils.strs import obj_string
class User(object):
"""
Users can be an... | 2.25 | 2 |
conjureup/controllers/juju/clouds/common.py | iMichka/conjure-up | 1 | 51864 | <gh_stars>1-10
class BaseCloudController:
pass
| 0.878906 | 1 |
tests/test_project.py | dsgrid/dsgrid | 4 | 51865 | import pytest
from pyspark.sql import SparkSession
from collections import defaultdict
from dsgrid.project import Project
from dsgrid.dataset.dataset import Dataset
from dsgrid.dimension.base_models import DimensionType
from dsgrid.exceptions import DSGValueNotRegistered, DSGInvalidDimensionMapping
from dsgrid.tests.c... | 2.078125 | 2 |
gui/model/timer_model.py | GGelatin/TekkenBot | 45 | 51866 | <reponame>GGelatin/TekkenBot<filename>gui/model/timer_model.py
#!/usr/bin/env python3
# Copyright (c) 2019, <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 sou... | 1.921875 | 2 |
angr/procedures/posix/recv.py | Kyle-Kyle/angr | 6,132 | 51867 | import angr
######################################
# recv
######################################
class recv(angr.SimProcedure):
#pylint:disable=arguments-differ,unused-argument
def run(self, fd, dst, length, flags):
simfd = self.state.posix.get_fd(fd)
if simfd is None:
return -1
... | 2.3125 | 2 |
makenew_python_app/server/__init__.py | makenew/python-app | 2 | 51868 | <filename>makenew_python_app/server/__init__.py
"""
Server.
"""
from .boot import boot
| 1.40625 | 1 |
categories/Info.py | SirMangler/DolphinDiscord | 0 | 51869 | import discord
from discord.ext import commands
class Info(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(help='Shows info about Dolphin', aliases=['link', 'l'])
async def links(self, ctx):
'''
Download links
'''
await ctx.send(embed=discord.Embed(title='Links:', ... | 2.8125 | 3 |
depth_first_search/m_target_sum.py | dhrubach/python-code-recipes | 0 | 51870 | <reponame>dhrubach/python-code-recipes
#################################################
# LeetCode Problem Number : 494
# Difficulty Level : Medium
# URL : https://leetcode.com/problems/target-sum/
#################################################
from typing import List
from collections import defaultdict
class Tar... | 3.640625 | 4 |
geonet/tests.py | bbengfort/kahu | 1 | 51871 | # geonet.tests
# Test Cases for the geonet app
#
# Author: <NAME> <<EMAIL>>
# Created: Mon Jun 11 08:10:28 2018 -0400
#
# ID: tests.py [] <EMAIL> $
"""
Test Cases for the geonet app
"""
##########################################################################
## Imports
#############################################... | 1.296875 | 1 |
futura_ui/app/ui/widgets/recipe_actions.py | pjamesjoyce/futura | 6 | 51872 | <reponame>pjamesjoyce/futura<gh_stars>1-10
from PySide2 import QtWidgets
from ..utils import load_ui_file
from ...signals import signals
import os
from functools import partial
emit_0 = partial(signals.start_status_progress.emit, 0)
class RecipeWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
... | 2.078125 | 2 |
frontend/Untitled.py | hanisaf/ODIN | 0 | 51873 | <reponame>hanisaf/ODIN
# coding: utf-8
# In[5]:
from flask import Flask
#from werkzeuk.utils import find_modules, import_str
# In[ ]:
# In[2]:
def create_app(config=None):
app = Flask(__name__)
app.config.update(config or {})
#register_blueprints(app)
return app
# In[ ]:
| 1.703125 | 2 |
using_insert_many.py | julio-coelho/python-playground | 0 | 51874 | <gh_stars>0
import sys
import pymongo
connection = pymongo.MongoClient('127.0.0.1', 27017)
def insert():
print "insert many, reporting for duty"
db = connection.school
people = db.people
richard = {
'name': '<NAME>',
'company': '10gen',
'interest': [
'horsing',... | 3.484375 | 3 |
Lib/site-packages/pdsspect/basic.py | fochoao/cpython | 0 | 51875 | from functools import wraps
from qtpy import QtWidgets
from .histogram import HistogramWidget, HistogramModel, HistogramController
from .pdsspect_image_set import PDSSpectImageSetViewBase
class BasicHistogramModel(HistogramModel):
"""Model for the hhistograms in the Basic Widgets
Attributes
---------
... | 2.5625 | 3 |
ReadXMLClass.py | exponential-decay/oais-du-jour | 1 | 51876 | <gh_stars>1-10
import os
import re
import sys
import urllib2
import xml.etree.ElementTree as etree
class read_xml:
def __init__(self, loc):
self.loc = loc
def scan_xml(self):
tree = etree.ElementTree(file=urllib2.urlopen(self.loc))
root = tree.getroot()
xml_iter = iter(root)
r... | 2.953125 | 3 |
pynamodb/tests/integration/config.py | augustincouette/PynamoDB | 3 | 51877 | <reponame>augustincouette/PynamoDB<filename>pynamodb/tests/integration/config.py
"""
Integration test settings
"""
DYNAMODB_HOST = 'http://localhost:8000' | 1.15625 | 1 |
app/helpers/util.py | Soumya117/finnazureflaskapp | 0 | 51878 | def link_exists(url, links):
data = [x['link'] for x in links['links']]
return (lambda item, elements: item in elements)(url, data)
| 2.9375 | 3 |
doc/crypto/testrsa.py | haysengithub/ctf | 0 | 51879 | <gh_stars>0
# -*- coding: utf-8 -*-
# by https://findneo.github.io/
# ref:
# https://crypto.stackexchange.com/questions/11053/rsa-least-significant-bit-oracle-attack
# https://ctf.rip/sharif-ctf-2016-lsb-oracle-crypto-challenge/
# https://introspelliam.github.io/2018/03/27/crypto/RSA-Least-Significant-Bit-Oracle-Attack... | 2.96875 | 3 |
examples/controller/gateway/v1.py | mtag-dev/mtag | 0 | 51880 | import asyncio
from squall import Router, WebSocket
import orjson
class FanOut:
def __init__(self):
self.clients = set()
def join(self, ws):
self.clients.add(ws)
def left(self, ws):
self.clients.discard(ws)
async def send(self, message):
await asyncio.gather(*[ws.sen... | 2.671875 | 3 |
chrony/core.py | gtnx/chrony | 3 | 51881 | <reponame>gtnx/chrony<filename>chrony/core.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import pandas as pd
def compute_category_index(categories):
return {category: index + 1 for index, category in enumerate(sorted(set(categori... | 2.203125 | 2 |
manipulation_main/training/env_reset_demo.py | ama29/6.843-Final-Project | 0 | 51882 | <filename>manipulation_main/training/env_reset_demo.py
import argparse
from manipulation_main.training.imitation_utils import get_env_expert
train_parser = argparse.ArgumentParser()
train_parser.add_argument('--config', type=str, required=True)
train_parser.add_argument('--model_dir', type=str, required=True)
train_p... | 2.171875 | 2 |
pip_services3_commons/commands/IEventListener.py | pip-services-python/pip-services-commons-python | 0 | 51883 | # -*- coding: utf-8 -*-
"""
pip_services3_commons.commands.IEventListener
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interface for event_name listeners.
:copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
... | 2.640625 | 3 |
application/parser.py | adrianno3259/heterogeneous-raytracing-pynq | 3 | 51884 | class Parser:
def __init__(self, *args, **kwargs):
import argparse
self.parser = argparse.ArgumentParser(
description='Request Ray-Triangle computations to the PYNQ-Z1 renderer.')
client_info = 'client: runs on any machine that accesses the PYNQ-Z1 renderer'
server_inf... | 3 | 3 |
DocumentRetrival/main.py | DB2-P2-EJJ/DB2-DocumentRetrival | 0 | 51885 | import PySimpleGUI as sg
import os.path
import pandas as pd
from call_index import get_data, process_index
# Set path from computer
BROWSE_PATH = os.getcwd()+"/Dataset"
selected_filename = None
query = None
full_data = None
selected_doc = None
mii_index = None
original_data = None
def main():
global BROWSE_PATH... | 2.375 | 2 |
bbot/IndMtn.py | AlwaysTraining/bbot | 0 | 51886 | <reponame>AlwaysTraining/bbot
#!/usr/bin/env python
# Author: <NAME>
# Copyright 2014
# Unclassified
from bbot.Utils import *
from bbot.MainStrategy import MainStrategy
from bbot.Data import *
S = SPACE_REGEX
N = NUM_REGEX
def get_region_ratio(app, context):
r = Regions()
r.coastal.number = 0
r.river.n... | 2.421875 | 2 |
en/app.py | GezegenDigital/Keyboard-Speedometer | 1 | 51887 | <filename>en/app.py
import time
import datetime
print("Please type your text after 3 seconds")
print("3")
time.sleep(1)
print("2")
time.sleep(1)
print("Go!")
time.sleep(0.2)
before = datetime.datetime.now()
text=input("Type here:")
after = datetime.datetime.now()
speed = after - before
seconds = round(spee... | 4.03125 | 4 |
PIAs/views.py | m3d14n0/PIA-Toolkit | 0 | 51888 | <gh_stars>0
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.shortcuts import render, redirect
from django.template.loader import get_template
from django.urls import reverse
from djang... | 1.898438 | 2 |
show_items.py | wor1dedit/fast-scrape | 0 | 51889 | <reponame>wor1dedit/fast-scrape<gh_stars>0
import auction
auction1154 = auction.Auction("iii1154")
auction1154.scrape_item_ids()
auction1154.scrape_item_info()
print(auction1154.items[0].info)
| 2.78125 | 3 |
lib/osenv_controller.py | opnmind/osenv | 0 | 51890 | <reponame>opnmind/osenv
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=C0330
import json
import os
import stat
import sys
from consolemenu import SelectionMenu
from lib.file_encryption import FileEncryption
from lib.storage import Storage
from lib.tenant import Tenant
from lib import _program
import ... | 2.25 | 2 |
checks/CheckCopyright.py | drakenclimber/hookster | 0 | 51891 | <gh_stars>0
#!/usr/bin/env python
#****************************************************************************
# ©
# Copyright 2014-2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... | 2.15625 | 2 |
bikeshed/htmlhelpers.py | shans/bikeshed | 0 | 51892 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import html5lib
from html5lib import treewalkers
from html5lib.serializer import htmlserializer
from lxml import html
from lxml import etree
from lxml.cssselect import CSSSelector
from . import config
from .messages import *
def fi... | 2.671875 | 3 |
quantities/units/concentration.py | 502E532E/python-quantities | 105 | 51893 | """
"""
from ..unitquantity import UnitQuantity
from .substance import mol
from .volume import L
M = molar = UnitQuantity(
'molar',
mol / L,
symbol='M',
aliases=['Molar']
)
mM = millimolar = UnitQuantity(
'millimolar',
molar / 1000,
symbol='mM'
)
uM = micromolar = UnitQuantity(
'micr... | 2.3125 | 2 |
dottygen/generator/merger.py | adbarwell/DottyGenerator | 0 | 51894 | <filename>dottygen/generator/merger.py
import copy
class Merger():
def __init__(self,efsms, unop=True):
self._efsms = efsms
self._unop = unop
def _is_terminal_or_visited(self, efsm, states, visited):
for state in states:
if not efsm.is_terminal_state(state) and not state.id... | 2.421875 | 2 |
test/package/package_b/subpackage_2.py | Hacky-DH/pytorch | 60,067 | 51895 | <filename>test/package/package_b/subpackage_2.py<gh_stars>1000+
__import__("math", fromlist=[])
__import__("xml.sax.xmlreader")
result = "subpackage_2"
class PackageBSubpackage2Object_0:
pass
def dynamic_import_test(name: str):
__import__(name)
| 1.695313 | 2 |
PR_Evaluation.py | iskaj/ObamaSpeech_Punctuation_Restoration | 0 | 51896 | <gh_stars>0
import time
import pandas as pd
import os
from tqdm import tqdm
PUNC = [',', '.', '?']
PUNC_NAMES = ["Comma", "Period", "Question Mark"]
def punc_to_puncname(punc):
assert punc in PUNC, "Provide a valid punctuation sign, only: , . ? are allowed"
return PUNC_NAMES[PUNC.index(punc)]
# G... | 2.9375 | 3 |
main/rest/views.py | csev/class2go | 2 | 51897 | <reponame>csev/class2go
from rest_framework import permissions
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from rest_framework import generics
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response... | 1.921875 | 2 |
experiment.py | veddox/jcm | 0 | 51898 | <gh_stars>0
#!/usr/bin/python3
##
## Janzen-Connell Model
## Set up and run the main experiment.
## (c) <NAME>, MIT license
##
import os, sys
analyse = True
logging = True
runtime = 1000 #default: 500
datafreq = 50 #default: 10
def run_model(scenario="null", n=10, b=0):
"""
Run the model with n repetitions ... | 2.65625 | 3 |
mlflow/utils/_spark_utils.py | adamreeve/mlflow | 1 | 51899 | import tempfile
import shutil
import os
def _get_active_spark_session():
try:
from pyspark.sql import SparkSession
except ImportError:
# Return None if user doesn't have PySpark installed
return None
try:
# getActiveSession() only exists in Spark 3.0 and above
retur... | 2.390625 | 2 |