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 |
|---|---|---|---|---|---|---|
app/filters.py | dakhnovskaya/organization | 0 | 18600 | <gh_stars>0
import django_filters
from app.models import Company
class CompanyFilter(django_filters.FilterSet):
min_cost = django_filters.NumberFilter(field_name='companyproduct__cost', lookup_expr='gte')
max_cost = django_filters.NumberFilter(field_name='companyproduct__cost', lookup_expr='lte')
class ... | 2.046875 | 2 |
reaction/rpc/rabbitmq.py | Inkln/reaction | 73 | 18601 | from typing import List
import asyncio
import inspect
import logging
import uuid
import aio_pika
import aio_pika.exceptions
from .base import BaseRPC
from .common import RPCError, RPCHandler, RPCRequest, RPCResponse
class RPC(BaseRPC):
HEARTBEAT_INTERVAL = 300
def __init__(
self,
url: str =... | 2.171875 | 2 |
api/migrations/0005_auto_20200906_1951.py | sh2MAN/yamdb_final | 0 | 18602 | # Generated by Django 3.0.5 on 2020-09-06 19:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0004_auto_20200906_1752'),
]
operations = [
migrations.AlterModelOptions(
name='category... | 1.546875 | 2 |
user_activity/models.py | adithya-bhat-b/user-activity | 0 | 18603 | <reponame>adithya-bhat-b/user-activity
import pytz
from django.db import models
# Create your models here.
def _get_time_zones():
"""
Function to get all the timezones
"""
timezone_choices = [(tz, tz) for tz in pytz.all_timezones]
return timezone_choices
# Model for user
class User(models.Model)... | 2.734375 | 3 |
Learning/python_data_analysis1.py | VictoriaGuXY/MCO-Menu-Checker-Online | 0 | 18604 | <filename>Learning/python_data_analysis1.py
import pandas as pd
# pandas provides us lots of data frame and functions that we can quickly use
# to analyze data.
"""
output
"""
# This file contains notes of basic data analyzing strategies using Python.
# I will introduce two ways to read a csv file: pathway and URL.
... | 4.46875 | 4 |
InvoiceItemModel.py | kevinyjiang/cpa-generator | 2 | 18605 | <filename>InvoiceItemModel.py
import config
class InvoiceItemModel(object):
def __init__(self, itemType, quantity):
self.itemType = itemType
self.quantity = int(quantity)
self.unitPrice = 0
if itemType == 'Portraiture':
self.unitPrice = config.PORTRAIT_RATE
els... | 2.8125 | 3 |
lambda/populateDB/lambda_function.py | aws-samples/amazon-connect-dynamic-ivr-menus | 4 | 18606 | <gh_stars>1-10
import json
import boto3
import os
def lambda_handler(event, context):
# TODO implement
dynamodb = boto3.resource('dynamodb')
customerTable = os.environ['customerTable']
table1 = dynamodb.Table(customerTable)
policiesTable = os.environ['policiesTable']
table2 = dynamodb.Tab... | 2.109375 | 2 |
pyds/heap/__init__.py | nitinkatyal1314/data-structures | 6 | 18607 | <reponame>nitinkatyal1314/data-structures
from .api import HeapAPI as Heap
from .api import HeapType
| 1.148438 | 1 |
examples/s5b_transfer/s5b_receiver.py | isabella232/slixmpp | 0 | 18608 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Slixmpp: The Slick XMPP Library
Copyright (C) 2015 <NAME>
This file is part of Slixmpp.
See the file LICENSE for copying permission.
"""
import asyncio
import logging
from getpass import getpass
from argparse import ArgumentParser
import slixmpp
... | 2.1875 | 2 |
api/app/routers/weather_models.py | bcgov/wps | 19 | 18609 | """ Routers for weather_models.
"""
import logging
from fastapi import APIRouter, Depends
from app.auth import authentication_required, audit
from app.weather_models import ModelEnum
from app.schemas.weather_models import (
WeatherModelPredictionSummaryResponse,
WeatherStationsModelRunsPredictionsResponse)
from... | 2.5 | 2 |
155.min-stack.py | elfgzp/leetCode | 3 | 18610 | #
# @lc app=leetcode.cn id=155 lang=python3
#
# [155] 最小栈
#
# https://leetcode-cn.com/problems/min-stack/description/
#
# algorithms
# Easy (47.45%)
# Total Accepted: 19.4K
# Total Submissions: 40.3K
# Testcase Example: '["MinStack","push","push","push","getMin","pop","top","getMin"]\n[[],[-2],[0],[-3],[],[],[],[]]... | 3.9375 | 4 |
make.py | beefoo/subway-inequality | 1 | 18611 | # -*- coding: utf-8 -*-
# python3 make.py -loc "data/lines/1.csv" -width 3840 -height 2160 -overwrite
# python3 make.py -loc "data/lines/1.csv" -width 3840 -height 2160 -rtl -overwrite
# python3 combine.py
# python3 make.py -data "data/lines/A_LEF.csv" -width 3840 -height 2160 -loc "data/lines/C.csv" -img "img/A.png" ... | 2.484375 | 2 |
release/scripts/startup/bl_ui/space_text.py | vic3t3chn0/Bforartists | 1 | 18612 | <filename>release/scripts/startup/bl_ui/space_text.py
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | 2.328125 | 2 |
wb/main/jobs/create_setup_bundle/create_setup_bundle_job.py | apaniukov/workbench | 23 | 18613 | """
OpenVINO DL Workbench
Class for create setup bundle job
Copyright (c) 2020 Intel Corporation
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... | 1.546875 | 2 |
ros_awsiot_agent/src/ros_awsiot_agent/mqtt2ros.py | whill-labs/ros_awsiot | 4 | 18614 | <gh_stars>1-10
#!/usr/bin/env python3
import logging
from os.path import expanduser
from typing import Any, Dict
from uuid import uuid4
import rospy
from awsiotclient import mqtt, pubsub
from ros_awsiot_agent import set_module_logger
from rosbridge_library.internal.message_conversion import populate_instance
from ros... | 2 | 2 |
poly/app.py | thdb-theo/Polynomial | 0 | 18615 | import sys
import re
from PyQt4 import QtGui, QtCore
from polynomial import Polynomial
from rational import Rational
class Window(QtGui.QMainWindow):
width, height = 420, 130
def __init__(self):
super().__init__()
self.setFixedSize(Window.width, Window.height)
self.setWindowTitle('... | 2.796875 | 3 |
ariadne_server/tests/fixtures/fake_context.py | seanaye/FeatherLight-API | 3 | 18616 | <reponame>seanaye/FeatherLight-API<filename>ariadne_server/tests/fixtures/fake_context.py
from secrets import token_hex
import pytest
class Object:
pass
class FakeContext(dict):
def __init__(self):
req_obj = Object()
req_obj.cookies = {}
req_obj.client = Object()
req_obj... | 1.820313 | 2 |
libs/evaluation/training_benchmark_database.py | eeshakumar/hythe | 0 | 18617 | # Copyright (c) 2020 <NAME>,
# <NAME>, <NAME>, <NAME>
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
from bark.benchmark.benchmark_result import BenchmarkConfig
from bark_ml.library_wrappers.lib_fqf_iqn_qrdqn.agent import TrainingBenchmark
from bark.benchmark.benchmark_runne... | 1.890625 | 2 |
goldstone/tenants/tests_cloud.py | Solinea/goldstone-server | 14 | 18618 | <reponame>Solinea/goldstone-server
"""Unit tests for /tenants/<id>/cloud endpoints."""
# Copyright 2015 Solinea, Inc.
#
# 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... | 2.15625 | 2 |
onnxruntime/test/server/integration_tests/model_zoo_data_prep.py | PhaniShekhar/onnxruntime | 0 | 18619 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import sys
import shutil
import onnx
import onnxruntime
import json
from google.protobuf.json_format import MessageToJson
import predict_pb2
import onnx_ml_pb2
# Current models only have one input and one output... | 2.265625 | 2 |
articlequality/feature_lists/tests/test_enwiki.py | mariushoch/articlequality | 0 | 18620 | <filename>articlequality/feature_lists/tests/test_enwiki.py
from revscoring.datasources.revision_oriented import revision
from revscoring.dependencies import solve
from .. import enwiki
revision_text = revision.text
def test_cite_templates():
text = """
This is some text with a citation.<ref>{{cite lol|titl... | 2.546875 | 3 |
GPU_compare_CPU.py | kvmu/SFU-workterm | 0 | 18621 | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 10 14:31:17 2015
@author: <NAME>.
Description:
This script does CPU and GPU matrix element time complexity
profiling. It has a function which applies the matrix element
analysis for a given set of parameters, profiles the code and
... | 2.9375 | 3 |
applications/plugins/Flexible/Flexible_test/scenes/python/reInitMapping.py | sofa-framework/issofa | 0 | 18622 | import Sofa
import SofaTest
import SofaPython.Tools
OBJ = SofaPython.Tools.localPath( __file__, "beam.obj" )
RAW = SofaPython.Tools.localPath( __file__, "beam.raw" )
##Check if calling Mapping::init() change anything
#
#The trick is to know that if the option evaluateShapeFunction is activated
#in the ImageGaussPoint... | 2.203125 | 2 |
mindspore/ops/_register_for_op.py | Vincent34/mindspore | 1 | 18623 | <gh_stars>1-10
# Copyright 2020 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 applicable l... | 2.453125 | 2 |
senlin-7.0.0/senlin/tests/unit/api/middleware/test_version_negotiation.py | scottwedge/OpenStack-Stein | 0 | 18624 | <filename>senlin-7.0.0/senlin/tests/unit/api/middleware/test_version_negotiation.py<gh_stars>0
# 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... | 1.992188 | 2 |
iot/models.py | kkishans/IOT_DJANGO | 0 | 18625 | <filename>iot/models.py
from django.db import models
from django import forms
# Create your models here.
class User(models.Model):
username = models.CharField(max_length=30)
password = models.TextField()
email = models.EmailField(unique=True)
objects = models.Manager()
def __str__(self):
re... | 2.609375 | 3 |
Homework files/Think_Python_Book_Homework_1.py | SillyHatsOnly/Python-Education-Experiments | 0 | 18626 | def do_twice(f):
f()
f()
def print_spam():
print('spam')
do_twice(print_spam)
def do_twice(f, a):
f(a)
f(a)
def print_spam(a):
print(a)
print(a)
do_twice(print_spam, 'spamm')
def do_four(f, a):
do_twice(f,a)
do_twice(f,a)
do_four(print_spam, "SPAM")
def hor_line():
print(... | 3.609375 | 4 |
email_log/apps.py | bernd-wechner/django-email-log | 26 | 18627 | <filename>email_log/apps.py
from django.apps import AppConfig
class EmailLogConfig(AppConfig):
name = 'email_log'
verbose_name = "Email log"
| 1.492188 | 1 |
gawain/tests/test_numerics.py | henrywatkins/gawain | 1 | 18628 | import pytest
from gawain.numerics import Clock, SolutionVector, MHDSolutionVector
| 1.039063 | 1 |
project_9/util.py | sople1/project_9 | 0 | 18629 | """
utility for project 9
:author: <NAME> <<EMAIL>>
:license: CC0
"""
def clear():
"""
clear cmd/term
:return: void
"""
import os
import sys
if sys.platform == 'win32':
os.system('cls') # on windows
else:
os.system('clear') # on linux / os x
if __name__ == '__mai... | 2.25 | 2 |
api/views.py | HigoOliveira/DesafioFinalServer | 0 | 18630 | <reponame>HigoOliveira/DesafioFinalServer<filename>api/views.py
from rest_framework.views import APIView
from .models import User, Event
from .serializer import UserSerializer, EventSerializer
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.authentication import TokenAuthentication
... | 1.992188 | 2 |
Searching_Sorting/MinimumMovesToEqualAllArrayElements2.py | PK-100/Competitive_Programming | 70 | 18631 | # LC 462
#from statistics import median
from random import randrange
from math import floor
class Solution:
#Quick Select Algorithm
def partition(self,x, pivot_index = 0):
i = 0
if pivot_index !=0: x[0],x[pivot_index] = x[pivot_index],x[0]
for j in range(len(x)-1):
if x[j+1] ... | 3.03125 | 3 |
moban/_version.py | CLiu13/moban | 1 | 18632 | __version__ = "0.3.9"
__author__ = "<NAME>."
| 1.039063 | 1 |
Gif_Rick/rick_random_gif.py | BiceCold/Citadel_of_Ricks | 2 | 18633 | <reponame>BiceCold/Citadel_of_Ricks<filename>Gif_Rick/rick_random_gif.py
import imgurpython
from Environment_Handlers.configs import get_config
import random
client_id = get_config("client_id")
client_secret = get_config("client_secret")
client_refresh_token = get_config("client_refresh")
client_access_token = get_co... | 2.484375 | 2 |
catalyst/dl/experiment/__init__.py | andrey-avdeev/catalyst | 3 | 18634 | <filename>catalyst/dl/experiment/__init__.py
# flake8: noqa
from .base import BaseExperiment
from .config import ConfigExperiment
from .supervised import SupervisedExperiment
| 1.0625 | 1 |
home_directories/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BC9837BA-F60E-475C-B524-E761FBD0E1EB/common.py | joekallen/dotfiles | 0 | 18635 | import os
import argparse
import subprocess
from workflow import Workflow
def get_kubectl_cmd_path():
wf = Workflow()
return wf.settings.get("KUBECTL_CMD_PATH") or os.environ.get("KUBECTL_CMD_PATH", '/usr/local/bin/kubectl')
class KService:
def __init__(self, type, name, age, status):
self.type =... | 2.390625 | 2 |
dependencies/generate maps/pythongis/app/tk2/__init__.py | karimbahgat/AutoMap | 4 | 18636 | """
Tk2
Tk2 is a convenience library for extending the functionality of Tkinter,
to make it easier and more flexible to create GUI applications.
"""
from .basics import *
from .scrollwidgets import *
from .texteditor import Text, MultiTextSearch
from .variables import *
# Later
from .multiwidgets import *
from .pr... | 2.46875 | 2 |
pp/web/base/tests/test_forjenkins.py | oisinmulvihill/pp-web-base | 0 | 18637 |
def test_nonop():
assert 1 == 1
| 1.257813 | 1 |
tools/deepke/relation_extraction/standard/models/BasicModule.py | dfface/DoctorKG | 1 | 18638 | <filename>tools/deepke/relation_extraction/standard/models/BasicModule.py
import os
import time
import torch
import torch.nn as nn
class BasicModule(nn.Module):
'''
封装nn.Module, 提供 save 和 load 方法
'''
def __init__(self):
super(BasicModule, self).__init__()
def load(self, pat... | 2.359375 | 2 |
url_shortener_client/exceptions/__init__.py | Andrelpoj/hire.me | 0 | 18639 | class AliasNotFound(Exception):
def __init__(self, alias):
self.alias = alias
class AliasAlreadyExists(Exception):
def __init__(self, alias):
self.alias = alias
class UnexpectedServerResponse(Exception):
def __init__(self, response):
self.response = response
| 2.46875 | 2 |
software/nuke/init.py | kei-iketani/plex | 153 | 18640 | <filename>software/nuke/init.py
#*********************************************************************
# content = init Nuke
# version = 0.1.0
# date = 2019-12-01
#
# license = MIT <https://github.com/alexanderrichtertd>
# author = <NAME> <<EMAIL>>
#********************************************************... | 2.328125 | 2 |
main.py | gaoshanyu/web_ui_test_sample | 0 | 18641 | <gh_stars>0
# -*- coding: utf-8 -*-
# Created at 03/10/2020
__author__ = 'raniys'
import pytest
if __name__ == '__main__':
# -v: verbose; -s: shortcut for --capture=no;
# -m: only run tests matching given mark expression. example: -m 'mark1 and not mark2';
# --html=path: create html report file at given ... | 2.03125 | 2 |
rnd/HaskellRSLCompiler/test/parse/test.py | syoyo/lucille | 77 | 18642 | #!/usr/bin/env python
import os, sys
import subprocess
import re
import glob
errlog = []
def run(f):
cmd = "../../lslc"
p = subprocess.Popen([cmd, f], stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
outs = [l for l in p.stdout]
errs = [l for l in p.stderr]
errline = re.compile... | 2.578125 | 3 |
glasses/models/classification/base/__init__.py | rentainhe/glasses | 271 | 18643 | from torch import Tensor, nn
from ...base import VisionModule
class ClassificationModule(VisionModule):
"""Base Classification Module class"""
def __init__(
self,
encoder: nn.Module,
head: nn.Module,
in_channels: int = 3,
n_classes: int = 1000,
**kwargs
):... | 2.859375 | 3 |
lib/data.py | PEDIA-Charite/classifier | 2 | 18644 | # -*- coding: utf-8 -*-
import os
import numpy as np
import sys
import logging
import csv
# Setup logging
logger = logging.getLogger(__name__)
console_handle = logging.StreamHandler()
console_handle.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s: %(message)s', datefmt='%m-%d %H:%M')
cons... | 2.96875 | 3 |
iris_sdk/models/data/tn_status.py | NumberAI/python-bandwidth-iris | 2 | 18645 | #!/usr/bin/env python
from iris_sdk.models.base_resource import BaseData
from iris_sdk.models.maps.tn_status import TnStatusMap
class TnStatus(TnStatusMap, BaseData):
pass | 1.359375 | 1 |
venv/lib/python3.6/site-packages/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_device_group_member.py | usegalaxy-no/usegalaxy | 1 | 18646 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_device_group_memb... | 1.953125 | 2 |
comrade/blueprints/rest.py | sp3c73r2038/elasticsearch-comrade | 256 | 18647 | from elasticsearch import TransportError
from sanic import Blueprint
from sanic.request import Request
from sanic.response import HTTPResponse, json
from ..connections import get_client
rest_bp = Blueprint('rest')
def format_es_exception(e: TransportError):
return json({"status_code": e.status_code,
... | 2.21875 | 2 |
tests/test_utils.py | tedeler/pyexchange | 128 | 18648 | <gh_stars>100-1000
from datetime import datetime
from pytz import timezone, utc
from pytest import mark
from pyexchange.utils import convert_datetime_to_utc
def test_converting_none_returns_none():
assert convert_datetime_to_utc(None) is None
def test_converting_non_tz_aware_date_returns_tz_aware():
utc_time = ... | 3.03125 | 3 |
vidpub/__main__.py | gary9630/session-video-publisher | 0 | 18649 | <reponame>gary9630/session-video-publisher<filename>vidpub/__main__.py
import argparse
from .upload_video import upload_video
from .generate_playlist import generate_playlist
def parse_args(argv):
parser = argparse.ArgumentParser()
parser.add_argument(
"-u", "--upload", action="store_true", help="Upl... | 2.625 | 3 |
ally/utils/option.py | rjfranssen/PyAlly | 53 | 18650 | <gh_stars>10-100
# MIT License
#
# Copyright (c) 2020 <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, mod... | 2.03125 | 2 |
examples/104-python3-9-pipeline.py | marviniter/argo-dataflow | 0 | 18651 | from argo_dataflow import pipeline, kafka
def handler(msg, context):
return ("hi! " + msg.decode("UTF-8")).encode("UTF-8")
if __name__ == '__main__':
(pipeline("104-python3-9")
.owner('argoproj-labs')
.describe("""This example is of the Python 3.9 handler.
[Learn about handlers](../docs/HANDLERS.... | 2.140625 | 2 |
djangur.py | JerryPopi/djangur-py | 0 | 18652 | import asyncio
import discord
from commands import Commands, Guild_Instance, leave, play_search
import os
from pymongo import MongoClient
from dotenv import load_dotenv
load_dotenv()
CONNECTION_STRING = f"mongodb+srv://{os.environ['mongo_user']}:{os.environ['mongo_pass']}@dj<EMAIL>.mongodb.net/djangur?retryWrites=tru... | 2.40625 | 2 |
membership/models.py | str4nd/sikteeri | 22 | 18653 | <filename>membership/models.py
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from decimal import Decimal
import logging
from django.core.files.storage import FileSystemStorage
from membership.billing.pdf_utils import get_bill_pdf, create_reminder_pdf
from membership.reference_numbers import barcode... | 1.875 | 2 |
napari_imc/io/__init__.py | neuromusic/napari-imc | 4 | 18654 | from .imaxt import ImaxtFileReader
from .mcd import McdFileReader
from .txt import TxtFileReader
__all__ = [
'ImaxtFileReader',
'McdFileReader',
'TxtFileReader',
]
| 1.242188 | 1 |
eval.py | ldzhangyx/TCN-for-beat-tracking | 3 | 18655 | <filename>eval.py<gh_stars>1-10
import torch
from torch.utils.data import Dataset
import numpy as np
import os
import pickle
from madmom.features import DBNBeatTrackingProcessor
import torch
from model import BeatTrackingNet
from utils import init_single_spec
from mir_eval.beat import evaluate
from data import Ball... | 2.25 | 2 |
pycity_calc/cities/scripts/city_generator/city_generator.py | RWTH-EBC/pyCity_calc | 4 | 18656 | # coding=utf-8
"""
Script to generate city object.
"""
from __future__ import division
import os
import numpy as np
import pickle
import warnings
import random
import datetime
import shapely.geometry.point as point
import pycity_base.classes.Weather as weath
import pycity_base.classes.demand.SpaceHeating as SpaceHeati... | 1.929688 | 2 |
cpgan_data.py | basilevh/object-discovery-cp-gan | 14 | 18657 | # <NAME>, March 2020
# Common code for PyTorch implementation of Copy-Pasting GAN
import copy
import itertools
import matplotlib.pyplot as plt
import numpy as np
import os, platform, time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
f... | 2.515625 | 3 |
provision/env/lib/python3.6/site-packages/ansible/plugins/become/dzdo.py | brightkan/tukole-frontend | 1 | 18658 | <reponame>brightkan/tukole-frontend<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
b... | 1.375 | 1 |
templates/php/functionsTest.py | anconaesselmann/LiveUnit | 0 | 18659 | <reponame>anconaesselmann/LiveUnit
import unittest
import os
if __name__ == '__main__' and __package__ is None:
from os import sys, path
sys.path.append(path.abspath(path.join(__file__, "..", "..")))
sys.path.append(path.abspath(path.join(__file__, "..", "..", "..", "classes_and_tests")))
from php.functio... | 2.5 | 2 |
app.py | opeyemibami/decision_support_system | 1 | 18660 | <reponame>opeyemibami/decision_support_system
import sys
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import efficientnet.keras as efn
import streamlit as st
import SessionState
from skimage.transform import resize
import skimage
import skimage.filters
import reportgenerator
import style
fro... | 2.375 | 2 |
richardson_extrapolation.py | PrabalChowdhury/CSE330-NUMERICAL-METHODS | 0 | 18661 | # -*- coding: utf-8 -*-
"""Richardson-Extrapolation.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1oNlSL2Vztk9Fc7tMBgPcL82WGaUuCY-A
Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the me... | 3.75 | 4 |
src/mlshell/blocks/pipeline/steps.py | nizaevka/mlshell | 8 | 18662 | """The :mod:`mlshell.pipeline.steps` contains unified pipeline steps."""
import inspect
import mlshell
import numpy as np
import pandas as pd
import sklearn
import sklearn.impute
import sklearn.compose
__all__ = ['Steps']
class Steps(object):
"""Unified pipeline steps.
Parameters
----------
estim... | 2.609375 | 3 |
paste/application/repositories.py | Afonasev/Paste | 0 | 18663 | from datetime import datetime
import peewee
from paste import domain
from . import db
class AbstractRepository(domain.IRepository):
_model = NotImplemented
_entity = NotImplemented
def count(self):
return self._model.count()
def save(self, entity):
model = _entity_to_model(entity... | 2.46875 | 2 |
example/example_nursery.py | airysen/racog | 3 | 18664 | # Dataset https://archive.ics.uci.edu/ml/datasets/Nursery
import numpy as np
import pandas as pd
from collections import Counter
from sklearn.model_selection import train_test_split, GridSearchCV, StratifiedKFold
from imblearn.metrics import geometric_mean_score
from sklearn.metrics import mean_squared_error, make_s... | 2.359375 | 2 |
channels/piratestreaming.py | sodicarus/channels | 0 | 18665 | <filename>channels/piratestreaming.py
# -*- coding: utf-8 -*-
# StreamOnDemand Community Edition - Kodi Addon
# ------------------------------------------------------------
# streamondemand.- XBMC Plugin
# Canale piratestreaming
# http://www.mimediacenter.info/foro/viewforum.php?f=36
# ---------------------------------... | 2.140625 | 2 |
test/IECore/LayeredDictTest.py | gcodebackups/cortex-vfx | 5 | 18666 | <reponame>gcodebackups/cortex-vfx
##########################################################################
#
# Copyright (c) 2008-2010, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following cond... | 1.179688 | 1 |
www/courses/cs1120/spring2017/code/day10.py | ic4f/sergey.cs.uni.edu | 0 | 18667 | <reponame>ic4f/sergey.cs.uni.edu<gh_stars>0
def makePic():
file = pickAFile()
return makePicture(file)
def decreaseRed(picture):
for pixel in getPixels(picture):
setRed(pixel, getRed(pixel) * 0.2)
repaint(picture)
def decreaseRed2(picture):
pixels = getPixels(picture)
for i in range(len... | 3.328125 | 3 |
nuplan/database/utils/boxes/box.py | MCZhi/nuplan-devkit | 0 | 18668 | <reponame>MCZhi/nuplan-devkit<gh_stars>0
from __future__ import annotations
import abc
from typing import Any, Dict
class BoxInterface(abc.ABC):
""" Interface for box. """
@property # type: ignore
@abc.abstractmethod
def label(self) -> int:
"""
Label id.
:return: Label id.
... | 2.4375 | 2 |
tests/test_training.py | Hilly12/masters-code | 0 | 18669 | <reponame>Hilly12/masters-code
import torch
import prifair as pf
N_SAMPLES = 10000
VAL_SAMPLES = 1000
STUDENT_SAMPLES = 5000
INPUTS = 1000
OUTPUTS = 5
BATCH_SIZE = 256
MAX_PHYSICAL_BATCH_SIZE = 128
EPSILON = 2.0
DELTA = 1e-5
MAX_GRAD_NORM = 1.0
N_TEACHERS = 4
N_GROUPS = 10
EPOCHS = 2
class MockModel(torch.nn.Module... | 2.359375 | 2 |
problem/01000~09999/02164/2164.py3.py | njw1204/BOJ-AC | 1 | 18670 | <filename>problem/01000~09999/02164/2164.py3.py
from collections import deque
n,x=int(input()),deque()
for i in range(1,n+1): x.append(i)
while len(x)>1:
x.popleft()
if len(x)==1: break
x.append(x.popleft())
print(x.pop()) | 3.21875 | 3 |
craft_ai/timezones.py | craft-ai/craft-ai-client-python | 14 | 18671 | <reponame>craft-ai/craft-ai-client-python
import re
_TIMEZONE_REGEX = re.compile(r"^([+-](2[0-3]|[01][0-9])(:?[0-5][0-9])?|Z)$")
TIMEZONES = {
"UTC": "+00:00",
"GMT": "+00:00",
"BST": "+01:00",
"IST": "+01:00",
"WET": "+00:00",
"WEST": "+01:00",
"CET": "+01:00",
"CEST": "+02:00",
"... | 2.890625 | 3 |
gpvdm_gui/gui/json_fdtd.py | roderickmackenzie/gpvdm | 12 | 18672 | <gh_stars>10-100
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2008-2022 <NAME> r.c.i.m<EMAIL>ie at googlemail.com
#
# https://www.gpvdm.com
#
# This program is free software; you can redist... | 1.976563 | 2 |
gru/plugins/base/inventory.py | similarweb/gru | 7 | 18673 | <reponame>similarweb/gru<filename>gru/plugins/base/inventory.py
from . import BasePlugin
from gru.config import settings
class Host(object):
def __init__(self, host_id, host_data=None):
self.host_id = host_id
if host_data:
self.host_data = host_data
else:
self.ho... | 2.53125 | 3 |
app/comic/eyra/tasks.py | EYRA-Benchmark/grand-challenge.org | 2 | 18674 | import json
from datetime import datetime
import time
from functools import reduce
import boto3
from celery import shared_task
from celery.bin.control import inspect
from django.conf import settings
from comic.container_exec.backends.k8s import K8sJob
from comic.eyra.models import Job, Submission, DataFile, JobInput
... | 2.203125 | 2 |
doc/conf.py | djarpin/sagemaker-python-sdk | 1 | 18675 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import os
import sys
from datetime import datetime
from unittest.mock import MagicMock
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
if name == "__version__":
return "1.4.0"
else:
return MagicMock()
MOCK_MODULES... | 2.109375 | 2 |
django_cassiopeia/views.py | galaddirie/django-cassiopeia | 13 | 18676 | <filename>django_cassiopeia/views.py
from django.shortcuts import render, HttpResponse
from django_cassiopeia import cassiopeia as cass
from time import sleep
import json
# Create your views here.
def test(request):
return render(request, "test/test.html")
def test_request(request, n):
context = {
"n... | 2.234375 | 2 |
sender.py | AndrVLDZ/telnet_DAW-master | 0 | 18677 | import telnetlib
def print_logo(logo=''):
LOGO_DAFAULT = """\033[93m
/\ /\\
/ \\'._ (\_/) _.'/ \\
/_.''._'--('.')--'_.''._\\
| \_ / `;=/ " \=;` \ _/ |
\/ `\__|`\___/`|__/` \/
` \(/|\)/ `
" ` "
DAW_Start_By_VLDZ
\033[0m
"""
if logo != '':
pri... | 2.671875 | 3 |
oed/__init__.py | wgshen/OED | 0 | 18678 | from .oed import OED
__all__ = [
"OED"
]
| 1.085938 | 1 |
pyperformance/_manifest.py | cappadokes/pyperformance | 0 | 18679 |
__all__ = [
'BenchmarksManifest',
'load_manifest',
'parse_manifest',
]
from collections import namedtuple
import os.path
from . import __version__, DATA_DIR
from . import _benchmark, _utils
DEFAULTS_DIR = os.path.join(DATA_DIR, 'benchmarks')
DEFAULT_MANIFEST = os.path.join(DEFAULTS_DIR, 'MANIFEST')
... | 2.125 | 2 |
pimux/function.py | pcpcpc1213/pimux | 0 | 18680 | from . import scrip as t
class misc():
'''
The class misc has miscellaneous methods
of termuxa-pi available.
Available methods are :
battery,
brightness,
vibrate,
contactlist,
torch,
downloadFile
'''
def __init__(self):
pass
def battery(self):
... | 3.140625 | 3 |
download_from_link.py | bogdanf555/scripts | 0 | 18681 | #!/usr/bin/python3
import requests
import sys
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Error: you should pass 2 arguments: [link_to_download_from] [path_to_save_downloaded_file]")
exit(1)
url = sys.argv[1]
r = requests.get(url, allow_redirects=True)
open(sys.argv[2], '... | 2.875 | 3 |
vowelsubstring.py | boddulurisrisai/python-practice | 1 | 18682 | <reponame>boddulurisrisai/python-practice
import re
b=input('enter string')
r=[];max=-1;z=-1
for i in range(len(b)):
for j in range(i+1,len(b)+1):
c=b[i:j]
for k in c:
if k=='a' or k=='e' or k=='i' or k=='o' or k=='u':
flag=0
else:
fl... | 3.671875 | 4 |
syndata/__init__.py | Menelau/synthetic_datasets | 6 | 18683 | <filename>syndata/__init__.py
# coding=utf-8
# Author: <NAME> <<EMAIL>>
#
# License: MIT
"""
The :mod:`deslib.util` This module includes various utilities. They are divided into three parts:
syndata.synthethic_datasets - Provide functions to generate several 2D classification datasets.
syndata.plot_tools - Provides... | 2.03125 | 2 |
profiles/migrations/0002_auto_20211214_0825.py | praekeltfoundation/ge-web | 1 | 18684 | # Generated by Django 3.1.14 on 2021-12-14 08:25
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0066_collection_management_permissions'),
('profiles', '0001_initial'),
]
operations = [
... | 1.492188 | 1 |
radmc-3d/version_0.41/examples/run_spher2d_1_nomirror/problem_setup.py | dlmatra/miao | 1 | 18685 | <reponame>dlmatra/miao
#
# Import NumPy for array handling
#
import numpy as np
import math
#
# Import plotting libraries (start Python with ipython --matplotlib)
#
#from mpl_toolkits.mplot3d import axes3d
#from matplotlib import pyplot as plt
#
# Some natural constants
#
au = 1.49598e13 # Astronomical Unit ... | 2.25 | 2 |
colorprinter/pycolor.py | edonyzpc/toolkitem | 3 | 18686 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# .---. .-----------
# / \ __ / ------
# / / \( )/ ----- (`-') _ _(`-') <-. (`-')_
# ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .->
# //// / // : : --- (,------.... | 1.960938 | 2 |
launch/velocity_smoother-composed-launch.py | doisyg/velocity_smoother | 8 | 18687 | <filename>launch/velocity_smoother-composed-launch.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Open Source Robotics Foundation, Inc.
#
# Software License Agreement (BSD License 2.0)
# https://raw.githubusercontent.com/kobuki-base/velocity_smoother/license/LICENSE
"""Launch the velocity ... | 2.46875 | 2 |
lib/taskstats/controller.py | tijko/IO-Mon | 1 | 18688 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct
import socket
from netlink import *
NETLINK_ROUTE = 0
NETLINK_UNUSED = 1
NETLINK_USERSOCK = 2
NETLINK_FIREWALL = 3
NETLINK_SOCK_DIAG = 4
NETLINK_NFLOG = 5
NETLINK_XFRM = 6
NETLINK_SELINUX ... | 2.265625 | 2 |
app/marketing/migrations/0002_membership.py | NDevox/website | 0 | 18689 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-12 04:25
from __future__ import unicode_literals
from django.db import migrations, models
def forward(apps, schema_editor):
db_alias = schema_editor.connection.alias
Cron = apps.get_model('django_celery_beat', 'CrontabSchedule')
... | 1.882813 | 2 |
Solutions/VMX2-VoicemailExpress/Code/vmx_transcriber.py | cbgandhi-code/amazon-connect-salesforce-scv | 0 | 18690 | # Version: 2022.03.23
"""
**********************************************************************************************************************
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved *
* ... | 1.5625 | 2 |
api/permissions.py | soltanoff/simple_file_server | 2 | 18691 | from rest_framework import permissions
class IsStaffOrReadOnly(permissions.BasePermission):
"""
Custom permission to only allow admins to edit it.
"""
def has_object_permission(self, request, view, obj):
return request.method in permissions.SAFE_METHODS or request.user.is_staff
| 2.375 | 2 |
capstone/rl/utils/linear_annealing.py | davidrobles/mlnd-capstone-code | 2 | 18692 | from .callbacks import Callback
class LinearAnnealing(Callback):
def __init__(self, obj, param, init, final, n_episodes):
self.doing = 'inc' if init < final else 'dec'
self.obj = obj
self.param = param
self.init = init
self.final = final
self.n_episodes = n_episode... | 2.9375 | 3 |
genTraining_recurr.py | lasinger/-3DVideos2Stereo | 62 | 18693 | from __future__ import print_function
import numpy as np
import argparse
import glob
import os
import errno
import math
import cv2
from random import shuffle
from shutil import copyfile
parser = argparse.ArgumentParser(
description="create training/test/validation sets from video list"
)
parser.add_argument("--vi... | 2.59375 | 3 |
seeq/addons/clustering/__main__.py | seeq12/seeq-clustering | 3 | 18694 | <filename>seeq/addons/clustering/__main__.py
import os
import sys
import argparse
from ._install_addon import install_addon
def cli_interface():
""" Installs Seeq Add-on Tool """
parser = argparse.ArgumentParser(description='Install Clustering as a Seeq Add-on Tool')
parser.add_argument('--username', typ... | 2.609375 | 3 |
utils/customchecks.py | arielbeje/good-bot-name | 10 | 18695 | <gh_stars>1-10
"""
Code stolen from https://github.com/Rapptz/discord.py
"""
import functools
import discord
from discord.ext import commands
from . import sql
class NotAModError(commands.CheckFailure):
pass
class NoTokenError(Exception):
pass
def is_mod():
async def predicate(ctx):
ch = ct... | 2.609375 | 3 |
tests/test_lambda_lapsed.py | BostonDSA/actionnetwork-activist-sync | 1 | 18696 | import json
import importlib
import os
import unittest
from unittest.mock import Mock
from moto import mock_dynamodb2
import boto3
from lambda_local.context import Context
os.environ['ENVIRONMENT'] = 'TEST'
os.environ['LOG_LEVEL'] = 'CRITICAL'
os.environ['DSA_KEY'] = 'TESTKEY'
class TestLapsed(unittest.TestCase):
... | 2.0625 | 2 |
tests/test_motif_finder.py | gaybro8777/RStudio-GitHub-Analysis | 2 | 18697 | """
This script tests the classes and functions from motif_finder.py.
Parameters
----------
None
Returns
-------
Assertion errors if tests fail
"""
import sys
import random
import pickle
import networkx as nx
from github_analysis.big_cloud_scratch import git_graph
from github_analysis.data_layer import getCommitsBy... | 2.765625 | 3 |
torrent.py | fishy/scripts | 4 | 18698 | <gh_stars>1-10
#!/usr/bin/env python
import sys
import os
from types import StringType
# get bencode package from http://github.com/fishy/scripts/downloads
from bencode.bencode import bencode, bdecode, BTFailure
try :
torrent = sys.argv[1]
except IndexError :
print "Usage: \"%s <torrent_file> [tracker_url]\" to sho... | 2.65625 | 3 |
test/test_mdsspath.py | jpevans/mdssdiff | 1 | 18699 | <reponame>jpevans/mdssdiff<gh_stars>1-10
#!/usr/bin/env python
"""
Copyright 2015 ARC Centre of Excellence for Climate Systems Science
author: <NAME> <<EMAIL>>
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... | 1.703125 | 2 |