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 |
|---|---|---|---|---|---|---|
server.py | kaseykwong/bme590final | 0 | 12796251 | <gh_stars>0
from flask import Flask, request
from pymodm import connect
from pymodm import MongoModel, fields, errors
import pymodm
import requests
from datetime import datetime
import logging
connect("mongodb://almostdone:<EMAIL>:45148/bme590final")
app = Flask(__name__)
class HeadData(MongoModel):
season = fi... | 2.734375 | 3 |
tests/test_connection.py | accuenmedia/amazonadapi | 0 | 12796252 | <reponame>accuenmedia/amazonadapi
import unittest
import config
from amazonadapi.connection import Connection
class ConnectionTestCase(unittest.TestCase):
def test_connection(self):
connection = Connection(config.ad_client_id, config.ad_client_secret, config.region, config.refresh_token)
token =... | 2.578125 | 3 |
GasGrid/OntoGasGrid/grid_component_owl_generator/closest_point_locate.py | mdhillmancmcl/TheWorldAvatar-CMCL-Fork | 0 | 12796253 | import pandas as pd
import matplotlib.pyplot as plt
from tqdm import tqdm
import numpy as np
pipelines = pd.read_csv('OntoGasGrid/pipeline_owl_generator/pipeline_split.csv').to_numpy()
offtakes = pd.read_csv('OntoGasGrid/grid_component_owl_generator/grid_component_data.csv').to_numpy()
n_offt = len(offtakes[:,0... | 2.75 | 3 |
governor/__init__.py | billcap/governor | 0 | 12796254 | import logging
import time
import os
import subprocess as sp
from governor.etcd import Client as Etcd
from governor.postgresql import Postgresql
from governor.ha import Ha
import etcd
class Governor:
INIT_SCRIPT_DIR = '/docker-entrypoint-initdb.d'
def __init__(self, config, psql_config):
self.advert... | 2.140625 | 2 |
emptytime/timetable/models.py | hyeongonkim/OSS-emptytime | 0 | 12796255 | <filename>emptytime/timetable/models.py
from django.db import models
class User(models.Model):
token_text = models.CharField(max_length=100, null=True)
username_text = models.CharField(max_length=8)
pw_text = models.CharField(max_length=30)
def __str__(self):
return self.username_text | 2.453125 | 2 |
tensortrade/base/__init__.py | bwcknr/tensortrade | 34 | 12796256 | from .clock import Clock
from .component import *
from .context import *
from .core import *
from .exceptions import *
| 1.054688 | 1 |
networkit/test/test_matching_algorithms.py | angriman/network | 366 | 12796257 | #!/usr/bin/env python3
import random
import unittest
import networkit as nk
class TestMatchingAlgorithms(unittest.TestCase):
def generateRandomWeights(self, g):
if not g.isWeighted():
g = nk.graphtools.toWeighted(g)
for e in g.iterEdges():
g.setWeight(e[0], e[1], random.random())
return g
def setUp(s... | 2.703125 | 3 |
scripts/oauth_login.py | longShot-88/hello_twitter | 0 | 12796258 | <filename>scripts/oauth_login.py<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import twitter
''' oauth_login into twitter '''
# Docs
# https://dev.twitter.com/oauth
# LogIn
def oauth_login():
# credentials for OAuth
CONSUMER_KEY = ' ---- '
CONSUMER_SECRET = ' ---- '
OAUTH_TOKEN = ' ---- '
OAUTH_TO... | 2.6875 | 3 |
tests/unittests/test_subprocess.py | bossjones/scarlett-os | 5 | 12796259 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_subprocess
----------------------------------
"""
import builtins
import os
import re
import signal
import sys
from _pytest.monkeypatch import MonkeyPatch
import pytest
import scarlett_os
# R0201 = Method could be a function Used when a method d... | 2.140625 | 2 |
ClimaTempo/lerbd.py | Daniel-H-C-P/APIClima-parqueDasDunas | 0 | 12796260 | <reponame>Daniel-H-C-P/APIClima-parqueDasDunas
import datetime
###################### 1 #####################
#leitura dos arquivos json
import json
#Para abrir o arquivo climaAgora
def climanow():
with open('/home/daniel/webdev/tcc2019/APIClima-parqueDasDunas/ClimaTempo/climaAgora.json') as f:
data = json.load(f)
... | 3.4375 | 3 |
algorithm-and-hardware/py3/gravity_utils.py | zcjl/python-works | 0 | 12796261 | <reponame>zcjl/python-works<gh_stars>0
# coding:utf-8
import serial
import time
import binascii
from enum import Enum
class GravityUtils:
Code = Enum('Code', 'MARK CHECK')
def __init__(self):
# 打开端口
self.ports = {
# "g_sensor_1": serial.Serial(port='/dev/tty.usbserial-FT2J03F3A',... | 2.609375 | 3 |
tools/nntool/graph/matches/matcher.py | knmcguire/gap_sdk | 0 | 12796262 | # Copyright (C) 2019 GreenWaves Technologies
# All rights reserved.
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from abc import ABC, abstractmethod
from typing import Generator, Sequence
from graph.graph_identity import GraphIdentity
from u... | 2.6875 | 3 |
main.py | OneFoggyScreen/Amicable-Bot | 1 | 12796263 | #The heart of the bot.
#--------- Libaries ---------#
import discord, os, settings
from tools.logging import ABLog
from discord.ext import commands
#--------- Variables ---------#
INTENTS = discord.Intents.all()
client = commands.Bot(command_prefix = settings.ABPrefixes, intents = INTENTS, help_command=None)
client... | 2.140625 | 2 |
mwedittypes/__init__.py | geohci/edit-types | 1 | 12796264 | <reponame>geohci/edit-types
from .mwedittypes import EditTypes
__title__ = "mwedittypes"
__summary__ = "mwedittypes is a package that supports edit diffs and action detection for Wikipedia"
__url__ = "https://github.com/geohci/edit-types"
__version__ = "1.1.5"
__license__ = "MIT License"
__all__ = ["EditTypes"]
| 1.460938 | 1 |
isobutane.py | erkandem/isobutane | 0 | 12796265 | <gh_stars>0
"""
a combination of the
- ideal gas law and
- a simple chemical reaction
But still, no warranty.
"""
# %% constants
AVOGARDRO = 6.02214076 * 10 ** 23 # 1/mol
BOLTZMANN = 1.380649 * 10 ** -23 # J/K or Nm/K or (kgm^2)/(Ks^2)
UNIVERSAL_GAS = AVOGARDRO * BOLTZMANN # J/(molK) or (kgm^2)/(molKs^2)
# %% at... | 3.078125 | 3 |
mwdust/Drimmel03.py | jan-rybizki/mwdust | 21 | 12796266 | <reponame>jan-rybizki/mwdust
###############################################################################
#
# Drimmel03: extinction model from Drimmel et al. 2003 2003A&A...409..205D
#
###############################################################################
import copy
import numpy
from scipy.ndimage import... | 2.140625 | 2 |
Introduction/Write a function.py | inarazim34/homework | 0 | 12796267 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
def is_leap(year):
leap = False
# Write your logic here
if year % 4 == 0 and (year % 400 == 0 or year % 100 != 0) :
leap = True
return leap
| 3.890625 | 4 |
frontera/tests/test_codecs.py | TeamHG-Memex/frontera | 3 | 12796268 | # -*- coding: utf-8 -*-
from frontera.contrib.backends.remote.codecs.json import Encoder as JsonEncoder, Decoder as JsonDecoder
from frontera.contrib.backends.remote.codecs.msgpack import Encoder as MsgPackEncoder, Decoder as MsgPackDecoder
from frontera.core.models import Request, Response
import pytest
@pytest.mar... | 2.28125 | 2 |
webfrontend/shadowsocks/models.py | josephwuzw/shadowsocks | 0 | 12796269 | <filename>webfrontend/shadowsocks/models.py
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Remove `managed = False` lines if you wish to allow Django to creat... | 2.046875 | 2 |
SocialNetwork/api/models.py | cmput404-ahyyy/group-webproject | 0 | 12796270 | <reponame>cmput404-ahyyy/group-webproject
from django.db import models
# Create your models here.
from Author.models import Author, FriendRequest, Friends
from Posts.models import Post, Comment, Image | 1.65625 | 2 |
manifold/mnist_tools.py | kteavery/CS5173-ManifoldLearning | 1 | 12796271 | import keras
'''
Helper methods and variables for mnist models and manifolds
'''
color_list = [
"red",
"orange",
"yellow",
"lime",
"green",
"cyan",
"blue",
"purple",
"fuchsia",
"peru",
]
# # Returns 4D np array (1, HEIGHT, WIDTH, 1)
# def tensor_to_numpy(t):
# sess = K.g... | 3.15625 | 3 |
1601-1700/1633-Strings That Satisfies The Condition/1633-Strings That Satisfies The Condition.py | jiadaizhao/LintCode | 77 | 12796272 | class Solution:
"""
@param target: the target string
@param s:
@return: output all strings containing target in s
"""
def getAns(self, target, s):
# Write your code here
result = []
for word in s:
i = 0
for c in word:
if c == targ... | 3.59375 | 4 |
for-proriv/myfuture/users/views.py | DmitryAA/EdVision | 0 | 12796273 | <filename>for-proriv/myfuture/users/views.py
from django.shortcuts import render,render_to_response
from django.contrib import auth
from django.http import HttpResponseRedirect
from django.template.context_processors import csrf
def login(request):
args = {}
args.update(csrf(request))
if request.method == ... | 2.125 | 2 |
examples/login_app.py | argabor/dash-desktop | 0 | 12796274 | # package imports
import dash
import dash_bootstrap_components as dbc
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
from dash import no_update
from flask import session
# local imports
from auth import authenticate_user, validate_login_session... | 2.328125 | 2 |
addtodb.py | myxxxsquared/search_concept | 0 | 12796275 | <reponame>myxxxsquared/search_concept
import dbconf
sql = 'INSERT INTO `search_concept` (concept_name) VALUES (?)'
lines = [[line.strip()] for line in open('names.txt', encoding='utf8') if line.strip()]
conn = dbconf.getconn()
cur = conn.cursor()
cur.executemany(sql, lines)
conn.commit()
| 2.46875 | 2 |
main.py | joelwright-dev/PyFaceDetection | 0 | 12796276 | <reponame>joelwright-dev/PyFaceDetection<gh_stars>0
import sys
import cv2
from random import *
#Load pre-trained data on face frontals from opencv (haar cascade algorithm)
trained_data = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
def Webcam():
#Choose an image to detect faces in
webcam = cv2... | 3 | 3 |
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py | ALBA-Synchrotron/cookiecutter-albalib | 0 | 12796277 | <reponame>ALBA-Synchrotron/cookiecutter-albalib
{% set klass = cookiecutter.project_slug.capitalize() -%}
{% set is_open_source = cookiecutter.open_source_license != 'Not open source' -%}
# -*- coding: utf-8 -*-
#
# This file is part of the {{ cookiecutter.project_name }} project
#
# Copyright (c) {% now 'local', '%Y' ... | 1.648438 | 2 |
MGTU-final-stage/3.py | webkadiz/olympiad-problems | 0 | 12796278 | <filename>MGTU-final-stage/3.py
def to_dec_num(hex_str):
return int(hex_str, 16)
def to_hex_str(dec_num):
return hex(dec_num).upper()[2:]
def diff_mul(mul1, mul2):
# Возвращает индекс ошибки записи в произведении, если такая ошибка одна, иначе -1
len_mul1 = len(mul1)
len_mul2 = len(mul2)
cnt_wrongs = 0
idx_wro... | 3.078125 | 3 |
tests/data/tupleassign.py | alexchamberlain/black | 2 | 12796279 | <reponame>alexchamberlain/black
sdfjklsdfsjldkflkjsf, sdfjsdfjlksdljkfsdlkf, sdfsdjfklsdfjlksdljkf, sdsfsdfjskdflsfsdf = 1, 2, 3
# output
(
sdfjklsdfsjldkflkjsf,
sdfjsdfjlksdljkfsdlkf,
sdfsdjfklsdfjlksdljkf,
sdsfsdfjskdflsfsdf,
) = (1, 2, 3)
| 1.429688 | 1 |
bonked/__init__.py | brl0/bonked | 1 | 12796280 | <filename>bonked/__init__.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Top-level package for bonked."""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__license__ = "MIT"
__version__ = "0.1.2dev"
| 1.0625 | 1 |
ml/radomforest.py | wang1365/algorithm-practice | 0 | 12796281 | from random import shuffle
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets import load_iris
import numpy as np
iris = load_iris()
print(type(iris), len(iris.data))
def test1():
XY = np.array(zip(iris.data, iris.target))
np.random.shuffl... | 2.84375 | 3 |
ProyectoHuevos/apps/carrito/apps.py | EstefaniaLaverde/ProyectoHuevos | 0 | 12796282 | <filename>ProyectoHuevos/apps/carrito/apps.py
from django.apps import AppConfig
class CarritoConfig(AppConfig):
name = 'carrito'
| 1.25 | 1 |
modular_exponentiation.py | KnugiHK/SingleScript | 0 | 12796283 | def fast_expo(b, e, n):
seq = bin(e)[3:]
result = b
for element in seq:
result = pow(result, 2)
if element == "1":
result *= b
result %= n
return result
result = fast_expo(
123456789123456789,
123456789123456789123456789123456789,
12345678912345678912345... | 3.15625 | 3 |
utils/data_parser.py | Jingil-Integrated-Management/JIM_backend | 0 | 12796284 | <filename>utils/data_parser.py
from datetime import date
from openpyxl import load_workbook
from apps.client.models import Client
from apps.division.models import Division
from apps.drawing.models import Drawing
from apps.part.models import Part, Material, OutSource
def _get(data, index):
try:
if data[i... | 2.28125 | 2 |
soccermetrics/rest/resources/personnel.py | soccermetrics/soccermetrics-client-py | 43 | 12796285 | from soccermetrics.rest.resources import Resource
class Personnel(Resource):
"""
Represents a Personnel REST resource (/personnel/<resource> endpoint).
The Personnel resources let you access biographic and demographic
data on the following personnel involved in a football match:
* Players,
... | 3.28125 | 3 |
buybacks2/management/commands/buybacks_load_types.py | hullwarning/aa-buybacks | 1 | 12796286 | from django.core.management import call_command
from django.core.management.base import BaseCommand
from ... import __title__
from ...constants import (
EVE_CATEGORY_ID_ASTEROID,
EVE_CATEGORY_ID_CHARGE,
EVE_CATEGORY_ID_COMMODITY,
EVE_CATEGORY_ID_DRONE,
EVE_CATEGORY_ID_FIGHTER,
EVE_CATEGORY_ID_M... | 1.867188 | 2 |
scripts/examples/OpenMV/32-modbus/modbus_apriltag.py | jiskra/openmv | 1,761 | 12796287 | <gh_stars>1000+
import sensor, image
import time
from pyb import UART
from modbus import ModbusRTU
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QQVGA) # we run out of memory if the resolution is much bigger...
uart = UART(3,115200, parity=None, stop=2, timeout=1, timeout_char=4)
m... | 2.40625 | 2 |
setup.py | timeoutdigital/cfn-resource-timeout | 4 | 12796288 | # -*- coding:utf-8 -*-
from __future__ import absolute_import
import codecs
from setuptools import setup
with codecs.open('README.rst') as readme_file:
readme = readme_file.read()
with codecs.open('HISTORY.rst') as history_file:
history = history_file.read()
setup(
name='cfn-resource-timeout',
ver... | 1.539063 | 2 |
utils/Logger.py | JiwooKimAR/MWP-solver-with-pretrained-language-model | 5 | 12796289 | <reponame>JiwooKimAR/MWP-solver-with-pretrained-language-model
import os
from time import strftime
import logging
def make_log_dir(log_dir):
"""
Generate directory path to log
:param log_dir:
:return:
"""
if not os.path.exists(log_dir):
os.mkdir(log_dir)
log_dirs = os.listdir(log... | 2.125 | 2 |
ner/data/raw/scripts/ira_seq.py | zhang-informatics/UMLS_iDISK | 0 | 12796290 | import os
import argparse
import datetime
import numpy as np
from glob import glob
from typing import List, Set, Tuple
"""
Author: <NAME> (<EMAIL>)
Computes character-level Cohen's kappa and percentage
agreement for a set of brat annotated files from two
annotators for a sequence labeling task (e.g. NER).
"""
clas... | 2.96875 | 3 |
att_app/migrations/0001_initial.py | tunir27/django-Attendance | 3 | 12796291 | <gh_stars>1-10
# Generated by Django 2.0.1 on 2018-02-10 08:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),... | 1.75 | 2 |
keras_based/exchange/core/models/multivariate_lstm.py | TianyuDu/AnnEconForecast | 7 | 12796292 | import datetime
import os
import keras
import numpy as np
import pandas as pd
from base_model import BaseModel
from multivariate_container import MultivariateContainer
from typing import Union
class MultivariateLSTM(BaseModel):
def __init__(
self,
container: MultivariateContainer,
... | 2.734375 | 3 |
dreamerv2/training/__init__.py | baecm/dreamerv2 | 0 | 12796293 | <filename>dreamerv2/training/__init__.py
from .trainer import Trainer
from .config import Config
from .evaluator import Evaluator | 1.109375 | 1 |
dependencies/src/4Suite-XML-1.0.2/Ft/Xml/Xslt/_4xslt.py | aleasims/Peach | 0 | 12796294 | ########################################################################
# $Header: /var/local/cvsroot/4Suite/Ft/Xml/Xslt/_4xslt.py,v 1.50.2.1 2006/10/16 21:52:39 jkloth Exp $
"""
Implementation of '4xslt' command
(functions defined here are used by the Ft.Lib.CommandLine framework)
Copyright 2006 Fourthought, Inc. (U... | 1.96875 | 2 |
apps/bazaar/views/RequestView.py | Nelson-Morais/HA-OOAD | 0 | 12796295 | <filename>apps/bazaar/views/RequestView.py
"""
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 the Apache License, Version... | 1.570313 | 2 |
App1/admin.py | surajjare7/community | 0 | 12796296 | from django.contrib import admin
from .models import Post
from . models import Query
from .models import Solution
# Register your models here.
admin.site.register(Post)
admin.site.register(Query)
# admin.site.register(Services)
# admin.site.register(Contact)
admin.site.register(Solution) | 1.40625 | 1 |
aws_managers/athena/functions/window.py | vahndi/aws-managers | 0 | 12796297 | <filename>aws_managers/athena/functions/window.py
"""
https://prestodb.io/docs/current/functions/window.html
"""
from typing import Optional, List, Union
"""
https://prestodb.io/docs/current/functions/window.html#value-functions
"""
class LagMixin(object):
name: str
def lag(
self,
o... | 2.96875 | 3 |
code/board.py | eulerlab/spectral-scanner | 1 | 12796298 | # ----------------------------------------------------------------------------
# board.py
# Pin definitions
#
# The MIT License (MIT)
# Copyright (c) 2020 <NAME>
# 2020-11-21, v1
# ----------------------------------------------------------------------------
from micropython import const
# Spectrometer (CM12880MA)
TRG ... | 1.984375 | 2 |
wsgi.py | anhbaysgalan1/Docker-nginx-flask-auto-ssl | 3 | 12796299 | from application import app
# Starts the application
if __name__ == "__main__":
app.run() | 1.6875 | 2 |
django_leek/models.py | Volumental/django-leek | 1 | 12796300 | <reponame>Volumental/django-leek<gh_stars>1-10
import base64
import pickle
from typing import Any
from django.db import models
class Task(models.Model):
pickled_task = models.BinaryField(max_length=4096)
pool = models.CharField(max_length=256, null=True)
queued_at = models.DateTimeField(auto_now_add=True... | 2.25 | 2 |
Python_scripts/PyevolveEx1.py | janaobsteter/Genotype_CODES | 1 | 12796301 | <reponame>janaobsteter/Genotype_CODES
from pyevolve import G1DList
from pyevolve import GSimpleGA
from pyevolve import Selectors
from pyevolve import Statistics
from pyevolve import DBAdapters
import pyevolve
# This function is the evaluation function, we want
# to give high score to more zero'ed chromosomes
def eval_... | 2.84375 | 3 |
LeetCode/queue-stack/1-design-circular-queue.py | safiulanik/problem-solving | 0 | 12796302 | """
URL: https://leetcode.com/explore/learn/card/queue-stack/228/first-in-first-out-data-structure/1337/
Problem Statement:
------------------
Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) princip... | 3.515625 | 4 |
oscar_mws/admin.py | ButchershopCreative/django-oscar-mws | 12 | 12796303 | <reponame>ButchershopCreative/django-oscar-mws<gh_stars>10-100
from django.contrib import admin
from django.db.models import get_model
admin.site.register(get_model("oscar_mws", "FeedSubmission"))
admin.site.register(get_model("oscar_mws", "FeedReport"))
admin.site.register(get_model("oscar_mws", "FeedResult"))
admi... | 1.609375 | 2 |
src/analyzer/preprocessor.py | diegowendel/TSAP | 1 | 12796304 | import re
import nltk
from string import punctuation
from nltk.tokenize import TweetTokenizer
from nltk.corpus import stopwords
#nltk.download('rslp')
#nltk.download('stopwords')
#nltk.download('punkt')
class PreProcessor(object):
stemmer = nltk.stem.RSLPStemmer()
tokenizer = TweetTokenizer(reduce_len=True,... | 3.109375 | 3 |
qkoubot/validators/database_validate.py | pddg/qkouserver | 0 | 12796305 | import os
from static import SQLITE_DIR_PATH, USE_MYSQL, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_HOST, MYSQL_DATABASE_NAME
def db_path_validate():
assert os.path.exists(SQLITE_DIR_PATH), "{path} is not exists.".format(path=SQLITE_DIR_PATH)
if USE_MYSQL:
assert MYSQL_USERNAME is not None, "MYSQL_USERNAME... | 3.046875 | 3 |
data/audio/audio_downloader.py | vuthede/speech_separation | 0 | 12796306 | # Before running, make sure avspeech_train.csv and avspeech_test.csv are in catalog.
# if not, see the requirement.txt
# download and preprocess the data from AVspeech dataset
import sys
sys.path.append("../lib")
import AVHandler as avh
import pandas as pd
import multiprocessing
from multiprocessing import Process
de... | 2.890625 | 3 |
comments/api/views.py | rkarthikdev/blog_api_django | 0 | 12796307 | <reponame>rkarthikdev/blog_api_django
from rest_framework import viewsets
from .serializers import CommentSerializer
from comments.models import Comment
from .permissions import IsGetOrIsAdmin
class CommentViewSet(viewsets.ModelViewSet):
queryset = Comment.objects.all()
serializer_class = CommentSerializer
... | 1.84375 | 2 |
3 Year/SDL/Python/Assignment 3/Assignment 3.py | bhushanasati25/College | 4 | 12796308 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv('medals_data.csv')
df[['Gold','Silver','Bronze']].plot(kind='bar',stacked=True)
plt.title('India Olympics Medal')
plt.xlabel('Years')
plt.ylabel('Medals')
n = len(df['Games'])
labels = df.Games.str.slice(0,4)
plt.xticks(np.arange... | 3.203125 | 3 |
tatoebatools/transcriptions.py | eumiro/tatoebatools | 14 | 12796309 | <filename>tatoebatools/transcriptions.py
class Transcription:
"""A sentence transcription in an auxiliary or alternative script"""
def __init__(
self, sentence_id, lang, script_name, username, transcription
):
# the id of the sentence
self._sid = sentence_id
# the language ... | 2.984375 | 3 |
vol3/109.py | EdisonAlgorithms/ProjectEuler | 0 | 12796310 | <reponame>EdisonAlgorithms/ProjectEuler
if __name__ == "__main__":
doubles = [2 * x for x in range(1, 21)]
doubles.append(50)
singles = [x for x in range(1, 21)]
singles.append(25)
triples = [3 * x for x in range(1, 21)]
scores = singles + doubles + triples
scores.sort()
limit = 100
... | 3.328125 | 3 |
Codeforces/A_Pashmak_and_Garden.py | anubhab-code/Competitive-Programming | 0 | 12796311 | x1, y1, x2, y2 = list(map(int,input().split()))
if x1 == x2 :
d = abs(y2-y1)
x3 , y3 = x2+d , y2
x4 , y4 = x1+d , y1
print("{x3} {y3} {x4} {y4}".format(x3=x3, y3=y3, x4=x4, y4=y4))
elif y1 == y2:
d = abs(x2-x1)
x3 , y3 = x2 , y2+d
x4 , y4 = x1 , y1+d
print("{x3} {y3} {x4} {y4}".format(x3... | 3.359375 | 3 |
main.py | F1shh-sec/Page-Permission-Checker | 0 | 12796312 | import requests
import requests
import urllib3
import webbrowser
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
cookies = {
}
headers = {
}
sites_200 = []
sites_403 = []
def printPage(response):
with open('test.html', "w") as output:
badchars = ['\\n', '\\t', 'b\'']... | 3.15625 | 3 |
lifegame.py | k28/python_lifegame | 0 | 12796313 | <filename>lifegame.py
# coding: utf-8
import random
import sys, time
import copy
import os
LIVE = '*'
DEAD = ' '
MAX_WIDTH = 40
MAX_HEIGHT = 20
# Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.
# Any live cell with two or three live neighbours lives on to the next generatio... | 3.75 | 4 |
tello_ros/src/camera_info_publisher.py | PedroS235/TelloSwarm | 0 | 12796314 | <reponame>PedroS235/TelloSwarm<gh_stars>0
#!/usr/bin/python3
import rospy
from sensor_msgs.msg import CameraInfo
from datetime import datetime
def publisher():
"""
This method contains the information to calibrate the tello camera
"""
print("Starting calibrator node")
publisher = rospy.Publi... | 2.5625 | 3 |
all.py | 0xfares/darkreporter | 0 | 12796315 | <filename>all.py
import csv
import sys
from collections import defaultdict
#Defining list of variables hold the actual data.
#IP Addresses Varible
RowOfDataIPAddress = []
RowOfDataIPAddress = list()
#Plugin ID Varible
RowOfDataPluginID = []
RowOfDataPluginID = list()
#Plugin Name Varible
RowOfDataPluginNam... | 2.4375 | 2 |
formats/ycd/__init__.py | Adobe12327/Sollumz | 131 | 12796316 | <filename>formats/ycd/__init__.py
if "bpy" in locals():
import importlib
importlib.reload(Animation)
importlib.reload(AnimSequence)
importlib.reload(Channel)
importlib.reload(Clip)
importlib.reload(ClipDictionary)
importlib.reload(utils)
else:
from . import Animation
from . import An... | 1.695313 | 2 |
tests/test-root/conf.py | kai687/sphinxawesome-sampdirective | 1 | 12796317 | <reponame>kai687/sphinxawesome-sampdirective
"""Sphinx configuration file for testing."""
| 0.789063 | 1 |
tests/test_myst_plugins.py | noirbizarre/pelican-myst | 0 | 12796318 | <reponame>noirbizarre/pelican-myst
from __future__ import annotations
from typing import Union
import pytest
from .helpers import read_content_metadata
# from pyquery import PyQuery as pq
TASKLIST_EXPECTATIONS: tuple[tuple[Union[dict, list], str], ...] = (
([], "disabled"),
({}, "disabled"),
(["taskli... | 2 | 2 |
main.py | banasiakmichal/portfel | 0 | 12796319 | # set keyboard mode for ios device
#from kivy.config import Config
#Config.set('kivy', 'keyboard_mode', 'dock')
from kivy.lang.builder import Builder
from kivymd.uix.bottomnavigation import MDBottomNavigation
from kivy.clock import Clock
from functools import partial
import SecondScreen
import FirstScreen
import ThirdS... | 2.3125 | 2 |
tests/test_htmlreflector.py | christabor/codeReflector | 3 | 12796320 | <filename>tests/test_htmlreflector.py
# -*- coding: utf-8 -*-
__author__ = """<NAME> (<EMAIL>)"""
import unittest
from code_reflector import html_reflector
class SelectorOutputTestCase(unittest.TestCase):
def setUp(self):
self.ref = html_reflector.HTMLReflector()
def test_single_class(self):
... | 2.671875 | 3 |
src/jets/data_ops/get_data_loader.py | isaachenrion/jets | 9 | 12796321 | import os
import pickle
import logging
from src.jets.data_ops.DataLoader import DataLoader
from src.jets.data_ops.Dataset import Dataset
import numpy as np
from .io import load_jets_from_pickle
w_vs_qcd = 'w-vs-qcd'
quark_gluon = 'quark-gluon'
DATASETS = {
'w':(w_vs_qcd,'antikt-kt'),
'wp':(w_vs_qcd + '/pileu... | 2.1875 | 2 |
download.py | jidzhang/vuejs-docs | 0 | 12796322 | <filename>download.py
#!/usr/env/bin python
# -*- coding:utf-8 -*-
import os, sys, re, urllib2
def download(path, ext):
path = os.path.expanduser(path)
for (dirname, subdir, subfile) in os.walk(path):
for f in subfile:
subf = os.path.join(dirname, f)
if subf.endswith(ext):
... | 3.03125 | 3 |
MuJoCo/Validate_GP_Controller.py | sanjaythakur/Uncertainty-aware-Imitation-Learning-on-Multiple-Tasks-using-Bayesian-Neural-Networks | 8 | 12796323 | <gh_stars>1-10
import numpy as np
import _pickle as pickle
import gpflow
import os
import tensorflow as tf
from Load_Controllers import Load_Demonstrator
from multiple_tasks import get_task_on_MUJOCO_environment
import sys
sys.path.insert(0,'./../')
from Housekeeping import *
def validate_GP_controller(domain_name, ... | 2.0625 | 2 |
google_destinationD.py | MyColumbus/googleDestinationsScrapper | 0 | 12796324 | <gh_stars>0
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# Columbus - Personalised Travel Itineraries based on experience, country or preferred destination.
# Contact <NAME> <<EMAIL>>
#
import time
import re
import csv
import os
import logging
from bs4 import BeautifulSoup
from selenium import webdriver
from seleni... | 3.0625 | 3 |
app/solarvibes/login_check/views.py | Fantaso/site-app-docker | 4 | 12796325 | <filename>app/solarvibes/login_check/views.py
from flask import Blueprint, render_template, redirect, url_for, flash, request
from solarvibes import db
from flask_login import current_user
from flask_security import login_required
login_check = Blueprint(
'login_check',
__name__,
)
#########################... | 2.484375 | 2 |
iepy/webui/corpus/migrations/0003_remove_dont_know_option.py | francolq/iepy | 813 | 12796326 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('corpus', '0002_data_migration_dont_know_skip_merge'),
]
operations = [
migrations.AlterField(
model_name='eviden... | 1.65625 | 2 |
ui/response_info_ui.py | LinkedList/qTTp | 0 | 12796327 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'response_info.ui',
# licensing of 'response_info.ui' applies.
#
# Created: Sun Feb 17 10:16:18 2019
# by: pyside2-uic running on PySide2 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore, QtGui... | 1.429688 | 1 |
xfeeds/management/commands/seed.py | rubeon/django-xfeeds | 0 | 12796328 | <filename>xfeeds/management/commands/seed.py<gh_stars>0
import time
import urllib.parse
import feedparser
from django.core.management.base import BaseCommand, CommandError
from xfeeds.models import Feed
from xfeeds.parser import tasks
from bs4 import BeautifulSoup as soup
from pprint import pprint
# Command to feed a ... | 2.515625 | 3 |
fru/FirewallManager/apps.py | Owen-Cummings/Firewall-GUI-Prototype | 0 | 12796329 | from django.apps import AppConfig
class FirewallmanagerConfig(AppConfig):
name = 'FirewallManager'
| 1.140625 | 1 |
scripts/cond_num_run.py | polyfem/Decoupling-Simulation-Accuracy-from-Mesh-Quality | 2 | 12796330 | <reponame>polyfem/Decoupling-Simulation-Accuracy-from-Mesh-Quality
import os
import json
import subprocess
import tempfile
if __name__ == '__main__':
polyfem_exe = "./PolyFEM_bin"
out_folder = "cond_num"
n_refs = [0, 1, 2, 3]
p_refs = [False, True]
current_folder = cwd = os.getcwd()
with ope... | 2.21875 | 2 |
src/stock_logger.py | SteveZhengMe/TK-Gui-Assignment | 0 | 12796331 | <gh_stars>0
# This project is a assignment of College.
# Purpose: Practice TK and database connection
# Usage: The user can add a stock record to Sqllite database, and one can search and list the records
#
# Author: <NAME>
# Date: 2021-03-17
import tkinter as tk
from tkinter import ttk, messagebox, filedialog
from fu... | 3.953125 | 4 |
scripts/spy.py | tarvitz/dsfp | 30 | 12796332 | # -*- coding: utf-8 -*
""" DSFP modifications spy, looks for save file modifications
.. module:: watcher
:platform: Linux, Windows, MacOS X
:synopsis: watches for dark souls save file modifications and prints
any modified data in console
.. moduleauthor:: Tarvitz <<EMAIL>>
"""
from __future__ import u... | 2.515625 | 3 |
Curso-Em-Video-Python/2Exercicios/090_Dicionarios_em_python.py | pedrohd21/Cursos-Feitos | 0 | 12796333 | <gh_stars>0
'''aluno = {}
aluno['nome'] = str(input('Qual o Seu nome: '))
aluno['media'] = float(input('Qual a sua media: '))
print(f'Nome igual a {aluno["nome"]}\nMedia igual a {aluno["media"]:.2f}')
if aluno['media'] >= 7:
aluno['situação'] = 'Aprovado'
elif aluno['media'] >= 5:
aluno['situação'] = 'Recuperaç... | 3.828125 | 4 |
tests/python/test.py | pylbert/firfilt | 0 | 12796334 | #! /usr/bin/env python
def main(filename_raw_in, filename_filtered_out):
import fir
import tempfile
filt = fir.Filter_LP(51, 1000, 7)
fdout = tempfile.NamedTemporaryFile(delete = False)
with open(filename_raw_in) as f:
for line in f:
try:
raw = float(line.str... | 2.59375 | 3 |
foreignc/setup.py | thebridge0491/intro_py | 0 | 12796335 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os, sys, pkgutil, json, glob
from distutils.command.clean import clean as CleanCommand
from setuptools import setup, find_packages, Command
#from setuptools import Extension # for Swig extension
from builtins import open, dict
PROJE... | 1.921875 | 2 |
tests/test_cpu.py | mirecl/pprof | 4 | 12796336 | <gh_stars>1-10
import atexit
import inspect
import os.path
import webbrowser
from tempfile import gettempdir
import pytest
from pprof import cpu
from pprof.cpu import show_html
empty_report = '<html><head><meta charset="UTF-8"/></head></html>'
def f(a, b):
# fake func
res = a + b
return res
@pytest... | 2.296875 | 2 |
apitests/conftest.py | hjalves/playlists | 0 | 12796337 | # This file is loaded by py.test to discover API tests
import pytest
from apitest import APITest
from loader import yaml_load
def pytest_collect_file(parent, path):
if path.ext == ".yaml" and path.basename.startswith("test"):
return APITestFile(path, parent)
class APITestFile(pytest.File):
def col... | 2.421875 | 2 |
sherpa_client/models/segment_contexts.py | kairntech/sherpa-client | 0 | 12796338 | <reponame>kairntech/sherpa-client
from typing import Any, Dict, Type, TypeVar
import attr
from ..models.segment_context import SegmentContext
T = TypeVar("T", bound="SegmentContexts")
@attr.s(auto_attribs=True)
class SegmentContexts:
""" """
after: SegmentContext
before: SegmentContext
def to_dic... | 2 | 2 |
katas/kyu_5/The_Hashtag_Generator.py | dusadamey/CodeWars | 0 | 12796339 | # https://www.codewars.com/kata/52449b062fb80683ec000024/
'''
Instructions :
The marketing team is spending way too much time typing in hashtags.
Let's help them with our own Hashtag Generator!
Here's the deal:
It must start with a hashtag (#).
All words must have their first letter capitalized.
If the final resul... | 4.1875 | 4 |
My Resources/f3.py | PradeepDuraisamy/Python | 0 | 12796340 | a = 10
b = 5
print(a+b)
| 2.90625 | 3 |
libs.py | BlackGameNeon/first-jump | 0 | 12796341 | #Import the libraries
#Pygame
import pygame
pygame.init()
#os to access files
import os
#Inits
#import win | 1.515625 | 2 |
python/StartupUI/ThumbnailExportUI.py | borsarinicola/NFTS_nuk_env | 5 | 12796342 | # Thumbnail Exporter Task UI
# Thumbnail image export task which can be used via the Export dialog via Shot, Clip or Sequence Processor
# To install copy the ThumbnailExportTask.py and ThumbnailExportTaskUI.py to your <HIERO_PATH>/Python/Startup directory.
# Keyword tokens exist for:
# {frametype} - Position where the... | 2.203125 | 2 |
embeddings.py | ramanshgrover/A-Modern-Approach-To-Image-Captioning | 0 | 12796343 | '''
This code was written by following the following tutorial:
Link: https://medium.com/@martinpella/how-to-use-pre-trained-word-embeddings-in-pytorch-71ca59249f76
This script processes and generates GloVe embeddings
'''
# coding: utf-8
import pickle
from preprocess import Vocabulary
import numpy as np
import json
fr... | 2.953125 | 3 |
pystematic/standard_plugin/standard_plugin.py | evalldor/pystematic | 1 | 12796344 | <reponame>evalldor/pystematic
import datetime
import functools
import itertools
import logging
import multiprocessing
import multiprocessing.connection
import pathlib
import random
import string
import pystematic
import pystematic.core as core
import wrapt
from rich.console import Console
from rich.markup import escap... | 2.078125 | 2 |
scisalt/matplotlib/setup_axes.py | joelfrederico/mytools | 1 | 12796345 | <reponame>joelfrederico/mytools
import os as _os
_on_rtd = _os.environ.get('READTHEDOCS', None) == 'True'
if not _on_rtd:
import numpy as _np
from .setup_figure import setup_figure as _setup_figure
def setup_axes(rows=1, cols=1, figsize=(8, 6), expand=True, tight_layout=None, **kwargs):
"""
Sets up a figu... | 2.53125 | 3 |
Python/dbinfo.py | mfunduc/dbcomp | 0 | 12796346 | import sys
import sqlite3
from tableinfo import TableInfo
class DbInfo(object):
def __init__(self, name):
self.name = name
self.conn = sqlite3.connect(name)
self.tables = {}
self.conn.text_factory = lambda x: str(x, 'utf-8', 'ignore')
cursor = self.conn.cursor()
curs... | 3.375 | 3 |
setup.py | portugueslab/arrayqueues | 27 | 12796347 | <filename>setup.py
from distutils.core import setup
from setuptools import find_namespace_packages
with open("requirements_dev.txt") as f:
requirements_dev = f.read().splitlines()
with open("requirements.txt") as f:
requirements = f.read().splitlines()
with open("README.md") as f:
long_description = f.r... | 1.289063 | 1 |
FindHighestAltitude.py | vanigupta20024/Programming-Challenges | 14 | 12796348 | <reponame>vanigupta20024/Programming-Challenges<filename>FindHighestAltitude.py
'''
There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes.
The biker starts his trip on point 0 with altitude equal 0.
You are given an integer array gain of length n where gain[i] is the net ... | 4.21875 | 4 |
cargo/logic/binary.py | jaredlunde/cargo-orm | 3 | 12796349 | """
`Binary Logic and Operations`
--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--
2016 <NAME> © The MIT License (MIT)
http://github.com/jaredlunde
"""
import psycopg2.extensions
from cargo.expressions import *
__all__ = ('BinaryLogic',)
class BinaryLogic(BaseLogic):
__sl... | 2.84375 | 3 |
examples/YinMo/add_album_images.py | zbx911/CHRLINE | 0 | 12796350 | <reponame>zbx911/CHRLINE
# -*- coding: utf-8 -*-
from CHRLINE import *
cl = CHRLINE()
# Group ID: str
groupId = None
# Album ID: str, u can get it from getAlbums or create a new album.
albumId = None
# Image's path: list<str>
images = []
for i in images:
print(f"--> Try to Upload {i}")
oid = cl.updateImag... | 2.296875 | 2 |