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 |
|---|---|---|---|---|---|---|
applications/popart/resnext_inference/resnext_inference_launch.py | Splendon/examples | 0 | 36900 | # Copyright 2019 Graphcore Ltd.
import time
from datetime import datetime
import os
from absl import app, flags
import subprocess
import re
import statistics
"""
This program launches subprocesses to handle data loading and resnext101 inference.
It can also be used to perform inference on other ONNX CNNs that take Im... | 2.5 | 2 |
src/ultimateml/dummy.py | EmilMachine/ultimateml | 0 | 36901 | <filename>src/ultimateml/dummy.py
def fancyfunction():
return 42 | 1.289063 | 1 |
src/main.py | EfficientElevator/Simulation | 1 | 36902 | """
Author: <NAME>
Test simulation functionality
"""
print("Test")
| 0.789063 | 1 |
tests/preprocessing/test_preprocessing_check.py | lshtm-gis/WHO_PHSM_Cleaning | 0 | 36903 | import pytest
import pandas as pd
from src.preprocess import check
class Test_check_column_names:
def test_check_column_names(self):
records = pd.DataFrame({'a': [1]})
config = pd.DataFrame({'column': ['a'], 'dataset': ['ACAPS']})
res = check.check_column_names(records, config, log=False... | 2.421875 | 2 |
Lib/site-packages/proboscis/sorting.py | Kronos3/pyexec | 25 | 36904 | <filename>Lib/site-packages/proboscis/sorting.py<gh_stars>10-100
# Copyright (c) 2011 Rackspace
# 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
#
# htt... | 2.46875 | 2 |
backoffice/migrations/0019_auto_20211010_1210.py | Psemp/artsetforme_public | 0 | 36905 | <gh_stars>0
# Generated by Django 3.2.7 on 2021-10-10 10:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backoffice', '0018_auto_20210929_1112'),
]
operations = [
migrations.RemoveField(
model_name='newsletter',
name=... | 1.429688 | 1 |
official/cv/yolov3_darknet53/eval.py | mindspore-ai/models | 77 | 36906 | <gh_stars>10-100
# Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# 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 appli... | 2.0625 | 2 |
ims/upload/browser/factories.py | imsweb/ims.upload | 0 | 36907 | <filename>ims/upload/browser/factories.py<gh_stars>0
import plone.api
from plone.app.content.browser.folderfactories import FolderFactoriesView
class UploadFolderFactoriesView(FolderFactoriesView):
""" Replaces the link for Add File dropdown with a link to our upload page """
def addable_types(self, include=... | 2.109375 | 2 |
literal/apps/order/tests/test_validators.py | spanickroon/Text-From-Photo-Django-API | 0 | 36908 | from unittest import mock
from django.test import TestCase
from parameterized import param, parameterized
from rest_framework import validators
from apps.order.constants import (
EXTENSION_ERROR_MESSAGE,
MAX_IMAGE_SIZE,
MAX_IMAGE_SIZE_ERROR_MESSAGE,
)
from apps.order.validators import FileValidator
clas... | 2.484375 | 2 |
gocardless_pro/services/billing_request_flows_service.py | gocardless/gocardless-pro-python | 30 | 36909 | <gh_stars>10-100
# WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#
from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors
class BillingRequestFlowsService(base_service.BaseService):
"""Service class th... | 2.375 | 2 |
src/pathrev/cli.py | pathwayforte/reproducibility-survey | 1 | 36910 | # -*- coding: utf-8 -*-
"""Command line interface."""
import logging
import click
from pathrev.pipeline import (
do_gsea, do_preranked,
)
logger = logging.getLogger(__name__)
@click.group(help='pathrev')
def main():
"""Run pathrev."""
logging.basicConfig(format="%(asctime)s - %(levelname)s - %(name)s -... | 2.328125 | 2 |
parsl/monitoring/monitoring_base.py | benclifford/parsl | 0 | 36911 | import logging
from parsl.monitoring.handler import DatabaseHandler
from parsl.monitoring.handler import RemoteHandler
from parsl.utils import RepresentationMixin
class NullHandler(logging.Handler):
"""Setup default logging to /dev/null since this is library."""
def emit(self, record):
pass
class M... | 2.59375 | 3 |
music/class_/time/atom.py | jedhsu/music | 0 | 36912 | <filename>music/class_/time/atom.py
"""
*Atom*
Smallest controllable unit of space.
"""
from dataclasses import dataclass
from typing import Sequence
from ._space import Space
from .quark import Quark
__all__ = ["Atom"]
@dataclass
class Atom(
tuple[Quark],
Space,
):
index: int
def __init... | 3.296875 | 3 |
Main/bakend.py | avinsit123/Precog_Intern_Assignment | 0 | 36913 | from flask import Flask,request,render_template
import numpy as np
from Reccomending_functions import item_item_cf,user_user_cf,rank_matrix_factorize
from Database_connector import fetch_from_database
import random
#ML Packages
asd = []
app = Flask(__name__)
@app.route('/')
def index():
global asd
randindex = [... | 2.375 | 2 |
wcpan/telegram/api.py | legnaleurc/wcpan.telegram | 7 | 36914 | <reponame>legnaleurc/wcpan.telegram
import json
from typing import List, Awaitable, Union
from tornado import httpclient as thc, web as tw, httputil as thu
from . import types, util
_API_TEMPLATE = 'https://api.telegram.org/bot{api_token}/{api_method}'
ReplyMarkup = Union[
types.InlineKeyboardMarkup,
type... | 2.25 | 2 |
pyapns_client/exceptions.py | rissicay/pyapns_client | 17 | 36915 | <reponame>rissicay/pyapns_client
import pytz
from datetime import datetime
# BASE
class APNSException(Exception):
"""
The base class for all exceptions.
"""
def __init__(self, status_code, apns_id):
super().__init__()
# The HTTP status code retuened by APNs.
# A 200 value in... | 2.96875 | 3 |
vor/backends/name/census_1990.py | ryankanno/vor | 0 | 36916 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .base import NameProvider
from .base import PROVIDERS
from vor.human import Gender
from py_utilities.decorators import run_once
import os
import random
class Census1990Provider(NameProvider):
KEYS = {
'provider': 'Census1990',
'm_first': 'male:f... | 2.90625 | 3 |
lib/source.py | imamol/license_automation | 0 | 36917 | <reponame>imamol/license_automation
import requests
from bs4 import BeautifulSoup
def verfiy_package_names():
with open('final_output/remaining_list.csv') as file:
orig_packages = file.readlines()
bad_count = 0
good_count = 0
count = 0
dict_packages = {}
... | 3.046875 | 3 |
Uche Clare/Phase 1/Python Basic 2/Day 17/Task 2.py | CodedLadiesInnovateTech/-python-challenge-solutions | 6 | 36918 | <filename>Uche Clare/Phase 1/Python Basic 2/Day 17/Task 2.py
#Write a Python program to create all possible strings by using 'a', 'e', 'i', 'o', 'u'. Use the characters exactly once.
import random
vowels = ['a', 'e', 'i', 'o', 'u']
random.shuffle(vowels)
char = "".join(vowels)
print(char)
| 4.1875 | 4 |
pdf_generator/views.py | ianvieira/django-pdf-generator | 0 | 36919 | <gh_stars>0
import os
from django.shortcuts import render
from .settings import pdf_settings
def pdf_html(request, html_key):
filename = '%s.html' % html_key
response = render(request, 'pdf_generator/%s' % filename)
os.remove(os.path.join(pdf_settings.TEMPLATES_DIR, filename))
return response | 1.765625 | 2 |
netw_preprocess.py | lynx-delta/adapted_u-net_dense_crfs | 0 | 36920 | <gh_stars>0
from os import listdir, makedirs
from os.path import isfile, isdir, join
import random
import warnings
warnings.filterwarnings("ignore")
import numpy as np
from skimage import io
from skimage import transform as trf
class DataPreprocessor():
'''Class for data preprocessing'''
d... | 2.25 | 2 |
FusionIIIT/applications/academic_procedures/urls.py | paras11agarwal/FusionIIIT | 0 | 36921 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'addCourse/', views.add_course, name='addCourse'),
url(r'^dropCourse/', views.drop_course, name='dropCourse'),
]
| 1.609375 | 2 |
playground/distributions/tanh_gaussian.py | brandontrabucco/playground | 3 | 36922 | <gh_stars>1-10
"""Author: <NAME>, Copyright 2019, MIT License"""
from playground.distributions.gaussian import Gaussian
import tensorflow as tf
import math
class TanhGaussian(Gaussian):
def __init__(
self,
model,
std=1.0,
tau=0.01,
optimizer_class=tf.... | 2.734375 | 3 |
tests/test_aiotapioca.py | ilindrey/aiotapioca-wrapper | 0 | 36923 | import pickle
from collections import OrderedDict
from itertools import product
import orjson
import pytest
import pytest_asyncio
import xmltodict
from aiohttp.client_reqrep import ClientResponse
from pydantic import BaseModel
from yarl import URL
from aiotapioca.adapters import TapiocaAdapter, generate_wrapper_from_... | 1.945313 | 2 |
sandal.py | ImaduddinAMajid/webshop-scraper | 0 | 36924 | # -*- coding: utf-8 -*-
import json
import scrapy
class SandalSpider(scrapy.Spider):
name = "sandal"
api_url = "https://www.skoringen.dk/sandaler-dame/?page={}"
start_urls = [api_url.format(1)]
def parse(self, response):
if response.status == 404:
return
sandals = respons... | 2.828125 | 3 |
app/services/mail/events.py | maxzhenzhera/my_vocab_backend | 0 | 36925 | <filename>app/services/mail/events.py
import logging
from fastapi import FastAPI
from fastapi_mail import ConnectionConfig as MailConnectionSettings
from .state import MailState
__all__ = ['init_mail']
logger = logging.getLogger(__name__)
def init_mail(app: FastAPI, settings: MailConnectionSettings) -> None:
... | 2.171875 | 2 |
csv2json.py | gaguevaras/lideresviz | 0 | 36926 | import csv
import json
# Open the CSV
f = open( 'events.csv', 'rU' )
# Change each fieldname to the appropriate field name. I know, so difficult.
reader = csv.DictReader( f, fieldnames = ("id","Nombre","datasketch","pacifista","ojoalapaz","indepaz","ONU","Defensoria","Unidad de Victimas","Somos Defensores"... | 3.421875 | 3 |
installation/templates/configuration/auth.py | piwaniuk/critic | 216 | 36927 | <gh_stars>100-1000
# -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2013 <NAME>, Opera Software ASA
#
# 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/... | 1.414063 | 1 |
reports/migrations/0001_initial.py | medfiras/Bazinga | 0 | 36928 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('events', '__first__'),
migrations.swappable_dependency(... | 1.703125 | 2 |
Utils/Classes/osuuser.py | HeapUnderfl0w/Phaazebot | 0 | 36929 | import datetime
from Utils.Classes.undefined import UNDEFINED
from Utils.Classes.apiclass import APIClass
class OsuUser(APIClass):
"""
Represents a osu! user with all its stats in a specific game mode
"""
def __repr__(self):
return f"<{self.__class__.__name__} name='{self.username}' mode='{self.mode}'>"
def _... | 2.796875 | 3 |
Lib/site-packages/fair_identifiers_client/helpers.py | fochoao/cpython | 0 | 36930 | <reponame>fochoao/cpython
import json
# Pattern (and code) taken from:
# https://gist.github.com/mivade/384c2c41c3a29c637cb6c603d4197f9f
FILE_SPECIFIER = 'file://'
def argument(*name_or_flags, **kwargs):
"""Convenience function to properly format arguments to pass to the
subcommand decorator.
"""
args... | 3 | 3 |
Python/GenericStructures/Stack.py | adeeconometrics/Algorithms | 0 | 36931 | <reponame>adeeconometrics/Algorithms<gh_stars>0
from typing import TypeVar, Generic
T = TypeVar("T")
class Node(Generic[T]):
next: Node[T] = None
def __init__(self, data: T) -> None:
self.data = data
class Stack(Generic[T]):
top: Node[T] = None
size: int = 0
def push(s... | 3.546875 | 4 |
content/ft_para_todos/load_content.py | mobilizaFT/mobiliza-ft-site | 1 | 36932 | <filename>content/ft_para_todos/load_content.py
from markdown2 import markdown
from lxml import html
import os
def load_ft_para_todos_posts(dict):
posts_dir = 'content/ft_para_todos/blog/'
all_data = []
filename = posts_dir + 'posts.md'
content = html.fromstring(markdown(open(filename, 'r').read()))
... | 2.8125 | 3 |
sorteio.py | laurocjs/criptomigo | 0 | 36933 | # coding= utf-8
import random
from Crypto.PublicKey import RSA
# Função para sortear os pares
def sorteiaPares(listaDeParticipantes): # Recebe lista com nome dos participantes
# e o valor é a chave pública dela
dictSorteado = {} # Dict a ser retornado
numeroDePar... | 3.546875 | 4 |
src/ds_algs/list_binary_tree.py | E1mir/PySandbox | 0 | 36934 | def binary_tree(r):
"""
:param r: This is root node
:return: returns tree
"""
return [r, [], []]
def insert_left(root, new_branch):
"""
:param root: current root of the tree
:param new_branch: new branch for a tree
:return: updated root of the tree
"""
t = root.pop(1)
i... | 4.125 | 4 |
research/recommend/DIEN/src/utils.py | mindspore-ai/models | 77 | 36935 | <filename>research/recommend/DIEN/src/utils.py
# Copyright 2022 Huawei Technologies Co., Ltd
#
# 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
#
#... | 2.21875 | 2 |
tests/network_speedtest.py | cloud-mon/server-test | 0 | 36936 | import speedtest
def perform_test():
s = speedtest.Speedtest()
best_server = s.get_best_server()
print('Best server: ')
print(best_server['name'])
print('Perform upload app:')
result = s.upload()
print('Done:' + str(result / 1024 / 1024) + ' MBit/s')
print('Perform download app:')
... | 2.671875 | 3 |
ferris/controllers/oauth.py | palladius/gae-ferris-ricc | 2 | 36937 | <filename>ferris/controllers/oauth.py
from __future__ import absolute_import
from google.appengine.ext import ndb
from ferris.core.controller import Controller, route, route_with
from oauth2client.client import OAuth2WebServerFlow
from ferris.core.oauth2.user_credentials import UserCredentials as OAuth2UserCredentials
... | 2.28125 | 2 |
data_scripts/weeds.py | bayerhealth/bayerhealth | 0 | 36938 |
import os
import pandas as pd
import shutil
os.chdir("../Downloads/DeepWeeds_Images_256")
try:
os.mkdir("train")
os.mkdir("val")
except:
pass
train = pd.read_csv("../train_set_labels.csv")
val = pd.read_csv("../test_set_labels.csv")
print(train)
for j,i in train.iterrows():
try:
os.mkdir("tr... | 2.578125 | 3 |
auctionbot/users/migrations/0006_auto_20180218_1311.py | netvigator/auctions | 0 | 36939 | <reponame>netvigator/auctions
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-02-18 06:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0005_auto_20180107_2152'),
]
operations = [
... | 1.414063 | 1 |
search_engines/http_client.py | soxoj/async-search-scraper | 5 | 36940 | import aiohttp
from collections import namedtuple
from aiohttp_socks import ProxyConnector
from .config import TIMEOUT, PROXY, USER_AGENT
from . import utils as utl
class HttpClient(object):
'''Performs HTTP requests. A `aiohttp` wrapper, essentialy'''
def __init__(self, timeout=TIMEOUT, proxy=PR... | 2.609375 | 3 |
Python Advanced/Advanced/Multidimensional Lists/Exercise - 2/Task07.py | IvanTodorovBG/SoftUni | 1 | 36941 | <filename>Python Advanced/Advanced/Multidimensional Lists/Exercise - 2/Task07.py
def is_valid(r, c, size):
if 0 <= r < size and 0 <= c < size:
return True
return False
count_presents = int(input())
n = int(input())
matrix = []
nice_kids_count = 0
given_to_nice = 0
for _ in range(n):
data = input... | 3.796875 | 4 |
Cloud Services and Computing/Amazon AWS/Lambdas/Lambdas-Practice-Web-Examples/aws-tutorial-code-master/textract/bounding-box-kv-tables/flask-app/app.py | okara83/Becoming-a-Data-Scientist | 0 | 36942 | import os
import time
from flask import Flask, render_template, request
from aws_requests_auth.aws_auth import AWSRequestsAuth
import requests
import uuid
import base64
import shutil
from config import Config
app = Flask(__name__)
config = Config()
@app.route("/", methods=["GET", "POST"])
def index():
if "uploa... | 2.328125 | 2 |
tests/integration/test_project.py | gitter-badger/a2ml | 30 | 36943 | <gh_stars>10-100
import pytest
from a2ml.cmdl.cmdl import cmdl
class TestProjectCLI():
def test_create_list_delete(self, runner, log, project):
result = runner.invoke(cmdl, ['project', 'delete', 'cli-integration-test'])
result = runner.invoke(cmdl, ['project', 'select', 'cli-integration-test'])
... | 2.25 | 2 |
pyat/tools.py | matt-hayden/PyAt | 0 | 36944 | <filename>pyat/tools.py
import subprocess
import sys
from . import debug, info, warning, error, fatal
from . import AT, BATCH
from .jobs import _get_jobs
if sys.platform.startswith('win'):
GREP='GREP.EXE'
else:
GREP='grep'
def search(grep_args, at_encoding='UTF-8'):
for job in _get_jobs():
jid, started, queue... | 2.046875 | 2 |
tests/test_main_window.py | Ceystyle/easyp2p | 4 | 36945 | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 <NAME>
"""Module containing all tests for the main window of easyp2p."""
from datetime import date, timedelta
import os
import sys
import unittest.mock
from PyQt5.QtCore import QLocale
from PyQt5.QtWidgets import QApplication, QCheckBox, QLineEdit
import easyp2p.pl... | 2.5 | 2 |
pineboolib/fllegacy/flserialport.py | juanjosepablos/pineboo | 0 | 36946 | <reponame>juanjosepablos/pineboo<filename>pineboolib/fllegacy/flserialport.py
"""Flserial por module."""
from PyQt5 import QtCore
from pineboolib.core import decorators
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from PyQt5 import QtSerialPort # type: ignore [attr-defined]
class BaudRateType(object):
... | 2.25 | 2 |
test4.py | JarkJiao/Python_learning_TestCase | 0 | 36947 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
year = int(raw_input('years:\n'))
month = int(raw_input('month:\n'))
day = int(raw_input('day:\n'))
months = (0,31,59,90,120,151,181,212,243,273,304,334)
if 0< month <=12:
sum = months[month-1]
else:
print '日期错误'
sum+=day
leap = 0
if (year %400==0) or ((year % 4 ==... | 4.0625 | 4 |
nsot/util/__init__.py | BunkersCo/nsot | 0 | 36948 | """
Utilities used across the project.
"""
# Core
from . import core
from .core import * # noqa
# Stats
from . import stats
from .stats import * # noqa
__all__ = []
__all__.extend(core.__all__)
__all__.extend(stats.__all__)
| 1.070313 | 1 |
task3/test_openbrewerydb.py | rokimaru/rest_api_autotests | 0 | 36949 | <filename>task3/test_openbrewerydb.py
""" Тесты api сайта https://www.openbrewerydb.org/ """
import pytest
import requests
from task3.methods import BrewerySiteMethods
class TestJsonPlaceholderSite:
""" Тесты api сайта https://www.openbrewerydb.org/ """
def test_openbrewerydb_1(self):
""" Проверка, ... | 2.703125 | 3 |
TVQAplus/eval/utils.py | slewyh/vqa | 80 | 36950 | import json
try:
import cPickle as pickle
except:
import pickle
def save_json(data, file_path):
with open(file_path, "w") as f:
json.dump(data, f)
def save_json_pretty(data, file_path):
"""save formatted json, use this one for some json config files"""
with open(file_path, "w") as f:
... | 3.0625 | 3 |
apps/finance_request/models.py | MegaSoftVision/finance_credit | 0 | 36951 | <gh_stars>0
from django.db import models
from apps.users.models import User
from django.core.validators import MaxValueValidator, MinValueValidator
class Client(models.Model):
GOOD = 'gd'
REGULAR = 'rg'
BAD = 'bd'
NULL = 'nl'
DEBT_SCORE_CHOICES = [
(GOOD, 'Bueno'),
(REGULAR, 'Regul... | 2.140625 | 2 |
Code/mreset.py | andrewwhipple/MeowgicMatt | 0 | 36952 | #Meowgic Matt reset module
import os
import json
#Debug function to call out that the module successfully loaded.
def meow():
print("mreset loaded")
#Resets Meowgic Matt to factory conditions, DELETING EVERYTHING CURRENTLY IN SUBFOLDERS.
def reset():
os.system("rm -rf ../Edited/")
os.system("rm -rf ... | 2.421875 | 2 |
minecraftQuest.py | prathimacode-hub/Toonslate-Gags | 2 | 36953 | # Setup
opt = ["yes", "no"]
directions = ["left", "right", "forward", "backward"]
# Introduction
name = input("What is your name, HaCKaToOnEr ?\n")
print("Welcome to Toonslate island , " + name + " Let us go on a Minecraft quest!")
print("You find yourself in front of a abandoned mineshaft.")
print("Can yo... | 4 | 4 |
soundbay/utils/checkpoint_utils.py | deep-voice/soundbay | 7 | 36954 | <filename>soundbay/utils/checkpoint_utils.py
from typing import Union
import boto3
from omegaconf import OmegaConf
from pathlib import Path
from tqdm import tqdm
def walk(input_path):
"""
helper function to yield folder's file content
Input:
input_path: the path of the folder
Output:
g... | 2.5625 | 3 |
rubicon_ml/viz/__init__.py | fdosani/rubicon-ml | 0 | 36955 | <filename>rubicon_ml/viz/__init__.py<gh_stars>0
from rubicon_ml.viz.dashboard import Dashboard
from rubicon_ml.viz.dataframe_plot import DataframePlot
from rubicon_ml.viz.experiments_table import ExperimentsTable
from rubicon_ml.viz.metric_correlation_plot import MetricCorrelationPlot
from rubicon_ml.viz.metric_lists_c... | 1.484375 | 1 |
run.py | CjwRiver/apiAutoTest | 0 | 36956 | <gh_stars>0
from test.conftest import pytest
from tools import logger
from tools.read_file import ReadFile
from tools.send_email import EmailServe
import os
import shutil
report = ReadFile.read_config('$.file_path.report')
logfile = ReadFile.read_config('$.file_path.log')
file_path = ReadFile.read_config('$.file_path'... | 2.140625 | 2 |
database/models/util.py | henryzzz093/data_pipeline2 | 0 | 36957 | import sqlalchemy as sa
import numpy as np
import datetime as dt
from faker import Faker
from jinja2 import Environment, PackageLoader
from database.models.core import (
Base,
Products,
Customers,
TransactionDetails,
Transactions,
)
import logging
logging.basicConfig()
logger = logging.getLogger(... | 2.375 | 2 |
test_platform/api_app/user_view.py | juxiaona/test_dev05 | 1 | 36958 | <filename>test_platform/api_app/user_view.py
from rest_framework import routers, serializers, viewsets
from django.contrib.auth.models import User
from api_app.serializer import UserSerializer
# 视图类
class UserViewSet(viewsets.ModelViewSet):
queryset = User.objects.all()
serializer_class = UserSerializer
... | 2.4375 | 2 |
river/metrics/cluster/ssb.py | WLDCH/river | 1 | 36959 | from river import stats, utils
from . import base
class SSB(base.ClusteringMetric):
"""Sum-of-Squares Between Clusters (SSB).
The Sum-of-Squares Between Clusters is the weighted mean of the squares of distances
between cluster centers to the mean value of the whole dataset.
Examples
--------
... | 3.59375 | 4 |
elliot/utils/read.py | gategill/elliot | 175 | 36960 | <reponame>gategill/elliot<filename>elliot/utils/read.py
"""
Module description:
"""
__version__ = '0.3.1'
__author__ = '<NAME>, <NAME>'
__email__ = '<EMAIL>, <EMAIL>'
import pandas as pd
import configparser
import pickle
import numpy as np
import os
from types import SimpleNamespace
def read_csv(filename):
"""... | 2.9375 | 3 |
examples/Mujoco/path_and_orientation_planner_bell_shaped.py | elsuizo/abr_control | 1 | 36961 | <gh_stars>1-10
"""
Running operational space control using Mujoco. The controller will
move the end-effector to the target object's position and orientation.
This example controls all 6 degrees of freedom (position and orientation),
and applies a second order path planner to both position and orientation targets
Afte... | 2.890625 | 3 |
birg_chemometrics_tools/peak_finding/cwt.py | BiRG/chemometrics_tools | 0 | 36962 | <gh_stars>0
import numpy as np
from collections import deque
from scipy.signal import cwt, ricker
from scipy.stats import mode, scoreatpercentile
def local_extreme(data, comparator,
axis=0, order=1, take_mode='clip'):
if (int(order) != order) or (order < 1):
raise ValueError('Order must... | 1.953125 | 2 |
autorop/call/__init__.py | mariuszskon/autorop | 15 | 36963 | from autorop.call.Custom import Custom
from autorop.call.SystemBinSh import SystemBinSh
| 1.195313 | 1 |
exams/models.py | akmohtashami/mcexam | 0 | 36964 | <gh_stars>0
# -*- coding: utf-8 -*-
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext as _
from users.models import Member
from adminsortable.models import Sortable
from adminsortable.fields import SortableForeignKey
from django.template import Template, Contex... | 2.25 | 2 |
happy/HappyLinkList.py | yunhanw-google/happy | 42 | 36965 | <filename>happy/HappyLinkList.py
#!/usr/bin/env python3
#
# Copyright (c) 2015-2017 Nest Labs, 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
#
# ... | 2.578125 | 3 |
monteCarlo_investopedia.py | sztang/py_practice | 0 | 36966 | #!/usr/bin/env python3
# Monte Carlo Simulation: Dice Game
# Based on Investopedia: Creating a Monte Carlo Simulation
# investopedia.com/articles/investing/093015/create-monte-carlo-simulation-using-excel.asp\
# Here's how the dice game rolls:
# The player throws three dice that have 6 sides 3 times.
# If the tota... | 4.46875 | 4 |
examples/run_parametric_elliptic_optimal_control_alpha.py | s274001/PINA | 4 | 36967 | import numpy as np
import torch
import argparse
from pina.pinn import PINN
from pina.ppinn import ParametricPINN as pPINN
from pina.label_tensor import LabelTensor
from torch.nn import ReLU, Tanh, Softplus
from pina.adaptive_functions.adaptive_softplus import AdaptiveSoftplus
from problems.parametric_elliptic_optimal_c... | 2.140625 | 2 |
todolist/api/urls.py | yusukhobok/TodoAPI | 0 | 36968 | <reponame>yusukhobok/TodoAPI
from django.urls import path
from .views import TodoViewSet
from rest_framework_bulk.routes import BulkRouter
from rest_framework import routers
router = BulkRouter()
router.register(r'', TodoViewSet, basename='todos')
urlpatterns = router.urls | 1.75 | 2 |
controllers/portal.py | R-E-A-L-iT/odoo-proportals-module | 0 | 36969 | <gh_stars>0
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import binascii
from odoo import fields, http, _
from odoo.exceptions import AccessError, MissingError, UserError
from odoo.http import request
from odoo.addons.payment.controllers.portal import PaymentProce... | 2.03125 | 2 |
google/cloud/videointelligence/v1/videointelligence-v1-py/google/cloud/videointelligence/__init__.py | googleapis/googleapis-gen | 7 | 36970 | # -*- coding: utf-8 -*-
# Copyright 2020 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... | 0.902344 | 1 |
whileIF.py | JulianConneely/Python-Problem-Sets | 0 | 36971 | #<NAME>, 21/03/18
#WhileIF loop with increment
#first 5 is printed
#then it is decreased to 4
#as it is not satisfying i<=2
#it moves on
#then 4 is printed
#then it is decreased to 3
#as it is not satisfying i<=2,it moves on
#then 3 is printed
#then it is decreased to 2
#as now i<=2 has completely satisfied, the loop ... | 3.90625 | 4 |
board/boardmanager.py | nh-99/COS125-OhMyCheckers | 0 | 36972 | from colorama import Style, Fore
import gamepiece
header = ' 0 1 2 3 4 5 6 7'
footer = ' +---+---+---+---+---+---+---+---+'
def construct_board():
print("\n" * 100)
print Fore.CYAN + "______ _ _ _ _____ _ _"
print "| ___ \ (_) | / __ \ | | | ... | 3 | 3 |
config.py | dufftt/social_distance_detector | 0 | 36973 | MIN_CONF = 0.3
NMS_THRESH = 0.3
USE_GPU = False
MIN_DISTANCE = 50
WEIGHT_PATH = "yolov3-tiny.weights"
CONFIG_PATH = "yolov3-tiny.cfg" | 1.109375 | 1 |
python/testData/docstrings/googleNoClosingParenthesisAfterParamType.py | jnthn/intellij-community | 2 | 36974 | <filename>python/testData/docstrings/googleNoClosingParenthesisAfterParamType.py
def f(x, y):
"""
Args:
x (Foo
y (Bar : description
""" | 1.78125 | 2 |
analysisAPI/utilities.py | steuwe/coco-analyze | 0 | 36975 | <reponame>steuwe/coco-analyze<gh_stars>0
## imports
import os, sys, time, json
import numpy as np
from colour import Color
import matplotlib.pyplot as plt
import matplotlib.path as mplPath
from matplotlib.collections import PatchCollection
from matplotlib.patches import Polygon
from skimage.transform import resize as i... | 1.914063 | 2 |
lib/python/batch_sim/gcloud_fakes.py | leozz37/makani | 1,178 | 36976 | # Copyright 2020 Makani Technologies 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 agreed to... | 2.5625 | 3 |
sequential_inference/envs/robosuite_envs/wipe/wipe_located.py | cvoelcker/sequential_inference | 0 | 36977 | <reponame>cvoelcker/sequential_inference
import numpy as np
import multiprocessing
from robosuite.environments.manipulation.wipe import Wipe, DEFAULT_WIPE_CONFIG
from robosuite.models.tasks import ManipulationTask
from .wipe_located_arena import WipeLocatedArena
class WipeLocated(Wipe):
def __init__(
sel... | 2.15625 | 2 |
tpp_tensorflow/models/dense.py | gfrogat/tpp_tensorflow | 0 | 36978 | <reponame>gfrogat/tpp_tensorflow<gh_stars>0
from tensorflow.keras import layers, Model, regularizers
class DenseHead(Model):
def __init__(self, params):
super(DenseHead, self).__init__()
# Correctly handle SELU
dropout = layers.AlphaDropout if params.activation == "selu" else layers.Drop... | 2.328125 | 2 |
boundlexx/celery/management/commands/purge_in_progress.py | AngellusMortis/boundlexx | 1 | 36979 | import djclick as click
from django_celery_results.models import TaskResult
@click.command()
def command():
TaskResult.objects.filter(status="STARTED").delete()
| 2.03125 | 2 |
Example Device - Thermostat.indigoPlugin/Contents/Server Plugin/plugin.py | IndigoDomotics/IndigoSDK | 0 | 36980 | <gh_stars>0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
####################
# Copyright (c) 2022, Perceptive Automation, LLC. All rights reserved.
# https://www.indigodomo.com
import indigo
import os
import sys
import random
# Note the "indigo" module is automatically imported and made available inside
# our glo... | 2.078125 | 2 |
dp_tornado/helper/security/web/__init__.py | donghak-shin/dp-tornado | 18 | 36981 | <reponame>donghak-shin/dp-tornado
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from dp_tornado.engine.helper import Helper as dpHelper
class WebHelper(dpHelper):
pass
| 1.429688 | 1 |
LeetCode/python3/136.py | ZintrulCre/LeetCode_Archiver | 279 | 36982 | class Solution:
def singleNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
k = 0
for n in nums:
k ^= n
return k | 3.171875 | 3 |
src/genie/libs/parser/iosxr/tests/ShowVrrpSummary/cli/equal/golden_output_1_expected.py | nielsvanhooy/genieparser | 0 | 36983 | <reponame>nielsvanhooy/genieparser<gh_stars>0
expected_output = {
"address_family":{
"ipv4":{
"bfd_sessions_down":0,
"bfd_sessions_inactive":1,
"bfd_sessions_up":0,
"intf_down":1,
"intf_up":1,
"num_bfd_sessions":1,
"num_intf":2,
"state":{
... | 1.53125 | 2 |
characterCrowd.py | campbellwmorgan/charactercrowd | 1 | 36984 | """
Plugin for manually animating
large numbers of rigs given a small number of source rigs
See README for installation instructions and usage
"""
from pymel.api.plugins import Command
import maya.OpenMayaMPx as OpenMayaMPx
from characterCrowdSrc.characterCrowd import *
class characterCrowdGui(Command):
def doIt... | 2.359375 | 2 |
python/cendalytics/core/__init__.py | jiportilla/ontology | 0 | 36985 | <gh_stars>0
from .cendant_api import CendantAPI
| 1.046875 | 1 |
python/test/test_spreadsheet_api.py | dlens/dlxapi | 0 | 36986 | # coding: utf-8
"""
Decision Lens API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
impor... | 1.351563 | 1 |
demo/demo_window.py | aakhundov/tf-attend-infer-repeat | 57 | 36987 | import tkinter as tk
import tkinter.ttk as ttk
from .pixel_canvas import PixelCanvas
class DemoWindow(ttk.Frame):
def __init__(self, master, model_wrapper,
canvas_size=50, window_size=28,
refresh_period=50, test_image=None, **kw):
ttk.Frame.__init__(self, master=master... | 2.65625 | 3 |
app/views.py | soje402/imageboard | 0 | 36988 | # coding=utf-8
from flask import Flask, url_for, render_template, request, redirect, jsonify, session, send_file
import models
import json
import datetime
import time
import md5
from werkzeug import secure_filename
app = Flask(__name__)
app.secret_key = '<KEY>'
ALLOWED_EXTENSIONS = ['png', 'jpg', 'jpeg', 'webm', 'mp4... | 2.34375 | 2 |
lib/Site.py | EthanZeigler/pastebin_scraper | 0 | 36989 | from queue import Queue
import time
from settings import USE_DB, DB_DB, DB_DUMP_TABLE, DB_ACCT_TABLE, REQUEST_SPACING
import logging
from . import helper
import sqlite3
import threading
class Site(object):
'''
Site - parent class used for a generic
'Queue' structure with a few helper metho... | 2.828125 | 3 |
Convolution Neural Network/main.py | dhavalsharma97/ExpressionIdentifier | 0 | 36990 | <gh_stars>0
# Convolution Neural Networks
# importing the required libraries
from demo import demo
from model import train_model, valid_model
import tensorflow as tf
flags = tf.compat.v1.flags
flags.DEFINE_string('MODE', 'demo',
'Set program to run in different modes, including train, valid and... | 2.609375 | 3 |
ETLPipeline (1).py | mudigosa/Disaster-Pipeline | 0 | 36991 | <filename>ETLPipeline (1).py
import sys
import pandas as pd
from sqlalchemy import create_engine
def load_data(messages_filepath, categories_filepath):
'''
input:
messages_filepath: The path of messages dataset.
categories_filepath: The path of categories dataset.
output:
df: The me... | 3.453125 | 3 |
backend/presentation/admin.py | Weida-W/CMPUT404-project-socialdistribution | 0 | 36992 | from django.contrib import admin
# Register your models here.
from .models import *
admin.site.register(Author)
admin.site.register(Follower)
admin.site.register(Post)
admin.site.register(Comment)
admin.site.register(Request)
admin.site.register(Inbox)
admin.site.register(Likes)
admin.site.register(Liked)
admin.site.... | 1.632813 | 2 |
guessenv/__main__.py | EasyPost/guessenv | 3 | 36993 | <filename>guessenv/__main__.py
import argparse
import sys
import io
import os
import os.path
import re
from itertools import repeat
from . import guesser
if sys.version_info < (3, 0):
open_function = io.open
else:
open_function = open
class _Exclude(object):
def __init__(self, regex):
self.raw ... | 2.453125 | 2 |
main_test.py | OniriCorpe/Motion | 0 | 36994 | <gh_stars>0
#!/usr/bin/env python
"""
The test file to use with pytest.
'(motion-venv) $ python -m pytest main_test.py'
"""
import main
def test_calculate_date_delta():
"""
Tests that the function calculate_date_delta(date_start, date_now)
calculates correctly the number of days between two dates.
"... | 3.25 | 3 |
deps/libffi/generate-osx-source-and-headers.py | liuqsqq/node-ffi | 3,373 | 36995 | #!/usr/bin/env python
import subprocess
import re
import os
import errno
import collections
import sys
class Platform(object):
pass
sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)')
def sdkinfo(sdkname):
ret = {}
for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIP... | 2.40625 | 2 |
fst_lookup/fallback_data.py | eddieantonio/fst-lookup | 5 | 36996 | <gh_stars>1-10
"""
Fallback data types, implemented in Python, for platforms that cannot build
the C extension.
"""
from .symbol import Symbol
from .typedefs import StateID
class Arc:
"""
An arc (transition) in the FST.
"""
__slots__ = ("_state", "_upper", "_lower", "_destination")
def __init__... | 2.671875 | 3 |
dashflaskapp/flaskapp/transactions_plotly/dashboard.py | NicholasGoh/real_estate_app | 0 | 36997 | import pandas as pd
import dash
from dash.dependencies import Input, Output, State
import plotly.express as px
import dash_html_components as html
import dash_core_components as dcc
import dash_bootstrap_components as dbc
# self packages
from .data_generator import load_transactions, comparisons_df
from .nav_bar impor... | 2.734375 | 3 |
scripts/vis_mask.py | ZHUXUHAN/my_segmentation | 0 | 36998 | <reponame>ZHUXUHAN/my_segmentation
import cv2
import numpy as np
from matplotlib import pyplot as plt
plt.switch_backend('agg')
imgfile = '/home/awesome-semantic-segmentation-pytorch/0023c3c5-c0fd-4ab2-85e0-dd00fa2b5f84_1581153710699_align_0.jpg'
pngfile = '/home/awesome-semantic-segmentation-pytorch/scripts/eval/0023... | 2.5 | 2 |
src/pretix/base/templatetags/cache_large.py | Janfred/pretix | 1,248 | 36999 | <filename>src/pretix/base/templatetags/cache_large.py
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 <NAME> and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Af... | 1.992188 | 2 |