text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Dominic Fitzgerald'
import simplejson
import random
from viewer.models import Report, Study, Sample
from report_parser import parse_extra_info
def effectratio(**kwargs):
reports = Report.objects.filter(pk__in=kwargs['reportId'])
effect_ratio_dict = {}
for report in reports:
for vari... | {
"repo_name": "jgrundstad/viewer",
"path": "util/render_charts.py",
"copies": "2",
"size": "5697",
"license": "apache-2.0",
"hash": 1400918468287846700,
"line_mean": 26.6553398058,
"line_max": 103,
"alpha_frac": 0.4505880288,
"autogenerated": false,
"ratio": 3.6402555910543133,
"config_test": f... |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import create_input
from bitcodin import get_input
from bitcodin import delete_input
from bitcodin import Input
from bitcodin.test.bitcodin_test_case import BitcodinTestCase
class GetInputTestCase(BitcodinTestCase):
def set... | {
"repo_name": "bitmovin/bitcodin-python",
"path": "bitcodin/test/input/testcase_get_input.py",
"copies": "1",
"size": "4407",
"license": "unlicense",
"hash": -6931828707258135000,
"line_mean": 72.45,
"line_max": 150,
"alpha_frac": 0.7581120944,
"autogenerated": false,
"ratio": 3.7189873417721517,... |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import create_job
from bitcodin import create_input
from bitcodin import create_encoding_profile
from bitcodin import delete_input
from bitcodin import delete_encoding_profile
from bitcodin import get_job_status
from bitcodin imp... | {
"repo_name": "bitmovin/bitcodin-python",
"path": "bitcodin/test/job/testcase_get_job_status.py",
"copies": "1",
"size": "1999",
"license": "unlicense",
"hash": 386168930231012400,
"line_mean": 37.4423076923,
"line_max": 108,
"alpha_frac": 0.6948474237,
"autogenerated": false,
"ratio": 3.68139963... |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import create_output
from bitcodin import delete_output
from bitcodin import get_output
from bitcodin import S3Output
from bitcodin.test.settings import s3_output_config
from bitcodin.test.bitcodin_test_case import BitcodinTestCa... | {
"repo_name": "bitmovin/bitcodin-python",
"path": "bitcodin/test/output/testcase_get_s3_output.py",
"copies": "1",
"size": "2039",
"license": "unlicense",
"hash": -6207991557071702000,
"line_mean": 38.2115384615,
"line_max": 70,
"alpha_frac": 0.6454144188,
"autogenerated": false,
"ratio": 3.64758... |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import create_output
from bitcodin import delete_output
from bitcodin import S3Output
from bitcodin.test.settings import s3_output_config
from bitcodin.test.bitcodin_test_case import BitcodinTestCase
class CreateS3OutputTestCas... | {
"repo_name": "bitmovin/bitcodin-python",
"path": "bitcodin/test/output/testcase_create_s3_output.py",
"copies": "1",
"size": "2597",
"license": "unlicense",
"hash": 3642033836716610000,
"line_mean": 40.8870967742,
"line_max": 92,
"alpha_frac": 0.6368887178,
"autogenerated": false,
"ratio": 3.662... |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import EncodingProfile
from bitcodin import AudioStreamConfig
from bitcodin import VideoStreamConfig
from bitcodin import create_encoding_profile
from bitcodin import delete_encoding_profile
from bitcodin.test.bitcodin_test_case ... | {
"repo_name": "bitmovin/bitcodin-python",
"path": "bitcodin/test/encodingprofile/testcase_create_encoding_profile.py",
"copies": "1",
"size": "1824",
"license": "unlicense",
"hash": -6469754060022566000,
"line_mean": 45.7692307692,
"line_max": 108,
"alpha_frac": 0.7319078947,
"autogenerated": false... |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import FTPOutput
from bitcodin import create_output
from bitcodin import delete_output
from bitcodin import get_output
from bitcodin.exceptions import BitcodinNotFoundError
from bitcodin.test.settings import ftp_output_config
fro... | {
"repo_name": "bitmovin/bitcodin-python",
"path": "bitcodin/test/output/testcase_delete_ftp_output.py",
"copies": "1",
"size": "1553",
"license": "unlicense",
"hash": -6155291201824628000,
"line_mean": 34.2954545455,
"line_max": 71,
"alpha_frac": 0.6664520283,
"autogenerated": false,
"ratio": 3.8... |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import S3Output
from bitcodin import create_output
from bitcodin import delete_output
from bitcodin.test.settings import s3_output_config
from bitcodin.test.bitcodin_test_case import BitcodinTestCase
class DeleteS3OutputTestCas... | {
"repo_name": "bitmovin/bitcodin-python",
"path": "bitcodin/test/output/testcase_delete_s3_output.py",
"copies": "1",
"size": "1653",
"license": "unlicense",
"hash": 7686172585735072000,
"line_mean": 36.5681818182,
"line_max": 67,
"alpha_frac": 0.6297640653,
"autogenerated": false,
"ratio": 3.609... |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from time import sleep, time
from bitcodin import create_job
from bitcodin import create_input
from bitcodin import create_encoding_profile
from bitcodin import delete_input
from bitcodin import delete_encoding_profile
from bitcodin import tra... | {
"repo_name": "bitmovin/bitcodin-python",
"path": "bitcodin/test/job/testcase_transfer_job_ftp.py",
"copies": "1",
"size": "3475",
"license": "unlicense",
"hash": -5585607966274095000,
"line_mean": 40.369047619,
"line_max": 124,
"alpha_frac": 0.6610071942,
"autogenerated": false,
"ratio": 3.84828... |
__author__ = 'dominic rufa'
"""
Folding@Home perses executor
# prereqs
conda config --add channels omnia --add channels conda-forge
conda create -n perses python3.7 perses tqdm dicttoxml
pip uninstall --yes openmmtools
pip install git+https://github.com/choderalab/openmmtools.git
argv[1]: setup.yaml (argument for pe... | {
"repo_name": "choderalab/perses",
"path": "perses/app/fah_generator.py",
"copies": "1",
"size": "23266",
"license": "mit",
"hash": 4510174391499328500,
"line_mean": 45.718875502,
"line_max": 269,
"alpha_frac": 0.6257629158,
"autogenerated": false,
"ratio": 3.886086520795056,
"config_test": fal... |
__author__ = '@dominofire'
import click
import doger.utils as utils
import doger.train_factory as train_factory
import doger.csv2pk as csv2pk_converter
import doger.split_predictor_response as split_predictor_response
import doger.split_train_test as split_train_test
import numpy as np
import doger.merge_results as me... | {
"repo_name": "dominoFire/doger",
"path": "doger/cli/puppet.py",
"copies": "1",
"size": "3457",
"license": "apache-2.0",
"hash": -6598911753074335000,
"line_mean": 34.2755102041,
"line_max": 126,
"alpha_frac": 0.6942435638,
"autogenerated": false,
"ratio": 3.233863423760524,
"config_test": true... |
__author__ = '@dominofire'
import glob
import os
import pandas as pd
import re
def merge_results(folder):
assert os.path.exists(folder) and os.path.isdir(folder)
csv_files = glob.glob(os.path.join(folder, '*_gridSearch.csv'))
filenames_list = [os.path.split(x)[1] for x in csv_files]
modelnames_lis... | {
"repo_name": "dominoFire/doger",
"path": "doger/merge_results.py",
"copies": "1",
"size": "1490",
"license": "apache-2.0",
"hash": -7797410378076534000,
"line_mean": 32.8636363636,
"line_max": 113,
"alpha_frac": 0.6120805369,
"autogenerated": false,
"ratio": 3.2891832229580573,
"config_test": ... |
""" Author: Dom Modica
Purpose: Monitor outdoor gear site and email myself when an item is on sale. Is important
to check frequently due to deals only lasting 10-15 minutes each """
import requests
from bs4 import BeautifulSoup
import pickle,shelve
import smtplib,time
fromaddr = 'redmen31@gmail.com'
toaddrs = 'redme... | {
"repo_name": "Onebrownsound/SnowboardGearScrapper",
"path": "SteepAndCheepScraper.py",
"copies": "1",
"size": "1304",
"license": "mit",
"hash": -4877547869040998000,
"line_mean": 26.7446808511,
"line_max": 89,
"alpha_frac": 0.6533742331,
"autogenerated": false,
"ratio": 3.642458100558659,
"con... |
"""Author: Dom Modica
Purpose: To solve the problem described @ http://www.reddit.com/r/dailyprogrammer/comments/2ovt2i/20141210_challenge_192_intermediate_markov_chain/
Essentially the purpose is to read in a large dictionary file of words, and analyze the frequencies of how letters follow each other.
For example in t... | {
"repo_name": "Onebrownsound/MarkovWordChallenge",
"path": "MarkovWords.py",
"copies": "1",
"size": "2256",
"license": "mit",
"hash": 7583035224940257000,
"line_mean": 45.0408163265,
"line_max": 175,
"alpha_frac": 0.7132092199,
"autogenerated": false,
"ratio": 3.6862745098039214,
"config_test":... |
"""Author:Dom Modica
The purpose of this program is to solve the problem described @ http://www.reddit.com/r/dailyprogrammer/comments/2o5tb7/2014123_challenge_191_intermediate_space_probe/
Essentially one is to create a 2D NxN matrix along with various obstacles denoted as gravity wells and asteroids and implement a BF... | {
"repo_name": "Onebrownsound/3DBFS",
"path": "ThreeDeeBFS.py",
"copies": "1",
"size": "5201",
"license": "mit",
"hash": -2903769302639751700,
"line_mean": 48.0660377358,
"line_max": 171,
"alpha_frac": 0.5902711017,
"autogenerated": false,
"ratio": 3.4859249329758715,
"config_test": false,
"ha... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
__all__ = [
"__title__",
"__summary__",
"__uri__",
"__version__",
"__author__",
"__email__",
"__license__",
"__copyright__",
]
__title__ = "bcrypt"
__summary__ = "Modern passw... | {
"repo_name": "pyca/bcrypt",
"path": "src/bcrypt/__about__.py",
"copies": "2",
"size": "1325",
"license": "apache-2.0",
"hash": -4518159710870979000,
"line_mean": 31.3170731707,
"line_max": 74,
"alpha_frac": 0.680754717,
"autogenerated": false,
"ratio": 3.650137741046832,
"config_test": false,
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "bcrypt"
__summary__ = "Modern password hashing for your sof... | {
"repo_name": "alex/bcrypt",
"path": "bcrypt/__about__.py",
"copies": "4",
"size": "1242",
"license": "apache-2.0",
"hash": 1860523797851248000,
"line_mean": 34.4857142857,
"line_max": 74,
"alpha_frac": 0.6900161031,
"autogenerated": false,
"ratio": 3.5384615384615383,
"config_test": false,
"... |
from __future__ import absolute_import
from __future__ import division
import os
import re
import warnings
from . import _bcrypt # type: ignore
from .__about__ import (
__author__,
__copyright__,
__email__,
__license__,
__summary__,
__title__,
__uri__,
__version__,
)
__all__ = [
... | {
"repo_name": "reaperhulk/bcrypt",
"path": "src/bcrypt/__init__.py",
"copies": "2",
"size": "5664",
"license": "apache-2.0",
"hash": -6303761037654890000,
"line_mean": 31.5517241379,
"line_max": 79,
"alpha_frac": 0.6375353107,
"autogenerated": false,
"ratio": 3.6518375241779495,
"config_test": ... |
from __future__ import absolute_import
from __future__ import division
import os
import re
import warnings
import six
from bcrypt import _bcrypt
from .__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__,
)
__all__ = [
"__title__", "__summa... | {
"repo_name": "Widiot/simpleblog",
"path": "venv/lib/python3.5/site-packages/bcrypt/__init__.py",
"copies": "4",
"size": "5467",
"license": "mit",
"hash": -7646226085536299000,
"line_mean": 35.4466666667,
"line_max": 79,
"alpha_frac": 0.6583135175,
"autogenerated": false,
"ratio": 3.6205298013245... |
from __future__ import absolute_import
from __future__ import division
import os
import re
import six
from bcrypt import _bcrypt
from .__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__,
)
__all__ = [
"__title__", "__summary__", "__uri__"... | {
"repo_name": "Graghav/surabi",
"path": "ADMIN/venv/lib/python2.7/site-packages/bcrypt/__init__.py",
"copies": "1",
"size": "4884",
"license": "apache-2.0",
"hash": -6715221449643389000,
"line_mean": 34.9117647059,
"line_max": 79,
"alpha_frac": 0.662981163,
"autogenerated": false,
"ratio": 3.5780... |
from __future__ import absolute_import
from __future__ import division
import os
import six
from bcrypt import _bcrypt
from .__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__,
)
__all__ = [
"__title__", "__summary__", "__uri__", "__versi... | {
"repo_name": "growingdever/bcrypt",
"path": "src/bcrypt/__init__.py",
"copies": "8",
"size": "2042",
"license": "apache-2.0",
"hash": -4082816448301707300,
"line_mean": 29.0294117647,
"line_max": 78,
"alpha_frac": 0.6581782566,
"autogenerated": false,
"ratio": 3.6399286987522284,
"config_test"... |
__author__ = 'donal'
__project__ = 'dataHoover'
import os
# todo Ugly ugly DL_DIR bodge
# ============
# LOGGING VARIABLES
# ============
# Meta Data
VERSION = "1.0"
PROJECT_NAME = 'IFAprovPat'
# S3 Bucket
EXCEL_BASE_DIR = 'dataclean'
# Downloads dir
DL_DIR = "C:\\MagicFolder" # os.path.join(os.path.expanduser('~'), ... | {
"repo_name": "carverdo/dcleaner",
"path": "config_project.py",
"copies": "1",
"size": "1696",
"license": "mit",
"hash": 8630824511385236000,
"line_mean": 31.6346153846,
"line_max": 103,
"alpha_frac": 0.5518867925,
"autogenerated": false,
"ratio": 2.7487844408427877,
"config_test": false,
"ha... |
__author__ = 'donal'
__project__ = 'dataHoover'
from dateutil import parser
import re
# To catch '..', '-' etc as nulls -
NOT_NULLS = re.compile(r'[a-zA-Z0-9]')
NULL_LEN_MAX = 2
# To catch '25APR2012 | 25APR12 | 25APR | 25APR2012T13:57PM' as date -
DATE_PATT = re.compile(r'\d{1,2}[a-zA-Z]{3,4}(\d{4}|\d{2}|)') # \B
DA... | {
"repo_name": "carverdo/dcleaner",
"path": "app/proj/se_corrects.py",
"copies": "1",
"size": "6745",
"license": "mit",
"hash": -4256063899797698600,
"line_mean": 27.9484978541,
"line_max": 78,
"alpha_frac": 0.5288361749,
"autogenerated": false,
"ratio": 2.9898049645390072,
"config_test": false,... |
__author__ = 'donal'
__project__ = 'dcleaner'
import os
import boto
from werkzeug import secure_filename
from uuid import uuid4
from config_vars import AWS_KEYS
from app.templates.flash_msg import *
from datetime import datetime
from operator import itemgetter
class s3Handler(object):
"""
Figure out who you ar... | {
"repo_name": "carverdo/dcleaner",
"path": "app/updown/s3_handler.py",
"copies": "1",
"size": "3716",
"license": "mit",
"hash": 3473172806795412500,
"line_mean": 34.3904761905,
"line_max": 87,
"alpha_frac": 0.5888051668,
"autogenerated": false,
"ratio": 3.60077519379845,
"config_test": false,
... |
__author__ = 'donal'
__project__ = 'dcleaner'
import requests
from threading import Thread
from flask import render_template
from config_vars import MAILGUN_URL, SANDBOX, MAILGUN_KEY
from . import lg
class SendEmail(object):
fr = "Circadian Activate <postmaster@{}>".format(SANDBOX)
def __init__(self, *args,... | {
"repo_name": "carverdo/dcleaner",
"path": "app/gunner.py",
"copies": "1",
"size": "2036",
"license": "mit",
"hash": -8921430663156476000,
"line_mean": 30.3230769231,
"line_max": 76,
"alpha_frac": 0.5279960707,
"autogenerated": false,
"ratio": 4.0078740157480315,
"config_test": false,
"has_no... |
__author__ = 'donal'
__project__ = 'rendezview'
from math import radians, cos, sin, asin, sqrt
def haversine((lat1, lon1), (lat2, lon2)):
"""
Calculate the great circle distance between two points (km)
on the earth (specified in decimal degrees).
The 2nd, 3rd, and 4th digits (after the decimal) adds ... | {
"repo_name": "carverdo/homer",
"path": "app/proj/havers.py",
"copies": "1",
"size": "1348",
"license": "mit",
"hash": -8419286930127530000,
"line_mean": 30.3720930233,
"line_max": 67,
"alpha_frac": 0.543768546,
"autogenerated": false,
"ratio": 2.587332053742802,
"config_test": false,
"has_no... |
__author__ = 'donal'
__project__ = 'ribcage'
import requests
from threading import Thread
from flask import render_template
from config_vars import MAILGUN_URL, SANDBOX, MAILGUN_KEY
from . import lg
class SendEmail(object):
fr = "Circadian Activate <postmaster@{}>".format(SANDBOX)
def __init__(self, *args, ... | {
"repo_name": "carverdo/homer",
"path": "app/gunner.py",
"copies": "1",
"size": "2035",
"license": "mit",
"hash": 1242984191787929000,
"line_mean": 30.3076923077,
"line_max": 76,
"alpha_frac": 0.5277641278,
"autogenerated": false,
"ratio": 4.005905511811024,
"config_test": false,
"has_no_keyw... |
__author__ = 'don'
import xmltodict
import geojson
import json
from datetime import datetime
from collections import OrderedDict
from operator import attrgetter
with open('inspections.xml') as fd:
obj = xmltodict.parse(fd.read())
features = []
for business in obj['Business_Inspection_Violation']['Business']:
... | {
"repo_name": "dsmyth/seattlehealthgeojson",
"path": "inspections.py",
"copies": "1",
"size": "1697",
"license": "apache-2.0",
"hash": 4143143593300158000,
"line_mean": 33.6326530612,
"line_max": 261,
"alpha_frac": 0.5910430171,
"autogenerated": false,
"ratio": 4.190123456790124,
"config_test":... |
__author__ = 'Doohoon Kim'
import numpy
import scipy
import unittest
import time
from nearpy import Engine
from nearpy.distances import CosineDistance
from nearpy.hashes import RandomBinaryProjections, HashPermutations, HashPermutationMapper
class lshsearcher:
def __init__(self):
self.__dimension = None... | {
"repo_name": "GabrielKim/ImageSearcher",
"path": "src/DataSearcher/lshsearcher/lshsearcher.py",
"copies": "1",
"size": "1559",
"license": "mit",
"hash": 1359319465192465400,
"line_mean": 28.4339622642,
"line_max": 112,
"alpha_frac": 0.6401539448,
"autogenerated": false,
"ratio": 3.95685279187817... |
__author__ = 'dorota'
# -*- coding: utf-8 -*-
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def change_field_value(self, field_name, text):
wd = self.app.wd
if text is not None:
wd.find_element_by_name(field_name)... | {
"repo_name": "dorotan/pythontraining",
"path": "fixture/contact.py",
"copies": "1",
"size": "9286",
"license": "apache-2.0",
"hash": -2220050606033569500,
"line_mean": 41.7834101382,
"line_max": 127,
"alpha_frac": 0.6108358466,
"autogenerated": false,
"ratio": 3.4577281191806333,
"config_test"... |
__author__ = 'dorota'
# -*- coding: utf-8 -*-
from model.group import Group
from random import randrange
def test_modify_group_name(app, db):
if app.group.count() == 0:
app.group.create()
old_groups = db.get_group_list()
index = randrange(len(old_groups))
group = Group(name="test")
group.i... | {
"repo_name": "dorotan/pythontraining",
"path": "test/test_modify_group.py",
"copies": "1",
"size": "1240",
"license": "apache-2.0",
"hash": -8323352441302789000,
"line_mean": 34.4571428571,
"line_max": 93,
"alpha_frac": 0.6435483871,
"autogenerated": false,
"ratio": 2.9039812646370025,
"config... |
__author__ = 'dorota'
# -*- coding: utf-8 -*-
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("groups.php") and len(wd.find_elements_by_name("new")) > 0):
... | {
"repo_name": "dorotan/pythontraining",
"path": "fixture/group.py",
"copies": "1",
"size": "3552",
"license": "apache-2.0",
"hash": -3704758785938102000,
"line_mean": 30.4424778761,
"line_max": 100,
"alpha_frac": 0.5861486486,
"autogenerated": false,
"ratio": 3.4451988360814743,
"config_test": ... |
__author__ = 'dorota'
# -*- coding: utf-8 -*-
from selenium import webdriver
from fixture.contact import ContactHelper
from fixture.group import GroupHelper
from fixture.session import SessionHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = w... | {
"repo_name": "dorotan/pythontraining",
"path": "fixture/application.py",
"copies": "1",
"size": "1054",
"license": "apache-2.0",
"hash": 1490530734515674600,
"line_mean": 26.0512820513,
"line_max": 65,
"alpha_frac": 0.5806451613,
"autogenerated": false,
"ratio": 4.182539682539683,
"config_test... |
__author__ = 'dorota'
# -*- coding: utf-8 -*-
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_homepage()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
... | {
"repo_name": "dorotan/pythontraining",
"path": "fixture/session.py",
"copies": "1",
"size": "1462",
"license": "apache-2.0",
"hash": -7853447510530192000,
"line_mean": 28.8163265306,
"line_max": 73,
"alpha_frac": 0.5643835616,
"autogenerated": false,
"ratio": 3.310657596371882,
"config_test": ... |
__author__ = 'dorota'
from pony.orm import *
from datetime import datetime
from model.group import Group
from model.contact import Contact
from pymysql.converters import decoders
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_ = 'group_list'
id = PrimaryKey(int, column='... | {
"repo_name": "dorotan/pythontraining",
"path": "fixture/orm.py",
"copies": "1",
"size": "2495",
"license": "apache-2.0",
"hash": 3404849912240336000,
"line_mean": 38,
"line_max": 126,
"alpha_frac": 0.6669338677,
"autogenerated": false,
"ratio": 3.674521354933726,
"config_test": false,
"has_n... |
__author__ = 'dorota'
from pytest_bdd import given, when, then
from model.contact import Contact
import random
@given('a contact list')
def contact_list(db):
return db.get_contact_list()
@given('a contact with <first_name>, <middle_name>, <last_name>, <title>, <company>, <address>, <home_number> and <first_email>... | {
"repo_name": "dorotan/pythontraining",
"path": "bdd/contact_steps.py",
"copies": "1",
"size": "3605",
"license": "apache-2.0",
"hash": -1241641466854155300,
"line_mean": 45.2179487179,
"line_max": 134,
"alpha_frac": 0.7126213592,
"autogenerated": false,
"ratio": 3.2506762849413886,
"config_tes... |
__author__ = 'dorota'
import mysql.connector
from model.group import Group
from model.contact import Contact
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = mysq... | {
"repo_name": "dorotan/pythontraining",
"path": "fixture/db.py",
"copies": "1",
"size": "1393",
"license": "apache-2.0",
"hash": -7675265289661538000,
"line_mean": 28.6382978723,
"line_max": 116,
"alpha_frac": 0.5915290739,
"autogenerated": false,
"ratio": 4.121301775147929,
"config_test": fals... |
__author__ = 'dorota'
import pytest
import json
import os.path
import importlib
import jsonpickle
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirnam... | {
"repo_name": "dorotan/pythontraining",
"path": "conftest.py",
"copies": "1",
"size": "2436",
"license": "apache-2.0",
"hash": -7326981332268768000,
"line_mean": 29.0740740741,
"line_max": 129,
"alpha_frac": 0.6773399015,
"autogenerated": false,
"ratio": 3.6686746987951806,
"config_test": true,... |
__author__ = 'dorota'
from pytest_bdd import given, when, then
from model.group import Group
import random
@given('a group list')
def group_list(db):
return db.get_group_list()
@given('a group with <name>, <header> and <footer>')
def new_group(name, header, footer):
return Group(name=name, header=header, foo... | {
"repo_name": "dorotan/pythontraining",
"path": "bdd/group_steps.py",
"copies": "1",
"size": "1688",
"license": "apache-2.0",
"hash": 2281654613671498000,
"line_mean": 34.1875,
"line_max": 113,
"alpha_frac": 0.6949052133,
"autogenerated": false,
"ratio": 3.0524412296564196,
"config_test": false... |
# Calculates the current version number. If possible, this is the
# output of "git describe", modified to conform to the versioning
# scheme that setuptools uses. If "git describe" returns an error
# (most likely because we're in an unpacked copy of a release tarball,
# rather than in a git working copy), then we fa... | {
"repo_name": "Cocophotos/TreebankAnalytics",
"path": "treebankanalytics/version.py",
"copies": "1",
"size": "2724",
"license": "mit",
"hash": -783227172768067100,
"line_mean": 24.9047619048,
"line_max": 70,
"alpha_frac": 0.6525735294,
"autogenerated": false,
"ratio": 3.746556473829201,
"config... |
__author__ = 'douglas'
# -*- coding: cp1252 -*-
from tkinter import *
from time import localtime
class Horas:
def __init__(self,raiz):
self.canvas=Canvas(raiz, width=200, height=100)
self.canvas.pack()
self.frame=Frame(raiz)
self.frame.pack()
self.altura = 100 # Altura do c... | {
"repo_name": "douglasbolis/prog_2",
"path": "tKinter/clock.py",
"copies": "1",
"size": "1781",
"license": "apache-2.0",
"hash": -4511340117515227600,
"line_mean": 38.5111111111,
"line_max": 154,
"alpha_frac": 0.6085489314,
"autogenerated": false,
"ratio": 2.8770226537216828,
"config_test": fal... |
__author__ = "Douglas"
def codifica(pLst):
lstArtigos = ['a', 'as', 'o', 'os', 'um', 'uma', 'umas', 'uns']
lstConj = ['e', 'nem', 'também', 'bem', 'como', 'mas', 'porém', 'todavia', 'contudo', 'entretanto', 'no entanto', 'logo', 'portanto', 'por isso', 'assim', 'por seguinte', 'que', 'porque', 'porquanto', 'pois']
... | {
"repo_name": "douglasbolis/prog_2",
"path": "manipula_textos/atividades_arquivos/codificaT.py",
"copies": "1",
"size": "1883",
"license": "apache-2.0",
"hash": -2354882869313554400,
"line_mean": 42.4651162791,
"line_max": 404,
"alpha_frac": 0.5425361156,
"autogenerated": false,
"ratio": 2.279268... |
__author__ = 'douglas'
def criarVtx(xsEsq,ysEsq,xiDir,yiDir):
return [[xsEsq,ysEsq],[xiDir,yiDir]]
def criarDim(xsEsq,ysEsq,larg,alt):
return [[xsEsq,ysEsq],[xsEsq+larg,ysEsq+alt]]
# Função que retorna os cantos superior direito e inferior esquerdo.
def getCantos(param_retangulo):
return param_retangulo... | {
"repo_name": "douglasbolis/prog_2",
"path": "tads/retangulo/danilo/TAD_RETANGULO.py",
"copies": "1",
"size": "3068",
"license": "apache-2.0",
"hash": -3329815613912712000,
"line_mean": 23.2380952381,
"line_max": 133,
"alpha_frac": 0.6378519974,
"autogenerated": false,
"ratio": 2.460918614020951,... |
__author__ = 'douglas'
def criarVtx(xsupesq,ysupesq,xinfd,yinf):
'''cria via vértices.
Retorna um tad retângulo a partir da origem (canto superior
esquerdo) e da extremidade direita inferior.'''
return [xsupesq,ysupesq,xinfd,yinf]
# fim funcao
def criarDim(xsupesq,ysupesq,larg,alt):
'''cria via or... | {
"repo_name": "douglasbolis/prog_2",
"path": "tads/retangulo/tadRetangulo.py",
"copies": "1",
"size": "8203",
"license": "apache-2.0",
"hash": -7547582881590861000,
"line_mean": 42.9838709677,
"line_max": 162,
"alpha_frac": 0.6949877751,
"autogenerated": false,
"ratio": 2.4352485858886572,
"con... |
__author__ = 'douglas'
def fazInsercao(param_lst):
lst_result, trocas = [], 0
if len(param_lst) > 0:
lst_result.append(param_lst[0])
lst_corrente = param_lst[1:]
trocas += 1
else:
return []
# fim else
for i in range(len(lst_corrente)):
m, inseriu = 0, False
while m < (len(lst_result)) and not ins... | {
"repo_name": "douglasbolis/prog_2",
"path": "tecnicas_programacao/metodos_insercao/insercao_direta.py",
"copies": "1",
"size": "1222",
"license": "apache-2.0",
"hash": -6661975531743410000,
"line_mean": 19.3833333333,
"line_max": 78,
"alpha_frac": 0.6301145663,
"autogenerated": false,
"ratio": 2... |
__author__ = "Douglas"
def tokenizador(pTexto):
strSep = [' ', '.', ',', ';', ':', '!', '?', '(', ')', '[', ']', '{', '}', '\\', '|', '/', '\n', '\t', '"'];
lstTokens, lstPosicoes = [], []
strBuffer, pos = '', 0
while pos < len(pTexto):
if (pTexto[pos] not in strSep):
strBuffer += pTexto[pos]
else:
if ... | {
"repo_name": "douglasbolis/prog_2",
"path": "manipula_textos/atividades_arquivos/tokenizadorT.py",
"copies": "1",
"size": "1153",
"license": "apache-2.0",
"hash": -2061611378530972700,
"line_mean": 23.4255319149,
"line_max": 245,
"alpha_frac": 0.6080139373,
"autogenerated": false,
"ratio": 2.490... |
__author__ = 'Douglas'
#~ Email: douglasbolislima@gmai.com
import tadcomplex
import tadmatrix
# QUESTÃO (1)(a)
def indexabd(paramNomeArq):
arqLeitura = open(paramNomeArq + '.txt', 'rt')
arqEscrita = open(paramNomeArq + '.ndx', 'wt')
posCursor = arqLeitura.tell()
linhaArqLeitura = arqLeitura.readline()
while... | {
"repo_name": "douglasbolis/prog_2",
"path": "atividades/atividade_2/segunda_prova_prog_2.py",
"copies": "1",
"size": "1905",
"license": "apache-2.0",
"hash": -3072033023215659000,
"line_mean": 23.7272727273,
"line_max": 74,
"alpha_frac": 0.7016806723,
"autogenerated": false,
"ratio": 2.321951219... |
__author__ = 'douglas'
# Exercício (1)
# funcao responsavel para cadastrar as imagens no dicionario
def f_cadastraImagem(dic, nome, lst):
sobrepoe = False
# [x1, y1, x2, y2]
canSupEsqN = (lst[0], lst[1])
canInfDirN = (lst[2], lst[3])
canSupDirN = (lst[2] - lst[0], lst[1])
canInfEsqN = (lst[0],... | {
"repo_name": "douglasbolis/prog_1",
"path": "tarefa_6/tarefa_6.py",
"copies": "1",
"size": "2412",
"license": "apache-2.0",
"hash": -5867059504398631000,
"line_mean": 31.5810810811,
"line_max": 103,
"alpha_frac": 0.5215767635,
"autogenerated": false,
"ratio": 2.668881506090808,
"config_test": ... |
__author__ ='douglas'
# Exercício proposto para a manipulação de frações:
# Função implementada jundo a Letra (A) para cria uma nova fração
# através do parametro do tipo tupla com dois elementos do tipo inteiro
def f_criaFracao(n, d):
t = ()
if (n<0 and d<0) or (n>0 and d<0):
t = (-n, -d)
else:
if d == 0:
... | {
"repo_name": "douglasbolis/prog_1",
"path": "tarefa_5/tarefa_5.py",
"copies": "1",
"size": "3524",
"license": "apache-2.0",
"hash": -7751231742319040000,
"line_mean": 21.7058823529,
"line_max": 95,
"alpha_frac": 0.6698330455,
"autogenerated": false,
"ratio": 2.120879120879121,
"config_test": f... |
__author__ = 'douglas'
from tkinter import *
import math
import time
def main():
raiz = Tk()
w, h = 800, 600
canvas = Canvas(raiz, width = 800, height = 600, cursor = 'X_cursor', bg = 'white')
canvas.pack()
canvas.create_rectangle(150, 50, 450, 100, fill = 'white', outline = 'red')
canvas.cr... | {
"repo_name": "douglasbolis/prog_2",
"path": "tKinter/senoideProfessor.py",
"copies": "1",
"size": "1158",
"license": "apache-2.0",
"hash": 2943647236389010000,
"line_mean": 25.9534883721,
"line_max": 87,
"alpha_frac": 0.573402418,
"autogenerated": false,
"ratio": 2.845208845208845,
"config_tes... |
__author__ = 'douglas'
from tkinter import *
import time
import tadCirculo
def movimenta(lst, px, w, h):
lst[4] = lst[0]
lst[5] = lst[1]
lst[6] = lst[2]
lst[7] = lst[3]
if (lst[0] <= 0):
if (lst[8] > lst[0]):
lst[0] += px
lst[2] += px
else:
lst[... | {
"repo_name": "douglasbolis/prog_2",
"path": "tads/circulo/circTkinter.py",
"copies": "1",
"size": "2078",
"license": "apache-2.0",
"hash": -4172372800018388000,
"line_mean": 20.4329896907,
"line_max": 94,
"alpha_frac": 0.41626564,
"autogenerated": false,
"ratio": 2.8543956043956045,
"config_te... |
__author__ = 'douglas'
from tkinter import *
import time
import tadRetangulo
def movimenta(lst, px, w, h):
lst[4] = lst[0]
lst[5] = lst[1]
lst[6] = lst[2]
lst[7] = lst[3]
if (lst[0] <= 0):
if (lst[8] > lst[0]):
tadRetangulo.move(lst, px, 0)
# lst[0] += px
... | {
"repo_name": "douglasbolis/prog_2",
"path": "tads/retangulo/retangTkinter.py",
"copies": "1",
"size": "3958",
"license": "apache-2.0",
"hash": 1035701619260676200,
"line_mean": 25.75,
"line_max": 83,
"alpha_frac": 0.4653865589,
"autogenerated": false,
"ratio": 2.615994712491738,
"config_test":... |
__author__ = 'douglas'
# Função do exercício (1)
def f_adicionaFilmeAtor(d, f, n):
if f in d:
d[f].append(n)
else:
d[f] = [n]
#fim if
#fim funcao
# Função do exercício (2)
def f_insereFilmeAtores(dicAcervo):
nomeFilme, nomeAtor, lstAtor = "", "", []
nomeFilme = input("Digite o nom... | {
"repo_name": "douglasbolis/prog_1",
"path": "lista_3/Lista_3.py",
"copies": "1",
"size": "5788",
"license": "apache-2.0",
"hash": 3618006585229150000,
"line_mean": 29.7593582888,
"line_max": 114,
"alpha_frac": 0.5659885237,
"autogenerated": false,
"ratio": 2.7609217474795966,
"config_test": fa... |
__author__ = 'Douglas'
import dlib
import os
import numpy as np
this_path = os.path.dirname(__file__)
def _shape_to_np(shape):
xy = []
for i in range(68):
xy.append((shape.part(i).x, shape.part(i).y,))
xy = np.asarray(xy, dtype='float32')
return xy
def get_landmarks(img):
# if not autom... | {
"repo_name": "BAILOOL/Assistant-for-People-with-Low-Vision",
"path": "FaceRecognition/face_frontalization/facial_feature_detector.py",
"copies": "1",
"size": "1755",
"license": "mit",
"hash": -413358303037189900,
"line_mean": 27.3064516129,
"line_max": 103,
"alpha_frac": 0.6421652422,
"autogenerat... |
__author__ = 'douglas'
import libplnbsi
from operator import itemgetter
def higherFreq(lstFreq):
return lstFreq[0]
# fim funcao
def printHigherFreq(tupFreq):
print("Maior frequencia: %s - %s vez(es)\n" %(tupFreq[0], tupFreq[1]))
# fim funcao
def lowFreq(lstFreq):
return lstFreq[-1]
# fim funcao
def pri... | {
"repo_name": "douglasbolis/prog_2",
"path": "manipula_textos/atividades_arquivos/megaSena.py",
"copies": "1",
"size": "2921",
"license": "apache-2.0",
"hash": 7755319779041143000,
"line_mean": 27.9108910891,
"line_max": 98,
"alpha_frac": 0.5871873929,
"autogenerated": false,
"ratio": 2.798657718... |
__author__ = "Douglas"
import libplnbsi
def main():
padroes = ['MMpMM', 'MMpM', 'MpM', 'MMM', 'MM', 'M', 'N/N/N', 'MMMMM', 'MMMMMM']
# nomeArqLtr = 'arqOrigMan/codigocivilbr.txt'
# nomeArqEsc = 'arqDestMan/freqCodigocivilbr.csv'
# nomeArqLtr = 'arqOrigMan/codigoTransitoBr1997.txt'
# nomeArqEsc = ... | {
"repo_name": "douglasbolis/prog_2",
"path": "manipula_textos/atividades_arquivos/extraiPadroes.py",
"copies": "1",
"size": "1678",
"license": "apache-2.0",
"hash": -7153583507428962000,
"line_mean": 36.1777777778,
"line_max": 409,
"alpha_frac": 0.6007172744,
"autogenerated": false,
"ratio": 2.30... |
__author__ = "Douglas"
import libplnbsi
def sortTamLst(lst):
for i in range(len(lst)-1):
for i in range(len(lst)-1):
if (len(lst[i]) < len(lst[i+1])):
aux = lst[i]
lst[i] = lst[i+1]
lst[i+1] = aux
#fim if
#fim for
#fim for... | {
"repo_name": "douglasbolis/prog_2",
"path": "manipula_textos/atividades_arquivos/extraiPadroesT.py",
"copies": "1",
"size": "1884",
"license": "apache-2.0",
"hash": -1291796520741038600,
"line_mean": 30.8474576271,
"line_max": 409,
"alpha_frac": 0.5337945716,
"autogenerated": false,
"ratio": 2.6... |
__author__ = 'douglas'
import libplnP
def codec(lstTokens, lstArtigos, lstConj, lstPrepos):
strCodificada = ''
for tok in lstTokens:
if tok in lstArtigos:
strCodificada += 'a'
elif tok in lstPrepos:
strCodificada += 'p'
elif tok in lstConj:
strCodificada += 'c'
elif tok.isdigit():
strCodificad... | {
"repo_name": "douglasbolis/prog_2",
"path": "atividades/atividade_1/20142bsi0062.py",
"copies": "1",
"size": "4621",
"license": "apache-2.0",
"hash": -2237037737744202200,
"line_mean": 28.127388535,
"line_max": 145,
"alpha_frac": 0.6096654275,
"autogenerated": false,
"ratio": 2.4259946949602123,... |
__author__ = 'douglas'
import math
# A função "criar(<float real>,<float img>)" cria e retorna um TAD Complexo a partir dos valores de
# entrada representando a parte real e a parte imaginária do número complexo.
# EX.:
# criar(2.0, 3.0)
# {"real": 2.0, "imaginario": 3.0}
#
def criar(r, i):
return {"real": r, "ima... | {
"repo_name": "douglasbolis/prog_2",
"path": "atividades/atividade_avaliativa/tadcomplex.py",
"copies": "1",
"size": "4199",
"license": "apache-2.0",
"hash": -2201673530478019600,
"line_mean": 34.75,
"line_max": 136,
"alpha_frac": 0.6519536903,
"autogenerated": false,
"ratio": 2.256940664126293,
... |
__author__ = 'douglas'
import math
# ====================================
# CRIADORES
def criaRetangular(r, i):
return ([r, i, 1])
# fim funcao
def criaPolar(m, a):
return ([m, a, 2])
# fim funcao
def getRetangular(numCpx):
if numCpx[2] == 1:
return numCpx
else:
return [numCpx[0] * m... | {
"repo_name": "douglasbolis/prog_2",
"path": "tads/num_complexo/tadComplexo.py",
"copies": "1",
"size": "1461",
"license": "apache-2.0",
"hash": 5057671247090357000,
"line_mean": 17.987012987,
"line_max": 86,
"alpha_frac": 0.5523613963,
"autogenerated": false,
"ratio": 2.3794788273615635,
"conf... |
__author__ = 'douglas'
import math
def criar(r, i):
return ([r, i])
# fim funcao
def criaP(m, a):
return [m * math.cos(math.radians(a)), math.radians(a) * math.sin(m)]
# fim funcao
def criaStr(strComplexo):
if (strComplexo.find('+') > 0):
lstStrComplexo = strComplexo.strip().split('+')
return ([float(lstStrC... | {
"repo_name": "douglasbolis/prog_2",
"path": "atividades/atividade_2/tadcomplex.py",
"copies": "1",
"size": "1237",
"license": "apache-2.0",
"hash": 1032069656910536100,
"line_mean": 23.74,
"line_max": 70,
"alpha_frac": 0.6168148747,
"autogenerated": false,
"ratio": 2.236889692585895,
"config_t... |
__author__ = 'Douglas'
import numpy as np
import cv2
def estimate_camera(model3D, fidu_XY):
rmat, tvec = calib_camera(model3D, fidu_XY)
RT = np.hstack((rmat, tvec))
projection_matrix = model3D.out_A * RT
return projection_matrix, model3D.out_A, rmat, tvec
def calib_camera(model3D, fidu_XY):
#co... | {
"repo_name": "BAILOOL/Assistant-for-People-with-Low-Vision",
"path": "FaceRecognition/face_frontalization/camera_calibration.py",
"copies": "1",
"size": "4023",
"license": "mit",
"hash": -8115388830285745000,
"line_mean": 31.9836065574,
"line_max": 107,
"alpha_frac": 0.5684812329,
"autogenerated":... |
__author__ = 'douglas'
import random
import insercao_direta
import insercao_bolha
import insercao_selecao
def geraLista(tamLst):
lst_resultados = []
i = 0
while i < tamLst:
num = random.randint(0, 200000)
if num not in lst_resultados:
lst_resultados.append(num)
i += 1
# fim if
# fim while
return l... | {
"repo_name": "douglasbolis/prog_2",
"path": "tecnicas_programacao/metodos_insercao/main_sort.py",
"copies": "1",
"size": "1390",
"license": "apache-2.0",
"hash": -8651614725504791000,
"line_mean": 23.4035087719,
"line_max": 155,
"alpha_frac": 0.6532374101,
"autogenerated": false,
"ratio": 2.2749... |
__author__ = 'Douglas'
import scipy.io as scio
import cv2
import numpy as np
np.set_printoptions(formatter={'float_kind': lambda x: "%.4f" % x})
class ThreeD_Model:
def __init__(self, path, name):
self.load_model(path, name)
def load_model(self, path, name):
model = scio.loadmat(path)[name]
... | {
"repo_name": "BAILOOL/Assistant-for-People-with-Low-Vision",
"path": "FaceRecognition/face_frontalization/frontalize.py",
"copies": "1",
"size": "4885",
"license": "mit",
"hash": -7955269068919910000,
"line_mean": 46.9019607843,
"line_max": 164,
"alpha_frac": 0.6268167861,
"autogenerated": false,
... |
__author__ = "Douglas"
import sys
def rvAcentos(arqO, arqD):
dicAcentos = {
"Á": "A", "Â": "A", "Ã": "A", "À": "A", "Ä": "A",
"á": "a", "â": "a", "ã": "a", "à": "a", "ä": "a",
"É": "E", "Ê": "E", "Ẽ": "E", "È": "E", "Ë": "E",
"é": "e", "ê": "e", "ẽ": "e", "è": "e", "ë": "e",
"Í": "I", "Î": "I", "Ĩ": "I", "... | {
"repo_name": "douglasbolis/prog_2",
"path": "manipula_textos/atividades_arquivos/sem_acentos.py",
"copies": "1",
"size": "1404",
"license": "apache-2.0",
"hash": -7219514064031317000,
"line_mean": 24.5094339623,
"line_max": 109,
"alpha_frac": 0.4815088757,
"autogenerated": false,
"ratio": 1.8344... |
__author__ = 'douglas'
import sys
'''
A função txt2int(<texto com num int>) recebe como entrada um texto descrevendo
um número inteiro entre 0 e 1999 e retorna o equivalente numérico do texto.
Ex.: 'mil e novecentos e noventa e quatro'
ret.: 1994
'''
def txt2int(textoInt):
lstExt, num, tamMatriz = [], 0, ''
ext = {... | {
"repo_name": "douglasbolis/prog_2",
"path": "atividades/atividade_4/descricoesTextuaisMatriz.py",
"copies": "1",
"size": "4063",
"license": "apache-2.0",
"hash": -8123791345083936000,
"line_mean": 25.7748344371,
"line_max": 135,
"alpha_frac": 0.6645225136,
"autogenerated": false,
"ratio": 2.3541... |
__author__ = 'Douglas'
import tadcomplex
# A função "criar(<altura int>,<largura int>)" cria e retorna um TMC de altura e largura definida pelos
# parâmetros de entrada. O conteúdo de uma matriz recém-criada são elementos iguais ao
# valor zero complexo (0 + 0i).
#
def criar(altA, altB):
dicMatrix = {}
dicMatrix["... | {
"repo_name": "douglasbolis/prog_2",
"path": "atividades/atividade_avaliativa/tadmatrix.py",
"copies": "1",
"size": "1820",
"license": "apache-2.0",
"hash": 623009595913436400,
"line_mean": 27.5079365079,
"line_max": 103,
"alpha_frac": 0.7114206128,
"autogenerated": false,
"ratio": 2.340286831812... |
__author__ = 'Douglas'
import urllib2, os, bz2
dlib_facial_landmark_model_url = "http://ufpr.dl.sourceforge.net/project/dclib/dlib/v18.10/shape_predictor_68_face_landmarks.dat.bz2"
def download_file(url, dest):
file_name = url.split('/')[-1]
u = urllib2.urlopen(url)
f = open(dest+"/"+file_name, 'wb')
... | {
"repo_name": "BAILOOL/Assistant-for-People-with-Low-Vision",
"path": "FaceRecognition/face_frontalization/check_resources.py",
"copies": "1",
"size": "1673",
"license": "mit",
"hash": 4822408198884162000,
"line_mean": 35.3913043478,
"line_max": 133,
"alpha_frac": 0.6150627615,
"autogenerated": fal... |
__author__ = 'Douglas'
'''
A função cifraCesar(<mensagem>,<ndesloc>) retorna criptografada a mensagem passada como
parâmetro de entrada com deslocamento passado como segundo parâmetro.
Ex.: 'Aula de matemática: Capítulo nove'
Ret.: 'DXOD*GH*PDWHPÄWLFD=*FDSÐWXOR*QRYH'
'''
def cifraCesar(mensagem, ndesloc):
textoCifra ... | {
"repo_name": "douglasbolis/prog_2",
"path": "atividades/atividade_4/criptografia.py",
"copies": "1",
"size": "1701",
"license": "apache-2.0",
"hash": 4055916137342982000,
"line_mean": 20.075,
"line_max": 93,
"alpha_frac": 0.7222551929,
"autogenerated": false,
"ratio": 2.211286089238845,
"confi... |
__author__ = 'douglas'
def criar(linhas, colunas):
'''cria e retorna um TAD matriz de dimensões linhas, colunas dadas. Retorna
None se os valores de dimensões forem inválidas.'''
if linhas < 1 or colunas < 1:
return None
else:
return {"lin": linhas, "col": colunas}
# fim funcao
def igual... | {
"repo_name": "douglasbolis/prog_2",
"path": "tads/matriz/tadMatriz.py",
"copies": "1",
"size": "2073",
"license": "apache-2.0",
"hash": 8759839040503041000,
"line_mean": 26.1447368421,
"line_max": 103,
"alpha_frac": 0.5935984481,
"autogenerated": false,
"ratio": 2.5362853628536284,
"config_tes... |
__author__ = 'douglas'
""" FUNÇÕES DE MANIPULAÇÃO DE TEXTOS """
from operator import itemgetter
# separaPalavras(...) pega um texto e retorna suas palavras em uma lista
def separaPalavras(pTexto, strSep):
auxSep = ''
palSep = []
for i in pTexto:
if i not in strSep:
auxSep +... | {
"repo_name": "douglasbolis/prog_2",
"path": "manipula_textos/atividades_arquivos/libplnbsi.py",
"copies": "1",
"size": "10142",
"license": "apache-2.0",
"hash": 3171839854257367600,
"line_mean": 25.875,
"line_max": 206,
"alpha_frac": 0.564330958,
"autogenerated": false,
"ratio": 2.89429962761386... |
__author__ = 'douglas'
#- PARAMETROS(*) arquivo de origem, arquivo destino, separador, lista de indices, codificacao -#
def geraIndexa(arqOrig, arqDest, sep, lstIndex, encoded):
arqGeoLocRead = open(arqOrig, 'rt', encoding=encoded)
arqGeoLocWrite = open(arqDest, 'wt')
pos = arqGeoLocRead.tell()
... | {
"repo_name": "douglasbolis/prog_2",
"path": "manipula_textos/atividades_arquivos/programGeolocation.py",
"copies": "1",
"size": "1380",
"license": "apache-2.0",
"hash": -7075456327038908000,
"line_mean": 30.3863636364,
"line_max": 110,
"alpha_frac": 0.6442028986,
"autogenerated": false,
"ratio":... |
__author__ = 'douglas'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# TAD_RETANGULO.py
#
# Autor: Danilo de Oliveira
# Criado em: 24/06/15 15:57:06
# Usuário: 20142bsi0186
#
# Função do programa: APLICAÇÃO DO TAD_RETANGULO FAZENDO USO DA BIBIOTECA GRÁFICA (TKINTER).
# Versão inicial: 1.0
# ------------------... | {
"repo_name": "douglasbolis/prog_2",
"path": "tads/retangulo/danilo/APLICACAO_TAD_RETANGULO.py",
"copies": "1",
"size": "1892",
"license": "apache-2.0",
"hash": 6775558927206951000,
"line_mean": 20.6551724138,
"line_max": 93,
"alpha_frac": 0.5525477707,
"autogenerated": false,
"ratio": 2.71469740... |
__author__ = 'Doug Rohm'
import re
import ast
from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('pi_sht1x/__init__.... | {
"repo_name": "drohm/pi-sht1x",
"path": "setup.py",
"copies": "1",
"size": "2195",
"license": "mit",
"hash": -3060592062881570000,
"line_mean": 38.9090909091,
"line_max": 118,
"alpha_frac": 0.6036446469,
"autogenerated": false,
"ratio": 3.830715532286213,
"config_test": false,
"has_no_keyword... |
__author__ = 'Doug Rohm'
import re
import ast
from os import path
from setuptools import setup
# Test edit!
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('pi_bm... | {
"repo_name": "drohm/pi-bmp183",
"path": "setup.py",
"copies": "1",
"size": "2153",
"license": "mit",
"hash": 3682417821370913000,
"line_mean": 37.4464285714,
"line_max": 114,
"alpha_frac": 0.583372039,
"autogenerated": false,
"ratio": 3.8862815884476536,
"config_test": false,
"has_no_keyword... |
__author__ = 'dpepper'
__version__ = '0.2.1'
import os
import imp
import json
import urllib
# from bson import json_util
import flask
def generate_urls(app, src_dir, base_url='/', auth_fn=None):
assert isinstance(app, flask.Flask)
assert base_url.startswith('/')
base_url = base_url.rstrip('/')
if ... | {
"repo_name": "d1hotpep/flask-autorouter",
"path": "flask_autorouter/__init__.py",
"copies": "1",
"size": "4632",
"license": "mit",
"hash": -2466649738639967000,
"line_mean": 30.5102040816,
"line_max": 115,
"alpha_frac": 0.4840241796,
"autogenerated": false,
"ratio": 4.088261253309797,
"config_... |
__author__ = 'dpepper'
__version__ = '0.2.2'
import types
from adapter import CacheableAdapter
from adapter import DictAdapter
class Cacheable:
VERSION = 1
TTL = 0
adapter = None
def __init__(self):
raise Exception('use Cacheable.init()')
@staticmethod
def init(adapter=None):
... | {
"repo_name": "d1hotpep/cacheable",
"path": "cacheable/__init__.py",
"copies": "1",
"size": "3069",
"license": "mit",
"hash": -8796638338066526000,
"line_mean": 24.3636363636,
"line_max": 104,
"alpha_frac": 0.5601173021,
"autogenerated": false,
"ratio": 3.9702457956015524,
"config_test": false,... |
__author__ = "dpgaspar"
from datetime import date, datetime
import operator
import os
from ..._compat import with_metaclass
# --------------------------------------
# Exceptions
# --------------------------------------
class PKMissingException(Exception):
def __init__(self, model_name=""):
messa... | {
"repo_name": "dpgaspar/Flask-AppBuilder",
"path": "flask_appbuilder/models/generic/__init__.py",
"copies": "1",
"size": "13059",
"license": "bsd-3-clause",
"hash": -7832050848897807000,
"line_mean": 29.3697674419,
"line_max": 107,
"alpha_frac": 0.5420016847,
"autogenerated": false,
"ratio": 4.09... |
__author__ = 'dpgaspar'
import logging
from werkzeug.security import generate_password_hash
from flask import flash, redirect, session, url_for, request
from openid.consumer.consumer import Consumer, SUCCESS, CANCEL
from flask_openid import SessionWrapper, OpenIDResponse
from ..views import expose, PublicFormView
fr... | {
"repo_name": "zhounanshu/Flask-AppBuilder",
"path": "flask_appbuilder/security/registerviews.py",
"copies": "3",
"size": "11229",
"license": "bsd-3-clause",
"hash": -2259141807621566500,
"line_mean": 41.858778626,
"line_max": 110,
"alpha_frac": 0.5845578413,
"autogenerated": false,
"ratio": 4.43... |
__author__ = 'dpgaspar'
import operator
import os
from ..._compat import with_metaclass
#--------------------------------------
# Exceptions
#--------------------------------------
class PKMissingException(Exception):
def __init__(self, model_name=''):
message = 'Please set one primary key on: {0}'... | {
"repo_name": "qpxu007/Flask-AppBuilder",
"path": "flask_appbuilder/models/generic/__init__.py",
"copies": "3",
"size": "10990",
"license": "bsd-3-clause",
"hash": 3947536610202729000,
"line_mean": 28.5430107527,
"line_max": 91,
"alpha_frac": 0.5333939945,
"autogenerated": false,
"ratio": 3.96607... |
import os
import paramiko
import ssh_lib as ssh
import node_parser as np
import logging
import apps as ap
from igraph import *
from allPaths import *
from start_apps import *
from apps import *
import time
import copy
PI_CONFIG_HZ = 100
LATENCY = 100 #queue length of tbf in ms
TEMPDIR = "./tmp"
def getNextFibHops(pa... | {
"repo_name": "theuerse/netstart",
"path": "deploy_network.py",
"copies": "1",
"size": "14821",
"license": "mit",
"hash": 5049994197864731000,
"line_mean": 43.6415662651,
"line_max": 234,
"alpha_frac": 0.6575129883,
"autogenerated": false,
"ratio": 2.6844774497373662,
"config_test": true,
"ha... |
import os
import paramiko
import ssh_lib as ssh
import node_parser as np
import apps as ap
from igraph import *
from allPaths import *
import argparse
from deploy_network import *
from nfd_kill import *
from pi_logging import *
from datetime import datetime
from gather_results import *
import rand_network as rand_netw... | {
"repo_name": "theuerse/netstart",
"path": "emulation.py",
"copies": "1",
"size": "4946",
"license": "mit",
"hash": -6378625016713592000,
"line_mean": 37.3410852713,
"line_max": 284,
"alpha_frac": 0.7122927618,
"autogenerated": false,
"ratio": 3.236910994764398,
"config_test": false,
"has_no_... |
__author__ = 'drager'
import json
import requests
import random
import time
pages = ['finding the needed money to buy a car','why the cloud is turning dark','help us raise the roof','obama said something at some place','there is always another page']
sections = ['headlines','home','tips for success','latest','archiv... | {
"repo_name": "crania/test",
"path": "apiscripts/generatehits.py",
"copies": "1",
"size": "1231",
"license": "mit",
"hash": -6846684963898809000,
"line_mean": 41.4482758621,
"line_max": 174,
"alpha_frac": 0.6677497969,
"autogenerated": false,
"ratio": 3.1483375959079285,
"config_test": false,
... |
__author__ = 'drathier'
# based off of https://github.com/jordansissel/grok-cpp/blob/master/pygrok/pygrok/patterns.py
whitespace = {
"ANY": r"(\n|\t|\r| )+"
}
base = {
'USERNAME': r'''[a-zA-Z0-9_-]+''',
'USER': r'''%{USERNAME}''',
'INT': r'''(?:[+-]?(?:[0-9]+))''',
'NUMBER': r'''(?:[+-]?(?:(?:[0-9]+(?:\.[0-9]*)... | {
"repo_name": "drathier/pygrok",
"path": "patterns.py",
"copies": "1",
"size": "5040",
"license": "mit",
"hash": -3648984524269110000,
"line_mean": 72.0434782609,
"line_max": 674,
"alpha_frac": 0.4704365079,
"autogenerated": false,
"ratio": 1.9482025512176266,
"config_test": false,
"has_no_ke... |
__author__ = 'drathier'
character_classes = {
"alnum": r"[0-9A-Za-z]",
"alpha": r"[A-Za-z]",
"ascii": r"[\x00-\x7F]",
"blank": r"[\t ]",
"cntrl": r"[\x00-\x1F\x7F]",
"digit": r"[0-9]",
"graph": r"[A-Za-z0-9!\"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]",
"lower": r"[a-z]",
"print": r"[A-Za-z... | {
"repo_name": "drathier/pylinreg",
"path": "parser/parser.py",
"copies": "1",
"size": "3418",
"license": "apache-2.0",
"hash": -3493802982220168000,
"line_mean": 31.5523809524,
"line_max": 118,
"alpha_frac": 0.4599180807,
"autogenerated": false,
"ratio": 3.6831896551724137,
"config_test": false... |
__author__ = 'drathier'
import re
import patterns
# TODO: make % escapes possible
# TODO: let Pygrok() take any number of parameters, joining them using (?:.|\n)* to avoid re-parsing the whole string
class Pygrok():
def __init__(self, *pattern):
self.pattern = self._pattern_parser(r"(?:.|\n)*".join(pattern))
p... | {
"repo_name": "drathier/pygrok",
"path": "pygrok.py",
"copies": "1",
"size": "1444",
"license": "mit",
"hash": 1449813173379129900,
"line_mean": 24.350877193,
"line_max": 117,
"alpha_frac": 0.6516620499,
"autogenerated": false,
"ratio": 3.0464135021097047,
"config_test": false,
"has_no_keywor... |
__author__ = 'dreicon88'
# -*- encoding: utf8 -*-
from django import forms
from usr.models import Cliente,User
class ClienteForm(forms.Form):
username = forms.CharField(label="*Nombre de Usuario", widget=forms.TextInput())
email = forms.EmailField(label="*Correo Electronico", widget=forms.TextInput())
nomb... | {
"repo_name": "exilesas/Bee",
"path": "usr/forms.py",
"copies": "2",
"size": "2862",
"license": "mit",
"hash": -7356191389888013000,
"line_mean": 35.1898734177,
"line_max": 111,
"alpha_frac": 0.6417074878,
"autogenerated": false,
"ratio": 3.9097127222982215,
"config_test": false,
"has_no_keyw... |
__author__ = 'dreipol GmbH'
from django.conf import settings
from boto import sns
from functools import partial
import inspect
class Decorator(object):
def __init__(self, function, *args, **kwargs):
self.function = function
@property
def original_function(self):
function = self.function
... | {
"repo_name": "mtford90/django-scarface",
"path": "scarface/utils.py",
"copies": "1",
"size": "2223",
"license": "mit",
"hash": 8310381454319951000,
"line_mean": 33.2153846154,
"line_max": 117,
"alpha_frac": 0.6482231219,
"autogenerated": false,
"ratio": 3.9414893617021276,
"config_test": false... |
__author__ = "drjfunk"
import numpy as np
from astropy.coordinates import SkyCoord, get_sun, get_body, get_body_barycentric, get_moon
from spherical_geometry.polygon import SphericalPolygon
import astropy.units as u
from .gbm_frame import GBMFrame
class GBMDetector(object):
def __init__(self, name, quaternion, s... | {
"repo_name": "drJfunk/gbmgeometry",
"path": "gbmgeometry/gbm_detector.py",
"copies": "1",
"size": "18628",
"license": "mit",
"hash": -7244473180194096000,
"line_mean": 29.6886326194,
"line_max": 270,
"alpha_frac": 0.4093837234,
"autogenerated": false,
"ratio": 3.8921855411617217,
"config_test"... |
__author__ = "Dr. Lapis"
langversion = 1
langname = "Русский"
##updater
# text construct: "Version "+version+available+changelog
#example: Version 3 available, click here to download, or for changelog click here
available = " доступна, нажмите здесь, чтобы скачать"
changelog = ", или нажмите здесь, чтобы посмотреть сп... | {
"repo_name": "Berserker66/omnitool",
"path": "omnitool/Language/russian.py",
"copies": "1",
"size": "4942",
"license": "mit",
"hash": 4115809909779826000,
"line_mean": 22.0580645161,
"line_max": 92,
"alpha_frac": 0.7022110271,
"autogenerated": false,
"ratio": 1.5460839463435743,
"config_test":... |
__author__ = 'drluke'
from baseModule import BaseNode, Pin
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.arrays import *
from OpenGL.GL import shaders
import OpenGL
from OpenGL.GL.ARB.framebuffer_object import *
from OpenGL.GL.EXT.framebuffer_object import *
from PyQt5.QtWidgets import QDialog
impo... | {
"repo_name": "DrLuke/gpnshader",
"path": "oldmodules/openglbase.py",
"copies": "1",
"size": "11108",
"license": "mit",
"hash": -907305263672736100,
"line_mean": 32.2604790419,
"line_max": 207,
"alpha_frac": 0.6092906014,
"autogenerated": false,
"ratio": 3.5913352731975428,
"config_test": false... |
__author__ = 'Dr. Masroor Ehsan'
__email__ = 'masroore@gmail.com'
__copyright__ = 'Copyright 2013, Dr. Masroor Ehsan'
__license__ = 'BSD'
__version__ = '0.1.1'
from abc import ABCMeta, abstractmethod
from urllib import urlencode
from req_parser import parse_single_article, parse_article_set, parse_story_set, parse_cat... | {
"repo_name": "masroore/pynewscred",
"path": "pynewscred/req_builder.py",
"copies": "1",
"size": "3024",
"license": "bsd-3-clause",
"hash": -8016017948307183000,
"line_mean": 32.9887640449,
"line_max": 109,
"alpha_frac": 0.6061507937,
"autogenerated": false,
"ratio": 3.5914489311163895,
"config... |
__author__ = 'Dr. Masroor Ehsan'
__email__ = 'masroore@gmail.com'
__copyright__ = 'Copyright 2013, Dr. Masroor Ehsan'
__license__ = 'BSD'
__version__ = '0.1.1'
from datetime import datetime
class _RequestProcessorMixin1(object):
def from_date(self, value, with_time=False):
"""Beginning of date range for w... | {
"repo_name": "masroore/pynewscred",
"path": "pynewscred/req_mixins.py",
"copies": "1",
"size": "8137",
"license": "bsd-3-clause",
"hash": -148800406303348930,
"line_mean": 45.2386363636,
"line_max": 144,
"alpha_frac": 0.654663881,
"autogenerated": false,
"ratio": 4.222625843279709,
"config_tes... |
__author__ = 'Dr. Masroor Ehsan'
__email__ = 'masroore@gmail.com'
__copyright__ = 'Copyright 2013, Dr. Masroor Ehsan'
__license__ = 'BSD'
__version__ = '0.1.1'
from datetime import datetime
try:
from lxml import etree
except ImportError:
try:
# Python 2.5
import xml.etree.cElementTree as etree... | {
"repo_name": "masroore/pynewscred",
"path": "pynewscred/req_parser.py",
"copies": "1",
"size": "7407",
"license": "bsd-3-clause",
"hash": 485683558398270300,
"line_mean": 31.3493449782,
"line_max": 74,
"alpha_frac": 0.6292696098,
"autogenerated": false,
"ratio": 3.507102272727273,
"config_test... |
__author__ = 'Dr. Masroor Ehsan'
__email__ = 'masroore@gmail.com'
__copyright__ = 'Copyright 2013, Dr. Masroor Ehsan'
__license__ = 'BSD'
__version__ = '0.1.1'
from req_mixins import _RequestProcessorMixin1, _RequestProcessorMixin2, _RequestProcessorMixin3
from req_builder import _FluentRequestProcessorBase, _ArticleR... | {
"repo_name": "masroore/pynewscred",
"path": "pynewscred/requests.py",
"copies": "1",
"size": "5177",
"license": "bsd-3-clause",
"hash": -8111637381637661000,
"line_mean": 39.453125,
"line_max": 132,
"alpha_frac": 0.6745219239,
"autogenerated": false,
"ratio": 4.019409937888199,
"config_test": ... |
__author__ = 'Dr. Masroor Ehsan'
__email__ = 'masroore@gmail.com'
__copyright__ = 'Copyright 2013, Dr. Masroor Ehsan'
__license__ = 'BSD'
__version__ = '0.1.1'
import httplib
import urllib
from cStringIO import StringIO
import gzip, zlib
class RestClient(object):
def __init__(self, host, port=80):
self.ho... | {
"repo_name": "masroore/pynewscred",
"path": "pynewscred/rest.py",
"copies": "1",
"size": "1753",
"license": "bsd-3-clause",
"hash": -6129755478215341000,
"line_mean": 28.7288135593,
"line_max": 78,
"alpha_frac": 0.586993725,
"autogenerated": false,
"ratio": 3.835886214442013,
"config_test": fa... |
__author__ = 'droptableuser'
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.template.defaultfilters import slugify
# extending a user
class MyUser(AbstractUser):
pub_key = models.TextField(max_length=None) #gpg generated public key
avatar = models.ImageField(blan... | {
"repo_name": "droptableuser/wombii-webapp",
"path": "wombii/webapp/models.py",
"copies": "1",
"size": "1626",
"license": "mit",
"hash": 1812619792083866400,
"line_mean": 41.7894736842,
"line_max": 109,
"alpha_frac": 0.7183271833,
"autogenerated": false,
"ratio": 3.9180722891566266,
"config_tes... |
__author__ = 'dsc'
from bottle import request
import requests
from bin.urlparse import ParseUrl
from bin.protocols import Web
from json import dumps
from bin.orm import Source, SourceFile
from bin.crawler import WebCrawl
from bin.dataobjects import DataObjectManipulation, Debug
class Api():
def __init__(self, cfg)... | {
"repo_name": "trbs/sandexer",
"path": "bin/api.py",
"copies": "1",
"size": "4134",
"license": "mit",
"hash": 2880537521324824000,
"line_mean": 34.0423728814,
"line_max": 166,
"alpha_frac": 0.4591194969,
"autogenerated": false,
"ratio": 4.66065388951522,
"config_test": false,
"has_no_keywords... |
__author__ = 'dsheoran'
"""
A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
Deepak Sheoran: Customized for the need of this project
"""
from os import path
from setuptools import find_packages, setup
here = path.abspath(path.dirnam... | {
"repo_name": "sheoran/drsync",
"path": "setup.py",
"copies": "1",
"size": "1246",
"license": "mit",
"hash": 1503290142722496300,
"line_mean": 26.0869565217,
"line_max": 82,
"alpha_frac": 0.6348314607,
"autogenerated": false,
"ratio": 3.622093023255814,
"config_test": false,
"has_no_keywords"... |
__author__ = 'dsheoran'
import ConfigParser
import logging
import os
import threading
import time
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
# globals: 'sync' is prefix to avoid collision with other stuff
sync_config_parser = sync_config_file = sync_rsync_opt = sync_rs... | {
"repo_name": "sheoran/drsync",
"path": "drsync/sync.py",
"copies": "1",
"size": "5074",
"license": "mit",
"hash": -8187377930342007000,
"line_mean": 33.5170068027,
"line_max": 154,
"alpha_frac": 0.631651557,
"autogenerated": false,
"ratio": 3.6294706723891275,
"config_test": true,
"has_no_ke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.