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 |
|---|---|---|---|---|---|---|
rumor/upstreams/aws.py | SudoQ/rumor | 1 | 12764351 | import json
import math
from datetime import datetime, timedelta
from decimal import Decimal
from typing import Any, Dict, List
import boto3
import boto3.dynamodb.types
from boto3.dynamodb.conditions import Attr
from logzero import logger
def send_messages(messages: List[Dict[str, str]], queue_name: str,
... | 1.921875 | 2 |
awwardapp/views.py | mornicamwende/ranker | 0 | 12764352 | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
# from geelweb.django... | 2.03125 | 2 |
Python/bankbalance.py | BlackTimber-Labs/DemoPr | 10 | 12764353 | class Bank:
def __init__(self,owner,balance):
self.owner=owner
self.balance=balance
def deposit(self,d):
self.balance=d+self.balance
print("amount : {}".format(d))
print("deposit accepted!!")
return self.balance
def withdraw(self,w):
... | 3.703125 | 4 |
2-EstruturaDeDecisao/ex--14/main.py | dev-everaldo-cyrino/PythonBrasil | 0 | 12764354 | <filename>2-EstruturaDeDecisao/ex--14/main.py
dt = input('coloque uma data no formato dd/mm/aaaa : ')
try:
if dt[2] == '/' and dt[5] == '/':
dia = int(dt[0]+dt[1])
mes = int(dt[3]+dt[4])
if dia > 31 or mes > 12:
print('invalido, dia ou mes errados')
el... | 3.859375 | 4 |
constants.bzl | maxwellE/bazel-diff | 0 | 12764355 | <reponame>maxwellE/bazel-diff
"""
Various constants used to build bazel-diff
"""
DEFAULT_JVM_EXTERNAL_TAG = "3.3"
RULES_JVM_EXTERNAL_SHA = "d85951a92c0908c80bd8551002d66cb23c3434409c814179c0ff026b53544dab"
BUILD_PROTO_MESSAGE_SHA = "50b79faec3c4154bed274371de5678b221165e38ab59c6167cc94b922d9d9152"
BAZEL_DIFF_MAVEN_... | 0.890625 | 1 |
py/0206.reverse-linked-list.py | ck2w/leetcode | 0 | 12764356 | #
# @lc app=leetcode id=206 lang=python3
#
# [206] Reverse Linked List
#
# https://leetcode.com/problems/reverse-linked-list/description/
#
# algorithms
# Easy (65.21%)
# Likes: 6441
# Dislikes: 123
# Total Accepted: 1.3M
# Total Submissions: 2M
# Testcase Example: '[1,2,3,4,5]'
#
# Given the head of a singly li... | 4.09375 | 4 |
telebot/plugins/sticklol.py | IloveOrbiter/TinyBot | 0 | 12764357 | # (c)2020 TeleBot
# You may not use this file without proper authorship and consent from @TeleBotSupport
#
"""
Available command(s)
.sticklol
Generates a. random laughing sticker.
"""
import random
from telethon import functions, types, utils
from telebot.utils import admin_cmd
def choser(cmd, pack, blacklist=None)... | 2.296875 | 2 |
pages/index.py | Jordan-Ireland/Unit2-Sprint4 | 0 | 12764358 | import dash
import os
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import json
import requests
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
from selenium import webdriver
chrome... | 2.421875 | 2 |
tests/test_board.py | Renaud11232/pyduinocli | 6 | 12764359 | <reponame>Renaud11232/pyduinocli
from . import *
import warnings
class TestBoardCommand(CoreNeedingTest):
def test_attach(self):
warnings.warn("Cannot test attach, it needs special hardware to be connected.")
def test_details(self):
details = self._arduino.board.details("arduino:avr:mega")["... | 2.78125 | 3 |
actions/macro/train/ultralisk_creation.py | Matuiss2/Greedy_bot | 9 | 12764360 | <gh_stars>1-10
"""Everything related to training ultralisks goes here"""
from sc2.constants import UnitTypeId, UpgradeId
class UltraliskCreation:
"""Good for now but it might need to be changed vs particular enemy units compositions"""
def __init__(self, main):
self.main = main
async def should_... | 2.03125 | 2 |
tests/generate_examples.py | hsolbrig/avidreader | 3 | 12764361 | <reponame>hsolbrig/avidreader<gh_stars>1-10
import os
from hbreader import FileInfo, hbopen, hbread
# This removes any absolute paths from the output -- not generally used
FileInfo.rel_offset = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))
# Open a vanilla file
metadata = FileInfo()
with hbopen('.... | 2.703125 | 3 |
rest_auth/serializers.py | recamshak/django-rest-auth | 0 | 12764362 | <reponame>recamshak/django-rest-auth
from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
try:
from django.utils.http import urlsafe_base64_decode as uid_decoder
except:
# make compatible with django 1.5
from... | 2.25 | 2 |
src/validx/py/pipelines.py | Cottonwood-Technology/ValidX | 19 | 12764363 | from .. import contracts
from .. import exc
from . import abstract
class AllOf(abstract.Validator):
"""
AND-style Pipeline Validator
All steps must be succeeded.
The last step returns result.
:param Validator \\*steps:
nested validators.
:raises ValidationError:
raised by t... | 2.546875 | 3 |
src/chainmock/__init__.py | ollipa/chainmock | 8 | 12764364 | """Chainmock.
Spy, stub, and mock library for Python and Pytest.
"""
from . import _doctest # imported for side-effects
from ._api import Assert, Mock, mocker
__all__ = [
"Assert",
"Mock",
"mocker",
]
| 1.367188 | 1 |
func_tests/tests/editorganizationtests/edit_organization_data.py | ICT4H/dcs-web | 1 | 12764365 | from framework.utils.common_utils import by_css
from testdata.test_data import url
USERNAME = 'username'
PASSWORD = 'password'
VALID_CREDENTIALS = {USERNAME: "<EMAIL>",
PASSWORD: "<PASSWORD>"}
DATA_WINNERS_ACCOUNT_PAGE = url("/account/")
ORGANIZATION_SECTOR_DROP_DOWN_LIST = by_css("select#id_sect... | 1.960938 | 2 |
gan_train.py | Aitical/ADspeech2face | 1 | 12764366 | <reponame>Aitical/ADspeech2face
import os
import time
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from configs import DATASET_PARAMETERS, NETWORKS_PARAMETERS
from parse_dataset import get_dataset
from models import get_network, SimCLRLoss, SupContrastiveLoss
from utils import M... | 2.15625 | 2 |
custom_rst2s5.py | kumar303/unicode-in-python | 97 | 12764367 | <filename>custom_rst2s5.py<gh_stars>10-100
#!/usr/bin/env python
# kumar: sniped from: http://matt-good.net/files/software-dev-with-trac/rst2s5
# Author: <NAME>
# Contact: <EMAIL>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML slides us... | 2.3125 | 2 |
tfmplugins/utils/eventbased.py | extremq/tfmplugins | 4 | 12764368 | # Copied from https://github.com/Athesdrake/aiotfm/blob/master/aiotfm/client.py
import sys
import asyncio
import traceback
class InvalidEvent(Exception):
"""Exception thrown when you added an invalid event to the client.
An event is valid only if its name begin by 'on_' and it is coroutine.
"""
class EventBased... | 2.78125 | 3 |
randomForestTest.py | vlstyxz/Brain-Computer-Interface-with-Neurosky | 9 | 12764369 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 17 21:24:37 2019
@author: anilosmantur
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 17 20:43:41 2019
@author: anilosmantur
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomFore... | 2.140625 | 2 |
dependencies/FontTools/Lib/fontTools/ttLib/tables/_h_d_m_x.py | charlesmchen/typefacet | 21 | 12764370 | import DefaultTable
import sstruct
import string
hdmxHeaderFormat = """
> # big endian!
version: H
numRecords: H
recordSize: l
"""
class table__h_d_m_x(DefaultTable.DefaultTable):
def decompile(self, data, ttFont):
numGlyphs = ttFont['maxp'].numGlyphs
glyphOrder = ttFont.getGlyphOrder()
dummy, data = s... | 2.640625 | 3 |
capreolus/tests/common_fixtures.py | AlexWang000/capreolus | 1 | 12764371 | <reponame>AlexWang000/capreolus
import pytest
from pathlib import Path
from capreolus.collection import DummyCollection
from capreolus.index import AnseriniIndex
from capreolus import registry
@pytest.fixture(scope="function")
def tmpdir_as_cache(tmpdir, monkeypatch):
monkeypatch.setattr(registry, "CACHE_BASE_PA... | 1.976563 | 2 |
scipy/weave/tests/test_inline_tools.py | ogrisel/scipy | 1 | 12764372 | from __future__ import absolute_import, print_function
from numpy.testing import TestCase, dec, assert_, run_module_suite
from scipy.weave import inline_tools
class TestInline(TestCase):
"""These are long running tests...
Would be useful to benchmark these things somehow.
"""
@dec.slow
def test... | 2.296875 | 2 |
convertmusic/tools/ffmpeg_bin/ffmpeg.py | groboclown/music-uploader | 0 | 12764373 |
import os
import subprocess
import re
BIN_FFMPEG = 'ffmpeg'
def convert(srcfile, outfile, bit_rate, channels, sample_rate, codec, tags, volume=None, verbose=False):
"""
Converts the source file to the outfile with the proper transformations.
Includes the additional tags.
"""
if srcfile == outfil... | 2.875 | 3 |
leetCodeSolutionsPython/bubbleSort.py | hpnog/computingProblems | 0 | 12764374 | <reponame>hpnog/computingProblems<gh_stars>0
# Bubble Sort
#
# Time Complexity: O(n*log(n))
# Space Complexity: O(1)
class Solution:
def bubbleSort(self, array: [int]) -> [int]:
dirty = False
for i in range(len(array)):
for j in range(0, len(array) - 1 - i):
if ar... | 3.8125 | 4 |
instance/env_to_config_shim.py | uk-gov-mirror/alphagov.govuk-shielded-vulnerable-people-service | 3 | 12764375 | import os
ENVIRONMENT = os.environ.get("ENVIRONMENT")
SECRET_KEY = os.environ.get("SECRET_KEY")
ORDNANCE_SURVEY_PLACES_API_KEY = os.environ.get("ORDNANCE_SURVEY_PLACES_API_KEY")
PERMANENT_SESSION_LIFETIME = int(os.environ.get("PERMANENT_SESSION_LIFETIME"))
GA_TRACKING_ID = os.environ.get("GA_TRACKING_ID")
GA_CROSS_DOM... | 2 | 2 |
brainfuck.py | MineRobber9000/pyfiles | 0 | 12764376 | import sys
major = sys.version_info.major
def six(two,three):
return lambda: two if major==2 else three
def newmodule():
if major==2:
return __import__("new").classobj
elif major==3:
return lambda name,base,ns: __import__("types").new_class(name,base,dict(),lambda d: d.update(ns))
def wh(cond,func):
while c... | 2.984375 | 3 |
lph/envs/Baking.py | PhilippeMorere/learning-to-plan-hierarchically | 6 | 12764377 | from lph.envs.AbsEnv import GraphEnv
class BakingEnv(GraphEnv):
"""
Baking environment, making chocolate or sultana cookies
Actions are:
0. Get egg
1. Break egg
2. Whisk egg
3. Pour egg
4. Get flour
... | 2.1875 | 2 |
e2xgrader/exporters/__init__.py | mhwasil/e2xgrader | 0 | 12764378 | <gh_stars>0
from .gradeexporter import GradeTaskExporter, GradeNotebookExporter, GradeAssignmentExporter
from .formexporter import FormExporter | 1.078125 | 1 |
0109.Convert Sorted List to Binary Search Tree/solution.py | zhlinh/leetcode | 0 | 12764379 | <reponame>zhlinh/leetcode<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
*****************************************
Author: zhlinh
Email: <EMAIL>
Version: 0.0.1
Created Time: 2016-03-07
Last_modify: 2016-03-07
******************************************
'''
'''
Given a **singly... | 3.625 | 4 |
speechdb/views.py | bmverhel/dices | 0 | 12764380 | from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.core.paginator import Paginator
from django.db.models import Q, Count, Max
from django.views.generic import ListView, DetailView, TemplateView
from django_filters.views import ... | 2.0625 | 2 |
layers/custom_layers.py | PentaHiggs/fantastic-pancakes | 3 | 12764381 | import tensorflow as tf
from tensorflow.python.framework import ops
import os
dot_slash = os.path.dirname(__file__)
# Making roi_pooling_layer available for import as a library
roi_location = os.path.join(dot_slash, "rpl.so")
op_module = tf.load_op_library(roi_location)
roi_pooling_layer = op_module.roi_pooler
# Mak... | 2.484375 | 2 |
eventex/core/views.py | Golker/wttd | 0 | 12764382 | from django.views.generic import ListView, DetailView
from eventex.core.models import Speaker, Talk
home = ListView.as_view(template_name='index.html', model=Speaker)
speaker_detail = DetailView.as_view(model=Speaker)
talk_list = ListView.as_view(model=Talk)
| 1.921875 | 2 |
repoclone/exceptions.py | pikamachu/pika-repo-batch-clone | 1 | 12764383 | <reponame>pikamachu/pika-repo-batch-clone<filename>repoclone/exceptions.py
# -*- coding: utf-8 -*-
"""
repoclone.exceptions
-----------------------
All exceptions used in the repoclone code base are defined here.
"""
class RepocloneException(Exception):
"""
Base exception class. All Cookiecutter-specific ex... | 1.648438 | 2 |
src/internal_api/v1/__init__.py | hvuhsg/OpenAPIGateway | 1 | 12764384 | <reponame>hvuhsg/OpenAPIGateway
from .v1 import v1
__all__ = ["v1"]
| 0.996094 | 1 |
wpt/websockets/websock_handlers/webkit/unknown-frame-type_wsh.py | gsnedders/presto-testo | 0 | 12764385 | <gh_stars>0
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
pass
def web_socket_transfer_data(request):
for i in range(1, 128):
request.connection.write(chr(i) + str(i) + '\xff')
for i in range(128, 256):
msg = str(i)
request.connection.write(chr(i) ... | 2.453125 | 2 |
tests/test_basis_evaluation.py | jiduque/scikit-fda | 147 | 12764386 |
from skfda.representation.basis import (
FDataBasis, Monomial, BSpline, Fourier, Constant, VectorValued, Tensor)
import unittest
import numpy as np
class TestBasisEvaluationFourier(unittest.TestCase):
def test_evaluation_simple_fourier(self):
"""Test the evaluation of FDataBasis"""
fourier ... | 2.4375 | 2 |
utils/models/train_step.py | sooooner/faster-RCNN | 1 | 12764387 | import tensorflow as tf
import time
from IPython.display import display
from utils.label_generator import classifier_label_generator
def frcnn_train_step(model, train_dataset, train_stage, epochs=1, valid_dataset=None, change_lr=False, rpn_lr=None, cls_lr=None):
if change_lr:
if rpn_lr:
tf.kera... | 2.703125 | 3 |
setup.py | dew-uff/versioned-prov | 1 | 12764388 | <gh_stars>1-10
from setuptools import setup
setup(
name='versioned-prov',
version='1.0.0',
description='Versioned-PROV website dependencies',
url='https://github.com/dew-uff/versioned-prov',
author=('<NAME>, <NAME>, '
'<NAME>, <NAME>'),
author_email='<EMAIL>',
license='MIT',
... | 1.242188 | 1 |
bots/td_crosspost.py | elnuno/reddit_bots | 0 | 12764389 | from time import time, strftime, sleep
import praw
source = 'the_donald'
dest = 'td_uncensored'
log_file = 'td_bot_log.txt'
reddit = praw.Reddit(
client_id='client_id',
client_secret='client_secret',
password='password',
username='username',
user_agent='linux:td_uncensored:0.1 (by /u/username)'
)
... | 2.6875 | 3 |
clustering/mysql_helper.py | marc1404/msc-thesis | 1 | 12764390 | <filename>clustering/mysql_helper.py
import mysql.connector
from dotenv import load_dotenv
import os
load_dotenv(dotenv_path='.env')
def connect():
print('Connecting to MySQL database...')
config = {
'host': os.getenv('MYSQL_HOST'),
'user': os.getenv('MYSQL_USER'),
'password': os.get... | 2.546875 | 3 |
task6.py | SimeonHristov99/SQLEveryDay | 0 | 12764391 | import pandas as pd
averages_df = employee.groupby(by='department').mean()[['salary']]
merged_df = pd.merge(employee, averages_df, how='inner',
left_on='department', right_on=averages_df.index)
merged_df[['department', 'first_name', 'salary_x', 'salary_y']]
| 3.21875 | 3 |
python/iceberg/api/expressions/expression_parser.py | moulimukherjee/incubator-iceberg | 2,161 | 12764392 | <reponame>moulimukherjee/incubator-iceberg
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Vers... | 1.75 | 2 |
DAY_1/SOLUTION_2.py | Malod219/AdventOfCode2019 | 0 | 12764393 | <reponame>Malod219/AdventOfCode2019
inputFile = str(input("Input file"))
f = open(inputFile,"r")
data = f.readlines()
f.close()
runningFuelSum = 0
for line in data:
line = line.replace("\n","")
mass = int(line)
fuelNeeded = (mass//3)-2
runningFuelSum += fuelNeeded
while(fuelNeeded > 0):
fu... | 3.375 | 3 |
blazar/api/v2/controllers/extensions/host.py | takanattie/blazar | 24 | 12764394 | <reponame>takanattie/blazar
# Copyright (c) 2014 Bull.
#
# 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 ... | 1.945313 | 2 |
murano/tests/unit/db/migration/test_migrations_base.py | chenyujie/hybrid-murano | 0 | 12764395 | <filename>murano/tests/unit/db/migration/test_migrations_base.py<gh_stars>0
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp.
# 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 obt... | 1.773438 | 2 |
algo/main.py | xuedong/time-series | 4 | 12764396 | # Fichier permettant de moduler les differentes methodes de clustering
try:
# Import generaux
import numpy as np
import pylab
import sys
import platform
import matplotlib.pyplot as plt
import re
# Import locaux
import kmeans
import rkde
except:
exit(1)
... | 3.171875 | 3 |
main/app.py | anngle/myapp | 0 | 12764397 | <reponame>anngle/myapp
# -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
from flask import Flask, render_template
from main import commands, public, user, admin
from main.extensions import bcrypt, cache, csrf_protect, db, \
debug_toolbar, login_manager, migrate, redis_store, princi... | 2.3125 | 2 |
hive_attention_tokens/chain/consensus/peers.py | imwatsi/hive-attention-tokens | 0 | 12764398 | <filename>hive_attention_tokens/chain/consensus/peers.py
"""Consensus on the state of peer nodes.""" | 1.054688 | 1 |
models/SCADC_networks.py | choyingw/SCADC-DepthCompletion | 9 | 12764399 | <filename>models/SCADC_networks.py
import torch
import torch.nn as nn
from torch.nn import init
import torchvision
import functools
from torch.optim import lr_scheduler
import torch.nn.functional as F
from copy import deepcopy
import numpy as np
import cv2
import collections
import matplotlib.pyplot as plt
from .submod... | 2.21875 | 2 |
worker/imapsync_dummy.py | dolfim/imap2gsuite-migrate | 0 | 12764400 | import os
import time
import subprocess
SOURCE_IMAP_HOST=os.getenv('SOURCE_IMAP_HOST', '')
SOURCE_IMAP_PORT=os.getenv('SOURCE_IMAP_PORT', None)
TARGET_AUTH_FILE=os.getenv('TARGET_AUTH_FILE')
_example_out = r"""
Here is imapsync 1.983 on host 39eb9c59f7a5, a linux system with 0.6/1.9 free GiB of RAM
with Perl 5.28.1 ... | 1.976563 | 2 |
Game/data/tiles/Tile-Trunk.py | joaompinto/2DExplorer | 9 | 12764401 | from Tile import tile
class trunk (tile):
def __init__(self,parentWorld,colRow):
super().__init__(parentWorld,colRow,6,1)
self.durability = 20
self.drop = 6
self.dropAmount = 4
self.physical = False
self.tool = "axe"
def setter(parentWorld, colRow):
x = trunk(pa... | 2.859375 | 3 |
broker/eblocbroker_scripts/process_payment.py | ebloc/ebloc-broker | 3 | 12764402 | <reponame>ebloc/ebloc-broker
#!/usr/bin/env python3
import sys
from typing import Any, Union
from broker import cfg
from broker._utils.tools import log, print_tb
from broker.config import env
from broker.lib import state
from broker.utils import StorageID, ipfs_to_bytes32
def process_payment(
self,
job_key,... | 1.78125 | 2 |
run.py | xucz153/robotautomation | 0 | 12764403 | import os
import fileinput
if os.path.exists("log.txt"):
os.remove("log.txt")
if os.path.exists("log.xml"):
os.remove("log.xml")
os.system("ant build")
os.system("adb push bin/Checker.jar /data/local/tmp/")
for line in fileinput.input("testsuites.txt"):
if len(line.strip()) != 0 :
exeStr = "adb shell uiau... | 2.578125 | 3 |
rnnmorph/test_predictor.py | AliceCyber/rnnmorph | 124 | 12764404 | <reponame>AliceCyber/rnnmorph<filename>rnnmorph/test_predictor.py
import unittest
import logging
import sys
import numpy as np
import nltk
# import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = ""
from rnnmorph.predictor import RNNMorphPredictor
from rnnmorph.tag_genres im... | 2.4375 | 2 |
cncore/laser.py | matthewSorensen/cnc-core | 0 | 12764405 | <gh_stars>0
import svgwrite
import tempfile
import os
import subprocess
# operations:
# * manage file handles
# * manage file conversions transparently
# * colors / laser semantics
# * access to the underlying svg
# * higher-level drawing operations
class LaserOutput:
# This is really only applicable to univers... | 2.59375 | 3 |
source/tools/utils_maintenance/c_sort_blocks.py | simileV/blenderStereo29 | 3 | 12764406 | <reponame>simileV/blenderStereo29
#!/usr/bin/env python3
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at yo... | 1.664063 | 2 |
lib/test/vot20/stark_st50_lt.py | tzhhhh123/Stark | 376 | 12764407 | <filename>lib/test/vot20/stark_st50_lt.py
from lib.test.vot20.stark_vot20lt import run_vot_exp
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '6'
run_vot_exp('stark_st', 'baseline', vis=False)
| 1.53125 | 2 |
digproj/core/migrations/0005_persona.py | mans-18/digest | 0 | 12764408 | # Generated by Django 2.2.4 on 2020-04-18 20:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0004_event'),
]
operations = [
migrations.CreateModel(
... | 1.726563 | 2 |
walltask.py | paecko/walltask | 1 | 12764409 | #!/usr/bin/python3
import ctypes
import os
import sys
import argparse
import json
from PIL import Image, ImageFont, ImageDraw
org_wall = 'wall.jpg'
new_wall = 'task_wall.jpg'
try:
rf = open('data.json', 'r')
# Initial usage of the script will create a json file with all the default settings and a list to store ta... | 3.390625 | 3 |
rust/core/paginator.py | AsiaLi/rust | 5 | 12764410 | <reponame>AsiaLi/rust<filename>rust/core/paginator.py
# -*- coding: utf-8 -*-
import peewee
DEFAULT_COUNT_PER_PAGE = 20
class TargetPage(object):
"""
分页器
"""
__slots__ = (
'__cur_page',
'__count_per_page',
'__total_object_count',
)
def __new__(cls, args):
"""
... | 2.75 | 3 |
sortingalgorithms/allSortingAlgsTimed.py | eduardoquerido/pythonstuffs | 0 | 12764411 | from bubblesort import bubblesort
from heapsort import heapsort
from insertionsort import insertionsort
from mergesort import mergesort
from quicksort import quicksort
from radixsort import radixsort
from selectionsort import selectionsort
from timsort import timsort
from timeit import default_timer as timer
# Bubble... | 3.640625 | 4 |
charbon/main.py | GninninwokyOuattara/open-pharma | 1 | 12764412 | import json
import os
from classes.firebase import InitFirebaseConnection
from firebase_admin import db
from classes.google_maps import GoogleMaps
from classes.pharma_consults import PharmaConsults
from datetime import datetime
from sys import argv
print(argv)
if not argv[1] in ["-fo", "-fa"]:
raise BaseException... | 2.578125 | 3 |
jax_cfd/base/subgrid_models_test.py | ngam/jax-cfd | 244 | 12764413 | <gh_stars>100-1000
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 2.21875 | 2 |
ehmatthes-pcc_2e-078318e/beyond_pcc/chess_game/settings.py | charliechocho/py-crash-course | 12 | 12764414 | class Settings:
def __init__(self):
self.screen_width, self.screen_height = 800, 300
self.bg_color = (225, 225, 225) | 1.8125 | 2 |
lemonshort/views.py | RobbiNespu/lemoncurry | 0 | 12764415 | <reponame>RobbiNespu/lemoncurry
from django.apps import apps
from django.shortcuts import get_object_or_404, redirect
from .convert import abc_to_id
def unshort(request, model, tiny):
entity = get_object_or_404(apps.get_model(model), pk=abc_to_id(tiny))
return redirect(entity, permanent=True)
| 1.984375 | 2 |
venv/lib/python3.8/site-packages/pip/_vendor/cachecontrol/caches/__init__.py | realxwx/leetcode-solve | 0 | 12764416 | <filename>venv/lib/python3.8/site-packages/pip/_vendor/cachecontrol/caches/__init__.py
# Copyright (c) 2020
# Author: xiaoweixiang
from .file_cache import FileCache # noqa
from .redis_cache import RedisCache # noqa
| 1.304688 | 1 |
transcriptome_clustering/pitchfork_paramvary.py | mattsmart/biomodels | 0 | 12764417 | <reponame>mattsmart/biomodels
import matplotlib.pyplot as plt
import numpy as np
import os
import time
from inference import solve_true_covariance_from_true_J
from pitchfork_langevin import jacobian_pitchfork, steadystate_pitchfork, langevin_dynamics
from settings import DEFAULT_PARAMS, PARAMS_ID, FOLDER_OUTPUT, TIMES... | 2.21875 | 2 |
e2e_tests/tests/deploy/test_local.py | trentwatt/determined | 0 | 12764418 | import json
import os
import random
import subprocess
import time
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import List, Optional
import docker
import pytest
from determined.common.api import bindings
from tests import config as conf
from tests import experiment as exp
from ..clust... | 1.882813 | 2 |
src/MapMyNotesApplication/tests/test_module_code.py | Ryan-Gouldsmith/MajorProject-MapMyNotes | 0 | 12764419 | <gh_stars>0
from MapMyNotesApplication import database
from MapMyNotesApplication.models.module_code import ModuleCode
from flask import Flask
from flask.ext.testing import TestCase
class TestNote(TestCase):
def create_app(self):
app = Flask(__name__)
app.config['TESTING'] = True
# http://... | 2.59375 | 3 |
Notes/23-Demo/seed2.py | pedwards95/Springboard_Class | 0 | 12764420 | from models2 import Department, Employee, db
from app2 import app
db.drop_all()
db.create_all()
d1 = Department(dept_code="mktg", dept_name="Marketing",phone="897-9999")
d2 = Department(dept_code="acct", dept_name="Accounting",phone="111-5429")
river = Employee(name="<NAME>", state="NY", dept_code="mktg")
summer = Em... | 2.796875 | 3 |
points2mesh/train.py | Hyde46/pc2mesh | 0 | 12764421 | <filename>points2mesh/train.py
import tensorflow as tf
import numpy as np
import cv2
import argparse
import os
from tensorpack import *
from tensorpack.input_source import QueueInput
from tensorpack.dataflow import (PrintData, BatchData)
from PointCloudDataFlow import get_modelnet_dataflow
from models import *
from fe... | 2.234375 | 2 |
src/engine/SCons/Sig/MD5Tests.py | datalogics-staylor/scons | 3 | 12764422 | <filename>src/engine/SCons/Sig/MD5Tests.py
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, mod... | 2.421875 | 2 |
examples/misc_examples/flatten_mesh.py | SAFedorov/bfieldtools | 17 | 12764423 | # -*- coding: utf-8 -*-
"""
Flatten mesh using conformal mapping
=============================================
Map 3D mesh to a 2D (complex) plane with angle-preserving (conformal) mapping
Based on these course notes
https://www.cs.cmu.edu/~kmcrane/Projects/DDG/
section 7.4.
"""
import numpy as np
fro... | 3.34375 | 3 |
tests/integration/platform/test_core_platforms_async.py | m1009d/scrapli_cfg | 15 | 12764424 | import pytest
@pytest.mark.asyncio
@pytest.mark.scrapli_replay
async def test_get_config(async_cfg_conn):
await async_cfg_conn.prepare()
config = await async_cfg_conn.get_config()
assert config.failed is False
# expected config is loaded from disk and set as an attribute in the fixture to make life ea... | 2.046875 | 2 |
smartsearch/nlp.py | brandonwatts/Capstone | 0 | 12764425 | import re
from smartsearch.matcher import field_matcher, phrase_matcher, zip_matcher
from smartsearch.model import extractions, nlp
from smartsearch.referencer import extract_references
def static_args(**kwargs):
"""This decorator method is used to add static arguments to another method.
The reason we are d... | 3.203125 | 3 |
testcases/csvbarfeed_test.py | tibkiss/pyalgotrade | 2 | 12764426 | <gh_stars>1-10
# PyAlgoTrade
#
# Copyright 2011 <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 l... | 2.125 | 2 |
batchq/contrib/virtualbox/run_testscript.py | troelsfr/BatchQ | 1 | 12764427 | ## Copyright 2012 (c) <NAME>
from batchq.core.errors import CommunicationTimeout
from batchq.pipelines.shell import BashTerminal as LocalMachine
from batchq.pipelines.shell import SSHTerminal as RemoteMachine
from batchq.pipelines.shell.ssh import BaseSecureTerminalHostVerification
from batchq.pipelines.shell import S... | 2.15625 | 2 |
Leetcode/0075. Sort Colors/0075.py | Next-Gen-UI/Code-Dynamics | 0 | 12764428 | <gh_stars>0
class Solution:
def sortColors(self, nums: List[int]) -> None:
zero = -1
one = -1
two = -1
for num in nums:
if num == 0:
two += 1
one += 1
zero += 1
nums[two] = 2
nums[one] = 1
nums[zero] = 0
elif num == 1:
two += 1
... | 3.3125 | 3 |
bcferries/crossing.py | duncmacdonald/bcferries | 11 | 12764429 | <filename>bcferries/crossing.py
from abstract import BCFerriesAbstractObject
from capacity import BCFerriesCapacity
import dateutil.parser
class BCFerriesCrossing(BCFerriesAbstractObject):
def __init__(self, name, row, api):
super(BCFerriesCrossing, self).__init__(self)
self.route_name = name
self._api ... | 2.640625 | 3 |
esd_process/ncei_backend.py | noaa-ocs-hydrography/esd_process | 0 | 12764430 | import os
import sqlite3
import logging
from esd_process import scrape_variables
class BaseBackend:
"""
Base class for backends, must be inherited to use
"""
def __init__(self):
self.output_folder = None
# these attributes are populated during scrape and saved to the backend (databas... | 2.578125 | 3 |
two_sigma_problems/problem_7.py | loftwah/Daily-Coding-Problem | 129 | 12764431 | <reponame>loftwah/Daily-Coding-Problem
"""This problem was asked by Two Sigma.
You’re tracking stock price at a given instance of time.
Implement an API with the following functions: add(), update(), remove(),
which adds/updates/removes a datapoint for the stock price you are tracking.
The data is given as (timesta... | 2.890625 | 3 |
generators/argument_unpacking.py | aTechGuide/python | 0 | 12764432 | <filename>generators/argument_unpacking.py
"""
dictionary unpacking => It unpacks a dictionary as named arguments to a function.
"""
class User:
def __init__(self, username, password):
self.username = username
self.password = password
@classmethod
def from_dict(cls, data):
return cls(data['username... | 4.4375 | 4 |
ipware/__init__.py | wking/django-ipware | 0 | 12764433 | <reponame>wking/django-ipware<filename>ipware/__init__.py
from .ip2 import get_client_ip
default_app_config = 'ipware.apps.IPwareConfig'
__author__ = '<NAME> @ Neekware Inc. [@vneekman]'
__description__ = "A Django application to retrieve user's IP address"
__version__ = '2.0.1'
| 1.789063 | 2 |
Utils/RandamData.py | yasserfaraazkhan/Selenium-Python-Pytest | 0 | 12764434 | import random
class Utils():
@classmethod
def _get_random_alphanumeric_string(cls):
return ''.join(random.choice('ABCDSFGEHIJK123456') for i in range(5))
@classmethod
def _get_random_numeric_string(cls):
return ''.join(random.choice('1234567890') for i in range(10))
@classmethod
... | 3.375 | 3 |
lambda_deployment/wikia/wikia.py | Pizzaface/SpongeBot | 0 | 12764435 | from __future__ import unicode_literals
import requests
import time
import mimetypes
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
from decimal import Decimal
from .exceptions import (
PageError, DisambiguationError, RedirectError, HTTPTimeoutError,
WikiaException, ODD_ERROR_MESSAGE)
from... | 2.640625 | 3 |
tests/context.py | itsdaveba/rubik-solver | 0 | 12764436 | import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import rubik_solver
from rubik_solver.defs import available_moves | 1.492188 | 1 |
gateway/builders/verify_3d_enrollment_builder.py | TransactPRO/gw3-python-client | 1 | 12764437 | # The MIT License
#
# Copyright (c) 2017 Transact Pro.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, m... | 1.820313 | 2 |
python/fibonacci-recursion.py | kirigaine/Notes-and-Programs | 0 | 12764438 | """
*********************************************************
* *
* Project Name: Recursive Fibonacci Sequence *
* Author: github.com/kirigaine *
* Description: A simple program to put in how many *
* numbers of the Fibonac... | 4.1875 | 4 |
temboo/core/Library/Twilio/OutgoingCallerIDs/ListCallerIDs.py | jordanemedlock/psychtruths | 7 | 12764439 | <reponame>jordanemedlock/psychtruths
# -*- coding: utf-8 -*-
###############################################################################
#
# ListCallerIDs
# Returns a list of Outgoing Caller IDs for a Twilio account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache Li... | 1.96875 | 2 |
bejmy/transactions/migrations/0005_auto_20170606_0722.py | bejmy/backend | 0 | 12764440 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-06 07:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('transactions', '0004_auto_20170606_0638'),
]
operations = [
migrations.AddF... | 1.570313 | 2 |
src/basic/web/flask/02using_templates/main.py | hbulpf/pydemo | 6 | 12764441 | <reponame>hbulpf/pydemo
import os
from flask import Flask, request, render_template, Markup
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def demo():
if request.method == 'GET':
return render_template('index.html', input_text = '', res_text = '')
else:
inputText = request.form.get("input_t... | 2.859375 | 3 |
apps/dot_ext/apps.py | dtisza1/bluebutton-web-server | 25 | 12764442 | <gh_stars>10-100
from django.apps import AppConfig
class dot_extConfig(AppConfig):
name = 'apps.dot_ext'
label = 'dot_ext'
verbose_name = 'Django OAuth Toolkit Extension'
def ready(self):
from . import signals # noqa
| 1.429688 | 1 |
eastern/yaml_formatter/formatter.py | tuterdust/eastern | 0 | 12764443 | <reponame>tuterdust/eastern
import logging
import os
import re
from stevedore.driver import DriverManager
from stevedore.exception import NoMatches
from . import utils
from ..plugin import get_plugin_manager
from ..formatter import BaseFormatter
DRIVER_NS = 'eastern.command'
class Formatter(BaseFormatter):
"""... | 2.203125 | 2 |
cla.py | ksIsCute/Rocket | 0 | 12764444 | <gh_stars>0
cla = "TOKEN HERE"
| 0.933594 | 1 |
ion_functions/qc/perf/test_qc_performance.py | steinermg/ion-functions | 10 | 12764445 | <gh_stars>1-10
from ion_functions.data.perf.test_performance import PerformanceTestCase, a_year, a_day
from ion_functions.qc.qc_functions import dataqc_globalrangetest_minmax as grt
from ion_functions.qc.qc_functions import dataqc_spiketest as spiketest
from ion_functions.qc.qc_functions import dataqc_stuckvaluetest as... | 1.78125 | 2 |
simulation/task/visualization/AverageStress.py | SergioML9/tfm | 0 | 12764446 | from mesa.visualization.ModularVisualization import VisualizationElement
import numpy as np
class AverageStress(VisualizationElement):
package_includes = ["Chart.min.js"]
local_includes = ["visualization/AverageStress.js"]
def __init__(self, canvas_height, canvas_width):
self.canvas_height = canva... | 2.53125 | 3 |
backend/instruments/apps.py | codepanda64/logs-and-metas-for-stations | 0 | 12764447 | from django.apps import AppConfig
class InstrumentsConfig(AppConfig):
name = 'instruments'
| 1.101563 | 1 |
evaluation/models.py | JorgeScp/performance | 1 | 12764448 | <filename>evaluation/models.py
from django.db import models
from django.utils import timezone
from django.conf import settings
class Test_Assign(models.Model):
evaluated = models.ForeignKey(
settings.AUTH_USER_MODEL,
blank=True,
null=True,
on_delete=models.CASCADE,
related_n... | 2.40625 | 2 |
main/re-sub-regex-substitution/re-sub-regex-substitution.py | EliahKagan/old-practice-snapshot | 0 | 12764449 | <reponame>EliahKagan/old-practice-snapshot
#!/usr/bin/env python3
import re
AND = re.compile(r'(?<= )&&(?= )')
OR = re.compile(r'(?<= )\|\|(?= )')
for _ in range(int(input())):
print(OR.sub('or', AND.sub('and', input())))
| 3.6875 | 4 |
lomapy/helpers/__init__.py | AlanTaranti/Lomapy | 2 | 12764450 | from .padronizar_resposta import padronizar_resposta_categoria
| 1.25 | 1 |