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 |
|---|---|---|---|---|---|---|
Libraries/topological_sort.py | tonko2/AtCoder | 2 | 12773251 | <reponame>tonko2/AtCoder<filename>Libraries/topological_sort.py
def topological_sort(inc, out):
# ・ノードIDは、0~N-1とする
# ・以下のデータは既に作られているとする
# inc[n] = nに流入するリンク数(int)
# out[n] = nからの流出先のノード集合(list or set)
# N = 7
# inc = [0] * N
# out = [[] for _ in range(N)]
# inc[0] = 3
# inc[1] ... | 3.328125 | 3 |
japonicus/interface.py | mczero80/japonicus | 229 | 12773252 | <reponame>mczero80/japonicus
#!/bin/python
import evaluation
def showTitleDisclaimer(backtestsettings, VERSION):
TITLE = """
██╗ █████╗ ██████╗ ██████╗ ███╗ ██╗██╗ ██████╗██╗ ██╗███████╗
██║██╔══██╗██╔══██╗██╔═══██╗████╗ ██║██║██╔════╝██║ ██║██╔════╝
██║███████║██████╔╝██║ ██║██... | 2.265625 | 2 |
AutonomousPkg/build/lib/Autonomous/Modules/Obstacle_Avoidance.py | GabeCasciano/Capstone20 | 1 | 12773253 | <reponame>GabeCasciano/Capstone20<filename>AutonomousPkg/build/lib/Autonomous/Modules/Obstacle_Avoidance.py
from Autonomous.Sensors.LIDAR import LIDAR_Interface, Utils
from Autonomous.Modules.Sensor_Fusion import Sensor_Fusion
from Autonomous.Modules.Obstacle_Detection import Obstacle_Detection
from Autonomous.Modules.... | 2.859375 | 3 |
torrentscraper/webscrapers/utils/uri_builder.py | AsiganTheSunk/python-torrent-scrapper | 5 | 12773254 | #!/usr/bin/env python3
# Import System Libraries
import urllib.parse
# Import Custom Constant
from lib.fileflags import FileFlags as fflags
# Constants
SEASON_WRAP = -1
EPISODE_WRAP = 0
TEMPORADA_WRAP = 1
SPECIAL_WEBSCRAPER = 'MejorTorrentScraper'
class UriBuilder(object):
def __init__(self, logger):
s... | 2.984375 | 3 |
build/lib/IP_Connector/PrintRecord.py | manthanchauhan/IP_Connector | 1 | 12773255 | """
Overloading 'print()'
"""
import sys
def print_record(string):
with open('logout_details.txt', 'a') as record:
stdout = sys.stdout
sys.stdout = record
print(string, end='')
sys.stdout = stdout
return
| 3.6875 | 4 |
flake8_intsights/checkers/indents.py | Intsights/flake8-intsights | 12 | 12773256 | <reponame>Intsights/flake8-intsights
import tokenize
from . import _checker
class Checker(
_checker.BaseChecker,
):
@classmethod
def check(
cls,
filename,
lines,
tokens,
start_position_to_token,
ast_tree,
astroid_tree,
all_astroid_nodes,
... | 2.4375 | 2 |
mpf/devices/shot_group.py | enteryourinitials/mpf | 0 | 12773257 | """Contains the ShotGroup base class."""
from collections import deque
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.events import event_handler
from mpf.core.mode import Mode
from mpf.core.mode_device import ModeDevice
from mpf.core.player import Player
@DeviceMonitor("common_state", "rotation_e... | 2.5 | 2 |
sysbd/module.py | chen-charles/sysbd | 0 | 12773258 | <reponame>chen-charles/sysbd<gh_stars>0
__author__ = 'Charles'
import os
import copy
from . import macro
class Module(object):
def __init__(self, name, target): self.name = name; self.target = target
def override(self, subcobj=None):
if issubclass(subcobj.__class__, self):
subcobj.compi... | 2.328125 | 2 |
event/migrations/0003_event_require_message.py | RevolutionTech/carrier-owl | 0 | 12773259 | <reponame>RevolutionTech/carrier-owl
# Generated by Django 2.2.9 on 2020-01-13 05:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("event", "0002_event_remove_location_and_rename_fields"),
]
operations = [
migrations.AlterField(
... | 1.328125 | 1 |
experiments/segmentation/unet_mcdropout_pascal.py | ElementAI/baal | 575 | 12773260 | import argparse
from copy import deepcopy
from pprint import pprint
import torch.backends
from PIL import Image
from torch import optim
from torchvision.transforms import transforms
from tqdm import tqdm
from baal import get_heuristic, ActiveLearningLoop
from baal.bayesian.dropout import MCDropoutModule
from baal imp... | 2.046875 | 2 |
test_murls.py | cyberbikepunk/murls | 0 | 12773261 | """ Test suite for the murls module. """
from murls import http, https
def test_init():
assert http('site.com') == 'http://site.com'
assert https('site.com') == 'https://site.com'
def test_path():
url = http('site.com')
assert url.path('foo', 'bar') == 'http://site.com/foo/bar'
assert url.path... | 2.953125 | 3 |
ally/Order/utils.py | jpwatt/PyAlly | 2 | 12773262 | <filename>ally/Order/utils.py
# 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 u... | 2.21875 | 2 |
alembic/env.py | yiunsr/suerp | 0 | 12773263 | import os
import sys
import asyncio
import debugpy
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from sqlalchemy.ext.asyncio import AsyncEngine
from sqlalchemy.ext.asyncio import create_async_engine
from alembic import context
from alembic.config import Config
# debugpy.listen(5678)
# print("... | 2.03125 | 2 |
Step3_Aggregation/aggregation_MachineLearning.py | Gaskell-1206/MSI_vs_MSS_Classification | 0 | 12773264 | <gh_stars>0
# Run aggregation by machine learning based methods
# Reference: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>J, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
# Development and interpretation of a pathomics-based model for the pr... | 2.515625 | 3 |
bevodevo/policies/params.py | riveSunder/bevodevo | 4 | 12773265 | from abc import ABC, abstractmethod
from collections import OrderedDict
from functools import reduce
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import gym
import matplotlib.pyplot as plt
class Params():
"""
policy which outputs the policy parameters directly, i.e. ... | 2.84375 | 3 |
src/module/MF.py | for-review-56/jsai-201911 | 0 | 12773266 | <filename>src/module/MF.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Matrix Factorization which does not learns only UI-matrix but also attributes.
"""
import numpy as np
import sys
from . import util
'''
import numpy as np
import sys
from src.module import util
'''
class MF:
def __init__(self, n_laten... | 2.84375 | 3 |
seisflows3/tools/err.py | bch0w/seisflows3 | 0 | 12773267 | #!/usr/bin/env python3
"""
Custom errors for Seisflows
"""
class ParameterError(ValueError):
"""
A new ValueError class which explains the Parameter's that threw the error
"""
def __init__(self, *args):
if len(args) == 0:
msg = "Bad parameter."
super(ParameterError, sel... | 3.359375 | 3 |
CrossValidation.py | gamzeakkurt/NLP-DisasterTweets | 1 | 12773268 | from sklearn.model_selection import StratifiedKFold
import pandas as pd
skf = StratifiedKFold(n_splits=10, random_state=48, shuffle=True)
def CV(predictors,target):
for fold, (train_index, test_index) in enumerate(skf.split(predictors, target)):
x_train, x_valid = pd.DataFrame(predictors.iloc[train_i... | 2.65625 | 3 |
workflows/api/tests.py | xflows/clowdflows-backend | 4 | 12773269 | from django.contrib.auth.models import User
from rest_framework.reverse import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from workflows.models import Workflow, Widget, Input
TEST_USERNAME = 'testuser'
TEST_PASSWORD = '<PASSWORD>'
# Test workflow ids
TEST_WORKFLOW_USERS_PK ... | 2.28125 | 2 |
app.py | clebertsilva28/desafio9 | 13 | 12773270 | <reponame>clebertsilva28/desafio9<filename>app.py
from flask import Flask, render_template, request, json, jsonify
import os
import json
import numpy as np
import io
from PIL import Image
app = Flask(__name__)
app.config.from_object(__name__)
port = int(os.getenv('PORT', 8080))
@app.route("/", methods=['GET'])
def he... | 3.015625 | 3 |
pharedox/image_processing.py | omarvaneer/pharynx_redox | 2 | 12773271 | <reponame>omarvaneer/pharynx_redox<gh_stars>1-10
import logging
from typing import Union, Tuple
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import numpy.ma as ma
import pandas as pd
import SimpleITK as sITK
import xarray as xr
from numpy.polynomial.polynomial import Polynomial
from scip... | 2 | 2 |
nengo_loihi/hardware/tests/test_interface.py | Michaeljurado24/nengo-loihi | 0 | 12773272 | import socket
import nengo
import numpy as np
import pytest
from nengo.exceptions import SimulationError
from nengo_loihi.block import Axon, LoihiBlock, Synapse
from nengo_loihi.builder.builder import Model
from nengo_loihi.builder.discretize import discretize_model
from nengo_loihi.hardware import interface as hardw... | 1.960938 | 2 |
image2dice_pattern/dice_art_pattern_from_image_create_dice_image_by_paste.py | MajeedAskari/educational_python_scripts | 0 | 12773273 | <reponame>MajeedAskari/educational_python_scripts
from PIL import Image, ImageOps, ImageDraw
dicew = 300
quality = 6 # minimum = 1, maximum = resolution of your dice image / dicesize
im = Image.open("image.png")
im = ImageOps.grayscale(im)
im = ImageOps.equalize(im)
diceh = im.height / im.width * dicew
dicesize = in... | 3.703125 | 4 |
python-is-easy/assignments/basic-loops/main.py | eDyablo/pirple | 0 | 12773274 | '''
Homework assignment for the 'Python is easy' course by Pirple.
Written by <NAME>.
It pprints the numbers from 1 to 100.
But for multiples of three print "Fizz" instead of the number and for the
multiples of five print "Buzz".
For numbers which are multiples of both three and five print "FizzBuzz".
It also adds "p... | 4.34375 | 4 |
stubs/m5stack_flowui-v1_4_0-beta/flowlib/units/_color.py | mattytrentini/micropython-stubs | 0 | 12773275 | <filename>stubs/m5stack_flowui-v1_4_0-beta/flowlib/units/_color.py
"""
Module: 'flowlib.units._color' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1 - updated
from typing import A... | 2.1875 | 2 |
constants.py | OnRails-IN/backend | 0 | 12773276 | <gh_stars>0
import os
ENV = os.environ.get("PYTHON_ENV")
INDEX_KEYS = {
'a':'Amelie', 'b':'Basterds', 'c':'Corleone', 'd':'Django', 'e':'Edgar',
'f':'Floorgang', 'g':'Gandalf', 'h':'HansLanda', 'i':'Ireland', 'j':'Jeeves',
'k':'Kubrick', 'l':'Lebowski', 'm':'Masterpiece', 'n':'Norman', 'o':'Ozymandias',
... | 1.8125 | 2 |
backend/kale/tests/unit_tests/test_kfputils.py | brness/kale | 502 | 12773277 | <reponame>brness/kale
# Copyright 2020 The Kale Authors
#
# 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 applic... | 1.617188 | 2 |
Algorithms_easy/1309. Decrypt String from Alphabet to Integer Mapping.py | VinceW0/Leetcode_Python_solutions | 4 | 12773278 | """
1309. Decrypt String from Alphabet to Integer Mapping
Given a string s formed by digits ('0' - '9') and '#' . We want to map s to English lowercase characters as follows:
Characters ('a' to 'i') are represented by ('1' to '9') respectively.
Characters ('j' to 'z') are represented by ('10#' to '26#') respectively. ... | 3.984375 | 4 |
sendtoairport/groupingdata.py | hellodu-dev/team_schedule | 6 | 12773279 | <reponame>hellodu-dev/team_schedule
# coding:utf-8
"""
<NAME>
June 9,2017
修改
<NAME>
June 22,2017
June 29 ,2017
"""
import json
from itertools import groupby
from operator import itemgetter
from sendtoairport import overwritestartschedule
import func_timeout
# 将订单信息转换为json数组[{numberoforder:3,OrderInfos:[{orderpoid:gf... | 2.328125 | 2 |
CodeUP/Python basic 100/6014.py | cmsong111/NJ_code | 0 | 12773280 | a=input()
print(a)
print(a)
print(a)
| 1.71875 | 2 |
hooks/post_gen_project.py | daleal/cookiecutter-pypackage | 18 | 12773281 | import shutil
import subprocess
import json
import os
# CLEANUP
MANIFEST_FILE = "manifest.json"
def cleanup_disabled_features():
print("⚒ Cleaning up...")
with open(MANIFEST_FILE) as manifest_file:
manifest = json.load(manifest_file)
for feature in manifest["features"]:
if not feature["e... | 2.5 | 2 |
pyqmc/energy.py | gcassella/pyqmc | 0 | 12773282 | #import numpy as np
import jax.numpy as jnp
import pyqmc.eval_ecp as eval_ecp
from pyqmc.distance import RawDistance
def ee_energy(configs):
ne = configs.shape[1]
if ne == 1:
return jnp.zeros(configs.shape[0])
ee = jnp.zeros(configs.shape[0])
ee, ij = RawDistance().dist_matrix(configs)
ee ... | 1.859375 | 2 |
fdk_client/platform/models/SearchLogReq.py | kavish-d/fdk-client-python | 0 | 12773283 | <reponame>kavish-d/fdk-client-python
"""Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class SearchLogReq(BaseSchema):
# Analytics swagger.json
marketplace_name = fields.Str(r... | 1.765625 | 2 |
shared_functions.py | scottmanderson/minerva | 0 | 12773284 | from app.models import DataSource, DataSourcePoll
def fetch_all_data_sources():
try:
all_data_sources = DataSource.query.all()
except Exception:
print("error fetching data sources; table likely empty")
all_data_sources = []
return all_data_sources
def fetch_all_data_source_polls(... | 2.28125 | 2 |
EnglishCheck.py | williamHuang5468/LearnCircleTool | 0 | 12773285 | # -*- coding: utf-8 -*-
from datetime import datetime
from datetime import timedelta
from datetime import date
import sys
def countLearnCirlce(date, itemName):
days = [0,1,2,3,4,5,6]
result = []
for item in days:
result.append((date + timedelta(days=item)).strftime('%Y/%m/%d'))
return result
def getTitle(date):... | 3.421875 | 3 |
comments/serializers.py | syqu22/django-react-blog | 0 | 12773286 | <filename>comments/serializers.py
from rest_framework import serializers
from users.serializers import UserSerializer
from comments.models import Comment
class CommentSerializer(serializers.ModelSerializer):
author = UserSerializer(read_only=True)
class Meta:
model = Comment
fields = ['id', ... | 2.265625 | 2 |
dotnet/private/rules/common.bzl | wbiker/rules_dotnet | 0 | 12773287 | <gh_stars>0
load(
"@io_bazel_rules_dotnet//dotnet/private:providers.bzl",
"DotnetLibrary",
)
def collect_transitive_info(deps):
"""Collects transitive information.
Args:
deps: Dependencies that the DotnetLibrary depends on.
Returns:
A depsets of the references, runfiles and deps. Refe... | 2 | 2 |
data_load_cv_siamese.py | bionlplab/poagnet | 0 | 12773288 | import os
import numpy as np
# from skimage.io import imread
import cv2
import copy
from skimage.transform import resize
def load_data_siamese(x_size,y_size,data_path,label_path,image_s_path,uncentain_path,validation_name,test_name):
tmp = np.loadtxt(label_path, dtype=np.str, delimiter=",")
# delete one image ... | 2.765625 | 3 |
camel_bubblesort/__init__.py | camel-ci/camel-ci-python3 | 0 | 12773289 | name = "camel-ci-python"
| 1.0625 | 1 |
classes/logger.py | tmcdonagh/Autorippr | 162 | 12773290 | # -*- coding: utf-8 -*-
"""
Simple logging class
Released under the MIT license
Copyright (c) 2012, <NAME>
@category misc
@version $Id: 1.7.0, 2016-08-22 14:53:29 ACST $;
@author <NAME>
@license http://opensource.org/licenses/MIT
"""
import logging
import os
import sys
class Logger(object):
def _... | 2.859375 | 3 |
api/tacticalrmm/agents/migrations/0015_note.py | BaDTaG/tacticalrmm | 1 | 12773291 | <gh_stars>1-10
# Generated by Django 3.1.1 on 2020-09-22 20:57
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("agents", ... | 1.617188 | 2 |
policyhandler/policy_consts.py | alex-sh2020/dcaegen2-platform-policy-handler | 2 | 12773292 | <reponame>alex-sh2020/dcaegen2-platform-policy-handler
# ================================================================================
# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apa... | 1.109375 | 1 |
cpa/tests/test2.py | DavidStirling/CellProfiler-Analyst | 98 | 12773293 |
# Fancy-pants method for getting a where clause that groups adjacent image keys
# using "BETWEEN X AND Y" ... unfortunately this usually takes far more
# characters than using "ImageNumber IN (X,Y,Z...)" since we don't run into
# queries asking for consecutive image numbers very often (except when we do it
# deli... | 2.96875 | 3 |
modules/btcppi.py | halesyy/ip-share | 0 | 12773294 | <reponame>halesyy/ip-share<gh_stars>0
from packer import Packer
from fdates import parse
P = Packer()
P.dataset(1, {
"url": "http://bitcoinppi.com/v1.1/global_ppi.csv?from=2011-07-01%2000%3A00&to=2020-10-26%2000%3A00",
"parse_as": "csv",
"name": "Global PPI Bitcoin",
"... | 2.21875 | 2 |
scitokens_protect.py | jbasney/scitokens-heroku | 0 | 12773295 | <reponame>jbasney/scitokens-heroku<filename>scitokens_protect.py
import scitokens
from functools import wraps
from flask import request
import traceback
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.backends import default_backend
import base64
import os
def protect(**outer_kwarg... | 2.4375 | 2 |
restaurant.py | julencosme/python-crash-course | 0 | 12773296 | <filename>restaurant.py
# A module for class Restaurant
"""A set of classes that can be used to represent a restaurant."""
class Restaurant():
"""A model of a restaurant."""
def __init__(self, name, cuisine):
"""Initialize name and age attributes."""
self.name = name
self.cuisine = c... | 4.125 | 4 |
wsgi.py | livingstack/RiverFlows | 0 | 12773297 | import os
import signal
import sys
import traceback
import time
from django.core.wsgi import get_wsgi_application
#from whitenoise.django import DjangoWhiteNoise
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RiverFlows.settings")
application = get_wsgi_application()
#application = DjangoWhiteNoise(application)
| 1.34375 | 1 |
bokchoy/compat.py | ulule/bokchoy | 0 | 12773298 | <filename>bokchoy/compat.py<gh_stars>0
import six
if not six.PY2:
# Python 3.x and up
text_type = str
string_types = (str,)
def as_text(v):
if v is None:
return None
elif isinstance(v, bytes):
return v.decode('utf-8')
elif isinstance(v, str):
... | 2.671875 | 3 |
figuras/PycharmKayStatisticalReport/problem_2_7.py | bor9/estudiando_el_kay | 0 | 12773299 | <reponame>bor9/estudiando_el_kay<filename>figuras/PycharmKayStatisticalReport/problem_2_7.py<gh_stars>0
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
import math
import matplotlib.colors as colors
from matplotlib import cm
from matplotlib import rc
__author__ = 'ernesto'
# if use la... | 3.0625 | 3 |
smoke-test/tests/cypress/integration_test.py | pramodbiligiri/datahub | 9 | 12773300 | import pytest
import subprocess
from tests.utils import ingest_file_via_rest
from tests.utils import delete_urns_from_file
@pytest.fixture(scope="module", autouse=True)
def ingest_cleanup_data():
print("ingesting test data")
ingest_file_via_rest("tests/cypress/data.json")
yield
print("removing test d... | 2.015625 | 2 |
PythonProject/my_photoshop/blur.py | curqder/MyProjects | 0 | 12773301 | <reponame>curqder/MyProjects
"""
File: blur.py
Name: 楊翔竣 <NAME>
-------------------------------
This file shows the original image first,
smiley-face.png, and then compare to its
blurred image. The blur algorithm uses the
average RGB values of a pixel's nearest neighbors
"""
from simpleimage import SimpleImage
def ... | 3.71875 | 4 |
src/examples/__init__.py | flipdot/manim-gallery | 14 | 12773302 | from os.path import dirname, join
import glob
from pathlib import Path
modules = glob.glob(join(dirname(__file__), '**/*.py'), recursive=True)
# __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.startswith('_')]
paths = [Path(x) for x in modules]
__all__ = [
f'{p.parent.name}.{p.stem}' for p in p... | 2.765625 | 3 |
research/cv/dlinknet/src/loss.py | mindspore-ai/models | 77 | 12773303 | # 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
#
# Unless required by applicable law or agreed to... | 2.390625 | 2 |
ceilometer/storage/impl_sqlalchemy.py | dreamhost/ceilometer | 0 | 12773304 | # -*- encoding: utf-8 -*-
#
# Author: <NAME> <<EMAIL>>
# <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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | 2.140625 | 2 |
plaza_routing/setup.py | PlazaNav/PlazaNav | 10 | 12773305 | from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
setup(
name='plaza_routing',
version='0.0.1',
description='Plaza routing service for plazaroute',
long_description=readme,
author='<NAME>, <NAME>',
author_email='<EMAIL>',
url='https://github.c... | 1.21875 | 1 |
algorithm/challenges/misere-nim-1.py | rishabhiitbhu/hackerrank | 0 | 12773306 | <reponame>rishabhiitbhu/hackerrank
g = int(input().strip())
for _ in range(g):
n = int(input().strip())
s = [int(x) for x in input().strip().split(' ')]
x = 0
for i in s:
x ^= i
if len(set(s))==1 and 1 in s:
#here x=0 or 1
if x:#odd no. of ones
print("... | 3.546875 | 4 |
flaskTest.py | thejonty/sensoRaspi | 0 | 12773307 | from flask import Flask, render_template, request, url_for
from datetime import datetime
from readWeather import readWeather
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def print_form():
now = datetime.now()
timeString = now.strftime("%Y-%m-%d %H:%M")
templateData = {
'title' :... | 3.0625 | 3 |
django/docs/releases/1.7.7.txt.py | roshanba/mangal | 0 | 12773308 | <filename>django/docs/releases/1.7.7.txt.py
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXX XXXXX XXXXXXX XXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXX XXX XXXXX
XXXXXX XXXXX XXXXX XXXXXXX XXXX XXX XXXXXXXX XXXXXX XX XXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXX XXXX XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXX XXX... | 1.53125 | 2 |
dags/somalia_dag.py | flatten-official/flatten-scripts | 2 | 12773309 | from datetime import datetime
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from somalia.form.main import main
from somalia.form.somalia_form_data import run_form_data_scraping
from somalia.gsheets.somalia_sheet import mai... | 2.171875 | 2 |
src/gtk3/treeview-treestore/glade/MainWindow.py | alexandrebarbaruiva/gui-python-gtk | 42 | 12773310 | # -*- coding: utf-8 -*-
"""Gtk.TreeView(), Gtk.TreeStore()."""
import gi
gi.require_version(namespace='Gtk', version='3.0')
from gi.repository import Gtk
class Handler:
brazilian_cities = {
'SP': ['Botucatu', 'São Manuel'],
'SC': ['Florianópolis', 'Joinville']
}
def __init__(self):
... | 2.84375 | 3 |
tensorflow/contrib/rnn/python/ops/lstm_ops.py | returncode13/tensorflow | 0 | 12773311 | <filename>tensorflow/contrib/rnn/python/ops/lstm_ops.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | 1.9375 | 2 |
venv/Lib/site-packages/pandas/tseries/api.py | arnoyu-hub/COMP0016miemie | 1 | 12773312 | <filename>venv/Lib/site-packages/pandas/tseries/api.py<gh_stars>1-10
"""
Timeseries API
"""
# flake8: noqa
from pandas.tseries.frequencies import infer_freq
import pandas.tseries.offsets as offsets
| 1.179688 | 1 |
rpcpy/exceptions.py | william-wambua/rpc.py | 152 | 12773313 | <gh_stars>100-1000
class SerializerNotFound(Exception):
"""
Serializer not found
"""
| 1.382813 | 1 |
gamelib/overlay.py | etmaifo/CleanerBot | 1 | 12773314 | <reponame>etmaifo/CleanerBot
import pygame, os
from gamelib.constants import COLOR, SCREEN, ASSET, GAME, FONT
from gamelib.physicsbody import PhysicsBody
import pygame.mixer as mixer
class CountDownOverlay(object):
def __init__(self):
mixer.init()
self.overlay = PhysicsBody(0, SCREEN.height/5, SCR... | 2.890625 | 3 |
src/GimelStudio/node_importer.py | iwoithe/Gimel-Studio | 47 | 12773315 | <reponame>iwoithe/Gimel-Studio<gh_stars>10-100
# ----------------------------------------------------------------------------
# Gimel Studio Copyright 2019-2021 by <NAME> and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 1.78125 | 2 |
demo/euleriansolid/main00_mesh.py | Technologicat/extrafeathers | 0 | 12773316 | # -*- coding: utf-8; -*-
import pathlib
import matplotlib.pyplot as plt
import dolfin
from extrafeathers import meshfunction
from extrafeathers import meshiowrapper
from extrafeathers import plotmagic
print(pathlib.Path.cwd())
meshiowrapper.import_gmsh(src="demo/meshes/box.msh",
dst="dem... | 2.296875 | 2 |
physical_education/tasks.py | skrapi/physical_education | 0 | 12773317 | from typing import Tuple, TYPE_CHECKING
from . import utils
from pyomo.environ import Constraint
if TYPE_CHECKING:
from .system import System3D
def periodic(robot: 'System3D', but_not: Tuple[str, ...], but_not_vel: Tuple[str, ...] = tuple()):
"""
Make all position and velocity states in `robot` periodic,... | 2.84375 | 3 |
djangofeeds/optimization.py | operasoftware/django-feeds | 11 | 12773318 | import BeautifulSoup
from HTMLParser import HTMLParseError
from django.conf import settings
import re
DJANGOFEEDS_REMOVE_TRACKERS = getattr(settings,
"DJANGOFEEDS_REMOVE_TRACKERS", True)
# The obvious tracker images
DJANGOFEEDS_TRACKER_SERVICES = getattr(settings,
"DJANGOFEEDS_TRACKER_SERVICES", [
'http:/... | 2.5 | 2 |
commander/src/commander/commands/AddFilterCommand.py | ugnelis/ros-cameras-controller | 4 | 12773319 | import uuid
import json
from commander.commands.Command import Command
from commander.data_classes.Filter import Filter
class AddFilterCommand(Command):
"""
Add a filter for the camera command.
"""
def __init__(self):
Command.__init__(self)
def execute(self, **kwargs):
"""
... | 2.5625 | 3 |
src/rpc/farmer_rpc_client.py | DONG-Jason/chia-blockchain | 0 | 12773320 | <filename>src/rpc/farmer_rpc_client.py<gh_stars>0
from typing import Dict, List, Optional
from src.rpc.rpc_client import RpcClient
from src.types.sized_bytes import bytes32
class FarmerRpcClient(RpcClient):
"""
Client to Chia RPC, connects to a local farmer. Uses HTTP/JSON, and converts back from
JSON int... | 3.078125 | 3 |
setup.py | ptpt/zhub | 0 | 12773321 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def readme():
with open('README.md') as f:
return f.read()
def requirements():
return list(open('requirements.txt'))
setup(name='zhub',
version='0.1',... | 1.382813 | 1 |
basics/color/hue.py | abhikpal/p5-examples | 16 | 12773322 | <filename>basics/color/hue.py
#
# Hue
#
# Hue is the color reflected from or transmitted through an object.
# and is typically referred to as the name of the color (red, blue,
# yellow, etc). Move the cursor vertically over each bar to alter its
# hue.
#
from p5 import *
bar_width = 20
last_bar = None
def setup():
... | 4.09375 | 4 |
plugins/modules/hashivault_identity_entity.py | fastlorenzo/ansible-modules-hashivault | 0 | 12773323 | <reponame>fastlorenzo/ansible-modules-hashivault
#!/usr/bin/env python
from ansible_collections.terryhowe.hashivault.plugins.module_utils.hashivault import hashivault_argspec
from ansible_collections.terryhowe.hashivault.plugins.module_utils.hashivault import hashivault_auth_client
from ansible_collections.terryhowe.ha... | 1.8125 | 2 |
app/main/errors.py | hettlage/salt-data-quality-site | 0 | 12773324 | <reponame>hettlage/salt-data-quality-site
from flask import current_app, render_template
from . import main
@main.errorhandler(500)
def internal_server_error(e):
current_app.logger.error(str(e), exc_info=1)
return render_template('500.html'), 500
@main.errorhandler(404)
def file_not_found_error(e):
retu... | 2.34375 | 2 |
CIM14/IEC61968/Customers/__init__.py | MaximeBaudette/PyCIM | 58 | 12773325 | <gh_stars>10-100
# Copyright (C) 2010-2011 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge,... | 1.210938 | 1 |
webapp/tests/api-tests.py | clairewlliams/cs257 | 0 | 12773326 | # <NAME> and <NAME>
import unittest
import games_api
import json
class APITester(unittest.TestCase):
def setUp(self):
self.games_api = games_api.GamesApi() #change depending on how we code it, will it be a class?
def tearDown(self):
pass
def test_games_endpoint(self):
url = '/ga... | 3.1875 | 3 |
_src/demo.py | badboy315/omooc.py | 0 | 12773327 | <reponame>badboy315/omooc.py<filename>_src/demo.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
def hello(words="Hollo World!-)"):
print words
#return words
if __name__ == '__main__':
hello('是也乎') | 2.296875 | 2 |
voltha/adapters/brcm_openomci_onu/omci/brcm_vlan_filter_task.py | sathishms77/test | 72 | 12773328 | #
# Copyright 2018 the original author or authors.
#
# 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... | 1.984375 | 2 |
Hereditariedade_e_Polimorfismo/21.1-Multiple-Inheritance_and_The-Lookup-Tree_Diamond-Shape.py | nnsdtr/OOP-Python | 0 | 12773329 | <reponame>nnsdtr/OOP-Python
class A(object):
def do_this(self):
print('do_this() in A')
class B(A):
pass
class C(A):
def do_this(self):
print('do_this() in C')
class D(B, C):
pass
D_instance = D()
D_instance.do_this()
print(D.mro()) # Method resolution order | 2.765625 | 3 |
monitoring/migrations/0002_alter_aspek_kegiatan.py | eewinkk/sdnantwr | 0 | 12773330 | <gh_stars>0
# Generated by Django 4.0.3 on 2022-03-10 15:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('monitoring', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='aspek',
name='kegiatan... | 1.359375 | 1 |
ch1/fibonacci.py | OMGZui/getSister | 1 | 12773331 | <reponame>OMGZui/getSister
a, b = 0, 1
while b < 10:
print(b)
a, b = b, a + b
# 1
# 1
# 2
# 3
# 5
# 8
a, b = 0, 1
while b < 1000:
print(b, end='->')
a, b = b, a + b
# 1->1->2->3->5->8->13->21->34->55->89->144->233->377->610->987->%
| 3.234375 | 3 |
2008/1A/Milkshakes/Milkshakes.py | alexcasgarcia/GCJ | 0 | 12773332 | <reponame>alexcasgarcia/GCJ<filename>2008/1A/Milkshakes/Milkshakes.py
import pdb
#5 (milkshake flavors)
#4 (customers)
#2 1 0 2 0 or 0 0 None None None
#2 1 1 2 1 or 1 1 None None None
#2 1 0 2 1 or 1 0 None None None
#0 0
#1 1
#1 0
#0 1
#find
# for a set of customers with the same # of preferences, figure out whi... | 3.546875 | 4 |
networkapi/requisicaovips/resource/RequestVipValidateResource.py | vinicius-marinho/GloboNetworkAPI | 73 | 12773333 | <reponame>vinicius-marinho/GloboNetworkAPI
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under ... | 1.742188 | 2 |
utilities.py | DannMensah/Project-Kodo | 8 | 12773334 | <gh_stars>1-10
import os
from pathlib import Path
import webbrowser
import threading
import socket
import re
import numpy as np
from cv2 import resize
from operator import itemgetter
from PIL import Image
import colorsys
import random
import copy
def stack_npy_files_in_dir(directory):
merged_array = None
arra... | 2.390625 | 2 |
graph-measures/features_algorithms/accelerated_graph_features/src/accelerated_graph_features/graph_plotter.py | Unknown-Data/QGCN | 3 | 12773335 | import sys
import os
# Leave the path changes here!!!
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
import networkx as nx
import matplotlib.pyplot as plt
from src.accelerated_graph_features.test_python_converter import crea... | 3 | 3 |
app.py | ruyueshuo/YOLOv4_Deployment | 11 | 12773336 | <reponame>ruyueshuo/YOLOv4_Deployment
import argparse
import io
import os
import time
import numpy as np
from importlib import import_module
from flask import Flask, render_template, Response, jsonify, request
import cv2
from PIL import Image
import darknet
# darknet = import_module(".").daknet
app = Flask(__name__)
... | 2.640625 | 3 |
vo/AutoScaleSettingVO.py | liujiage/DevOpsK8s | 1 | 12773337 | class AutoScaleSettingVO:
def __init__(self, mini_size=1, max_size=1, mem_exc=0, deploy_name = ""):
self.miniSize = mini_size
self.maxSize = max_size
self.memExc = mem_exc
self.deployName = deploy_name
self.operationResult = ""
| 1.898438 | 2 |
cornflow/tests/custom_liveServer.py | pchtsp/corn | 5 | 12773338 | from flask_testing import LiveServerTestCase
import cornflow_client as cf
import json
from cornflow.app import create_app
from cornflow.commands import AccessInitialization
from cornflow.shared.utils import db
from cornflow.tests.const import PREFIX
from cornflow.models import UserModel, UserRoleModel
from cornflow.s... | 2.140625 | 2 |
edk2toolext/tests/test_edk2_logging.py | kuqin12/edk2-pytool-extensions | 32 | 12773339 | <reponame>kuqin12/edk2-pytool-extensions<gh_stars>10-100
## @file test_edk2_logging.py
# This contains unit tests for the edk2_logging
##
# Copyright (c) Microsoft Corporation
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import os
import tempfile
import unittest
import logging
from edk2toolext import edk2_loggin... | 2.390625 | 2 |
src/monitor.py | javtges/CEES-Automated-Saturation-System | 1 | 12773340 | <gh_stars>1-10
import cv2
from .roi import ROI
class Monitor(ROI):
"""Vision Monitor.
Contains all methods and values that handle machine vision.
This includes camera interfacing, region of interest (ROI),
and data processing, among others.
"""
def __init__(self, **kwargs):
"""Init... | 3.15625 | 3 |
model/user.py | sookocheff/modelviewcontroller | 0 | 12773341 | from google.appengine.ext import ndb
class User(ndb.Model):
name = ndb.StringProperty()
@classmethod
def get_or_create(cls, name):
if not name:
return None
user = ndb.Key('User', name).get()
if not user:
user = User(name=name, id=name)
user.pu... | 2.78125 | 3 |
scales/pool/watermark.py | steveniemitz/scales | 48 | 12773342 | from collections import deque
import logging
import gevent
from .base import PoolSink
from ..asynchronous import AsyncResult
from ..constants import (Int, ChannelState, SinkProperties, SinkRole)
from ..sink import (
ClientMessageSink,
SinkProvider,
FailingMessageSink
)
from ..dispatch import ServiceClosedError
... | 2 | 2 |
features/hooks/config.py | mrmayfield/pyethereum | 1 | 12773343 | <gh_stars>1-10
import uuid
import mock
import tempfile
from pyethereum.utils import sha3
class ConfigHook(object):
def before_feature(self, context, feature):
'''
.. note::
`context.conf` is used instead of `context.config` because `config`
is used internally in `context`... | 2.203125 | 2 |
textX-LS/core/textx_ls_core/languages/textxfile/__init__.py | goto40/textX-LS | 0 | 12773344 | from .. import LanguageTemplate
class TextxfileLang(LanguageTemplate):
@property
def extensions(self):
return ['textxfile']
@property
def language_name(self):
return 'Textxfile'
| 2 | 2 |
log/27_remove_element.py | uteuliyeva/leetcode_python_solutions | 0 | 12773345 | #Date: 031622
#Difficulty: Easy
class Solution(object):
def removeElement(self, nums, val):
"""
:type nums: List[int]
:type val: int
:rtype: int
"""
write=0
for read in range(len(nums)):
if nums[read]!=val:
nums[write]=nums[read]
... | 3.375 | 3 |
setup.py | jkaluzka/flask-model-mommy | 0 | 12773346 | <reponame>jkaluzka/flask-model-mommy
"""Setup file for flask-model-mommy."""
import setuptools
from os.path import join, dirname
setuptools.setup(
name='flask-model-mommy',
version='0.1.0',
packages=['flask_model_mommy'],
include_package_data=True, # declarations in MANIFEST.in
install_requires=... | 1.390625 | 1 |
src/som/primitives/ast/system_primitives.py | smarr/RTruffleSOM | 9 | 12773347 | from som.primitives.primitives import Primitives
from som.vm.globals import nilObject, falseObject, trueObject
from som.vmobjects.primitive import AstPrimitive as Primitive
from som.vm.universe import std_print, std_println
from rpython.rlib import rgc, jit
import time
def _load(ivkbl, rcvr, args):
argument =... | 2.15625 | 2 |
cvplus/model/videoController.py | AndyTsangChun/cvutil | 0 | 12773348 | #! /usr/bin/env python
import os,sys
import cv2, re
import numpy as np
try:
from pyutil import PyLogger
except ImportError:
from .. import PyLogger
__author__ = "<NAME>"
__credits__ = ["<NAME>"]
__version__ = "0.0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
SRC_TYPE_NAME = ["WebCam","Video","IPCam"]
OUTPUT_V... | 2.40625 | 2 |
src/utils/pkldf2jsonl.py | fatterbetter/CodeSearchNet | 1,681 | 12773349 | <filename>src/utils/pkldf2jsonl.py
import pandas as pd
from .general_utils import chunkify
from dpu_utils.utils import RichPath
from multiprocessing import Pool, cpu_count
def df_to_jsonl(df: pd.DataFrame, RichPath_obj: RichPath, i: int, basefilename='codedata') -> str:
dest_filename = f'{basefilename}_{str(i).zf... | 2.78125 | 3 |
time_feature_extraction.py | paidamoyo/DEAP_classification | 3 | 12773350 | <filename>time_feature_extraction.py
import os
import numpy as np
from scipy.io import loadmat
class TimeFeatureExtraction(object):
def __init__(self, ):
self.dir_path = os.path.dirname(os.path.realpath(__file__))
self.subjects = 32
self.num_labels = 4
def extract_features(self, test... | 2.65625 | 3 |