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 |
|---|---|---|---|---|---|---|
allegroapi/entities/aftersalesserviceconditions.py | OceanFireSoftware/python-allegro | 17 | 45400 | <gh_stars>10-100
# coding=utf-8
"""
The After Sale Service Conditions endpoint
Documentation: https://developer.allegro.pl/documentation/#/
Schema:
"""
from __future__ import unicode_literals
from ..base import BaseApi
from .aftersalesserviceconditionreturnpolicies import AfterSaleServiceConditionReturnPolicies
from... | 1.59375 | 2 |
todo/migrations/0004_rename_list_tasklist.py | Sowmya-1998/https-github.com-shacker-django-todo | 567 | 45401 | <gh_stars>100-1000
# Generated by Django 2.0.2 on 2018-02-09 23:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("auth", "0009_alter_user_last_name_max_length"),
("todo", "0003_assignee_optional"),
]
op... | 1.851563 | 2 |
setup.py | villmow/astyle-py | 0 | 45402 | <filename>setup.py
import os
import pathlib
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext as build_ext_orig
class CMakeExtension(Extension):
def __init__(self, name):
# don't invoke the original build_ext for this special extension
supe... | 2.1875 | 2 |
main.py | faresbs/sign-language-tutor | 0 | 45403 | #
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import webbrowser
import random
from kivy.app import App
from kivy.clock import Clock
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.core.window import Window
from kivy.core.text i... | 2.03125 | 2 |
second.py | cplanck/remote-playground | 0 | 45404 | <gh_stars>0
print('this is the first line of second.py')
for x in range(20):
print(x)
print('this is the chunk of code added to the fourth branch')
print('Im editing this file in GitHub to see if fetch finds it')
print('adding this code to push to the main on the remote repository') | 2.765625 | 3 |
server/server.py | daniiel-morales/dashboard-gt | 0 | 45405 | from http.server import HTTPServer, BaseHTTPRequestHandler
from json import dumps as toJSON
from json import loads as formatJSON
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type', 'application/json')
self.send_... | 2.734375 | 3 |
src/dx/share/property_maker.py | lmmx/dx | 0 | 45406 | from inspect import currentframe
__all__ = ["add_props_to_ns", "add_classprops_to_ns", "classproperty", "props_as_dict"]
def prop_getsetdel(property_name, prefix="_", read_only=False, deletable=False):
internal_attr = prefix + property_name
def prop_getter(internal_attr):
def getter_func(self):
... | 2.171875 | 2 |
scripts/genomes2decoadj.py | danydoerr/spp_dcj | 2 | 45407 | <filename>scripts/genomes2decoadj.py<gh_stars>1-10
#!/usr/bin/env python3
# import from built-in packages
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter as ADHF, FileType
from sys import stdout, stderr, exit
# import from own packages
import data_utils as du
import zombi_utils as zu
if __name__ ... | 2.90625 | 3 |
src/runner-base/runnertools/runnertools/runner_io.py | ads-ad-itcenter/qunomon.forked | 16 | 45408 | <reponame>ads-ad-itcenter/qunomon.forked
import os
import sys
import shutil
import glob
from pathlib import Path
import json
import yaml
# init
QAI_USER_HOME = os.environ['QAI_USER_HOME']
inventory_dir = os.path.join(QAI_USER_HOME, 'inventory/')
# check args
args_file = os.path.join(QAI_USER_HOME, 'args', 'args.json'... | 2.234375 | 2 |
stcloud/models/alert_notification.py | sematext/sematext-api-client-python | 1 | 45409 | # coding: utf-8
"""
Sematext Cloud API
API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`. # noqa: E501
OpenAPI spec version: v3
... | 1.773438 | 2 |
yt_dlp_nao/extractor/sharevideos.py | sheerluck/ytdl-patched | 80 | 45410 | # coding: utf-8
from __future__ import unicode_literals
from ..utils import KNOWN_EXTENSIONS, determine_ext, mimetype2ext, try_get
from .common import InfoExtractor
class ShareVideosIE(InfoExtractor):
IE_NAME = 'sharevideos'
_VALID_URL = r'https?://(?:embed\.)?share-videos\.se/auto/(?:embed|video)/(?P<id>\d+... | 1.976563 | 2 |
findastring.py | Vicfred/hackerrankpython | 1 | 45411 | def count_substring(string, sub_string):
k = len(sub_string)
ans = 0
for i in range(len(string)):
if i+k > len(string):
break
if sub_string == string[i:i+k]:
ans += 1
return ans
if __name__ == '__main__':
string = input().strip()
sub_string = input().stri... | 3.953125 | 4 |
bin/pipeline_python_scripts/filtered_bcf_to_fasta.py | thanhleviet/bactmap | 1 | 45412 | <reponame>thanhleviet/bactmap
#!/usr/bin/env python3
from pysam import VariantFile
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import argparse, sys, os
class ParserWithErrors(argparse.ArgumentParser):
def error(self, message):
print('{0}\n\n'.format(message))
s... | 2.59375 | 3 |
Programming_warmup.py | Databackbone/Automate_the_boring_stuff_with_python | 0 | 45413 | print("Hello World")
my_name = input("Whats your name? ")
print("Hello " + my_name)
print('Did you know that your name is ' + str(len(my_name)) + ' letters long!')
| 4.0625 | 4 |
plotplayer/__init__.py | Jman420/plotplayer | 0 | 45414 | """
Root PlotPlayer Package contains all the data structures, modules and classes used by the
PlotPlayer project.
Public Modules:
* plotplayer - Contains the PlotPlayer interface and functionality; this is the most
common entry point for most usages
Subpackages:
* helpers - Contains various modules containi... | 1.953125 | 2 |
mulm/residualizer/__init__.py | neurospin/pylearn-mulm | 6 | 45415 | # -*- coding: utf-8 -*-
##########################################################################
# Created on Tue Jun 25 13:25:41 2013
# Copyright (c) 2013-2021, CEA/DRF/Joliot/NeuroSpin. All rights reserved.
# @author: <NAME>
# @email: <EMAIL>
# @license: BSD 3-clause.
############################################... | 2.03125 | 2 |
main.py | Sergiogd112/pynote | 0 | 45416 | from copy import copy
import json
import os
import re
from pprint import pprint as print
from typing import Union
import networkx as nx
import numpy as np
from dpath.util import get
from matplotlib import pyplot as plt
def md_to_dict(text, order, n=0, max_depth=100):
try:
maxh = max([x.count("#") for x i... | 2.515625 | 3 |
flow/controllers/car_following_models.py | mark-koren/flow | 0 | 45417 | """
This script contains several car-following control models for flow-controlled
vehicles.
Controllers can have their output delayed by some duration. Each controller
includes functions
get_accel(self, env) -> acc
- using the current state of the world and existing parameters,
uses the control mod... | 3.28125 | 3 |
pset_pandas_ext/101problems/p37.py | mottaquikarim/pydev-psets | 5 | 45418 | """
37. How to get the nrows, ncolumns, datatype, summary stats of each column of a dataframe? Also get the array and list equivalent.
"""
"""
Difficulty Level: L2
"""
"""
Get the number of rows, columns, datatype and summary statistics of each column of the Cars93 dataset. Also get the numpy array and list equivalent ... | 2.578125 | 3 |
src/accounts/api/urls.py | njNafir/blogapi-django | 1 | 45419 | <reponame>njNafir/blogapi-django
from django.urls import path, re_path
from django.contrib import admin
from .views import (
UserCreateAPIView,
UserLoginAPIView
)
urlpatterns = [
re_path(r'^login/$', UserLoginAPIView.as_view(), name='login_api'),
re_path(r'^register/$', UserCreateAPIView.as_view(), name... | 1.726563 | 2 |
bookstore/news/views.py | M0673N/bookstore | 0 | 45420 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect, render
from django.urls import reverse_lazy
from django.views import View
from django.views.generic import ListView, CreateView, DetailView, UpdateView, DeleteView
from bookstore.news.forms import ArticleForm, ArticleComme... | 2.03125 | 2 |
lessons/lab/lesson2.py | VenturaDelMonte/socialnetworks | 0 | 45421 | <filename>lessons/lab/lesson2.py
#!/usr/bin/python
import random
import math
# n is the number of nodes
# r is the radius of each node (a node u is connected with each other node at distance at most r) - strong ties
# k is the number of random edges for each node u - weak ties
def WSGridGraph(n, r, k):
line... | 4.09375 | 4 |
app/graham/training-snakes-master/app/snakes/unused/snake_2.py | CallumBrown743/starter-snake-python | 0 | 45422 | <reponame>CallumBrown743/starter-snake-python<filename>app/graham/training-snakes-master/app/snakes/unused/snake_2.py
from utils.vector import up, down, left, right, noop
from .base_snake import BaseSnake
class Snake2(BaseSnake):
def move(self, gamestate):
current_vector = gamestate.me.current_direction... | 2.984375 | 3 |
tests/test_gp_layer.py | timrudner/snr_issues_in_deep_gps | 5 | 45423 | """
Unchanged from https://github.com/hughsalimbeni/DGPs_with_IWVI/blob/master/tests/test_gp_layer.py
"""
import numpy as np
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.FATAL)
import gpflow
from dgps_with_iwvi.layers import GPLayer
from dgps_with_iwvi.models import DGP_VI
def test_gp_layer():
... | 1.992188 | 2 |
receipt_parser/__init__.py | slgero/check_parser | 48 | 45424 | <reponame>slgero/check_parser
"""A package which allow parsing Reussian receipts."""
__version__ = "0.0.28"
__license__ = "MIT"
from .receipt_parser import RuleBased # type: ignore
from .finder import Finder # type: ignore
from .normalizer import Normalizer # type: ignore
from .cat_model import PredictCategory #... | 1.273438 | 1 |
baseStation/src/ui/domain/subroutine/sightSubroutine.py | olgam4/design3 | 0 | 45425 | <filename>baseStation/src/ui/domain/subroutine/sightSubroutine.py
import tkinter as tk
from tkinter import ttk, messagebox
from remote.domain.commandCallback import CommandCallback
from remote.domain.commandStatus import CommandStatus
from ui.domain.subroutine.iSubroutineRunner import ISubroutineRunner
from ui.domain.... | 2.5 | 2 |
code/mne_website_example.py | hrayatnia/pycon | 1 | 45426 | import mne
raw = mne.io.read_raw_fif('raw.fif', preload=True) # load data
raw.info['bads'] = ['MEG 2443', 'EEG 053'] # mark bad channels
raw.filter(l_freq=None, h_freq=40.0) # low-pass filter data
# Extract epochs and save them:
picks = mne.pick_types(raw.info, meg=True, eeg=True, eog=True,
... | 2.390625 | 2 |
Commons/Variables.py | CT83/PyDashBoard | 0 | 45427 | RESP = []
| 0.984375 | 1 |
Scripts/IDEA_4/Additive_Network.py | dearbornlavern/my-deity | 24 | 45428 | """
The script that creates the neural network architecture based on the concept.txt. The script uses command-line arguments
for specifying the structure of the network and the hyperparameters for the training.
use ->
User:~$ python Additive_Network --help
for the usage information of this module
... | 3.8125 | 4 |
functions.py | QijingMa/COGS18-Final-Project | 0 | 45429 | """A collection of function for doing my project."""
import time
import random
#Background Introduction
def Intro():
print("Hello, how are you doing after the long journey? ")
time.sleep(2)
print("You are now at Pallet Town,Kanto.")
time.sleep(2)
print("A place where is abounded with amazing... | 4 | 4 |
python/high-scores/high_scores_old.py | christine-court/exercism | 0 | 45430 | <reponame>christine-court/exercism<filename>python/high-scores/high_scores_old.py
from unittest.main import main
def latest(scores):
return scores[-1]
def personal_best(scores):
return max(scores)
def personal_top_three(scores):
top_three_scores = []
for i in range(3):
top_three_scores.app... | 2.703125 | 3 |
changelogger/urls.py | zhelyabuzhsky/changelogger | 1 | 45431 | from django.conf.urls import include
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import path
urlpatterns = [
path("", include("changelogs.urls")),
path("admin/", admin.site.urls),
path("accounts/", include("django.contrib.auth.urls")),
path("log... | 1.695313 | 2 |
gorillabot/plugins/info.py | pep7/GorillaBot | 21 | 45432 | <reponame>pep7/GorillaBot
# Copyright (c) 2013-2016 <NAME>
#
# 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,... | 2.03125 | 2 |
rasa_nlu/featurizers/universal_sent_encoder.py | Beeketing/rasa_nlu | 0 | 45433 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import tensorflow as tf
import tensorflow_hub as hub
from rasa_nlu.featurizers import Featurizer
class UniversalSentenceEncoderFeaturizer(Featurizer):
"... | 2.59375 | 3 |
automl_pn/binary_classifier.py | CTPAHH1K/auto-binary-classifier | 0 | 45434 | import pandas as pd
import numpy as np
from automl_pn.utils.models import models_list, MODELS_STR_TO_OBJECT
from automl_pn.utils.metrics import score_func, higher_better
from automl_pn.utils.preprocessor import Preprocessor
from sklearn.model_selection import train_test_split
from joblib import Parallel, delayed
cla... | 2.546875 | 3 |
Mat_Comp/cap3/teste_3.3-SquareWave.py | yuri-pin/Execicios_Python | 0 | 45435 | <reponame>yuri-pin/Execicios_Python<gh_stars>0
from pylab import plot,show
from numpy import linspace,sin
#linspace(a,b,c) tem inicio no ponto 'a' fim no ponto 'b' e é dividido em 'c' partes
x = linspace(-10,10,1000)
f = 0
for i in range(0,100):
f = f + sin((2*i+1)*x)/(2*i+1)
y = f
plot(x, y)
show()
| 3.28125 | 3 |
lib/googlecloudsdk/third_party/apis/categorymanager/v1alpha1/resources.py | bopopescu/Google-Cloud-SDK-1 | 0 | 45436 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 1.726563 | 2 |
sfa.py | ISeeBugsEverywhere/SnapFlatApp | 0 | 45437 | #!/usr/bin/python3
#-*- coding: utf-8 -*-
from PyQt5.QtWidgets import QApplication
from Main.SFA_main import SFA_window
import sys
if __name__ == "__main__":
app = QApplication(sys.argv)
window = SFA_window()
window.show()
sys.exit(app.exec_())
| 2.125 | 2 |
python/acer/game.py | henrychilvers/acer | 1 | 45438 | <filename>python/acer/game.py
import datetime
import random
from acer.player import Player
class Game:
def __init__(self):
self.gameTime = datetime.datetime.now()
self.numberOfPlayers = 0
self.numberOfDays = 0
self.players = []
self.shuffledDays = []
def setup(self):
... | 3.8125 | 4 |
xr_fetcher/throttling.py | jrlangford/xr-fetcher | 0 | 45439 | <filename>xr_fetcher/throttling.py
from rest_framework import throttling
class ApplicationRateThrottle(throttling.SimpleRateThrottle):
scope = 'oauth_application'
def get_cache_key(self, request, view):
if request.auth and request.auth.application:
ident = request.auth.application.id
... | 2.21875 | 2 |
preader/reader/forms.py | jobscry/preader | 0 | 45440 | <gh_stars>0
from django import forms
from .models import Feed
class URLForm(forms.Form):
url = forms.URLField(label='URL', max_length=255)
class NewSubscriptionForm(forms.Form):
feeds = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, label='URLs')
def __init__(self, *args, **kwargs):
... | 2.171875 | 2 |
montepython/likelihoods/Planck15_highl_TTTEEE/__init__.py | archaeo-pteryx/montepython_public | 69 | 45441 | from montepython.likelihood_class import Likelihood_clik
class Planck15_highl_TTTEEE(Likelihood_clik):
pass
| 1.125 | 1 |
dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_screener.py | pbarton666/virtual_classroom | 0 | 45442 | #py_screener.py
def screener(user_inp=None):
"""A function to square only floating points.
Returns custom exceptions if an int or complex is encountered."""
#make sure something was input
if not user_inp:
print("Ummm...did you type in ANYTHING?")
return
#If it *might* be a floa... | 3.8125 | 4 |
src/pyramidbridge/rethinkdb/connection.py | sawdog/pyramidbridge | 1 | 45443 | <gh_stars>1-10
"""rethinkDB connection"""
import rethinkdb as r
class Connection(object):
"""RethinkDB Connection handler"""
__connection__ = None
__db__ = None
__host__ = None
__port__ = None
__user__ = None
__password__ = None
__session__ = None
__table__ = None
def __init__... | 3.03125 | 3 |
python/Clique_Percolation_Method.py | JasonPap/graphproject | 1 | 45444 | __author__ = 'Jason'
import itertools
from Graph import *
from GraphStatistics import *
def get_cliques(graph, k, proc_pool):
persons = []
for idx in graph.dictionary:
persons.append(idx)
cliques = []
combinations = itertools.combinations(persons, k)
arg = []
for comb ... | 2.828125 | 3 |
main.py | KWinston/ShipyardSystem | 0 | 45445 | <filename>main.py
# CMPT 200 Lab 5 Queue Management System
#
# Author: <NAME>
# MacEwan ID: 1645889
#
# Date: November 3, 2014
#
# To start program: type in console: main()
# WARNING: !!! to avoid graphics.py crashes, use the rectangular exit
# buttons within the menu instead o... | 2.765625 | 3 |
examples/postmessage.py | haramaki/spark-openstack | 1 | 45446 | # 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, software
# distributed under the... | 2.25 | 2 |
python3/939.minimum-area-rectangle.334012431.ac.py | Diego-Zulu/leetcode_answers | 0 | 45447 | <filename>python3/939.minimum-area-rectangle.334012431.ac.py
#
# @lc app=leetcode id=939 lang=python3
#
# [939] Minimum Area Rectangle
#
# https://leetcode.com/problems/minimum-area-rectangle/description/
#
# algorithms
# Medium (52.14%)
# Likes: 575
# Dislikes: 113
# Total Accepted: 43.7K
# Total Submissions: 83... | 3.65625 | 4 |
nmmis/contrib/district/admin.py | mgrsantox/nmmis | 0 | 45448 | <gh_stars>0
from django.contrib import admin
from nmmis.contrib.district.models import District
admin.site.register(District)
| 1.109375 | 1 |
models/vgg16_unfreezed_block2.py | VictorAtPL/Pascal-VOC12_Class-segmentation_Tensorflow-2.0.0 | 1 | 45449 | <reponame>VictorAtPL/Pascal-VOC12_Class-segmentation_Tensorflow-2.0.0
from tensorflow import keras
from tensorflow.keras.applications import VGG16
from tensorflow.keras.layers import Conv2D, Conv2DTranspose, Activation
from AbstractModel import AbstractModel
from common import load_sets_count, get_input_fn_and_steps_p... | 2.59375 | 3 |
blog/models.py | IreneG5/spss_online | 14 | 45450 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils import timezone
from django.conf import settings
class Category(models.Model):
""" Each blog post belongs to a pre-defined category.
Categories are set up on the admin panel """
name = models.CharField(max_length=100)
def __unico... | 2.5 | 2 |
sponsors/migrations/0001_initial.py | miguelfg/django-sponsors | 1 | 45451 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Sponsor',
fields=[
... | 1.671875 | 2 |
code/python/teenie_mosaic.py | CreativeInquiry/TeenieHarrisProject | 0 | 45452 | <gh_stars>0
import cv2
import numpy as np
import json
meta = json.loads(open("meta.json",'r').read())
meta_by_shade = sorted(meta,key=lambda x: x['COLOR_AVG']);
W = 214
H = 277
uw = 0.1
def do_pic(im):
l = np.reshape(im,(W*H))
L = []
for i in range(len(l)):
L.append([i,l[i]])
L.sort(key=lambda x:x[1])
out =... | 2.09375 | 2 |
tests/lib/durak/test_draw_pile.py | maximpertsov/durak-sockets | 0 | 45453 | import pytest
from lib.durak.draw_pile import DrawPile
@pytest.fixture
def cards():
return ["10D", "10C", "2S", "5C", "8D", "2C"]
@pytest.fixture
def mocked_draw_cards(cards, get_draw_pile_cards):
return get_draw_pile_cards(cards)
@pytest.fixture
def default_parameters():
return {
"drawn_card... | 2.5 | 2 |
conference.py | robertkohl125/ConferenceCentral | 0 | 45454 | <filename>conference.py
#!/usr/bin/python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = '<EMAIL> (<NAME>)'
from datetime import datetime
import da... | 1.960938 | 2 |
labellab-flask/api/models/Issue.py | M-A-D-A-R-A/LabelLab | 0 | 45455 | from datetime import datetime
from email.policy import default
from flask import current_app
from api.extensions import db, Base
class Issue(db.Model):
"""
This model holds information about an Issue
"""
__tablename__ = "issue"
id = db.Column(db.Integer, primary_key=True)
title =... | 2.265625 | 2 |
src/dumpBuggyPatches/dumpLogs.py | dSar-UVA/repoMiner | 0 | 45456 | <gh_stars>0
import sys, os
#import psycopg2
import logging
import codecs
sys.path.append("../util")
from DatabaseCon import DatabaseCon
#from Config import Config
import Util
class dumpLogs:
def __init__(self, password, c_info):
self.config_info = c_info
self.db_config = self.config_info.config... | 2.609375 | 3 |
usaspending_api/awards/v2/lookups/matview_lookups.py | animatecitizen/usaspending-api | 0 | 45457 | default_mapping = {
'Recipient Name': 'recipient_name',
'Recipient DUNS Number': 'recipient_unique_id',
'Awarding Agency': 'awarding_toptier_agency_name',
'Awarding Agency Code': 'awarding_toptier_agency_code',
'Awarding Sub Agency': 'awarding_subtier_agency_name',
'Awarding Sub Agency Code': 'a... | 1.4375 | 1 |
himym_all.py | realkarimsaleh/Valentines2020 | 0 | 45458 | def valentine_tellings():
import random
valentine = [
"\033[1;36m"
"All of How I met your Mother"
"\nFlirts in One thread"
"\033[0m"
"\n\n"
"I think you fell from heaven,"
"\nbecause you look like an angel."
"\n\n\n"
"I thought you must have injured yourself"
"\nwhen you fell from heaven,... | 3.265625 | 3 |
app/apiv2/internal/tasking/mobius_task.py | Joey-Wondersign/Staffjoy-suite-Joey | 890 | 45459 | from flask_restful import marshal, abort, Resource
from app.models import Schedule2
from app.apiv2.decorators import permission_sudo
from app.apiv2.marshal import tasking_schedule_fields
class MobiusTaskApi(Resource):
method_decorators = [permission_sudo]
def get(self, schedule_id):
""" Peek at a sc... | 2.140625 | 2 |
cla_frontend/apps/status/urls.py | ministryofjustice/cla_frontend | 3 | 45460 | <gh_stars>1-10
from django.conf.urls import patterns, url
from moj_irat.views import HealthcheckView
from . import views
urlpatterns = patterns(
"",
url(r"^live/$", views.status, {"probe_type": "live"}, name="live_probe"),
url(r"^ready/$", views.status, {"probe_type": "ready"}, name="ready_probe"),
ur... | 1.726563 | 2 |
test/test_npu/test_ones_like.py | Ascend/pytorch | 1 | 45461 | <reponame>Ascend/pytorch<filename>test/test_npu/test_ones_like.py
# Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensour... | 2.265625 | 2 |
Algorithms/Math/Angle between hands in a clock.py | Praggya17/HacktoberFestContribute | 98 | 45462 | <reponame>Praggya17/HacktoberFestContribute<gh_stars>10-100
import math
t = int(input())
for _ in range(t):
x,y = map(float,input().split())
if (x==0 or x==12):
if (y==0 or y==60):
diff = abs((x*30)-(y*6))
else:
diff = abs((y*6)-(y*0.5))
else :
if (y==0 or y==... | 2.953125 | 3 |
Scripts/simulation/sims/university/university_enums.py | velocist/TS4CheatsInfo | 0 | 45463 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\university\university_enums.py
# Compiled at: 2019-08-26 20:01:13
# Size of source mod 2**32: 4... | 2.015625 | 2 |
scripts/estimate_acc.py | iQua/fl-lottery | 1 | 45464 | import os, sys
def main():
path = sys.argv[1]
for round_id in range(1, len(os.listdir(path))+1):
acc_path = os.path.join(path, str(round_id))
if os.path.isdir(acc_path):
if os.path.exists(os.path.join(acc_path, "accuracy.json")):
with open(os.path.join(acc_path, "acc... | 2.6875 | 3 |
customize_notifications/customize-notifications.py | renjunok/customize-notifications-python-sdk | 0 | 45465 | import random
import time
import json
import hashlib
import requests
def generateNonceStr():
return "".join(random.sample('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 16))
# def change_type(byte):
# if isinstance(byte, bytes):
# return str(byte, encoding="utf-8")
# return js... | 2.75 | 3 |
certificate_generator/txx_tools/txx_consts.py | SleepAqua/certificate_generator | 1 | 45466 | '''
@version: Python 3.7.3
@Author: Louis
@Date: 2020-06-15 13:27:40
LastEditors: Louis
LastEditTime: 2020-08-19 15:06:25
'''
import os
import sys
from enum import Enum
from datetime import datetime
TODAY = datetime.now().strftime("%Y%m%d")
TODAY_ = datetime.now().strftime("%Y-%m-%d")
TIME = datetime.now().strftime("... | 2.484375 | 2 |
dashboard_viewer/uploader/models.py | EHDEN/NetworkDashboards | 4 | 45467 | import datetime
import json
import os
import pathlib
import uuid
from django.conf import settings
from django.db import models
from django_celery_results.models import TaskResult
class Country(models.Model):
class Meta:
db_table = "country"
ordering = ("country",)
country = models.CharField(... | 2.328125 | 2 |
write_new_table.py | Cassiel60/python | 0 | 45468 | import sys
import pandas as pd
varFil = sys.argv[1]
df = pd.read_csv(varFil, header=0, sep='\t')
print len(df)
df_new = df[df['Allele Call'].isin(['Heterozygous', 'Homozygous'])]
print len(df_new)
df_res = df_new[df_new['Allele Cov'] >= 30]
print len(df_res)
df_res.to_csv('output.xls', index=False, header=True, s... | 2.9375 | 3 |
tests/integration/cartography/intel/aws/ec2/test_ec2_volumes.py | ramonpetgrave64/cartography | 1 | 45469 | import cartography.intel.aws.ec2.instances
import cartography.intel.aws.ec2.volumes
import tests.data.aws.ec2.instances
import tests.data.aws.ec2.volumes
TEST_ACCOUNT_ID = '000000000000'
TEST_REGION = 'eu-west-1'
TEST_UPDATE_TAG = 123456789
def test_load_volumes(neo4j_session):
# Arrange
data = tests.data.aw... | 2.015625 | 2 |
challenges/repeated_word/test_repeated_word.py | nastinsk/python-data-structures-and-algorithms | 0 | 45470 | from repeated_word import find_first_repeat
import pytest
def test_regular_str():
text = "Once upon a time, there was a brave princess who..."
assert find_first_repeat(text) == "a"
def test_bigger_different_case():
text = "It was the best of times, it was the worst of times, it was the age of wisdom, it w... | 3.28125 | 3 |
flask_restly/exception/too_many_requests.py | gorzechowski/flask-restly | 16 | 45471 | from werkzeug.exceptions import TooManyRequests as WerkzeugTooManyRequests
class TooManyRequests(WerkzeugTooManyRequests):
description = "Too many requests"
def __init__(self, description=None):
if description is not None:
self.description = description
| 2.453125 | 2 |
study/day01_spider/03_urllib2_useragentlist.py | Youngfellows/HPython2-Spider | 0 | 45472 | # coding=utf-8
import urllib2
import random
url = "http://www.baidu.com/"
# 可以是User-Agent列表,也可以是代理列表
ua_list = [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/5.0 (Windows NT 6.1; rv2.0.1) Gecko/20100101 Firefox/4.0.1",
"Opera/9.80 (Macintosh; Int... | 3.078125 | 3 |
skills.py | chombatant/python-kik-chatbot | 1 | 45473 | <reponame>chombatant/python-kik-chatbot
import re
import regex as re2
from regex import sub as sub2
from collections import defaultdict
from datetime import datetime
from ngrams.ngrams import corrections, Pw
import nltk
# ===========================================================================================
... | 3.015625 | 3 |
anki_alert_script.py | FerriteGiant/automated_anki_notifications | 0 | 45474 | <reponame>FerriteGiant/automated_anki_notifications
from datetime import datetime as dt
import os
import sys
from bs4 import BeautifulSoup as bs
from requests import Session,post
import yaml
DIR_PATH = os.path.dirname(os.path.realpath(__file__))
LOG_FILE = "{}/history.log".format(DIR_PATH)
PARAMS_FILE = "{}/config_p... | 2.9375 | 3 |
segment_classifier/charCNN_classifier/charCNN_main.py | liuhongbing1220/fundanNLP_task | 0 | 45475 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 29 15:44:44 2019
@author: liuhongbing
"""
# coding=utf-8
import tensorflow as tf
import time
import os
from charCNN_model import CharCNN
import datetime
from read_data import Config,Dataset
# Load data
print("正在载入数据...")
# 函数dataset_read:输入文件名,返回... | 2.46875 | 2 |
determine_steady_state.py | JoerivanEngelen/Nile_Delta_post | 0 | 45476 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 27 11:26:25 2019
@author: engelen
"""
import xarray as xr
import pandas as pd
from glob import glob
import os
import numpy as np
from collections import defaultdict
def get_first_true(df, condition):
time = df[condition].iloc[0:1].index.values
if time.size == 0:... | 2.265625 | 2 |
utils/scripts/debug/data_utils.py | eflows4hpc/compss | 31 | 45477 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# For better print formatting
from __future__ import print_function
# Imports
from abc import abstractmethod
from enum import Enum
class Version:
def __init__(self, data, version_id, timestamp):
self._data = data
self._id = version_id
self._pro... | 3.03125 | 3 |
test/vm.py | yslib/ruston | 0 | 45478 | <filename>test/vm.py<gh_stars>0
from opcode import hasconst
from types import CodeType
import types
from typing import Collection, List, Any, Dict
import collections
import dis
import operator
Block = collections.namedtuple('Block', 'type, handler, level')
class Frame:
def __init__(self, f_code:CodeType, ... | 2.234375 | 2 |
src/features/preprocessing/huawei.py | lenaWitterauf/Domain-Guided-Monitoring | 1 | 45479 | from src.features.preprocessing.huawei_traces import HuaweiTracePreprocessor
import dataclass_cli
import dataclasses
import logging
import pandas as pd
from pathlib import Path
from tqdm import tqdm
from typing import List, Dict, Set
import http
import re
from .base import Preprocessor
from collections import Counter
f... | 2.234375 | 2 |
tools/download_secuityhub_event_files.py | xen0l/python-asff | 2 | 45480 | #!/usr/bin/env python
#
# This script is meant to be run when new security hub events are added or we need
# to regenerate sample securityhub event files
#
import json
import os
import boto3
# To get all supported TTPs, it's easiest to fetch it from the AWS console:
# https://eu-west-1.console.aws.amazon.com/securit... | 1.953125 | 2 |
uploads/core/admin.py | AsciencioAlex/simple-file-upload | 0 | 45481 | <filename>uploads/core/admin.py<gh_stars>0
from django.contrib import admin
from uploads.core.forms import DocumentForm
from uploads.core.models import Document
admin.site.register(Document)
| 1.21875 | 1 |
conduit_ui_tests/sign_in/signin_steps.py | dduleba/tw2019-ui-tests | 1 | 45482 | <reponame>dduleba/tw2019-ui-tests
from radish import steps, after
from radish_selenium.radish.selenium_base_steps import attach_screenshot_on_failure, \
attach_page_source_on_failure, attach_console_log_on_failure, close_web_browser
# from realworld_ui.sdk.page_objects.general import LoggedPageObject
from conduit_... | 1.710938 | 2 |
codes/counting_sort.py | pedh/CLRS-Solutions | 3 | 45483 | <reponame>pedh/CLRS-Solutions<filename>codes/counting_sort.py
"""
Counting sort.
"""
import random
def counting_sort(array, key_length, key_func):
"""Counting sort."""
counts = [0] * key_length
result = [0] * len(array)
for i in array:
counts[key_func(i)] += 1
for i in range(1, key_length... | 4.09375 | 4 |
tests/test_aufabschlagregional.py | bo4e/BO4E-python | 1 | 45484 | <filename>tests/test_aufabschlagregional.py<gh_stars>1-10
from datetime import datetime, timezone
from decimal import Decimal
import pytest # type:ignore[import]
from bo4e.com.aufabschlagproort import AufAbschlagProOrt
from bo4e.com.aufabschlagregional import AufAbschlagRegional, AufAbschlagRegionalSchema
from bo4e.... | 1.992188 | 2 |
model/DPF.py | SQD1/DPCC-Net | 0 | 45485 | <gh_stars>0
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from einops import rearrange
class ModuleHelper:
@staticmethod
def BNReLU(num_features, bn_type=None, **kwargs):
return nn.Sequential(
nn.BatchNorm2d(num_features, **kwargs),
nn.R... | 2.203125 | 2 |
torchvision/prototype/datasets/_builtin/cifar.py | yassineAlouini/vision-1 | 1 | 45486 | <reponame>yassineAlouini/vision-1<gh_stars>1-10
import abc
import io
import pathlib
import pickle
from typing import Any, Dict, List, Optional, Tuple, Iterator, cast, BinaryIO, Union
import numpy as np
from torchdata.datapipes.iter import (
IterDataPipe,
Filter,
Mapper,
)
from torchvision.prototype.dataset... | 2.140625 | 2 |
Interfas Grafica VIII (GUI)/InterfasGraficaVIII.py | BrianMarquez3/Python-Course | 20 | 45487 | # Interfas Grafica VIII
# Operacion Matematicas
from tkinter import *
raiz = Tk()
miFrame=Frame(raiz)
miFrame.pack()
operacion =""
resultado=0
#Entry
#------------------------------Pantalla---------------------------------
numeroPantalla=StringVar()
pantalla=Entry(miFrame, textvariable=numeroPantalla)
pantalla.gr... | 3.578125 | 4 |
btsprice/aba.py | Zapata/btsprice | 0 | 45488 | # -*- coding: utf-8 -*-
import datetime
import time
import math
ABA = ["HERTZ", "HERO"]
SECONDS_PER_DAY = 60 * 60 * 24
def _get_hertz_feed(reference_timestamp, current_timestamp, period_days, phase_days, reference_asset_value, amplitude):
"""
Given the reference timestamp, the current timestamp, the period (... | 3.03125 | 3 |
has_keyword_extractor/hwo.py | 360medics/has-keyword-extractor | 0 | 45489 | from typing import Dict
def compute_hwo(word: str, monogram_frequency: Dict, cumul_monogram: Dict):
if word not in monogram_frequency:
return -100
key_max = max(list(cumul_monogram.keys()))
return cumul_monogram[monogram_frequency[word]] / cumul_monogram[key_max]
| 3.140625 | 3 |
mmdet/models/classifiers/__init__.py | anorthman/mmdetection | 5 | 45490 | from .classifier import Classifier
from .loss_heads import MultilabelsHead
__all__ = ['Classifier', 'MultilabelsHead']
| 1.125 | 1 |
info.py | wanjun-group-seu/AQUARIUM | 0 | 45491 | <gh_stars>0
# !/usr/bin/env python
# -*- coding:utf-8 -*-
# author : zerodel
# Readme:
#
import pysrc.body.config
import pysrc.wrapper.bwa
import pysrc.wrapper.ciri
import pysrc.wrapper.ciri2
import pysrc.wrapper.ciri_full
import pysrc.wrapper.knife
import pysrc.wrapper.rsem
import pysrc.wrapper.sailfish
import pysrc.w... | 2.203125 | 2 |
performance_measures.py | kkeya1/FCPH | 0 | 45492 | <reponame>kkeya1/FCPH
#%%
# Main source = Deep hit model, 'https://github.com/chl8856/DeepHit'
#%%
'''
This provide time-dependent Concordance index and Brier Score:
- Use weighted_c_index and weighted_brier_score, which are the unbiased estimates.
See equations and descriptions eq. (11) and (12) of the... | 2.25 | 2 |
callGitServer/models/gitlabHandler.py | isabella232/ALM-SF-DX-Python-Tools | 5 | 45493 | <reponame>isabella232/ALM-SF-DX-Python-Tools
''' Bitbucket Server Interface '''
import urllib
from modules.utils import INFO_TAG, WARNING_TAG, ERROR_LINE, SUCCESS_LINE, print_key_value_list
from modules.git_server_callout import http_request
from modules.comment_operations import get_last_comment, append_new_comments, ... | 2.328125 | 2 |
vegaops2n9e.py | vegaops/vegaops2n9e | 1 | 45494 | # -*- coding: UTF-8 -*-
import json
import logging
import os
import re
import requests
import schedule
import sys
import threading
import time
import yaml
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('VegaOps2N9e')
reload(sys)
sys.setdefaultencoding('utf8')
def _push_metrics(cfg, metrics):
... | 2.171875 | 2 |
orange3/Orange/canvas/canvas/items/utils.py | rgschmitz1/BioDepot-workflow-builder | 54 | 45495 | import numpy
from AnyQt.QtGui import QColor, QRadialGradient, QPainterPathStroker
def saturated(color, factor=150):
"""Return a saturated color.
"""
h = color.hsvHueF()
s = color.hsvSaturationF()
v = color.valueF()
a = color.alphaF()
s = factor * s / 100.0
s = max(min(1.0, s), 0.0)
... | 2.71875 | 3 |
morphablegraphs/construction/preprocessing/__init__.py | dfki-asr/morphablegraphs | 5 | 45496 | LEN_ROOT = 3
LEN_QUATERNION = 4
LEN_EULER = 3
from .bitvector import gen_foot_contact_annotation
from .semantic_annotation import gen_walk_annotation, gen_synthetic_semantic_annotation_pick_and_place, \
gen_synthetic_semantic_annotation_for_screw, \
gen_... | 1.164063 | 1 |
main.py | esp32wrangler/ESP32-Garage-Door-Watcher | 0 | 45497 | <filename>main.py<gh_stars>0
import socket
import time
import utime
import machine
import os
import ntptime
from machine import Pin
from machine import Timer
from machine import RTC
from math import cos, sin, acos as arccos, asin as arcsin, tan as tg, degrees, radians
s = socket.socket()
#configuration... | 2.703125 | 3 |
IPython/lib/tests/test_imports.py | pyarnold/ipython | 1 | 45498 | # encoding: utf-8
from IPython.testing import decorators as dec
def test_import_backgroundjobs():
from IPython.lib import backgroundjobs
def test_import_deepreload():
from IPython.lib import deepreload
def test_import_demo():
from IPython.lib import demo
| 1.265625 | 1 |
api/TelegramApi.py | juanmafn/telegram-framework-python | 0 | 45499 | #!/usr/bin/env python3
# coding: utf8
__author__ = "<NAME>"
# Librería bot telegram
# doc: https://github.com/python-telegram-bot/python-telegram-bot
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Updater, CommandHandler, MessageHandler, CallbackQueryHandler, Filters
import s... | 2.5625 | 3 |