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 |
|---|---|---|---|---|---|---|
vk_bots/__main__.py | RedHolms/vk_bots | 0 | 51700 | <reponame>RedHolms/vk_bots<filename>vk_bots/__main__.py
import sys
import traceback
import requests
from ._vkapi import VkAPI
from .longpoll import LongPollManager
from . import utils, types, enums
class StopBot(Exception): pass
vk_bots = types.Empty()
class VKBots(object):
"""Main VKBots class"""
def __ne... | 2.359375 | 2 |
python/shapeRecognition.py | Teaching-projects/SZE-Projektmunka2-2019-GPS-Art | 0 | 51701 | import cv2
import sys
import json
import numpy as np
from matplotlib import pyplot as plt
shape='n/aaaa'
imgPath="C:\\xampp\\htdocs\\projektmunka\\python\\haromszog.png"
#imgPath=sys.argv[1]
img = cv2.imread(imgPath, cv2.IMREAD_GRAYSCALE)
_, threshold = cv2.threshold(img, 240, 255, cv2.THRESH_BINARY)
contours, _ = cv2... | 3.046875 | 3 |
test.py | kevinkwl/AoAReader | 67 | 51702 | import aoareader as reader
import torch
import time
import argparse
import os
from preprocess import get_stories, vectorize_stories
parser = argparse.ArgumentParser(description="test.py")
parser.add_argument('-testdata', default='data/test.txt.pt',
help='Path to the test.txt.pt, test.txt.pt will... | 2.40625 | 2 |
datasetCreator.py | pamnani9/Face-Detection | 0 | 51703 | <reponame>pamnani9/Face-Detection
import cv2
import numpy as np
import sqlite3
faceDetect=cv2.CascadeClassifier('C:\\Users\hp\\AppData\\Local\\Programs\\Python\\Python35\\Lib\\site-packages\\cv2\\data\\haarcascade_frontalface_default.xml')
cam=cv2.VideoCapture(0)
def InsertOrUpdate(Id, Name, Gender, Occupation... | 3.328125 | 3 |
simple_rl/apmdp/AP_MDP/RoomCubePlainMDPClass.py | yoonseon-oh/simple_rl | 2 | 51704 | <gh_stars>1-10
''' FourRoomMDPClass.py: Contains the FourRoom class. '''
# Python imports.
import math
import os
from collections import defaultdict
import numpy as np
import time
from simple_rl.apmdp.LTLautomataClass import LTLautomata
# Other imports
from simple_rl.mdp.MDPClass import MDP
from simple_rl.apmdp.AP_MD... | 2.359375 | 2 |
apps/puzzles/admin.py | madjaqk/puzzle_master_v2 | 0 | 51705 | <gh_stars>0
from django.contrib import admin
from .models import PuzzleSet, Puzzle, PuzzleAnswer
admin.site.register(Puzzle)
admin.site.register(PuzzleSet)
admin.site.register(PuzzleAnswer) | 1.25 | 1 |
makmal/admin.py | ParmenidesSartre/Makmal-Record-System | 0 | 51706 | from django.contrib import admin
from .models import Report
@admin.register(Report)
class ReportAdmin(admin.ModelAdmin):
list_display = ['project_name','contractor_name', 'done_on']
search_fields = ['project_name','contractor_name'] | 1.523438 | 2 |
spec/base.py | ace6807/spec-data-validation-pattern | 1 | 51707 | from abc import abstractmethod
from dataclasses import dataclass
from typing import Any
class Spec:
@abstractmethod
def passes(self, candidate: Any) -> bool:
raise NotImplementedError()
def __call__(self, candidate: Any) -> bool:
return self.passes(candidate)
def __and__(self, other:... | 3.515625 | 4 |
albow/demo/screens/DemoTabPanelScreen.py | hasii2011/albow-python-3 | 6 | 51708 | <filename>albow/demo/screens/DemoTabPanelScreen.py
from pygame.event import Event
from albow.containers.TabPanel import TabPanel
from albow.core.ui.Widget import Widget
from albow.core.ui.Shell import Shell
from albow.widgets.Label import Label
from albow.layout.Column import Column
from albow.demo.screens.BaseDem... | 3.09375 | 3 |
server/code/models/article.py | Social-Do-Gooders/localy | 0 | 51709 | <reponame>Social-Do-Gooders/localy
import json
from db import db
class ArticleModel(db.Document):
title = db.StringField(required=True)
content = db.StringField()
author = db.StringField()
date = db.DateTimeField()
article_type = db.StringField(default='other', choices=['business news', '... | 2.5625 | 3 |
config.py | taeram/ineffable | 7 | 51710 | from os import getenv, \
path
from time import time
from datetime import timedelta
class Config(object):
AWS_ACCESS_KEY_ID = getenv('AWS_ACCESS_KEY_ID')
AWS_REGION = getenv('AWS_REGION')
AWS_S3_BUCKET = getenv('AWS_S3_BUCKET')
AWS_SECRET_ACCESS_KEY = getenv('AWS_SECRET_ACCESS_KEY')
C... | 2.046875 | 2 |
tests/test_wins.py | Acamol/connect-four | 0 | 51711 | from ConnectFour import ConnectFour
import pytest
def test_empty_cell():
my = ConnectFour.Game()
assert not my.check_for_win(2, 2)
def test_diagonal_win():
# positive slope
my = ConnectFour.Game()
my.move(1) # X
my.move(2) # Y
my.move(2) # YX
my.move(3) # Y
my.m... | 2.53125 | 3 |
cogs/tweet_image.py | aiotter/kaede-bot | 2 | 51712 | <gh_stars>1-10
import re
import aiohttp
from discord.ext import commands
from bs4 import BeautifulSoup as bs
TWEET_URL_PATTERN = re.compile(r"https?://twitter.com/\S+/status/\d+")
class TweetImage(commands.Cog):
def __init__(self, bot):
self.bot = bot
async def get_tweet_imageurls(self, url):
... | 2.796875 | 3 |
scripts/scripts.py | Asion001/Nft | 0 | 51713 | <filename>scripts/scripts.py<gh_stars>0
from brownie import accounts, network, Wei, project
import os, json
development_networks = ["development"]
def is_development():
return get_network() in development_networks
def get_network():
return network.show_active()
def get_account():
if is_development():... | 2.421875 | 2 |
sdk/python/pulumi_gcp/dns/record_set.py | pulumi-bot/pulumi-gcp | 0 | 51714 | <reponame>pulumi-bot/pulumi-gcp<gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
class RecordSet(pulumi.CustomResource):
"""
Man... | 1.890625 | 2 |
discordbot.py | naoki-eda/discordpy-startup | 0 | 51715 | #coding:UTF-8
import os
import discord
from discord.ext import tasks
from datetime import datetime
token = os.environ['DISCORD_BOT_TOKEN'] #トークン
channel_id = os.environ['CHANNEL_ID'] #チャンネルID
# 接続に必要なオブジェクトを生成
client = discord.Client()
@tasks.loop(seconds=60)
async def loop():
print(datetime.now().strftime("%Y/%... | 2.609375 | 3 |
run.py | nunenuh/crnn.pytorch | 1 | 51716 | import os
import sys
# from lmdb.cffi import version as ver
sys.path.append(os.getcwd())
import torch
from iqra.models.crnn import *
from iqra.modules.feature import *
if __name__ == '__main__':
image_data = torch.rand(3,1,224,224)
text_data = torch.rand(3,512).long()
# text_data = torch.LongTensor(text... | 2.125 | 2 |
ibmcloud_python_sdk/resource/resource_binding.py | mor120/ibmcloud-python-sdk | 2 | 51717 | <reponame>mor120/ibmcloud-python-sdk
import json
from ibmcloud_python_sdk.config import params
from ibmcloud_python_sdk.auth import get_headers as headers
from ibmcloud_python_sdk.utils.common import query_wrapper as qw
from ibmcloud_python_sdk.utils.common import resource_not_found
from ibmcloud_python_sdk.utils.commo... | 2.421875 | 2 |
examples/plot_dtd.py | diamondjems016/galaxy_analysis | 1 | 51718 | import numpy as np
import yt
from matplotlib import rc
fsize = 17
rc('text', usetex=False)
rc('font', size=fsize)#, ftype=42)
line_width = 3
point_size = 30
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from galaxy_analysis.particle_analysis import particle_types as pdef
def plot_dtd(ds):
... | 2.375 | 2 |
tests/web/classes/__init__.py | DavidCain/python-slackclient | 2,486 | 51719 | STRING_51_CHARS = "SFOTYFUZTMDSOULXMKVFDOBQWNBAVGANMVLXQQZZQZQHBLJRZNY"
STRING_301_CHARS = (
"ZFOMVKXETILJKBZPVKOYAUPNYWWWUICNEVXVPWNAMGCNHDBRMATGPMUHUZHUJKFWWLXBQXVDNCGJHAPKEK"
"DZCXKBXEHWCWBYDIGNYXTOFWWNLPBTVIGTNQKIQDHUAHZPWQDKKCHERBYKLAUOOKJXJJLGOPSCRVEHCOAD"
"BFYKJTXHMPPYWQVXCVGNNSXLNIHVKTVMEOIRXQDPLHID... | 1.28125 | 1 |
foodplanapp/migrations/0006_dish_active.py | 949027/food-plan | 0 | 51720 | <reponame>949027/food-plan<gh_stars>0
# Generated by Django 4.0.3 on 2022-03-17 18:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foodplanapp', '0005_merge_0002_delete_user_0004_alter_dish_calories'),
]
operations = [
migrations.Add... | 1.242188 | 1 |
authors/apps/escalation/tests/test_escalation.py | andela/ah-the-immortals-backend | 2 | 51721 | <filename>authors/apps/escalation/tests/test_escalation.py
import json
from rest_framework.views import status
from .basetest import BaseTest
class EscalationArticlesTest(BaseTest):
"""
Test cases for article escalation
"""
msg = "Sorry we couldn't find that article."
snitch = "You can't report y... | 2.609375 | 3 |
deepfence_backend/utils/fim_config_utils.py | deepfence/ThreatMapper | 1,281 | 51722 | <filename>deepfence_backend/utils/fim_config_utils.py
import yaml
import json
from jsonschema import validate
from jsonschema.exceptions import ValidationError, SchemaError
def validate_fim_config(fim_config):
with open("/etc/df_sysmon/fim_config_schema.json", "r") as schemafile:
fim_schema = schemafile.r... | 2.75 | 3 |
app/etl.py | pqtrng/spotify | 0 | 51723 | <reponame>pqtrng/spotify
from dotenv import load_dotenv
import os, sys
sys.path.insert(
0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
)
# Local
from app.validate import validate
from app.extract import extract
from app.load import load
load_dotenv(".env")
def etl():
# Extract
... | 2.359375 | 2 |
moitoi_docker_hive/assets/backend/forms.py | kepsic/moitoi_docker_hive | 0 | 51724 | from flask_wtf import FlaskForm
from wtforms import IntegerField
from wtforms.validators import DataRequired
class ClusterSetupForm(FlaskForm):
clusters = IntegerField('Clusters', validators=[DataRequired()])
replicas = IntegerField('Replicas', validators=[DataRequired()])
| 2.21875 | 2 |
wikiWebCrawler/dumpWikiExtractionIDs.py | chrhenning/image_text_relation | 0 | 51725 | #!/usr/bin/env python3
# Tool that dumps all the (ids, titles, urls) of SimpleWiki articles into a pickle file. It reads this information from the output of the WikiExtraction parser [1]
# [1]: https://github.com/attardi/wikiextractor
import argparse
import os
import random
import pickle
from lxml import etree
if __n... | 3.21875 | 3 |
attack/attacker.py | smallflyingpig/adversarial_attack_and_defense | 0 | 51726 | <filename>attack/attacker.py
import torch
from torch import nn
from abc import ABC, abstractmethod
class AdditiveAttacker(ABC):
def __init__(self, eps, data_min=-1, data_max=1):
self.eps = eps
self.data_min = data_min
self.data_max = data_max
@abstractmethod
def _get_perturbation(s... | 3.125 | 3 |
SteamProphet/apps/SteamProphet/urls.py | sgarcialaguna/SteamProphet | 0 | 51727 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.PlayerListView.as_view(), name='player_list'),
url(r'^login/$', views.LoginView.as_view(), name='login'),
url(r'^privacy/$', views.PrivacyView.as_view(), name='privacy'),
url(r'^games/$', views.GameListView.as_view()... | 1.773438 | 2 |
scheduling_application/tokens.py | myangDevy/SACSSC-Scheduler | 3 | 51728 | # UNUSED
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from six import text_type
class TokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self, appointment, timestamp):
return (text_type(appointment.volunteer)+text_type(appointment.pk)+text_type(timestamp))
# ret... | 1.96875 | 2 |
Fundamentals/Exercises/Text_Processing_Lab/1_reverse_string.py | tankishev/Python | 2 | 51729 | # You will be given series of strings until you receive an "end" command. Write a program that reverses strings and prints each pair on separate line in the format "{word} = {reversed word}".
while True:
word = input()
if word == 'end':
break
reversed_word = word[::-1]
print(f"{word} = {r... | 4.46875 | 4 |
fixture/orm.py | Emeraldany/python_training | 0 | 51730 | <gh_stars>0
import datetime
from pymysql.converters import encoders, decoders, convert_mysql_timestamp
from pony.orm import *
class ORMFicture:
db=Database()
class ORMGroup(db.Entity):
_table_= 'grouplist'
id= PrimaryKey(int,column='group_id')
name=Optional(str,column='group_name')
... | 2.515625 | 3 |
parseNodes.py | Granoia/Hypergraph-Stats | 0 | 51731 | <gh_stars>0
import parseCount
def parse_nodes(filename): #extracts information from the list of hypernodes and puts them into node objects. Right now it only actually uses the names of the nodes.
node_ls = []
with open(filename, 'r') as file:
file.readline()
for line in file.readlines():... | 3.15625 | 3 |
tests/models/test_classification.py | WadhwaniAI/cac-test-release | 24 | 51732 | """Tests cac.models.classification.ClassificationModel"""
import os
from os.path import dirname, join, exists
from copy import deepcopy
import torch
import wandb
import unittest
from tqdm import tqdm
import numpy as np
from torch import optim
from cac.config import Config
from cac.utils.logger import set_logger, color
... | 2.328125 | 2 |
base/modules/tmp/sb_utils/root/sb_utils/serialize/enums.py | ScreamBun/openc2-oif-device | 2 | 51733 | <filename>base/modules/tmp/sb_utils/root/sb_utils/serialize/enums.py
from shutil import which
from typing import Dict
from ..enums import EnumBase
class SerialFormats(str, EnumBase):
"""
The format of an OpenC2 Serialization
"""
# Binary Format
CBOR = 'cbor'
# Text Format
JSON = 'json'
... | 2.78125 | 3 |
package.py | OSS-Pipeline/rez-doxygen | 0 | 51734 | <reponame>OSS-Pipeline/rez-doxygen
name = "doxygen"
version = "1.8.18"
authors = [
"<NAME>"
]
description = \
"""
Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports
other popular programming languages such as C, Objective-C, C#, PHP, Ja... | 1.242188 | 1 |
selectolx.py | buritica06/Scraping_Project | 0 | 51735 | import random
from time import sleep
from selenium import webdriver
# Instancio el driver de selenium que va a controlar el navegador
# A partir de este objeto voy a realizar el web scraping e interacciones
driver = webdriver.Chrome(r"C:\Users\rburi\AppData\Local\Programs\Python\Python39\Proyectos\Scraping_Project\chr... | 3.390625 | 3 |
OnlineJudge/t2.py | flyinglandlord/BUAA-SAE-DataStructure-2021 | 2 | 51736 | class Node():
def __init__(self, data=None, left=None, right=None):
self.data = data
self.left = left
self.right = right
def tree_in(node_list):
list_in = input().split()
l = len(list_in)
node_list.append(Node(list_in[0]))
for i in range(1, l):
if list_in[i] == "Non... | 3.515625 | 4 |
custom_components/ecowitt/sensor.py | synth3tk/homeassistant_ecowitt | 15 | 51737 | <gh_stars>10-100
"""Support for Ecowitt Weather Stations."""
import logging
import homeassistant.util.dt as dt_util
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import DEVICE_CLASS_BATTERY
from homeassistant.const ... | 1.96875 | 2 |
hashtag_corpus.py | Procope/emo2vec | 15 | 51738 | <reponame>Procope/emo2vec
from keras.preprocessing.sequence import pad_sequences
from keras.preprocessing.text import Tokenizer
from keras.utils import to_categorical
import numpy as np
CORPUS_PATH = 'resources/data/hashtag/hashtag_corpus.txt'
labels_index = {'anger': 0,
'disgust': 1,
... | 2.828125 | 3 |
components/gbf.py | MizaGBF/MizaBOT | 19 | 51739 | <filename>components/gbf.py
import ssl
import re
import json
import zlib
from urllib import request
from datetime import datetime, timedelta
# ----------------------------------------------------------------------------------------------------------------
# GBF Component
# ------------------------------------... | 2.40625 | 2 |
CardScraperJP.py | type-null/PTCG-database | 0 | 51740 | """
Scrape card info from pokemon-card.com
and save as csv file
author: type-null
date: July 2020
"""
import bs4
import sys
import requests
import pandas as pd
def getContent(cardId):
# anti-scraping
user_agent = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0"
url = f'https:/... | 3.140625 | 3 |
sample/views.py | madisona/django-mongo-storage | 3 | 51741 | # Create your views here.
import mimetypes
from django.http import HttpResponse
from django import shortcuts
from sample import models
def serve_mongo_download(request, mongo_id):
obj = shortcuts.get_object_or_404(models.SampleModel, content=mongo_id)
return get_mongo_response(obj.content)
def get_mongo_re... | 2.375 | 2 |
uitwerkingen/4-decisiontree.py | harcel/PyDataScienceIntroNL | 0 | 51742 | <reponame>harcel/PyDataScienceIntroNL
titanic = pd.read_csv(os.path.join('data', 'titanic3.csv'))
print(titanic.head())
labels = titanic.survived.values
features = titanic[['pclass', 'sex', 'age', 'sibsp', 'parch', 'fare', 'embarked']]
features_dummies = pd.get_dummies(features, columns=['pclass', 'sex', 'embarked'])
... | 2.921875 | 3 |
serial_samples.py | jusola/arduino-influxdb | 0 | 51743 | # Copyright 2017 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 3.15625 | 3 |
bot.py | ruberVulpes/a-discord-bot | 0 | 51744 | <gh_stars>0
from bot import client
from env import discord_token
if __name__ == '__main__':
client.run(discord_token)
| 1.578125 | 2 |
tools/trace_utils.py | jhall11/sts | 5 | 51745 | <reponame>jhall11/sts<filename>tools/trace_utils.py
#!/usr/bin/python
import sys
import json
import os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import sts.replay_event as replay_events
from sts.input_traces.log_parser import parse
from sts.util.tabular import Tabular
from sts.event_dag import E... | 2.140625 | 2 |
plorts/plotting.py | brucespang/plorts | 1 | 51746 | <reponame>brucespang/plorts<gh_stars>1-10
import os
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from . import palettes
import errno
def colors_from_hue(data, hue, cmap):
if hue is None:
return [cmap(0.5)]
num_colors = len(data.groupby(hue))
cm_subsection = np.linspace(... | 3.078125 | 3 |
gofri/lib/main.py | ThomasKenyeres/Gofri | 0 | 51747 | import importlib
import os
import runpy
import shutil
from configparser import ConfigParser
import pkg_resources
import sys
from clinodes.nodes import ArgNode, Switch
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relation, sessionmaker
from gofri.lib.http... | 1.75 | 2 |
src/oh_scraper.py | erik1066/covid-web-scraper | 3 | 51748 | import requests, io, csv, datetime
import county_report, state_report
STATE_ABBR = 'OH'
STATE = 'Ohio'
URL = 'https://coronavirus.ohio.gov/static/COVIDSummaryData.csv'
def scraper():
# make an HTTP web request to get the CA CSV file
response = requests.get(URL)
if response.status_code == requests.codes.o... | 3.53125 | 4 |
sample/sample_presignedURLS.py | unicloud-uos/uos-sdk-python | 0 | 51749 | from ossConfig import ossConfig
import Oss
access_key = '<KEY>'
secret_key = '<KEY>'
endpoint_url = 'http://XXXXXXXXXXXXXXXXX.com'
config = ossConfig(access_key, secret_key, endpoint_url)
bucket_name = 'test1'
object_name = 'mytestput'
URL = Oss.PresignedURLs(config, bucket_name, object_name)
print(URL)
| 1.9375 | 2 |
league_team.py | raka-gunarto/nse-team-scraper | 0 | 51750 | from bs4 import BeautifulSoup
import urllib.request
from league_player import LeaguePlayer
BASE_URL = "https://tournaments.nse.gg/"
class LeagueTeam:
def __init__(self, url):
self.html_soup = BeautifulSoup(urllib.request.urlopen(url).read(), features="html.parser")
self.__parse_players(... | 2.859375 | 3 |
isensus/version.py | MPI-IS/isensus | 0 | 51751 | <reponame>MPI-IS/isensus
__version__ = "0.3b"
| 0.828125 | 1 |
roasttron/apps/roast/views.py | chrisvans/roasttron | 0 | 51752 | import models
import serializers
# Third Party
from rest_framework import viewsets
class RoastViewSet(viewsets.ModelViewSet):
"""
API endpoint that allows roastss to be viewed or edited.
"""
filter_fields = ['coffee', ]
queryset = models.Roast.objects.all()
serializer_class = serializers.Roas... | 2.03125 | 2 |
numba/tests/test_overlap.py | auderson/numba | 6,620 | 51753 | import numpy as np
from numba import jit
from numba.core import types
from numba.tests.support import TestCase, tag
import unittest
# Array overlaps involving a displacement
def array_overlap1(src, dest, k=1):
assert src.shape == dest.shape
dest[k:] = src[:-k]
def array_overlap2(src, dest, k=1):
assert... | 2.5 | 2 |
vendors/models.py | jeffshek/betterself | 98 | 51754 | <reponame>jeffshek/betterself
from django.db import models
from betterself.base_models import BaseModelWithUserGeneratedContent
class Vendor(BaseModelWithUserGeneratedContent):
RESOURCE_NAME = 'vendors'
name = models.CharField(max_length=200)
email = models.EmailField(max_length=254, null=True, blank=Tr... | 2.140625 | 2 |
cmsplugin_blog/utils.py | Troyhy/cmsplugin-blog | 0 | 51755 | <reponame>Troyhy/cmsplugin-blog
from django.utils.translation import get_language, ugettext_lazy as _
from django.conf import settings
def module_exists(str):
try:
__import__(str)
except ImportError:
return False
return True
def is_multilingual():
return 'cmsplugin_blog.mi... | 2.109375 | 2 |
scripts/CAAs_from_TCGA.py | pascalduijf/CAAs_1 | 3 | 51756 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections
import csv
import io
import math
import pathlib
import re
import pandas as pd
class Barcode:
"""A TCGA barcode.
TCGA barcodes can be truncated at almost any segment depending on what they represent, for example, a particiant, a
sample or... | 3.46875 | 3 |
app/authenticationUtils.py | spravesh1818/globalFantasyLeague | 0 | 51757 | from datetime import timedelta, datetime
from typing import Optional
from fastapi import HTTPException, Depends
from fastapi.security import OAuth2PasswordBearer
from jose import jwt, JWTError
from passlib.context import CryptContext
from pydantic import BaseModel
from db import database as adb
from usermanagement.mod... | 2.5625 | 3 |
src/ralph/scan/tests/plugins/test_proxmox_2_3.py | vi4m/ralph | 1 | 51758 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.test import TestCase
from ralph.discovery.tests.util import MockSSH
from ralph.scan.plugins.proxmox_2_3 import (
_get_node_sn,
... | 2.03125 | 2 |
avg.py | subhendu17620/codechef | 0 | 51759 | <reponame>subhendu17620/codechef<filename>avg.py
for t in range(int(input())):
n,k,v=map(int,input().split())
a=list(map(int,input().split()))
s=0
for i in range(n):
s+=a[i]
x=(((n+k)*v)-s)/k
x=float(x)
if x>0:
if((x).is_integer()):
print(int(x))
else:
... | 2.984375 | 3 |
util/logging.py | cassianobecker/dnn | 3 | 51760 | <reponame>cassianobecker/dnn
import logging
import logging.handlers
import sys
def set_logger(name, level, log_furl=None):
"""
Creates/retrieves a Logger object with the desired name and level.
"""
logger = logging.getLogger(name)
if not len(logger.handlers):
formatter = logging.Formatter... | 2.703125 | 3 |
e2e/slack/test_accessbot_slack_match_alias.py | easternlabs/accessbot | 0 | 51761 | # pylint: disable=invalid-name
import sys
import pytest
from unittest.mock import MagicMock
sys.path.append('plugins/sdm')
sys.path.append('e2e')
from test_common import create_config, DummyResource, get_dummy_person, DummyRole, ErrBotExtraTestSettings
from lib import ShowResourcesHelper
pytest_plugins = ["errbot.ba... | 1.960938 | 2 |
codes/Python/mqtt_pub.py | abhaysbharadwaj/pscmr_vijayawada | 0 | 51762 | import paho.mqtt.client as mqtt
import time
from random import randint
statusTopic = 'abhay/home/room1/status'
tempTopic = 'abhay/home/room1/temp'
humdTopic = 'abhay/home/room1/humd'
mqttBrokerIp = '172.16.31.10'
mqttBrokerPort = 1883
client = mqtt.Client()
client.connect(mqttBrokerIp, mqttBrokerPort)#172.... | 2.59375 | 3 |
src/utils/analytics.py | marcgarrofe/Twitter-Sentiment-Analysis | 0 | 51763 | <reponame>marcgarrofe/Twitter-Sentiment-Analysis
import pandas as pd
import numpy as np
def count_class_type(dataset: pd.DataFrame, column_label: str):
"""
Counts de class type of the dataset
:param dataset: Input data
:param column_label: Name of the column to be analyzed
"""
assert dataset.s... | 3.53125 | 4 |
automol/pot/_read.py | sjklipp/automol | 0 | 51764 | <reponame>sjklipp/automol<filename>automol/pot/_read.py<gh_stars>0
""" Finds different types of maxima along potentials. Currently works
with lists of energies instead of the standard potential dict in
other functions.
"""
import numpy
from scipy.signal import argrelextrema
from phydat import phycon
ETHRESH ... | 2.328125 | 2 |
setup.py | TheUnity42/Micro2Project | 0 | 51765 | <gh_stars>0
from SQLTools import Enable_SQLite_Image_Compressor
import numpy as np
import pandas as pd
import imageio
import sqlite3
import re
import glob
import tqdm
import kaggle
import sys
import PIL
def ProcessKaggle():
print("Downloading Kaggle data...")
# fetch the dataset
kaggle.api.authenticate()
... | 2.46875 | 2 |
conjureup/controllers/base/spellpicker/gui.py | iMichka/conjure-up | 1 | 51766 | import os
from conjureup import controllers, utils
from conjureup.app_config import app
from conjureup.download import EndpointType, download_local
from conjureup.models.addon import AddonModel
from conjureup.models.step import StepModel
from conjureup.ui.views.spellpicker import SpellPickerView
class SpellPickerCon... | 2.296875 | 2 |
klearn/ensemble/ensemble.py | KevinLiao159/klearn | 1 | 51767 | import pandas as pd
import numpy as np
from copy import deepcopy
import warnings
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.model_selection import cross_val_predict
from sklearn.model_selection import KFold, StratifiedKFold
from sklearn.externals.joblib import Parallel, delayed
from gravity_l... | 2.546875 | 3 |
adlib/tests/learners/feature_deletion_run_with_dataset.py | xyvivian/adlib | 0 | 51768 | import sys
from data_reader.operations import load_dataset
from sklearn import metrics
import adlib.learners as learner
from data_reader.dataset import EmailDataset
import matplotlib.pyplot as plt
def main(argv):
"""
driver class that performs demo of the library
"""
# pre-process data and randomly p... | 2.921875 | 3 |
accounts/admin.py | devmedtz/sogea | 3 | 51769 | <filename>accounts/admin.py
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import Group
from . import forms
from . models import CustomUser, Profile
# Register the new UserAdmin...
admin.site.register(CustomUser)
admin.site.register(Pr... | 1.648438 | 2 |
tests/test.py | hagenw/massdatasets | 1 | 51770 | <reponame>hagenw/massdatasets<filename>tests/test.py
import pandas as pd
import massdatasets
def test_mus2016():
ref_frame = pd.read_csv(
'./data/sisec_mus_2017_full.csv'
)
frame = massdatasets.mus2016().to_pandas_df()
frame = frame.sample(10)
for idx, row in frame.iterrows():
... | 2.5 | 2 |
survivor/tests/survivor.py | vix993/project-lifeline | 1 | 51771 | <reponame>vix993/project-lifeline<filename>survivor/tests/survivor.py
from rest_framework.test import APITestCase
from rest_framework import status
from rest_framework.reverse import reverse as api_reverse
from survivor.models import Survivor, FlagAsInfected, Reports
class SurvivorAPITestCase(APITestCase):
def s... | 2.5 | 2 |
Lib/site-packages/argparseqt/gui.py | fochoao/cpython | 1 | 51772 | # -*- coding: utf-8 -*-
''' Widgets for displaying argparse arguments in a GUI '''
import argparse
from qtpy import QtCore, QtWidgets
from . import groupingTools, wrappedWidgets
class ArgDialog(QtWidgets.QDialog):
''' A simple settings dialog containing a single ArgparseWidget and stardard ok/cancel dialog buttons... | 3.15625 | 3 |
src/farrow_and_ball/__init__.py | vork/farrowandball | 1 | 51773 | from farrow_and_ball.palettes import (
BaseColorPalette,
DivergentPalette,
MiscPalette,
PaletteNotFoundError,
PaletteTypeNotImplementedError,
SpectralPalette,
all_palettes,
build_colormap,
get_palette,
get_interpolated_palette,
)
| 1.1875 | 1 |
bravo_mailer.py | chuan-wang/standalone_scripts | 3 | 51774 |
import smtplib
import argparse
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
def main(args):
# Allow HTML-formatted emails (very simplistic atm, should be expanded if used)
msg = MIMEMultipart("alternative")
if args["body"].startswith("<html>", 0, 10):
msg.attach(MIMEText(a... | 3.125 | 3 |
src/models/board.py | jonathanabila/22E1_5-draughts | 1 | 51775 | from copy import deepcopy
from typing import List
from constants import BLACK, COLS, PIECES, RED, ROWS, SQUARE_SIZE, WHITE
from models.pieces import Piece
import pygame
class Board:
def __init__(self):
self.board = []
self.create_board()
self.white_left = self.red_left = PIECES
... | 3.40625 | 3 |
basic_measure_worker.py | KPF-newstrust/ntrust-worker | 3 | 51776 | #!/usr/bin/env python3
import os
import sys
import json
import configparser
import logging
import logging.config
import traceback
# install required package if in docker
if os.geteuid() == 0:
import pkgutil
import subprocess
required_pkgs = ["pytz"]
for pkg in required_pkgs:
if not pkgutil.fin... | 1.867188 | 2 |
controllers/basic_controller.py | Falcon1991/kinova_drake | 5 | 51777 | <filename>controllers/basic_controller.py<gh_stars>1-10
##
#
# A simple controller which sends constant outputs. To be used as
# a template for more complex controllers.
#
##
from pydrake.all import *
from kinova_station import EndEffectorTarget, GripperTarget
class BasicController(LeafSystem):
"""
A simple... | 2.96875 | 3 |
skope_loader/dsloader.py | openskope/dataset-utilities | 0 | 51778 | """
Indexes a dataset in Elasticsearch.
The dataset consists of a dataset.json file and optional supporting files
stored in the same directory. If a supporting file is found, it overrides
that section of the dataset.json.
Where possible dsloader attempts to enhance and complete information
available in dataset.json ... | 2.65625 | 3 |
Indexer/EacCpf.py | atbradley/eaccpf-indexer | 0 | 51779 | """
This file is subject to the terms and conditions defined in the
LICENSE file, which is part of this source code package.
"""
from DigitalObject import DigitalObject
from lxml import etree
import Cfg
import Utils
import hashlib
import logging
import os
# namespaces
DOC_KEY = "doc"
DOC_NS = "urn:isbn:1-931666-33-4... | 2.375 | 2 |
utils/__init__.py | nmiles2718/PACMan_dist | 0 | 51780 | __all__ = ['adscrawl','classifier','proposal_scraper','tokenizer']
| 1.023438 | 1 |
Mundo 03/ex115/libr/interfac/__init__.py | AlanyLourenco/Python | 0 | 51781 | def linha(tam=42):
return '-'*tam
def cab(txt):
print(linha())
print(txt.center(42))
print(linha())
def leiaint(msg):
while True:
try:
n=int(input(msg))
except(ValueError, TypeError):
print(f'\033[31mERRO: Por favor, digite um número inteiro valido.\033[m'... | 3.640625 | 4 |
nodes/ssn_node.py | aneeshads/EPAi4.0-Capstone | 0 | 51782 | <reponame>aneeshads/EPAi4.0-Capstone<filename>nodes/ssn_node.py
import bpy
from bpy.types import NodeTree, Node, NodeSocket
from ..customnodetree import MyCustomTreeNode
class MyCustomNodeSSN(Node, MyCustomTreeNode):
'''A custom node that accepts input of fake social security numbers (SSN) \
from the Faker li... | 3.109375 | 3 |
api/app/reviews/models.py | martinoywa/Baobab | 1 | 51783 | <filename>api/app/reviews/models.py
from datetime import datetime
from app import db
class ReviewForm(db.Model):
id = db.Column(db.Integer(), primary_key=True)
application_form_id = db.Column(db.Integer(), db.ForeignKey('application_form.id'), nullable=False)
is_open = db.Column(db.Boolean(), nulla... | 2.34375 | 2 |
src/nl_rendering/utils.py | MeteoSwiss-APN/nl_rendering | 0 | 51784 | <gh_stars>0
"""Utils for the command line tool."""
# Standard library
import logging
def count_to_log_level(count: int) -> int:
"""Map occurrence of the command line option verbose to the log level."""
if count == 0:
return logging.ERROR
elif count == 1:
return logging.WARNING
elif cou... | 2.46875 | 2 |
src/pykeen/datasets/inductive/__init__.py | andreasala98/pykeen | 0 | 51785 | <reponame>andreasala98/pykeen
# -*- coding: utf-8 -*-
"""Inductive models in PyKEEN."""
| 0.828125 | 1 |
cli.py | shiftsayan/plane | 0 | 51786 | <reponame>shiftsayan/plane
from PyInquirer import prompt
from schema import schema
from profiles import profiles
def prompt_schema():
questions = [
{
'type': 'list',
'name': 'schema',
'message': "What type of email do you want to send?",
'choices': [ ps.id ... | 2.875 | 3 |
python/pymips/plugins/sklearn.py | elanmart/mips | 8 | 51787 | import numpy as np
from sklearn.exceptions import NotFittedError
from sklearn.linear_model import SGDClassifier
from sklearn.linear_model.base import LinearClassifierMixin
from sklearn.utils import check_array
import faiss
def _default_index(d):
index = faiss.index_factory(d, "IVF2048,Flat", faiss.METRIC_INNER_P... | 2.53125 | 3 |
tests/system/data_sources/deploy_cloudsql/cloudsql_resource_manager.py | Robby29/professional-services-data-validator | 0 | 51788 | # 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 agreed to in writing, ... | 2.015625 | 2 |
Utils.py | rasvetik/COVID-19 | 0 | 51789 | """
Created on Thursday Mar 26 2020
<NAME>
based on
https://www.kaggle.com/bardor/covid-19-growing-rate
https://github.com/CSSEGISandData/COVID-19
https://github.com/imdevskp
https://www.kaggle.com/yamqwe/covid-19-status-israel
"""
import datetime
import numpy as np
import pandas as pd
import seaborn as... | 2.28125 | 2 |
src/lib/kombi/Task/Image/ConvertImageTask.py | paulondc/chilopoda | 2 | 51790 | import os
from ..Task import Task
from .UpdateImageMetadataTask import UpdateImageMetadataTask
from ... import Crawler
class ConvertImageTask(Task):
"""
Convert the source image (from the crawler) to the target one using oiio.
"""
def __init__(self, *args, **kwargs):
"""
Create a Conve... | 2.5625 | 3 |
mc_cnn/preprocessing/preprocessing_beefrost_data_fusion_contest.py | CNES/Pandora_MCCNN | 3 | 51791 | #!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2021 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA_MCCNN
#
# https://github.com/CNES/Pandora_MCCNN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 2.34375 | 2 |
src/devlprd/filtering.py | FANTM/devlprd | 1 | 51792 | import numpy as np
# NOTE: these all assume a sample rate of 1000Hz and 0-centered(ish)
BUTTER2_45_55_NOTCH = [[0.95654323, -1.82035157, 0.95654323, 1., -1.84458768, 0.9536256 ],
[1. , -1.90305207, 1. , 1., -1.87701816, 0.95947072]]
BUTTER4_45_55_NOTCH = [[0.92117099, -1.75303637, ... | 1.71875 | 2 |
lib/vdlib/torrent/torrentplayer.py | vadyur/script.module.vd-common | 0 | 51793 | # -*- coding: utf-8 -*-
import os, sys
from ..util.log import debug, print_tb
from ..util import filesystem
from ..util.string import decode_string
if sys.version_info < (3, 0):
from .bencode import BTFailure as BTError
from .bencode import bdecode, bencode
else:
from .bencodepy import BencodeDecodeError as BTErr... | 2.265625 | 2 |
RpiCluster/PrimaryNodes/RpiPrimary.py | chewett/RaspberryPiCluster | 1 | 51794 | <reponame>chewett/RaspberryPiCluster
import socket
from RpiCluster.MainLogger import logger
from RpiCluster.RpiClusterClient import RpiClusterClient
from RpiCluster.RpiInfluxClient import RpiInfluxClient
class RpiPrimary:
"""Class to create a primary node which will handle connections coming in from a secondary
... | 2.859375 | 3 |
Python/diameter-of-binary-tree.py | kuanhungchen/leetcode-practice | 1 | 51795 | # Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def diameterOfBinaryTree(self, root):
self.ans = 1
def dfs(node):
if not node: return 0
l = dfs(node.left... | 3.6875 | 4 |
tests/test_utils.py | froysm/stpmex-python | 37 | 51796 | import datetime as dt
from stpmex.utils import strftime, strptime
def test_strftime():
assert strftime(dt.date(2020, 4, 20)) == '20200420'
def test_strptime():
assert strptime('20200420') == dt.date(2020, 4, 20)
| 3.125 | 3 |
lib/fama/project/project.py | aekazakov/FamaProfiling | 0 | 51797 | """Describes Project class"""
import os
from collections import defaultdict
from fama.utils.const import ENDS
from fama.project.program_config import ProgramConfig
from fama.project.project_options import ProjectOptions
from fama.project.sample import Sample
from fama.reference_library.reference_data import ReferenceD... | 2.171875 | 2 |
start.py | DestinyofYeet/antonstechbot | 1 | 51798 | <filename>start.py
from consolemenu import *
from consolemenu.items import *
import os
import sys
import subprocess
import webbrowser
import time
import requests
import json
from colorama import *
import mysql.connector
VERSION = subprocess.check_output(["git", "describe", "--tags", "--always"]).decode('ascii').strip(... | 2.484375 | 2 |
python/protobufs/services/post/actions/add_to_collections_pb2.py | getcircle/protobuf-registry | 0 | 51799 | <gh_stars>0
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protobufs/services/post/actions/add_to_collections.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf impo... | 0.972656 | 1 |