text stringlengths 0 1.05M | meta dict |
|---|---|
from emailtrail import calculate_delay, get_path_delay
class TestDelayCalculation():
def test_usual_cases(self):
assert 1 == calculate_delay(1450263874, 1450263873)
assert 0 == calculate_delay(1450263874, 1450263874)
def test_negative_delay_returns_zero(self):
assert 0 == calculate_de... | {
"repo_name": "akshayKMR/emailtrail",
"path": "tests/delay_test.py",
"copies": "1",
"size": "1715",
"license": "mit",
"hash": -1277478190472317400,
"line_mean": 40.8292682927,
"line_max": 342,
"alpha_frac": 0.5690962099,
"autogenerated": false,
"ratio": 3.0140597539543057,
"config_test": false,... |
from emailtrail import extract_from_label, extract_received_by_label, remove_details, extract_protocol
def test_from_label_extraciton():
cases = [
# [input , expected_output]
[
"from mail-vk0-x233.google.com (mail-vk0-x233.google.com. [2607:f8b0:400c:c05::233])\n by mx.google.co... | {
"repo_name": "akshayKMR/emailtrail",
"path": "tests/test_label_extraction.py",
"copies": "1",
"size": "5463",
"license": "mit",
"hash": -401543212367044700,
"line_mean": 44.1487603306,
"line_max": 344,
"alpha_frac": 0.5685520776,
"autogenerated": false,
"ratio": 2.6964461994077,
"config_test":... |
from email.utils import formataddr
from datetime import datetime
import time
from ...ut.time import TIME_DISPLAY_FORMAT
class Wrap(object):
def __init__(self, impl):
self.impl = impl
def __getattr__(self, name):
return getattr(self.impl, name)
def __contains__(self, value):
retu... | {
"repo_name": "Answeror/torabot",
"path": "torabot/mods/feed/types.py",
"copies": "1",
"size": "4589",
"license": "mit",
"hash": 2467592027459857000,
"line_mean": 25.6802325581,
"line_max": 89,
"alpha_frac": 0.6038352582,
"autogenerated": false,
"ratio": 3.9973867595818815,
"config_test": false... |
from email.utils import formataddr
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from flu... | {
"repo_name": "edoburu/fluentcms-emailtemplates",
"path": "fluentcms_emailtemplates/models.py",
"copies": "1",
"size": "6288",
"license": "apache-2.0",
"hash": -2007653347186104300,
"line_mean": 38.7974683544,
"line_max": 146,
"alpha_frac": 0.6657124682,
"autogenerated": false,
"ratio": 4.2258064... |
from email.utils import formataddr
from django.conf import settings
from django.core.mail import get_connection, EmailMultiAlternatives
from django.template.loader import get_template
def send_feedback_mail(user_name, user_email_addr, subject, message, url):
connection = get_connection()
ctx = {
"na... | {
"repo_name": "ebmdatalab/openprescribing",
"path": "openprescribing/frontend/feedback.py",
"copies": "1",
"size": "1323",
"license": "mit",
"hash": 1036870225719203100,
"line_mean": 27.1489361702,
"line_max": 74,
"alpha_frac": 0.6402116402,
"autogenerated": false,
"ratio": 3.7478753541076486,
... |
from email.utils import formatdate, getaddresses
from django.core.mail.message import make_msgid
from django.utils.translation import ugettext_lazy as _
NO_SUBJECT = _(u"(no subject)")
def sanitize_headers(msg):
"""
Set and modify headers on an :class:`email.Message` that need to be there no matter which list th... | {
"repo_name": "melinath/django-kiki",
"path": "kiki/utils/message.py",
"copies": "1",
"size": "2722",
"license": "bsd-2-clause",
"hash": 4737521359982301000,
"line_mean": 29.5842696629,
"line_max": 184,
"alpha_frac": 0.6792799412,
"autogenerated": false,
"ratio": 2.9846491228070176,
"config_tes... |
from email.utils import formatdate
from datetime import datetime, timedelta
from time import mktime
import simplejson, urllib2, base64
from xml.etree import ElementTree as ET
from xml.sax.saxutils import escape
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, Http404
from django.uti... | {
"repo_name": "mollyproject/mollyproject",
"path": "molly/maps/osm/views.py",
"copies": "1",
"size": "2430",
"license": "apache-2.0",
"hash": 6552364501225375000,
"line_mean": 35.8181818182,
"line_max": 123,
"alpha_frac": 0.6670781893,
"autogenerated": false,
"ratio": 3.537117903930131,
"config... |
from email.utils import formatdate
from datetime import datetime, timedelta
from time import mktime
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, Http404
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import NullBreadcrumb
from models import ExternalImageSi... | {
"repo_name": "mollyproject/mollyproject",
"path": "molly/external_media/views.py",
"copies": "1",
"size": "1136",
"license": "apache-2.0",
"hash": -1369907658684317700,
"line_mean": 29.7027027027,
"line_max": 99,
"alpha_frac": 0.6822183099,
"autogenerated": false,
"ratio": 4.04270462633452,
"c... |
from email.Utils import formatdate
from email.mime.text import MIMEText
import smtplib
import sys
from time import time
import traceback
from urlparse import parse_qsl
import MySQLdb as mysql
import sqlalchemy.pool as pool
import commonware.log
from django.core.management import setup_environ
from django.utils.http i... | {
"repo_name": "jbalogh/zamboni",
"path": "services/update.py",
"copies": "1",
"size": "12178",
"license": "bsd-3-clause",
"hash": -578257961997547800,
"line_mean": 35.4610778443,
"line_max": 79,
"alpha_frac": 0.5311216949,
"autogenerated": false,
"ratio": 3.947487844408428,
"config_test": false... |
from email.utils import formatdate
from jinja2 import Environment, PackageLoader
import logging
from multiprocessing import Pool
import os
from . import __version__
from .cache import cached_storage
from .crawler.get_downloadable_talks import get_downloadable_talks
from .crawler.get_supported_subtitle_languages import ... | {
"repo_name": "KerstinYu/metacourse",
"path": "metated/metaTED/metalink.py",
"copies": "2",
"size": "4948",
"license": "apache-2.0",
"hash": -4483689966095308300,
"line_mean": 37.9606299213,
"line_max": 94,
"alpha_frac": 0.6727970897,
"autogenerated": false,
"ratio": 3.5777295733911787,
"config... |
from email.utils import formatdate
from multiprocessing.dummy import Pool as ThreadPool
from time import time
from django.conf import settings
from django.core.cache import cache
from django.core.management import BaseCommand, CommandError
import boto3
import requests
import sentry_sdk
from apscheduler.schedulers.blo... | {
"repo_name": "glogiotatidis/basket",
"path": "basket/news/management/commands/process_fxa_data.py",
"copies": "1",
"size": "6945",
"license": "mpl-2.0",
"hash": 3816687859582053400,
"line_mean": 29.7300884956,
"line_max": 83,
"alpha_frac": 0.5952483801,
"autogenerated": false,
"ratio": 3.5965820... |
from email.utils import formatdate
from pyrake import signals
from pyrake.exceptions import NotConfigured, IgnoreRequest
from pyrake.utils.misc import load_object
class HttpCacheMiddleware(object):
def __init__(self, settings, stats):
if not settings.getbool('HTTPCACHE_ENABLED'):
raise NotCon... | {
"repo_name": "elkingtowa/pyrake",
"path": "pyrake/contrib/downloadermiddleware/httpcache.py",
"copies": "2",
"size": "4327",
"license": "mit",
"hash": 3072181496015891500,
"line_mean": 42.7070707071,
"line_max": 86,
"alpha_frac": 0.6713658424,
"autogenerated": false,
"ratio": 4.29265873015873,
... |
from email.utils import formatdate
from scrapy import signals
from scrapy.exceptions import NotConfigured, IgnoreRequest
from scrapy.utils.misc import load_object
class HttpCacheMiddleware(object):
def __init__(self, settings, stats):
if not settings.getbool('HTTPCACHE_ENABLED'):
raise NotCon... | {
"repo_name": "ramiro/scrapy",
"path": "scrapy/contrib/downloadermiddleware/httpcache.py",
"copies": "5",
"size": "4476",
"license": "bsd-3-clause",
"hash": 8470759322069412000,
"line_mean": 41.6285714286,
"line_max": 86,
"alpha_frac": 0.6668900804,
"autogenerated": false,
"ratio": 4.358325219084... |
from email.utils import formatdate
from time import mktime
from inspect import isfunction
import logging
import itertools
from datetime import datetime, timedelta
from slimmer.slimmer import xhtml_slimmer
from urlparse import urlparse, urlunparse, parse_qs
from urllib import urlencode
import simplejson
from lxml impor... | {
"repo_name": "mollyproject/mollyproject",
"path": "molly/utils/views.py",
"copies": "1",
"size": "21667",
"license": "apache-2.0",
"hash": 2639787908118727700,
"line_mean": 38.9023941068,
"line_max": 88,
"alpha_frac": 0.5741450132,
"autogenerated": false,
"ratio": 4.635643988018828,
"config_te... |
from email.Utils import formatdate
from time import time
from urllib import urlencode
from urlparse import parse_qsl
from compare import version_int
import constants as co
from utils import get_mirror, log, mypool
import settings_local as settings
good_rdf = """<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w... | {
"repo_name": "mozilla/versioncheck",
"path": "versioncheck/update.py",
"copies": "1",
"size": "12022",
"license": "bsd-3-clause",
"hash": 645708369448886800,
"line_mean": 37.4089456869,
"line_max": 78,
"alpha_frac": 0.5185493262,
"autogenerated": false,
"ratio": 4.058744091829845,
"config_test... |
from email.utils import formatdate
from time import time
RSS_20_HEADER = """<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>{title}</title>
<link>{link}</link>
<description>{description}</description>
"""
RSS_20_ITEM = """
<item>
<title>{title}</title>
<link>{li... | {
"repo_name": "flacerdk/smoke-signal",
"path": "utils/generate_feed.py",
"copies": "1",
"size": "2246",
"license": "mit",
"hash": -677182840411568000,
"line_mean": 34.6507936508,
"line_max": 526,
"alpha_frac": 0.5988423865,
"autogenerated": false,
"ratio": 3.2740524781341107,
"config_test": fal... |
from email.utils import formatdate
from twisted.internet import defer
from twisted.internet.error import TimeoutError, DNSLookupError, \
ConnectionRefusedError, ConnectionDone, ConnectError, \
ConnectionLost, TCPTimedOutError
from scrapy import signals
from scrapy.exceptions import NotConfigured, Ignore... | {
"repo_name": "YeelerG/scrapy",
"path": "scrapy/downloadermiddlewares/httpcache.py",
"copies": "117",
"size": "4701",
"license": "bsd-3-clause",
"hash": -3955713133369411000,
"line_mean": 42.5277777778,
"line_max": 90,
"alpha_frac": 0.6687938736,
"autogenerated": false,
"ratio": 4.409943714821764... |
from email.utils import formatdate
from typing import Optional, Type, TypeVar
from twisted.internet import defer
from twisted.internet.error import (
ConnectError,
ConnectionDone,
ConnectionLost,
ConnectionRefusedError,
DNSLookupError,
TCPTimedOutError,
TimeoutError,
)
from twisted.web.clie... | {
"repo_name": "dangra/scrapy",
"path": "scrapy/downloadermiddlewares/httpcache.py",
"copies": "6",
"size": "5481",
"license": "bsd-3-clause",
"hash": -8251904016661386000,
"line_mean": 40.2105263158,
"line_max": 102,
"alpha_frac": 0.6801678526,
"autogenerated": false,
"ratio": 4.381294964028777,
... |
from email.utils import formatdate
import os
from posixpath import normpath
from wsgiref.headers import Headers
from wsgiref.util import FileWrapper
from .media_types import MediaTypes
from .static_file import StaticFile
from .utils import (decode_if_byte_string, decode_path_info,
ensure_leading_tr... | {
"repo_name": "samdowd/drumm-farm",
"path": "drumm_env/lib/python2.7/site-packages/whitenoise/base.py",
"copies": "1",
"size": "6699",
"license": "mit",
"hash": 53179349658904740,
"line_mean": 39.3554216867,
"line_max": 79,
"alpha_frac": 0.6115838185,
"autogenerated": false,
"ratio": 4.0649271844... |
from email.utils import formatdate
from ants import signals
from ants.utils.exceptions import NotConfigured, IgnoreRequest
from ants.utils.misc import load_object
class HttpCacheMiddleware(object):
def __init__(self, settings, stats):
if not settings.getbool('HTTPCACHE_ENABLED'):
raise NotCo... | {
"repo_name": "wcong/ants",
"path": "ants/contrib/downloadermiddleware/httpcache.py",
"copies": "1",
"size": "4326",
"license": "bsd-3-clause",
"hash": 2795144972027178500,
"line_mean": 42.26,
"line_max": 84,
"alpha_frac": 0.6705963939,
"autogenerated": false,
"ratio": 4.304477611940299,
"confi... |
from email.utils import formatdate
from twisted.internet import defer
from twisted.internet.error import (
ConnectError,
ConnectionDone,
ConnectionLost,
ConnectionRefusedError,
DNSLookupError,
TCPTimedOutError,
TimeoutError,
)
from twisted.web.client import ResponseFailed
from scrapy impor... | {
"repo_name": "eLRuLL/scrapy",
"path": "scrapy/downloadermiddlewares/httpcache.py",
"copies": "1",
"size": "4721",
"license": "bsd-3-clause",
"hash": 2347365109910111700,
"line_mean": 39.6982758621,
"line_max": 90,
"alpha_frac": 0.6670196992,
"autogenerated": false,
"ratio": 4.395716945996275,
... |
from email.utils import getaddresses
from django.utils.encoding import force_unicode
from django.core.mail import EmailMessage
class KikiMessage(EmailMessage):
"""
This is similar to a django EmailMessage, but overrides recipients() to return arbitrary recipients rather than a concatenation of the to, cc, and bcc ... | {
"repo_name": "melinath/django-kiki",
"path": "kiki/message.py",
"copies": "1",
"size": "1440",
"license": "bsd-2-clause",
"hash": -5738320406070538000,
"line_mean": 30.3260869565,
"line_max": 163,
"alpha_frac": 0.6680555556,
"autogenerated": false,
"ratio": 3.3410672853828305,
"config_test": f... |
from email.utils import parseaddr
from sqlalchemy import not_, func
from pyramid.view import (
view_config,
)
from pyramid.httpexceptions import (
HTTPFound,
)
import colander
from deform import (
Form,
widget,
ValidationFailure,
)
from ...models import (
DBSession,
User,
Gro... | {
"repo_name": "aagusti/sp2d",
"path": "sp2d/views/admin/user_group.py",
"copies": "1",
"size": "10049",
"license": "mit",
"hash": 2501458581225844000,
"line_mean": 36.6367041199,
"line_max": 97,
"alpha_frac": 0.5450293562,
"autogenerated": false,
"ratio": 4.003585657370518,
"config_test": true,... |
from email.utils import parseaddr
from sqlalchemy import not_
from pyramid.view import (
view_config,
)
from pyramid.httpexceptions import (
HTTPFound,
)
import colander
from deform import (
Form,
widget,
ValidationFailure,
)
from osipkd.models import (
DBSession,
User,
)
fro... | {
"repo_name": "aagusti/o-sipkd",
"path": "osipkd/views/admin/user.py",
"copies": "1",
"size": "7553",
"license": "mit",
"hash": -8695342123390431000,
"line_mean": 30.0823045267,
"line_max": 77,
"alpha_frac": 0.571163776,
"autogenerated": false,
"ratio": 3.7821732598898348,
"config_test": true,
... |
from email.utils import parseaddr
import itertools
import logging
import re
import sys
import urllib
import urlparse
import html5lib
from html5lib.sanitizer import HTMLSanitizer
from html5lib.serializer.htmlserializer import HTMLSerializer
from encoding import force_unicode
from sanitizer import BleachSanitizer
VER... | {
"repo_name": "pcraciunoiu/bleach",
"path": "bleach/__init__.py",
"copies": "1",
"size": "14722",
"license": "bsd-3-clause",
"hash": 3637193332177883600,
"line_mean": 33.8862559242,
"line_max": 95,
"alpha_frac": 0.5472082597,
"autogenerated": false,
"ratio": 3.947975328506302,
"config_test": fa... |
from email.utils import parseaddr
from furl import furl
from waterbutler.core import metadata
class BaseBitbucketMetadata(metadata.BaseMetadata):
"""Metadata properties common to Bitbucket files and folders
*commit*: The commit sha that this metadata snapshot applies to.
The commit may not actually in... | {
"repo_name": "RCOSDP/waterbutler",
"path": "waterbutler/providers/bitbucket/metadata.py",
"copies": "3",
"size": "3797",
"license": "apache-2.0",
"hash": -1792351769566259000,
"line_mean": 24.8299319728,
"line_max": 97,
"alpha_frac": 0.6062681064,
"autogenerated": false,
"ratio": 4.0522945570971... |
from email.utils import parseaddr
from datetime import datetime
from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPFound,
HTTPForbidden,
)
from pyramid.security import (
remember,
forget,
authenticated_userid,
)
import transaction
import colander
from... | {
"repo_name": "aagusti/i-pbb",
"path": "ipbb/views/registers.py",
"copies": "1",
"size": "10009",
"license": "mit",
"hash": -1108954426536665200,
"line_mean": 30.1897106109,
"line_max": 100,
"alpha_frac": 0.5591967229,
"autogenerated": false,
"ratio": 3.862987263604786,
"config_test": true,
"... |
from email.utils import parsedate, formatdate
import os
from posixpath import normpath
import re
from wsgiref.headers import Headers
from .media_types import MediaTypes
from .utils import (ensure_leading_trailing_slash, MissingFileError,
stat_regular_file)
class StaticFile(object):
def __ini... | {
"repo_name": "GiovanniConserva/TestDeploy",
"path": "venv/Lib/site-packages/whitenoise/base.py",
"copies": "1",
"size": "8931",
"license": "bsd-3-clause",
"hash": 4474194668434005000,
"line_mean": 38.6933333333,
"line_max": 79,
"alpha_frac": 0.5997088792,
"autogenerated": false,
"ratio": 4.03023... |
from email.utils import parsedate_to_datetime
from flask import (Blueprint, render_template, redirect, url_for, request,
flash)
from flask_login import login_required
from werkzeug.datastructures import CombinedMultiDict
from fernet import app, db, forms, teknologkoren_se
from fernet.views.auth impor... | {
"repo_name": "teknologkoren/fernet",
"path": "fernet/views/admin.py",
"copies": "1",
"size": "12776",
"license": "mpl-2.0",
"hash": 469105409192232100,
"line_mean": 30.8229426434,
"line_max": 79,
"alpha_frac": 0.5230781287,
"autogenerated": false,
"ratio": 3.888177940280317,
"config_test": fal... |
# from email.utils import parsedate_to_datetime
import re
from datetime import datetime
from kat.harness import Query
from abstract_tests import AmbassadorTest, HTTP, ServiceType
class RetryPolicyTest(AmbassadorTest):
target: ServiceType
def init(self) -> None:
self.target = HTTP()
def config... | {
"repo_name": "datawire/ambassador",
"path": "python/tests/kat/t_retrypolicy.py",
"copies": "1",
"size": "3197",
"license": "apache-2.0",
"hash": 3627338205633974000,
"line_mean": 31.9587628866,
"line_max": 139,
"alpha_frac": 0.6512355333,
"autogenerated": false,
"ratio": 3.45995670995671,
"con... |
from .embedder import Embedder
from .encrypter import Encrypter
class HideIntoPNG():
def hide(self, containerData, payloadMetaData, payloadData, passPhrase):
"""
Embeds data and metadata both encrypted with a passPhrase in a PNG container.
Parameters:
containerData (bin) -- Binary Data of a sample PNG f... | {
"repo_name": "HugoJH/HideIntoPNG",
"path": "hideintopng/hideintopng.py",
"copies": "1",
"size": "1702",
"license": "mit",
"hash": 933221532119984800,
"line_mean": 33.7346938776,
"line_max": 108,
"alpha_frac": 0.759106933,
"autogenerated": false,
"ratio": 3.939814814814815,
"config_test": false... |
from embedding import SVDEmbedding, EnsembleEmbedding, Embedding
from explicit import PositiveExplicit
def create_representation(args):
rep_type = args['<representation>']
path = args['<representation_path>']
neg = int(args['--neg'])
w_c = args['--w+c']
eig = float(args['--eig'])
... | {
"repo_name": "hellrich/JeSemE",
"path": "pipeline/transform_models/representations/representation_factory.py",
"copies": "1",
"size": "1144",
"license": "mit",
"hash": 1390726836951586000,
"line_mean": 32.6666666667,
"line_max": 119,
"alpha_frac": 0.5655594406,
"autogenerated": false,
"ratio": 3... |
from embeddings.embedding import Embedding
import unittest
import os
class TestEmbeddings(unittest.TestCase):
hello_url = 'https://gist.githubusercontent.com/vzhong/61397d15cf60c0762bb2232c52c12fde/raw/58b644cf4bacb44315d24d481991060963553342/hello.txt'
def setUp(self):
self.root = os.environ['EMBED... | {
"repo_name": "vzhong/embeddings",
"path": "test/test_embeddings.py",
"copies": "1",
"size": "1790",
"license": "mit",
"hash": -7008722480621095000,
"line_mean": 32.7735849057,
"line_max": 147,
"alpha_frac": 0.6083798883,
"autogenerated": false,
"ratio": 3.1184668989547037,
"config_test": true,... |
from ..embed import (compute_diffusion_map, compute_diffusion_map_psd,
has_sklearn)
import numpy as np
from pytest import mark, raises
def _nonnegative_corrcoef(X):
return (np.corrcoef(X) + 1) / 2.0
def _factored_nonnegative_corrcoef(X):
X = X - X.mean(axis=1, keepdims=True)
U = X /... | {
"repo_name": "ThomasYeoLab/CBIG",
"path": "external_packages/python/mapalign-master/mapalign/tests/test_embed.py",
"copies": "1",
"size": "5144",
"license": "mit",
"hash": -812452463476801700,
"line_mean": 39.5039370079,
"line_max": 79,
"alpha_frac": 0.5602643857,
"autogenerated": false,
"ratio"... |
from em_core import core, EPUMgmtOpts
import sys
import os
import traceback
import em_deprecated
import em_optparse
from epumgmt.api.exceptions import *
from epumgmt.api import *
import remote_debug
def main(argv=sys.argv):
if os.name != 'posix':
print >>sys.stderr, "Only runs on POSIX systems."
r... | {
"repo_name": "nimbusproject/epumgmt",
"path": "src/python/epumgmt/main/em_cmdline.py",
"copies": "1",
"size": "2667",
"license": "apache-2.0",
"hash": -1347385849543218400,
"line_mean": 29.3068181818,
"line_max": 79,
"alpha_frac": 0.5916760405,
"autogenerated": false,
"ratio": 3.788352272727273,... |
from emdp.common import MDP, EpisodeDoneError
import numpy as np
def test_simple_reset_MDP():
P = np.array([[[1, 0], [0, 1]], # LEFT action results in the same state, RIGHT next state.
[[0, 1], [0, 1]]]) # from terminal state, any action goes to the same state.
p0 = np.array([1, 0])
R = n... | {
"repo_name": "zafarali/emdp",
"path": "tests/test_mdp_functions.py",
"copies": "1",
"size": "1352",
"license": "mit",
"hash": 8084930434571972000,
"line_mean": 33.6666666667,
"line_max": 94,
"alpha_frac": 0.6057692308,
"autogenerated": false,
"ratio": 3.3137254901960786,
"config_test": false,
... |
from emdp.gridworld import builder_tools
from emdp import actions
import numpy as np
TEST_CASE_SIZE = 3
def _create_tmb():
tmb = builder_tools.TransitionMatrixBuilder(
TEST_CASE_SIZE, has_terminal_state=False)
tmb.add_grid(p_success=0.9)
return tmb
def test_corner_wall():
# Wall in top left ... | {
"repo_name": "zafarali/emdp",
"path": "tests/test_builder_tools.py",
"copies": "1",
"size": "1512",
"license": "mit",
"hash": 2545835093768092700,
"line_mean": 37.7692307692,
"line_max": 117,
"alpha_frac": 0.6607142857,
"autogenerated": false,
"ratio": 2.869070208728653,
"config_test": false,
... |
from emdrp.utils.efpl import *
from numpy import uint32
import pytest
def test_imports():
pass
def test_calc_efpl_simple():
import wknml
nml = wknml.NML(
parameters=wknml.NMLParameters(
name='',
scale=(1, 1, 1),
),
trees=[
wknml.Tree(
... | {
"repo_name": "elhuhdron/emdrp",
"path": "tests/emdrp/emdrp/utils/test_efpl.py",
"copies": "1",
"size": "2563",
"license": "mit",
"hash": -2628581030807642600,
"line_mean": 24.8888888889,
"line_max": 67,
"alpha_frac": 0.4307452204,
"autogenerated": false,
"ratio": 3.3285714285714287,
"config_te... |
from emds.compat import json
from emds.data_structures import MarketHistoryList, MarketOrderList
from emds.formats.exceptions import ParseError
from emds.formats.unified import history, orders
def parse_from_json(json_str):
"""
Given a Unified Uploader message, parse the contents and return a
MarketOrderLi... | {
"repo_name": "gtaylor/EVE-Market-Data-Structures",
"path": "emds/formats/unified/__init__.py",
"copies": "1",
"size": "2212",
"license": "mit",
"hash": -1462008875422560500,
"line_mean": 35.8833333333,
"line_max": 80,
"alpha_frac": 0.6817359855,
"autogenerated": false,
"ratio": 4.111524163568773... |
from emelem.config import *
AUTH_USER_REGISTRATION_ROLE = 'alpha'
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(DATA_DIR, 'unittests.db')
DEBUG = True
EMELEM_WEBSERVER_PORT = 8081
# Allowing SQLALCHEMY_DATABASE_URI to be defined as an env var for
# continuous integration
if 'EMELEM__SQLALCHEMY_DATABASE_URI' i... | {
"repo_name": "jpoullet2000/emelem",
"path": "tests/emelem_test_config.py",
"copies": "1",
"size": "1092",
"license": "apache-2.0",
"hash": -6879269413804404000,
"line_mean": 33.125,
"line_max": 81,
"alpha_frac": 0.7216117216,
"autogenerated": false,
"ratio": 2.716417910447761,
"config_test": f... |
from emend import Edit
PAGE_SIZE = 10
def get(handler, response):
site = handler.get_site(required=True)
# get some edits
from_index = handler.request.get('from')
if from_index:
from_index = int(from_index)
edits = Edit.all().\
ancestor(site).\
filter('index <=', from_index).\
filter... | {
"repo_name": "tantalor/emend",
"path": "app/handlers/sites/closed.py",
"copies": "1",
"size": "1041",
"license": "mit",
"hash": 6049385395707046000,
"line_mean": 29.6176470588,
"line_max": 91,
"alpha_frac": 0.6003842459,
"autogenerated": false,
"ratio": 3.253125,
"config_test": false,
"has_n... |
from emend import Site
PAGE_SIZE = 1
def get(handler, response):
from_domain = handler.request.get('from')
to_domain = handler.request.get('to')
from_site, to_site = None, None
if to_domain:
to_key_name = Site.key_name_from_domain(to_domain)
to_site = Site.get_by_key_name(to_key_name)
if fro... | {
"repo_name": "tantalor/emend",
"path": "app/handlers/sites/default.py",
"copies": "1",
"size": "2032",
"license": "mit",
"hash": 3268599774831908000,
"line_mean": 28.4492753623,
"line_max": 87,
"alpha_frac": 0.5743110236,
"autogenerated": false,
"ratio": 3.111791730474732,
"config_test": false... |
from emend import User
from google.appengine.datastore import datastore_query
PAGE_SIZE = 10
def get(handler, response):
# parameters
from_cursor = handler.request.get('from')
to_cursor = handler.request.get('to')
# setup query
if to_cursor:
query = backward_query().with_cursor(to_cursor)
elif fro... | {
"repo_name": "tantalor/emend",
"path": "app/handlers/users/default.py",
"copies": "1",
"size": "1288",
"license": "mit",
"hash": -1731742412405940500,
"line_mean": 27.6222222222,
"line_max": 90,
"alpha_frac": 0.6576086957,
"autogenerated": false,
"ratio": 3.389473684210526,
"config_test": fals... |
from emission.core.get_database import get_client_stats_db_backup, get_server_stats_db_backup, get_result_stats_db_backup
#x = get_client_stats_db_backup().find()
#print(list(x))
def write_stats(fname, headers, entries):
f = open(fname, "w+")
f.write(','.join(headers) + '\n')
for entry in entries:
row = convert... | {
"repo_name": "yw374cornell/e-mission-server",
"path": "emission/net/int_service/giles/migrate_from_mongo.py",
"copies": "2",
"size": "1272",
"license": "bsd-3-clause",
"hash": -7553813952800402000,
"line_mean": 24.9795918367,
"line_max": 121,
"alpha_frac": 0.6721698113,
"autogenerated": false,
"... |
from emission import EmissionsJsonParser
from emission import vehicles, PollutantTypes
def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
return abs(a - b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
class TestEmissionsJsonParser:
def test_init(self):
fuel_type = vehicles.FuelTypes.PETROL
veh... | {
"repo_name": "asbjorn/EmissionCalculatorLib",
"path": "tests/test_emission_json_reader.py",
"copies": "2",
"size": "1182",
"license": "bsd-2-clause",
"hash": 7818073641694026000,
"line_mean": 30.1052631579,
"line_max": 68,
"alpha_frac": 0.5846023689,
"autogenerated": false,
"ratio": 3.1945945945... |
from emissions.models import EmissionEvent, ContaminantReleased
from downloader import Downloader
from scraper import Scraper
class HTMLGetter(object):
def __init__(self, url_builder):
self.url_builder = url_builder
self.metadata = {
'failed': 0,
'success': 0
}
... | {
"repo_name": "texastribune/emissions-database",
"path": "emission_events/scraper/html_getter.py",
"copies": "1",
"size": "1369",
"license": "mit",
"hash": 2519142713854247400,
"line_mean": 36,
"line_max": 84,
"alpha_frac": 0.5668371074,
"autogenerated": false,
"ratio": 4.318611987381703,
"conf... |
from emitcode import emitCode
from raco.language.grappalang import GrappaAlgebra
from raco.language.clang import CCAlgebra
import logging
logging.basicConfig(level=logging.DEBUG)
LOG = logging.getLogger(__name__)
tr = "sp2bench_1m"
queries = {}
queries['Q1'] = """A(yr) :- %(tr)s(journal, 'http://www.w3.org/1999/02/2... | {
"repo_name": "uwescience/raco",
"path": "examples/sp2bench/sp2bench_rdf_long.py",
"copies": "1",
"size": "7762",
"license": "bsd-3-clause",
"hash": -8409829536461688000,
"line_mean": 58.7076923077,
"line_max": 200,
"alpha_frac": 0.5802628189,
"autogenerated": false,
"ratio": 2.9092953523238383,
... |
from emitcode import emitCode
import raco.algebra as algebra
from raco.language import CCAlgebra, GrappaAlgebra
import logging
logging.basicConfig(level=logging.DEBUG)
LOG = logging.getLogger(__name__)
tr = "sp2bench_1m"
queries = {}
queries['Q1'] = """A(yr) :- %(tr)s(journal, '<http://www.w3.org/1999/02/22-rdf-synt... | {
"repo_name": "uwescience/raco",
"path": "examples/sp2bench/sp2bench_rdf_brackets.py",
"copies": "1",
"size": "8029",
"license": "bsd-3-clause",
"hash": 6690524987756424000,
"line_mean": 60.2900763359,
"line_max": 204,
"alpha_frac": 0.5673184705,
"autogenerated": false,
"ratio": 2.962730627306273... |
from emit.MethodBuilder import *
class CopperInterpreter(object):
def __init__(self):
super().__init__()
self.methods = {}
self.stackFrames = []
def eval(self, entry, args):
assert(entry)
args = args or []
stackFrame = {
'stack': [arg fo... | {
"repo_name": "aboveyou00/cc",
"path": "src/interpreter/CopperInterpreter.py",
"copies": "1",
"size": "3578",
"license": "mit",
"hash": 8518751930096834000,
"line_mean": 28.5702479339,
"line_max": 100,
"alpha_frac": 0.4362772499,
"autogenerated": false,
"ratio": 4.604890604890605,
"config_test"... |
from emma.adapter import AbstractAdapter
class MockAdapter(AbstractAdapter):
expected = None
raised = None
def __init__(self, *args, **kwargs):
super(MockAdapter, self).__init__()
self.called = 0
self.call = ()
def _capture(self, method, path, params):
self.called += 1... | {
"repo_name": "myemma/EmmaPython",
"path": "tests/model/__init__.py",
"copies": "1",
"size": "1211",
"license": "mit",
"hash": 6632401416713645000,
"line_mean": 30.8947368421,
"line_max": 63,
"alpha_frac": 0.5730800991,
"autogenerated": false,
"ratio": 4.279151943462898,
"config_test": false,
... |
from EmmeDomotica import EmmeDomotica
# Initializing connection on localhost
restClient = EmmeDomotica("http://127.0.0.1", 8000)
# User menu
print "EmmeDomotica rest client"
print "1. To get a list of available devices"
print "1.1 To show detail of a specific device"
print "2. To add a device"
print "3. To edit an ex... | {
"repo_name": "SamuelFinocchioNJP/EmmeDomotica",
"path": "RestClient/ui.py",
"copies": "1",
"size": "2236",
"license": "mit",
"hash": 8137852835020051000,
"line_mean": 36.2833333333,
"line_max": 94,
"alpha_frac": 0.6431127013,
"autogenerated": false,
"ratio": 3.5776,
"config_test": false,
"ha... |
from emm_exceptions.NotFoundException import NotFoundException
from emm_exceptions.ActionInProgressException import ActionInProgressException
from model.Entities import Topology
from services.DatabaseManager import DatabaseManager
from util.FactoryAgent import FactoryAgent
from util.SysUtil import SysUtil as sys_util
i... | {
"repo_name": "MobileCloudNetworking/maas",
"path": "bundle/core/TopologyOrchestrator.py",
"copies": "1",
"size": "2779",
"license": "apache-2.0",
"hash": 5364662615951922000,
"line_mean": 33.3209876543,
"line_max": 153,
"alpha_frac": 0.6397984887,
"autogenerated": false,
"ratio": 4.2298325722983... |
from emojiDict import emojiLookup
import cPickle as pickle
def readThes():
"""Read in the Thesaurus """
thes = {}
f = open('../mthes/mobythes.aur', 'rU')
for line in f.readlines():
stuff = line.strip().split(',')
thes[stuff[0]] = stuff[1:]
f.close()
return thes
def buildEmDict(... | {
"repo_name": "yoachim/pyemoji",
"path": "python/createDict.py",
"copies": "1",
"size": "1331",
"license": "mit",
"hash": 1707826131636920600,
"line_mean": 27.3191489362,
"line_max": 61,
"alpha_frac": 0.524417731,
"autogenerated": false,
"ratio": 3.6767955801104972,
"config_test": false,
"has... |
from emokit.emotiv import Emotiv
from datetime import datetime
import os, sys, time, errno, platform
# import matplotlib.pyplot as plt
if platform.system() == "Windows":
import socket # Needed to prevent gevent crashing on Windows. (surfly / gevent issue #459)
import gevent
idle_time = 1
measure_time =... | {
"repo_name": "mahdanahmad/medik-emokit-wheelchair",
"path": "getter.py",
"copies": "1",
"size": "2226",
"license": "mit",
"hash": 2849733127395976000,
"line_mean": 32.7272727273,
"line_max": 200,
"alpha_frac": 0.4829290207,
"autogenerated": false,
"ratio": 3.403669724770642,
"config_test": fal... |
from emonitor.extensions import db, events
class Eventhandler(db.Model):
"""Eventhandler class"""
__tablename__ = 'eventhandlers'
__table_args__ = {'extend_existing': True}
id = db.Column(db.Integer, primary_key=True)
event = db.Column(db.String(32))
handler = db.Column(db.String(64))
pos... | {
"repo_name": "sambandi/eMonitor",
"path": "emonitor/modules/events/eventhandler.py",
"copies": "3",
"size": "3373",
"license": "bsd-3-clause",
"hash": 3182070544570562600,
"line_mean": 35.6630434783,
"line_max": 134,
"alpha_frac": 0.5810850875,
"autogenerated": false,
"ratio": 4.2374371859296485... |
from emonitor.extensions import db
from emonitor.modules.alarmkeys.alarmkeycar import AlarmkeyCars
class Alarmkey(db.Model):
"""Alarmkey class"""
__tablename__ = 'alarmkeys'
__table_args__ = {'extend_existing': True}
id = db.Column(db.Integer, primary_key=True)
category = db.Column(db.String(40),... | {
"repo_name": "digifant/eMonitor",
"path": "emonitor/modules/alarmkeys/alarmkey.py",
"copies": "2",
"size": "5815",
"license": "bsd-3-clause",
"hash": 6990215487127942000,
"line_mean": 34.6748466258,
"line_max": 124,
"alpha_frac": 0.6221840069,
"autogenerated": false,
"ratio": 3.8766666666666665,... |
from emonitor.extensions import db
from emonitor.modules.cars.car import Car
class AlarmkeyCars(db.Model):
"""AlarmkeyCars class"""
__tablename__ = 'alarmkeycars'
__table_args__ = {'extend_existing': True}
kid = db.Column(db.Integer, primary_key=True)
dept = db.Column(db.String(30), primary_... | {
"repo_name": "sambandi/eMonitor",
"path": "emonitor/modules/alarmkeys/alarmkeycar.py",
"copies": "3",
"size": "3522",
"license": "bsd-3-clause",
"hash": -5569292203194811000,
"line_mean": 32.2264150943,
"line_max": 88,
"alpha_frac": 0.5559341283,
"autogenerated": false,
"ratio": 3.15591397849462... |
from emonitor.utils import Module
from emonitor.extensions import babel
from .content_admin import getAdminContent
from emonitor.extensions import monitorserver
from emonitor.modules.alarms.alarm import Alarm
from emonitor.modules.participation import Participation
from flask import Flask, jsonify, abort, request
impor... | {
"repo_name": "digifant/eMonitor",
"path": "emonitor/modules/externalApi/__init__.py",
"copies": "1",
"size": "8173",
"license": "bsd-3-clause",
"hash": -2223528738040221200,
"line_mean": 55.7569444444,
"line_max": 175,
"alpha_frac": 0.555365227,
"autogenerated": false,
"ratio": 4.070219123505976... |
from emonitor.utils import Module
from emonitor.extensions import babel
from .content_admin import getAdminContent
class UserModule(Module):
"""
Definition of users module with admin area
"""
info = dict(area=['admin'], name='users', path='users', icon='fa-user', version='0.1')
helppath = '/emonit... | {
"repo_name": "sambandi/eMonitor",
"path": "emonitor/modules/user/__init__.py",
"copies": "3",
"size": "1053",
"license": "bsd-3-clause",
"hash": -3673947492156457000,
"line_mean": 31.90625,
"line_max": 113,
"alpha_frac": 0.6419753086,
"autogenerated": false,
"ratio": 3.8713235294117645,
"confi... |
from emonitor.utils import Module
from emonitor.extensions import babel
from emonitor.modules.events.content_admin import getAdminContent, getAdminData
from emonitor.modules.events.eventhandler import Eventhandler
class EventsModule(Module):
"""
Definition of event module with frontend, admin and widget area
... | {
"repo_name": "digifant/eMonitor",
"path": "emonitor/modules/events/__init__.py",
"copies": "3",
"size": "1536",
"license": "bsd-3-clause",
"hash": -5066849677690515000,
"line_mean": 30.3469387755,
"line_max": 122,
"alpha_frac": 0.642578125,
"autogenerated": false,
"ratio": 4.290502793296089,
"... |
from emonitor.utils import Module
from emonitor.extensions import events, babel
from .content_admin import getAdminContent, getAdminData
class TextmodModule(Module):
"""
Definition of textmod module with admin area
"""
info = dict(area=['admin'], name='textmod', path='textmod', icon='fa-text-width', v... | {
"repo_name": "digifant/eMonitor",
"path": "emonitor/modules/textmod/__init__.py",
"copies": "1",
"size": "2137",
"license": "bsd-3-clause",
"hash": 4184421149197965300,
"line_mean": 38.5740740741,
"line_max": 238,
"alpha_frac": 0.6541881142,
"autogenerated": false,
"ratio": 3.7425569176882663,
... |
from EmotionAPIIntegration import get_emotion
from generate_places_from_theme import get_place
moods = get_emotion()
age = raw_input("What is your age?")
gender = raw_input("What is your gender (Male/Female)?")
weather = raw_input("Would you prefer an Outdoor or Indoor? ")
time = raw_input("Would you like to go... | {
"repo_name": "RohitSaha/GyPsY",
"path": "Gypsy.py",
"copies": "1",
"size": "6765",
"license": "mit",
"hash": -6191829840480987000,
"line_mean": 19.8225806452,
"line_max": 98,
"alpha_frac": 0.5358462676,
"autogenerated": false,
"ratio": 2.881175468483816,
"config_test": false,
"has_no_keyword... |
from EmotionAPIIntegration import get_emotion
moods = get_emotion()
age = raw_input("What is your age?")
gender = raw_input("What is your gender (Male/Female)?")
weather = raw_input("Would you prefer an outdoor or indoor? ")
time = raw_input("Would you like to go out in the Early Morning, Morning, Afternoon or... | {
"repo_name": "RohitSaha/GyPsY",
"path": "main.py",
"copies": "1",
"size": "6315",
"license": "mit",
"hash": 8783240106667326000,
"line_mean": 18.8415841584,
"line_max": 98,
"alpha_frac": 0.5412509897,
"autogenerated": false,
"ratio": 2.8704545454545456,
"config_test": false,
"has_no_keywords... |
from emotion_processing.compound_emotions import CompoundEmotion
from emotion_processing.emotion_qualifiers import EmotionQualifier
from emotion_processing.sentic_values import SenticValue
interval_maps = {
'pleasantness': {
-2/3: SenticValue.grief,
-1/3: SenticValue.sadness,
0: SenticVa... | {
"repo_name": "CatalystOfNostalgia/hoot",
"path": "server/hoot/emotion_processing/emotion.py",
"copies": "1",
"size": "5840",
"license": "mit",
"hash": -1119877104280318300,
"line_mean": 31.4444444444,
"line_max": 78,
"alpha_frac": 0.5467465753,
"autogenerated": false,
"ratio": 3.872679045092838,... |
from Empleado import Empleado
class Empresa(Empleado):
def __init__(self, nombre, edad, peso, estatura, pasatiempo, id, puesto, company, since, address, empleados):
super().__init__(nombre, edad, peso, estatura, pasatiempo, id, puesto)
self.company = company='Zildjian'
self.since = since = '... | {
"repo_name": "AnhellO/DAS_Sistemas",
"path": "Ene-Jun-2020/alvarado-lara-luz-deorela-sabas/Practica2/Empresa.py",
"copies": "1",
"size": "2386",
"license": "mit",
"hash": -7397108692583673000,
"line_mean": 35.6923076923,
"line_max": 206,
"alpha_frac": 0.6121593291,
"autogenerated": false,
"ratio... |
from empower.main import RUNTIME
import datetime
import empower.logger
import json
LOG = empower.logger.get_logger()
lvapList = []
ruleList = []
wtpList = []
json_rule = {}
_ev= False
def show_all_lvaps(self):
LOG.info("Exploring connected lvapps in WTPs....")
wtpsd={}
for wtp in self.wtps():
lva... | {
"repo_name": "LokiNetworks/empower-runtime",
"path": "empower/apps/loki/drp_manager.py",
"copies": "1",
"size": "1715",
"license": "apache-2.0",
"hash": 4465825494780920300,
"line_mean": 19.6626506024,
"line_max": 95,
"alpha_frac": 0.5819241983,
"autogenerated": false,
"ratio": 2.911714770797962... |
from empressx import states
from empressx.empress.models import Task
def serve(app_name):
task = Task(app_name=app_name, action='serve')
task.save()
return True, task.id
def unserve(app_name):
task = Task(app_name=app_name, action='unserve')
task.save()
return True, task.id
def status(task... | {
"repo_name": "TeamNext/EmpressX",
"path": "empressx/empress/methods/public.py",
"copies": "1",
"size": "1138",
"license": "mit",
"hash": 878433615704188700,
"line_mean": 25.4651162791,
"line_max": 69,
"alpha_frac": 0.4982425308,
"autogenerated": false,
"ratio": 3.7434210526315788,
"config_test... |
from emringer import *
from libtbx import easy_pickle
from matplotlib import pyplot as plt
from sys import argv
numbers = [3,9,15,21]
extension = "_ringer.pkl"
ringers = {i: easy_pickle.load("%d%s" % (i, extension)) for i in numbers}
x = range(0,365,5)
y ={}
for i in numbers:
for index, value in enumerate(ringers[i... | {
"repo_name": "fraser-lab/EMRinger",
"path": "Figures/3/3C_E.py",
"copies": "1",
"size": "1148",
"license": "bsd-3-clause",
"hash": -3530333141891443700,
"line_mean": 22.4285714286,
"line_max": 86,
"alpha_frac": 0.6367595819,
"autogenerated": false,
"ratio": 2.5398230088495577,
"config_test": f... |
from emspy.query import *
from query import Query
import cPickle
import warnings
import pandas as pd
import numpy as np
class TSeriesQuery(Query):
def __init__(self, conn, ems_name, new_data = False):
Query.__init__(self, conn, ems_name)
self._init_assets(new_data)
self.reset()
d... | {
"repo_name": "c-owens/ems-api-sdk",
"path": "python/query/tsquery.py",
"copies": "1",
"size": "5965",
"license": "mit",
"hash": 7897950386655525000,
"line_mean": 34.0882352941,
"line_max": 163,
"alpha_frac": 0.4943839061,
"autogenerated": false,
"ratio": 3.8683527885862516,
"config_test": fals... |
from emspy.query import *
from query import Query
import pandas as pd
import sys, json
class FltQuery(Query):
def __init__(self, conn, ems_name, new_data = False):
Query.__init__(self, conn, ems_name)
self._init_assets(new_data)
self.reset()
def _init_assets(self, new_data):
# Query._init_assets(se... | {
"repo_name": "c-owens/ems-api-sdk",
"path": "python/query/fltquery.py",
"copies": "1",
"size": "12755",
"license": "mit",
"hash": -4977914022375011000,
"line_mean": 23.912109375,
"line_max": 114,
"alpha_frac": 0.6221089769,
"autogenerated": false,
"ratio": 2.975274084441334,
"config_test": fal... |
from emu.cpu import labeltab, datatab
from emu.instruction import Instruction, BinaryInstruction
def line2val(line):
return Instruction(line).to_binary()[0].value
def line2multi(line):
return map(lambda x: x.value, Instruction(line).to_binary())
def test_to_binary():
assert line2val('add $t1, $t1, $t2... | {
"repo_name": "mossberg/spym",
"path": "test/test_instruction.py",
"copies": "1",
"size": "5290",
"license": "mit",
"hash": 2184590231595903500,
"line_mean": 41.32,
"line_max": 78,
"alpha_frac": 0.6196597353,
"autogenerated": false,
"ratio": 2.3947487550928024,
"config_test": false,
"has_no_k... |
from emulator_v0.main import Account
from agent.main import Agent
from config import *
env = Account()
agent = Agent()
# fill cache
for episode in range(5):
state, universe = env.reset()
while True:
action = agent.get_stochastic_policy(state, 0)
next_state, universe, reward, done, value, port... | {
"repo_name": "AlphaSmartDog/DeepLearningNotes",
"path": "Note-5 DQN与HS300指数择时/D3QN_Vector/test_main.py",
"copies": "1",
"size": "1184",
"license": "mit",
"hash": 5897116233810931000,
"line_mean": 23.6666666667,
"line_max": 67,
"alpha_frac": 0.5971283784,
"autogenerated": false,
"ratio": 3.7,
"... |
from emuplugin import BasePlugin
import dcpu16
try:
raw_input
except NameError:
# Python3 raw_input was renamed to input
raw_input = input
class DebuggerPlugin(BasePlugin):
"""
A plugin to implement a debugger
"""
def __init__(self, args):
"""
Enable debugger if a... | {
"repo_name": "mceier/dcpu16py",
"path": "plugins/debuggerplugin.py",
"copies": "3",
"size": "4497",
"license": "mit",
"hash": -2528273955454573000,
"line_mean": 35.8606557377,
"line_max": 101,
"alpha_frac": 0.5167889704,
"autogenerated": false,
"ratio": 4.31573896353167,
"config_test": false,
... |
from emuplugin import BasePlugin
import importlib
import sys
import time
import os
import re
START_ADDRESS = 0x8000
MIN_DISPLAY_HZ = 60
class TerminalPlugin(BasePlugin):
"""
A plugin to implement terminal selection
"""
arguments = [
(["--term"], dict(action="store", default="null"... | {
"repo_name": "Olical/dcpu16py",
"path": "plugins/terminalplugin.py",
"copies": "1",
"size": "2940",
"license": "mit",
"hash": -1977534042525415700,
"line_mean": 32.4090909091,
"line_max": 127,
"alpha_frac": 0.5272108844,
"autogenerated": false,
"ratio": 3.8481675392670156,
"config_test": false... |
from emuplugin import BasePlugin
import importlib
import sys
import time
import os
import re
START_ADDRESS = 0x8000
MIN_DISPLAY_HZ = 60
class TerminalPlugin(BasePlugin):
"""
A plugin to implement terminal selection
"""
arguments = [
(["--term"], dict(action="store", default="null", help=... | {
"repo_name": "mceier/dcpu16py",
"path": "plugins/terminalplugin.py",
"copies": "3",
"size": "2911",
"license": "mit",
"hash": -40156979647714440,
"line_mean": 31.7078651685,
"line_max": 123,
"alpha_frac": 0.5324630711,
"autogenerated": false,
"ratio": 3.81020942408377,
"config_test": false,
... |
from emupy6502.addressing_modes import AddressingModes
#################################################################################
# SYSTEM
def nop(registers, operand, memory_controller):
pass
def brk(registers, operand, memory_controller):
memory_controller.write(registers.sp, registers.pc & 0xff)
... | {
"repo_name": "crispg72/6502py",
"path": "emupy6502/opcodes.py",
"copies": "1",
"size": "16020",
"license": "mit",
"hash": -3470031326811259000,
"line_mean": 35.7431192661,
"line_max": 131,
"alpha_frac": 0.5475655431,
"autogenerated": false,
"ratio": 3.140560674377573,
"config_test": false,
"... |
from emupy6502.registers import Registers
def imp(registers, memory_controller):
# implied has no effect
return None
def acc(registers, memory_controller):
# accumulator has no effect
return None
def imm(registers, memory_controller):
value = memory_controller.read(registers.pc)
registers.pc... | {
"repo_name": "crispg72/6502py",
"path": "emupy6502/addressing_modes.py",
"copies": "1",
"size": "6182",
"license": "mit",
"hash": 5739323816465840000,
"line_mean": 37.6375,
"line_max": 115,
"alpha_frac": 0.6151730831,
"autogenerated": false,
"ratio": 2.8527918781725887,
"config_test": false,
... |
from .em_utils import ks_distance, expectation
from ..imgutils import *
import numpy as np
def one_class_em(counts, kernel='ks', max_iter=10):
n = np.sum(counts[0, :])
pmfs = np.ndarray(shape=counts.shape, dtype='float32')
ndpmf(counts, n, pmfs)
mask = np.ones(shape=counts.shape[1], dtype='float32')
expecte... | {
"repo_name": "yandexdataschool/crayimage",
"path": "crayimage/hotornot/em/em.py",
"copies": "1",
"size": "1494",
"license": "mit",
"hash": 6663595217030873000,
"line_mean": 32.2,
"line_max": 90,
"alpha_frac": 0.6017402945,
"autogenerated": false,
"ratio": 2.8457142857142856,
"config_test": fal... |
from emv.util import unformat_bytes
from emv.protocol.command import SelectCommand
from emv.protocol.response import SuccessResponse
from emv.transmission import TransmissionProtocol
class MockConnection(object):
T0_protocol = 1
def __init__(self, responses):
self.responses = responses
self.r... | {
"repo_name": "russss/python-emv",
"path": "emv/test/test_transmission.py",
"copies": "1",
"size": "1214",
"license": "mit",
"hash": -3128587149400327700,
"line_mean": 26.5909090909,
"line_max": 80,
"alpha_frac": 0.6507413509,
"autogenerated": false,
"ratio": 3.5188405797101447,
"config_test": ... |
from enable.api import ColorTrait
from enable.markers import AbstractMarker, MarkerNameDict, marker_trait
from traits.api import (Float, HasStrictTraits, Instance, Int, Property,
cached_property)
from kiva.constants import STROKE
class MarkerStylus(HasStrictTraits):
""" A Flyweight object... | {
"repo_name": "tonysyu/deli",
"path": "deli/stylus/marker_stylus.py",
"copies": "1",
"size": "1581",
"license": "bsd-3-clause",
"hash": 3393509224942655500,
"line_mean": 27.2321428571,
"line_max": 72,
"alpha_frac": 0.5926628716,
"autogenerated": false,
"ratio": 4.074742268041237,
"config_test":... |
from enable.api import ColorTrait
from traits.api import HasStrictTraits, Instance, Property
from .label_stylus import LabelStylus
from .polygon_stylus import PolygonStylus
DEFAULT_LABEL_STYLE = {'x_origin': 'left', 'x_offset': 20, 'margin': 5}
class FlagStylus(PolygonStylus):
def draw(self, gc, rect, origin=... | {
"repo_name": "tonysyu/deli",
"path": "deli/stylus/flag_label_stylus.py",
"copies": "1",
"size": "1694",
"license": "bsd-3-clause",
"hash": -7159711734723520000,
"line_mean": 27.7118644068,
"line_max": 76,
"alpha_frac": 0.6033057851,
"autogenerated": false,
"ratio": 3.6666666666666665,
"config_... |
from enable.api import Component
def test_padding_init():
""" Make sure that padding traits passed to the constructor get set in the
correct order.
"""
c = Component()
assert c.padding_top == 0
assert c.padding_bottom == 0
assert c.padding_left == 0
assert c.padding_right == 0
c = ... | {
"repo_name": "ContinuumIO/chaco",
"path": "chaco/tests/component_tests.py",
"copies": "3",
"size": "1603",
"license": "bsd-3-clause",
"hash": 3807138440150155000,
"line_mean": 29.8269230769,
"line_max": 78,
"alpha_frac": 0.645040549,
"autogenerated": false,
"ratio": 3.6103603603603602,
"config... |
from enable.api import Container, Label, NativeScrollBar, Window
from enable.example_support import DemoFrame, demo_main
class MyFrame(DemoFrame):
def _create_window(self):
label = Label(text="h:\nv:", font="modern 16",
position=[20, 50],
bounds=[100, 100],
... | {
"repo_name": "tommy-u/enable",
"path": "examples/enable/scrollbar_demo.py",
"copies": "1",
"size": "2368",
"license": "bsd-3-clause",
"hash": 8294181727747588000,
"line_mean": 37.8196721311,
"line_max": 72,
"alpha_frac": 0.5215371622,
"autogenerated": false,
"ratio": 4.006768189509306,
"config... |
from enable.api import Container
from enable.toolkit_constants import pointer_names
from traits.api import Enum, Float
PointerEnum = Enum('arrow', values=set(pointer_names))
class MovableComponent(Container):
""" A `Container` which can be manipulated by the user
"""
# This component is not resizable
... | {
"repo_name": "dmsurti/ensemble",
"path": "ensemble/ctf/movable_component.py",
"copies": "1",
"size": "3061",
"license": "bsd-3-clause",
"hash": -3365487274697152000,
"line_mean": 31.9139784946,
"line_max": 77,
"alpha_frac": 0.487422411,
"autogenerated": false,
"ratio": 4.596096096096096,
"conf... |
from enable.api import Container, TextField, Window
from enable.example_support import DemoFrame, demo_main
size = (500, 400)
class MyFrame(DemoFrame):
def _create_window(self):
text_field = TextField(position=[25,100], width=200)
text = "This a test with a text field\nthat has more text than\n... | {
"repo_name": "tommy-u/enable",
"path": "examples/enable/text_field_demo.py",
"copies": "1",
"size": "1083",
"license": "bsd-3-clause",
"hash": 3956143996759194600,
"line_mean": 35.1,
"line_max": 73,
"alpha_frac": 0.5909510619,
"autogenerated": false,
"ratio": 3.8956834532374103,
"config_test":... |
from enable.enable_traits import bounds_trait, coordinate_trait
from traits.api import Enum, HasStrictTraits, Instance, Property, Tuple
from ..layout.ab_constrainable import ABConstrainable
from ..layout.constraints_namespace import ConstraintsNamespace
from ..layout.utils import add_symbolic_constraints, STRENGTHS
... | {
"repo_name": "tonysyu/deli",
"path": "deli/core/coordinate_box.py",
"copies": "1",
"size": "6342",
"license": "bsd-3-clause",
"hash": -2451193994573028000,
"line_mean": 31.5230769231,
"line_max": 77,
"alpha_frac": 0.6204667297,
"autogenerated": false,
"ratio": 4.216755319148936,
"config_test":... |
from enable.example_support import DemoFrame, demo_main
from enable.api import Container, Window, TextField
from enable.stacked_container import VStackedContainer, HStackedContainer
size = (240, 240)
class MyFrame(DemoFrame):
def _create_window(self):
stack = VStackedContainer(position=[0,0],
... | {
"repo_name": "tommy-u/enable",
"path": "examples/enable/stacked_container_demo.py",
"copies": "1",
"size": "1637",
"license": "bsd-3-clause",
"hash": 5580940119143800000,
"line_mean": 34.5869565217,
"line_max": 77,
"alpha_frac": 0.5919364692,
"autogenerated": false,
"ratio": 3.745995423340961,
... |
from enable.primitives.shape import Shape
from enable.enable_traits import coordinate_trait
from traits.api import Property, Bool, property_depends_on
class GeoPrimitive(Shape):
""" Coordinates are in Lat/Long using WGS84 Datum
"""
geoposition = coordinate_trait
scale_with_zoom = Bool(False)
... | {
"repo_name": "nmichaud/enable-mapping",
"path": "mapping/enable/primitives/geo_primitive.py",
"copies": "1",
"size": "1807",
"license": "bsd-3-clause",
"hash": -8048469443195810000,
"line_mean": 29.1166666667,
"line_max": 81,
"alpha_frac": 0.5932484781,
"autogenerated": false,
"ratio": 3.7962184... |
from enable.savage.svg.document import SVGDocument
from enable.savage.trait_defs.ui.svg_editor import SVGEditor
from traits.api import HasTraits, Instance
from traitsui.api import Item, View
class StaticImageExample(HasTraits):
svg = Instance(SVGDocument)
traits_view = View(Item('svg', editor=SVGEditor(),
... | {
"repo_name": "tommy-u/enable",
"path": "examples/savage/static_image.py",
"copies": "1",
"size": "1350",
"license": "bsd-3-clause",
"hash": -3371909193735065600,
"line_mean": 34.5263157895,
"line_max": 74,
"alpha_frac": 0.6325925926,
"autogenerated": false,
"ratio": 3.835227272727273,
"config_... |
from enchant import request_dict
from circuits import Component
from ..plugin import BasePlugin
DEFAULT_LANGUAGE = "en_US"
class Commands(Component):
channel = "commands"
def spell(self, source, target, args):
"""Check the spelling of the given word.
Syntax: SPELL <word>
"""
... | {
"repo_name": "prologic/kdb",
"path": "kdb/plugins/spell.py",
"copies": "1",
"size": "1212",
"license": "mit",
"hash": 7972892468356225000,
"line_mean": 21.4444444444,
"line_max": 74,
"alpha_frac": 0.6130363036,
"autogenerated": false,
"ratio": 3.8476190476190477,
"config_test": false,
"has_n... |
from encoded.reports.constants import BATCH_DOWNLOAD_COLUMN_TO_FIELDS_MAPPING
from encoded.reports.constants import SERIES_BATCH_DOWNLOAD_COLUMN_TO_FIELDS_MAPPING
from encoded.reports.constants import METADATA_LINK
from encoded.reports.constants import AT_IDS_AS_JSON_DATA_LINK
from encoded.reports.metadata import Metad... | {
"repo_name": "ENCODE-DCC/encoded",
"path": "src/encoded/reports/batch_download.py",
"copies": "1",
"size": "6498",
"license": "mit",
"hash": 570802984081093600,
"line_mean": 36.3448275862,
"line_max": 86,
"alpha_frac": 0.6263465682,
"autogenerated": false,
"ratio": 4.021039603960396,
"config_t... |
from encoded.searches.responses import CartQueryResponseWithFacets
from encoded.searches.responses import CartMatrixResponseWithFacets
from encoded.searches.queries import CartSearchQueryFactory
from encoded.searches.queries import CartSearchQueryFactoryWithFacets
from encoded.searches.queries import CartMatrixQueryFac... | {
"repo_name": "ENCODE-DCC/encoded",
"path": "src/encoded/searches/fields.py",
"copies": "1",
"size": "4034",
"license": "mit",
"hash": -892265121625118800,
"line_mean": 35.0178571429,
"line_max": 85,
"alpha_frac": 0.7174020823,
"autogenerated": false,
"ratio": 4.050200803212851,
"config_test": ... |
from encoded.search_views import search_generator
from snovault.elasticsearch.searches.parsers import QueryString
class BatchedSearchGenerator:
SEARCH_PATH = '/search/'
DEFAULT_PARAMS = [
('limit', 'all')
]
def __init__(self, request, batch_field='@id', batch_size=5000):
self.request... | {
"repo_name": "ENCODE-DCC/encoded",
"path": "src/encoded/reports/search.py",
"copies": "1",
"size": "1894",
"license": "mit",
"hash": 4498472333033696000,
"line_mean": 38.4583333333,
"line_max": 90,
"alpha_frac": 0.64625132,
"autogenerated": false,
"ratio": 3.684824902723735,
"config_test": fal... |
from Encoder import Encoder
from networking.Listener import Listener
from networking.IP_Parser import IP_Parser
from src.Routing.RoutingTable import RoutingTable
from src.Messages.Message_handler import Message_handler
class Node():
def __init__(self, socket, id, ip):
self.__encoder = Encoder()
se... | {
"repo_name": "mikesligo/distributed-search",
"path": "src/Node.py",
"copies": "1",
"size": "1316",
"license": "mit",
"hash": -7153364864058400000,
"line_mean": 31.925,
"line_max": 71,
"alpha_frac": 0.6542553191,
"autogenerated": false,
"ratio": 3.781609195402299,
"config_test": false,
"has_n... |
from .encoder import medea
class MedeaMapper(object):
def __init__(self, *attrs, **json_attrs):
self.attributes = set(attrs) | set(json_attrs)
self.json_attrs = dict((attr, self.json_attr(attr)) for attr in attrs)
self.json_attrs.update(json_attrs)
def __call__(self, source):
... | {
"repo_name": "kevinbeaty/medea",
"path": "medea/mapper.py",
"copies": "1",
"size": "1737",
"license": "mit",
"hash": 7672492736368861000,
"line_mean": 27.95,
"line_max": 78,
"alpha_frac": 0.5423143351,
"autogenerated": false,
"ratio": 4.267813267813268,
"config_test": false,
"has_no_keywords... |
from encoders import BaseEncoder
from classifiers import BaseClassifier, LogisticRegressionWrapper
class Representation(object):
def __init__(self, encoder, classifier, *args, **kwargs):
enc_args = {}
cl_args = {}
klen = len(encoder) + 1
clen = len(classifier) + 1
for k, v... | {
"repo_name": "juditacs/dsl",
"path": "dsl/representation/model.py",
"copies": "1",
"size": "1142",
"license": "mit",
"hash": -841623165293672200,
"line_mean": 35.8387096774,
"line_max": 81,
"alpha_frac": 0.6392294221,
"autogenerated": false,
"ratio": 4.13768115942029,
"config_test": false,
"... |
from .encoders import make_encoder
from gi.repository import Gst
container_registry = {}
def make_pipe(config, name):
format_info = config['formats'][name]
container_info = config['containers'][format_info['container']]
muxer = container_registry[container_info['format']]()
aenc = make_encoder(container_info['au... | {
"repo_name": "endrift/bmdstream",
"path": "bmdstream/containers.py",
"copies": "1",
"size": "1828",
"license": "mit",
"hash": -3869905491165053400,
"line_mean": 25.1142857143,
"line_max": 71,
"alpha_frac": 0.7002188184,
"autogenerated": false,
"ratio": 2.607703281027104,
"config_test": false,
... |
from ENCODETools import ReadJSON
from ENCODETools import GetENCODE
from ENCODETools import FlatJSON
from ENCODETools import LoginGSheet
from ENCODETools import FindGSpreadSheet
from ENCODETools import FindGWorkSheet
from identity import keys
if __name__ == "__main__":
'''
This script will read in a set of js... | {
"repo_name": "ENCODE-DCC/WranglerScripts",
"path": "GSheetWrite.py",
"copies": "1",
"size": "4078",
"license": "mit",
"hash": 3074137234865216000,
"line_mean": 37.4716981132,
"line_max": 99,
"alpha_frac": 0.617459539,
"autogenerated": false,
"ratio": 3.982421875,
"config_test": false,
"has_n... |
from encoding_cp932 import encoding_table, decoding_table # JS module in libs
### Codec APIs
class Codec:
def encode(self, input, errors='strict'):
b = []
for pos, car in enumerate(input):
cp = ord(car)
try:
code = encoding_table[cp]
high = ... | {
"repo_name": "brython-dev/brython",
"path": "www/src/Lib/_codecs_jp.py",
"copies": "1",
"size": "1174",
"license": "bsd-3-clause",
"hash": -4222887851023160300,
"line_mean": 27.6341463415,
"line_max": 77,
"alpha_frac": 0.4412265758,
"autogenerated": false,
"ratio": 4.4638783269961975,
"config_... |
from .encoding.hash import double_sha256
from .encoding.hexbytes import h2b_rev
def merkle(hashes, hash_f=double_sha256):
"""Take a list of hashes, and return the root merkle hash."""
while len(hashes) > 1:
hashes = merkle_pair(hashes, hash_f)
return hashes[0]
def merkle_pair(hashes, hash_f):
... | {
"repo_name": "richardkiss/pycoin",
"path": "pycoin/merkle.py",
"copies": "1",
"size": "2732",
"license": "mit",
"hash": 2112936082051841000,
"line_mean": 38.5942028986,
"line_max": 88,
"alpha_frac": 0.7507320644,
"autogenerated": false,
"ratio": 2.9313304721030042,
"config_test": false,
"has... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.