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 |
|---|---|---|---|---|---|---|
examples/stockquotes-old/phase1/stockmarket.py | brubbel/Pyro4 | 638 | 12794051 | <filename>examples/stockquotes-old/phase1/stockmarket.py
import random
class StockMarket(object):
def __init__(self, marketname, symbols):
self.name = marketname
self.symbolmeans = {}
for symbol in symbols:
self.symbolmeans[symbol] = random.uniform(20, 200)
self.aggrega... | 2.96875 | 3 |
setup.py | jvzantvoort/seeddms | 3 | 12794052 | <reponame>jvzantvoort/seeddms
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import io
import os
import re
setup_path = os.path.abspath(__file__)
setup_path_dir = os.path.dirname(setup_path)
exec(open(os.path.join(setup_path_dir, 'seeddms', 'version.py')).read())
long_description = open(os.path.... | 1.34375 | 1 |
atpbar/report.py | abitoun-42/atpbar | 72 | 12794053 | # <NAME> <<EMAIL>>
##__________________________________________________________________||
class ProgressReportComplementer:
"""Complement progress reports
Complement a progress report with the previous report for the same
task.
Parameters
----------
report : dict
A progress report, a ... | 3 | 3 |
serverlesspack/exceptions.py | Robinson04/serverlesspack | 1 | 12794054 | <gh_stars>1-10
from .utils import message_with_vars
class OutputDirpathTooLow(Exception):
def __init__(self, highest_found_directory: str, output_base_dirpath: str):
self.highest_found_directory = highest_found_directory
self.output_base_dirpath = output_base_dirpath
def __str__(self):
... | 2.6875 | 3 |
bookstore/profiles/models.py | M0673N/bookstore | 0 | 12794055 | <filename>bookstore/profiles/models.py
from django.contrib.auth import get_user_model
from django.db import models
from django.utils.safestring import mark_safe
from bookstore.accounts.models import BookstoreUser
import cloudinary.models as cloudinary_models
from bookstore.profiles.misc import list_of_countries
from ... | 2.296875 | 2 |
cheetah_core/djangoapps/core/models.py | dota-2-cheetah/cheetah_core | 0 | 12794056 | <filename>cheetah_core/djangoapps/core/models.py
from django.db import models
# Create your models here.
class ValveDataAbstract(models.Model):
name = models.CharField('Name', max_length=50)
localized_name = models.CharField('Localized name', max_length=50)
nicknames = models.TextField('Nicknames', blank=T... | 2.265625 | 2 |
qork/easy.py | flipcoder/qork | 3 | 12794057 | #!/usr/bin/python
from collections import defaultdict
from qork.signal import Signal
from qork.reactive import *
APP = None
def qork_app(a=None):
global APP
if a is None:
return APP
APP = a
return APP
def cache(*args, **kwargs):
return APP.cache(*args, **kwargs)
def add(*args, **kwar... | 2.0625 | 2 |
chap8/8-15/printing_functions.py | StewedChickenwithStats/Answers-to-Python-Crash-Course | 1 | 12794058 | def print_models(unprinted_designs, completed_models):
while unprinted_designs:
current_design = unprinted_designs.pop()
print("Printing model: " + current_design)
completed_models.append(current_design)
| 2.859375 | 3 |
nymph/utils/third/doc_parse.py | smilelight/nymph | 1 | 12794059 | <reponame>smilelight/nymph
# -*- coding: utf-8 -*-
from typing import Dict, List
def is_breakpoint(item: dict):
# if item['text_feature'] != 'text':
if item['text_feature'] not in ['table', 'text', 'image']:
return True
if item['is_center'] is True:
return True
if item['is_bold'] is T... | 2.421875 | 2 |
src/Eighteenth Chapter/Exercise6.py | matthijskrul/ThinkPython | 0 | 12794060 | <reponame>matthijskrul/ThinkPython
# Rewrite the fibonacci algorithm without using recursion.
# Can you find bigger terms of the sequence?
# Can you find fib(200)?
import time
def fibonacci(n):
fibonaccinumber1 = 0
fibonaccinumber2 = 1
if n > 1:
for i in range(2, n+1):
fibonaccinumber3... | 4.21875 | 4 |
mathfun/primes/__init__.py | lsbardel/mathfun | 0 | 12794061 | <gh_stars>0
from .gcd import xgcd
from .prime_numbers import factors, is_prime, prime_factors
| 1.023438 | 1 |
src/nqdc/_authors.py | neuroquery/nqdc | 1 | 12794062 | <reponame>neuroquery/nqdc<filename>src/nqdc/_authors.py
"""Extracting list of authors from article XML."""
import pandas as pd
from lxml import etree
from nqdc._typing import BaseExtractor
from nqdc import _utils
class AuthorsExtractor(BaseExtractor):
"""Extracting list of authors from article XML."""
field... | 2.96875 | 3 |
src/vk_chat_bot/vk/manager.py | Dilik8/prof_net_dip | 0 | 12794063 | <gh_stars>0
import threading
import vk_api
import datetime as dt
import flag
from queue import Queue
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.utils import get_random_id
from src.vk_chat_bot.db.database import UserAppToken, UserSear... | 2.0625 | 2 |
docs/import.py | kikei/onsen | 0 | 12794064 | <reponame>kikei/onsen<filename>docs/import.py
from database.models import Onsen
import json
from django.utils import timezone
content = open("docs/points.json").read()
contents = content.split("\n")
contents = list(filter(lambda x: x != "", contents))
jsons = list(map(json.loads, contents))
def extract_char(c):
r... | 2.609375 | 3 |
addressapp/tests/api/test_geographyapi.py | AbhiyantrikTechnology/DentalHub-Backend | 1 | 12794065 | <reponame>AbhiyantrikTechnology/DentalHub-Backend
# -*- coding:utf-8 -*-
from django.contrib.auth.models import Permission
import pytest
from faker import Faker
from mixer.backend.django import mixer
from rest_framework import status
from rest_framework.test import APIClient
from rest_framework_jwt.settings import ap... | 1.984375 | 2 |
setup.py | satta/eupathtables | 0 | 12794066 | <reponame>satta/eupathtables
import glob
from setuptools import setup, find_packages
try:
import multiprocessing
except ImportError:
pass
setup(
name='eupathtables',
version='0.1',
description='Python interface for reading and converting EuPathDB flat file dumps',
packages = find_packages(),
... | 1.484375 | 1 |
lucasSequence.py | StokicDusan/LucasSequence | 0 | 12794067 | <gh_stars>0
# Lucas Sequence L is a sequence of numbers
# such that L(n) = L(n-1) + L(n-2)
from time import perf_counter
from math import sqrt
from doctest import testmod
import sys
class Stopwatch:
def __init__(self):
self.reset()
def start(self):
if not self.__running:
... | 3.65625 | 4 |
GageLogger.py | JakubGreen/Neapco-Wireless-Telemetry | 0 | 12794068 | # Created By: <NAME>
# Date: 7/16/2016
# Description: The program reads wirelessly transmitted data from multiple sensors and saves it on the local SD card.
# Usage: The program simultaneously reads multiple UDP streams and writes them to ".txt" files.
# The output files are formatted to be imported into the InFiel... | 2.609375 | 3 |
src/neocities_sync/__init__.py | kugland/neocities-sync | 2 | 12794069 | """Sync local directories with neocities.org sites."""
import os
import sys
from . import cmdline
from . import local
from .config import load_config_file
from .ignore_files import IgnoreFiles
from .log import (debug, decrease_verbosity, error, fatal, increase_verbosity, info)
from .neocities import Neocities
from .s... | 2.421875 | 2 |
happyly/_deprecations/utils.py | alex-tsukanov/cargopy | 5 | 12794070 | import warnings
from typing import Type, Union
def will_be_removed(
deprecated_name: str,
use_instead: Union[str, Type],
removing_in_version: str,
stacklevel=2,
):
new_class_name = (
use_instead.__name__ # type: ignore
if isinstance(use_instead, Type) # type: ignore
else ... | 2.46875 | 2 |
Python/Topics/Match object and flags/Something's missing/main.py | drtierney/hyperskill-problems | 5 | 12794071 | import re
string = input()
template = r'never gonna let you down...'
match = re.match(template, string, flags=re.IGNORECASE)
| 2.703125 | 3 |
appreg/utils.py | acdh-oeaw/dar | 0 | 12794072 | <reponame>acdh-oeaw/dar
from django.conf import settings
def populate_webapp(webpage_object, metadata):
""" parses a metadata_dict and populates a webpage object with the parsed data
:param webpage_object: An instance of the class appreg.models.WebApp
:param metadata: A dictionary providing string for the... | 2.34375 | 2 |
train.py | LeeDoYup/DeblurGAN-tf | 64 | 12794073 | from __future__ import print_function
import time
import os
import sys
import logging
import json
import tensorflow as tf
import numpy as np
import cv2
import data.data_loader as loader
from models.cgan_model import cgan
from models.ops import *
os.system('http_proxy_on')
def linear_decay(initial=0.0001, step=0, ... | 2.609375 | 3 |
cli/src/ssm_client.py | eyalstoler/ssm-simple-cli | 0 | 12794074 | <reponame>eyalstoler/ssm-simple-cli
import boto3
class SSMClient:
def __init__(self, config, **client_kwargs):
self.session = boto3.Session(**client_kwargs)
self.ssm_config = config
self.profile_name = 'default'
def client(self):
return self.session.client('ssm')
def get... | 2.25 | 2 |
semversioner/core.py | mvanbaak/semversioner | 0 | 12794075 | import os
import sys
import json
import click
import datetime
from distutils.version import StrictVersion
from jinja2 import Template
ROOTDIR = os.getcwd()
INITIAL_VERSION = '0.0.0'
DEFAULT_TEMPLATE = """# Changelog
Note: version releases in the 0.x.y range may introduce breaking changes.
{% for release in releases %}... | 2.21875 | 2 |
toolbox/web.py | korn-alex/toolbox | 0 | 12794076 | import requests as rq
from sys import stdout
from pathlib import Path
import re
import os
class Downloader:
"""
class to manage downloading url links
"""
def __init__(self, *args, session=None): # creates a session
self.cwd = Path.cwd()
self.src_path = Path(__file__)
... | 2.953125 | 3 |
Automate the Boring Stuff with Python/02.00 chuva.py | rdemarqui/Estudos | 2 | 12794077 | <filename>Automate the Boring Stuff with Python/02.00 chuva.py
# Script da Chuva
print('Está chovendo?')
verificaChuva = input()
if verificaChuva.capitalize() == 'Sim':
print('Você tem Guarda-chuva?')
checkGuardaChuva = input()
if checkGuardaChuva.capitalize() == 'Não':
while verificaChuva.capital... | 3.78125 | 4 |
models/random_player.py | danilonumeroso/role | 1 | 12794078 | import random
import chess
import chess.engine
class RandomPlayer:
def __init__(self):
self.id = {
'name': 'RandomPlayer'
}
def play(self, board: chess.Board, limit=None) -> chess.engine.PlayResult:
legal_moves = list(board.legal_moves)
move = random.choice(legal_... | 2.890625 | 3 |
python/python_a_byte_of/varargs.py | ssavinash1/Algorithm_stanford | 24 | 12794079 | def total (initial, *positionals, **keywords):
""" Simply sums up all the passed numbers. """
count = initial
for n in positionals:
count += n
for n in keywords:
count += keywords[n]
return count
print(__name__)
| 3.53125 | 4 |
cleanupNeeded/ASL-Localization-master/dwmDistances.py | AUVSL/Keiller-MS-Thesis | 0 | 12794080 | # dwmDistances
# Being written September 2019 by <NAME>
# Intended for use with DWM 1001 module through UART TLV interface
# This script calls the dwm_loc_get API call as specified in the
# DWM1001 Firmware API Guide 5.3.10.
# It parses the information received to send over
# the ROS network.
# In the future, this scri... | 2.6875 | 3 |
actions/train/hydras.py | drakonnan1st/JackBot | 0 | 12794081 | <gh_stars>0
"""Everything related to training hydralisks goes here"""
from sc2.constants import HYDRALISK
from actions.build.hive import BuildHive
class TrainHydralisk(BuildHive):
"""Ok for now"""
def __init__(self, main):
self.controller = main
BuildHive.__init__(self, self.controller)
... | 2.359375 | 2 |
Projects/Project_DMS/user/user.py | ivenpoker/Python-Projects | 1 | 12794082 | <gh_stars>1-10
import os
# Initialize UI settings based on terminal size (width)
UI_fill_width = os.get_terminal_size()[0]
# UI_fill_width = 74
UI_user_menu_fill_char = '#'
# Initialize UI settings (for prompts) based on terminal size (width)
UI_input_fill_width = int(int(os.get_terminal_size()[0]) / 2) + 5
# UI_in... | 2.78125 | 3 |
remove_bg/apps.py | iamr0b0tx/image-background-remove-tool | 1 | 12794083 | <gh_stars>1-10
from django.apps import AppConfig
class RemoveBgConfig(AppConfig):
name = 'remove_bg'
| 1.203125 | 1 |
sessionAPI/sessionApp/forms.py | KiralyTamas/Django | 0 | 12794084 | <gh_stars>0
from django import forms
class ItemForm(forms.Form):
name=forms.CharField(max_length=40)
quantity=forms.IntegerField() | 1.984375 | 2 |
src/modu/editable/datatypes/fck.py | philchristensen/modu | 0 | 12794085 | # modu
# Copyright (c) 2006-2010 <NAME>
# http://modu.bubblehouse.org
#
#
# See LICENSE for details
"""
Contains the FCK Editor support for modu.editable.
"""
import os, os.path, time, stat, shutil, array
from zope.interface import implements
from modu import editable, assets, web
from modu.persist import sql
from ... | 1.929688 | 2 |
bldr/cmd/new.py | bldr-cmd/bldr-cmd | 0 | 12794086 | <reponame>bldr-cmd/bldr-cmd<filename>bldr/cmd/new.py<gh_stars>0
"""
`deps.get` Command
"""
from bldr.environment import Environment
import os
import sys
from git.objects.submodule.root import RootUpdateProgress
import bldr
import bldr.gen.render
import bldr.util
import giturlparse
from git import Repo
from pathlib i... | 1.976563 | 2 |
freefield/analysis.py | pfriedrich-hub/freefield | 1 | 12794087 | <filename>freefield/analysis.py<gh_stars>1-10
import numpy as np
from scipy import stats
def double_to_single_pole(azimuth_double, elevation_double):
azimuth_double, elevation_double = np.deg2rad(azimuth_double), np.deg2rad(elevation_double)
azimuth_single = np.arctan(np.sin(azimuth_double) / np.cos(azimuth_d... | 2.359375 | 2 |
zeppelin_handy_helpers/__init__.py | sbilello/zeppelin-handy-helper | 0 | 12794088 | <filename>zeppelin_handy_helpers/__init__.py
from argumentsactions import Read, Check, Stop, Monitor
| 1.203125 | 1 |
mojo/devtools/common/devtoolslib/apptest.py | zbowling/mojo | 1 | 12794089 | <filename>mojo/devtools/common/devtoolslib/apptest.py<gh_stars>1-10
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Apptest is a Mojo application that interacts with another Mojo application
and verifie... | 2.15625 | 2 |
market_maker/abstract.py | pborky/sample-market-maker | 1 | 12794090 |
import logging
from abc import ABC
class LoggingBase(ABC):
def __init__(self, log_level: int) -> None:
self.logger = logging.getLogger(self.__class__.__name__)
self.logger.setLevel(log_level)
@property
def log_level(self) -> int:
self.logger.level | 3.140625 | 3 |
usertracking/middleware.py | joebos/django-user-tracking | 0 | 12794091 | from tracking import generate_new_tracking_key, register_event
from django.core.urlresolvers import reverse
from django.conf import settings
USER_TRACKING_LOG_HTML_FRAGMENT_RESPONSE = getattr(settings, "USER_TRACKING_LOG_HTML_FRAGMENT_RESPONSE", False)
class UserTrackingMiddleware(object):
def process_request(se... | 2.078125 | 2 |
workspaces.py | tylermenezes/PyWorkspaces | 1 | 12794092 | #!/usr/bin/python
import re
import subprocess
class workspaces():
@staticmethod
def _cmd(*args):
return subprocess.Popen(args, stdout=subprocess.PIPE).stdout.read().decode("utf-8")
@staticmethod
def get_display_size():
size = (re.split(' *', workspaces._cmd('wmctrl', '-d').replace("\n"... | 2.78125 | 3 |
utility/args.py | Tabbomat/MADUtilities | 2 | 12794093 | import configargparse
def parse_args() -> dict:
parser = configargparse.ArgParser(default_config_files=['config.ini'])
parser.add_argument('--madmin_url', required=True, type=str)
parser.add_argument('--madmin_user', required=False, default='', type=str)
parser.add_argument('--madmin_password', requir... | 2.890625 | 3 |
tests/compose/test_DAG.py | Dynatrace/alyeska | 2 | 12794094 | # -*- coding: utf-8 -*-
## ---------------------------------------------------------------------------
## Copyright 2019 Dynatrace 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
##
#... | 1.515625 | 2 |
tools/check_input.py | yuk-to/SALMON2 | 3 | 12794095 | #!/usr/bin/env python
#
# Copyright 2020 ARTED developers
#
# 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... | 2.453125 | 2 |
magic_deco_2.py | bmintz/python-snippets | 2 | 12794096 | #!/usr/bin/env python3
# encoding: utf-8
def inject_x(f):
x = 'hi'
def g(*args, **kwargs):
nonlocal x
return f(*args, **kwargs)
return g
@inject_x
def foo():
return x
def inject_x_attempt_2(f):
def wrapper(f):
x = 'hi'
def wrapped(*args, **kwargs):
nonlocal x
return f(*args, **kwargs)
return wra... | 3.34375 | 3 |
scripts/examples/ClimateEmulator/gev_fit_kma_fretchet.py | teslakit/teslak | 12 | 12794097 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# basic import
import os
import os.path as op
import sys
import time
sys.path.insert(0, op.join(op.dirname(__file__),'..','..'))
# python libs
import numpy as np
import xarray as xr
# custom libs
from teslakit.project_site import PathControl
from teslakit.extremes import... | 2.125 | 2 |
src/preprocess_clean.py | ngov17/RecipeNet | 0 | 12794098 | <filename>src/preprocess_clean.py
import sys, os
import numpy as np
from PIL import Image
from skimage import io, transform, img_as_float32
import random
START_TOKEN = "*START*" # no index as start token is not added to vocabulary as we don't want to predict start
STOP_TOKEN = "*STOP*" #Index: 0
PAD_TOKEN = "*<PASSW... | 2.8125 | 3 |
env/lib/python3.6/site-packages/dal_queryset_sequence/tests/test_views.py | anthowen/duplify | 1,368 | 12794099 | <gh_stars>1000+
import json
from dal import autocomplete
from django import test
from django.contrib.auth.models import Group
class Select2QuerySetSequenceViewTestCase(test.TestCase):
def setUp(self):
self.expected = {
'pagination': {
'more': False
},
... | 2.421875 | 2 |
tests/test_cli_map.py | sjoerdk/anonapi | 0 | 12794100 | <gh_stars>0
from pathlib import Path
from unittest.mock import Mock
from click.testing import CliRunner
from pytest import fixture
from anonapi.cli import entrypoint
from anonapi.cli.map_commands import (
MapCommandContext,
activate,
add_accession_numbers,
add_selection,
delete,
edit,
fin... | 2.125 | 2 |
Sets/set .add().py | AndreasGeiger/hackerrank-python | 0 | 12794101 | <filename>Sets/set .add().py
amountInputs = int(input())
countryList = set()
for i in range(amountInputs):
countryList.add(input())
print(len(countryList))
| 3.4375 | 3 |
iauth/urls.py | rajmani1995/picfilter | 0 | 12794102 | '''
Authentication urls for ToDos Users
Author: <NAME>
'''
from django.conf.urls import url
from . import views
# Authentiction urls
urlpatterns = [
url(r'^login/', views._login),
url(r'^signup/', views._register),
url(r'^change_password/', views._changePassword),
url(r'^logout/', views._logou... | 2.09375 | 2 |
geneeval/fetcher/auto_fetcher.py | BaderLab/GeneEval | 3 | 12794103 | from typing import List
from geneeval.fetcher.fetchers import Fetcher, LocalizationFetcher, SequenceFetcher, UniprotFetcher
class AutoFetcher:
"""A factory function which returns the correct data fetcher for the given `tasks`.
A `Fetcher` is returned which requests all the data relevant to `tasks` in a sing... | 3.1875 | 3 |
lib/__init__.py | caiodearaujo/azure-cosmosdb-python | 0 | 12794104 | import os, json
from typing import Dict, Iterable
from azure.cosmos import (CosmosClient,
PartitionKey,
ContainerProxy,
DatabaseProxy)
SETTINGS = dict(
HOST = os.getenv('COSMOSDB_HOST'),
MASTER_KEY = os.getenv('COSMOSDB_MASTER_KEY'),... | 2.3125 | 2 |
autodiff/node.py | teamjel/cs207-FinalProject | 0 | 12794105 | <filename>autodiff/node.py
"""
Node Logic for Automatic Differentiation
"""
from functools import wraps
import numpy as np
import numbers
from .visualization import create_computational_graph, create_computational_table
from .settings import settings
"""
Custom exceptions.
"""
class NoValueError(Exception):
pass
... | 2.859375 | 3 |
landmark/test.py | reasonsolo/mtcnn_caffe | 0 | 12794106 | import os
import sys
import cv2
import time
import caffe
import numpy as np
import config
sys.path.append('../')
from fast_mtcnn import fast_mtcnn
from gen_landmark import expand_mtcnn_box, is_valid_facebox, extract_baidu_lm72
from baidu import call_baidu_api
def create_net(model_dir, iter_num):
model_path = os.pa... | 2.203125 | 2 |
patch_tracking/util/upstream/__init__.py | openeuler-mirror/patch-tracking | 0 | 12794107 | <reponame>openeuler-mirror/patch-tracking
"""upstream init"""
import patch_tracking.util.upstream.git as git
import patch_tracking.util.upstream.github as github
class Factory(object):
"""
Factory
"""
@staticmethod
def create(track):
"""
git type
"""
if track.versio... | 1.796875 | 2 |
pcdet/models/model_utils/basic_blocks.py | xiangruhuang/OpenPCDet | 0 | 12794108 | <filename>pcdet/models/model_utils/basic_blocks.py
from torch import nn
def MLP(channels, activation=nn.LeakyReLU(0.2), bn_momentum=0.1, bias=True):
return nn.Sequential(
*[
nn.Sequential(
nn.Linear(channels[i - 1], channels[i], bias=bias),
nn.BatchNorm1d(channel... | 2.59375 | 3 |
typing_game/api/mixins/colors.py | CarsonSlovoka/typing-game | 0 | 12794109 | <filename>typing_game/api/mixins/colors.py<gh_stars>0
from typing_game.api.generics import RGBColor
class TypingGameColorMixin:
""" Settings of colors."""
__slots__ = ()
TYPING_CORRECT_COLOR = RGBColor.GREEN
TYPING_CUR_POS_COLOR = RGBColor.BLUE
TYPING_MODIFY_COLOR = RGBColor.YELLOW
TYPING_ERR... | 2.15625 | 2 |
import-feeds.py | gleitz/iron-blogger | 3 | 12794110 | #!/usr/bin/python
from lxml import html
import yaml
import sys
import urllib2
import urlparse
from datetime import datetime
print 'Import feeds at ' + str(datetime.now())
HEADERS = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0'}
with open('bloggers.yml') as f:
... | 2.8125 | 3 |
textclassification/randomforest.py | sshekhar10/mymllearnings | 0 | 12794111 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 10 17:37:56 2018
@author: sshekhar
"""
# get some libraries that will be useful
import re
import string
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from sklearn.ensemble import RandomForestClassifier
# functi... | 2.84375 | 3 |
Code/Blogs_Preprocessing_II.py | MaLuHart/Blogpost-Classification | 0 | 12794112 | <reponame>MaLuHart/Blogpost-Classification
# coding: utf-8
# # Preprocessing der Texte
#
# Autorin: <NAME>
# In[1]:
# Imports
import os
import numpy as np
import re # module for regular expression operations
import csv # module for csv output
from sklearn.model_selection import train_test_split # module to split... | 3.15625 | 3 |
test_documents/cleaner.py | RDShah/text-analyzer | 0 | 12794113 | <reponame>RDShah/text-analyzer
with open('graduation_raw.txt') as rfile:
with open('graduation.txt','w') as wfile:
for line in rfile:
if line == '\n': continue
if '[' not in line:
wfile.write(line)
elif ']' in line:
wfile.write(line[:line.index('[')])
wfile.write(line[line.index(']')+1:])
wfil... | 2.78125 | 3 |
setup.py | nagataaaas/Iro | 1 | 12794114 | <reponame>nagataaaas/Iro<gh_stars>1-10
"""
IRO
===
Easy and powerful Colorizer for Python!
Powered by [<NAME>](https://twitter.com/514YJ)
[GitHub](https://github.com/nagataaaas/Iro)
```python
from iro import Iro, Color, Style, ColorRGB, Color256
from colorsys import hls_to_rgb
success = Iro((Color.GREEN, "[ SUCC... | 2.4375 | 2 |
kote/protocol.py | l-n-s/kote | 5 | 12794115 | <gh_stars>1-10
from uuid import UUID, uuid4
MAX_MESSAGE_LENGTH = 1024 # 1 byte for code, 16 for UUID, 1007 for content
class ValidationError(Exception):
pass
class Message:
AUTHORIZATION = 1
PING = 2
PRIVATE = 3
PUBLIC = 4
OK = 5
UNAUTHORIZED = 6
def... | 2.875 | 3 |
demo/run-adj.py | xtian15/MPAS-SW-TL-AD | 0 | 12794116 | <reponame>xtian15/MPAS-SW-TL-AD
import sys
from datetime import timedelta
import netCDF4 as nc
import numpy as np
sys.path.append('../src/')
from module_sw_mpas import mpas_sw_module as mpsw
from mpas_namelist import namelist
from mpas_sw_driver import read_configs, read_dims, read_vars, \
initial_conditions, cl... | 2.09375 | 2 |
mazure/services/virtualmachines/models.py | tinvaan/mazure | 2 | 12794117 |
import uuid
import mongoengine as db
from flask import current_app as app
from flask_mongoengine import MongoEngine
class Properties:
name = "example"
nic = "example-nic"
disk = "example-disk"
vmId = str(uuid.uuid4())
subId = str(uuid.uuid4())
rgroup = "example-resource-group"
availabili... | 2.015625 | 2 |
graduated_site/migrations/0007_auto_20191218_1215.py | vbacaksiz/KTU-MEBSIS | 0 | 12794118 | <filename>graduated_site/migrations/0007_auto_20191218_1215.py
# Generated by Django 3.0 on 2019-12-18 12:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('graduated_site', '0006_auto_20191218_0927'),
]
operations = [
migrations.AddFie... | 1.515625 | 2 |
SendGridEmail/sendGridEmailHelper.py | prodProject/WorkkerAndConsumerServer | 0 | 12794119 | from sendgrid.helpers.mail import Mail
from CommonCode.strings import Strings
class SendGridEmailHelper:
def builderToMail(self,emailBuilder):
fromId = Strings.getFormattedEmail(builder=emailBuilder.fromId);
toids = list()
for ids in emailBuilder.toId:
toids.append(Strings.get... | 2.640625 | 3 |
tests/request_tests.py | yoshikiohshima/gato | 0 | 12794120 | <reponame>yoshikiohshima/gato<gh_stars>0
import unittest2
from sphero import request
from nose.tools import assert_equal
class RequestTest(unittest2.TestCase):
def test_ping(self):
assert_equal('\xff\xff\x00\x01\x00\x01\xfd', request.Ping().bytes)
def test_set_rgb(self):
response = request.Se... | 2.453125 | 2 |
lib/helpers/python/aoc/util/fmath.py | josephroquedev/advent-of-code | 0 | 12794121 | <reponame>josephroquedev/advent-of-code
from functools import reduce
import re
# Usage:
# n = [3, 5, 7]
# a = [2, 3, 2]
# chinese_remainder(n, a) == 23
# https://rosettacode.org/wiki/Chinese_remainder_theorem#Python_3.6
def chinese_remainder(n, a):
sum = 0
prod = reduce(lambda a, b: a * b, n)
for n_i, a... | 3.390625 | 3 |
paths_cli/__init__.py | dwhswenson/openpathsampling-cli | 1 | 12794122 | <filename>paths_cli/__init__.py<gh_stars>1-10
from .cli import OpenPathSamplingCLI
from . import commands
from . import version
| 1.382813 | 1 |
MapApi/models.py | todor943/mapEngine | 0 | 12794123 | <reponame>todor943/mapEngine
from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from MapApi import signals
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
@receiver(signals.user_login, sender=settings.AUTH_USER_MODEL)
def create... | 2.015625 | 2 |
utils/trello_parser.py | James-Ansley/TrelloCardSortParser | 1 | 12794124 | import json
import os
from typing import TextIO, Hashable, Iterator
from dateutil.parser import isoparse
from utils.sorts import Sort, Group
def parse_board(f: TextIO, card_mapping: dict[str, Hashable]) -> Sort:
"""
Extracts the information from a trello board json file.
A card_mapping maps the card pr... | 3.34375 | 3 |
src/orca/operators.py | cournape/orca-py | 0 | 12794125 | import abc
import logging
import math
import random
from orca.grid import BANG_GLYPH, COMMENT_GLYPH, DOT_GLYPH, MidiNoteOnEvent
from orca.ports import InputPort, OutputPort
logger = logging.getLogger(__name__)
OUTPUT_PORT_NAME = "output"
class IOperator(abc.ABC):
def __init__(
self, grid, x, y, name, ... | 2.828125 | 3 |
108.py | Aarush4907/C107 | 0 | 12794126 | <filename>108.py
import pandas as pd
import plotly.graph_objects as go
df = pd.read_csv(r"D:\PROGRAMS\PYTHON\C102\108Data.csv")
student_df = df.loc[df["student_id"]=="TRL_123"]
print (student_df.groupby("level")["attempt"].mean())
fig = go.Figure(go.Bar(x = student_df.groupby("level")["attempt"].mean(),y=['level1... | 3.390625 | 3 |
tests/describe/spec/test_utils.py | jeffh/describe | 3 | 12794127 | import sys
from unittest import TestCase
from StringIO import StringIO
from functools import wraps
from mock import Mock, patch
from describe.spec.utils import (tabulate, Benchmark, CallOnce,
getargspec, func_equal, accepts_arg, filter_traceback)
class DescribeFilteredTraceback(TestCase):
@patch('traceb... | 2.453125 | 2 |
modules/led_strip/main.py | la-guirlande/modules | 1 | 12794128 | <reponame>la-guirlande/modules
import re
import time
from modules.utils import ghc, color, project
try:
import RPi.GPIO as GPIO
is_gpio = True
except Exception:
is_gpio = False
print('Running module without GPIO')
module = ghc.Module(project.ModuleType.LED_STRIP, project.Paths.API_URL.value, project.Paths.WEBS... | 2.65625 | 3 |
plugins/test.py | keyboardcrunch/fastapi_route_plugin_framework | 0 | 12794129 | """ example plugin to extend a /test route """
from fastapi import APIRouter
router = APIRouter()
@router.get("/test")
async def tester():
""" test route """
return [{"result": "test"}]
| 2.046875 | 2 |
taattack/constraints/pre_constraints/pre_constraint.py | linerxliner/ValCAT | 0 | 12794130 | from abc import ABC, abstractmethod
class PreConstraint(ABC):
@abstractmethod
def filter(self, ids, workload):
raise NotImplemented()
| 2.390625 | 2 |
lib/update.py | fadushin/namecheap-dns | 1 | 12794131 | #!/usr/bin/env python
#
# Copyright (c) dushin.net
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list ... | 1.445313 | 1 |
project.py | mrdanielvelez/ReadAloud-StanfordCodeinPlace-FinalProject | 0 | 12794132 | <gh_stars>0
import os, pyttsx3, tkinter as tk
import PyPDF3
from tkinter.font import BOLD
from tkinter import Canvas, filedialog
from tkPDFViewer import tkPDFViewer as pdf
from gtts import gTTS, tts
from playsound import playsound
from tkinter import *
root = tk.Tk()
root.title("Read Aloud: Turn Your PDF Files into Au... | 3.25 | 3 |
python/setup.py | ziyu-guo/treelite | 1 | 12794133 | <gh_stars>1-10
# coding: utf-8
"""Setup script"""
from __future__ import print_function
import os
import shutil
import tempfile
from setuptools import setup, Distribution, find_packages
class TemporaryDirectory(object):
"""Context manager for tempfile.mkdtemp()"""
# pylint: disable=R0903
def __enter__(self):
... | 2.015625 | 2 |
setup.py | purplesky2016/docassemble-VirtualCourtSampleInterviews | 1 | 12794134 | import os
import sys
from setuptools import setup, find_packages
from fnmatch import fnmatchcase
from distutils.util import convert_path
standard_exclude = ('*.pyc', '*~', '.*', '*.bak', '*.swp*')
standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', './dist', 'EGG-INFO', '*.egg-info')
def find_package_dat... | 2.265625 | 2 |
mistos-backend/src/app/api/classes/image.py | Maddonix/mistos_2 | 1 | 12794135 | <reponame>Maddonix/mistos_2
import copy
from os import name
import warnings
import xml
from pathlib import Path
from typing import Any, List, Optional, Set
import numpy as np
from app import crud
from app import fileserver_requests as fsr
from app.api import utils_import, utils_paths, utils_results
from app.api.classe... | 1.992188 | 2 |
app/rooms/examples/__init__.py | olegliubimov/code-examples-python | 21 | 12794136 | <gh_stars>10-100
from .eg001_create_room_with_data import eg001Rooms
from .eg002_create_room_with_template import eg002
from .eg003_export_data_from_room import eg003
from .eg004_add_forms_to_room import eg004
from .eg005_get_rooms_with_filters import eg005
from .eg006_create_external_form_fill_session import eg006
fro... | 1.125 | 1 |
onlinejudge/implementation/command/login.py | kfaRabi/online-judge-tools | 0 | 12794137 | <gh_stars>0
# Python Version: 3.x
import getpass
import sys
from typing import *
import onlinejudge
import onlinejudge.implementation.logging as log
import onlinejudge.implementation.utils as utils
if TYPE_CHECKING:
import argparse
def login(args: 'argparse.Namespace') -> None:
# get service
service = o... | 2.453125 | 2 |
automatic_model_loading.py | FedericoMolinaChavez/tesis-research | 0 | 12794138 | <gh_stars>0
from keras.models import model_from_json
from keras.models import load_model
model_names = {'clivage_1_json' : 'models/model1.json',
'clivage_1' : 'models/model1.h5',
'clivage_2_json' : 'models/model2.json',
'clivage_2' : 'models/model2.h5',
'clivage_3_json' : 'models/model3.... | 2.375 | 2 |
piwebasync/websockets/__init__.py | newvicx/piwebasync | 0 | 12794139 | <gh_stars>0
from .client import WebsocketClient | 1.085938 | 1 |
src/builder.py | neobepmat/BatchBuilder | 0 | 12794140 | <reponame>neobepmat/BatchBuilder
# Temperature-conversion program using PyQt
import sys, os
from PyQt4 import QtGui, QtCore, uic
from PyQt4.QtGui import QMessageBox
from main import *
from builder_configuration import BuilderConfiguration
form_class = uic.loadUiType("main-interface.ui")[0] #... | 2.25 | 2 |
ISPProgrammer/NXPChip.py | snhobbs/NXPISP | 3 | 12794141 | import math
import zlib
from time import sleep
import struct
from timeout_decorator import timeout
from timeout_decorator.timeout_decorator import TimeoutError
from pycrc.algorithms import Crc
from .ISPChip import ISPChip
NXPReturnCodes = {
"CMD_SUCCESS" : 0x0,
"INVALID_COMMAND" ... | 2.21875 | 2 |
homework3 [MAIN PROJECT]/project/seller.py | Gaon-Choi/ITE2038_ | 0 | 12794142 | <gh_stars>0
import time
import argparse
from helpers.connection import conn
def parsing_seller(parser:argparse.ArgumentParser):
sub_parsers = parser.add_subparsers(dest='function')
# info
parser_info = sub_parsers.add_parser('info')
parser_info.add_argument('id', type=int)
# update
parser_up... | 2.84375 | 3 |
third_party/blink/renderer/bindings/scripts/idl_types.py | Ron423c/chromium | 575 | 12794143 | <filename>third_party/blink/renderer/bindings/scripts/idl_types.py
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""IDL type handling.
Classes:
IdlTypeBase
IdlType
IdlUnionType
IdlArrayOrSequenceType
... | 1.726563 | 2 |
widget_row/config.py | chr0nu5/core | 0 | 12794144 | <filename>widget_row/config.py
class Config:
def data(self):
config = {
'name':'Row',
'icon': 'fa fa-square-o',
'tags': 'row, bootstrap',
'preview': False
}
return config | 2.09375 | 2 |
mipengine/controller/algorithm_execution_DTOs.py | ThanKarab/MIP-Engine | 4 | 12794145 | from pydantic import BaseModel
from typing import Dict, List
from mipengine.controller.api.algorithm_request_dto import AlgorithmRequestDTO
from mipengine.controller.node_tasks_handler_interface import INodeTasksHandler
# One of the two expected data object for the AlgorithmExecutor layer.
class AlgorithmExecutionDT... | 2.203125 | 2 |
main.py | p-jonczyk/work-list | 2 | 12794146 | <gh_stars>1-10
import openpyxl as xl
import calendar
import work_list
import row_style
import os
import files_handeling
import constants as const
import input_handeling
def main():
# take source file name
source_file_name = input(
"\nSource - employees workhour list - file name (with .xlsx extention)... | 3.109375 | 3 |
mozillians/mozspaces/migrations/0001_initial.py | caktus/mozillians | 0 | 12794147 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MozSpace'
db.create_table('mozspaces_mozspace', (
('id', self.gf('django.db.mo... | 2.078125 | 2 |
basic/print emoji.py | jspw/Basic_Python | 6 | 12794148 | #website : https://unicode.org/emoji/charts/full-emoji-list.html
#replace '+' with '000'
print("\U0001F600")
print("\U0001F603")
print("\U0001F604")
print("\U0001F601")
print("\U0001F606")
print("\U0001F605")
print("\U0001F602")
print("\U0001F602")
print("\U0001F602")
print("\U0001F602")
print("\U0001F602")
print("\U... | 2.90625 | 3 |
rally_ovs/tests/unit/plugins/ovs/context/test_ovn_nb.py | LorenzoBianconi/ovn-scale-test | 15 | 12794149 | <reponame>LorenzoBianconi/ovn-scale-test
# Copyright 2018 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 1.796875 | 2 |
aio_parallel_tools/aio_task_pool/__init__.py | Python-Tools/aio_parallel_tools | 0 | 12794150 | """All Supported Task Pools."""
from .aio_fixed_task_pool_simple import AioFixedTaskPoolSimple
from .aio_fixed_task_pool_lifo import AioFixedTaskPoolLifo
from .aio_fixed_task_pool_priority import AioFixedTaskPoolPriority
from .aio_autoscale_task_pool_simple import AioAutoScaleTaskPoolSimple
from .aio_autoscale_task_poo... | 1 | 1 |