text stringlengths 0 1.05M | meta dict |
|---|---|
# import re
import time
from datetime import date
from lxml import html
from juriscraper.OpinionSite import OpinionSite
class Site(OpinionSite):
def __init__(self):
super(Site, self).__init__()
self.url = 'http://www.courts.state.hi.us/opinions_and_orders/opinions/%s/index.html' % da... | {
"repo_name": "brianwc/juriscraper",
"path": "opinions/united_states/state/haw.py",
"copies": "1",
"size": "2296",
"license": "bsd-2-clause",
"hash": -730619527292444800,
"line_mean": 42.1538461538,
"line_max": 146,
"alpha_frac": 0.5762195122,
"autogenerated": false,
"ratio": 3.0250329380764165,
... |
from datetime import datetime
from juriscraper.OpinionSite import OpinionSite
class Site(OpinionSite):
def __init__(self):
super(Site, self).__init__()
self.court_id = self.__module__
self.url = 'http://supreme.nvcourts.gov/Supreme/Decisions/Advance_Opinions/'
self.xpath... | {
"repo_name": "brianwc/juriscraper",
"path": "opinions/united_states/state/nev_p.py",
"copies": "1",
"size": "2296",
"license": "bsd-2-clause",
"hash": -2134723604282442000,
"line_mean": 37.5862068966,
"line_max": 114,
"alpha_frac": 0.5858013937,
"autogenerated": false,
"ratio": 3.391432791728212... |
from datetime import datetime
from juriscraper.OpinionSite import OpinionSite
class Site(OpinionSite):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.court_id = self.__module__
self.url = 'http://nvcourts.gov/Supreme/Decisions/Advance_Opin... | {
"repo_name": "Andr3iC/juriscraper",
"path": "opinions/united_states/state/nev_p.py",
"copies": "2",
"size": "2864",
"license": "bsd-2-clause",
"hash": 7491226538015777000,
"line_mean": 32.9268292683,
"line_max": 93,
"alpha_frac": 0.5373603352,
"autogenerated": false,
"ratio": 3.676508344030809,
... |
__author__ = 'michaell'
import pprint
import datetime
import pymongo
from tornado.options import options
class ProjectsManager(object):
"""
Projects manager for projects hours app
"""
@staticmethod
def load_projects(group_name='the_group'):
"""
Tries to find project in database
... | {
"repo_name": "miooim/project_hours",
"path": "src/admin/drivers/projects.py",
"copies": "1",
"size": "1225",
"license": "mit",
"hash": 7220540628056763000,
"line_mean": 24.5416666667,
"line_max": 95,
"alpha_frac": 0.5583673469,
"autogenerated": false,
"ratio": 4.343971631205674,
"config_test":... |
__author__ = 'Michael Messmore'
__email__ = 'mike@messmore.org'
__version__ = '0.2.0'
try:
import urlparse
except:
from urllib import parse as urlparse
import json
import yaml
from flask import jsonify, request, Blueprint, redirect
from flask_restless import APIManager
from flask_restless.helpers import *
sqlalche... | {
"repo_name": "mmessmore/flask-restless-swagger",
"path": "flask_restless_swagger/__init__.py",
"copies": "1",
"size": "8159",
"license": "bsd-2-clause",
"hash": -8550938812552644000,
"line_mean": 31.8991935484,
"line_max": 95,
"alpha_frac": 0.4303223434,
"autogenerated": false,
"ratio": 4.591446... |
__author__ = 'michael'
COMMENT_STATE_PENDING = 'pending'
COMMENT_STATE_APPROVED = 'approved'
COMMENT_STATE_UNAPPROVED = 'unapproved'
COMMENT_STATE_SPAM = 'spam'
COMMENT_STATE_CHOICES = ((COMMENT_STATE_PENDING, 'Pending'),
(COMMENT_STATE_APPROVED, 'Approved'),
(COMMENT... | {
"repo_name": "unomena/unobase",
"path": "unobase/commenting/constants.py",
"copies": "1",
"size": "1458",
"license": "bsd-3-clause",
"hash": 5228060868674025000,
"line_mean": 41.8823529412,
"line_max": 121,
"alpha_frac": 0.5960219479,
"autogenerated": false,
"ratio": 3.7099236641221376,
"confi... |
__author__ = 'Michael'
# description
# identifies wording differences between questions in a csv file
# these are from other files in this repository
from Survey_Audit import SurveyCheck
from get_questions import QuestionsMatrix
import re
# Static weight definitions
Core2014_column = 2 # (zero-indexed)
def comp... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "QMatrix/Wording_Changes.py",
"copies": "1",
"size": "2028",
"license": "cc0-1.0",
"hash": 3729399102982370000,
"line_mean": 28.8235294118,
"line_max": 103,
"alpha_frac": 0.5690335306,
"autogenerated": false,
"ratio": 3.976470588235294,
"config_te... |
__author__ = 'michael'
from copy import copy
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
import models
import constants
class CustomCommentForm(forms.ModelForm):
class Meta:
model = models.CustomComment
widget... | {
"repo_name": "unomena/unobase",
"path": "unobase/commenting/forms.py",
"copies": "1",
"size": "2458",
"license": "bsd-3-clause",
"hash": 1313320671281278700,
"line_mean": 38.0158730159,
"line_max": 175,
"alpha_frac": 0.6082180635,
"autogenerated": false,
"ratio": 4.049423393739703,
"config_tes... |
__author__ = 'michael'
from django.conf.urls.defaults import patterns, url
from unobase.forum import views, forms
urlpatterns = patterns('',
# Forum
url(r'^(?P<slug>[\w-]+)/$',
views.ForumDetail.as_view(paginate_by=6, template_name='forum/forum_detail.html'),
name='forum_detail'),
# For... | {
"repo_name": "unomena/unobase",
"path": "unobase/forum/urls.py",
"copies": "1",
"size": "2519",
"license": "bsd-3-clause",
"hash": 1132593151103102500,
"line_mean": 32.6,
"line_max": 107,
"alpha_frac": 0.5958713775,
"autogenerated": false,
"ratio": 3.3452855245683932,
"config_test": false,
"... |
__author__ = 'michael'
from django.db import models
from django.contrib.comments.models import Comment
import constants
from unobase import models as unobase_models
from unobase import settings as unobase_settings
class CustomComment(unobase_models.TagModel, Comment):
visible_to = models.IntegerField(choices=c... | {
"repo_name": "unomena/unobase",
"path": "unobase/commenting/models.py",
"copies": "1",
"size": "1662",
"license": "bsd-3-clause",
"hash": 4916182362684410000,
"line_mean": 36.7954545455,
"line_max": 142,
"alpha_frac": 0.6949458484,
"autogenerated": false,
"ratio": 3.6933333333333334,
"config_t... |
__author__ = 'michael'
from django.db import models
from unobase import models as unobase_models
from unobase.support import constants
class Case(unobase_models.TagOnlyContentModel):
status = models.PositiveSmallIntegerField(choices=constants.CASE_STATUS_CHOICES, default=constants.CASE_STATUS_NEW)
origin = m... | {
"repo_name": "unomena/unobase",
"path": "unobase/support/models.py",
"copies": "1",
"size": "1060",
"license": "bsd-3-clause",
"hash": 5514302832654666000,
"line_mean": 49.5238095238,
"line_max": 151,
"alpha_frac": 0.7858490566,
"autogenerated": false,
"ratio": 3.925925925925926,
"config_test"... |
__author__ = 'michael'
from django import forms
from unobase import constants
from unobase.forms import Content
from unobase.forum import models
class ForumCategory(Content):
class Meta(Content.Meta):
model = models.ForumCategory
fields = Content.Meta.fields + ['forum']
def __init__(self, *a... | {
"repo_name": "unomena/unobase",
"path": "unobase/forum/forms.py",
"copies": "1",
"size": "2511",
"license": "bsd-3-clause",
"hash": 7283860970124310000,
"line_mean": 30.7974683544,
"line_max": 64,
"alpha_frac": 0.6188769415,
"autogenerated": false,
"ratio": 3.9543307086614172,
"config_test": f... |
__author__ = 'michael'
from django import forms
import collections
class PollAnswerForm(forms.Form):
def __init__(self, *args, **kwargs):
super(PollAnswerForm, self).__init__(*args, **kwargs)
self.poll = kwargs['initial'].get('poll')
if self.poll is not None:
... | {
"repo_name": "unomena/unobase",
"path": "unobase/poll/forms.py",
"copies": "1",
"size": "1184",
"license": "bsd-3-clause",
"hash": -4941571686760049000,
"line_mean": 32.8571428571,
"line_max": 142,
"alpha_frac": 0.5836148649,
"autogenerated": false,
"ratio": 4.501901140684411,
"config_test": f... |
__author__ = 'michael'
from django import forms
import models
from unobase import models as unobase_models
class BulkSelectedMixin(forms.Form):
"""
Mixin form used for bulk actions, used to determine bulk selected users.
"""
selected = forms.CharField(
widget=forms.HiddenInput(),
)
... | {
"repo_name": "unomena/unobase",
"path": "unobase/tagging/forms.py",
"copies": "1",
"size": "1938",
"license": "bsd-3-clause",
"hash": -5411255308559924000,
"line_mean": 26.7,
"line_max": 85,
"alpha_frac": 0.5608875129,
"autogenerated": false,
"ratio": 3.9470468431771892,
"config_test": false,
... |
__author__ = 'michael'
from django.views import generic as generic_views
from django.http import Http404, HttpResponse
from django.contrib.contenttypes.models import ContentType
from django.contrib import messages
from django.shortcuts import get_object_or_404
from unobase import mixins as unobase_mixins
from unobase... | {
"repo_name": "unomena/unobase",
"path": "unobase/commenting/views.py",
"copies": "1",
"size": "3545",
"license": "bsd-3-clause",
"hash": -338909228211501700,
"line_mean": 40.7058823529,
"line_max": 153,
"alpha_frac": 0.6059238364,
"autogenerated": false,
"ratio": 4.220238095238095,
"config_tes... |
__author__ = 'michael'
from django.views import generic as generic_views
from django.shortcuts import get_object_or_404
from django.conf import settings
from unobase import views as unobase_views
from unobase import mixins as unobase_mixins
from unobase.email_tracking import models, forms
class OutboundEmailList(uno... | {
"repo_name": "unomena/unobase",
"path": "unobase/email_tracking/views.py",
"copies": "1",
"size": "1138",
"license": "bsd-3-clause",
"hash": 8572377809782028000,
"line_mean": 32.5,
"line_max": 107,
"alpha_frac": 0.7135325132,
"autogenerated": false,
"ratio": 3.7311475409836063,
"config_test": ... |
__author__ = 'michael'
from django.views import generic as generic_views
from django.shortcuts import get_object_or_404
from django.contrib import messages
from unobase.support import models, signals
from unobase import mixins
class CaseCreate(generic_views.CreateView):
def get_initial(self):
return {'u... | {
"repo_name": "unomena/unobase",
"path": "unobase/support/views.py",
"copies": "1",
"size": "1198",
"license": "bsd-3-clause",
"hash": 2790120170028770300,
"line_mean": 32.3055555556,
"line_max": 132,
"alpha_frac": 0.7278797997,
"autogenerated": false,
"ratio": 3.6636085626911314,
"config_test"... |
__author__ = 'michael'
from django.views import generic as generic_views
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from unobase.views import ListWithDetailView
from unobase.forum import models
from unobase import mixins, ... | {
"repo_name": "unomena/unobase",
"path": "unobase/forum/views.py",
"copies": "1",
"size": "6607",
"license": "bsd-3-clause",
"hash": 1051917726224052000,
"line_mean": 32.2010050251,
"line_max": 119,
"alpha_frac": 0.6723172393,
"autogenerated": false,
"ratio": 3.7625284738041,
"config_test": fal... |
__author__ = 'Michael'
from gensim.models import Word2Vec
import EmotionSynsets
import numpy as np
#Get the most likely emotion for a given word vector:
def get_most_likely_emotion(vector_synsets, emotion_labels, word_vector, strategy='average'):
if strategy == 'average':
dist = float('Inf')
curre... | {
"repo_name": "MichSchli/EmoticonSynonyms",
"path": "EmotionMatching.py",
"copies": "1",
"size": "1072",
"license": "mit",
"hash": 4947081966648005000,
"line_mean": 30.5294117647,
"line_max": 124,
"alpha_frac": 0.6305970149,
"autogenerated": false,
"ratio": 3.4249201277955272,
"config_test": fa... |
__author__ = 'Michael'
import codecs
import logging
class Ccedict():
@staticmethod
def splitLine(line):
"""Returns simplified character, pinyin, and definitions in a set"""
if (line.startswith("#")):
return None
pinyin_start = line.find("[")
pinyin_end = line.find... | {
"repo_name": "The80sCalled/flash-card-builder",
"path": "ccedict.py",
"copies": "1",
"size": "2205",
"license": "mit",
"hash": 4379366494735192000,
"line_mean": 28.4,
"line_max": 87,
"alpha_frac": 0.5392290249,
"autogenerated": false,
"ratio": 3.3008982035928143,
"config_test": false,
"has_n... |
__author__ = 'Michael'
import re
import ply.lex as lex
from ply.lex import TOKEN
from MTG import color, card_type
def token_from_enum(enum_class, token_name):
def tok_fun(t):
t.value = enum_class[t.value.upper()]
return t
tok_fun.__doc__ = r'|'.join(item.name for item in list(enum_class))
... | {
"repo_name": "murgatroid99/Python-MTG",
"path": "parser/lexer.py",
"copies": "1",
"size": "3240",
"license": "mit",
"hash": -408652668797160900,
"line_mean": 22.6569343066,
"line_max": 178,
"alpha_frac": 0.587654321,
"autogenerated": false,
"ratio": 2.3461259956553224,
"config_test": false,
... |
import BaseHTTPServer
import urlparse
import json
import requests
from random import randint
"""createds the server we will be using"""
def run_while_true(server_class=BaseHTTPServer.HTTPServer, handler_class=BaseHTTPServer.BaseHTTPRequestHandler):
server_address = ('',#port number required here )
httpd = ser... | {
"repo_name": "miket1113/Meeseeksbot",
"path": "bot.py",
"copies": "1",
"size": "4213",
"license": "apache-2.0",
"hash": 1444643688085459200,
"line_mean": 39.5096153846,
"line_max": 143,
"alpha_frac": 0.5570852124,
"autogenerated": false,
"ratio": 3.8901200369344413,
"config_test": false,
"ha... |
from datetime import date
from django.db import connection
from django.contrib import admin
from django.forms.widgets import TextInput
from .models import (
Client, BonusPolicy, Service, Payment, InfoVar, models)
_m_list = [
'Январь',
'Февраль',
'Март',
'Апрель',
'Май',
'Июнь',
'Июль'... | {
"repo_name": "unaxfromsibiria/bonuscardsys",
"path": "src/accounting/admin.py",
"copies": "1",
"size": "3521",
"license": "mit",
"hash": -3837968692500202000,
"line_mean": 22.9305555556,
"line_max": 72,
"alpha_frac": 0.5696459663,
"autogenerated": false,
"ratio": 3.477295660948537,
"config_tes... |
from enum import Enum
from .common import Command, MetaOnceObject
from .protocol import CommandTargetType, Protocol
class WorkerStatusEnum(Enum):
free = 1
busy = 2
class Worker(object):
_status = None
_index = -1
def __init__(self, index):
self._status = WorkerStatusEnum.free
... | {
"repo_name": "unaxfromsibiria/roolet",
"path": "clients/python3/roolet/processing.py",
"copies": "1",
"size": "2843",
"license": "mit",
"hash": -1721868649668331300,
"line_mean": 25.3240740741,
"line_max": 86,
"alpha_frac": 0.5930355259,
"autogenerated": false,
"ratio": 4.044096728307254,
"con... |
import asyncio
from functools import wraps
from .client import Connection, ServerError
from .common import (
Configuration, MethodRegistry)
from .enums import GroupConnectionEnum
from .transport import Command, Answer, UnitBuilder, encoding
_defult_reconnect_time = 2.5
read_buffer_size = 8 * 1024
class NotR... | {
"repo_name": "unaxfromsibiria/roolet",
"path": "clients/python3/libroolet/server.py",
"copies": "1",
"size": "8971",
"license": "mit",
"hash": -8348260992228645000,
"line_mean": 29.1040268456,
"line_max": 76,
"alpha_frac": 0.5566826441,
"autogenerated": false,
"ratio": 4.261757719714964,
"conf... |
import base64
import json
import pickle
from .enums import AnswerErrorCode, ProcCmdType
JSON_RPC_VERSION = '2.0'
# TODO: replace from options
encoding = "utf-8"
def _b64_convert(content):
return (content or b'').decode(encoding)
class DataFormatError(Exception):
def __init__(self, base_err):
if ... | {
"repo_name": "unaxfromsibiria/roolet",
"path": "clients/python3/libroolet/transport.py",
"copies": "1",
"size": "8428",
"license": "mit",
"hash": 7692461818809760000,
"line_mean": 25.9265175719,
"line_max": 79,
"alpha_frac": 0.5246796393,
"autogenerated": false,
"ratio": 4.0422062350119905,
"c... |
import base64
import pickle
import socket
import time
from uuid import uuid4
from random import SystemRandom
from .config import Configuration, LoggerWrapper
from .common import CommandBuilder, Command
from .exceptions import ExecuteError
from .protocol import CommandTargetType, auth_request, ServiceGroup
class Cli... | {
"repo_name": "unaxfromsibiria/roolet",
"path": "clients/python3/roolet/client.py",
"copies": "1",
"size": "6536",
"license": "mit",
"hash": 3905339770819787300,
"line_mean": 33.0416666667,
"line_max": 87,
"alpha_frac": 0.513004896,
"autogenerated": false,
"ratio": 4.535739070090215,
"config_te... |
import hashlib
from django.db import models
from django.core.cache import cache
from django.utils.timezone import now as datetime_now
class BonusPolicy(models.Model):
begin = models.DateField('Начало действия', db_index=True)
end = models.DateField('Окончание действия', db_index=True)
limit = models.Deci... | {
"repo_name": "unaxfromsibiria/bonuscardsys",
"path": "src/accounting/models.py",
"copies": "1",
"size": "5060",
"license": "mit",
"hash": -3026477317798516700,
"line_mean": 30.1052631579,
"line_max": 113,
"alpha_frac": 0.5888324873,
"autogenerated": false,
"ratio": 3.0562378797672913,
"config_... |
import json
from .helpers import method_path, str_data
from .protocol import CommandTargetType
class MetaOnceObject(type):
"""
Once system object.
"""
_classes = dict()
def __call__(self, *args, **kwargs):
cls = str(self)
if cls not in self._classes:
this = super().... | {
"repo_name": "unaxfromsibiria/roolet",
"path": "clients/python3/roolet/common.py",
"copies": "1",
"size": "2928",
"license": "mit",
"hash": -3870884890975893500,
"line_mean": 24.0256410256,
"line_max": 65,
"alpha_frac": 0.4818989071,
"autogenerated": false,
"ratio": 4.249637155297533,
"config_... |
import logging
import json
import hashlib
from django.conf import settings
from django.core.cache import cache
from django.db.models import Q
from django.http.response import JsonResponse
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView, View
from django.utils.timezon... | {
"repo_name": "unaxfromsibiria/bonuscardsys",
"path": "src/accounting/views.py",
"copies": "1",
"size": "9914",
"license": "mit",
"hash": 4877246155884335000,
"line_mean": 28.9847094801,
"line_max": 80,
"alpha_frac": 0.5273839878,
"autogenerated": false,
"ratio": 4.107666527021366,
"config_test... |
import logging
import json
import os
import sys
import traceback
from .common import MetaOnceObject
from .exceptions import ConfigError
ENV_PATH_VAR = 'ROOLET_CONF'
def _exception_to_err(err):
if isinstance(err, Exception):
err = '{}: {}\n{}'.format(
err.__class__.__name__,
err,... | {
"repo_name": "unaxfromsibiria/roolet",
"path": "clients/python3/roolet/config.py",
"copies": "1",
"size": "4043",
"license": "mit",
"hash": -2439100214533937700,
"line_mean": 26.5034013605,
"line_max": 79,
"alpha_frac": 0.5364828098,
"autogenerated": false,
"ratio": 3.757434944237918,
"config_... |
import logging
import string
from enum import Enum
from hashlib import sha256, md5
from random import SystemRandom
_cr_methods = {
'sha256': sha256,
'md5': md5,
}
class ServiceGroup(Enum):
service = 1
server = 2
web = 3
class CommandTargetType(Enum):
exit = 0
auth_request = 1
auth ... | {
"repo_name": "unaxfromsibiria/roolet",
"path": "clients/python3/roolet/protocol.py",
"copies": "1",
"size": "3120",
"license": "mit",
"hash": 1693316480392965600,
"line_mean": 24.7851239669,
"line_max": 78,
"alpha_frac": 0.6413461538,
"autogenerated": false,
"ratio": 3.777239709443099,
"config... |
import signal
import socket
import time
import weakref
from threading import Thread
from .config import Configuration, LoggerWrapper
from .common import CommandBuilder
from .processing import CommandExecuter, WorkerStatusEnum
class ManageAdapter(object):
service_methods = {}
_cid = None
def __init__(s... | {
"repo_name": "unaxfromsibiria/roolet",
"path": "clients/python3/roolet/server.py",
"copies": "1",
"size": "8204",
"license": "mit",
"hash": -4134541008541506600,
"line_mean": 31.2992125984,
"line_max": 81,
"alpha_frac": 0.4720867869,
"autogenerated": false,
"ratio": 5.020807833537332,
"config_... |
import string
from decimal import Decimal
from django.db import transaction
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.http import HttpResponsePermanentRedirect
from functools import wraps
from random import SystemRandom
from . import ... | {
"repo_name": "unaxfromsibiria/bonuscardsys",
"path": "src/accounting/helpers.py",
"copies": "1",
"size": "4504",
"license": "mit",
"hash": 1560812594907399700,
"line_mean": 26.2195121951,
"line_max": 75,
"alpha_frac": 0.5900537634,
"autogenerated": false,
"ratio": 3.8088737201365186,
"config_t... |
__author__ = 'Michael Wagner'
__version__ = '1.0'
from cab.global_constants import GlobalConstants
class GC(GlobalConstants):
def __init__(self):
super().__init__()
self.VERSION = '03-2016'
self.TITLE = 'Urban Development simulation'
self.GUI = "PyGame" # Options: "None", TK", "P... | {
"repo_name": "Micutio/CAB_Simulations",
"path": "UrbanDevelopment/ud_global_constants.py",
"copies": "1",
"size": "1313",
"license": "mit",
"hash": -6906006696620994000,
"line_mean": 34.4864864865,
"line_max": 61,
"alpha_frac": 0.4150799695,
"autogenerated": false,
"ratio": 4.235483870967742,
... |
__author__ = 'Michael Zoorob'
# Description: Checks if questions in codebook are in text file questionnaires
# Input: List of question codes as csv file, surveys as text files in folder
# Output: CSV File with Question Codes as column 1 and the text of questions in subsequent columns
from gibberishclassifier import c... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "QMatrix/get_questions.py",
"copies": "1",
"size": "6243",
"license": "cc0-1.0",
"hash": 5360471323204009000,
"line_mean": 40.3443708609,
"line_max": 105,
"alpha_frac": 0.4571520103,
"autogenerated": false,
"ratio": 4.30551724137931,
"config_test"... |
__author__ = 'Michael Zoorob'
# Description: Checks if questions in codebook are in text file questionnaires
# Input: List of question codes, surveys as text files in folder
# Output: CSV File with Question Codes as column 1 and "Si/no" for all subsequent columns
import csv
import re
import os
class QuestionsMatrix... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "QMatrix/Question_Code_Finder.py",
"copies": "1",
"size": "2476",
"license": "cc0-1.0",
"hash": 7636251375428191000,
"line_mean": 36.5151515152,
"line_max": 89,
"alpha_frac": 0.5936995153,
"autogenerated": false,
"ratio": 3.63582966226138,
"config... |
__author__ = 'Michael Zoorob'
# File name: Survey_Checker.py
# Author: Michael Zoorob
# VUnetid: zoorobmj
# Email: michael.j.zoorob@vanderbilt.edu
# Description: Read in a survey data in csv format and ensure equal range and type
import csv
import os
# Static weight definitions
# these values come from Stata
MISS... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "QMatrix/Survey_Audit.py",
"copies": "1",
"size": "7533",
"license": "cc0-1.0",
"hash": 339591222857762200,
"line_mean": 35.2163461538,
"line_max": 127,
"alpha_frac": 0.5234302403,
"autogenerated": false,
"ratio": 4.196657381615599,
"config_test":... |
__author__ = 'Michal Kosinski'
SAMPLE_RESPONSE = {u'data': {u'charts': [],
u'dateFormat': u'H:00',
u'series': [{u'aggType': u'A1h',
u'avg': {u'avg': 11.05991,
u'max': u'17.9875',
u'min': u'7.25505'},
... | {
"repo_name": "mkos/krk-poll",
"path": "samples.py",
"copies": "1",
"size": "18804",
"license": "mit",
"hash": 5493280235892818000,
"line_mean": 51.8230337079,
"line_max": 79,
"alpha_frac": 0.3000425441,
"autogenerated": false,
"ratio": 4.289233576642336,
"config_test": false,
"has_no_keyword... |
import base64
import os
import binaryninja as bn
class Metadata:
def __init__(self, meta_location):
self.data = self.read_metadata_dict(meta_location)
self.sim_hash_meta_location = meta_location
def read_metadata_dict(self, meta_location):
data = {}
if os.path.isfile(meta_location):
with ... | {
"repo_name": "googleprojectzero/functionsimsearch",
"path": "pybindings/binary_ninja_plugin/modules/metadata.py",
"copies": "1",
"size": "2419",
"license": "apache-2.0",
"hash": 2522594356082390500,
"line_mean": 33.0704225352,
"line_max": 147,
"alpha_frac": 0.5874328235,
"autogenerated": false,
... |
__author__ = 'michal'
from django.core.management.base import CommandError, BaseCommand
from django.conf import settings
from django.contrib.auth import get_user_model
from locksmith.models import Key, LocksmithMixin, KeyChain
import datetime
from optparse import make_option
class Command(BaseCommand):
can_import_... | {
"repo_name": "MichalMazurek/django-locksmith",
"path": "locksmith/management/commands/user_keys.py",
"copies": "1",
"size": "2575",
"license": "mit",
"hash": 7500222539849107000,
"line_mean": 34.2739726027,
"line_max": 79,
"alpha_frac": 0.5277669903,
"autogenerated": false,
"ratio": 4.2774086378... |
__author__ = 'Michal'
# Hexadecimal Numbers
#
# In this exercise you will write a lexical analyzer that breaks strings up
# into whitespace-separated identifiers and numbers. An identifier is a
# sequence of one or more upper- or lower-case letters. In this exercise,
# however, there are two types of numbers: decimal n... | {
"repo_name": "MFry/BowserBrowser",
"path": "lexers/lexerTest1.py",
"copies": "1",
"size": "4529",
"license": "mit",
"hash": 8380148733776878000,
"line_mean": 31.3571428571,
"line_max": 78,
"alpha_frac": 0.6679178627,
"autogenerated": false,
"ratio": 3.2938181818181818,
"config_test": true,
"... |
__author__ = 'michal'
from django.shortcuts import redirect
from django.core.exceptions import PermissionDenied
from django.http.response import HttpResponseForbidden
from .models import Key, K
import json
def key_required(key_name, redirect_url=None, json_response={}):
"""
Checks if the logged user as acces... | {
"repo_name": "MichalMazurek/django-locksmith",
"path": "locksmith/decorators.py",
"copies": "1",
"size": "1757",
"license": "mit",
"hash": -7106912138425202000,
"line_mean": 31.5555555556,
"line_max": 70,
"alpha_frac": 0.5520774047,
"autogenerated": false,
"ratio": 4.977337110481586,
"config_t... |
__author__ = 'michal'
from os.path import expanduser
from os.path import join
import os
from datetime import datetime
import pynotify
import duptool
def main():
default_log_dir = join(expanduser("~"), '.duptool')
log_files = filter(lambda x: 'log' in x, os.listdir(default_log_dir))
log_files = filter(lam... | {
"repo_name": "starsky/duptool",
"path": "bin/duptool_notification.py",
"copies": "1",
"size": "1253",
"license": "mit",
"hash": 738430306660941600,
"line_mean": 35.8823529412,
"line_max": 115,
"alpha_frac": 0.5786113328,
"autogenerated": false,
"ratio": 3.58,
"config_test": false,
"has_no_ke... |
__author__ = 'Michal'
# Problem Statement:
# Email Addresses & Spam
#
# In this assignment you will write Python code to to extract email
# addresses from a string of text. To avoid unsolicited commercial email
# (commonly known as "spam"), users sometimes add the text NOSPAM to an
# other-wise legal email address, tru... | {
"repo_name": "MFry/BowserBrowser",
"path": "lexers/emailAddressLexer.py",
"copies": "1",
"size": "4033",
"license": "mit",
"hash": -3779230253194684400,
"line_mean": 35.3333333333,
"line_max": 221,
"alpha_frac": 0.695016117,
"autogenerated": false,
"ratio": 2.989621942179392,
"config_test": fa... |
_author__ = 'Michal Smyk'
import numpy.matlib
import random
import sys
import time
import math
import Pyro4
class ClientClass:
def __init__(self, port_number):
self.array = None
self.block_count = None
self.block_size = None
self.servers = None
self.machine_number = 0
... | {
"repo_name": "Azkel/Distributed-Matrix-Multiplication-In-Python",
"path": "src/client.py",
"copies": "1",
"size": "5484",
"license": "mit",
"hash": 2731538288979882000,
"line_mean": 38.1714285714,
"line_max": 102,
"alpha_frac": 0.5665572575,
"autogenerated": false,
"ratio": 3.753593429158111,
... |
_author__ = 'Michal Smyk'
import numpy.matlib
import time
import Pyro4
import sys
class MatrixProcessing:
def __init__(self):
self.matrix = None
self.matrix_a = None
self.matrix_b = None
def set_matrix_a(self, new_matrix_a):
self.matrix_a = new_matrix_a
def set_matrix_b... | {
"repo_name": "Azkel/Distributed-Matrix-Multiplication-In-Python",
"path": "src/server.py",
"copies": "1",
"size": "1295",
"license": "mit",
"hash": -2465716295423578000,
"line_mean": 21.3275862069,
"line_max": 86,
"alpha_frac": 0.5637065637,
"autogenerated": false,
"ratio": 3.381201044386423,
... |
import pandas as pd
import openpyxl
WD_report_name = "EXP031-RPT-Process-Accruals_with_Expense_Report.xlsx"
AP_account = 25702400 # the account from which the money will flow
def load_workbook(file_name, sheetname=None, skiprows=None):
if skiprows:
try:
wb = pd.read_excel(file_na... | {
"repo_name": "Trymzet/accruals_script",
"path": "main.py",
"copies": "1",
"size": "5387",
"license": "unlicense",
"hash": 3936061015975751000,
"line_mean": 39.4538461538,
"line_max": 175,
"alpha_frac": 0.6632634119,
"autogenerated": false,
"ratio": 3.360573923892701,
"config_test": false,
"h... |
import openpyxl
import pandas as pd
import xml.etree.ElementTree as ElementTree
from zipfile import ZipFile
from urllib.request import urlopen, urlretrieve
from datetime import datetime
from os import remove
from numpy import array
pd.options.mode.chained_assignment = None
# for testing
try:
remove("... | {
"repo_name": "Trymzet/Upload_rates",
"path": "Upload_Rates_v0.5.py",
"copies": "1",
"size": "10519",
"license": "unlicense",
"hash": 5937367385547046000,
"line_mean": 40.9346938776,
"line_max": 123,
"alpha_frac": 0.6445479608,
"autogenerated": false,
"ratio": 3.011451474377326,
"config_test": ... |
import xml.etree.ElementTree as ElementTree
from openpyxl import load_workbook
from zipfile import ZipFile
from urllib.request import urlopen
from urllib.request import urlretrieve
from datetime import datetime
from os import remove
from os.path import exists
from os import makedirs
from time import sleep
f... | {
"repo_name": "Trymzet/Upload_rates",
"path": "Upload_Rates_v1.0.py",
"copies": "1",
"size": "14594",
"license": "unlicense",
"hash": -9034927255668628000,
"line_mean": 39.9310344828,
"line_max": 127,
"alpha_frac": 0.6019736842,
"autogenerated": false,
"ratio": 3.123956326268465,
"config_test":... |
"""Author: Michal Zmuda
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
Brings up a set of cluster-worker nodes. They can create separate clusters.
"""
import os
from . import docker, common, worker, gui, panel, location_service_bootstrap
def up(image, bindi... | {
"repo_name": "kliput/onezone-gui",
"path": "bamboos/docker/environment/zone_worker.py",
"copies": "1",
"size": "4713",
"license": "mit",
"hash": 5667923215526122000,
"line_mean": 41.0803571429,
"line_max": 132,
"alpha_frac": 0.6148949714,
"autogenerated": false,
"ratio": 3.8069466882067853,
"c... |
"""Author: Michal Zmuda
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
Brings up a set of oneprovider worker nodes. They can create separate clusters.
"""
import os
import subprocess
import sys
from . import common, docker, worker, gui
def up(image, bindir... | {
"repo_name": "kliput/onezone-gui",
"path": "bamboos/docker/environment/provider_worker.py",
"copies": "1",
"size": "8992",
"license": "mit",
"hash": 1190178535332991200,
"line_mean": 45.3505154639,
"line_max": 101,
"alpha_frac": 0.5451512456,
"autogenerated": false,
"ratio": 4.2235791451385625,
... |
from helpers.loader import Loader
import matplotlib
import matplotlib.pyplot as plt
class spinePercentual(object):
def __init__(self):
self.soma_radius = 8
self.prox_ex = self.soma_radius + 20
self.mid_ex = self.prox_ex + 20
self.dist_ex = self.mid_ex + 190
def reduce_n... | {
"repo_name": "mattions/TimeScales",
"path": "branch_dist/calc_spine_pos.py",
"copies": "1",
"size": "2410",
"license": "bsd-3-clause",
"hash": -421273497843751400,
"line_mean": 30.3116883117,
"line_max": 70,
"alpha_frac": 0.5473029046,
"autogenerated": false,
"ratio": 3.5598227474150663,
"conf... |
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
from helpers.loader import Loader
try:
import ecellControl.ecellManager as eC
except ImportError:
pass
class StimulPlotter():
"""Helps to plot stimuli"""
def __init__(self):
pass
def build_stimul_vec(self,... | {
"repo_name": "mattions/TimeScales",
"path": "helpers/plotter.py",
"copies": "1",
"size": "11026",
"license": "bsd-3-clause",
"hash": -6931778825019635000,
"line_mean": 36.3762711864,
"line_max": 159,
"alpha_frac": 0.5436241611,
"autogenerated": false,
"ratio": 3.4030864197530866,
"config_test"... |
import os
import cPickle
import datetime
import numpy
class Loader(object):
def __init__(self):
self.dirRoot = None
def create_new_dir(self, prefix="./", root="Data"):
"""
Create the directory where to put the simulation
"""
self.dirRoot... | {
"repo_name": "mattions/TimeScales",
"path": "helpers/loader.py",
"copies": "1",
"size": "3230",
"license": "bsd-3-clause",
"hash": 4024648154683213300,
"line_mean": 30.6764705882,
"line_max": 72,
"alpha_frac": 0.5625386997,
"autogenerated": false,
"ratio": 3.953488372093023,
"config_test": fal... |
import pylab
import numpy as np
from numpy import sin, exp
import matplotlib.pyplot as plt
from helpers.loader import Loader
class FitHandler(object):
"""Fit the data with a polynomial"""
def fit(self, data, terms):
polycoeffs = np.polyfit(data.x, data.y, terms)
poly = np.poly1d(poly... | {
"repo_name": "mattions/TimeScales",
"path": "branch_dist/import_digitezed_data.py",
"copies": "1",
"size": "4254",
"license": "bsd-3-clause",
"hash": 7612434428335530000,
"line_mean": 27.9455782313,
"line_max": 82,
"alpha_frac": 0.584861307,
"autogenerated": false,
"ratio": 3.5509181969949917,
... |
import math
from neuron import h, nrn
import ecellControl as eC
from synapse import Synapse
import logging
logger = logging.getLogger(__name__)
class Spine():
"""
Class spine. Create a spine with head neck and psd
"""
def __init__(self, id, filename_bioch_mod, big_spine):
""" Create a s... | {
"repo_name": "mattions/TimeScales",
"path": "neuronControl/spine.py",
"copies": "1",
"size": "8023",
"license": "bsd-3-clause",
"hash": 5398830340628136000,
"line_mean": 33.5818965517,
"line_max": 98,
"alpha_frac": 0.5448086751,
"autogenerated": false,
"ratio": 3.5204036858271173,
"config_test... |
from neuron import h
class Synapse(object):
"""Synapse object class. Usually created in the spine"""
def __init__(self, chan_type, section, position=0.5):
self.chan_type = chan_type
self.section = section
self.chan = self.create_channel(chan_type, position)
self.v... | {
"repo_name": "mattions/TimeScales",
"path": "neuronControl/synapse.py",
"copies": "1",
"size": "3819",
"license": "bsd-3-clause",
"hash": -7798845604383563000,
"line_mean": 38.381443299,
"line_max": 92,
"alpha_frac": 0.558261325,
"autogenerated": false,
"ratio": 3.8343373493975905,
"config_tes... |
import neuron
from neuron import h
import numpy
import os
import sys
from spine import *
from synapse import Synapse
from helpers.loader import Loader
class Event():
"""Event will be added to the cvode queue list"""
def __init__(self, eventTime, cvode, nrnSim):
self.eventTime = eventTime
sel... | {
"repo_name": "mattions/TimeScales",
"path": "neuronControl/nrnManager.py",
"copies": "1",
"size": "8555",
"license": "bsd-3-clause",
"hash": -7377927027054644000,
"line_mean": 37.3677130045,
"line_max": 108,
"alpha_frac": 0.5048509643,
"autogenerated": false,
"ratio": 3.5176809210526314,
"conf... |
class Stimul(object):
"""Store the inputs we are going to deliver to the different synapses"""
def __init__(self, time, number, interval, chan_type, noise=0):
"""
Initialize the stimul class
Params:
time: first time the input is deployed, in seconds
number: numb... | {
"repo_name": "mattions/TimeScales",
"path": "neuronControl/stimul.py",
"copies": "1",
"size": "1390",
"license": "bsd-3-clause",
"hash": -823848398833323100,
"line_mean": 32.9268292683,
"line_max": 87,
"alpha_frac": 0.564028777,
"autogenerated": false,
"ratio": 3.861111111111111,
"config_test"... |
import os
import logging
FORMAT = '%(levelname)s %(name)s %(lineno)s %(message)s'
if os.environ.has_key('DEBUG'):
logging.basicConfig(level=logging.DEBUG, format=FORMAT)
else:
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
import numpy as np
import math
import ... | {
"repo_name": "mattions/TimeScales",
"path": "spineIntegration.py",
"copies": "1",
"size": "21242",
"license": "bsd-3-clause",
"hash": 7839145878780893000,
"line_mean": 42.0872210953,
"line_max": 113,
"alpha_frac": 0.5064024103,
"autogenerated": false,
"ratio": 4.0253932158423344,
"config_test"... |
__author__ = 'Michel Llorens'
__email__ = "mllorens@dcc.uchile.cl"
class Stack:
def __init__(self, delta):
self.stack = list()
self.DELTA = delta
return
def push(self, face):
self.stack.append(face)
return
def pop(self):
if not self.empty():
ret... | {
"repo_name": "Michotastico/CC5501-1",
"path": "tools/structures/Stack.py",
"copies": "1",
"size": "1932",
"license": "apache-2.0",
"hash": -7251934687552672000,
"line_mean": 26.6,
"line_max": 83,
"alpha_frac": 0.4798136646,
"autogenerated": false,
"ratio": 3.8106508875739644,
"config_test": fa... |
__author__ = 'Michel Llorens'
__email__ = "mllorens@dcc.uchile.cl"
from MathMethods import *
from tools.structures import TriangularFace, Stack, Edge
class QuickHull:
def __init__(self, cloud, delta):
self.cloud = cloud
self.stack = Stack.Stack(delta)
self.final_faces = list()
ret... | {
"repo_name": "Michotastico/CC5501-1",
"path": "tools/algorithm/QuickHull.py",
"copies": "1",
"size": "5380",
"license": "apache-2.0",
"hash": -319066698039496640,
"line_mean": 31.6060606061,
"line_max": 137,
"alpha_frac": 0.5425650558,
"autogenerated": false,
"ratio": 3.9127272727272726,
"conf... |
__author__ = 'Michel Llorens'
__email__ = "mllorens@dcc.uchile.cl"
from operator import itemgetter
import math
import numpy as np
def obtain_extremes(cloud):
x = (min(cloud, key=itemgetter(0)), max(cloud, key=itemgetter(0)))
y = (min(cloud, key=itemgetter(1)), max(cloud, key=itemgetter(1)))
z = (min(cloud... | {
"repo_name": "Michotastico/CC5501-1",
"path": "tools/algorithm/MathMethods.py",
"copies": "1",
"size": "2688",
"license": "apache-2.0",
"hash": -8213693821347877000,
"line_mean": 27.9032258065,
"line_max": 89,
"alpha_frac": 0.5677083333,
"autogenerated": false,
"ratio": 2.7739938080495357,
"co... |
__author__ = 'Michel Llorens'
__email__ = "mllorens@dcc.uchile.cl"
from tools.algorithm import MathMethods
import numpy as np
class TriangularFace:
def __init__(self, va, vb, vc):
self.vertexA = va
self.vertexB = vb
self.vertexC = vc
self.plane = MathMethods.calculate_triangular_p... | {
"repo_name": "Michotastico/CC5501-1",
"path": "tools/structures/TriangularFace.py",
"copies": "1",
"size": "2046",
"license": "apache-2.0",
"hash": -1524391083095371300,
"line_mean": 25.2307692308,
"line_max": 101,
"alpha_frac": 0.5337243402,
"autogenerated": false,
"ratio": 3.4271356783919598,
... |
__author__ = 'Michel Llorens'
__email__ = "mllorens@dcc.uchile.cl"
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
from tools.algorithm.QuickHull import QuickHull
from tools.algorithm import RandomFactory
import Bottle
import Can
import SpriteBottle
import TwoFigures
#c... | {
"repo_name": "Michotastico/CC5501-1",
"path": "view/example.py",
"copies": "1",
"size": "2642",
"license": "apache-2.0",
"hash": -5024340347201372000,
"line_mean": 21.5811965812,
"line_max": 78,
"alpha_frac": 0.5495836488,
"autogenerated": false,
"ratio": 2.9420935412026727,
"config_test": fal... |
__author__ = 'Michel Llorens'
__email__ = "mllorens@dcc.uchile.cl"
class Edge:
def __init__(self, vertex_a, vertex_b):
self.va = vertex_a
self.vb = vertex_b
def is_equals(self, other_edge):
boolean_va11 = self.va[0] == other_edge.va[0]
boolean_va12 = self.va[1] == other_edge.... | {
"repo_name": "Michotastico/CC5501-1",
"path": "tools/structures/Edge.py",
"copies": "1",
"size": "1346",
"license": "apache-2.0",
"hash": -5422149180615912000,
"line_mean": 31.8292682927,
"line_max": 64,
"alpha_frac": 0.5802377415,
"autogenerated": false,
"ratio": 2.8638297872340424,
"config_t... |
__author__ = 'MICH'
"Compute accuracy for train images"
"Shows predictions that are neither cats nor dogs"
import os
from glob import glob
cats_file = 'data/cats.txt'
dogs_file = 'data/dogs.txt'
predictions_dir = 'data/overfeat_predictions_train_orig/'
# load cat and dog names
cf = open( cats_file )
df = open( dogs... | {
"repo_name": "mblaauw/Kaggle_CatsVsDogs",
"path": "compute_train_acc.py",
"copies": "1",
"size": "1608",
"license": "mit",
"hash": -4817342355180042000,
"line_mean": 22.6470588235,
"line_max": 78,
"alpha_frac": 0.5404228856,
"autogenerated": false,
"ratio": 3.597315436241611,
"config_test": fa... |
__author__ = 'MICH'
import isbndb
import urllib
from bs4 import BeautifulSoup
import pickle
input_list = pickle.load( open( "thr-covers.pickle", "rb" ) )
isbn = list()
author = list()
city = list()
ed = list()
form = list()
lang = list()
lccn = list()
oclcnum = list()
originallang = list()
publisher = list()
title =... | {
"repo_name": "mblaauw/CollectDutchBookFeatures",
"path": "worldcat_api.py",
"copies": "1",
"size": "2481",
"license": "mit",
"hash": 8508452613265222000,
"line_mean": 23.0873786408,
"line_max": 104,
"alpha_frac": 0.4828698106,
"autogenerated": false,
"ratio": 3.9696,
"config_test": false,
"h... |
__author__ = 'MICH'
import re
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy_bl.items import ScrapyBlItem
class BlSpider(BaseSpider):
name = "bl"
allowed_domains = ["boekenliefde.nl"]
start_urls = []
#2543810
for i in range(9999, 2543810):
ne... | {
"repo_name": "mblaauw/scrapy_bl",
"path": "scrapy_bl/spiders/bl_spider.py",
"copies": "1",
"size": "1528",
"license": "mit",
"hash": 8165073750983097000,
"line_mean": 38.1794871795,
"line_max": 99,
"alpha_frac": 0.6053664921,
"autogenerated": false,
"ratio": 3.1635610766045548,
"config_test": ... |
__author__ = 'MICH'
"""
Produce a predictions file for Kaggle from OverFeat predictions on test images
Set your paths below
"""
import os
import csv
import random
from glob import glob
#
cats_file = 'data/cats.txt'
dogs_file = 'data/dogs.txt'
predictions_dir = 'data/overfeat_predictions_test/'
output_file = 'data/pr... | {
"repo_name": "mblaauw/Kaggle_CatsVsDogs",
"path": "predict.py",
"copies": "1",
"size": "1636",
"license": "mit",
"hash": 8159292643878409000,
"line_mean": 23.4179104478,
"line_max": 80,
"alpha_frac": 0.5531784841,
"autogenerated": false,
"ratio": 3.422594142259414,
"config_test": false,
"has... |
__author__ = 'mickeypash'
from django.forms import ModelForm
from django import forms
from django.forms.widgets import RadioSelect, Textarea
from models import *
YES_CHOICES = (('', 'Not Specified'),
('Y', 'Yes'), ('N', 'No')
)
YES_NO_CHOICES = (
('Y', 'Yes'), ('N', 'No')
)
STANDING_CHOICES = (('... | {
"repo_name": "leifos/treconomics",
"path": "treconomics_project/survey/forms.py",
"copies": "1",
"size": "33162",
"license": "mit",
"hash": 6656013981801000000,
"line_mean": 59.7380952381,
"line_max": 220,
"alpha_frac": 0.5563295338,
"autogenerated": false,
"ratio": 4.623170221664576,
"config_... |
__author__ = 'mickeypash'
from nltk import word_tokenize, sent_tokenize
from nltk import ne_chunk_sents
import nltk.data, nltk.tag
tagger = nltk.data.load(nltk.tag._POS_TAGGER)
stop_words = ['Agence France Presse',
'Associated Press',
'Central News Agency (Taiwan)',
'Los Angel... | {
"repo_name": "leifos/treconomics",
"path": "treconomics_project/snippets/nltk_entity_extraction.py",
"copies": "1",
"size": "1407",
"license": "mit",
"hash": 3196382343912538600,
"line_mean": 29.6086956522,
"line_max": 81,
"alpha_frac": 0.6403695807,
"autogenerated": false,
"ratio": 3.752,
"co... |
__author__ = "Microsoft Corporation <ptvshelp@microsoft.com>"
__version__ = "3.0.0.0"
__all__ = ['enable_attach', 'wait_for_attach', 'break_into_debugger', 'settrace', 'is_attached', 'AttachAlreadyEnabledError']
import atexit
import getpass
import os
import os.path
import platform
import socket
import struct
import s... | {
"repo_name": "DonJayamanne/pythonVSCode",
"path": "src/test/pythonFiles/folding/noComments.py",
"copies": "1",
"size": "10654",
"license": "mit",
"hash": 125086595475050480,
"line_mean": 36.3824561404,
"line_max": 146,
"alpha_frac": 0.5715224329,
"autogenerated": false,
"ratio": 4.37356321839080... |
__author__ = 'Miel Donkers <miel.donkers@gmail.com>'
import logging
import urllib
from http import HTTPStatus
from http.server import BaseHTTPRequestHandler
from jinja2 import Environment, PackageLoader, select_autoescape
log = logging.getLogger(__name__)
env = Environment(
loader=PackageLoader('alarmlistener',... | {
"repo_name": "mdonkers/AlarmListener",
"path": "alarmlistener/monitor_request_handler.py",
"copies": "1",
"size": "3449",
"license": "mit",
"hash": 6937400559005150000,
"line_mean": 43.2179487179,
"line_max": 113,
"alpha_frac": 0.6480139171,
"autogenerated": false,
"ratio": 3.978085351787774,
... |
__author__ = 'Miel Donkers <miel.donkers@gmail.com>'
import logging
from sqlalchemy import create_engine, MetaData, Column, Table, Integer, DateTime, select, desc
log = logging.getLogger(__name__)
class EventStore:
"""
The EventStore manages database connections and provides methods to store alarm notific... | {
"repo_name": "mdonkers/AlarmListener",
"path": "alarmlistener/event_store.py",
"copies": "1",
"size": "2342",
"license": "mit",
"hash": -8736775843581586000,
"line_mean": 40.0877192982,
"line_max": 122,
"alpha_frac": 0.6532877882,
"autogenerated": false,
"ratio": 4.521235521235521,
"config_tes... |
_author_ = "Miguel Andres Herrero, Carlos Congosto Sandoval"
import socket
import serial
import time
import RPi.GPIO as GPIO
import os
arduino = serial.Serial('/dev/ttyUSB0',baudrate=9600, timeout=1.0)#establecemos la conexion con el arduino
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)#se crea el socket
s.bin... | {
"repo_name": "carlosCS92/ProyectoSED",
"path": "server.py",
"copies": "1",
"size": "2653",
"license": "mit",
"hash": 6922320893447215000,
"line_mean": 34.8378378378,
"line_max": 116,
"alpha_frac": 0.5109351433,
"autogenerated": false,
"ratio": 3.274074074074074,
"config_test": false,
"has_no... |
from PIL import Image, ImageFont, ImageDraw, ImageTk
import textwrap
try:
from Tkinter import Label
except ImportError:
from tkinter import Label
def truetype_font(font_path, size):
return ImageFont.truetype(font_path, size)
class CustomFont_Label(Label):
def __init__(self, master, text, foregr... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580778_tkinter_custom_fonts/recipe-580778.py",
"copies": "1",
"size": "3327",
"license": "mit",
"hash": 2229123000475494000,
"line_mean": 36.8068181818,
"line_max": 289,
"alpha_frac": 0.6327021341,
"autogenerated": false,
"ratio": 3.422839... |
from rpyc.utils.server import ThreadedServer
from rpyc.utils.classic import DEFAULT_SERVER_PORT
from rpyc.core.service import Service, ModuleNamespace
from rpyc.lib.compat import execute, is_py3k
import sys
import os
import threading
import argparse
EXECUTED_PYTHON_FILE = False
def exec_python(filepath, namesp... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580751_Testing_Tkinter_or_Selenium/recipe-580751.py",
"copies": "1",
"size": "2758",
"license": "mit",
"hash": 3481069412679805000,
"line_mean": 32.6341463415,
"line_max": 135,
"alpha_frac": 0.6584481508,
"autogenerated": false,
"ratio": 3... |
from Tkinter import PhotoImage
from ttk import Label
from PIL import Image, ImageTk
class AnimatedGIF(Label, object):
def __init__(self, master, path, forever=True):
self._master = master
self._loc = 0
self._forever = forever
self._is_running = False
im = Image.ope... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580708_Tkinter_Animated_GIF/recipe-580708.py",
"copies": "1",
"size": "3062",
"license": "mit",
"hash": 5967373970590084000,
"line_mean": 25.3965517241,
"line_max": 86,
"alpha_frac": 0.5581319399,
"autogenerated": false,
"ratio": 3.9006369... |
from rpyc.utils.server import ThreadedServer
from rpyc.utils.classic import DEFAULT_SERVER_PORT
from rpyc.core.service import Service, ModuleNamespace
from rpyc.lib.compat import execute, is_py3k
class PublicService(Service):
exposed_namespace = {}
def on_connect(self):
self._conn._config.update(dic... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580721_Tkinter_remote_debugging/recipe-580721.py",
"copies": "1",
"size": "2780",
"license": "mit",
"hash": -7349060162518643000,
"line_mean": 32.4939759036,
"line_max": 149,
"alpha_frac": 0.6338129496,
"autogenerated": false,
"ratio": 3.9... |
try:
from Tkinter import Label
from ttk import Style
from tkFont import Font, nametofont
except ImportError:
from tkinter import Label
from tkinter.ttk import Style
from tkinter.font import Font, nametofont
def get_background_of_widget(widget):
try:
# We assume first tk widget
... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580774_Tkinter_Link_or_Hyperlink_Button/recipe-580774.py",
"copies": "1",
"size": "2735",
"license": "mit",
"hash": -7297182940632561000,
"line_mean": 26.6262626263,
"line_max": 181,
"alpha_frac": 0.5941499086,
"autogenerated": false,
"rat... |
try:
from Tkinter import Tk, Frame
except ImportError:
from tkinter import Tk, Frame
class Bordered_Frame(Frame):
def __init__(self, master, bordercolor=None, borderleft=0, bordertop=0, borderright=0, borderbottom=0, interiorwidget=Frame, **kwargs):
Frame.__init__(self, master, background=borderco... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580798_Tkinter_frame_different_border/recipe-580798.py",
"copies": "1",
"size": "1202",
"license": "mit",
"hash": -8605046414084793000,
"line_mean": 34.3529411765,
"line_max": 139,
"alpha_frac": 0.6722129784,
"autogenerated": false,
"ratio... |
try:
import Tkinter as tk
except ImportError:
import tkinter as tk
class Placeholder_State(object):
__slots__ = 'normal_color', 'normal_font', 'placeholder_text', 'placeholder_color', 'placeholder_font', 'with_placeholder'
def add_placeholder_to(entry, placeholder, color="grey", font=None):
normal_c... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580768_Tkinter_entry_with_placeholder/recipe-580768.py",
"copies": "1",
"size": "2617",
"license": "mit",
"hash": -6239460690259469000,
"line_mean": 30.9146341463,
"line_max": 127,
"alpha_frac": 0.6473060757,
"autogenerated": false,
"ratio... |
"""
I provide in this module the function "tk_call_async".
"tk_call_async" executes the function "computation" asyncronously with the provided "args" and "kwargs" without blocking the tkinter event loop.
If "callback" is provided, it will be called with the result when the computation is finnished.
If an exception ... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580754_Long_processing_computatiTkinter_or_longrunning_/recipe-580754.py",
"copies": "1",
"size": "4660",
"license": "mit",
"hash": 7870312300003378000,
"line_mean": 32.0496453901,
"line_max": 144,
"alpha_frac": 0.6729613734,
"autogenerated"... |
try:
from Tkinter import Canvas
from Tkconstants import *
except ImportError:
from tkinter import Canvas
from tkinter.constants import *
from PIL import Image, ImageDraw, ImageTk
# Python 2/3 compatibility
try:
basestring
except NameError:
basestring = str
def hex2rgb(str_rgb):
try:
r... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580761_Tkinter_frame_with_gradient/recipe-580761.py",
"copies": "1",
"size": "4149",
"license": "mit",
"hash": 2755327978483286500,
"line_mean": 30.9153846154,
"line_max": 119,
"alpha_frac": 0.5695348277,
"autogenerated": false,
"ratio": 3... |
try:
from Tkinter import Frame, PanedWindow as Tk_PanedWindow
from ttk import Label
from Tkconstants import HORIZONTAL, VERTICAL
except ImportError:
from tkinter import Frame, PanedWindow as Tk_PanedWindow
from tkinter.ttk import Label
from tkinter.constants import HORIZONTAL, VERTICAL
class ... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580728_Tkinter_beautiful_handler_pannedwindow_Similar/recipe-580728.py",
"copies": "1",
"size": "7404",
"license": "mit",
"hash": 5228319313829755000,
"line_mean": 35.6534653465,
"line_max": 224,
"alpha_frac": 0.6206104808,
"autogenerated": ... |
try:
from Tkinter import Text, Frame, Label, PhotoImage, Button
from ttk import Scrollbar
from Tkconstants import *
except ImportError:
from tkinter import Text, Frame, Label, PhotoImage, Button
from tkinter.ttk import Scrollbar
from tkinter.constants import *
class Tag(Frame):
BACKGROU... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580734_Tag_entry_Tkinter_like_Jquery_Tag/recipe-580734.py",
"copies": "1",
"size": "6229",
"license": "mit",
"hash": 4641674941811543000,
"line_mean": 39.9802631579,
"line_max": 713,
"alpha_frac": 0.6419971103,
"autogenerated": false,
"rat... |
try:
from ttk import Treeview, Scrollbar, Frame
from Tkconstants import HORIZONTAL, VERTICAL, N,S,E,W, END
except ImportError:
from tkinter.ttk import Treeview, Scrollbar, Frame
from tkinter.constants import HORIZONTAL, VERTICAL, N,S,E,W, END
import xml.etree.ElementTree as ET
from operator impor... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580752_XML_viewer_Tkinter_or_XML/recipe-580752.py",
"copies": "1",
"size": "5777",
"license": "mit",
"hash": -8328161834761171000,
"line_mean": 29.8930481283,
"line_max": 136,
"alpha_frac": 0.5643067336,
"autogenerated": false,
"ratio": 3.... |
try:
from Tkinter import PhotoImage, Frame, Label, Widget
from Tkconstants import *
except ImportError:
from tkinter import PhotoImage, Frame, Label, Widget
from tkinter.constants import *
class CollapsibleFrame(Frame):
def __init__(self, master, text=None, borderwidth=2, width=0, height=16, inte... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580760_Collpsible_frame_Tkinter_or_Collapsible/recipe-580760.py",
"copies": "1",
"size": "4700",
"license": "mit",
"hash": -5227416740541752000,
"line_mean": 37.2113821138,
"line_max": 201,
"alpha_frac": 0.6487234043,
"autogenerated": false,... |
try:
import Tkinter as tk
import ttk
except ImportError:
import tkinter as tk
from tkinter import ttk
class MouseWheel(object):
def __init__(self, root, factor = 0.5):
self.activeArea = None
self.factor = factor
import platform
os = platform.system()
if os ==... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578874_Tkinter_simultaneous_scrolling/recipe-578874.py",
"copies": "1",
"size": "4697",
"license": "mit",
"hash": -5094684552182288000,
"line_mean": 32.55,
"line_max": 136,
"alpha_frac": 0.6387055567,
"autogenerated": false,
"ratio": 3.5,
... |
import re
import os
try:
from Tkinter import StringVar, Entry, Frame, Listbox, Button, Scrollbar
from Tkconstants import *
except ImportError:
from tkinter import StringVar, Entry, Frame, Listbox, Button, Scrollbar
from tkinter.constants import *
try:
from tkFileDialog import *
except ImportError... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580771_Tkinter_file_autocomplete_entry/recipe-580771.py",
"copies": "1",
"size": "12116",
"license": "mit",
"hash": -1762170118471952400,
"line_mean": 34.1188405797,
"line_max": 208,
"alpha_frac": 0.5396995708,
"autogenerated": false,
"rat... |
try:
import Tkinter as tk
import ttk
import tkFont
from Tkconstants import *
except ImportError:
import tkinter as tk
import tkinter.ttk as ttk
from tkinter import font as tkFont
from tkinter.constants import *
# Python 2 and 3 compatibility
try:
xrange
except NameError:
xran... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580720_Pagination_widget_in_Tkinter/recipe-580720.py",
"copies": "1",
"size": "20673",
"license": "mit",
"hash": -5776504755311518000,
"line_mean": 33.1138613861,
"line_max": 261,
"alpha_frac": 0.5667779229,
"autogenerated": false,
"ratio"... |
import markdown2
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import pyqtSignal as Signal
from pcloudpy.gui.components import customWidgets
def widget_generator(func, parms, text="", only_apply=False):
class TemplateWidget(QWidget):
def __init__(... | {
"repo_name": "mmolero/pcloudpy",
"path": "pcloudpy/gui/components/widgetGenerator.py",
"copies": "1",
"size": "3675",
"license": "bsd-3-clause",
"hash": 1223000901022257400,
"line_mean": 31.5221238938,
"line_max": 90,
"alpha_frac": 0.5270748299,
"autogenerated": false,
"ratio": 4.110738255033557... |
__all__=['ReaderLAS']
import numpy as np
from laspy.file import File as FileLAS
from .base import PointsCloudBase
class ReaderLAS(PointsCloudBase):
"""
Reader for LAS Files
example:
reader = ReaderLAS(filename)
reader.update()
"""
def __init__(self, filename):
super(... | {
"repo_name": "mmolero/pcloudpy",
"path": "pcloudpy/core/io/ReaderLAS.py",
"copies": "1",
"size": "1157",
"license": "bsd-3-clause",
"hash": 3653802784158651400,
"line_mean": 21.6862745098,
"line_max": 66,
"alpha_frac": 0.5522904062,
"autogenerated": false,
"ratio": 3.118598382749326,
"config_t... |
__all__ =['ReaderPLY', 'WriterPLY']
import numpy as np
from vtk import vtkPLYReader, vtkPolyData, vtkPLYWriter
from .base import PolyDataBase
from .converters import get_polydata_from
class ReaderPLY(PolyDataBase):
"""
Reader for PLY Files
example:
reader = ReaderPLY(filename)
reader.u... | {
"repo_name": "mmolero/pcloudpy",
"path": "pcloudpy/core/io/ReaderPLY.py",
"copies": "1",
"size": "1332",
"license": "bsd-3-clause",
"hash": -308046263787257800,
"line_mean": 20.8360655738,
"line_max": 65,
"alpha_frac": 0.6433933934,
"autogenerated": false,
"ratio": 3.906158357771261,
"config_t... |
from matplotlib import mlab
from scipy.interpolate import griddata
def natural_neighbor(x,y,z,xi,yi):
"""
Natural Neighbor Interpolation Method.
Natural neighbor interpolation is a method of spatial interpolation, developed by Robin Sibson.
The method is based on Voronoi tessellation of a discrete s... | {
"repo_name": "mmolero/pcloudpy",
"path": "pcloudpy/core/interpolation.py",
"copies": "1",
"size": "3333",
"license": "bsd-3-clause",
"hash": 1713407732466797300,
"line_mean": 38.2117647059,
"line_max": 195,
"alpha_frac": 0.6849684968,
"autogenerated": false,
"ratio": 3.5232558139534884,
"confi... |
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import pyqtSignal as Signal
from pcloudpy.gui.utils.qhelpers import *
class StandardItem(QStandardItem):
def __init__(self, *args, **kwargs):
super(StandardItem, self).__init__(*args, **kwargs)
... | {
"repo_name": "mmolero/pcloudpy",
"path": "pcloudpy/gui/components/DatasetsWidget.py",
"copies": "1",
"size": "4330",
"license": "bsd-3-clause",
"hash": 6330510648285918000,
"line_mean": 33.373015873,
"line_max": 93,
"alpha_frac": 0.6394919169,
"autogenerated": false,
"ratio": 3.7392055267702937,... |
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import pyqtSignal as Signal
from ..resources_rc import *
from .toolboxTreeWidgetItem import ToolBoxTreeWidgetItem
from .toolboxStandardItem import ToolboxStandardItem
class ToolBoxesWidget(QWidget):
def __init_... | {
"repo_name": "mmolero/pcloudpy",
"path": "pcloudpy/gui/components/ToolboxesWidget.py",
"copies": "1",
"size": "2519",
"license": "bsd-3-clause",
"hash": -6936489871277104000,
"line_mean": 29.7195121951,
"line_max": 128,
"alpha_frac": 0.621278285,
"autogenerated": false,
"ratio": 3.99207606973058... |
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class ObjectInspectorWidget(QWidget):
def __init__(self, parent = None):
super(ObjectInspectorWidget, self).__init__(parent)
layout = QVBoxLayout()
self.tab = QTabWidget()
self.properties_tree = Q... | {
"repo_name": "mmolero/pcloudpy",
"path": "pcloudpy/gui/components/ObjectInspectorWidget.py",
"copies": "1",
"size": "1774",
"license": "bsd-3-clause",
"hash": 2194860421794974700,
"line_mean": 31.8703703704,
"line_max": 76,
"alpha_frac": 0.599210823,
"autogenerated": false,
"ratio": 3.5983772819... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.