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 |
|---|---|---|---|---|---|---|
ree/core/__init__.py | blackleg/reescrapper | 0 | 12779951 | from .scraper import Scraper
from .exceptions import ResponseCodeException, ResponseDataException, NoDataException, TimestampException
| 1.234375 | 1 |
tests/buildframe_test.py | SeBassTian23/Visual-Phenomics-Python | 0 | 12779952 | """
Test file corresponding with photosynq_py.buildframe
"""
from unittest import TestCase
# import pandas as pd
# import numpy as np
import visual_phenomics_py as visual_phenomics_py
class BuildframeTest(TestCase):
"""
Test class corresponding with vppy.buildframe
"""
# def setUp(self)... | 3.09375 | 3 |
users/views.py | sedexdev/scramble-api-frontend | 0 | 12779953 | from flask import (
Blueprint,
flash,
redirect,
render_template,
request,
url_for)
from flask_login import current_user, login_user, logout_user
from werkzeug.wrappers import Response
from .forms import (
AccountForm,
DeleteForm,
LoginForm,
RegisterForm,
ResetForm,
Updat... | 2.28125 | 2 |
formations/views.py | Kgermando/catsr | 0 | 12779954 | <reponame>Kgermando/catsr<filename>formations/views.py<gh_stars>0
from django.shortcuts import render, get_object_or_404, redirect
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from formations.models import Formation
# Create your views here.
def formations_view(request):
"""
docstr... | 2.109375 | 2 |
recipe_scrapers/__version__.py | michael-golfi/recipe-scrapers | 0 | 12779955 | __version__ = "13.3.0"
| 1.023438 | 1 |
2.7/ptp_path.py | SnoWolf2018/Python | 0 | 12779956 | <filename>2.7/ptp_path.py
import sys
import os
import numpy as np
'''path tests'''
#print 'current path'
#print os.getcwd()
#'''Your Shell Path'''
#print os.path.abspath(os.path.dirname(__file__))
#'''Your script Path'''
#
#print 'get upper path'
#print os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
#prin... | 2.53125 | 3 |
app/enquiries/apps.py | uktrade/enquiry-mgmt-tool | 3 | 12779957 | <filename>app/enquiries/apps.py
from django.apps import AppConfig
class EnquiriesConfig(AppConfig):
name = "enquiries"
| 1.320313 | 1 |
data/main.py | oyjuffer/Battler-V1.1 | 0 | 12779958 |
### MAIN ###
# IMPORT LIBRARIES
import os
import pygame
# IMPORT GAME FILES
from . import constants
from . import control
from . import setup
from .states import main_menu, game_setup
# CLASSES
# FUNCTIONs
def main():
"""
This is the main function for the game; it sets up a game object and state dictionaries.... | 2.90625 | 3 |
winlogtimeline/ui/tag_settings.py | ShaneKent/PyEventLogViewer | 4 | 12779959 | from tkinter import *
from tkinter import messagebox
from tkinter.ttk import *
import re
class TagSettings(Toplevel):
def __init__(self, parent):
super().__init__(parent)
# Class variables
self.tags = dict()
self.changes_made = False
# Window Parameters
self.title... | 2.734375 | 3 |
tests/functional/test_filesystem.py | rena2damas/filemanager-service | 0 | 12779960 | <reponame>rena2damas/filemanager-service<filename>tests/functional/test_filesystem.py
import io
import subprocess
from base64 import b64encode
import pytest
from src.api.auth import AuthAPI
@pytest.fixture()
def auth(mocker):
mocker.patch.object(AuthAPI, "authenticate", return_value=True)
return {"Authoriza... | 2.203125 | 2 |
attr_functions.py | ecreager/beta-tcvae | 0 | 12779961 | """
Convert ground truth latent classes into binary sensitive attributes
"""
def attr_fn_0(y):
return y[:,0] >= 1
def attr_fn_1(y):
return y[:,1] >= 1
def attr_fn_2(y):
return y[:,2] >= 3
def attr_fn_3(y):
return y[:,3] >= 20
def attr_fn_4(y):
return y[:,4] >= 16
def attr_fn_5(y):
ret... | 2.84375 | 3 |
challenge1-titanic/scripts/example.py | xdssio/xdss_academy_challenges | 0 | 12779962 |
# coding: utf-8
# # Example
# In[3]:
import turicreate as tc
# ## Get the data
# In[22]:
data = 'path-to-data-here'
sf = tc.SFrame(data).dropna(columns=['Age'])
train, test = sf.random_split(fraction=0.8)
test, validations = test.random_split(fraction=0.5)
# ## Modeling
# In[27]:
from turicreate import log... | 2.3125 | 2 |
DLBio/pt_training.py | pgruening/dlbio | 1 | 12779963 | import argparse
import os
import random
import time
import warnings
from math import cos, pi
import cv2
import numpy as np
import torch
import torch.optim as optim
from DLBio.pt_train_printer import Printer
from DLBio.pytorch_helpers import get_lr
class ITrainInterface():
"""
TrainInterfaces handle the pred... | 3.09375 | 3 |
app/study/filterAccDis.py | kyoungd/material-stock-finder-app | 0 | 12779964 | import pandas as pd
import numpy as np
import logging
# IF CHOPPINESS INDEX >= 61.8 - -> MARKET IS CONSOLIDATING
# IF CHOPPINESS INDEX <= 38.2 - -> MARKET IS TRENDING
# https://medium.com/codex/detecting-ranging-and-trending-markets-with-choppiness-index-in-python-1942e6450b58
class WyckoffAccumlationDistribution:
... | 2.890625 | 3 |
python/OSGridConverter/coordinates/cartesian.py | EdwardBetts/OSGridConverter | 6 | 12779965 | '''
Created on 17 Mar 2018
@author: julianporter
'''
from OSGridConverter.algebra import Vector3
from OSGridConverter.mapping import Datum
from math import radians,degrees,sin,cos,sqrt,atan2,isnan
class Cartesian (Vector3):
def __init__(self,arg):
try:
phi=radians(arg.latitude)
l... | 2.984375 | 3 |
ex18-cose_and_bulls.py | lew18/practicepython.org-mysolutions | 0 | 12779966 | """
https://www.practicepython.org
Exercise 18: Cows and Bulls
3 chilis
Create a program that will play the “cows and bulls” game with the user.
The game works like this:
Randomly generate a 4-digit number. Ask the user to guess a 4-digit number.
For every digit that the user guessed correctly in the correct place, ... | 4.375 | 4 |
public/views/base.py | cmisid/Wasty-Database | 0 | 12779967 | <filename>public/views/base.py
from django.http import HttpResponse
def ping(request):
return HttpResponse(status=200)
def parse_user(request):
users = json.loads(request.body)
return HttpResponse(status=200) | 1.890625 | 2 |
poo/class/store.py | alfmorais/design-patterns-python | 0 | 12779968 | <filename>poo/class/store.py
class Store:
tax = 1.03
def __init__(self, address: str) -> None:
self.__address = address
def show_address(self) -> None:
print(self.__address)
@classmethod
def sales(cls) -> int:
return 40 * cls.tax
@classmethod
def change_tax(cls, ... | 2.9375 | 3 |
HomeWorks/Rostik/helper.py | PhantomMind/FamousTeamDream | 0 | 12779969 | import time
mainIsOn = True
targetValue = -1
while mainIsOn:
print("Select category\n"
"0 - Close App\n"
"1 - Lists\n"
"2 - While\n")
if targetValue == -1:
try:
targetValue = int(input())
except ValueError as e:
print("Wrong statement. Try ag... | 3.65625 | 4 |
platform/hwconf_data/efr32mg21/modules/PIN/PIN_Snippets.py | lenloe1/v2.7 | 0 | 12779970 | """
Generated from a template
"""
import efr32mg21.PythonSnippet.RuntimeModel as RuntimeModel
from efr32mg21.modules.PIN.PIN_Defs import PORT_PINS
def activate_runtime():
pass
| 1.414063 | 1 |
zopeskel/plone25_buildout.py | jean/ZopeSkel | 1 | 12779971 | <reponame>jean/ZopeSkel<gh_stars>1-10
import copy
from zopeskel.plone3_buildout import Plone3Buildout
from zopeskel.base import get_var
class Plone25Buildout(Plone3Buildout):
_template_dir = 'templates/plone2.5_buildout'
summary = "A buildout for Plone 2.5 projects"
help = """
This template creates a build... | 1.960938 | 2 |
mldictionary_api/routes/api.py | PabloEmidio/api-dictionary | 7 | 12779972 | <reponame>PabloEmidio/api-dictionary<gh_stars>1-10
import traceback
from flask import Blueprint, jsonify, request
from werkzeug.exceptions import NotFound, InternalServerError, TooManyRequests
from mldictionary_api.models import RedisRequests
from mldictionary_api.const import (
API_PREFIX,
DICTIONARIES,
... | 2.3125 | 2 |
riccardo-negri/16/x.py | Tommimon/advent-of-code-2020 | 3 | 12779973 | #!/usr/bin/env python
# Day 16 solution of Advent Of Code 2020 by <NAME>
# First part answer: 29878
# Second part answer: 855438643439
switch = False
constraints = []
tickets = []
with open('input.txt', 'r') as f:
for line in f.readlines():
if not switch:
try:
constraints.append(list(map(int, (line[line.ind... | 3.125 | 3 |
graphite2opentsdb.py | amarin/graphite2opentsdb | 0 | 12779974 | <reponame>amarin/graphite2opentsdb
import copy
import time
import requests
import sys
from requests.exceptions import ConnectionError
import settings
USAGE = '''
Usage: %s <cmd> <args>
Supported commands:
- list:
Simply lists available metrics
- get <graphite.metric.name> [as <target_name>] [fr... | 2.984375 | 3 |
model/model.py | naderabdalghani/doclense-flask-api | 0 | 12779975 | <gh_stars>0
import torch
import torchvision.models as models
import torch.optim as optim
from torchvision import datasets
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, random_split
import numpy as np
from os import path
from PIL import Image
def get_class_names(dataset_path='dat... | 2.40625 | 2 |
bcs-ui/backend/bcs_web/apis/permissions.py | kayinli/bk-bcs | 0 | 12779976 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 TH<NAME>, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in complianc... | 2.171875 | 2 |
model/embedding/bert.py | 0xflotus/BERT-pytorch | 1 | 12779977 | <gh_stars>1-10
import torch.nn as nn
from .token import TokenEmbedding
from .position import PositionalEmbedding
from .segment import SegmentEmbedding
class BERTEmbedding(nn.Module):
def __init__(self, vocab_size, embed_size, dropout=0.1):
super().__init__()
self.token = TokenEmbedding(vocab_size=... | 2.515625 | 3 |
data/projects/flutils/tests/unit/moduleutils/test_validate_attr_identifier.py | se2p/artifact-pynguin-ssbse2020 | 3 | 12779978 | <reponame>se2p/artifact-pynguin-ssbse2020
import keyword
import unittest
from unittest.mock import (
Mock,
patch,
)
from flutils.moduleutils import _validate_attr_identifier
class TestValidateAttrIdentifier(unittest.TestCase):
def test_validate_attr_identifier__00(self) -> None:
arg = ''
... | 2.40625 | 2 |
sopel/modules/soma.py | Ameenekosan/Yumiko | 0 | 12779979 | <gh_stars>0
#old modules from smircbot re-written in Python2
# coding=utf8
from sopel.module import commands, rule, priority, example
import requests
@commands("somafm")
def somafm(bot,trigger):
r = requests.get('http://somafm.com/channels.xml')
if r.status_code == 200:
bot.say("")
| 2.140625 | 2 |
tests/evernote/test_stored_note.py | KostyaEsmukov/SyncToG | 8 | 12779980 | <filename>tests/evernote/test_stored_note.py
import datetime
import os
from contextlib import ExitStack
from pathlib import Path
import pytest
import pytz
from synctogit.evernote.models import Note, NoteMetadata
from synctogit.evernote.stored_note import EvernoteStoredNote
from synctogit.filename_sanitizer import nor... | 2.1875 | 2 |
tests/test_jwt.py | nihal-rao/supertokens-fastapi | 0 | 12779981 | <filename>tests/test_jwt.py
"""
Copyright (c) 2020, VRAI Labs and/or its affiliates. All rights reserved.
This software is licensed under the Apache License, Version 2.0 (the
"License") as published by the Apache Software Foundation.
You may not use this file except in compliance with the License. You may
obtain a co... | 2.015625 | 2 |
myworkspace/wechat02.py | lvzhang/test | 0 | 12779982 | #!/user/bin/env python
#_*_ coding=utf-8 *_*
"""
Function:微信消息自动回复
Date:2015/05/26
Author:lvzhang
ChangeLog:v0.1 init
"""
import itchat
@itchat.msg_register('Text')
def text_replay(msg):
# 自己实现问答
print("已经自动回复")
return "[自动回复]您好,我正忙,一会儿再联系您!!!"
if __name__=="__main__":
print("运行成功!!!")
itchat.aut... | 2.21875 | 2 |
app.py | zmwangx/ncov | 2 | 12779983 | <filename>app.py
#!/usr/bin/env python3
import pathlib
import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_table as dt
import plotly.graph_objs as go
from dash_dangerously_set_inner_html import DangerouslySetInnerHTML
from plotly.subplots import make_subp... | 2.578125 | 3 |
workflow/setup.py | isciences/wsim | 5 | 12779984 | <gh_stars>1-10
#!/usr/bin/env python3
# Import setuptools if we have it (so we can use ./setup.py develop)
# but stick with distutils if we don't (so we can install it without
# needing tools outside of the standard library)
try:
from setuptools import setup
except ImportError:
from distutils.core import setup... | 1.226563 | 1 |
tests/mep/genetics/test_population.py | paulfjacobs/py-mep | 2 | 12779985 | import unittest
import random
import numpy as np
from mep.genetics.population import Population
from mep.genetics.chromosome import Chromosome
class TestPopulation(unittest.TestCase):
"""
Test the Population class.
"""
def test_random_tournament_selection(self):
"""
Test the random_to... | 3.359375 | 3 |
dotfiles/config/offlineimap/custom.py | nathbo/dotfiles | 1 | 12779986 | <reponame>nathbo/dotfiles
from subprocess import check_output
def get_password(account):
return check_output("authinfo.sh machine="+account, shell=True).strip(b'\n')
| 2.171875 | 2 |
webapp/views/access/forms.py | nwallin1/ezEML | 3 | 12779987 | from wtforms import (
StringField, SelectField, HiddenField
)
from webapp.home.forms import EDIForm
class AccessSelectForm(EDIForm):
pass
class AccessForm(EDIForm):
userid = StringField('User ID', validators=[])
permission = SelectField('Permission',
choices=[("all", "a... | 2.546875 | 3 |
weather/apps/web/climate/lib/climate.py | Billykat7/btkweathers | 0 | 12779988 | <gh_stars>0
from datetime import datetime
from django.db.models import Q, Sum
from weather.apps.web.climate.models import Climate
def get_weathers(i):
city_req = i['city']
period_start = i['period_start... | 2.421875 | 2 |
emat/util/xmle/html_table_to_txt.py | jinsanity07git/tmip-emat | 13 | 12779989 | <reponame>jinsanity07git/tmip-emat
import os
import math
import copy
import pandas as pd
import numpy as np
from bs4 import BeautifulSoup
class html_tables(object):
def __init__(self, raw_html):
self.url_soup = BeautifulSoup(raw_html, "lxml")
def read(self):
self.tables = []
self.tables_html = self.url... | 2.96875 | 3 |
Events/reaction.py | hanss314/TheBrainOfTWOWCentral | 0 | 12779990 | import time, discord
from Config._functions import grammar_list
class EVENT:
LOADED = False
RUNNING = False
param = { # Define all the parameters necessary
"CHANNEL": "",
"EMOJIS": []
}
# Executes when loaded
def __init__(self):
self.LOADED = True
# Executes when activated
def start(self, TWOW_CENTR... | 2.78125 | 3 |
build/lib/annotation_utils/old/converter/__init__.py | HienDT27/annotation_utils | 13 | 12779991 | <filename>build/lib/annotation_utils/old/converter/__init__.py
from .labelimg_labelme_converter import LabelImgLabelMeConverter
from .labelme_coco_converter import LabelMeCOCOConverter | 1.015625 | 1 |
problem_4_active_directory.py | tomgtqq/Data_Structures_Algorithms-Project2 | 0 | 12779992 | <reponame>tomgtqq/Data_Structures_Algorithms-Project2
class Group(object):
def __init__(self, _name):
self.name = _name
self.groups = []
self.users = []
def add_group(self, group):
self.groups.append(group)
def add_user(self, user):
self.users.append(user)
def ... | 3.546875 | 4 |
aoc03/03-1.py | ssfivy/adventofcode2019 | 0 | 12779993 | <reponame>ssfivy/adventofcode2019<filename>aoc03/03-1.py
#!/usr/bin/env python3
# I am not familiar enough with doing geometrical stuff in code
# so using python for now, dont want to do two things at the same time
# ok I'm allowing google and external libraries too
from shapely.geometry import LineString
def calcu... | 3.453125 | 3 |
dokklib_db/errors/transaction.py | cmoore-i3/dokklib-db | 22 | 12779994 | import re
from typing import Any, Dict, List, Optional, Type
from dokklib_db.errors import exceptions as ex
from dokklib_db.errors.client import ClientError
from dokklib_db.op_args import OpArg
CancellationReasons = List[Optional[Type[ClientError]]]
class TransactionCanceledException(ClientError):
"""The entir... | 2.28125 | 2 |
test/test_cross_section_box.py | ArnaudCrl/pywellcad | 6 | 12779995 | <gh_stars>1-10
import unittest
import pathlib
import wellcad.com
from ._sample_path import SamplePath
from ._extra_asserts import ExtraAsserts
class TestCrossSectionBox(unittest.TestCase, SamplePath, ExtraAsserts):
@classmethod
def setUpClass(cls):
cls.app = wellcad.com.Application()
cls.sampl... | 2.359375 | 2 |
train_stageII_rank_instance.py | ChronousZhang/Dual-path | 1 | 12779996 | # -*- coding: utf-8 -*-
from __future__ import print_function,division
import os
import time
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.autograd import Variable
from torchvision import datasets,transforms
from load_text i... | 2 | 2 |
lib/python/frugal/tests/transport/test_http_transport.py | ariasheets-wk/frugal | 144 | 12779997 | <gh_stars>100-1000
# Copyright 2017 Workiva
# 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 ... | 1.875 | 2 |
lib/cappconfig.py | Aziroshin/mntools | 0 | 12779998 | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
#=======================================================================================
# Imports
#=======================================================================================
import sys
import os
from lib.configutils import *
#===============================... | 1.6875 | 2 |
marueditor_debug.py | Marusoftware/Marutools | 0 | 12779999 | #! /usr/bin/python3
import subprocess
import time
import sys
import os
subprocess.Popen(["./marueditor.py","--debug"])
while 1:
time.sleep(1)
| 1.609375 | 2 |
gefolge_web/event/model.py | dasgefolge/gefolge.org | 2 | 12780000 | <filename>gefolge_web/event/model.py
import datetime
import itertools
import flask # PyPI: Flask
import icalendar # PyPI: icalendar
import jinja2 # PyPI: Jinja2
import pytz # PyPI: pytz
import class_key # https://github.com/fenhl/python-class-key
import lazyjson # https://github.com/fenhl/lazyjson
import peter # http... | 2.1875 | 2 |
logitch/config.py | thomaserlang/logitch | 0 | 12780001 | import os, yaml
config = {
'debug': False,
'user': '',
'token': '',
'sql_url': '',
'client_id': '',
'client_secret': '',
'cookie_secret': '',
'redirect_uri': '',
'web_port': 8001,
'irc': {
'host': 'irc.chat.twitch.tv',
'port': 6697,
'use_ssl': True,
}... | 2.21875 | 2 |
decoder/decoder.py | Richard-Kirby/strobe | 0 | 12780002 | import config.config as config
# Decoder class for use with a rotary encoder.
class decoder:
"""Class to decode mechanical rotary encoder pulses."""
def __init__(self, pi, rot_gpioA, rot_gpioB, switch_gpio, rotation_callback, switch_callback):
"""
Instantiate the class with the p... | 3.421875 | 3 |
sheetsync/__init__.py | guykisel/SheetSync | 1 | 12780003 | # -*- coding: utf-8 -*-
"""
sheetsync
~~~~~~~~~
A library to synchronize data with a google spreadsheet, with support for:
- Creating new spreadsheets. Including by copying template sheets.
- Call-back functions when rows are added/updated/deleted.
- Protected columns.
... | 2.453125 | 2 |
asyncapi_schema_pydantic/v2_3_0/schema.py | albertnadal/asyncapi-schema-pydantic | 0 | 12780004 | <reponame>albertnadal/asyncapi-schema-pydantic
from typing import Optional
from pydantic import Extra
from .json_schema import JsonSchemaObject
from .external_documentation import ExternalDocumentation
class Schema(JsonSchemaObject):
"""
The Schema Object allows the definition of input and output data types... | 2.203125 | 2 |
pyscnet/BuildNet/__init__.py | MingBit/SCNetEnrich | 5 | 12780005 | <gh_stars>1-10
from .gne_dockercaller import rundocker
from .gne_synchrony import get_synchrony
| 1.117188 | 1 |
ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fipClearVirtualLinksFcf_template.py | OpenIxia/ixnetwork_restpy | 20 | 12780006 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class FipClearVirtualLinksFcf(Base):
__slots__ = ()
_SDM_NAME = 'fipClearVirtualLinksFcf'
_SDM_ATT_MAP = {
'HeaderFipVersion': 'fipClearVirtualLinksFcf.header.fipVersion-1',
'HeaderFipReserved': 'fipClearVirtua... | 1.703125 | 2 |
finding_dallin/game/director.py | JosephRS409/cse210-project | 0 | 12780007 | import arcade
from game.title_view import Title
from game.player import Player
from game import constants
class Director():
def __init__(self):
"""Directs the game"""
self.window = arcade.Window(
constants.SCREEN_WIDTH, constants.SCREEN_HEIGHT, constants.SCREEN_TITLE)
self.main... | 2.9375 | 3 |
__main__.py | kocsob/tornado-template | 0 | 12780008 | import os
import tornado.httpserver
import tornado.ioloop
import tornado.log
import tornado.web
from tornado.options import define, options, parse_command_line
import config
import handlers.web
import handlers.api
class Application(tornado.web.Application):
def __init__(self, debug):
routes = [
... | 2.25 | 2 |
bower-license-parser.py | ewen/bower-license-parser | 0 | 12780009 | #!env python
import sys
import json
import csv
json_input = json.load(sys.stdin)
csv_output = csv.writer(sys.stdout)
csv_output.writerow(['Library', 'URL', 'License'])
for package_name, data in json_input.items():
name = package_name.split('@')[0]
url = ''
if 'homepage' in data:
if type(data['h... | 3.1875 | 3 |
src/ao3_beautifulsoup/history.py | jezaven/ao3-history | 5 | 12780010 | <reponame>jezaven/ao3-history<filename>src/ao3_beautifulsoup/history.py
# -*- encoding: utf-8
from datetime import datetime
import collections
import itertools
import re
from bs4 import BeautifulSoup, Tag
import requests
ReadingHistoryItem = collections.namedtuple(
'ReadingHistoryItem', ['work_id', 'title', 'aut... | 3.03125 | 3 |
apps/Servers/data_tables_views.py | ulibn/BlueXolo | 21 | 12780011 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django_datatables_view.base_datatable_view import BaseDatatableView
from apps.Servers.models import TemplateServer, ServerProfile, Parameters
class ServerTemplatesListJson(LoginRequiredMixin, BaseDatatableView):
model =... | 1.984375 | 2 |
PyExercises - CeV - Mundo 3/Exercises (35 - 43)/Ex 41/ex 41.py | PatrickAMenezes/PyExercises-CursoEmVideo-Mundo3 | 0 | 12780012 | <reponame>PatrickAMenezes/PyExercises-CursoEmVideo-Mundo3
from Functions import readint, readfloat
num_int = readint.readint()
num_float = readfloat.readfloat()
print(f'The integer entered was {num_int} and the float was {num_float}.')
| 3.484375 | 3 |
src/utils/config.py | rachelkberryman/flower_detection | 1 | 12780013 | # %% Packages
import json
from dotmap import DotMap
# %% Functions
def get_config_from_json(json_file):
with open(json_file, "r") as config_file:
config_dict = json.load(config_file)
config = DotMap(config_dict)
return config
def process_config(json_file):
config = get_config_from_json(js... | 2.5625 | 3 |
microserver.py | ronrest/model_nanny | 0 | 12780014 | <filename>microserver.py
"""
TODO: Add description of this script
TODO: Add license
"""
from __future__ import print_function, division, unicode_literals
import os
import pickle
from flask import Flask
from flask import render_template, url_for
app = Flask(__name__)
# SETTINGS
VALIDATION_METRIC = "valid_acc"
... | 2.359375 | 2 |
cactus/skeleton.py | hzdg/Cactus | 0 | 12780015 | <reponame>hzdg/Cactus<filename>cactus/skeleton.py
data = """
<KEY>
ICAg8N3E/wM4o00/AMgAAA==
"""
| 0.902344 | 1 |
tests/base/test_view.py | bluetyson/discretize | 0 | 12780016 | <reponame>bluetyson/discretize
from __future__ import print_function
import unittest
import numpy as np
import matplotlib.pyplot as plt
import discretize
from discretize import Tests, utils
import pytest
np.random.seed(16)
TOL = 1e-1
class Cyl3DView(unittest.TestCase):
def setUp(self):
self.mesh = di... | 2.296875 | 2 |
canopy/io/adat/errors.py | SomaLogic/Canopy | 7 | 12780017 | class AdatReadError(Exception):
pass
| 1.101563 | 1 |
alipay/aop/api/domain/InsCoverage.py | snowxmas/alipay-sdk-python-all | 213 | 12780018 | <filename>alipay/aop/api/domain/InsCoverage.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class InsCoverage(object):
def __init__(self):
self._coverage_name = None
self._coverage_no = None
self._effect_end_time = None
... | 1.914063 | 2 |
pommermanLearn/models/pommer_q_embedding_rnn.py | FrankPfirmann/playground | 0 | 12780019 | from typing import Callable
import numpy as np
import torch
import torch.nn as nn
from util.data import transform_observation
class PommerQEmbeddingRNN(nn.Module):
def __init__(self, embedding_model):
super(PommerQEmbeddingRNN, self).__init__()
self.embedding_model = embedding_model
self.... | 2.671875 | 3 |
text_replace/presets/relative_url_prefixer.py | Salaah01/text-replace | 0 | 12780020 | <reponame>Salaah01/text-replace
"""Prepends some text to a relative URL."""
try:
import config # noqa: F401
except ModuleNotFoundError:
from . import config # noqa: F401
from replace import replace
def relative_url_prefixer(filePath: str, newText: str) -> None:
"""Prepends some text to a relative URL.... | 2.6875 | 3 |
potosnail.py | spe301/Potosnail | 0 | 12780021 | <filename>potosnail.py
import pandas as pd
import numpy as np
from math import log
from sklearn.svm import SVC, SVR
from sklearn.linear_model import LogisticRegression, LinearRegression
from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
from sklearn.cluster import KMeans
from sklearn.naive... | 1.90625 | 2 |
expense/__version__.py | mahasak/bearlord | 0 | 12780022 | <reponame>mahasak/bearlord<gh_stars>0
__version__ = "0.0.1"
__name__ = "expense-tracker"
__description__ = "Python API Wrapper for the Airtable API"
__author__ = "<NAME>"
__authoremail__ = "<EMAIL>"
__license__ = "The MIT License (MIT)"
__copyright__ = "Copyright 2020 <NAME>"
| 0.820313 | 1 |
Implicit/auth_server/Implicit_auth_server.py | YungYanix/auth-server-sample | 63 | 12780023 | <reponame>YungYanix/auth-server-sample
import json
#import ssl
import urllib.parse as urlparse
from auth import (authenticate_user_credentials, generate_access_token,
verify_client_info, JWT_LIFE_SPAN)
from flask import Flask, redirect, render_template, request
from urllib.parse import urlencode
a... | 2.625 | 3 |
example/search/faceset_create.py | FacePlusPlus/facepp-python-demo | 10 | 12780024 | <filename>example/search/faceset_create.py
# coding: utf-8
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
import requests
from config import API_KEY, API_SECRET, FACESET_CREATE_PATH
display_name = 'hello'
outer_id = 'fpp-demo'
tags = 'group1'
face_t... | 2.21875 | 2 |
assembler.py | Solomon1999/kivystudio | 1 | 12780025 | <filename>assembler.py
from kivy.uix.boxlayout import BoxLayout
from kivy.core.window import Window
from kivy.clock import Clock
import os
import sys
import traceback
from kivystudio.parser import emulate_file
from kivystudio.widgets.filemanager import filemanager
from kivystudio.components.screens import AndroidPh... | 2.1875 | 2 |
api/wecubek8s/wecubek8s/apps/plugin/utils.py | WeBankPartners/wecube-plugins-kubernetes | 6 | 12780026 | <filename>api/wecubek8s/wecubek8s/apps/plugin/utils.py
# coding=utf-8
from __future__ import absolute_import
import logging
import re
from talos.core import config
from talos.core.i18n import _
from wecubek8s.common import exceptions
CONF = config.CONF
LOG = logging.getLogger(__name__)
def escape_name(name):
... | 2.078125 | 2 |
imagetyperzapi2/imagetyperzapi.py | imagetyperz/bypasscaptcha | 0 | 12780027 | <filename>imagetyperzapi2/imagetyperzapi.py<gh_stars>0
# Imagetyperz captcha API
# -----------------------
# requests lib
try:
from requests import session
except:
raise Exception('requests package not installed, try with: \'pip2.7 install requests\'')
import os
from base64 import b64encode
# endpoints
# ----... | 2.1875 | 2 |
raspi/Camera_and_LTE/LTE_stream.py | blake-shaffer/avionics | 3 | 12780028 | # This script does the following:
# 1) Record H264 Video using PiCam at a maximum bitrate of 300 kbps
# 2) Stream video data to a local BytesIO object
# 3) Send raw data over LTE
# 4) Store raw data to an onboard file
# 5) Clears BytesIO object after network stream and file store
# 6) Interrupts and ends recording afte... | 3.046875 | 3 |
weasyprint/tests/w3_test_suite/web.py | Smylers/WeasyPrint | 0 | 12780029 | # coding: utf8
"""
weasyprint.tests.w3_test_suite.web
----------------------------------
A simple web application to run and inspect the results of
the W3C CSS 2.1 Test Suite.
See http://test.csswg.org/suites/css2.1/20110323/
:copyright: Copyright 2011-2012 <NAME> and contributors, see AUTHOR... | 2.78125 | 3 |
mlbozone_retrosheet_extraction.py | cat-astrophic/MLBozone | 0 | 12780030 | # This script parses MLB data from retrosheet and creates a dataframe
# Importing required modules
import pandas as pd
import glob
# Defining username + directory
username = ''
filepath = 'C:/Users/' + username + '/Documents/Data/mlbozone/'
# Create a list of all files in the raw_data subfolder
file... | 2.828125 | 3 |
test/run_pub_actor.py | F2011B/pyzac | 0 | 12780031 | <gh_stars>0
from pyzac import *
@pyzac_decorator(pub_addr="tcp://127.0.0.1:2000")
def publisher():
return 20
@pyzac_decorator(pub_addr="tcp://127.0.0.1:2001")
def publishertwo():
return 3
publisher()
publishertwo()
| 2.140625 | 2 |
tornado/setup.py | oberhamsi/FrameworkBenchmarks | 1 | 12780032 | <reponame>oberhamsi/FrameworkBenchmarks
from os.path import expanduser
from os import kill
import subprocess
import sys
import time
python = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python')
cwd = expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logfile, errfile):
subprocess.Popen(
... | 2.234375 | 2 |
settings.py | mr-karan/FinalYearCSE | 3 | 12780033 | <reponame>mr-karan/FinalYearCSE
import os
user_agent = 'when is my cakeday by /u/avinassh'
scopes = ['identity']
app_key = os.environ['APP_KEY']
app_secret = os.environ['APP_SECRET']
refresh_token = os.environ['REFRESH_TOKEN']
access_token = os.environ['ACCESS_TOKEN']
| 1.484375 | 1 |
scripts/land_sea_percentages.py | markmuetz/cosar_analysis | 0 | 12780034 | <gh_stars>0
# coding: utf-8
import iris
if __name__ == '__main__':
basedir = '/home/markmuetz/mirrors/rdf/um10.9_runs/archive/u-au197/land_sea_mask'
land_mask_cube = iris.load_cube(f'{basedir}/qrparm.mask')
land_mask = land_mask_cube.data[53:92, :]
# Same as in COSAR
num_cells = land_mask.shape[0... | 2.1875 | 2 |
backend/everpro/competition_tracking/api/competition_track.py | Ascensiony/EverPro-Intelligence-APIs | 1 | 12780035 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from six.moves.urllib.parse import urlencode, quote
from nltk.token... | 2.6875 | 3 |
final-project/audioquiz/views.py | krishna-vasudev/lightify | 0 | 12780036 | from django.shortcuts import render,redirect
from .models import QuesModel
from django.http import JsonResponse
# Create your views here.
def audioquiz(request):
quiz=QuesModel.objects.all()
if request.method == 'POST':
print(request.POST)
score = 0
wrong = 0
correct = 0
... | 2.515625 | 3 |
quadpy/ball/tools.py | gdmcbain/quadpy | 1 | 12780037 | # -*- coding: utf-8 -*-
#
from math import pi
import numpy
from .. import helpers
def show(scheme, backend="mpl"):
"""Displays scheme for 3D ball quadrature.
"""
helpers.backend_to_function[backend](
scheme.points,
scheme.weights,
volume=4.0 / 3.0 * pi,
edges=[],
b... | 3.234375 | 3 |
tests/matchers/test_StringMatcher.py | javierseixas/pyJsonAssert | 0 | 12780038 | import unittest
from pyjsonassert.matchers import StringMatcher
class TestStringMatcher(unittest.TestCase):
string = "asfasdf"
number_as_string = "12"
number = 12
float = 12.2
boolean = False
def test_should_identify_an_string(self):
assert StringMatcher.match(self.string) is True
... | 3.25 | 3 |
bsp/ls1cdev/key.py | penghongguang/loong | 15 | 12780039 | from machine import Pin
led1 = Pin(("LED1", 52), Pin.OUT_PP)
led2 = Pin(("LED2", 53), Pin.OUT_PP)
key1 = Pin(("KEY1", 85), Pin.IN, Pin.PULL_UP)
key2 = Pin(("KEY2", 86), Pin.IN, Pin.PULL_UP)
while True:
if key1.value():
led1.value(1)
else:
led1.value(0)
if key2.value():
led2.value(1)
... | 3.28125 | 3 |
02/premier.py | alexprengere/PythonExercises | 23 | 12780040 | <reponame>alexprengere/PythonExercises
#!/usr/bin/env python
import sys
def is_prime(n):
"""Returns True is n is prime, False otherwise.
>>> is_prime(4)
False
>>> is_prime(7)
True
"""
if n <= 1:
return False
for i in xrange(2, n):
if n % i == 0:
... | 4.375 | 4 |
yeast_ubi/gpmdb_ptm_bot.py | RonBeavis/StandardsAndPractices | 0 | 12780041 | <gh_stars>0
#
# Copyright © 2021 <NAME>
# Licensed under Apache License, Version 2.0, January 2004
#
# Takes a list of protein accession numbers in a file and generates
# a list of lysine residues that have been observed with ubiquitination
# and the number of times the ubiquitination has been observed.
import sys
im... | 3.015625 | 3 |
inventory/suppliers/admin.py | cnobile2012/inventory | 10 | 12780042 | # -*- coding: utf-8 -*-
#
# inventory/suppliers/admin.py
#
"""
Supplier Admin
"""
__docformat__ = "restructuredtext en"
from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from inventory.common.admin_mixins import UserAdminMixin, UpdaterFilter
from .models import Supplier
#
# Su... | 1.921875 | 2 |
blackpixels.py | Pranit18De/Removing-Hand-Written-Annotations | 2 | 12780043 | <reponame>Pranit18De/Removing-Hand-Written-Annotations
import cv2
import numpy
import sys
from scipy.misc import toimage
from matplotlib import pyplot as plt
from PIL import Image
sys.setrecursionlimit(1500000)
src = cv2.imread('imgbin.jpg', 0)
arr=numpy.ndarray.tolist(src)
bp=[]
l1=[]
arr1=[]
for i in range(len(arr))... | 2.4375 | 2 |
sidekick/models/__init__.py | cybera/netbox_sidekick | 1 | 12780044 | <reponame>cybera/netbox_sidekick
from .accounting import AccountingSource # noqa: F401
from .accounting import AccountingSourceCounter # noqa: F401
from .accounting import AccountingProfile # noqa: F401
from .accounting import BandwidthProfile # noqa: F401
fro... | 1.257813 | 1 |
datawire/views/api/collections.py | arc64/datawi.re | 2 | 12780045 | <filename>datawire/views/api/collections.py
from flask import Blueprint # , request
from flask.ext.login import current_user
from apikit import obj_or_404, jsonify, Pager, request_data
from datawire.model import Collection, db
from datawire import authz
blueprint = Blueprint('collections', __name__)
@blueprint.rou... | 2.21875 | 2 |
vestlus/forms/__init__.py | lehvitus/vestlus | 12 | 12780046 | <reponame>lehvitus/vestlus
# vestlus:forms
from .channel import ChannelForm
from .message import MessageForm
from .message import PrivateMessageForm
from .message import GroupMessageForm
from .membership import MembershipForm
| 1.117188 | 1 |
partners_histo.py | ccicconetti/cordis-scripts | 2 | 12780047 | <gh_stars>1-10
#!/usr/bin/python
import csv
import argparse
parser = argparse.ArgumentParser(
description='Parse the H2020 cordis csv file and produce statistics about participants',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("--input", type=str,
default='c... | 3.453125 | 3 |
app.py | cerule7/exchange-website | 0 | 12780048 | #----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
from flask import Flask, render_template, request
from flask_basicauth import BasicAuth
# from flask.ext.sqlalchemy import SQLAlchemy
import logging
fr... | 2.5 | 2 |
src/backend/apps/media/__init__.py | Vixx-X/ati-project | 0 | 12780049 | <reponame>Vixx-X/ati-project<filename>src/backend/apps/media/__init__.py<gh_stars>0
"""
Media module
"""
from flask import Blueprint
bp = Blueprint("media", __name__)
from . import urls
| 1.546875 | 2 |
src/base/exceptions.py | system-design-2/user-service | 0 | 12780050 | from rest_framework import exceptions, status
from rest_framework.views import Response, exception_handler
def custom_exception_handler(exc, context):
# Call REST framework's default exception handler first to get the standard error response.
response = exception_handler(exc, context)
# if there is an In... | 2.484375 | 2 |