text stringlengths 4 1.02M | meta dict |
|---|---|
"""
This module provides functions for generating libxml2 documents (xmlDoc).
Constructors must receive a Response object and return a xmlDoc object.
"""
import libxml2
xml_parser_options = libxml2.XML_PARSE_RECOVER + \
libxml2.XML_PARSE_NOERROR + \
libxml2.XML_PARSE_NOWARNI... | {
"content_hash": "c395e77363b7bcfef09b42b8ab05540c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 81,
"avg_line_length": 35.17777777777778,
"alnum_prop": 0.6279216677195198,
"repo_name": "ndemir/scrapy",
"id": "44dc4f94f4d5becebe12a58735029aeae0e79bdd",
"size": "1583",
... |
from __future__ import annotations
import logging
from dataclasses import dataclass
from typing import Iterable
from pants.backend.cc.lint.clangformat.subsystem import ClangFormat
from pants.backend.cc.target_types import CCSourceField
from pants.backend.python.util_rules.pex import Pex, PexProcess, PexRequest
from p... | {
"content_hash": "c7e3efb1e9382ab737993d055cb8dd46",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 100,
"avg_line_length": 32.96590909090909,
"alnum_prop": 0.6780420544639779,
"repo_name": "pantsbuild/pants",
"id": "516e1d07faeb6ea444f725436f0cc663f39d8466",
"size": "303... |
import zmq
class Sender():
def __init__(self):
self.port = '5555'
self.context = zmq.Context()
self.socket = self.context.socket(zmq.PAIR)
self.socket.connect("tcp://localhost:%s" % self.port)
def send(self, command):
try:
self.socket.send(command, flags=zm... | {
"content_hash": "cb4423d114c71d08f14d014e00079852",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 61,
"avg_line_length": 25.4,
"alnum_prop": 0.5695538057742782,
"repo_name": "uberspaceguru/GiantTetris",
"id": "c50815b9eee3f35000c96b08b540fdf599199f32",
"size": "381",
... |
def default_getter(attribute=None):
"""a default method for missing renderer method
for example, the support to write data in a specific file type
is missing but the support to read data exists
"""
def none_presenter(_, **__):
"""docstring is assigned a few lines down the line"""
r... | {
"content_hash": "109f6632bd50384561b4a57225377463",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 74,
"avg_line_length": 29.732142857142858,
"alnum_prop": 0.6408408408408408,
"repo_name": "chfw/pyexcel",
"id": "ad08709330840db0fc7d0bd27d393017de1900c0",
"size": "1665",
... |
from django.core.urlresolvers import reverse
from mox3.mox import IsA # noqa
from openstack_dashboard.test import helpers as test
from nec_portal.dashboards.admin.links import fixture
from nec_portal.dashboards.admin.links import views
INDEX_URL = reverse('horizon:admin:links:index')
class LinksV... | {
"content_hash": "0c1ea3ea86abbf0c4e4901ff2f23484a",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 72,
"avg_line_length": 33.12903225806452,
"alnum_prop": 0.6893865628042843,
"repo_name": "NECCSiPortal/NECCSPortal-dashboard",
"id": "4ee807408eeb294e8f1f70ba74c6653a9a92b8e3... |
import _plotly_utils.basevalidators
class SideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="side",
parent_name="layout.coloraxis.colorbar.title",
**kwargs
):
super(SideValidator, self).__init__(
plotly_name=plo... | {
"content_hash": "e8bec0a01cec045c6dfbcedc6f30ef89",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 70,
"avg_line_length": 31.833333333333332,
"alnum_prop": 0.5671902268760908,
"repo_name": "plotly/python-api",
"id": "efd98fe30662de3c57a760d10750fa2a2632bb3f",
"size": "57... |
from django.contrib import admin
from atados_core.models import Nonprofit, Project, User, Address, Role, Work, Job, City, AddressProject, Volunteer, Apply, Question, Banner, GoogleAddress, UploadedImage, Newsletter
from atados_core.models import JobDate
from django.core.exceptions import PermissionDenied
from django.h... | {
"content_hash": "1374526900876abb1e39181ee86b5fd4",
"timestamp": "",
"source": "github",
"line_count": 603,
"max_line_length": 234,
"avg_line_length": 35.18905472636816,
"alnum_prop": 0.6442810688533861,
"repo_name": "atados/api",
"id": "0df86c5e82f271691225633f5748cc1482262c1a",
"size": "21251",
... |
"""
Base backends structures.
This module defines base classes needed to define custom OpenID or OAuth
auth services from third parties. This customs must subclass an Auth and
and Backend class, check current implementation for examples.
Also the modules *must* define a BACKENDS dictionary with the backend name
(whic... | {
"content_hash": "0f9de354d6569cb94fdf1c0ab9367187",
"timestamp": "",
"source": "github",
"line_count": 817,
"max_line_length": 79,
"avg_line_length": 38.421052631578945,
"alnum_prop": 0.6006371455877668,
"repo_name": "makinacorpus/django-social-auth",
"id": "c518288b936d98d2fef1d6ca08cf49b56240caa8"... |
"""
Test module configuration for application 'rule'.
"""
__author__ = "Ariel Gerardo Rios ([email protected])"
from test_models import *
| {
"content_hash": "32bac91245add2583aa84b3026b0aea5",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 64,
"avg_line_length": 25,
"alnum_prop": 0.7133333333333334,
"repo_name": "ariel17/traffic",
"id": "6a941c4abdf15c43fb2d0e74c95b6948a2825596",
"size": "197",
"binary": fal... |
from impacket.structure import Structure
from impacket.dcerpc import ndrutils
from impacket.dcerpc.samr import SAMR_RPC_SID_IDENTIFIER_AUTHORITY, SAMR_RPC_SID
from impacket.uuid import uuidtup_to_bin
from impacket.nt_errors import ERROR_MESSAGES
import random
from struct import pack, unpack
MSRPC_UUID_LSARPC = uuidtup... | {
"content_hash": "859259d3049a56a517fcc481440c0866",
"timestamp": "",
"source": "github",
"line_count": 752,
"max_line_length": 208,
"avg_line_length": 34.82313829787234,
"alnum_prop": 0.6045366021308283,
"repo_name": "hecchi777/S3-SlaacSecuritySolution",
"id": "e3fe906eb25be5c5865c33e82382383d842cbe... |
"""
PlexPhoto
Attributes:
NA (TYPE): Description
"""
from plexapi import media, utils
from plexapi.utils import PlexPartialObject
NA = utils.NA
@utils.register_libtype
class Photoalbum(PlexPartialObject):
"""Summary
Attributes:
addedAt (TYPE): Description
art (TYPE): Description
... | {
"content_hash": "beb3d4e643196674076210feb5bb5c54",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 82,
"avg_line_length": 29.96,
"alnum_prop": 0.5824909403013542,
"repo_name": "Hellowlol/plexapi",
"id": "cb387ee430515d79ad2f56acbb113e2623106bb7",
"size": "5267",
"bina... |
import os
from flask import Flask, request
from subprocess import call
from simple_rec import run_rec
app = Flask(__name__)
@app.route('/rec',methods=['POST'])
def rec():
file=request.files['file']
file.save('search.png')
return str(run_rec())
if __name__ == "__main__":
app.run(host='0.0.0.0')
| {
"content_hash": "3a699228cdd7854bba308169a2b3ab88",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 35,
"avg_line_length": 22.357142857142858,
"alnum_prop": 0.6389776357827476,
"repo_name": "revan/facerecserver",
"id": "b7d94cb5906efb0eb578108853365528d6c302cb",
"size": "... |
from argparse import ArgumentParser
import sys, os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import pyfanova.fanova
import pyfanova.visualizer
def parameter_plotting(dataset, data_dir, plot_dir, pairwise=False):
plt.rcdefaults()
# IMO very sloppy way to do it... | {
"content_hash": "a5288d8fb671c1180493216c9d8c02c4",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 121,
"avg_line_length": 43.71264367816092,
"alnum_prop": 0.6058374967131213,
"repo_name": "hmendozap/master-arbeit-projects",
"id": "df1ceaeaaa823e831a52906876381e4f629f6068"... |
from __future__ import absolute_import
from __future__ import print_function
import unittest
import set_test_path
from weave_wdm_next_test_base import weave_wdm_next_test_base
import WeaveUtilities
class test_weave_wdm_next_mutual_subscribe_19(weave_wdm_next_test_base):
def test_weave_wdm_next_mutual_subscribe_1... | {
"content_hash": "1975ccbece874335055cc90bdb00f95f",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 173,
"avg_line_length": 58.431372549019606,
"alnum_prop": 0.5802013422818791,
"repo_name": "openweave/openweave-core",
"id": "d707a2207f2f167a1690cabcdd4d4bdf1c40645d",
"si... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import unittest
import yaml
from ray.autoscaler.autoscaler import fillout_defaults, validate_config
from ray.tests.utils import recursive_fnmatch
RAY_PATH = os.path.abspath(os.path.join(__file__, ".... | {
"content_hash": "39e9c59c98442613e762290bd0c3026c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 71,
"avg_line_length": 28.91176470588235,
"alnum_prop": 0.6541200406917599,
"repo_name": "ujvl/ray-ng",
"id": "ac7d6657b6906eedabdb0f1590a721d12fb5693a",
"size": "983",
"... |
'''OpenGL extension OES.rgb8_rgba8
This module customises the behaviour of the
OpenGL.raw.GLES1.OES.rgb8_rgba8 to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/OES/rgb8_rgba8.txt
'''
from OpenGL import platform, constant, arrays
... | {
"content_hash": "4e60efddccd463f60fa6a7a88d307959",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 71,
"avg_line_length": 32.34782608695652,
"alnum_prop": 0.7876344086021505,
"repo_name": "alexus37/AugmentedRealityChess",
"id": "90e8678f0abc7b25dbbf0a02a257d0a8162d1c89",
... |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | {
"content_hash": "fdebe28fee0cc4d31f3aaeec49e80f8f",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 267,
"avg_line_length": 41.439153439153436,
"alnum_prop": 0.5615423901940756,
"repo_name": "plaid/plaid-python",
"id": "c9af0928df17de362b6f789aaf455b7c16fa6ac0",
"size": ... |
ALLOWED_REPOS = ['https://github.com/USER1/PROJECT1', 'https://github.com/USER2/PROJECT2']
### Alternatively, add your list of permitted organisations here
ALLOWED_ORGS = ['ORG1', 'ORG2']
### Add your sender email. Remember, senders need to be admins on your AppEngine account.
EMAIL_FROM = "Me <[email protected]>"
## Ro... | {
"content_hash": "467e80078b0800cdd5346473501d68bf",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 91,
"avg_line_length": 54.714285714285715,
"alnum_prop": 0.7232375979112271,
"repo_name": "maniksurtani/github-emailhook",
"id": "1e86a9b3861da381118be9e7a9f89d9021b673b7",
... |
import tensorflow
import cv2
def handler(event, context):
return 0 | {
"content_hash": "c1a4285a9f3ed7c78ba9dc22ff89e35e",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 28,
"avg_line_length": 12,
"alnum_prop": 0.75,
"repo_name": "ryfeus/lambda-packs",
"id": "3fd1d7840af5b36d1f62b2dbd3f74b1c42a3dfa1",
"size": "72",
"binary": false,
"copi... |
import datetime
from django.test import TestCase, tag
from .models import *
from .helpers import get_quarter_verbose
from real_estate.test_helper import (
create_mock_image_file,
create_neighbourhood,
create_street,
)
NULL_PRICE = ''
NULL_DATE_OF_CONSTRUCTION = ''
def create_builder():
_objects =... | {
"content_hash": "7d592fe89fd92fc3c012defc7cf5546f",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 79,
"avg_line_length": 34.62126245847176,
"alnum_prop": 0.5978313021782938,
"repo_name": "Dybov/real_estate_agency",
"id": "2c0c1920b64e1f066f60eb503ad239b1d12f3c5a",
"siz... |
"""RNN models of BasisNet with LSTM cells.
It implements a RNN wrapper with specialized LSTM cell with bases
for the kernels.
"""
import functools
from typing import Optional
import tensorflow as tf
CLIENT_SZIE = 500000
class BasisRNNLayer(tf.keras.layers.Layer):
"""A RNN wrapper using LSTM cell with Basis ker... | {
"content_hash": "fd0af53bb33690d2c6a28ab1fee3193c",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 80,
"avg_line_length": 35.316770186335404,
"alnum_prop": 0.6475553992261696,
"repo_name": "google-research/google-research",
"id": "5cfb9e66584ba8f1b4bd8bad08a1ba507744b7d6"... |
import datetime
import re
import simplejson
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models import signals
from oembed.constants import DEFAULT_OEMBED_TTL, MIN_OEMBED_TTL, RESOURCE_TYPES
from oembed.exceptions import AlreadyRegistered, NotRegistered, O... | {
"content_hash": "5c1bd3e54643c9cb77e4a40ced9f14a3",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 102,
"avg_line_length": 37.542986425339365,
"alnum_prop": 0.5751476437266482,
"repo_name": "ericholscher/djangoembed",
"id": "bb1969b43b9ce1c9f2c6565860f2a1d20ba3ee15",
"s... |
from __future__ import absolute_import
import json
import functools
import re
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
import tornado.web
import tornado.auth
from tornado import httpclient
from tornado.options import options
from celery.utils.imports import in... | {
"content_hash": "0da1eb34df5256eb61114d7951f96a70",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 99,
"avg_line_length": 35.0125,
"alnum_prop": 0.5915744377008212,
"repo_name": "asmodehn/flower",
"id": "cbfb92a13cbf7a0ba3b3f8af8a8ab9096ed1222f",
"size": "5602",
"bina... |
from types import LambdaType
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import nlopt
import numpy as np
from meep import Block, EigenModeSource, MaterialGrid, Simulation, Vector3, Volume
from meep.adjoint import DesignRegion, EigenmodeCoefficient, OptimizationProblem
from meep.visualization i... | {
"content_hash": "6eaa6f104088591ce416f5033f3ae171",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 112,
"avg_line_length": 33.95567867036011,
"alnum_prop": 0.637379670419318,
"repo_name": "gdsfactory/gdsfactory",
"id": "be27df166ed4bdcbd25c49a739dc718476f55b95",
"size":... |
import os
import pickle
import numpy as np
import h5py
from sklearn.externals import joblib
from gala import imio, agglo, features, classify
fman = features.default.snemi3d()
def train(index):
outfn = 'training-data-%i.h5' % index
if os.path.exists(outfn):
data, labels = classify.load_training_data_f... | {
"content_hash": "e8a21aaa32a1a20896fd2a61213a3877",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 98,
"avg_line_length": 40.06024096385542,
"alnum_prop": 0.5759398496240602,
"repo_name": "jni/gala-scripts",
"id": "e7fc79d3dd97a795e1c596ec0460d8cbeea3d96a",
"size": "3325... |
import re
import subprocess
class ArpScraper(object):
# this entire class is obviously full of peril and shame
# ... only tested on Ubuntu 14.04...
# A cursory search for python arp libraries returned immature
# libraries focused on crafting arp packets rather than querying
# known system data, so ... | {
"content_hash": "127ce52e78dff63a718266377575aa2f",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 69,
"avg_line_length": 32.3235294117647,
"alnum_prop": 0.545950864422202,
"repo_name": "timfreund/ceph-libvirt-clusterer",
"id": "a4280a2daf7666ddb59d7859c8aa6e15e1db3509",
... |
from google.cloud import recaptchaenterprise_v1
async def sample_retrieve_legacy_secret_key():
# Create a client
client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient()
# Initialize request argument(s)
request = recaptchaenterprise_v1.RetrieveLegacySecretKeyRequest(
key="key_v... | {
"content_hash": "27549db01e16dc2aae2e14f1f506772c",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 97,
"avg_line_length": 30.263157894736842,
"alnum_prop": 0.7617391304347826,
"repo_name": "googleapis/python-recaptcha-enterprise",
"id": "23e9e9a24dfde6058504f21d0c153ea914b... |
import httplib
import collections
import types
import time
from urllib import urlencode
from .signatures import generate_hmac_signature, HttpRequest
from .responses import *
class PayPalAPInterface(object):
def __init__(self, config=None, **kwargs):
if config:
self.config = config
el... | {
"content_hash": "f9864a3eeab9adff81b56ef6b39fa3b0",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 81,
"avg_line_length": 38.20454545454545,
"alnum_prop": 0.6006841165972635,
"repo_name": "softak/webfaction_demo",
"id": "b146a40f767337fc6ab0effee589786203753b1e",
"size"... |
from google.appengine.ext import ndb
import server.seed
import datetime
from datetime import timedelta
class Aire(ndb.Model):
id = ndb.StringProperty(indexed=False)
timestamp = ndb.DateTimeProperty()
parameter = ndb.IntegerProperty()
tecnic = ndb.IntegerProperty(indexed=False)
period = ndb.IntegerP... | {
"content_hash": "2cc0840b4fd52ee849541d4bf986488c",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 155,
"avg_line_length": 44,
"alnum_prop": 0.7454545454545455,
"repo_name": "emarinizquierdo/breathe-better",
"id": "2d393ecbdeabdab4127af11c5b5fe5f0b8a7b346",
"size": "1320... |
import pandas
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cross_validation import train_test_split
from sklearn.metrics import mean_squared_error
from sklearn.linear_model import LinearRegression
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from datetime import timedelta
... | {
"content_hash": "ae689f38b1dc5946881f272c240451a7",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 102,
"avg_line_length": 27.140350877192983,
"alnum_prop": 0.7634130575307045,
"repo_name": "sudikrt/costproML",
"id": "dc82aea06da0c53d35d120952e51bd5debaae772",
"size": "1... |
from __future__ import with_statement
import os
from fabric.api import hide, get
from fabric.contrib.files import upload_template, contains
from fabric.context_managers import lcd
from utils import FabricTest, eq_contents
from server import server
class TestContrib(FabricTest):
# Make sure it knows / is a direc... | {
"content_hash": "df116b96c7012abe7f753f2d67292141",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 100,
"avg_line_length": 35.38709677419355,
"alnum_prop": 0.5666362807657247,
"repo_name": "cmattoon/fabric",
"id": "1143a618a2b437e3ab62e67a4c5b645b790476f5",
"size": "550... |
from __future__ import annotations
import os
import re
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Callable, ClassVar, Iterator, Optional, cast
from typing_extensions import final
from pants.backend.docker.registries import ALL_DEFAULT_REGISTRIES
from pants.base.build_env... | {
"content_hash": "ed2e7c7be65cf4838fd8748ce47c44d2",
"timestamp": "",
"source": "github",
"line_count": 459,
"max_line_length": 148,
"avg_line_length": 32.869281045751634,
"alnum_prop": 0.6535427851792934,
"repo_name": "benjyw/pants",
"id": "28653c0958d6ea5f0afbc4d48471e2a3fbdfc100",
"size": "15219... |
try:
from msrest.exceptions import (
ClientException,
SerializationError,
DeserializationError,
TokenExpiredError,
ClientRequestError,
AuthenticationError,
HttpOperationError,
)
except ImportError:
raise ImportError("You need to install 'm... | {
"content_hash": "efa799915a406e77f62de0f0a6dedf87",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.6782945736434108,
"repo_name": "dstrockis/outlook-autocategories",
"id": "4db6a136b512ada1569351839279121cedf15700"... |
from __future__ import unicode_literals
import django
from django.contrib.contenttypes.models import ContentType
from django.db import IntegrityError, models, transaction
from django.db.models.query import QuerySet
from django.template.defaultfilters import slugify as default_slugify
from django.utils.encoding import ... | {
"content_hash": "cac499ed9771523265cff3088ad1dfbd",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 92,
"avg_line_length": 31.66826923076923,
"alnum_prop": 0.5873690602702293,
"repo_name": "7kfpun/django-taggit",
"id": "0418beb7dbb3517ceefd14aee10312c6f62bc47d",
"size": ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounting', '0017_nonnullable_char_fields'),
]
operations = [
migrations.AlterField(
model_name='subscription',
name='no_invoice_reason',
field=models.C... | {
"content_hash": "aa014dc9ca13c30a7fe5b3ab511bb0c9",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 75,
"avg_line_length": 28.608695652173914,
"alnum_prop": 0.5835866261398176,
"repo_name": "dimagi/commcare-hq",
"id": "14e2328b0f63b94342c02528c7fa92b5b768015a",
"size": "7... |
"""
gurl.py
Created by Greg Neagle on 2013-11-21.
Modified in Feb 2016 to add support for NSURLSession.
Updated June 2019 for compatibility with Python 3 and PyObjC 5.1.2+
curl replacement using NSURLConnection and friends
Tested with PyObjC 2.5.1 (inlcuded with macOS)
and with PyObjC 5.2b1. Should also work with Py... | {
"content_hash": "f0ba7a6423a5a7b08cedc451b03aa46b",
"timestamp": "",
"source": "github",
"line_count": 688,
"max_line_length": 82,
"avg_line_length": 42.80523255813954,
"alnum_prop": 0.6253989813242784,
"repo_name": "erikng/installapplications",
"id": "effac34577f72a792f7295d193c1da19998bfd44",
"s... |
man = 1
wives = man * 7
madai = wives * 7
cats = madai * 7
kitties = cats * 7
total = man + wives + madai + cats + kitties
print(total)
| {
"content_hash": "2c660b90ea90c0542873acf738460d99",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 44,
"avg_line_length": 19.428571428571427,
"alnum_prop": 0.625,
"repo_name": "1ta/study_python",
"id": "b860c3a59cb8de8dc50176bb798930cb302a5671",
"size": "136",
"binary":... |
from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='dish',
version=version,
description="Distributed shared memory tools",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='dis... | {
"content_hash": "60a2ea14480854ca4be4b53d7a487e47",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 95,
"avg_line_length": 27.96153846153846,
"alnum_prop": 0.6052269601100413,
"repo_name": "desmaj/dish",
"id": "7f06a8b4eb35b3a51b320bb55734e80c60a70f83",
"size": "727",
"... |
import pytest
import numpy as np
import sympy as sp
import numpy.testing as npt
from simupy.systems.symbolic import DynamicalSystem, dynamicsymbols
from simupy.systems import (need_state_equation_function_msg,
zero_dim_output_msg)
from simupy.array import Array, r_
x = x1, x2 = Array(dynami... | {
"content_hash": "267929a9cdafdd78f465f173b90cc8f9",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 75,
"avg_line_length": 37.0377358490566,
"alnum_prop": 0.6174223127865512,
"repo_name": "simupy/simupy",
"id": "190b4e2beb8995c8954c8057b04bd167a5c9bfd7",
"size": "1963",
... |
"""This file contains the descriptions and settings for all modules. Also it contains functions to add modules and so on"""
try:
import json
except ImportError:
import simplejson as json
from flask import jsonify, render_template, request
from maraschino.database import db_session
import maraschino
import co... | {
"content_hash": "8be446e44044ffa9fd1c703b6043e492",
"timestamp": "",
"source": "github",
"line_count": 1063,
"max_line_length": 127,
"avg_line_length": 29.454374412041393,
"alnum_prop": 0.43688917278824657,
"repo_name": "runjmc/maraschino",
"id": "c78cd89be7df0e96af5bad53a2cffafb87366669",
"size":... |
import sys
from fcgi import WSGIServer
import os
import atexit
import cherrypy
import cherrypy._cpwsgi
import turbogears
turbogears.update_config(configfile="C:\\workspace\\eCRM\\prod.cfg", modulename="ecrm.config")
from ecrm.controllers import Root
cherrypy.root = Root()
if cherrypy.server.state == 0:
atexit.... | {
"content_hash": "39ce27fb7041ee4268620dc3921a9182",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 94,
"avg_line_length": 26.444444444444443,
"alnum_prop": 0.726890756302521,
"repo_name": "LamCiuLoeng/bossini",
"id": "6b9d185c8b53b40d1e75f5884d3f6fa54804fede",
"size": "7... |
import subprocess, os, base64
from cantools import config
from cantools.util import log, error, read, write, mkdir
# jsmin was removed from the cantools requirements to reduce
# the maintenance burden for deployments on older systems
# (often with some degree of broken package management) that
# don't need to compile ... | {
"content_hash": "ef1cad1d58b5fe0110fc56a32468322c",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 179,
"avg_line_length": 40.149812734082396,
"alnum_prop": 0.5728544776119403,
"repo_name": "bubbleboy14/cantools",
"id": "a157e6aa06941e23ee2d0dd64dfab2950946c72d",
"size"... |
import mock
import webob
from jacket.api.compute.openstack.compute.legacy_v2.contrib import server_external_events \
as server_external_events_v2
from jacket.api.compute.openstack.compute import server_external_events \
a... | {
"content_hash": "53570ae5d1ab80416876840040fb5ab8",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 91,
"avg_line_length": 43.486301369863014,
"alnum_prop": 0.5986769570011026,
"repo_name": "HybridF5/jacket",
"id": "76e535182f42462a5ea2f38acddec01f3054f60d",
"size": "695... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.test import Client
from django.core.urlresolvers import reverse
from bot.testing.utils import LogosTestCase
from .bot_plugin import MemosPlugin
# Create your tests here.
from .models i... | {
"content_hash": "c52cdd4a51ec4374bfe18d982473fda2",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 90,
"avg_line_length": 36.558282208588956,
"alnum_prop": 0.59456284611512,
"repo_name": "kiwiheretic/logos-v2",
"id": "80c19988db562e4e96491467b70b150a92107ca4",
"size": "... |
"""
pybufrkit.decoder
~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import
from __future__ import print_function
import sys
import functools
import logging
# noinspection PyUnresolvedReferences
from six.moves import range
from pybufrkit.constants import (BITPOS_START,
MESSAGE... | {
"content_hash": "708c8ddac5e7255d9eea9619281e6798",
"timestamp": "",
"source": "github",
"line_count": 451,
"max_line_length": 112,
"avg_line_length": 45.330376940133036,
"alnum_prop": 0.6136274701623948,
"repo_name": "ywangd/pybufrkit",
"id": "044e9ef8699f91378768a52d4c79e41da1944e12",
"size": "2... |
import copy
from tempest.lib.api_schema.response.compute.v2_26 import servers as servers226
create_backup = {
'status_code': [202],
'response_body': {
'type': 'object',
'properties': {
'image_id': {'type': 'string', 'format': 'uuid'}
},
'additionalProperties': False... | {
"content_hash": "5ac1a0d189b22c027a26c2053a6d5c77",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 79,
"avg_line_length": 46.24324324324324,
"alnum_prop": 0.7504383401519579,
"repo_name": "openstack/tempest",
"id": "cb0fc134652368c59c5cafe5a0a2eeea9c148210",
"size": "228... |
"""Automatically format references in a LaTeX file."""
import argparse
from multiprocessing import Pool
from reference_utils import Reference, extract_bibtex_items
from latex_utils import read_latex_file, write_latex_file
class ReferenceFormatter:
def __init__(self, add_arxiv):
self.add_arxiv = add_arxi... | {
"content_hash": "127b6fe567d1998184a5de13e233d5a1",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 192,
"avg_line_length": 44.523809523809526,
"alnum_prop": 0.7,
"repo_name": "teunzwart/latex-production-tools",
"id": "f670021d80d6cae2498ea3274e3932292a4b1902",
"size": "1... |
'''
Created on Jun 4, 2014
@author: sstober
'''
# import socket;
import logging;
log = logging.getLogger(__name__);
import argparse;
import random;
from deepthought.util.config_util import init_logging, load_config_file, empty_config;
from deepthought.util.yaml_util import load_yaml_template, load_yaml;
from deepthoug... | {
"content_hash": "ac18b09299ff28022d02f6a520fb628a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 132,
"avg_line_length": 33.44776119402985,
"alnum_prop": 0.5899152164212406,
"repo_name": "sstober/deepthought",
"id": "c5fb60f8704d46a5630dd30914749de28a7891b2",
"size": "... |
from werkzeug import check_password_hash, generate_password_hash
from antiques import db
from antiques.core.date import utc_now
from antiques.core.mixins import ActiveRecordMixin
class User(ActiveRecordMixin, db.Model):
""" regular user """
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key... | {
"content_hash": "8c2ccfed31d1ce49e32a86477a4b1f7a",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 71,
"avg_line_length": 27.22222222222222,
"alnum_prop": 0.6653061224489796,
"repo_name": "vgamula/breakyourantiques",
"id": "d11c9b899cb9b0c41873f888358281b23cd0a183",
"siz... |
from collections import defaultdict, namedtuple
from . import globalvars
try:
basestring
except NameError: # python 3
basestring = str
def stringArray(strings):
return "[NSArray arrayWithObjects:%s,nil]" % ','.join(('@"%s"' % s) for s in strings)
def wrapString(s):
s = s.replace('\n', '\\n').replace(... | {
"content_hash": "a47c035458ec6b5641ef02cd611546a1",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 112,
"avg_line_length": 34.43636363636364,
"alnum_prop": 0.6078845476944738,
"repo_name": "hsoft/xibless",
"id": "a9949901b3a5fb07b05fc55c37a1e98a53951044",
"size": "5682"... |
"""TFDS dataset for SKAI."""
import dataclasses
import tensorflow as tf
import tensorflow_datasets as tfds
@dataclasses.dataclass
class SkaiDatasetConfig(tfds.core.BuilderConfig):
"""Configuration for SKAI datasets.
Any of the attributes can be left blank if they don't exist.
Attributes:
labeled_train_pa... | {
"content_hash": "7da530eace0dd78d7a94b2038505458a",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 79,
"avg_line_length": 36.88421052631579,
"alnum_prop": 0.6532534246575342,
"repo_name": "google-research/skai",
"id": "fa0ad068be60786582cf100596b61cd18ebf314e",
"size": "... |
from django import forms
from django.forms import Form
from django.template import loader
from django.core.mail import EmailMultiAlternatives
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.shortcuts import get_current_site
from django.utils.encoding import force_bytes
from djan... | {
"content_hash": "14ee9b138e9d113fb4f8637decbe0f43",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 287,
"avg_line_length": 54.78688524590164,
"alnum_prop": 0.6666666666666666,
"repo_name": "anderson7ru/bienestarues",
"id": "834af450898f631f3e7834810ec0eba404d2dc7f",
"si... |
from gapic.schema import wrappers
MIXINS_MAP = {
'DeleteOperation': wrappers.MixinMethod(
'DeleteOperation',
request_type='operations_pb2.DeleteOperationRequest',
response_type='None'
),
'WaitOperation': wrappers.MixinMethod(
'WaitOperation',
request_type='operations... | {
"content_hash": "0abbd3597806123eb6101dcc03cb3e4c",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 65,
"avg_line_length": 34.98148148148148,
"alnum_prop": 0.6701958708311275,
"repo_name": "googleapis/gapic-generator-python",
"id": "89fccdd573dc4a7d9029adf2b8d8aa5a09b757c3"... |
import re
import string
import ConfigParser
import os
import sys
import socket
import fcntl
import struct
import base64
import zlib
import json
import time
import subprocess
import urllib
import urllib2
from core.utils import Utils
class Colors(object):
N = '\033[m' # native
R = '\033[31m' # red
G = '\033... | {
"content_hash": "ab2f585f03b4f12ab83c51110418a0d3",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 165,
"avg_line_length": 33.58128078817734,
"alnum_prop": 0.5386533665835411,
"repo_name": "ru-faraon/SPF",
"id": "2f12874500ebaf469f395c47aff0b28aa23b261e",
"size": "6817"... |
from example.api.controllers.v1 import controller
Controller = controller.Controller
__all__ = (Controller)
| {
"content_hash": "2b9ad4039a180c8b77f6176efce25736",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 49,
"avg_line_length": 22,
"alnum_prop": 0.7818181818181819,
"repo_name": "JimJiangX/BoneDragon",
"id": "44e8ef72c80ee9b9700b24be7d957c3a50022832",
"size": "259",
"binary"... |
import bigtempo.processors.dataframe_task as task
def sample_datasource_factory(cls):
return cls()
datasource_factory = sample_datasource_factory
task_factory = task.factory
| {
"content_hash": "2d3c735db7b18044e67bcd384335e5f0",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 49,
"avg_line_length": 20.22222222222222,
"alnum_prop": 0.7857142857142857,
"repo_name": "rhlobo/bigtempo",
"id": "5bb6a659a5e2b9649bce24279d4ae54092580034",
"size": "208",
... |
"""Contains calculation of various derived indices."""
import numpy as np
from .thermo import mixing_ratio, saturation_vapor_pressure
from .tools import _remove_nans, get_layer
from .. import constants as mpconsts
from ..package_tools import Exporter
from ..units import check_units, concatenate, units
from ..xarray im... | {
"content_hash": "209bbeb4b42e96a7e9593452edc6a780",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 94,
"avg_line_length": 35.635883905013195,
"alnum_prop": 0.6302384125573819,
"repo_name": "ShawnMurd/MetPy",
"id": "f297e25ceb1dd328df07af954f00ea296e74f1b7",
"size": "136... |
from spa.models.mix import Mix
from spa.models.basemodel import BaseModel
from django.db import models
class Tracklist(BaseModel):
mix = models.ForeignKey(Mix, related_name='tracklist')
index = models.SmallIntegerField()
timeindex = models.TimeField(null=True)
description = models.CharField(max... | {
"content_hash": "a2a9b46c982e2a6b2fc83b5bc00ba333",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 58,
"avg_line_length": 40.07692307692308,
"alnum_prop": 0.7293666026871402,
"repo_name": "fergalmoran/dss",
"id": "fbd50658e21e7d692cc78d7f87ec57c5ffdb0f77",
"size": "521",... |
import fileio
from reg import fetch, assign, CONT
from stats import goto_stats
INSTR = 'INSTR'
NO_INSTR = '"???"'
DONE = 'DONE'
@goto_stats
def goto(label):
fileio.write_file(INSTR, _convert_label(label))
def curr_instr():
return fileio.read_file(INSTR, NO_INSTR)
# these aren't strictly necessary, but t... | {
"content_hash": "44703b7f28460b91ba078c6a231f9e17",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 63,
"avg_line_length": 20.571428571428573,
"alnum_prop": 0.6972222222222222,
"repo_name": "nickdrozd/ecio-lisp",
"id": "ec34f92688bd44762db2ffc3684ac3c5fe4ac013",
"size": "... |
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.sites.models import get_current_site
from django.http import HttpResponse
from django.shortcuts import render
from content_edit.models import CmsContent
@staff_member_required
def ajax_save_content(request):
""" Save front ... | {
"content_hash": "b2cc961b0f9f73e9a61870a217e32078",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 71,
"avg_line_length": 38.55,
"alnum_prop": 0.7535667963683528,
"repo_name": "avinashdevicode/django-content-edit-master",
"id": "e1634b244776cdff6561c1ba823c050f983e0d41",
... |
from enum import Enum
from functools import wraps
import panoply.datasource
from .exceptions import DataSourceException
ERROR_CODES_REGISTRY = {
400: 'Bad request',
401: 'Unauthorized',
403: 'Permissions error',
404: 'Resource is not found',
408: 'Timeout',
422: 'Parsing error',
429: 'Rate... | {
"content_hash": "f2f0f562bf3e438011dd832ff0a13bdb",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 113,
"avg_line_length": 32.04255319148936,
"alnum_prop": 0.5537848605577689,
"repo_name": "panoplyio/panoply-python-sdk",
"id": "da671757b49c3a06221c7bce88031234c463856f",
... |
"""
Commands for setting temporary breakpoints on the next
instruction of some type (call, branch, etc.)
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import capstone
import gdb
import pwndbg.disasm
i... | {
"content_hash": "4bf33408b18e93ce74ee9b6ea26c198b",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 132,
"avg_line_length": 25.240506329113924,
"alnum_prop": 0.6191073219658977,
"repo_name": "cebrusfs/217gdb",
"id": "9e86f75a07a8cfbed4087345d5c2ad4f1eecf830",
"size": "40... |
import _plotly_utils.basevalidators
class ShapeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="shape", parent_name="scatterternary.line", **kwargs
):
super(ShapeValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | {
"content_hash": "d81bca216b0b16b62c079001a98e0704",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 78,
"avg_line_length": 35.266666666666666,
"alnum_prop": 0.5879017013232514,
"repo_name": "plotly/python-api",
"id": "74dcf83e26aef5ea8f144dc4f8b472bc6c10a01d",
"size": "52... |
VERSION = '0.3.10'
DEFAULT_SWAGGER_SETTINGS = {
'exclude_url_names': [],
'exclude_namespaces': [],
'api_version': '',
'api_path': '/',
'api_key': '',
'relative_paths': False,
'token_type': 'Token',
'enabled_methods': ['get', 'post', 'put', 'patch', 'delete'],
'is_authenticated': Fal... | {
"content_hash": "541e04a28e3ac8970c5fe611a601c656",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 71,
"avg_line_length": 31.136363636363637,
"alnum_prop": 0.6160583941605839,
"repo_name": "visasq/django-rest-swagger",
"id": "813de1e665624c4ba9d0fcb7a49a2caae8a4b73c",
"s... |
"""
This module allows you to analyse OCaml source code, autocomplete,
and infer types while writing.
"""
import functools
import sublime
import sublime_plugin
import re
import os
import sys
if sys.version_info < (3, 0):
from merlin.process import MerlinProcess
from merlin.helpers import merlin_pos, only_ocam... | {
"content_hash": "8334fa94c5129921a3969348e16b9e6c",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 113,
"avg_line_length": 29.300556586270872,
"alnum_prop": 0.5981764072690432,
"repo_name": "frantic/sublime-text-merlin",
"id": "514407871bbaa4b38727b843b2a0c806706efd45",
... |
"""
Unit Tests for ml2 rpc
"""
import collections
import mock
from sqlalchemy.orm import exc
from neutron.agent import rpc as agent_rpc
from neutron.common import constants
from neutron.common import exceptions
from neutron.common import rpc as n_rpc
from neutron.common import topics
from neutron.openstack.common im... | {
"content_hash": "950ea4407609ae8a4a5efa12b4356ccc",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 78,
"avg_line_length": 45.066914498141266,
"alnum_prop": 0.5520085787346366,
"repo_name": "redhat-openstack/neutron",
"id": "0d51a9e2736f3c53e8852fd59a4c3c98f9eb59bc",
"si... |
from kafkaka.gevent_patch import KafkaClient
from gevent import joinall
from gevent import spawn, sleep
import gevent
import time
from gevent.server import StreamServer
gevent.monkey.patch_all()
def test(c):
i=0
while 1:
i += 1
for j in xrange(0, 500):
c.send_message('im-msg', u'你... | {
"content_hash": "b5aff214cb4711b1a13e321fcaa10d6f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 96,
"avg_line_length": 30.09375,
"alnum_prop": 0.5607476635514018,
"repo_name": "wesdu/kafkaka",
"id": "ef0f3bffb42ca121ec7ac4bd97c061e5435deddb",
"size": "983",
"binary"... |
"""Create a new site."""
import datetime
import io
import json
import os
import shutil
import textwrap
import unidecode
from urllib.parse import urlsplit, urlunsplit
import dateutil.tz
import dateutil.zoneinfo
from mako.template import Template
from pkg_resources import resource_filename
import nikola
from nikola.ni... | {
"content_hash": "fcff02e867f049d76d0649d9ea1a473d",
"timestamp": "",
"source": "github",
"line_count": 499,
"max_line_length": 224,
"avg_line_length": 41.13627254509018,
"alnum_prop": 0.5547815072830906,
"repo_name": "getnikola/nikola",
"id": "4607758b6ee085f351bb8e14cff398aa0aa5be18",
"size": "21... |
"""
MATRIX -> IMAGE.
Use imgmap.py with mapimg.py.
All image in folder with two colors.
$ imgmap.py | mapimg.py 222,0,222,220 100,220,0,200
Args.
$ imgmap.py test.png | mapimg.py 222,0,222,220
Stdin.
$ echo 'test.png' | imgmap.py | mapimg.py 222,0,222,220
Stdout.
$ imgmap.py icon.png >> out.txt
"""
__version__ = 1.0... | {
"content_hash": "6c00c2c73bac6d8e9d171e18b30b80cf",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 77,
"avg_line_length": 31.884057971014492,
"alnum_prop": 0.5861363636363637,
"repo_name": "schwarzbox/Tools-Python3",
"id": "451421a3280db0d58957a5c572f5c144d383524f",
"si... |
'''
Trains different classifiers on the Emobase 2010 dataset
'''
# Add path to our module(s).
import sys
import os
import pickle
import argparse
sys.path.append("../src/python")
import motherese
# Paths.
FEATS_DIR = "../feats"
MODEL_DIR = "../models"
import numpy as np
from sklearn import svm
from sklearn im... | {
"content_hash": "8018cc02ec761fa45bc72646fabce18e",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 139,
"avg_line_length": 37.90217391304348,
"alnum_prop": 0.6435331230283912,
"repo_name": "sebschu/cds-detector",
"id": "69285ee91a05f2e5b8332fcfa95d4458629f6ab8",
"size": ... |
""" Test module for 3-boidy phase space
"""
# =============================================================================
from ostap.core.pyrouts import Ostap, SE
from ostap.utils.gsl import gslCount
from ostap.logger.colorized import attention
import ostap.logger.table as T
from ostap.... | {
"content_hash": "cec241529ccd133f3731057d2a17b621",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 119,
"avg_line_length": 43.172413793103445,
"alnum_prop": 0.5117145899893504,
"repo_name": "OstapHEP/ostap",
"id": "5d7cb114728ca774a5407d9bb42a3f16d34369e2",
"size": "792... |
from parameters import applyPreset, preset, presetTree, group, \
registerPreset, allPresets, BadPreset, defaults, PCall, pcall
from parameters.runtime import Delta, Direct
from pmodule import PModule, pmodule, addToRunQueue
from manager import initialize, manager, reset, clean
from configuration import configT... | {
"content_hash": "bd27e766fa51aad999e1ead99c6ce4c1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 66,
"avg_line_length": 26.307692307692307,
"alnum_prop": 0.8070175438596491,
"repo_name": "hoytak/lazyrunner",
"id": "da3c73beca7d273761948335778cfcc76bb2271e",
"size": "34... |
from __future__ import print_function
from . import ble_cli
from .transport import Transport
class Transport_BLE(Transport):
def __init__(self, service_uuid, nu_lookup):
self.nu_lookup = nu_lookup
self.service_uuid = service_uuid
self.name_uuid_lookup = None
# Expect service UUID ... | {
"content_hash": "ba064be8b0a360e7521821fef508f432",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 89,
"avg_line_length": 44.875,
"alnum_prop": 0.6262766945218199,
"repo_name": "espressif/esp-idf",
"id": "3baa9be96fedd6125f0564ecf358e72a13b449b2",
"size": "2267",
"bina... |
from platformio.platforms.base import BasePlatform
class TitivaPlatform(BasePlatform):
"""
An embedded platform for TI TIVA C ARM microcontrollers
(with Energia Framework)
"""
PACKAGES = {
"toolchain-gccarmnoneeabi": {
"alias": "toolchain",
"default": Tru... | {
"content_hash": "62cae4cb0ddd707629d44e7e7a025ac4",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 63,
"avg_line_length": 19.677419354838708,
"alnum_prop": 0.4918032786885246,
"repo_name": "aphelps/platformio",
"id": "2c798e13c545567e84d561306b554f4fc5bc3117",
"size": "6... |
from .util import avg
from .util import jaccard
from .util import ngrams
def features(record):
return [set(ngrams(attr, k=2, step=1)) for attr in record]
def hit(query_features, result_features):
return avg(list(map(jaccard, query_features, result_features)))
| {
"content_hash": "ef29a153ed221edfeb26ec09c407b8d0",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 67,
"avg_line_length": 24.727272727272727,
"alnum_prop": 0.7316176470588235,
"repo_name": "rschwager-mm/polymr",
"id": "fcb9614fc4b197dd567dbe6e1545db25ea0f5cf8",
"size": "... |
from mitmproxy import controller
from mitmproxy import http
from mitmproxy import tcp
from mitmproxy import websocket
Events = frozenset([
"clientconnect",
"clientdisconnect",
"serverconnect",
"serverdisconnect",
"tcp_start",
"tcp_message",
"tcp_error",
"tcp_end",
"http_connect",
... | {
"content_hash": "934c5a3f6935eeeff041f38b79234e3b",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 48,
"avg_line_length": 23.136986301369863,
"alnum_prop": 0.5630550621669627,
"repo_name": "dwfreed/mitmproxy",
"id": "53f236ca3bcaab72901f251a73f492da1c41734a",
"size": "16... |
import unittest
import logging
from tests.test_source import SourceTestCase
from dipper.sources.OMIA import OMIA
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__)
class OMIATestCase(SourceTestCase):
def setUp(self):
self.source = OMIA('rdf_graph', True)
self.source... | {
"content_hash": "6750c22a149d1720520847f7679eab63",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 45,
"avg_line_length": 20.833333333333332,
"alnum_prop": 0.67,
"repo_name": "monarch-initiative/dipper",
"id": "c7fce9a3ab12107bdb42d10935ba4e853e49186b",
"size": "524",
... |
from __future__ import absolute_import, unicode_literals
from django.http import HttpResponse, HttpResponseRedirect
from wagboot.models import WebsiteSettings
def robots_txt(request):
website_settings = WebsiteSettings.for_site(request.site)
return HttpResponse(content=website_settings.robots_txt or "Allow... | {
"content_hash": "02270376e80848092452e9939516e6ff",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 102,
"avg_line_length": 30.217391304347824,
"alnum_prop": 0.7467625899280576,
"repo_name": "wagboot/wagboot",
"id": "7f010cba7965301c09a5ae99ec9044e88c0ef974",
"size": "719... |
import os
import sys
import numpy as np
from mayavi.mlab import surf, show, figure, axes, points3d
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
sys.path.append("src/python/modules")
from regression import *
def list_datafiles(path):
"""
Return a list of files with experimental data... | {
"content_hash": "c3561db860616c119e79513a7ee1d688",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 89,
"avg_line_length": 26.833333333333332,
"alnum_prop": 0.5957955088389871,
"repo_name": "carlgonz/u-fit",
"id": "4d7dba82a9a6e198a2c738f2b30322ca0ca3d526",
"size": "2093"... |
"""
A module for managing apps, specs, requirements, and for starting jobs.
"""
import biokbase.auth as auth
from .job import Job
from .jobmanager import JobManager
from .jobcomm import JobComm
from . import specmanager
import biokbase.narrative.clients as clients
from biokbase.narrative.widgetmanager import WidgetMana... | {
"content_hash": "d90d522dbc17bb7ce434918cf3fd30b3",
"timestamp": "",
"source": "github",
"line_count": 850,
"max_line_length": 108,
"avg_line_length": 42.35058823529412,
"alnum_prop": 0.5313906328129341,
"repo_name": "pranjan77/narrative",
"id": "5640ec3e4f4361f32847f49838a538ea3ecfcbdb",
"size": ... |
import copy
import pytest
from configuration import available_ports, ALL_TEST_CIPHERS, ALL_TEST_CURVES, ALL_TEST_CERTS
from common import ProviderOptions, Protocols, data_bytes
from fixtures import managed_process
from providers import Provider, S2N, OpenSSL, GnuTLS
from utils import invalid_test_parameters, get_param... | {
"content_hash": "7d7b771c6744ed11a8fa3ff79a60ced5",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 120,
"avg_line_length": 43.264150943396224,
"alnum_prop": 0.6864369821194941,
"repo_name": "PKRoma/s2n",
"id": "769f9523cc3da19ff1b79d5b247a7ac36e1c6024",
"size": "6879",
... |
import sys
from django.shortcuts import render
from circuits.models import Provider, Circuit
from dcim.models import Site, Rack, Device, ConsolePort, PowerPort, InterfaceConnection
from extras.models import UserAction
from ipam.models import Aggregate, Prefix, IPAddress, VLAN, VRF
from secrets.models import Secret
fr... | {
"content_hash": "2a7877b84ad6ea4e5ed0000a7a12ab79",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 115,
"avg_line_length": 31.741935483870968,
"alnum_prop": 0.6529471544715447,
"repo_name": "rfdrake/netbox",
"id": "2da97a2cf23948a08ed38659419cd8e3402c0740",
"size": "1968... |
'''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import os
import sys
import subprocess
# set path to common libraries
sys.path.append(subprocess.check_output("git rev-parse --show-toplevel", shell=True).rstrip("\n") + "/test/common")
import fit_common
# Select test group here using @attr
from nose.plugin... | {
"content_hash": "eed3b5eaae16f96569d308582b2c99a8",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 125,
"avg_line_length": 50.61538461538461,
"alnum_prop": 0.5802938196555217,
"repo_name": "tldavies/RackHD",
"id": "69aed20d6406db8b676a2e2781db4952fd7dc4f0",
"size": "3948... |
from collections import MutableMapping
import ctypes as ct
from functools import reduce
import multiprocessing
import os
import errno
import re
from .libbcc import lib, _RAW_CB_TYPE, _LOST_CB_TYPE
from .perf import Perf
from .utils import get_online_cpus
from .utils import get_possible_cpus
from subprocess import chec... | {
"content_hash": "d9e111ed7419c6ce08be1830d0438fcc",
"timestamp": "",
"source": "github",
"line_count": 885,
"max_line_length": 95,
"avg_line_length": 36.31299435028249,
"alnum_prop": 0.5374490462706538,
"repo_name": "mcaleavya/bcc",
"id": "d33d46eb017dbd0d5b1f8b89d13e2fb39ca198d5",
"size": "32706"... |
from .basic_dataset_profiler import BasicDatasetProfiler
from .basic_suite_builder_profiler import BasicSuiteBuilderProfiler
from .columns_exist import ColumnsExistProfiler
| {
"content_hash": "9c97099f1b37a11951e15087b2154f07",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 67,
"avg_line_length": 57.666666666666664,
"alnum_prop": 0.8786127167630058,
"repo_name": "great-expectations/great_expectations",
"id": "6f844ad0fe90a58ab65a4fdae7c6d881495f6... |
import codecs
import os
import re
import sys
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: ... | {
"content_hash": "43fb56a7af3093e2a7fb9b315c27315d",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 72,
"avg_line_length": 28.183098591549296,
"alnum_prop": 0.5962018990504747,
"repo_name": "hangtwenty/terrarium",
"id": "4d5de5717ea9b40260ddfaaf036547349aaa709a",
"size": ... |
import os
from sketchbook import Sketch
_TEST_CURIO = bool(os.environ.get("TEST_CURIO", False))
if _TEST_CURIO:
from sketchbook import CurioSketchContext
from sketchbook.testutils import CurioTestHelper
helper = CurioTestHelper(__file__)
default_skt_ctx = CurioSketchContext()
else:
from sketch... | {
"content_hash": "e6c78418fe1b7d6ffdcd2cc9119d260d",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 79,
"avg_line_length": 29.56179775280899,
"alnum_prop": 0.5594830862789814,
"repo_name": "futursolo/sketchbook",
"id": "b62aeeb20bed45fe2744ec9a7da49e9fea8f9eee",
"size": "... |
from ptm.factories.base import TemplatedAppFactory
class AppFactory(TemplatedAppFactory):
pass
| {
"content_hash": "c85444e9aa917d00077e86e8430405c7",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 50,
"avg_line_length": 20.2,
"alnum_prop": 0.8217821782178217,
"repo_name": "GrivIN/ptm",
"id": "a354e58f985d2670c9c5bd647c7573c27ad5b281",
"size": "101",
"binary": false,... |
import logging
import unittest
import MySQLdb
import environment
import tablet
import utils
use_mysqlctld = True
tablet_master = tablet.Tablet(use_mysqlctld=use_mysqlctld)
tablet_replica1 = tablet.Tablet(use_mysqlctld=use_mysqlctld)
tablet_replica2 = tablet.Tablet(use_mysqlctld=use_mysqlctld)
setup_procs = []
de... | {
"content_hash": "be7045ba2ec65db73a6fa10f835d3055",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 80,
"avg_line_length": 32.12627986348123,
"alnum_prop": 0.6586635504090088,
"repo_name": "erzel/vitess",
"id": "7a231567b1173bc76e8ac01f84d073bc1339f112",
"size": "9436",
... |
from antlr4 import InputStream, CommonTokenStream, ParseTreeWalker
from parse.MATLABLexer import MATLABLexer
from parse.MATLABParser import MATLABParser
from TranslateListener import TranslateListener
from error.ErrorListener import ParseErrorExceptionListener
from error.Errors import ParseError
def parse(in_str):
... | {
"content_hash": "93d6fbbcc7567330c396f2448fc1177b",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 84,
"avg_line_length": 30.67391304347826,
"alnum_prop": 0.6853295535081503,
"repo_name": "mattmcd/ParseMATLAB",
"id": "982cdb8f46eb7ae96fd41f41d2014d9f135c2cd0",
"size": "1... |
from Tkinter import *
import math # imported for use of sqrt function
from random import randint # imported for use of randint function
# the 2D point class
class Point(object):
# initialize the state of the 2D point
def __init__(self, x=0.0, y=0.0):
self._x = float(x)
self._y = float(y)
... | {
"content_hash": "c3d72d61c5adb23ebe873b469d0b239a",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 107,
"avg_line_length": 30.504587155963304,
"alnum_prop": 0.6655639097744361,
"repo_name": "AbhishekShah212/School_Projects",
"id": "c4f0db885cdc039d292d290c62f3c11e92841722... |
import sublime, sublime_plugin
class splittobufferCommand(sublime_plugin.TextCommand):
def run(self, edit):
sels = self.view.sel()
self.window = sublime.active_window()
self.make_buffer(sels)
def make_buffer(self, sels):
regions = []
orv = self.window.active_view()
syntax = self.view.settings().get('syn... | {
"content_hash": "7ffc7e1894a725ebfe1b8d17ec0d6234",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 55,
"avg_line_length": 28,
"alnum_prop": 0.6964285714285714,
"repo_name": "berendbaas/sublime_splittobuffer",
"id": "c0b0df975ffd0b79a921dd4adfeca87714dfe245",
"size": "728... |
from eliot import Field, ActionType
from eliot._validation import ValidationError
from ipaddr import IPv4Address
def _system(name):
return u"flocker:route:" + name
def validate_ipv4_address(value):
if not isinstance(value, IPv4Address):
raise ValidationError(
value,
u"Field ... | {
"content_hash": "c3fcbb4f3322231485cd01c6fa3f8a9c",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 74,
"avg_line_length": 22.879310344827587,
"alnum_prop": 0.6593820648078372,
"repo_name": "beni55/flocker",
"id": "bd4a1f25ecbd4749a46d3713ccab798978d000d9",
"size": "1389"... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VmEndReplayingEvent(vim, *args, **kwargs):
'''This event indicates the end of a replay... | {
"content_hash": "d0aa0dff2439a35a239a24c86ad7be1d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 124,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.5998300764655905,
"repo_name": "xuru/pyvisdk",
"id": "473e8880c1910b1d39df2af9591781ce299a836d",
"size": "1178",... |
import collect_array as ca
import collect_id as ci
import collect_loop as cl
import collect_device as cd
def print_dict_sorted(mydict):
keys = sorted(mydict)
entries = ""
for key in keys:
value = mydict[key]
entries += "'" + key + "': " + value.__repr__() + ","
return "{" + entries[:-... | {
"content_hash": "dd70135b35b43e3712467b4f06e31f31",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 97,
"avg_line_length": 27.517857142857142,
"alnum_prop": 0.609344581440623,
"repo_name": "dikujepsen/OpenTran",
"id": "cc51c9cc3969bec72bdfc6742b67c8c88dea867a",
"size": "... |
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
import pytest
from pytablewriter import FormatAttr, TableFormat
class Test_TableFormat_search_table_format:
@pytest.mark.parametrize(
["value", "expected"],
[
[
FormatAttr.TEXT,
[
... | {
"content_hash": "6bdf724919fcb5804def2067c9705122",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 69,
"avg_line_length": 33.043103448275865,
"alnum_prop": 0.46230106965823115,
"repo_name": "thombashi/pytablewriter",
"id": "446ad40c79a90d0d2f1550e955849188a473b9df",
"si... |
from urllib2 import Request,urlopen,URLError
import mysql.connector
import time
import datetime
import os
import pickle
import pandas as pd
import threading
from pandas.io import sql
from sqlalchemy import create_engine
def getPrice(tickers):
link = 'http://download.finance.yahoo.com/d/quotes.csv?'
arguments = 'f=aa2... | {
"content_hash": "16f903532aa39f3ff9b3a594133ae75a",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 395,
"avg_line_length": 29.807339449541285,
"alnum_prop": 0.6897506925207756,
"repo_name": "viep/StockScraper",
"id": "c588ebd3f783818f355127dbe3e7110183575e77",
"size": "... |
"""
enhance and wrap window for using convenience
Tested environment:
Mac OS X 10.6.8
http://doc.qt.nokia.com/latest/qdesktopwidget.html
http://www.pyside.org/docs/pyside/PySide/QtGui/QWidget.html
"""
__all__ = [
"auto_set_geometry",
"AutoSaveGeo",
"CustomDlg",
"CustomWin",
"CustomSheetWin",
... | {
"content_hash": "5c81663a2b4f6cb3304e6805efdd8ab0",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 109,
"avg_line_length": 28.626436781609197,
"alnum_prop": 0.5770929532222445,
"repo_name": "alexlib/Qt-Python-Binding-Examples",
"id": "0a4e2108ebf8bc8953c5009cc7311495c08cc... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tagit.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is reall... | {
"content_hash": "39b75069886b91d1f00a7958eb2a4613",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.19047619047619,
"alnum_prop": 0.6197183098591549,
"repo_name": "ned2/tator",
"id": "61f6006071e646bf4eceac4e1589a96c976b1cfb",
"size": "803",
"b... |
import json
class JsonResponse(object):
def __init__(self, result_key):
self.result_key = result_key
def format_job_for_response(self, job, final_output_key):
job_info = {
'id': job.id,
'kind': job.kind,
}
# If there were errors encode them into meta
... | {
"content_hash": "9ca55d17aaa888473462627c8c40ef7e",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 61,
"avg_line_length": 22.037037037037038,
"alnum_prop": 0.48739495798319327,
"repo_name": "voidfiles/dabba",
"id": "69e0cf3f219aa08f9f19f435dfecdeeb6149083a",
"size": "595... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.