text stringlengths 4 1.02M | meta dict |
|---|---|
from Acquisition import aq_inner
from Acquisition import aq_parent
from bika.lims.permissions import *
from Products.Archetypes.BaseContent import BaseContent
from bika.lims.upgrade import stub
def upgrade(tool):
# Hack prevent out-of-date upgrading
# Related: PR #1484
# https://github.com/bikalabs/Bika-L... | {
"content_hash": "a6104e7348b8bb3185186dd7b4fe13bc",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 75,
"avg_line_length": 33.65714285714286,
"alnum_prop": 0.6561969439728353,
"repo_name": "hocinebendou/bika.gsoc",
"id": "326b775c92af0f1f28ad4be0b3217eee3cf7612e",
"size":... |
import os
import sys
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import (
get_info, system_info, lapack_opt_info, blas_opt_info)
config = Configuration('linalg', parent_package, top_path)
config.a... | {
"content_hash": "980186eff7b4f20da6df559a236f3d76",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 78,
"avg_line_length": 34.55421686746988,
"alnum_prop": 0.558228730822873,
"repo_name": "ryfeus/lambda-packs",
"id": "e2944f38c33d1c98a65a0f4dd72127a028e70fd6",
"size": "28... |
from msrest.service_client import ServiceClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from msrest.pipeline import ClientRawResponse
from . import models
class AutoRestResourceFlatteningTestServiceConfiguration(Configuration):
"""Configuration for AutoRestResourceF... | {
"content_hash": "2f6b93570501f16092d035c9a903f753",
"timestamp": "",
"source": "github",
"line_count": 537,
"max_line_length": 205,
"avg_line_length": 39.75046554934823,
"alnum_prop": 0.6583903307411224,
"repo_name": "fhoring/autorest",
"id": "dd4e591ecb2026497804f5af79340b170eb44c4a",
"size": "21... |
"""
Responsible for the injection of the BioGRID parse into the main space.
"""
from bioflow.bio_db_parsers.proteinRelParsers import parse_bio_grid
from bioflow.utils.log_behavior import get_logger
from bioflow.configs.main_configs import biogrid_path
from bioflow.neo4j_db.db_io_routines import convert_to_internal_ids
... | {
"content_hash": "b84e81d820ef1ee33ba4c696d053edf7",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 127,
"avg_line_length": 42.205128205128204,
"alnum_prop": 0.5899149453219927,
"repo_name": "chiffa/PolyPharma",
"id": "e38bbcd7bb296dc896f0ccff544858184ee32384",
"size": "3... |
from datetime import datetime
from django.core.exceptions import ValidationError
from django.db import models
def validate_answer_to_universe(value):
if value != 42:
raise ValidationError('This is not the answer to life, universe and everything!', code='not42')
class ModelToValidate(models.Model):
... | {
"content_hash": "a16a1e4412f0b5fab33bafa83f1a0a8a",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 114,
"avg_line_length": 35,
"alnum_prop": 0.6967806841046278,
"repo_name": "wkschwartz/django",
"id": "ff9aad11f05546ba75f7885c34f8d80cfc40b84f",
"size": "4970",
"binary... |
from norm.error import Error
class NotFound(Error):
pass | {
"content_hash": "d30099a4b39234b5d3a5262be7ab6c45",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 28,
"avg_line_length": 12.4,
"alnum_prop": 0.7419354838709677,
"repo_name": "iffy/norm",
"id": "ce6d7b7689abdc83c77052ef0fbe11d1837f96db",
"size": "120",
"binary": false,
... |
from collections import namedtuple
import traceback
import sys
import os
import imp
import pkgutil
import time
from util import *
from i18n import _
from util import profiler, PrintError, DaemonThread, UserCancelled
class Plugins(DaemonThread):
@profiler
def __init__(self, config, is_local, gui_name):
... | {
"content_hash": "aa731e016733d1391885da3294265ec7",
"timestamp": "",
"source": "github",
"line_count": 486,
"max_line_length": 84,
"avg_line_length": 34.54938271604938,
"alnum_prop": 0.5762015365374308,
"repo_name": "sherlockcoin/Electrum-NavCoin",
"id": "0727aeaf6dd8d04f4fece900528360b5dd11f417",
... |
"""
MongoLog
Written by Harel Malka in 2010 as part of the Glow Machine (www.theglowmachine.com).
Adapted to generic use 2013 with permission.
harel@harelmalka.com / harel@thisisglow.com
MongoLog is a drop in replacement to a standard logging module where all log messages
are kept in a mongodb collection. This allo... | {
"content_hash": "e9e0bc5e976a871c7db78f60bb5c1a6b",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 184,
"avg_line_length": 33.64102564102564,
"alnum_prop": 0.7129065040650406,
"repo_name": "glowdigitalmedia/mongolog",
"id": "075aa20d80c00c946763ef3483da504df769e293",
"s... |
"""
ACTIVE Plugin for Testing for Application Discovery (OWASP-IG-005)
"""
from framework.dependency_management.dependency_resolver import ServiceLocator
DESCRIPTION = "Active probing for app discovery"
def run(PluginInfo):
resource = ServiceLocator.get_component("resource").GetResources('ActiveDiscovery')
... | {
"content_hash": "f8d2fc883a28749f38ceb028d1d90ff5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 94,
"avg_line_length": 35.46666666666667,
"alnum_prop": 0.6691729323308271,
"repo_name": "DarKnight24/owtf",
"id": "6491da17ba9c5e7c30a305536db0e5f4110f8fa6",
"size": "532"... |
import argparse, logging, sys
from . import __VERSION__
from pbrdna.utils import validate_int, validate_float, validate_file, which
from pbrdna.log import initialize_logger
NPROC = 1
MIN_DIST = 0.001
DIST = 0.03
STEP = 0.015
MAX_DIST = 0.5
MIN_ACCURACY = 0.99
MIN_QV = 15
FRACTION = 0.8
MIN_LENGTH = 500
MIN_RATIO = 0.... | {
"content_hash": "a4b79cd295b8431e92effa55d850400f",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 99,
"avg_line_length": 34.01796407185629,
"alnum_prop": 0.6039429677873613,
"repo_name": "PacificBiosciences/rDnaTools",
"id": "f3656a7af99ed3d00d7ed0ee734fdacb1ac232e8",
... |
from django.db import models
from django.db.models.signals import post_save
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey, \
GenericRelation
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.dispatch import receiver
fr... | {
"content_hash": "7d7e3d4539c0f60eff87ab7ecd29b773",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 91,
"avg_line_length": 33.354838709677416,
"alnum_prop": 0.6518375241779497,
"repo_name": "ic-labs/django-icekit",
"id": "9f8092180c11cccf8ec52191b182ee23f71e2795",
"size"... |
from django.core.urlresolvers import reverse
from django_webtest import WebTest
from testing.common import login_user, make_user
from apps.links.models import Link
class CategorisedLinksWithCategoriesUpdateTest(WebTest):
def setUp(self):
self.logged_in_user = make_user()
self.assertTrue(login_us... | {
"content_hash": "66f509b73a47e71b6006e619bc79fc78",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 33.16417910447761,
"alnum_prop": 0.5981098109810981,
"repo_name": "dstl/lighthouse",
"id": "d65cefd48673a720b6c5129ffb47a051076e65e3",
"size": "2264"... |
import warnings
import numpy as np
import cvxpy as cp
import cvxpy.settings as s
from cvxpy.tests.base_test import BaseTest
warnings.filterwarnings("ignore")
SOLVE_METHODS = [s.SCS, s.ECOS]
EPS_NAME = {s.SCS: "eps",
s.ECOS: "abstol"}
def perturbcheck(problem, gp: bool = False, solve_methods: list = SO... | {
"content_hash": "cdb6f61c21003e31c51d44948d1eeb43",
"timestamp": "",
"source": "github",
"line_count": 642,
"max_line_length": 95,
"avg_line_length": 39.69314641744548,
"alnum_prop": 0.554330337872307,
"repo_name": "merraksh/cvxpy",
"id": "08a140df66ee8687d749a1ab2f0e7e036d177999",
"size": "25483"... |
__author__ = "Nils Tobias Schmidt"
__email__ = "schmidt89 at informatik.uni-marburg.de"
import os
import re
from androlyze.docker.util import run
from androlyze.log.Log import clilog
from androlyze.settings import *
# environment variable names
## docker
RABBITMQ_DOCKER_CONN = "RABBITMQ_PORT"
MONGODB_DOCKER_CONN = "... | {
"content_hash": "6fbf08d8d50ab2901d6e125fe0bacaff",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 182,
"avg_line_length": 39.33802816901409,
"alnum_prop": 0.6301467955603294,
"repo_name": "nachtmaar/androlyze",
"id": "56ff258b5c9a40b533e263273f925fc31767d6ce",
"size": "... |
__author__ = 'max'
from .environment import * | {
"content_hash": "9df9f1f72bb037596db39bde6d7e69d8",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 26,
"avg_line_length": 15.333333333333334,
"alnum_prop": 0.6521739130434783,
"repo_name": "XuezheMax/ReLiefParser",
"id": "3f04ce2d5a3965d072440a7ca7e49b4cc6ead3bc",
"size":... |
import collections
import itertools
import operator
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import retrying
import six
import uuid
from neutron.agent.common import utils
from neutron.agent.linux import ip_lib
from neutron.agent.ovsdb import api as ovsdb
from neu... | {
"content_hash": "90000e9a1fd242b15a842e441ce5eed6",
"timestamp": "",
"source": "github",
"line_count": 590,
"max_line_length": 79,
"avg_line_length": 37.996610169491525,
"alnum_prop": 0.5703452582746008,
"repo_name": "wenhuizhang/neutron",
"id": "00e2de18c806969a5e76de3f28421bb20f49b207",
"size": ... |
'''
This example is just a prototype. Please take anything you see here with a
grain of salt so to speak. Still to be determined if the Python BACI
prototype will be completed!
TODO:
- everything!
'''
#--CORBA STUBS-----------------------------------------------------------------
import acsexmplLamp__POA
#--ACS Imports... | {
"content_hash": "89434a0dadc7d108b332e15fae8fdac8",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 85,
"avg_line_length": 33.69090909090909,
"alnum_prop": 0.40528872099298435,
"repo_name": "csrg-utfsm/acscb",
"id": "9b3c0346fa55fefc99f33019b2435f95a32cc234",
"size": "302... |
import unittest
import os
import wx
#import wx.lib.inspection
from programs import pmag_gui
from pmagpy import pmag
from pmagpy import validate_upload2 as validate_upload
from pmagpy import data_model3 as data_model
from pmagpy import new_builder as nb
#def set_consts(dmodel):
# global TEST_DIR, dmodel2, project2_W... | {
"content_hash": "78b0a079964be10f7e0749085775b6bb",
"timestamp": "",
"source": "github",
"line_count": 634,
"max_line_length": 149,
"avg_line_length": 37.34069400630915,
"alnum_prop": 0.617132719439047,
"repo_name": "Caoimhinmg/PmagPy",
"id": "461d733210e6cb95b9e1c5042837f6d731413bb7",
"size": "23... |
from django.apps import AppConfig
class SubscriptionsConfig(AppConfig):
name = 'eventex.subscriptions'
verbose_name = 'Controle de Participantes'
| {
"content_hash": "f5d160babcf78eaeccec94ddadc1adc2",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 46,
"avg_line_length": 26,
"alnum_prop": 0.7692307692307693,
"repo_name": "ghclara/wttd-eventex",
"id": "a8ab1862c452afe3e81cc31b1709b44268d5a18d",
"size": "156",
"binary"... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^message/$', views.message, name='message'),
]
| {
"content_hash": "f215131009f463e3af557749f56ed7d1",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 54,
"avg_line_length": 21.375,
"alnum_prop": 0.6432748538011696,
"repo_name": "huaiping/pandora",
"id": "9aa462daaed3fecc15b2cf782f1d26aee2bfed3e",
"size": "171",
"binary"... |
import sys
import subprocess
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
Builder.load_file('ShutdownScreenKv.kv')
class ShutdownScreen(Screen):
def __init__(self, **kwargs):
super(ShutdownScreen, self).__init__(... | {
"content_hash": "82e9fff3f693201806a6f6ddc823f5a2",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 103,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.6573392243495336,
"repo_name": "yk0242/incubation",
"id": "5d70485fda65ffad916e445a1a126463a2058f2e",
"size": "2... |
import logging
import sys
import pytest
from brokerlso.qmfv2 import RequestCmd
FORMAT = "%(asctime)s : %(pathname)s : %(name)s : %(module)s : %(funcName)s : %(lineno)d : %(levelname)s : %(message)s"
date_format = "%Y%m%d-%H%M%S-%f"
logging.basicConfig(format=FORMAT, level=logging.DEBUG, stream=sys.stdout)
logger = l... | {
"content_hash": "5b06c294e17037c47d8e026582900f00",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 119,
"avg_line_length": 44.80701754385965,
"alnum_prop": 0.5783085356303838,
"repo_name": "codeghar/brokerlso",
"id": "83682b344f5b9b32f0857534571747a3d2bbd9c4",
"size": "2... |
import struct
import gzip
import bz2
class CompressedFile (object):
magic = None
file_type = None
mime_type = None
proper_extension = None
@classmethod
def is_magic(cls, data):
return data.startswith(cls.magic)
class GZFile (CompressedFile):
magic = '\x1f\x8b\x08'
file_type ... | {
"content_hash": "b49c216aa1caa5f9f07765a436d77483",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 47,
"avg_line_length": 19.517857142857142,
"alnum_prop": 0.62580054894785,
"repo_name": "Som-Energia/enerdata",
"id": "966e342dbfacc961ac3a5cb925198698f98d301d",
"size": "1... |
from __future__ import print_function
from sys import exit
from wellpapp import Client
from argparse import ArgumentParser
from operator import itemgetter
def main(arg0, argv):
parser = ArgumentParser(prog=arg0)
parser.add_argument("-f", "--fuzzy", action="store_true", help="Fuzzy matching")
parser.add_argument("-... | {
"content_hash": "eca0f5ed67e57b1e407818dc35e873a9",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 126,
"avg_line_length": 32.28333333333333,
"alnum_prop": 0.678884873515746,
"repo_name": "drougge/wellpapp-pyclient",
"id": "b731b51d5ba138b9a3848f74519627dd195c6983",
"siz... |
import sublime
import sublime_plugin
# Related reading;
# https://stackoverflow.com/questions/56611586/open-file-at-specific-line-number-using-open-file-command
# https://forum.sublimetext.com/t/open-file-at-specific-line-number-using-open-file-command/41928
# The open_file command from core Sublime can be us... | {
"content_hash": "09b73e9d3d295148a2d0471a4d6ef07a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 108,
"avg_line_length": 41.1875,
"alnum_prop": 0.7632776934749621,
"repo_name": "STealthy-and-haSTy/SublimeScraps",
"id": "76b85e849f8da266f173c6e89acbd4b94a99a5df",
"size"... |
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.0'
}
DOCUMENTATION = '''
module: bigip_static_route
short_description: Manipulate static routes on a BIG-IP.
description:
- Manipulate static routes on a BIG-IP.
version_added: 2.3
options:
name:
descrip... | {
"content_hash": "81ea872c6670a1469f9928f35da02b5d",
"timestamp": "",
"source": "github",
"line_count": 440,
"max_line_length": 82,
"avg_line_length": 28.918181818181818,
"alnum_prop": 0.5770198050927381,
"repo_name": "mcgonagle/ansible_f5",
"id": "42a10c96cfa2ba99b4f5f33e34510fb5d5ef85eb",
"size":... |
from __future__ import absolute_import
from distutils.core import setup
setup(
description='A robust database benchmarking application for pure speeds',
version=0.5,
name='BenchmarkDB',
packages=[
'BenchmarkDB'
]
) | {
"content_hash": "469af8b946998c120a89d96d31fabac2",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 77,
"avg_line_length": 22.09090909090909,
"alnum_prop": 0.691358024691358,
"repo_name": "kmjungersen/BenchmarkDB",
"id": "5f9923411a66940406e432e78d70ddc4a455466c",
"size":... |
import sys
import os
from eclipse2buck import decorator
def check_force_flag(lines):
for line in lines:
tag = "plugin.build.force="
if line.startswith(tag):
line = line.strip('\r\n')
if (line[len(tag):] == "true"):
return True
return False
d... | {
"content_hash": "7bfa9997274f6bb3421e9c77d597d29a",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 75,
"avg_line_length": 29.632653061224488,
"alnum_prop": 0.5475206611570248,
"repo_name": "simpleton/eclipse2buck",
"id": "fbe13c099bc8200b02416c92cf656159b6fe6f64",
"size"... |
from __future__ import unicode_literals
import warnings
from bisect import bisect
from collections import OrderedDict, defaultdict
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core.exceptions import FieldDoesNotExist
from django.db import connections
from djang... | {
"content_hash": "36f68a79d24b00c792cf5641acc73509",
"timestamp": "",
"source": "github",
"line_count": 725,
"max_line_length": 115,
"avg_line_length": 42.04275862068965,
"alnum_prop": 0.6077228437387224,
"repo_name": "lwiecek/django",
"id": "c6ddd2a6f9d2e82aafcc557b76dcdca8d493090d",
"size": "3048... |
"""The Rainforest Eagle integration."""
from __future__ import annotations
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from . import data
from .const import DOMAIN
PLATFORMS = ("sensor",)
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> b... | {
"content_hash": "c00f74bf1427191ed2d0dba93fa5cf8a",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 82,
"avg_line_length": 33,
"alnum_prop": 0.7359307359307359,
"repo_name": "sander76/home-assistant",
"id": "44a5624267e213e66c543ea9b418c4e5817033e9",
"size": "924",
"bin... |
from strategies import do_one, exhaust
from strategies.core import typed
from ...core import Add, Expr, Mul, Number, sympify
from ...core.logic import _fuzzy_group
from ...core.strategies import flatten, rm_id, unpack
from ...functions import adjoint
from ..matrices import MatrixBase, ShapeError
from .matexpr import I... | {
"content_hash": "fcc1a436deb6af44a4e58821d04718fa",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 92,
"avg_line_length": 28.93089430894309,
"alnum_prop": 0.5717296613741745,
"repo_name": "skirpichev/omg",
"id": "d7856081019d3cda9a6d40dd919dab07326ba299",
"size": "7117"... |
import netaddr
from oslo_log import log as logging
from neutron.agent.l3 import namespaces
from neutron.agent.linux import ip_lib
from neutron.agent.linux import iptables_manager
from neutron.agent.linux import ra
from neutron.common import constants as l3_constants
from neutron.common import exceptions as n_exc
from... | {
"content_hash": "c3a0666d2b3ef7622fec2aaa94216f1e",
"timestamp": "",
"source": "github",
"line_count": 611,
"max_line_length": 79,
"avg_line_length": 42.71849427168576,
"alnum_prop": 0.5599019194666871,
"repo_name": "aristanetworks/neutron",
"id": "3f0d801a660600fd7b433755f51bce31f29d06a8",
"size"... |
import logging
import six
import xml.etree.ElementTree as XML
from jenkins_jobs.errors import InvalidAttributeError
from jenkins_jobs.errors import JenkinsJobsException
from jenkins_jobs.errors import MissingAttributeError
def build_trends_publisher(plugin_name, xml_element, data):
"""Helper to create various t... | {
"content_hash": "540f1e364674499311c139eb1817b853",
"timestamp": "",
"source": "github",
"line_count": 677,
"max_line_length": 79,
"avg_line_length": 41.96454948301329,
"alnum_prop": 0.5851812741992256,
"repo_name": "phinexus/jenkins-job-builder",
"id": "6ff5f0f0962beac719ef14df4553aa657b6abf74",
... |
from astropy.io.misc.asdf.tags.transform.basic import TransformType
from astropy.modeling.models import Spline1D
__all__ = ["SplineType"]
class SplineType(TransformType):
name = "transform/spline1d"
version = "1.0.0"
types = ["astropy.modeling.spline.Spline1D"]
@classmethod
def from_tree_transfo... | {
"content_hash": "5a48413bda25e47c1bb84f7b553c1a88",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 83,
"avg_line_length": 30.2,
"alnum_prop": 0.6655629139072847,
"repo_name": "astropy/astropy",
"id": "f5f2882a443d05042523c8942fa90314b878fa87",
"size": "604",
"binary": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0009_event_from_coc_location_id'),
]
operations = [
migrations.DeleteModel(
name='Fish',
),
migrations.RenameFiel... | {
"content_hash": "64711d764d571ea70a972cb427709107",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 53,
"avg_line_length": 23.36,
"alnum_prop": 0.553082191780822,
"repo_name": "emeth-/dancing-banana",
"id": "950648044dedf16279ba8f4245ed13f920662485",
"size": "608",
"bin... |
import os
import hashlib
import re
import sys
import json
import ConfigParser as configparser
from mimetypes import guess_type
from datetime import datetime
from urlparse import urljoin
# Third party
from flask import Flask, request, send_from_directory, render_template, jsonify
from werkzeug import secure_filename
fr... | {
"content_hash": "edb3ef6f15e630453932ef45be347398",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 94,
"avg_line_length": 31.16599190283401,
"alnum_prop": 0.6554949337490257,
"repo_name": "jhaals/python-filebutler",
"id": "96e8ff2e173fce0c0637eee8ed9391f8f9d58b7c",
"siz... |
from sympy import diff, Integral, Limit, sin, Symbol, Integer, Rational, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, E, I, oo, pi, GoldenRatio, EulerGamma
from sympy.printing.mathml import mathml, MathMLPrinter
from xml.dom.minidom import parseString
x = Symbol('x')
mp = MathMLPrinter()
def tes... | {
"content_hash": "99be65bb0c38499fb32abb01d7e20ae5",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 177,
"avg_line_length": 39.42248062015504,
"alnum_prop": 0.6512633959296038,
"repo_name": "tovrstra/sympy",
"id": "4088fa63815b247add93c960b1444495fbfe7683",
"size": "1017... |
from AvgSearchTimeXXFoundParameters import AvgSearchTimeXXFoundParameters
class AvgSearchTime100FoundParameters(AvgSearchTimeXXFoundParameters):
def __init__(self, period, simulationTime):
AvgSearchTimeXXFoundParameters.__init__(self, period, simulationTime, 1.0)
| {
"content_hash": "5c44f61b160d12673d9a2a6afabadf6e",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 77,
"avg_line_length": 45.666666666666664,
"alnum_prop": 0.8284671532846716,
"repo_name": "unaguil/hyperion-ns2",
"id": "c15290b14d6525a8a30db09470b1f77477892939",
"size": "... |
"""
JSON-RPC module
Specification: http://groups.google.com/group/json-rpc/web/json-rpc-2-0
"""
import simplejson
from datetime import datetime
from datetime import date
from datetime import time
from paste.deploy.converters import asbool
from duende import Response
# JSON-RPC error codes:
PARSE_ERROR = -32700
IN... | {
"content_hash": "1b53575cee34caeb4706a57c90ecdc54",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 79,
"avg_line_length": 24.335078534031414,
"alnum_prop": 0.6566265060240963,
"repo_name": "jeronimoalbi/duende",
"id": "192e310426f2f6d13198778876e34e98c562818f",
"size": ... |
import os
import re
import math
import random
import sys
def commonChild(s1, s2):
pass
if __name__ == "__main__":
print(commonChild("SHINCHAN", "NOHARAAA")) | {
"content_hash": "d9a643cbe54ddba9b7d5248c7088cdb7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 43,
"avg_line_length": 12.461538461538462,
"alnum_prop": 0.6851851851851852,
"repo_name": "MithileshCParab/HackerRank-10DaysOfStatistics",
"id": "c8bbafd4af489e05d60e81fd41c4... |
import matplotlib.pyplot as plt
import numpy as np
G = 100 # government spending
theta = 0.2 # tax rate
alpha = 0.9 # propensity to consume
n_rounds = 30 # number of rounds we'll consider
# create an array of numbers from 0-30, one for each spending round
r = np.arange(0,n_rounds)
# solve equation 1 for each in... | {
"content_hash": "fd6d8493d56f9f2682fc4fc7348a4a7e",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 67,
"avg_line_length": 22.391304347826086,
"alnum_prop": 0.6961165048543689,
"repo_name": "spatchcock/monetary_economics_python",
"id": "3bfebf34c5bb1b2c1d61702531f4dd7ee2560... |
class ResultSet(list):
"""
The ResultSet is used to pass results back from the Amazon services
to the client. It is light wrapper around Python's :py:class:`list` class,
with some additional methods for parsing XML results from AWS.
Because I don't really want any dependencies on external libraries... | {
"content_hash": "65393007585bf0d80dd9b7666b385715",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 79,
"avg_line_length": 34.84444444444444,
"alnum_prop": 0.5727040816326531,
"repo_name": "kumar303/rockit",
"id": "954160c55c17a673ec96c717c89a7fb92b76da1c",
"size": "5808... |
import socket
import SocketServer
import os
import threading
import time
import common
import action
import config
import testobj
from logger import LOG
from action import activeTest
global serverInstance
global actc
class ActionCaller:
async_actions = []
lock = threading.Lock()
def __init__(self, lct... | {
"content_hash": "aabf58e8493e6c52ae488bdbc0ee0b68",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 119,
"avg_line_length": 44.52613240418118,
"alnum_prop": 0.5218718209562564,
"repo_name": "deepeshmittal/daytona",
"id": "e1edbd3c24d31977ed1b24d0d7ebd82b5b435b37",
"size"... |
"""
Script to upgrade ddbb in mysql servers
17/08/2015 by Miguel Jimenez
"""
import os
import sys
ddbb_servers = [] #Complete with MySQL servers
ddbb_users = [] #Complete with MySQL users
ddbb_passwords = [] #Complete with MySQL passwords
ddbb_names = [] #Complete with MySQL DDBB names
if sys.argv[1] == "help":
... | {
"content_hash": "2440e0843befa7a662ce26be613e288e",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 130,
"avg_line_length": 24.703703703703702,
"alnum_prop": 0.631184407796102,
"repo_name": "miguelFLG13/updateDDBBservers",
"id": "69b1bdd8ba3f7a42b51e947e1b88437cdfa7a929",
... |
from os.path import join
COURSE_DATA = join('..', 'course-data')
details_source = join(COURSE_DATA, 'details')
xml_source = join(COURSE_DATA, 'raw_xml')
course_dest = join(COURSE_DATA, 'courses')
term_dest = join(COURSE_DATA)
mappings_path = join(COURSE_DATA, 'data-lists')
handmade_path = join(COURSE_DATA, 'data-mappi... | {
"content_hash": "1728b6aab12ee084cbd8772846b2c5e6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 69,
"avg_line_length": 26.58974358974359,
"alnum_prop": 0.6894889103182257,
"repo_name": "StoDevX/course-data-tools",
"id": "bd78fc3a3ca18f09d9c2b470965e49bf85252c85",
"siz... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0024_alter_page_content_type_on_delete_behaviour"),
("wagtailcore", "0027_fix_collection_path_collation"),
]
operations = []
| {
"content_hash": "0917fe83fdc26e51dbf173e89f8c478c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 76,
"avg_line_length": 23.90909090909091,
"alnum_prop": 0.6692015209125475,
"repo_name": "zerolab/wagtail",
"id": "1fe5dde40fba610364f923281f281591c4418c79",
"size": "335",... |
"""Test that the 'add-dsym', aka 'target symbols add', command informs the user about success or failure."""
from __future__ import print_function
import os
import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@skipUnlessDarwin
cl... | {
"content_hash": "a84844970a5e995132cd13da6615fe0c",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 108,
"avg_line_length": 36.44274809160305,
"alnum_prop": 0.5982404692082112,
"repo_name": "youtube/cobalt",
"id": "11c3bc86a6ed48dbf834e6189e135a9e06975061",
"size": "4774... |
import logging
import time
from operator import itemgetter
from collections import deque
##__________________________________________________________________||
class TaskPackageDropbox:
"""A drop box for task packages.
This class puts task packages in a working area and have
dispatchers execute the tasks.... | {
"content_hash": "9b85894f099fc69fde3aca37c964063d",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 90,
"avg_line_length": 26.0375,
"alnum_prop": 0.5431269003040486,
"repo_name": "alphatwirl/alphatwirl",
"id": "1015b13d56428b9decde214914eb6c722026121b",
"size": "6285",
... |
from Task import Task
import bototools
import name_constructor
import uuid
class ApiAuthorizer(Task):
"""Create an authorizer for given api"""
known_params = {
'api': 'name of the api to deploy',
'name': 'name of the authorizer',
'lambda': 'name of the "gatekeeper" lambda function',
'type': 'type o... | {
"content_hash": "dc071ba807aac3c99fc226d5536114ee",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 237,
"avg_line_length": 55.08695652173913,
"alnum_prop": 0.666403578005788,
"repo_name": "Travelport-Czech/apila",
"id": "1b397ca75d915e5606ee3803ec7b91cb485dea0f",
"size":... |
import os
"""
Checks the validity of a filepath -> will return true if a file/folder exists
"""
print(os.path.exists('/home/zac/Downloads'))
print(os.path.exists('/home/zac/Downloads/shit'))
"""
Checks if the referred path is a file -> returns true if a file
"""
print(os.path.isfile('/home/zac/Downloads/log.txt'))... | {
"content_hash": "69bb7c59b49b8e01e2d2e0beae33da98",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 83,
"avg_line_length": 20,
"alnum_prop": 0.7053571428571429,
"repo_name": "zac11/AutomateThingsWithPython",
"id": "d7522afe4fcdb966004b07ce6282c959c7292795",
"size": "560",... |
"""
Name-Suhan Gui
Credit-Stack Overflow, Alexandru Munteanu
I have 15 cookies. Bob has 45 cookies. How many cookies are there in total?
I have 45 coins. I split it amongst 5 people. How many coins are there?
I have 5 cows. I get 97 more cows. How many cows are there?
"""
import math
import re
########################... | {
"content_hash": "f1c786ba3f3e5ba2c33cf6c57df9aa92",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 154,
"avg_line_length": 34.531157270029674,
"alnum_prop": 0.44014780441694595,
"repo_name": "ChubbyPotato/Word_Problem_Solver",
"id": "fe53bfb6a5e00f28871d566ec71f3ca1f1c12b... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from opentracing_instrumentation.interceptors import ClientInterceptors
from tornado import gen
from . import JSON
from ..event import EventType
from ..serializer.json i... | {
"content_hash": "258c65190e3e0223128ee785ae80007a",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 78,
"avg_line_length": 32.126666666666665,
"alnum_prop": 0.5901639344262295,
"repo_name": "uber/tchannel-python",
"id": "50afab43c197f7961a20894da5c73f1fd541a926",
"size":... |
import unittest
import os
import httpretty
import mock
from skew import scan
def get_response_body(name):
path = os.path.join(os.path.dirname(__file__), 'data', name)
fp = open(path)
body = fp.read()
fp.close()
return body
def path(filename):
return os.path.join(os.path.dirname(__file__), ... | {
"content_hash": "508b7931d1cc03596a8c9948549f7bdc",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 99,
"avg_line_length": 41.9168765743073,
"alnum_prop": 0.5282735412535304,
"repo_name": "samstav/skew",
"id": "643eab29c460f9bf8d58a92ef081e33831524d06",
"size": "17163",
... |
import sys, threading
sys.setrecursionlimit(10**6) # max depth of recursion
threading.stack_size(2**27) # new thread will get stack of such size
mx = None
last = -1
def IsBinarySearchTree(tree):
if len(tree) in (0,1):
return True
def inOrderTraversal(tree, i):
global mx
global last
if i == -1:... | {
"content_hash": "81909f4f02c1dc97a3c17a5d16b6b888",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 69,
"avg_line_length": 19.705882352941178,
"alnum_prop": 0.6179104477611941,
"repo_name": "oy-vey/algorithms-and-data-structures",
"id": "fc46d832ea7e7b8da03044b54722a2579d04... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index),
url(r'^calendar/$', views.calendar),
url(r'^calendar/(?P<project>.+)/(?P<d1>[0-9]{8})-(?P<d2>[0-9]{8})/$', views.calendar),
url(r'^calendar/(?P<d1>[0-9]{8})-(?P<d2>[0-9]{8})/$', views.calendar),
url(r'^cal... | {
"content_hash": "2a5f3a0e569b5c0ee8c256b00d84f466",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 90,
"avg_line_length": 42.38095238095238,
"alnum_prop": 0.6235955056179775,
"repo_name": "MikesAtMIT/planner",
"id": "401dbbe58f6bc7735a2de99195f21fa6664526fb",
"size": "89... |
import re
def nl_toolkit_get_all_synsets(input_dict):
if input_dict['corpus'].lower()=='wordnet':
from nltk.corpus import wordnet as wn
synsets = {}
for word in input_dict['words']:
synsets[word] = wn.synsets(word)
return {'synsets' : synsets}
def nl_toolkit_g... | {
"content_hash": "d1d76379358e45776d28b0ef1c806194",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 57,
"avg_line_length": 32,
"alnum_prop": 0.5733173076923077,
"repo_name": "Alshak/clowdflows",
"id": "50ba25733fe6378eede58707f8c30cc553d02cbe",
"size": "832",
"binary": ... |
from multiprocessing import Process, Manager
import multiprocessing
import os
import urllib
import urllib2
import random
import time
import json
import string
import random
import math
def randomString(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
de... | {
"content_hash": "2a4fd8dc678cf61e76747175b9a27c62",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 241,
"avg_line_length": 34.12328767123287,
"alnum_prop": 0.7059413890004015,
"repo_name": "michaeldfallen/ier-frontend",
"id": "25221eee2d032839c6eac725729acaf1685fb1cd",
... |
import os
import sys
import time
from PyQt4.QtGui import QPixmap, QApplication
class ScreenWeb(QApplication):
def __init__(self, window_id=None):
super(ScreenWeb, self).__init__(sys.argv)
if not window_id:
window_id = QApplication.desktop().winId()
else:
window_id =... | {
"content_hash": "270a32f30eb17fe179be67906df47e6b",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 70,
"avg_line_length": 26.916666666666668,
"alnum_prop": 0.5851393188854489,
"repo_name": "RainCT/imagecast",
"id": "f7e1734952668e9826c74567af5e17822b028551",
"size": "669... |
"""Identifies the landmark for the given image."""
import argparse
from googleapiclient import discovery
import httplib2
from oauth2client.client import GoogleCredentials
# [START get_vision_service]
# The url template to retrieve the discovery document for trusted testers.
DISCOVERY_URL='https://{api}.googleapis.c... | {
"content_hash": "514cfcf250b6605647172d1b42372083",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 81,
"avg_line_length": 29.12162162162162,
"alnum_prop": 0.6283062645011601,
"repo_name": "GoogleCloudPlatform/cloud-vision",
"id": "ae41422f86b855d674ddf88f03c90d18657df83c",... |
import unittest
from datetime import datetime, time
from mycroft.util.parse import get_gender
from mycroft.util.parse import extract_datetime
from mycroft.util.parse import extract_number
from mycroft.util.parse import normalize
class TestNormalize_fr(unittest.TestCase):
def test_articles_fr(self):
self.... | {
"content_hash": "0534469ea00e0ebe1e1d42ecda788a9b",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 79,
"avg_line_length": 56.679586563307495,
"alnum_prop": 0.5272851607020743,
"repo_name": "linuxipho/mycroft-core",
"id": "fb9626fdcee970ff3ba8b87124554477a76bfeab",
"size... |
from __future__ import unicode_literals
from jinja2 import Template
from moto.core.responses import BaseResponse
from .models import elb_backend
class ELBResponse(BaseResponse):
def create_load_balancer(self):
"""
u'Scheme': [u'internet-facing'],
"""
load_balancer_name = self.que... | {
"content_hash": "2f8a7c02114ea3d1edd9a1bd25200c5b",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 153,
"avg_line_length": 45.24603174603175,
"alnum_prop": 0.6606735660410454,
"repo_name": "DataDog/moto",
"id": "1e777bec06f0eb6eb32ceb80c6591c53930d76aa",
"size": "11402"... |
"""
TNC: A python interface to the TNC non-linear optimizer
TNC is a non-linear optimizer. To use it, you must provide a function to
minimize. The function must take one argument: the list of coordinates where to
evaluate the function; and it must return either a tuple, whose first element is the
value of the function... | {
"content_hash": "24339ee2cfa89c44c2b6f325eb8d6924",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 84,
"avg_line_length": 37.32835820895522,
"alnum_prop": 0.5932293749167,
"repo_name": "teoliphant/scipy",
"id": "894ab8ed679dd342c8261f58f30dd007b4dee287",
"size": "16210"... |
from websocket import websocket
from server import Server
from frame import Frame, ControlFrame, OPCODE_CONTINUATION, OPCODE_TEXT, \
OPCODE_BINARY, OPCODE_CLOSE, OPCODE_PING, OPCODE_PONG, CLOSE_NORMAL, \
CLOSE_GOING_AWAY, CLOSE_PROTOCOL_ERROR, CLOSE_NOACCEPT_DTYPE, \
CLOSE_INVALID_DATA, CLOSE_PO... | {
"content_hash": "43d77a0810b630fe08973e9c2e2c5dc1",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 78,
"avg_line_length": 51.06666666666667,
"alnum_prop": 0.783289817232376,
"repo_name": "taddeus/wspy",
"id": "6069e0af35ce0224ec0236c9deffcb96bdaa88ef",
"size": "766",
"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0026_auto_20151108_1530'),
]
operations = [
migrations.AddField(
model_name='speakerlist',
name='first',
... | {
"content_hash": "816e68de797c24c29c7e0e113c810dec",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 111,
"avg_line_length": 35.793103448275865,
"alnum_prop": 0.5443159922928709,
"repo_name": "I-sektionen/i-portalen",
"id": "0b29aa7b226c34abca0b8e336a27775f12b95e12",
"size... |
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPInternalServerError
from pyramid.httpexceptions import HTTPBadRequest
from pyramid_mailer.message import Message
from marshmallow import Schema
from marshmallow import EXCLUDE
from marshmallow import ValidationError
from marshmallow.fields imp... | {
"content_hash": "0f3d19050e3134d0e731f91a9b8d2f78",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 27.63888888888889,
"alnum_prop": 0.6743718592964824,
"repo_name": "silenius/amnesia",
"id": "2e57bdfaaf73800999173203d0e1d12cb646fef6",
"size": "2015... |
"""Utility functions for getting data to/from files"""
import gzip
import os
import pathlib
import pickle
from ..utils import decorator_decorator
__all__ = ['pickleable', 'save', 'load']
def _normalize(file):
"""Convenience function to support path objects."""
if 'Path' in type(file).__name__:
retur... | {
"content_hash": "f9055f5aeb9a7dc5bca8e1d1af7b38ba",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 93,
"avg_line_length": 26.71559633027523,
"alnum_prop": 0.5885989010989011,
"repo_name": "MAndelkovic/pybinding",
"id": "ff1fd2e1b9ae4eab452f7f5d586ad806dcccb4bf",
"size":... |
import errno
import os
import _psutil_bsd
import _psutil_posix
import _psposix
from psutil.error import AccessDenied, NoSuchProcess, TimeoutExpired
from psutil._compat import namedtuple
from psutil._common import *
__all__ = base_module_namespace[:]
# --- constants
NUM_CPUS = _psutil_bsd.get_num_cpus()
TOTAL_PHYMEM... | {
"content_hash": "d9a9183bc9f960ada1eb97f7a95a56b5",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 84,
"avg_line_length": 32.95477386934673,
"alnum_prop": 0.6527904849039341,
"repo_name": "elventear/psutil",
"id": "b6e3c8472c0c2eda171c2236cf98734609a4a090",
"size": "659... |
from unittest.mock import patch, PropertyMock
from reddit_view import view
import unittest
import json
class TestRedditLogic(unittest.TestCase):
def setUp(self):
self.initial = {
'i': 'r',
's': 'pics,',
'o': 'hot,new,top',
'p': '100',
... | {
"content_hash": "f8e81d54bb20763617abef22fcbaa21f",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 100,
"avg_line_length": 30.085470085470085,
"alnum_prop": 0.51875,
"repo_name": "japrogramer/reddit_view",
"id": "4ad5aa94504f97a9fc0f69bf0ae64ca2a7bc5f91",
"size": "3520"... |
import re
import sublime
st_version = 2
if sublime.version() == '' or int(sublime.version()) > 3000:
st_version = 3
if (st_version == 2):
from pybeautifier import Beautifier
else:
# from .pybeautifier import Beautifier
print('CodeFormatter: formatting python files on ST3 not supported.')
class PyFo... | {
"content_hash": "9c0f4025580d73703073d344dc3ba923",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 78,
"avg_line_length": 33.05298013245033,
"alnum_prop": 0.5570026046884392,
"repo_name": "crlang/sublime-text---front-end-config",
"id": "c444af6c6e3246701fda07c1ef2a7009ea1... |
import json
import urllib
from tempest.common import service_client
class IdentityV3ClientJSON(service_client.ServiceClient):
api_version = "v3"
def create_user(self, user_name, password=None, project_id=None,
email=None, domain_id='default', **kwargs):
"""Creates a user."""
... | {
"content_hash": "f0678365f01d97a4bfcd98bfc077ef50",
"timestamp": "",
"source": "github",
"line_count": 511,
"max_line_length": 79,
"avg_line_length": 41.34637964774951,
"alnum_prop": 0.5765808405906854,
"repo_name": "fengbeihong/tempest_automate_ironic",
"id": "bc90fd1182e7a5cae87161f94fd49806852687... |
""" Creates a zip file in the staging dir with the result of a compile.
It can be sent to other machines for testing.
"""
import csv
import fnmatch
import glob
import json
import optparse
import os
import re
import shutil
import stat
import sys
import tempfile
from common import chromium_utils
from slave import b... | {
"content_hash": "fa225b49b8adebf0ebbb55790ecc0dda",
"timestamp": "",
"source": "github",
"line_count": 470,
"max_line_length": 80,
"avg_line_length": 40.35957446808511,
"alnum_prop": 0.6587063102957457,
"repo_name": "eunchong/build",
"id": "ccc1f90a5c8ec12908c9f0c5e6b1e7a785e56111",
"size": "19158... |
__author__ = 'Vijaysrinivas Rajagopal'
import urllib.request, urllib.error, json
class GrabSource:
"""
Grabs needed files (usually in JSON format) for processing and compiling during runtime
"""
def __init__(self):
self.rawdata = ""
self.jsondata = None
def sourcegrab(self, url):... | {
"content_hash": "fac86e9e1d806f25ef559c9b58fd0fbc",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 111,
"avg_line_length": 33.18518518518518,
"alnum_prop": 0.5848214285714286,
"repo_name": "MedicAlert/py4f",
"id": "43ff5d7be62f4ff1bfac1f6b9e3b5a904230fa62",
"size": "1792... |
from __future__ import unicode_literals
from django.db import models
class AuthGroup(models.Model):
id = models.IntegerField(primary_key=True)
name = models.CharField(max_length=160, unique=True, blank=True)
class Meta:
db_table = 'auth_group'
class AuthGroupPermissions(models.Model):
id = mo... | {
"content_hash": "cb05edbd6332963eb68acd270b030007",
"timestamp": "",
"source": "github",
"line_count": 1082,
"max_line_length": 104,
"avg_line_length": 50.79482439926063,
"alnum_prop": 0.7340429403202329,
"repo_name": "fbarreir/distributor_web",
"id": "06b3869906e5d41418abd2a949b38dc87bbab376",
"s... |
"""
Defines the encoder and decoder interface for marshalling data between Python
objects and Weld.
"""
from abc import ABC, abstractmethod
from weld.error import WeldError
class WeldEncoder(ABC):
"""
An abstract class that must be overwridden by libraries. This class
is used to marshall objects from Pyth... | {
"content_hash": "917724b759d99225d78052749d5ea6ec",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 78,
"avg_line_length": 25.62121212121212,
"alnum_prop": 0.6014192785334121,
"repo_name": "weld-project/weld",
"id": "bb91840c7fcb78a382ea55d1d2b30336fdb161bf",
"size": "169... |
"""Test replica set AsyncIOClient."""
import test
import unittest
from test import SkipTest
from test.asyncio_tests import AsyncIOTestCase, asyncio_test
from test.test_environment import env
import pymongo
import pymongo.errors
from motor import motor_asyncio
class TestAsyncIOReplicaSet(AsyncIOTestCase):
def s... | {
"content_hash": "cdbd8c44c7f16f73237dff6abb8285b2",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 93,
"avg_line_length": 29.310344827586206,
"alnum_prop": 0.6688235294117647,
"repo_name": "mongodb/motor",
"id": "f223721b31ff02911f6073c74fd4bc2ebb9e8d56",
"size": "2274",... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | {
"content_hash": "5d654a965ff8ec0b0b6dade95fb8abd2",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 378,
"avg_line_length": 46.1578947368421,
"alnum_prop": 0.5674648422652984,
"repo_name": "hephaestus-dev/salpakan-online",
"id": "57aa9f8f3caaec402699f4950273074091eb1300",
... |
from operator import attrgetter
from pokercore.exceptions import HandCreationError, HandComparisonError
from pokercore.card import Card, CardCreationError
class Hand(object):
"""Class representing a poker hand.
A poker hand consists of one or more Card objects, passed to the
constructor contai... | {
"content_hash": "130fd2b8f4ba52d5617b4048c9e8b2fc",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 76,
"avg_line_length": 32.39153439153439,
"alnum_prop": 0.5042469781117281,
"repo_name": "amikrop/pokercore",
"id": "b01fadbd980963153d568680576c3daf29bd4c93",
"size": "61... |
"""Train a transformer on dataset of sequences."""
import contextlib
import os
import time
from absl import app
from absl import flags
from absl import logging
import gin
import jax
import jax.nn
import jax.numpy as jnp
import tensorflow.compat.v1 as tf
from protein_lm import data
from protein_lm import evaluation
f... | {
"content_hash": "689d15e10efeab05fdf4e6941768ce12",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 91,
"avg_line_length": 33.04950495049505,
"alnum_prop": 0.6490413421210306,
"repo_name": "google-research/google-research",
"id": "81090f800570a848a74fe98df8771caf098e0b9f",... |
'''
Created on Jul 25, 2017
@author: dvanaken
'''
from django import forms
from .models import Application, Project
class NewResultForm(forms.Form):
upload_code = forms.CharField(max_length=30)
sample_data = forms.FileField()
raw_data = forms.FileField(required=False)
db_parameters_data = forms.File... | {
"content_hash": "0c8418ef00ea621d83e07ff97c703f2d",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 98,
"avg_line_length": 30.868852459016395,
"alnum_prop": 0.5507169410515136,
"repo_name": "dvanaken/website",
"id": "130f353504063ac75995337166319172e6857abe",
"size": "188... |
from utils.constants import *
from utils.packetCreator import *
from operator import itemgetter
import socket, sys
import copy
import argparse
from errors import *
#from db_manager import DBManager
from messages import *
#TLS/SSL handshake RFC2246 pg 31
"""
Format of an SSL record
Byte 0 = SSL rec... | {
"content_hash": "095910e35eb734411a4607ce8f051873",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 119,
"avg_line_length": 42.20091324200913,
"alnum_prop": 0.5121185890499892,
"repo_name": "su-vikas/pytlspect",
"id": "9acfb0a67a7f058e08cc2e123b91558468b72d8f",
"size": "... |
import sys
from oslo.config import cfg
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.v2 import attributes
from neutron.common import constants as q_const
from neutron.common import exceptions as q_exc
from neutron.common import topics
from neutron.common import utils
from neutron.db import a... | {
"content_hash": "96ad7637cf8e0a748789a0c703944f2b",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 79,
"avg_line_length": 47.53846153846154,
"alnum_prop": 0.573797965788257,
"repo_name": "Brocade-OpenSource/OpenStack-DNRM-Neutron",
"id": "facc0d926b5ee36379f7828a97869a2a4... |
import sys
import io
import inspect
import re
import itertools
import random
import os
class Object(dict):
def __init__(self, **kwargs):
dict.__init__(self, kwargs)
self.__dict__ = self
def __hash__(self):
return id(self)
def __getstate__(self):
return self
... | {
"content_hash": "62a62afc70e280359ef24d2f0eba6e42",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 127,
"avg_line_length": 29.686666666666667,
"alnum_prop": 0.5342465753424658,
"repo_name": "MrCoft/twocode",
"id": "32a8c28a82b24f2338ade7165b5bff0af60cb773",
"size": "890... |
'''
This module performs the return type inference, according to symbolic types,
It then reorders function declarations according to the return type deps.
* type_all generates a node -> type binding
'''
from pythran.analyses import LazynessAnalysis, StrictAliases, YieldPoints
from pythran.analyses import LocalN... | {
"content_hash": "5e09e8fd86fa38c2607d0cebe57e120d",
"timestamp": "",
"source": "github",
"line_count": 605,
"max_line_length": 81,
"avg_line_length": 40.17685950413223,
"alnum_prop": 0.5308347389640844,
"repo_name": "serge-sans-paille/pythran",
"id": "ab4bb30125db72780d62e4ca83c5d2ab151ef2a6",
"si... |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='cuddy',
version='0.1.0',
description='Declaratively build an administrative interface',
long_description=read("README"),
author='Michael Williamson',
ur... | {
"content_hash": "3797fecdd68d895c4929176a74efc6a4",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 23.181818181818183,
"alnum_prop": 0.6137254901960785,
"repo_name": "mwilliamson/cuddy",
"id": "f84360aaed779a50d80ad7af7ae8e511139ab693",
"size": "53... |
"""
Tts API
Description # noqa: E501
The version of the OpenAPI document: 2.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import telestream_cloud_tts
from telestream_cloud_tts.mo... | {
"content_hash": "10ddaff27bb8227838acaeb335f59fa7",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 94,
"avg_line_length": 27.134615384615383,
"alnum_prop": 0.6456413890857547,
"repo_name": "Telestream/telestream-cloud-python-sdk",
"id": "f68ea3558eaed57c0685264d9758788473a... |
import os
import math
import sys
import shutil
import numpy as np
import cv2
noChangeMat = np.array([[1.,0.,0.],[0.,1.,0.]])
dir = 'alphaWhales/batch2'
def getAllImageFiles():
matches = []
for root, dirnames, filenames in os.walk(dir):
filenames = [ f for f in filenames if os.path.splitext(f)[1] in (... | {
"content_hash": "64b3d53e556669c44e6bee21dee96dbb",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 82,
"avg_line_length": 33.041666666666664,
"alnum_prop": 0.6729718369062632,
"repo_name": "andpol5/whaleDetector",
"id": "e036614f3452a1885511644409c72567a35d2b2c",
"size":... |
"""
cobra
~~~~~
Implements cobra main
:author: BlBana <635373043@qq.com>
:homepage: https://github.com/WhaleShark-Team/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2018 Feei. All rights reserved
"""
import xml.etree.ElementTree as eT
from cobra.detecti... | {
"content_hash": "26f8e49532877ad8df144888202cf65a",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 116,
"avg_line_length": 33.36440677966102,
"alnum_prop": 0.5854711709423419,
"repo_name": "40huo/cobra",
"id": "534ca1365005181edeb2550903e0a8d54263a031",
"size": "3984",
... |
"""
Provides common functionality for integrated unit tests
"""
import random
import string
from nova import exception
from nova import flags
from nova import service
from nova import test # For the flags
from nova.auth import manager
from nova.log import logging
from nova.tests.integrated.api import client
FLAGS ... | {
"content_hash": "0abc97c84c61bb5c84e36edecbf6c542",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 77,
"avg_line_length": 32.43127962085308,
"alnum_prop": 0.5985678795849774,
"repo_name": "superstack/nova",
"id": "bc98921f03f5778d847a70f409a365e36bbf1f26",
"size": "7524... |
import argparse
import toml
import config
def makeParser():
parser = argparse.ArgumentParser(description="Convert a device toml cfg into a binary device proto file")
parser.add_argument('device_config', help="The input device config file")
parser.add_argument('proto_file', help="The file to write the bina... | {
"content_hash": "09df8ae9370b091db1dc7cd30b616391",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 109,
"avg_line_length": 32.40909090909091,
"alnum_prop": 0.6591865357643759,
"repo_name": "cuauv/software",
"id": "38e27a428dff4e3c2fb1ffc89a0d372a167569fa",
"size": "737",... |
from django.shortcuts import render
from django.template import loader
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from bs4 import BeautifulSoup, PageElement
import os
# print('%s' % os.getcwd())
# /Users/coufo/Desktop/TestWireframes2/WireFrameSite/mysite
def index(requ... | {
"content_hash": "e9058e254d67347982c80fd0d0fbdb71",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 71,
"avg_line_length": 29.916666666666668,
"alnum_prop": 0.6566852367688022,
"repo_name": "CoufalikJaroslav/pencil-django-presenter",
"id": "52298bfc2cc519baea286d8d5520b8883... |
class GameManager:
def __init__(self, game_name, make_game, display):
self.display = display
self.game_name = game_name
self.env = make_game(game_name)
self.reset()
def is_atari(self):
# Returns false if the space has already been compressed.
return self.env.obse... | {
"content_hash": "5baf2b5b122adca3b4c734bc62cc3059",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 65,
"avg_line_length": 30.565217391304348,
"alnum_prop": 0.6059743954480796,
"repo_name": "machine-intelligence/rl-teacher-atari",
"id": "4f8be831e941a87e743add5f51eef77c3942... |
import logging
import numpy as np
from geosolver.diagram.get_instances import get_all_instances
from geosolver.diagram.states import GraphParse
from geosolver.grounding.label_distances import label_distance_to_line, label_distance_to_point, label_distance_to_arc, \
label_distance_to_angle
from geosolver.grounding... | {
"content_hash": "93d87e7c8e837f0cd26c756321992ed7",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 154,
"avg_line_length": 48.18934911242604,
"alnum_prop": 0.6111247544204322,
"repo_name": "lupantech/InterGPS",
"id": "6a838a78a0fdd0e90e5dc3bf800553bc6970fcd7",
"size": "... |
"""
Django settings for www project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | {
"content_hash": "d04ea2bf8862d2d8177468bbe152a2be",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 71,
"avg_line_length": 23.890243902439025,
"alnum_prop": 0.7197549770290965,
"repo_name": "vmharrel/personalshopper",
"id": "7440cebbb6da4229c1889c2c97cefdcfce0ab1d8",
"siz... |
"""SavedModel builder implementation."""
import functools
import os
from google.protobuf.any_pb2 import Any
from tensorflow.core.framework import types_pb2
from tensorflow.core.protobuf import meta_graph_pb2
from tensorflow.core.protobuf import saved_model_pb2
from tensorflow.core.protobuf import saver_pb2
from tens... | {
"content_hash": "4c19a3eed2e577b8feb9d9b40067ef7d",
"timestamp": "",
"source": "github",
"line_count": 806,
"max_line_length": 176,
"avg_line_length": 42.8151364764268,
"alnum_prop": 0.6774464632414733,
"repo_name": "yongtang/tensorflow",
"id": "d9fe73777c67139ae8ff0ff448c99826bdc30689",
"size": "... |
""" Import the Base Module, A module is part of the bot who manage some stuff """
from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta
import schedule
from utils import db
from utils.modules import BaseModule
from utils.translations import _
from .models import Bet, Answe... | {
"content_hash": "9dbf6c7fd813c861ee06e129432e78db",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 81,
"avg_line_length": 24.57777777777778,
"alnum_prop": 0.5714285714285714,
"repo_name": "Gagaro/PimpMyBot",
"id": "c5ccc11a98d1547a5f793dbfb1692995a8095b6f",
"size": "1106... |
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class cptBrepWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
self._triFil... | {
"content_hash": "f8f8b650ee1a73d95bdd6e403e56c179",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 77,
"avg_line_length": 31.721739130434784,
"alnum_prop": 0.5433114035087719,
"repo_name": "nagyistoce/devide",
"id": "5b8a33b001fcd3fdd67334eb28abe165c9bbac4d",
"size": "3... |
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(os.path.dirname(__file__), '..', 'webvirtmgr.sqlite3'),
# The following set... | {
"content_hash": "ef8360898584e75d69923da5f528ffba",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 107,
"avg_line_length": 32.9078947368421,
"alnum_prop": 0.6903238704518193,
"repo_name": "selboo/starl-mangle",
"id": "e4cb6bb86934cc70cca4df5a8a50e54cc53041bb",
"size": "... |
"""Add tables for SQL Lab state
Revision ID: db4b49eb0782
Revises: 78ee127d0d1d
Create Date: 2019-11-13 11:05:30.122167
"""
# revision identifiers, used by Alembic.
revision = "db4b49eb0782"
down_revision = "78ee127d0d1d"
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
def upg... | {
"content_hash": "04e6bdfd38dc0de587ae9b3922b6da99",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 88,
"avg_line_length": 45.93589743589744,
"alnum_prop": 0.6288026793190065,
"repo_name": "airbnb/superset",
"id": "53afac7d6968da290fbc8782059f7a673092d2de",
"size": "4368"... |
from django.core import mail
from django.contrib.auth.models import User, check_password
from django.test import TestCase
from forms import EditProfileForm
from models import UnconfirmedUser
class UserbaseTest(TestCase):
def test_registration(self):
self.client.post('/register/', {'username': 'user',
'email': ... | {
"content_hash": "ba29441871777d8d5f4e59311e9d3029",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 77,
"avg_line_length": 35.648648648648646,
"alnum_prop": 0.7285822592873389,
"repo_name": "abshkd/benzene",
"id": "729475aa2f1f0926de5860417f921f889447d8d4",
"size": "1319"... |
"""
Exercise 4
Random Loopy practice
Use random to simulate 2 6-sided dice rolls for as many times as a user wants.
Procedure:
Rolling the dice:
1. Ask the user for a number, this will be the total number of rolls
2. Use a for loop and inside each for loop, roll two dice
3. Count the number of ... | {
"content_hash": "1da3e60ed68ad471f968c09e44492de7",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 87,
"avg_line_length": 33.16129032258065,
"alnum_prop": 0.6945525291828794,
"repo_name": "Heroes-Academy/Intro-to-Python-Spring-2016",
"id": "c0ebf7c15ad6852e409c3c1580a07590... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.