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 |
|---|---|---|---|---|---|---|
src/easydmp/eventlog/models.py | hmpf/easydmp | 5 | 12798051 | <gh_stars>1-10
from functools import reduce
from operator import or_
from copy import deepcopy
from django.contrib.contenttypes.models import ContentType
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from django.utils.timezone import now as tznow
GFK_MAPPER = {
'actor': ... | 1.992188 | 2 |
trypython/basic/dict_/dict02.py | devlights/try-python | 4 | 12798052 | <filename>trypython/basic/dict_/dict02.py<gh_stars>1-10
"""
ディクショナリについてのサンプルです。
dict の マージ について (Python 3.5 以降で有効)
"""
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
class Sample(SampleBase):
def exec(self):
# -------------------------------------------------... | 3 | 3 |
src/text_utils/symbols_dict.py | stefantaubert/text-utils | 0 | 12798053 | <filename>src/text_utils/symbols_dict.py<gh_stars>0
from collections import Counter, OrderedDict
from pathlib import Path
from text_utils.utils import parse_json, save_json
class SymbolsDict(OrderedDict): # Tuple[str, int]
def save(self, file_path: Path):
save_json(file_path, self)
@classmethod
def load(... | 2.515625 | 3 |
sdk_k64f/boards/frdmk64f/multiprocessor_examples/erpc_remote_control/service/erpc_remote_control_app_1/interface.py | Sir-Branch/k64f-starter-template | 1 | 12798054 | # Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
# Copyright 2016 NXP
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Generated by erpcgen 1.7.3 on Mon Sep 23 13:00:45 2019.
#
# AUTOGENERATED - DO NOT EDIT
#
import erpc
# Abstract base class for remote_control_app_1
class Iremote_control... | 1.539063 | 2 |
utils/urbansounds.py | birds-on-mars/birdsonearth | 13 | 12798055 | <reponame>birds-on-mars/birdsonearth<filename>utils/urbansounds.py
'''
script to restructure the urban sounds data set into the required format to run
the train.py script on it.
Download the the dataset from:
https://www.kaggle.com/pavansanagapati/urban-sound-classification
Then unpack train.zip into root specified bel... | 2.59375 | 3 |
docker_registry_frontend/manifest.py | cschaba/docker-registry-frontend | 21 | 12798056 | <filename>docker_registry_frontend/manifest.py
import abc
import functools
import json
import operator
class DockerRegistryManifest(abc.ABC):
def __init__(self, content):
self._content = content
def get_created_date(self):
raise NotImplementedError
def get_entrypoint(self):
raise... | 2.234375 | 2 |
inference-framework/checker-framework/checkers/binary/trace-log.py | SoftwareEngineeringToolDemos/type-inference | 1 | 12798057 | #!/usr/bin/env python
import sqlite3
import sys
import re
auto_mode = True
#codeCodes = {
# 'black': '0;30', 'bright gray': '0;37',
# 'blue': '0;34', 'white': '1;37',
# 'green': '0;32', 'bright blue': '1;34',
# 'cyan': '0;36', 'bright green': '1;32',
# 'red': '0;31', 'bright cyan': '1;36',
# ... | 2.84375 | 3 |
perm_comb.py | RikGhosh487/Combinations-Permutations | 0 | 12798058 | <reponame>RikGhosh487/Combinations-Permutations<filename>perm_comb.py<gh_stars>0
import sys
# method that calculates factorials
def factorial(input):
if type(input) != int:
return 'Can only accept integer inputs'
if input < 0:
return 'Invalid input. Must be a value greater than 0'
if input ... | 4.0625 | 4 |
ProdTracker/product/admin.py | rishthas/ProdTracker | 0 | 12798059 | <reponame>rishthas/ProdTracker
from django.contrib import admin
from .models import Branch,Product,Transfer,Vendor,Model
# Register your models here.
admin.site.register(Branch)
admin.site.register(Product)
admin.site.register(Transfer)
admin.site.register(Vendor)
admin.site.register(Model)
| 1.382813 | 1 |
MascotasPasto/afiliados/migrations/0001_initial.py | FabianBedoya/Frameworks-7a-2020B | 0 | 12798060 | <reponame>FabianBedoya/Frameworks-7a-2020B
# Generated by Django 3.1.1 on 2020-10-30 20:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
n... | 1.710938 | 2 |
app/__init__.py | csud-reservation/flask-backend | 1 | 12798061 | <reponame>csud-reservation/flask-backend
from flask import Flask
from flask_bootstrap import Bootstrap
from flask_mail import Mail
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
from config import config
from flask_debugtoolbar import DebugToolbarExtension
from flask.ext.login import LoginMana... | 2.25 | 2 |
src/catcher/handlers/smtp.py | gavin-anders/callback-catcher | 2 | 12798062 | <gh_stars>1-10
'''
Created on 15 Sep 2017
@author: gavin
test STARTTLS with openssl s_client -connect 127.0.0.1:25 -starttls smtp
'''
from .basehandler import TcpHandler
from catcher.settings import SSL_KEY, SSL_CERT
import ssl
import os
import base64
class smtp(TcpHandler):
NAME = "SMTP"
DESCRIPTION = '''... | 2.328125 | 2 |
biothings-hub/files/nde-hub/utils/pmid_helper.py | NIAID-Data-Ecosystem/nde-crawlers | 0 | 12798063 | <reponame>NIAID-Data-Ecosystem/nde-crawlers<gh_stars>0
# Helper file to batch call pmids to get citations and funding
# Helpful links to documentation of Biopython Package for writing this file
# https://biopython.org/DIST/docs/tutorial/Tutorial.html#sec162
# https://biopython.org/docs/1.76/api/Bio.Entrez.html
# https:... | 2.515625 | 3 |
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/n/non/non_ascii_name.py | ciskoinch8/vimrc | 463 | 12798064 | """ Tests for non-ascii-name checker. """
áéíóú = 4444 # [non-ascii-name]
def úóíéá(): # [non-ascii-name]
"""yo"""
| 1.78125 | 2 |
octoprint_octopod/layer_notifications.py | mnebelung/OctoPrint-OctoPod | 52 | 12798065 | <gh_stars>10-100
from .alerts import Alerts
from .base_notification import BaseNotification
class LayerNotifications(BaseNotification):
def __init__(self, logger, ifttt_alerts):
BaseNotification.__init__(self, logger)
self._ifttt_alerts = ifttt_alerts
self._alerts = Alerts(self._logger)
self.reset_layers()
... | 2.890625 | 3 |
meiduo_mall/meiduo_mall/apps/users/serializers.py | Goldx4/meiduo-demo | 0 | 12798066 | from rest_framework import serializers, status
from django_redis import get_redis_connection
from rest_framework_jwt.settings import api_settings
import logging
import re
from .models import User
from .utils import get_user_by_account
from celery_tasks.email.tasks import send_verify_email
logger = logging.getLogger('... | 2.109375 | 2 |
main.py | yuxuibbs/Academic-Games-Player | 4 | 12798067 | import os
from flask import Flask
from MrLing import ling_blueprint
from MrBasicWff import wff_blueprint
app = Flask(__name__)
app.config['SECRET_KEY'] = 'random string'
app.debug = True
app.register_blueprint(ling_blueprint)
app.register_blueprint(wff_blueprint)
@app.route("/")
def home():
return '<p><a href="/... | 2.078125 | 2 |
tests/regressions/python/596_list_arrays.py | frzfrsfra4/phylanx | 83 | 12798068 | # Copyright (c) 2018 <NAME>
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
from phylanx import Phylanx
import numpy as np
@Phylanx
def foo(x, y):
return [x, y]
x = np.array([1, 2])
y = np.array([3, 4])
... | 2.203125 | 2 |
SurveyBackend.py | BlkPingu/SurveyBackend | 0 | 12798069 | <reponame>BlkPingu/SurveyBackend
from flask import Flask, request, redirect, url_for, Response, jsonify
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
import jwt
import datetime
from flask_cors import CORS,cross_origin
import os
import json
from werkzeug.utils import secure_filename
from werkzeug... | 2.046875 | 2 |
tests/test_commands.py | smartpr/django-future | 0 | 12798070 | from datetime import timedelta
from django.core.management import call_command
from django.test import TestCase
from django.utils import timezone
from django_future.jobs import schedule_job
from django_future.models import ScheduledJob
class RunScheduledJobsCommandTest(TestCase):
def setUp(self):
self.s... | 2.515625 | 3 |
train/train_image_classifier.py | open-climate-tech/firecam | 9 | 12798071 | # Copyright 2020 Open Climate Tech Contributors
#
# 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 agr... | 1.96875 | 2 |
docs/conf.py | arthurazs/dotapatch | 12 | 12798072 | <filename>docs/conf.py
#!/usr/bin/env python3
# coding: utf-8
# dotapatch documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 4 11:19:55 2018.
from os.path import abspath
from sys import path
import sphinx_rtd_theme
path.insert(0, abspath('..'))
needs_sphinx = '1.6.5'
extensions = [
... | 1.601563 | 2 |
home/migrations/0008_delete_addpost.py | sandipsandal/Just-A-Thought | 0 | 12798073 | # Generated by Django 3.0.9 on 2020-08-23 12:27
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0007_auto_20200823_1340'),
]
operations = [
migrations.DeleteModel(
name='addPost',
),
]
| 1.335938 | 1 |
lists_dictionary/Bread Factory.py | vasetousa/Python-fundamentals | 0 | 12798074 | events = input().split("|")
energy = 100
coins = 100
for el in range(len(events)):
string = events[el]
order, value = string.split("-")
value = int(value)
if order == "rest":
energy += value
if energy > 100:
energy = 100
difference = 100 - energy
prin... | 3.71875 | 4 |
run.py | John-5014/Password-locker | 0 | 12798075 | #!/usr/bin/env python3.6
import secrets
import string
import pyperclip
from user import User, Credentials
def create_user(fname, lname, password):
'''
Function to create a new user account
'''
new_user = User(fname, lname, password)
return new_user
def save_user(user):
'''
function to sa... | 3.703125 | 4 |
pygreppy/core.py | skvoter/pygreppy | 4 | 12798076 | <reponame>skvoter/pygreppy<filename>pygreppy/core.py
from pygments.lexers.python import PythonLexer
from pygments import highlight
from pygments.formatters.terminal import TerminalFormatter
import shutil
import re
import ast
import sys
import os
from . import codegen
def usage():
print('''
usage: pytgrep [-c <dep... | 2.609375 | 3 |
Web_Scraping/PluMA/PluMA/items.py | movingpictures83/PluMA-GUI | 0 | 12798077 | <reponame>movingpictures83/PluMA-GUI
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class PlumaItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
Name = scrapy.Field()
De... | 2.234375 | 2 |
scripts/jitl_test.py | cmusatyalab/dronesearch | 8 | 12798078 | <filename>scripts/jitl_test.py
# Drone Search
#
# A computer vision pipeline for live video search on drone video
# feeds leveraging edge servers.
#
# Copyright (C) 2018-2019 Carnegie Mellon University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance ... | 2.515625 | 3 |
appfl/algorithm/algorithm.py | markxiao/APPFL | 0 | 12798079 | <reponame>markxiao/APPFL<gh_stars>0
import copy
"""This implements a base class for server."""
class BaseServer:
def __init__(self, model, num_clients, device):
self.model = model
self.num_clients = num_clients
self.device = device
# update global model
def update(self):
... | 2.734375 | 3 |
Round #585 (Div 2)/C.py | julianferres/Codeforces | 4 | 12798080 | SI = lambda : input()
from collections import Counter
n = int(input())
a = SI()
b = SI()
def solve(n,a,b):
d = Counter(a)+Counter(b)
for i in d:
if(d[i]&1):
print(-1)
return
xa = d[a]//2
newa = []
newb = []
for i in range(n):
if(a[i]!=b[i]):
newa.append((a[i],i))
newb.append((b[i],i))
a,b = new... | 3.03125 | 3 |
9_datetime.py | Alirezak2n/Python-Tutorials | 0 | 12798081 | <gh_stars>0
import datetime
import pytz
today = datetime.date.today()
print(today)
birthday = datetime.date(1994,12,19)
print(birthday)
days_since_birth = today - birthday
print(days_since_birth)
tdelta = datetime.timedelta(days=10)
print(today + tdelta)
print(today.month)
print(today.weekday())
print(datetime.... | 2.875 | 3 |
00.py | takeoverjp/nlp100 | 0 | 12798082 | #!/usr/bin/python3
s="stressed"
rev=""
for c in s:
rev=c+rev
print(rev)
| 3.015625 | 3 |
necrobot/match/matchutil.py | saturnin55/necrobot | 0 | 12798083 | import datetime
import discord
import pytz
from necrobot.botbase import server, discordutil
from necrobot.database import matchdb, racedb
from necrobot.util import console, timestr, writechannel, strutil, rtmputil
from necrobot.botbase.necrobot import Necrobot
from necrobot.gsheet.matchgsheetinfo import MatchGSheetIn... | 2.5 | 2 |
sljassbot/player/rl_player/model.py | andieder/pyschieberSLJassBot | 0 | 12798084 | import os
import os.path
from keras.layers import Dense, Flatten, Conv1D, Reshape
from keras.optimizers import Nadam
from keras.models import Sequential
from keras.models import load_model
from keras.regularizers import l2
from keras import backend as K
from keras.losses import mean_squared_error
from sljassbot.playe... | 2.3125 | 2 |
gpio.py | bibinvarghese/democes | 0 | 12798085 | <gh_stars>0
import sys
import time
class UI(object):
"""Abstract UI class. Subclassed by specific board implementations."""
def __init__(self):
self._button_state = [False for _ in self._buttons]
current_time = time.time()
self._button_state_last_change = [current_time for _ in self._buttons]
self... | 3.265625 | 3 |
applications/conventions/models.py | Haakenlid/grenselandet | 0 | 12798086 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils import formats
from django.utils import timezone
# Create your models here.
class ConventionManager(models.Manager):
def next(self):
""" The upcoming event """
next_convention = self.exclude(en... | 2.3125 | 2 |
python/producer.py | ssproessig/amqp-training | 0 | 12798087 | #!/usr/bin/env python
import time
from random import choice
from string import ascii_lowercase
from amqp import connect_get_channel_declare_exchange_and_return_channel, EXCHANGE_NAME
APPS = ["foo", "bar", "infrastructure"]
LEVELS = ["debug", "info", "warn", "error"]
def publish_cyclically():
channel = connect_g... | 2.734375 | 3 |
help.py | Fxcilities/KEKWBot | 2 | 12798088 | import discord
from discord.ext import commands
from discord.ext import *
from discord.ext.commands import *
import asyncio
class help(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def help(self, ctx):
embed = discord.Embed(
title="KEKW Bot... | 2.78125 | 3 |
twiliokey.py | ridwanrahman/wavemaps | 3 | 12798089 | <reponame>ridwanrahman/wavemaps<filename>twiliokey.py
''' Twilio keys for send_text.py:
account_sid_key
auth_token
'''
class TwilioKey:
def __init__(self): # https://www.twilio.com/try-twilio
self.account_sid_key = "your_sid"
self.auth_token_key = "your_auth"
def get_sid(self):
return s... | 2.53125 | 3 |
Spark_streaming/spark_streaming.py | XinxinTang/Real-time_Stock_Monitor | 0 | 12798090 | # @author: <NAME>
# email: <EMAIL>
# -2
# fetch data from kafka producer
# doing computation using spark streaming
# store back to kafka producer in another topic
import argparse
import json
import logging
import atexit
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
from pyspark.stream... | 2.84375 | 3 |
news_spider/spiders/wallstreetcn.py | zuoakang/news_spider | 0 | 12798091 | import scrapy
from news_spider.items import WallstreetcnItem
from news_spider.utils.common import get_category_by_name
class WallstreetcnSpider(scrapy.Spider):
name = 'wallstreetcn'
allowed_domains = ['https://api.wallstcn.com']
start_urls = ['https://api.wallstcn.com/apiv1/content/information-flow?chann... | 2.875 | 3 |
150-Challenges/Challenges 80 - 87/Challenge 82.py | DGrifferty/Python | 0 | 12798092 | <filename>150-Challenges/Challenges 80 - 87/Challenge 82.py<gh_stars>0
# 082
# Show the user a line of text from your favourite poem and
# ask for a starting and ending point. Display the characters
# between those two points.
# very similar to challenge 74
from typing import List
def print_list(lst: List):
"""... | 4.125 | 4 |
pdfmerge/views.py | rupin/pdfmerger | 0 | 12798093 | from django.http import HttpResponse
from django.template import loader
from .models import *
from django.conf import settings
from django.shortcuts import redirect
from utils import dataLayerPDF
from utils import dprint
from utils import modelUtils
import pandas as pd
from django.contrib.auth import authenticate, log... | 2.15625 | 2 |
FunctionalPractice/py_sorted.py | CarrieGao/py3-practice | 0 | 12798094 | # _*_ coding: utf-8 _*_
def by_name(t):
return t[0].lower()
def by_score(t):
return t[1]
if __name__ == '__main__':
print(sorted([36, 5, -12, 9, -21]))
s = sorted(['bob', 'about', 'Zoo', 'Credit'], key=str.lower, reverse=True)
print(s)
L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 8... | 3.78125 | 4 |
tools/apply_gsub_rules.py | aravindavk/Gubbi | 9 | 12798095 | #!/usr/bin/python
# Copyright (C) 2012, <NAME> <<EMAIL>>
# http://aravindavk.in
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | 2.046875 | 2 |
abtools/core/models.py | i1bgv/abtools | 3 | 12798096 | <reponame>i1bgv/abtools
# -*- coding: utf-8 -*-
import numpy as np
from .base import Distribution
from .distributions import Bernoulli, Lognormal
class BLModel(Distribution):
def __init__(self, x=None, mu=None, std=None,
alpha=None, n=None, k_b=None, k_l=None):
self.bernoulli = Bernoul... | 2.375 | 2 |
url_shortener/db.py | kuderr/simple-url-shortener | 0 | 12798097 | import typing
import random
import uuid
from pydantic import BaseModel, Field
class URL(BaseModel):
"""
FastAPI uses pydantic to validate and represent data.
Maybe dive deeper in it.
"""
id: int = Field(..., title="ID of URL")
full_url: str = Field(..., title="Full URL")
short_url_code: ... | 3.265625 | 3 |
run_onnx_on_microtvm.py | mshr-h/nucleo-f746zg-microtvm-example | 0 | 12798098 | <reponame>mshr-h/nucleo-f746zg-microtvm-example
import tvm
from tvm import relay
import onnx
import tvm.micro
from tvm.micro.contrib import zephyr
import os
import numpy as np
model_path = "add.onnx"
onnx_model = onnx.load(model_path)
input1_name = "Input1"
input2_name = "Input2"
shape_dict = {input1_name: [1], inpu... | 2.25 | 2 |
scripts/data_subset.py | Njfritter/myersBriggsNLPAnalysis | 16 | 12798099 | #!/usr/bin/env python3
################################################################
# <NAME> Personality Type Tweets Natural Language Processing
# By <NAME>
# Project can be found at:
# https://www.inertia7.com/projects/109 &
# https://www.inertia7.com/projects/110
###############################################... | 2.453125 | 2 |
e1/p1.py | larsaars/algorithms_datastructures_exercises | 0 | 12798100 | <filename>e1/p1.py
import argparse
from utils import time_func
def gcd_iterative(a: int, b: int) -> int:
while True:
r = a % b
a = b
b = r
if r == 0: # not r
break
return a
def gcd_recursive(a: int, b: int):
return gcd_recursive(b, a % b) if b else a
def... | 3.8125 | 4 |
projects/olds/ocr/ocr-tensorflow/train.py | Bingwen-Hu/hackaway | 0 | 12798101 | # -*- coding: utf-8 -*-
import os
import time
import tensorflow as tf
from config import FLAGS
from model import build_graph
from preprocess import train_data_iterator, test_data_helper
def train():
with tf.Session() as sess:
# initialization
graph = build_graph(top_k=1)
saver = tf.train... | 2.171875 | 2 |
test/test_huffman.py | brendanlong/compression | 0 | 12798102 | #!/usr/bin/env python3
import bitstring
from compression import huffman
simple = b"122333"
simple_codes = {
"1": "11",
"2": "10",
"3": "0"
}
simple_tree = bitstring.Bits("0b00100110001100110010100110011")
simple_compressed = bitstring.Bits("0x498cca67d0")
lorem = (b"Lorem ipsum dolor sit amet, consectet... | 2.8125 | 3 |
transition_amr_parser/action_pointer/o8_data_oracle.py | IBM/transition-amr-parser | 76 | 12798103 | <reponame>IBM/transition-amr-parser
import json
import argparse
from collections import Counter, defaultdict
import re
from tqdm import tqdm
from transition_amr_parser.io import read_propbank, read_amr, write_tokenized_sentences
from transition_amr_parser.action_pointer.o8_state_machine import (
AMRStateMachine,
... | 2.515625 | 3 |
src/diamond/collectors/hacheck/test/testhacheck.py | rohangulati/fullerite | 0 | 12798104 | <reponame>rohangulati/fullerite
#!/usr/bin/python
# coding=utf-8
################################################################################
from mock import Mock
from mock import patch
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from urllib2 import HTTPError... | 2.296875 | 2 |
experiments/chouse_auxiliary_supervised.py | jkulhanek/a2cat-vn-pytorch | 7 | 12798105 | from deep_rl import register_trainer
from deep_rl.core import AbstractTrainer
from deep_rl.core import MetricContext
from deep_rl.configuration import configuration
from environments.gym_house.goal import GoalImageCache
import os
import torch
import numpy as np
from torch.utils.data import Dataset,DataLoader
from model... | 2.140625 | 2 |
UI/main_window.py | b0bs0n/valo-crosshair | 0 | 12798106 | <gh_stars>0
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'main_window.ui'
##
## Created by: Qt User Interface Compiler version 6.2.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###... | 1.546875 | 2 |
actions.py | matthewb66/bdconsole | 0 | 12798107 | import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash_extensions import Download
def create_actions_tab(projname, vername):
return [
dbc.Row(
dbc.Col(html.H2("Actions")),
),
dbc.Row(
dbc.Col(html.H4(... | 2.078125 | 2 |
tests/tests.py | chunglabmit/phathom | 1 | 12798108 | <reponame>chunglabmit/phathom<filename>tests/tests.py
import phathom
import phathom.io
import phathom.utils
from phathom.test_helpers import *
import multiprocessing
import numpy as np
import unittest
import os
import tempfile
import sys
class TestConversion(unittest.TestCase):
def test_imread(self):
fil... | 2.375 | 2 |
app.py | anthonycgalea/FRC-2022-Scouting-Server | 0 | 12798109 | <filename>app.py<gh_stars>0
from flask import (
Flask
, render_template
, redirect
, request
, jsonify
, url_for
)
from flask_sqlalchemy import SQLAlchemy
import os, requests
from models import constants
from requests.exceptions import HTTPError
basedir = os.path.abspath(os.path.dirname(__file_... | 2.609375 | 3 |
insert_into_table.py | cegladanych/demo_storage | 0 | 12798110 | <gh_stars>0
from azure.cosmosdb.table.tableservice import TableService
from azure.cosmosdb.table.models import Entity
import csv
account_name = ''
accoun_key = ''
table_name = 'projectx'
file_name = 'C:\\Users\\admin\\Downloads\\meta.csv'
def set_table_service():
return TableService(account_name,accoun_key)
def... | 2.375 | 2 |
mlnx-ofed-4.9-driver/rdma-core-50mlnx1/tests/test_relaxed_ordering.py | Hf7WCdtO/KRCore | 0 | 12798111 | <filename>mlnx-ofed-4.9-driver/rdma-core-50mlnx1/tests/test_relaxed_ordering.py
from tests.base import RCResources, UDResources, XRCResources
from tests.utils import traffic, xrc_traffic
from tests.base import RDMATestCase
from pyverbs.mr import MR
import pyverbs.enums as e
class RoUD(UDResources):
def create_mr(... | 1.929688 | 2 |
run_files.py | OmarOsman/Arabic_Text_Summarization | 0 | 12798112 | <filename>run_files.py<gh_stars>0
import os, pickle, re
import document
import preprocess
import argparse
import pdb
def get_summary(input_text):
pr = preprocess.Preprocess()
original_text = input_text
preprocessed_text = pr.get_clean_article(input_text)
sentences = pr.get_article_sentences(preprocess... | 2.859375 | 3 |
exercise/venv/lib/python3.7/site-packages/sqreen/log.py | assuzzanne/my-sqreen | 0 | 12798113 | <gh_stars>0
# -*- coding: utf-8 -*-
# Copyright (c) 2016, 2017, 2018, 2019 Sqreen. All rights reserved.
# Please refer to our terms for more information:
#
# https://www.sqreen.io/terms.html
#
""" Logging module helpers
"""
import logging
ROOT_LOGGER_NAME = "sqreen"
LOG_FORMAT = (
"[%(levelname)s][%(asctime)s ... | 2.234375 | 2 |
src/btt/questions/admin.py | kevinkissi/basic-tech-tips-webapp | 116 | 12798114 | <reponame>kevinkissi/basic-tech-tips-webapp
from django.contrib import admin
from django.apps import apps
questions = apps.get_app_config('questions')
for model_name, model in questions.models.items():
admin.site.register(model)
| 1.953125 | 2 |
photoframe/__init__.py | sesamemucho/photoframe | 0 | 12798115 | <reponame>sesamemucho/photoframe
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__version__ = '0.1.0'
| 1.015625 | 1 |
en/verbocean_to_json.py | yuichigoto/ccg2lambda | 200 | 12798116 | <filename>en/verbocean_to_json.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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/licens... | 2.6875 | 3 |
view/runnable/showMultiPlayerBoard.py | achrafJhidri/LeCompteEstBon | 0 | 12798117 | from view.runnable.Runnable import Runnable
class showMultiPlayerBoard(Runnable):
def __init__(self,vue, sec):
Runnable.__init__(self,vue)
self.sec = sec
def run(self):
self.vue.showMultiPlayerBoard(self.sec) | 1.8125 | 2 |
cryptomarket/exchange/client.py | miguelagustin/cryptomkt-python | 0 | 12798118 | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import requests
import time
import warnings
from .auth import HMACAuth
from .compat import imap
from .compat import quote
from .compat impor... | 2.359375 | 2 |
setup.py | maiziex/Aquila_stLFR | 7 | 12798119 | from setuptools import setup, find_packages, Extension
setup(name='aquila_stlfr',
version='1.1',
description='assembly and variant calling for stlfr and hybrid assembler for linked-reads',
author='XinZhou',
author_email='<EMAIL>',
packages=['bin',],
entry_points={'console_scripts':[... | 1.070313 | 1 |
rx/core/operators/catch.py | mmpio/RxPY | 4,342 | 12798120 | from typing import Callable, Union
import rx
from rx.core import Observable, typing
from rx.disposable import SingleAssignmentDisposable, SerialDisposable
from rx.internal.utils import is_future
def catch_handler(source: Observable, handler: Callable[[Exception, Observable], Observable]) -> Observable:
def subsc... | 2.546875 | 3 |
test.py | pboi20/fuzzycd | 0 | 12798121 | <gh_stars>0
import os
import shutil
import unittest
from fuzzycd import (
path_is_directory, filter_paths, get_print_directories, get_best_match)
TEST_DIR = "fixtures"
def touch(path):
with open(path, 'a'):
os.utime(path, None)
class TestFuzzyCD(unittest.TestCase):
@classmethod
def setUpC... | 2.390625 | 2 |
bx24_orm/core/utils.py | dmitriilazukov/bx24_orm | 1 | 12798122 | # -*- coding: utf-8 -*-
class classproperty(property):
def __get__(self, cls, owner):
return classmethod(self.fget).__get__(None, owner)()
| 2.234375 | 2 |
examples/misc/hexapod_z.py | brutzl/pymbs | 0 | 12798123 | # -*- coding: utf-8 -*-
'''
This file is part of PyMbs.
PyMbs is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
PyMbs is distributed i... | 1.75 | 2 |
gym_round_bot/envs/round_bot_worlds.py | robotsthatdream/gym-round_bot | 2 | 12798124 | #!/usr/bin/python
# -*- coding: utf-8 -*-
""" <NAME>
ISIR - CNRS / Sorbonne Université
02/2018
This file allows to build worlds
TODO : replace this file by a .json loader and code worlds in .json
"""
# WARNING : don't fo (from round_bot_py import round_bot_model) here to avoid mutual imports !
impo... | 2.578125 | 3 |
uwhoisd/caching.py | kgaughan/uwhoisd | 32 | 12798125 | <gh_stars>10-100
"""
Caching support.
"""
import collections
import logging
import time
import pkg_resources
logger = logging.getLogger("uwhoisd")
class UnknownCache(Exception):
"""
The supplied cache type name cannot be found.
"""
def get_cache(cfg):
"""
Attempt to load the configured cache... | 2.78125 | 3 |
tests/unit/configuration_subsystem/test_settings_sources.py | saito-hideki/ansible-navigator | 0 | 12798126 | <gh_stars>0
"""Test the ability to produce a dictionary of effective sources."""
from copy import deepcopy
import pytest
from ansible_navigator.configuration_subsystem import Configurator
from ansible_navigator.configuration_subsystem import Constants as C
from ansible_navigator.configuration_subsystem import Naviga... | 2.390625 | 2 |
src/controller/widgets/buttons_cch.py | gustavosaquetta/FrameworkSSQt-Vocatus | 0 | 12798127 | import os, sys
sys.path.append(os.getcwd())
from PyQt5.QtWidgets import QApplication
from src.view.widgets.buttons_cch import ButtonsCCHView
from src.controller.base import Base
class ButtonsCCHController:
def __init__(self, force_show=False):
print('C botoes')
self.view = ButtonsCCHView()
self.view.bt_confi... | 2.46875 | 2 |
delivery/pdf_processor/preprocessor/__init__.py | sidmishraw/scp | 2 | 12798128 | # __init__.py
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date: 2017-04-05 20:29:06
# @Last Modified by: <NAME>
# @Last Modified time: 2017-04-05 23:13:28
'''
Houses the core logic used to build the reverse-indices for the words extracted from the PDFs.
The preprocessor module.
'''
# CS 267 specific import... | 2.15625 | 2 |
UniExplore/base/migrations/0032_alter_responses_photograph.py | MichaelHills01/group-software-project-1 | 1 | 12798129 | <gh_stars>1-10
# Generated by Django 4.0.1 on 2022-03-16 14:58
import base.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0031_alter_profile_picture_delete_weeklychallenge'),
]
operations = [
migrations.AlterField(
... | 1.453125 | 1 |
compressed_communication/broadcasters/histogram_model_test.py | amitport/google_research_federated | 0 | 12798130 | <filename>compressed_communication/broadcasters/histogram_model_test.py
# Copyright 2022, 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/L... | 2.078125 | 2 |
scripts/download_osm_tiles.py | MartinRusk/stratux | 104 | 12798131 | #!/usr/bin/python3
from sys import argv
import os
import math
import urllib.request
import random
import os.path
import sqlite3
URL_TEMPLATE = "https://c.tile.openstreetmap.org/%d/%d/%d.png"
BBOX = None # [lon_min, lat_min, lon_max, lat_max] or None for whole world
ZOOM_MAX = 7
LAYERTYPE = "baselayer" # "baselayer" ... | 2.921875 | 3 |
vctk_texts.py | deciding/hifi-gan | 0 | 12798132 | text_dir='VCTK-Corpus/txt/'
wav_dir='VCTK-Corpus/wav48/'
train_txt='VCTK-Corpus/training.txt'
val_txt='VCTK-Corpus/validation.txt'
eval_txt='VCTK-Corpus/evaluation.txt'
import os
all_set=[]
train_set=[]
val_set=[]
eval_set=[]
spks=os.listdir(text_dir)
spks.sort()
for spk in spks:
if spk in ['p360', 'p361', 'p3... | 2.3125 | 2 |
btb/selection/recent.py | dataronio/BTB | 161 | 12798133 | <filename>btb/selection/recent.py
import logging
from btb.selection.ucb1 import UCB1
# the minimum number of scores that each choice must have in order to use
# best-K optimizations. If not all choices meet this threshold, default UCB1
# selection will be used.
K_MIN = 2
logger = logging.getLogger('btb')
class Rec... | 3.265625 | 3 |
tests/components/test_pressure.py | StephenOrJames/aviation-weather | 2 | 12798134 | import unittest
from aviation_weather import Pressure
from aviation_weather.exceptions import PressureDecodeError
class TestPressure(unittest.TestCase):
"""Unit tests for aviation_weather.components.pressure.Pressure"""
def _test_valid(self, raw, indicator, value):
p = Pressure(raw)
self.asse... | 3.109375 | 3 |
projects/models.py | DerrickOdhiambo/P-Awards | 0 | 12798135 | <gh_stars>0
from django.db import models
from django.utils.timezone import now
from django.contrib.auth.models import User
from django.urls import reverse
from django_resized import ResizedImageField
class Project(models.Model):
title = models.CharField(max_length=50)
project_image = models.ImageField(upload_... | 2.15625 | 2 |
franki/docker/compose.py | cr0hn/franki | 1 | 12798136 | import argparse
from typing import List
import yaml
from ..dal.services import ServiceConfig
TAB = " " * 2
def cli_docker_compose(parser: argparse._SubParsersAction):
sub_parser = parser.add_parser("docker-compose",
help="build a docker-compose")
sub_parser.add_argument(... | 2.40625 | 2 |
leetcode/even_digits.py | Imipenem/Competitive_Prog_with_Python | 0 | 12798137 | <reponame>Imipenem/Competitive_Prog_with_Python<gh_stars>0
def findNumbers(nums: [int]) -> int:
return len(list(([e for e in nums if len(str(e))%2 == 0])))
if __name__ == '__main__':
print(findNumbers([12,345,2,6,7896]))
| 3.5625 | 4 |
flappy.py | antpa/FlapPyBird | 0 | 12798138 | from itertools import cycle
import random
import sys
import pygame
from pygame.locals import *
FPS = 30
SCREENWIDTH = 512
SCREENHEIGHT = 512
# amount by which base can maximum shift to left
PIPEGAPSIZE = 100 # gap between upper and lower part of pipe
PIPEHEIGHT = 300
PIPEWIDTH = 50
BASEY = SCREENHEIGHT ... | 3.09375 | 3 |
src/pages/views.py | ahsanali2000/Patientio | 2 | 12798139 | from django.shortcuts import render, get_object_or_404
from .models import About,Appointment,Doctor,Report,Service,History
from django.http import HttpResponse,HttpResponseRedirect
from django.shortcuts import redirect
from django.contrib.auth.decorators import login_required
# Create your views here.
def home(request)... | 2 | 2 |
search/conftest.py | ArturMichalak/ElasticSearch-DSL-Playground | 0 | 12798140 | """Basic test configuration"""
from unittest.mock import MagicMock
from pytest import fixture
from elasticsearch_dsl.connections import add_connection
@fixture
def mock_client(dummy_response):
"""Returns elasticsearch mock client"""
client = MagicMock()
client.search.return_value = dummy_response
ad... | 2.65625 | 3 |
hyperspeed/text.py | bovesan/mistika-hyperspeed | 3 | 12798141 | #!/usr/bin/env python
import re
class Title(object):
def __init__(self, path):
self.path = path
self._fonts = False
self._string = False
def __str__(self):
return self.name
def __repr__(self):
return self.name
@property
def fonts(self):
if not self.... | 3.265625 | 3 |
complaints/ccdb/tests/test_choose_field_map.py | JeffreyMFarley/ccdb-data-pipeline | 6 | 12798142 | <filename>complaints/ccdb/tests/test_choose_field_map.py
import os
import unittest
import complaints.ccdb.choose_field_map as sut
from common.tests import build_argv, captured_output, validate_files
def fieldsToAbsolute(mapping_file):
# where is _this_ file? and one level up
thisScriptDir = os.path.dirname(o... | 2.296875 | 2 |
bash_to_python/cat.py | blakfeld/Bash-To-Python | 0 | 12798143 | <reponame>blakfeld/Bash-To-Python<filename>bash_to_python/cat.py<gh_stars>0
"""
cat.py -- Emulate UNIX cat.
Author: <NAME>
E-Mail: <EMAIL>
Date: 5/25/2015
"""
import os
import sys
class Cat(object):
def __init__(self, fname=None, stdin=None):
"""
Constructor
Args:
fname (st... | 3.28125 | 3 |
calculate_diff.py | yhc45/IP-Spoof | 0 | 12798144 | <filename>calculate_diff.py<gh_stars>0
#!/usr/bin/python2
from spoof_struct import send_packet
import dpkt, socket, subprocess
from collections import defaultdict
import time
import cPickle as pickle
import itertools
src_ip = '192.168.100.128'
spoof_ip = '192.168.22.21'
src_port = 54024
pcap_name = "filter.pcap"
ipid_... | 2.640625 | 3 |
src/ralph/licences/tests/tests_models.py | DoNnMyTh/ralph | 1,668 | 12798145 | <filename>src/ralph/licences/tests/tests_models.py
# -*- coding: utf-8 -*-
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from ralph.accounts.tests.factories import RegionFactory, UserFactory
from ralph.back_office.tests.factories import BackOfficeAssetFactory
from ralp... | 2.03125 | 2 |
leetcode-CP/Data-structures-Problems/566. Reshape the Matrix.py | vijay2020pc/100-days-of-code | 0 | 12798146 | In MATLAB, there is a handy function called reshape which can reshape an m x n matrix into a new one with a different size r x c keeping its original data.
You are given an m x n matrix mat and two integers r and c representing the number of rows and the number of columns of the wanted reshaped matrix.
The reshaped m... | 4.0625 | 4 |
src/convert/vukuzazi.py | IHCC-cohorts/data-harmonization-test | 0 | 12798147 | <filename>src/convert/vukuzazi.py
import csv
import pandas as pd
from argparse import ArgumentParser, FileType
def main():
p = ArgumentParser()
p.add_argument('input', type=str)
p.add_argument('output', type=FileType('w'))
args = p.parse_args()
input_xlsx = args.input
output_file = args.outp... | 3.078125 | 3 |
radarly/influencer.py | gvannest/radarly-py | 6 | 12798148 | """
An influencer in Radarly is an author of several publications who has a
more-or-less large audience. The influencer module of ``radarly-py`` defines
several methods and functions in order to help you to understand who are the
influencers in your project and consequently understand your audience.
"""
from .api impo... | 2.921875 | 3 |
templates/node/node.py | threefoldtech/0-templates | 1 | 12798149 | <reponame>threefoldtech/0-templates
from jumpscale import j
from zerorobot import config
from zerorobot.template.base import TemplateBase
from zerorobot.template.decorator import retry, timeout
from zerorobot.template.state import StateCheckError
import netaddr
import time
CONTAINER_TEMPLATE_UID = 'github.com/threefo... | 1.789063 | 2 |
authorization/migrations/0005_auto_20200207_2204.py | KariSpace/CRM_Sedicomm | 0 | 12798150 | <reponame>KariSpace/CRM_Sedicomm
# Generated by Django 2.2.4 on 2020-02-07 20:04
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('authorization', '0004_auto_20200207_2147'),
]
operations = [
migrations.Al... | 1.382813 | 1 |