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 |
|---|---|---|---|---|---|---|
py/hashmap.py | maoandmoon/dataStructures | 1 | 12794451 | from .linkedlist import LinkedList
class Hashmap(object):
"""
character holding hash map
"""
def __init__(self, hash_fn, length=100):
self.num_values = 0
assert hasattr(hash_fn, '__call__'), 'You must provide a hash function'
self._buckets = [None] * length
self.hash_le... | 3.796875 | 4 |
tests/base_test.py | HelloMorrisMoss/mahlo_popup | 0 | 12794452 | """Parent class for each non-unit test. Creates and removes a new test table for each test."""
# TODO: integrate creating/removing a database
from unittest import TestCase
from flask_server_files.flask_app import app
from flask_server_files.sqla_instance import fsa
# from flask.ext.testing import TestCase
class ... | 2.6875 | 3 |
playground/service.py | tairan/playground-python | 0 | 12794453 | <reponame>tairan/playground-python<filename>playground/service.py
import datetime
import pytz
from .models import (
Account
)
class AccountService():
def __init__(self, session):
self.session = session
def sign_in(self, name):
user = self.session.Query(Account).filter(name=name).fisrt()
if user:
user.l... | 3 | 3 |
teamspirit/profiles/models.py | etienne86/oc_p13_team_spirit | 0 | 12794454 | <gh_stars>0
"""Contain the models related to the app ``profiles``."""
from django.db import models, transaction
from teamspirit.core.models import Address
from teamspirit.profiles.managers import (
PersonalManager,
RoleManager,
rename_id_file,
rename_medical_file,
)
from teamspirit.users.models import... | 2.375 | 2 |
command/httlemon.py | dev-lemon/httlemon | 1 | 12794455 | <gh_stars>1-10
import click
from client.client_request import client_request
@click.command()
@click.argument('http_verb')
@click.argument('url')
def httlemon(http_verb, url):
beautified_response = client_request(http_verb, url)
click.echo(beautified_response)
| 2.453125 | 2 |
dbq/main.py | getyourguide/dbq | 6 | 12794456 | import os
import sys
import json
import atexit
from argparse import ArgumentParser
from shutil import get_terminal_size
from subprocess import Popen, PIPE
from textwrap import dedent
from pkg_resources import get_distribution
from databricks_dbapi import databricks
from tabulate import tabulate
MAX_ROWS = 100
HISTORY... | 2.8125 | 3 |
aiokraken/websockets/schemas/__init__.py | asmodehn/aiokraken | 0 | 12794457 | <reponame>asmodehn/aiokraken
# TODO : Marshmallow schemas : Possible optimizations
# - if input is a list ( and not a dict/ class instance), iterate on it, zipped with declared fields.
# - from an existing schema, have a way to "restrict" the field to a "smaller" field.
# A kind fo gradual typing i guess...
| 1.851563 | 2 |
pixel/tests.py | trevor-ngugi/pixel-collab | 0 | 12794458 | from django.test import TestCase
from .models import Place,Category,Image
# Create your tests here.
class PlaceTestClass(TestCase):
def setUp(self):
self.nairobi=Place(location='nairobi')
def test_instance(self):
self.assertTrue(isinstance(self.nairobi,Place))
def test_save_method(s... | 2.75 | 3 |
apps/cli/diana-cli.py | derekmerck/DIANA | 9 | 12794459 | <reponame>derekmerck/DIANA
import logging
import click_log
import click
from diana.apis import *
from utils.merge_yaml_sources import merge_yaml_sources
from commands.orthanc import ofind, pull
from commands.splunk import sfind
from commands.watch import watch
from commands.mock import mock
from commands.hello import h... | 1.921875 | 2 |
ghwiz/ghwiz.py | nerdralph/h2k | 0 | 12794460 | <filename>ghwiz/ghwiz.py
#!/usr/bin/python
# <NAME> 2021, 2022
# Greener Homes wizard: creates H2K house models from templates
import photos
import math, os, sys
import xml.etree.ElementTree as ET
FT_PER_M = 3.28084
SF_PER_SM = FT_PER_M ** 2
if len(sys.argv) < 6:
print(sys.argv[0], "fileid template.h2k afl-heig... | 2.640625 | 3 |
scripts/evaluate.py | rashikcs/Case-Study-Campaign-Optimization | 0 | 12794461 | import numpy as np
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import auc
from sklearn.metrics import matthews_corrcoef
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve
from sklearn.metrics import classification_repor... | 2.703125 | 3 |
dssg_challenge/ga/algorithm/simulated_annealing.py | DavidSilva98/dssgsummit2020-challenge | 0 | 12794462 | <reponame>DavidSilva98/dssgsummit2020-challenge
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------------------------
"""
Simulated Annealing Meta-Heuristic
----------------------------------
Content:
▶ class Simulated Annealing
─────────────────────────────────... | 2.0625 | 2 |
gongda/TROPOMI/TROPOMI_NO2_Suez_visualisations.py | eamarais/eam-group | 3 | 12794463 | #####################################################################################################################
#####################################################################################################################
# See how TROPOMI NO2 responds to the Suez Canal blockage
# When downloading the ... | 2.640625 | 3 |
problem/01000~09999/04999/4999.py3.py | njw1204/BOJ-AC | 1 | 12794464 | print('gn'[input()>input()]+'o') | 2.125 | 2 |
AutomatedTesting/Assets/TestAnim/scene_export_motion.py | BreakerOfThings/o3de | 11 | 12794465 | <gh_stars>10-100
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import traceback, sys, uuid, os, json
import scene_export_utils
import scene_api.motion_g... | 1.820313 | 2 |
ml_cdn_cifar.py | wiseodd/compound-density-networks | 14 | 12794466 | import torch
import torchvision
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.distributions as dists
import numpy as np
import scipy.io
import foolbox
import input_data
import argparse
from tqdm import tqdm
import data_loader
import math
import os
import tensorflow as t... | 1.945313 | 2 |
app/migrations/0003_photo_pic.py | taojy123/Babylon | 0 | 12794467 | <gh_stars>0
# Generated by Django 3.0.8 on 2020-08-04 03:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0002_photo_hidden'),
]
operations = [
migrations.AddField(
model_name='photo',
name='pic',
... | 1.53125 | 2 |
backend/registry/enums/document.py | Don-King-Kong/mrmap | 10 | 12794468 | from MrMap.enums import EnumChoice
class DocumentEnum(EnumChoice):
""" Defines all document types
"""
CAPABILITY = "Capability"
METADATA = "Metadata"
| 2.15625 | 2 |
python/qibuild/actions/list_configs.py | vbarbaresi/qibuild | 0 | 12794469 | <reponame>vbarbaresi/qibuild
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYING file.
"""List all the known configs """
import operator
from qisys import ui
import qisys.parsers
import qibuild.worktree
de... | 1.875 | 2 |
graph_2_systems_rmsd.py | Miro-Astore/mdanalysis_scripts | 1 | 12794470 | <reponame>Miro-Astore/mdanalysis_scripts<filename>graph_2_systems_rmsd.py
import numpy as np
import os
import MDAnalysis as mda
from matplotlib import pyplot as plt
import matplotlib.gridspec as gridspec
system_list=['_scratch_r16_ma2374_gmx_cftr_2nd_round_310K_I37R_3_res_rmsd.dat','_scratch_r16_ma2374_gmx_cftr_2nd... | 2.421875 | 2 |
src/langumo/building/mergence.py | affjljoo3581/langumo | 7 | 12794471 | """
Mergence
^^^^^^^^
All parsed plain text files should be merged into a single file to handle them
as an unified large corpus data.
.. autoclass:: MergeFiles
"""
from langumo.building import Builder
from langumo.utils import AuxiliaryFile, AuxiliaryFileManager, colorful
class MergeFiles(Builder):
"""Merge fi... | 3.015625 | 3 |
src/test/kalman/numpy_kalman.py | chrisspen/homebot | 8 | 12794472 | """
From http://arxiv.org/pdf/1204.0375.pdf
"""
from numpy import dot, sum, tile, linalg
from numpy.linalg import inv
def kf_predict(X, P, A, Q, B, U):
"""
X: The mean state estimate of the previous step (k−1).
P: The state covariance of previous step (k−1).
A: The transition n × n matrix.
Q: The ... | 3.046875 | 3 |
setup.py | Yoctol/word-embedder | 3 | 12794473 | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
try:
long_description = open("README.md").read()
except IOError:
long_description = ""
setup(
name="word-embedder",
version="1.0.0",
description="Word Embedder",
li... | 1.640625 | 2 |
kite-python/kite_ml/kite/exp/eligible_users/retention_rate.py | kiteco/kiteco-public | 17 | 12794474 | <filename>kite-python/kite_ml/kite/exp/eligible_users/retention_rate.py<gh_stars>10-100
from typing import Callable
import datetime
import pandas as pd
def naive_retention_fn(df: pd.DataFrame) -> pd.Series:
"""
Calculates naive retention rate based entirely on the kite_status data
:param df: a DataFrame... | 3 | 3 |
tests/test_resources.py | paulopes/panel-components | 4 | 12794475 | """The purpose of this module is to test the TemporaryResources context manager
The purpose of the TemporaryResources context manager is to enable using temporary, specific
configuration of resources when creating a custom Template.
If you use the global configuration `pn.config` for your templates you will include t... | 2.375 | 2 |
tests/unit/modules/test_create.py | MatthieuBlais/freeldep | 0 | 12794476 | <reponame>MatthieuBlais/freeldep
import pytest
from freeldep.modules.create import validate_bucket
from freeldep.modules.create import validate_emails
from freeldep.modules.create import validate_name
from freeldep.modules.create import validate_registry
def test_validate_name():
assert validate_name("sdfsdfdfsd... | 2.15625 | 2 |
class9/exercise4.py | papri-entropy/pyplus | 0 | 12794477 | #!/usr/bin/env python
"""
4a. Add nxos1 to your my_devices.py file.
Ensure that you include the necessary information to set the NX-API port to 8443.
This is done using 'optional_args' in NAPALM so you should have the following key-value pair defined:
"optional_args": {"port": 8443}
4b. Create a new function named... | 2.515625 | 3 |
zeusproject/templates/app/users/controllers.py | zerossB/zeus | 6 | 12794478 | # -*- coding: utf-8 -*-
"""
{{NAMEPROJECT}}.users.controllers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{{NAME}} user controllers module
:copyright: (c) {{YEAR}} by {{AUTHOR}}.
:license: BSD, see LICENSE for more details.
"""
from flask import current_app, render_template, Blueprint
from flask_security im... | 2.015625 | 2 |
src/pi_drone_server/app.py | JoshuaBillson/PiDroneServer | 0 | 12794479 | # Ros Client
import rospy
# Standard Python Libraries
import threading
import os
import time
# Messages
from geometry_msgs.msg import Twist
# Third Party Libraries
from flask import Flask, request, Response
from pi_drone_server.html import html
from pi_drone_server.camera import Camera
# Globals
current_speed = 0
c... | 2.515625 | 3 |
tests/test_reporter_advanced_ogr.py | dersteppenwolf/registrant | 42 | 12794480 | <reponame>dersteppenwolf/registrant<filename>tests/test_reporter_advanced_ogr.py
# -*- coding: UTF-8 -*-
"""Advanced tests generating html files for a geodatabase.
Geodatabase contains domains, tables, and feature classes.
This test case is supposed to be run with a Python installation
that have GDAL installed because... | 2.28125 | 2 |
links.py | wbrpisarev/barefoot_weather_server | 0 | 12794481 | # -*- mode:python; coding:utf-8; -*-
from sqlalchemy import create_engine
from html_templates import html_begin, html_end, html_links_li
from mysql import mysql_connect_data
__all__ = ["links"]
def links(lang, connect_data=mysql_connect_data):
e = create_engine(connect_data)
if lang not in ("ru", "en"):
... | 2.65625 | 3 |
zepid/calc/__init__.py | darrenreger/zEpid | 0 | 12794482 | from .utils import (risk_ci, incidence_rate_ci, risk_ratio, risk_difference, number_needed_to_treat, odds_ratio,
incidence_rate_ratio, incidence_rate_difference, attributable_community_risk,
population_attributable_fraction, probability_to_odds, odds_to_probability, counternull_p... | 0.984375 | 1 |
storage/storage_item.py | DiPaolo/watchdog-yt-uploader | 0 | 12794483 | # represents items that used by Storage;
# can be either a directory or media file, or non-media file
import abc
import hashlib
import os
import uuid
from enum import Enum
class StorageItemStatus(Enum):
UNKNOWN = 'Unknown'
ON_TARGET = 'On Target'
UPLOADING = 'Uploading'
UPLOAD_FAILED = 'Upload Failed'... | 2.8125 | 3 |
AES/AESCipherText.py | HolzerSoahita/Cracking_code_python | 1 | 12794484 | from aes import AES
from hmac import new as new_hmac, compare_digest
from hashlib import pbkdf2_hmac
import os
AES_KEY_SIZE = 16
HMAC_KEY_SIZE = 16
IV_SIZE = 16
SALT_SIZE = 16
HMAC_SIZE = 32
def get_key_iv(password, salt, workload=100000):
"""
Stretches the password and extracts an AES key, an HMAC key and ... | 3.296875 | 3 |
scripts/lastdata.py | winkste/rki2_scraper | 0 | 12794485 | celle_last_inc =121.53
noh_last_inc =73.25 | 0.605469 | 1 |
insta/tests.py | chriskaringeg/CRIMMZ-GRAM | 0 | 12794486 | from django.test import TestCase
from .models import Image,Profile
from django.contrib.auth.models import User
# Create your tests here.
class ProfileTestCase(TestCase):
# SetUp method
def setUp(self):
#creating a user instance
self.user = User(username="chris",email="<EMAIL>"... | 2.625 | 3 |
tests/test_dummy.py | rmflight/GOcats | 10 | 12794487 | import pytest
def test_run_script():
# run 1
# run 2
# assert
assert 1 == 1
| 1.625 | 2 |
metareserve_geni/internal/gni/py2/util/geni_util.py | MariskaIJpelaar/metareserve-GENI | 3 | 12794488 | import geni.util
def get_context():
try:
return geni.util.loadContext()
except IOError as e: # File not found. No credentials loaded?
print('ERROR: Could not load context: ', e)
print('''Are there any credentials available? If not, check
https://docs.emulab.net/geni-lib/intro/creden... | 2.28125 | 2 |
src/data/data_parsers.py | kanmaytacker/heart-net | 0 | 12794489 | <reponame>kanmaytacker/heart-net
import os
import h5py
from click import progressbar
import numpy as np
def read_skeleton_file(file_path: str):
with open(file_path, 'r') as f:
skeleton_sequence = {'numFrame': int(f.readline()), 'frameInfo': []}
for _ in range(skeleton_sequence['numFrame']):
... | 2.625 | 3 |
DataLoader.py | sgrieve/SpatialEFD | 2 | 12794490 | import numpy as np
def LoadData(FileName):
'''
Loads hollow data into structured numpy array of floats and returns a tuple
of column headers along with the structured array.
'''
data = np.genfromtxt(FileName, names=True, delimiter=',')
return data.dtype.names, data
def SegmentDataByAspect(F... | 3.328125 | 3 |
fjlt/__init__.py | gabobert/fast-jlt | 8 | 12794491 | import os
from .version import __version__
def get_include():
''' Path of cython headers for compiling cython modules '''
return os.path.dirname(os.path.abspath(__file__))
| 1.640625 | 2 |
extra-packages/pyperl-1.0.1d/t/wantarray.py | UfSoft/ISPManCCP | 0 | 12794492 | <filename>extra-packages/pyperl-1.0.1d/t/wantarray.py
import perl
#if perl.MULTI_PERL:
# print "1..0"
# raise SystemExit
print "1..11"
perl.eval("""
sub foo {
if (wantarray) {
return "array";
}
elsif (defined wantarray) {
return "scalar";
}
else {
return;
}
}
""")
foo = pe... | 2.453125 | 2 |
PythonExercicios/Mundo 2/8_estrutura_de_repeticao_for/ex050.py | GuilhermoCampos/Curso-Python3-curso-em-video | 0 | 12794493 | <gh_stars>0
d = 0
co = 0
for c in range(1, 7):
valor = int(input('Digite o {}º Valor: '.format(c)))
if valor % 2 == 0:
d += valor
co += 1
print('Você informou {} números PARES e a soma foi {}'.format(co, d))
| 3.53125 | 4 |
lib/datasets/interior_net.py | tim885/DeepDepthRefiner | 4 | 12794494 | import os
from os.path import join
import cv2
import pickle
import torch
import numpy as np
import pandas as pd
import torch.utils.data as data
class InteriorNet(data.Dataset):
def __init__(self, root_dir, label_name='_raycastingV2',
pred_dir='pred', method_name='sharpnet_pred',
... | 2.359375 | 2 |
gui/arena/arena_editor.py | Flipajs/FERDA | 1 | 12794495 | <gh_stars>1-10
__author__ = 'dita'
from PyQt4 import QtGui, QtCore
import cv2
import sys
import math
import numpy as np
from core.project.project import Project
from gui.img_controls import gui_utils
from gui.arena.my_ellipse import MyEllipse
from gui.arena.my_view import MyView
class ArenaEditor(QtGui.QDialo... | 2.203125 | 2 |
tests/test_fitter.py | jmeyers314/danish | 0 | 12794496 | <reponame>jmeyers314/danish
import os
import pickle
import time
from scipy.optimize import least_squares
import numpy as np
import batoid
import danish
from test_helpers import timer
directory = os.path.dirname(__file__)
LSST_obsc_radii = {
'M1_inner': 2.5580033095346875,
'M2_outer': 4.502721059044802,
... | 1.8125 | 2 |
scripts/update_songs_assets.py | theastropath/turbot | 10 | 12794497 | #!/usr/bin/env python3
from pathlib import Path
import requests
from bs4 import BeautifulSoup
page = requests.get(
"https://animalcrossing.fandom.com/wiki/K.K._Slider_song_list_(New_Horizons)"
)
tree = BeautifulSoup(page.content, "lxml")
with open(Path("src") / "turbot" / "assets" / "songs.csv", "w", newline="... | 3.15625 | 3 |
konversi_suhu.py | salimsuprayogi/program_dasar_python | 1 | 12794498 | <gh_stars>1-10
import os
def main():
# rumus yang digunakan C = 5 * (F-32)/9
# menampilkan informasi program
print("Konversi Suhu dari Fahrenheit ke Celcius)\n")
# input suhu dalam fahrenheit
f = float(input("Masukan suhu (Fahrenheit): "))
# melakukan konversi suhu ke Celcius
c = 5 * (f-... | 3.5625 | 4 |
tests/vcf_chunker_test.py | oxfordfun/minos | 14 | 12794499 | import filecmp
import shutil
import os
import unittest
import cluster_vcf_records
from minos import vcf_chunker
this_dir = os.path.dirname(os.path.abspath(__file__))
data_dir = os.path.join(this_dir, "data", "vcf_chunker")
class TestVcfChunker(unittest.TestCase):
def test_total_variants_and_alleles_in_vcf_dict... | 2.359375 | 2 |
reth/reth/algorithm/dqn/__init__.py | sosp2021/Reth | 0 | 12794500 | from .dqn_solver import DQNSolver
| 1.039063 | 1 |
labs/03_neural_recsys/movielens_paramsearch_results.py | soufiomario/labs-Deep-learning | 1,398 | 12794501 | <filename>labs/03_neural_recsys/movielens_paramsearch_results.py
import pandas as pd
from pathlib import Path
import json
def load_results_df(folder='results'):
folder = Path(folder)
results_dicts = []
for p in sorted(folder.glob('**/results.json')):
with p.open('r') as f:
results_dicts... | 2.90625 | 3 |
src/KnotTheory/HFK-Zurich/simplify/fastUnknot2.py | craigfreilly/masters-project-submission | 0 | 12794502 | <filename>src/KnotTheory/HFK-Zurich/simplify/fastUnknot2.py
import RectDia
import FastRectDiag
from RectDia import RectDia
from FastRectDiag import FastRectDiag
import profile
def printHistory(diag):
tmp=diag
while(1):
## if tmp.isdestabilisable()!=0 :print tmp.isdestabilisable()
## print... | 2.796875 | 3 |
src/compiler/build.py | glgomes/clonebuilder | 1 | 12794503 | # -*- coding: UTF-8 -*-
"""
@author rpereira
Apr 10, 2012
Controle do build, extract feito de funções do legado.
"""
import legacy.makefile as mkfile
from legacy.compiler_builder import CompilerBuilder
import legacy.futil as futil
import wx
import string
import re
from controller.front import FrontCo... | 2.203125 | 2 |
radiopadre_kernel/js9/__init__.py | ratt-ru/radiopadre | 9 | 12794504 | <gh_stars>1-10
import os, os.path, traceback
from iglesia.utils import message, error
# init JS9 configuration
# js9 source directory
DIRNAME = os.path.dirname(__file__)
JS9_DIR = None
JS9_ERROR = os.environ.get("RADIOPADRE_JS9_ERROR") or None
JS9_HELPER_PORT = None
# Javascript code read from local settings file
JS... | 2.171875 | 2 |
setup.py | Ravindrasaragadam/Tweeter-Sentiment-Analysis | 0 | 12794505 | <gh_stars>0
from cx_Freeze import setup, Executable
base = None
executables = [Executable("Analysis.py", base=base)]
packages = ["idna"]
options = {
'build_exe': {
'packages': packages,
},
}
setup(
name="Tweeter Sentiment Analysis",
options=options,
version="1.0",
description='Tweete... | 1.421875 | 1 |
aerokit/aero/riemann.py | PierreMignerot/aerokit | 0 | 12794506 | <reponame>PierreMignerot/aerokit
# backward compatibility
from aerokit.instance.riemann import * | 0.683594 | 1 |
auxiliary/simulation_study.py | marclipfert/student-project-antonia-marc | 0 | 12794507 | <reponame>marclipfert/student-project-antonia-marc<filename>auxiliary/simulation_study.py
#*************************** SMALL SIMULATION STUDY *****************************
#************* TIME-VARYING TREATMENT: MOVE UP CONCEPTIONS IN TIME **************
import numpy as np
import pandas as pd
import math as math
impor... | 2.546875 | 3 |
setup.py | iterativo-git/pycybersource | 0 | 12794508 | #!/usr/bin/env python
"""
A light wrapper for Cybersource SOAP Toolkit API
"""
import os
import sys
from setuptools import setup, find_packages
import pycybersource
# fix permissions for sdist
if 'sdist' in sys.argv:
os.system('chmod -R a+rX .')
os.umask(int('022', 8))
base_dir = os.path.dirname(__file__)
w... | 1.398438 | 1 |
dailyfresh/apps/goods/views.py | litaiji/dailyfresh | 0 | 12794509 | <reponame>litaiji/dailyfresh<filename>dailyfresh/apps/goods/views.py
from django.shortcuts import render
# Create your views here.
from django.views.generic import View
from django.core.cache import cache
from django_redis import get_redis_connection
from goods.models import GoodsType
from goods.models import IndexGoo... | 2.140625 | 2 |
CreateCommunities.py | EUDAT-Training/B2FIND-Training | 7 | 12794510 | #!/usr/bin/env python
import sys, os, optparse, time
from os.path import expanduser
PY2 = sys.version_info[0] == 2
if PY2:
from urllib import quote
from urllib2 import urlopen, Request
from urllib2 import HTTPError,URLError
else:
from urllib import parse
from urllib.request import urlopen, Request
... | 2.15625 | 2 |
Python 3 Programming/ex_5_8.py | ElizaLo/Practice-Python | 5 | 12794511 | <reponame>ElizaLo/Practice-Python<filename>Python 3 Programming/ex_5_8.py
import turtle
import math
wn = turtle.Screen()
wn.bgcolor("SkyBlue")
bob = turtle.Turtle()
bob.right(90)
for _ in range(4):
bob.forward(50)
bob.left(90)
bob.right(225)
distance = math.sqrt(50*50 / 2)
bob.forward(distance)
bob.right(90)
bo... | 3.921875 | 4 |
bin/ipynb2rst.py | albapa/QUIP | 229 | 12794512 | #!/usr/bin/env python3
import sys
import os
import glob
if len(sys.argv[1:]) == 0:
dirs = [os.getcwd()]
else:
dirs = sys.argv[1:]
for dir in dirs:
for notebook in glob.glob(os.path.join(dir, '*.ipynb')):
cmd = 'ipython nbconvert --to rst {0}'.format(notebook)
print(cmd)
os.system(... | 2.453125 | 2 |
DBP/models/user.py | Pusnow/DB-Project | 0 | 12794513 | #-*- coding: utf-8 -*-
from DBP.models import Base,session
from sqlalchemy import Column, Integer, Unicode, Enum, Date, String
from sqlalchemy import Table, ForeignKey, PrimaryKeyConstraint
from sqlalchemy.sql.expression import label
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
from datetim... | 2.4375 | 2 |
doors-detector/doors_detector/evaluators/model_evaluator.py | micheleantonazzi/master-thesis-robust-door-detector | 0 | 12794514 | from abc import abstractmethod
from typing import List, Dict
from src.bounding_box import BoundingBox
from src.utils.enumerators import BBType, BBFormat
import torch.nn.functional as F
class ModelEvaluator:
def __init__(self):
self._gt_bboxes = []
self._predicted_bboxes = []
self._img_cou... | 2.359375 | 2 |
publishstatic/management/commands/storage/s3.py | scuml/publishstatic | 1 | 12794515 | <filename>publishstatic/management/commands/storage/s3.py
import boto
from ..common import get_required_env_variable
class S3Storage(object):
def __init__(self, bucket=None):
"""
Establish connections.
Assume credentials are in environment or
in a config file.
"""
... | 2.75 | 3 |
pkgs/numba-0.24.0-np110py27_0/lib/python2.7/site-packages/numba/errors.py | wangyum/anaconda | 0 | 12794516 | """
Numba-specific errors and warnings.
"""
from __future__ import print_function, division, absolute_import
import contextlib
from collections import defaultdict
import warnings
# Filled at the end
__all__ = []
class NumbaWarning(Warning):
"""
Base category for all Numba compiler warnings.
"""
class... | 2.484375 | 2 |
pyroscope/__init__.py | pyroscope-io/pyroscope-python | 9 | 12794517 | from collections import namedtuple
from contextlib import contextmanager
from pyroscope import agent
Config = namedtuple('Config', ('app_name', 'server_address',
'auth_token', 'sample_rate', 'with_subprocesses', 'log_level'))
class PyroscopeError(Exception):
pass
def configure(app_name, se... | 2.515625 | 3 |
06. Python Essentials/04. For Loops/08. Number sequence.py | tdrv90/softuni-courses | 0 | 12794518 | <filename>06. Python Essentials/04. For Loops/08. Number sequence.py<gh_stars>0
numbers = []
count_of_nums = int(input())
for i in range(count_of_nums):
n = int(input())
numbers.append(n)
print(f'Max number: {max(numbers)}')
print(f'Min number: {min(numbers)}')
| 3.953125 | 4 |
p019.py | piohhmy/euler | 0 | 12794519 | <reponame>piohhmy/euler
"""
1 Jan 1900 was a Monday.
Thirty days has September, April, June and November.
All the rest have thirty-one,
Saving February alone, Which has twenty-eight, rain or shine.
And on leap years, twenty-nine.
A leap year occurs on any year evenly divisible by 4, but not on a century unless it is d... | 3.828125 | 4 |
cogs/Exchange.py | 34-Matt/Trickster | 0 | 12794520 | import discord
from discord.ext import commands
from forex_python.converter import CurrencyRates,CurrencyCodes
from datetime import date
class Exchange(commands.Cog):
def __init__(self,bot):
self.bot = bot
self.exchangeNames = {
"EUR":["eur","euro member countries"],
"IDR":... | 2.734375 | 3 |
test/test_quadrature.py | mmechelke/bayesian_xfel | 0 | 12794521 | <reponame>mmechelke/bayesian_xfel
import unittest
from bxfel.orientation.quadrature import GaussSO3Quadrature, ChebyshevSO3Quadrature
import numpy as np
class TestGauss(unittest.TestCase):
def test_init(self):
g = GaussSO3Quadrature(1)
self.assertEqual(g.m, 4)
self.assertTrue(g._R is not... | 2.46875 | 2 |
utils/nms_wrapper.py | songheony/MOTDT | 0 | 12794522 | <reponame>songheony/MOTDT<filename>utils/nms_wrapper.py
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import torch
from torc... | 1.742188 | 2 |
metrics/metrics_interface.py | DominikSpiljak/imdb-review-classifier | 0 | 12794523 | <gh_stars>0
class Metric:
def initialize(self):
pass
def log_batch(self, predicted, ground_truth):
pass
def compute(self):
pass
| 1.554688 | 2 |
venv/Lib/site-packages/timingsutil/stopwatch.py | avim2809/CameraSiteBlocker | 0 | 12794524 | # encoding: utf-8
import logging_helper
from .timeout import TimersBase
logging = logging_helper.setup_logging()
class Stopwatch(TimersBase):
def __init__(self,
high_precision=None):
super(Stopwatch, self).__init__(high_precision=high_precision)
self.reset()
def reset(sel... | 3.015625 | 3 |
pycap/ping.py | Blueswing/pycap | 0 | 12794525 | import select
import socket
import struct
import time
import uuid
from collections import deque
from .icmp import parse_icmp_packet
from .ip import get_ip_address, parse_ipv4_packet
_FMT_ICMP_PACKET = '>BBHHH'
def chesksum(data):
n = len(data)
m = n % 2
sum_ = 0
for i in range(0, n - m, 2):
... | 2.5625 | 3 |
runtime/data/script/__make_require_graph.py | CrueLu/elonafoobar | 1 | 12794526 | from glob import glob
import re
require_pattern = re.compile(r'\brequire\("(.*)"\)')
print("digraph require_graph {")
for path in glob("**/*.lua", recursive=True):
with open(path) as f:
caller = path.replace(".lua", "").replace("/", ".")
caller_node = caller.replace(".", "__")
print(f" {... | 2.78125 | 3 |
Flopy_Tutorial1_Cheq.py | akurnizk/diked_hr_estuary_gw | 0 | 12794527 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 29 15:47:36 2018
@author: akurnizk
"""
import flopy
import numpy as np
import sys,os
import matplotlib.pyplot as plt
# Location of BitBucket folder containing cgw folder
cgw_code_dir = 'E:\python'
sys.path.insert(0,cgw_code_dir)
from cgw.utils import ge... | 2.3125 | 2 |
oracle/modules/reddit.py | Toofifty/Oracle2 | 1 | 12794528 | """
Oracle 2.0 IRC Bot
reddit.py plugin module
http://toofifty.me/oracle
"""
import urllib, json
from format import BOLD, RESET
def _init(bot):
print '\t%s loaded' % __name__
def parsereddit(l, b, i):
"""
!d Parse a Reddit link into it's information
!a <link>
!r user
"""
def parselink(li... | 2.921875 | 3 |
scraper.py | adnanalimurtaza/tripadvisor_data_scraper | 1 | 12794529 | <reponame>adnanalimurtaza/tripadvisor_data_scraper<filename>scraper.py<gh_stars>1-10
# importing libraries
from bs4 import BeautifulSoup
import urllib
import os
import urllib.request
base_path = os.path.dirname(os.path.abspath('__file__'))
file = open(os.path.expanduser(r""+base_path+"/datasets/Hotels_Reviews.cs... | 3.078125 | 3 |
tasks/__init__.py | vladcorneci/golden-gate | 262 | 12794530 | # Copyright 2017-2020 Fitbit, Inc
# SPDX-License-Identifier: Apache-2.0
"""
Invoke configuration for Golden Gate
"""
# First check that we are running in a Python >= 3.5 environment
from __future__ import print_function
import sys
if not sys.version_info.major == 3 and sys.version_info.minor >= 5:
print(
"""You a... | 1.929688 | 2 |
pynos/versions/ver_7/ver_7_1_0/yang/brocade_arp.py | bdeetz/pynos | 12 | 12794531 | #!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_arp(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def hide_arp_holder_system_max_arp(self, **kwargs):
"""Auto Generated Code
"""
... | 2.546875 | 3 |
04_test_automation/nose/bisiesto.py | twiindan/api_lessons | 0 | 12794532 |
def es_bisiesto(year):
if not isinstance(year, int):
return "Error: Should be a integer"
if year < 0:
return "Error: Should be a positive number"
if year % 100 == 0:
if year % 400 == 0:
return 'Is leap year'
else:
return 'Is not leap year'
eli... | 3.84375 | 4 |
cogs/utility.py | BRAVO68WEB/Zarena | 0 | 12794533 | import discord
from discord.ext import commands
import aiohttp
import sys
import time
import googletrans
import functools
class utility:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def avatar(self, ctx, *, member: discord.Member = None):
if member is None:
em... | 2.84375 | 3 |
tests/test_wrangling.py | BlaneG/CAN-income-stats | 0 | 12794534 | import pandas as pd
import numpy as np
import pytest
from ..wrangling import (
subset_plot_data_for_income_bins,
subset_plot_data_for_scatter_plot,
subset_year_age_sex_geo
)
def test_subset_plot_data_for_income_bins():
expected_result = {'Age group': {598748: '35 to 44 years',
... | 2.46875 | 2 |
blackstone/rules/citation_rules.py | goro53467/Blackstone | 541 | 12794535 | CITATION_PATTERNS = [
{
"label": "GENERIC_CASE_CITATION",
"pattern": [
{"IS_BRACKET": True, "OP": "?"},
{"SHAPE": "dddd"},
{"IS_BRACKET": True, "OP": "?"},
{"LIKE_NUM": True, "OP": "?"},
{"TEXT": {"REGEX": "^[A-Z]"}, "OP": "?"},
... | 1.65625 | 2 |
release/src-rt-6.x.4708/router/samba3/source4/scripting/python/samba/provision/__init__.py | zaion520/ATtomato | 2 | 12794536 |
# Unix SMB/CIFS implementation.
# backend code for provisioning a Samba4 server
# Copyright (C) <NAME> <<EMAIL>> 2007-2010
# Copyright (C) <NAME> <<EMAIL>> 2008-2009
# Copyright (C) <NAME> <<EMAIL>> 2008-2009
#
# Based on the original in EJS:
# Copyright (C) <NAME> <<EMAIL>> 2005
#
# This program is free software; yo... | 1.789063 | 2 |
oc/data.py | wearelumenai/flowclus | 0 | 12794537 | import flowsim.client as c
get_chunk = c.get_chunk(port=8080)
| 1.320313 | 1 |
sal_ui.py | dvneeseele/SimpleAnimeLibrary | 0 | 12794538 | <filename>sal_ui.py<gh_stars>0
#############################################################################
# dvneeseele
#############################################################################
import os
import sys
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt, QSize
from PyQt5 import QtCore
from Py... | 2.28125 | 2 |
PhotoManagementSystem/PhotoManager/Library/facep.py | 39M/PhotoTheater | 1 | 12794539 | # -*- coding: utf-8 -*-
# vim:fenc=utf-8
import requests
API_KEY = '<KEY>'
API_SECRET = '<KEY>'
API_URL = 'http://apicn.faceplusplus.com'
def detect(path):
data = {
'api_key': API_KEY,
'api_secret': API_SECRET,
}
files = {
'img': open(path, 'rb'),
}
r = requests.post(API_... | 2.671875 | 3 |
grasshopper/__init__.py | aholyoke/grasshopper | 0 | 12794540 | from .framework import Framework
| 1.117188 | 1 |
bot.py | joonsauce/sus-bot | 1 | 12794541 | <reponame>joonsauce/sus-bot<gh_stars>1-10
# links the main bot file with the other feature files
# links to the redesigned help command
from help import *
# links to the random sus meme feature
from redditAPI import *
# links to the roll features
from roll import *
# links to the various bot settings
from setti... | 2.1875 | 2 |
kostalpiko/const.py | rcasula/KostalPyko | 0 | 12794542 | <reponame>rcasula/KostalPyko
BASE_INDICES = {
"current_power": 0,
"total_energy": 1,
"daily_energy": 2,
"string1_voltage": 3,
"l1_voltage": 4,
"string1_current": 5,
"l1_power": 6,
}
SINGLE_STRING_INDICES = {
**BASE_INDICES,
"status": 7
}
DOUBLE_STRING_INDICES = {
**BASE_INDICES... | 1.453125 | 1 |
bokeh/util/api.py | areaweb/bokeh | 1 | 12794543 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | 1.671875 | 2 |
Server/app/docs/v2/admin/excel/__init__.py | moreal/DMS-Backend | 27 | 12794544 | <filename>Server/app/docs/v2/admin/excel/__init__.py
from app.docs.v2 import jwt_header
def generate_excel_doc(type):
return {
'tags': ['[Admin] 신청 정보'],
'description': '{}신청 정보를 다운로드합니다.'.format(type),
'parameters': [jwt_header],
'responses': {
'200': {
... | 2.140625 | 2 |
imgprocess.py | Xanadu12138/DSCN-superpixels | 4 | 12794545 | # Functions of img processing.
from functools import total_ordering
import config
import numpy as np
import copy
import torch
import cv2
from skimage.color import rgb2gray
from XCSLBP import XCSLBP
def extractPixelBlock(originalImg, labels):
'''
input_param:
originalImg: Original pixels matrix that sq... | 2.96875 | 3 |
python/DeepSeaSceneLighting/Convert/LightSetConvert.py | akb825/DeepSea | 5 | 12794546 | # Copyright 2020 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | 2.75 | 3 |
cookbook/data_structures/keep_last_items.py | brittainhard/py | 0 | 12794547 | """
Deque is double-ended-queue. Lets you append and prepend to a list. Faster at
finding stuff I guess?
It is O(1) of memory use when inserting or popping, but lists are O(N).
"""
from collections import deque
def search(lines, pattern, history=5):
previous_lines = deque(maxlen=history)
for line in lines:
... | 3.984375 | 4 |
Dalitz_simplified/optimisation/miranda/miranda_eval.py | weissercn/MLTools | 0 | 12794548 | <filename>Dalitz_simplified/optimisation/miranda/miranda_eval.py<gh_stars>0
"""
This script can be used to get the p value for the Miranda method (=chi squared). It takes input files with column vectors corresponding to
features and lables.
"""
print(__doc__)
import sys
sys.path.insert(0,'../..')
import os
from s... | 2.703125 | 3 |
backend/util/response/search_products_results/__init__.py | willrp/willstores-ws | 4 | 12794549 | <reponame>willrp/willstores-ws<filename>backend/util/response/search_products_results/__init__.py
from .search_products_results_response import SearchProductsResultsResponse
from .search_products_results_schema import SearchProductsResultsSchema
| 1.21875 | 1 |
tests/pyspark/wranglers/test_interval_identifier.py | TobiasRasbold/pywrangler | 14 | 12794550 | """This module contains tests for pyspark interval identifier.
isort:skip_file
"""
import pandas as pd
import pytest
from pywrangler.util.testing import PlainFrame
pytestmark = pytest.mark.pyspark # noqa: E402
pyspark = pytest.importorskip("pyspark") # noqa: E402
from tests.test_data.interval_identifier import (
... | 2.828125 | 3 |