text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import print_function
import sys
from utils import CDNEngine
if sys.version_info >= (3, 0):
import subprocess as commands
import urllib.parse as urlparse
else:
import commands
import urlparse
def detect(hostname):
"""
Performs CDN detection through whois command's.
Paramet... | {
"content_hash": "313a8a55d877b9b506e219ad848965b7",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 51,
"avg_line_length": 20.142857142857142,
"alnum_prop": 0.6578014184397163,
"repo_name": "Nitr4x/whichCDN",
"id": "0b282e7f71f1e03bd7a385759deac711dd259cb3",
"size": "587"... |
from __future__ import absolute_import
# Copyright (c) 2010-2014 openpyxl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | {
"content_hash": "1e924cd7906478625d2fabb0654c03c6",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 79,
"avg_line_length": 44.44444444444444,
"alnum_prop": 0.5796666666666667,
"repo_name": "Hitachi-Data-Systems/org-chart-builder",
"id": "5d22db31b8efcafcf3af92ede31e93b528f... |
VERSION = (0, 9, 5, 'alpha')
__version__ = VERSION # alias
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final'... | {
"content_hash": "1d94f6bbcf94430a2ba2c07b84f308aa",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 95,
"avg_line_length": 33.02439024390244,
"alnum_prop": 0.5945347119645494,
"repo_name": "manhg/django-rest-framework-gis",
"id": "daff06a9eeeb6d8eef5b0966623feabf629eb4ae",
... |
# The MIT License
#
# Copyright (c) 2008 Bob Farrell
# Copyright (c) bpython authors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the ri... | {
"content_hash": "b6a29aadb3890186f19810895f80d072",
"timestamp": "",
"source": "github",
"line_count": 1935,
"max_line_length": 101,
"avg_line_length": 31.858397932816537,
"alnum_prop": 0.5425493949323557,
"repo_name": "SurfasJones/icecream-info",
"id": "7a1737f20aa016b5380e8ead018de179d158b7e4",
... |
import unittest
import datetime as pydt
import logging
import uuid
import json
# Our imports
import emission.storage.decorations.trip_queries as esdt
import emission.storage.decorations.analysis_timeseries_queries as esda
import emission.storage.timeseries.timequery as estt
import emission.storage.timeseries.abstract... | {
"content_hash": "d6c9529851fc1fc930589dc045d23cdf",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 88,
"avg_line_length": 39.0655737704918,
"alnum_prop": 0.697440201426773,
"repo_name": "yw374cornell/e-mission-server",
"id": "b8fdcabfc79430ab4388f4fd5fda3f1ef5d1fa42",
"s... |
import pytest
import tornado.testing
import bson.json_util
print __package__
from drenaj.config import *
from drenaj.tests.testhandlerbase import TestHandlerBase
class TestBucketHandler(TestHandlerBase):
def test_followers_ids_view(self):
import urllib
print self.get_http_port()
# Ex... | {
"content_hash": "d709cd4ac9d57292b8141d4b3daf6e36",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 519,
"avg_line_length": 40.16083916083916,
"alnum_prop": 0.5446630680828836,
"repo_name": "boun-cmpe-soslab/drenaj",
"id": "9801f36457be3e8f6fc0c82f0347c0cc439c479f",
"siz... |
__author__ = 'Christian Heinrich'
__copyright__ = 'Copyright 2014, Recorded Future'
__credits__ = []
__license__ = 'Apache'
__version__ = '1.0'
__maintainer__ = 'Christian Heinrich'
__email__ = '[email protected]'
__status__ = 'Production'
__all__ = [
'rf_csv_maltegoload',
'rf_expand_event',
'... | {
"content_hash": "0eb98bd4ca39e7e2914c28e6c655ceac",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 49,
"avg_line_length": 22,
"alnum_prop": 0.5989304812834224,
"repo_name": "cmlh/Maltego-Recorded_Future-Canari",
"id": "baa2c9c9aa398efb89750fbee6c5763c9417d199",
"size": "... |
import json
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.template.context_processors import csrf
from django.utils.http import urlencode
from django.utils.module_loading import import_string
from django.utils.translat... | {
"content_hash": "9b5e4cd692d395d3bd840b6d7c2da3bc",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 116,
"avg_line_length": 34.193370165745854,
"alnum_prop": 0.6370980772338019,
"repo_name": "andersinno/django-form-designer-ai",
"id": "724e49f49300b4b567ddd20cc10c11aa6c648... |
"""
Code for a conventional entry-point based command-line interface.
"""
import argparse
import os
from logging import getLogger
import boto3
import pytz
from . import DiscoVPC, DiscoAWS
from .disco_aws_util import read_pipeline_file, graceful
from .disco_logging import configure_logging
from .disco_config import r... | {
"content_hash": "c1ca456217686776b3affa655417d043",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 110,
"avg_line_length": 41.59233449477352,
"alnum_prop": 0.6334925023037614,
"repo_name": "amplifylitco/asiaq",
"id": "bcf2945530932b512458951f2d98d79845830d34",
"size": "... |
"""Unit test for treadmill.formatter
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
from treadmill import formatter
class FormatterTest(unittest.TestCase):
"""Tests for teadmill.formatter""... | {
"content_hash": "a75038dd6f8bdec70ea2334ded742963",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 78,
"avg_line_length": 26.192307692307693,
"alnum_prop": 0.48751835535976507,
"repo_name": "Morgan-Stanley/treadmill",
"id": "6de94e4f852ea99ec8b29f5b75c745c6c6068e7a",
"si... |
"""
The MIT License (MIT)
Copyright (c) 2012 Gabriel Fernandes
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify... | {
"content_hash": "65910c88a17ec65184e5652cd44ba46e",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 80,
"avg_line_length": 47.28,
"alnum_prop": 0.7918781725888325,
"repo_name": "nayamonia/amelia",
"id": "1c11f8014b16d9428726c69e9882644f876db5eb",
"size": "1200",
"binary... |
import os, sys
# nothing to test until we put VMODL back in the VIB
# See https://github.com/vmware/vsphere-storage-for-docker/pull/975 for details.
if "INSTALL_VMODL" not in os.environ:
print("Skipping VMODL test - INSTALL_VMODL is not defined")
sys.exit(0)
import ssl
sys.path.append('/lib64/python3.5/site-p... | {
"content_hash": "84413194b29c16906aecdf786c87381b",
"timestamp": "",
"source": "github",
"line_count": 811,
"max_line_length": 132,
"avg_line_length": 36.60912453760789,
"alnum_prop": 0.6621421353991243,
"repo_name": "govint/docker-volume-vsphere",
"id": "65ea00b3421bfec4a9c02bbd02233b65a082798a",
... |
from __future__ import division, print_function, absolute_import
from scipy._lib.six import string_types, exec_, PY3
from scipy._lib._util import getargspec_no_self as _getargspec
import sys
import keyword
import re
import types
import warnings
from scipy.misc import doccer
from ._distr_params import distcont, distd... | {
"content_hash": "9157f19a9afb67de2b4d67167e9c964d",
"timestamp": "",
"source": "github",
"line_count": 3415,
"max_line_length": 103,
"avg_line_length": 34.753440702781845,
"alnum_prop": 0.5532047555252226,
"repo_name": "sriki18/scipy",
"id": "94cd90d0b162125fd4cb4685427702a86406566d",
"size": "118... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topics', '0005_auto_20170518_1636'),
]
operations = [
migrations.AddField(
model_name='topic',
name='key',
field... | {
"content_hash": "88c00289a08034f4d229335d5245014b",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 62,
"avg_line_length": 21.27777777777778,
"alnum_prop": 0.5900783289817232,
"repo_name": "GeorgiaTechDHLab/TOME",
"id": "53731be09e8eb6f76b0306ad128e14419125d955",
"size": ... |
from airflow.operators.python_operator import BranchPythonOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.models import DAG
from datetime import datetime, timedelta
two_days_ago = datetime.combine(datetime.today() - timedelta(2),
datetime.min.time())
a... | {
"content_hash": "a70c3c84e9dc2c8eb7b7527319a9b4cb",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 123,
"avg_line_length": 28.285714285714285,
"alnum_prop": 0.6599326599326599,
"repo_name": "yiqingj/airflow",
"id": "19bb1832fc94fc7a64a7096958dc361bf0f87ac3",
"size": "175... |
from rest_framework.permissions import BasePermission
from kolibri.core.auth.permissions.general import DenyAll
class UserCanManageDevicePermissions(DenyAll):
def user_can_read_object(self, user, obj):
return user.is_superuser
def readable_by_user_filter(self, user, queryset):
if user.is_su... | {
"content_hash": "29c9f0f6735c0fa92c56670f4133b7da",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 87,
"avg_line_length": 33.054054054054056,
"alnum_prop": 0.7089125102207686,
"repo_name": "DXCanas/kolibri",
"id": "0d352552eeab6e527c193028925c28c3ac5a2ed1",
"size": "1223... |
"""Contains the `AddN` expression.
The `AddN` expression represents a sum of operands. JAX only has a binary
`add` primitive, meaning a sequence of adds is represented as an expression
tree of `add` primitives. In `autoconj`, we'd like to roll all the `add`s into
a single expression to simplify rewrite rules and to re... | {
"content_hash": "b2135e3488e7507e43cf2db431b649b7",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 79,
"avg_line_length": 29.396039603960396,
"alnum_prop": 0.7052879757494106,
"repo_name": "jax-ml/oryx",
"id": "17c5792fce587edddda020e3e917f4252e6062ac",
"size": "3551",
... |
import os
import time
from azure import (
WindowsAzureError,
SERVICE_BUS_HOST_BASE,
_convert_response_to_feeds,
_dont_fail_not_exist,
_dont_fail_on_exist,
_get_request_body,
_get_request_body_bytes_only,
_int_or_none,
_str,
_update_request_uri_query,
url_quote,
url_unquo... | {
"content_hash": "f55044fa345e7cb19c4fdcc71537dcfb",
"timestamp": "",
"source": "github",
"line_count": 900,
"max_line_length": 82,
"avg_line_length": 41.68,
"alnum_prop": 0.6025005331627212,
"repo_name": "jlark/azure-sdk-for-python",
"id": "8ad9abe90d4f13b4bd0ac3249444884556ca2078",
"size": "38254... |
import pytest
from plenum.common.startable import Mode
from plenum.common.stashing_router import PROCESS, DISCARD
from plenum.server.replica_validator import ReplicaValidator
from plenum.server.replica_validator_enums import INCORRECT_INSTANCE, ALREADY_ORDERED, FUTURE_VIEW, \
GREATER_PREP_CERT, OLD_VIEW, CATCHING_... | {
"content_hash": "b760cb3ba5caeeed3b8ac45c33e6f82f",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 122,
"avg_line_length": 43.39622641509434,
"alnum_prop": 0.6340993788819875,
"repo_name": "evernym/zeno",
"id": "77f4e2b6d7d4809631349de16b1761685178e477",
"size": "16100"... |
''' Runs various chrome tests through valgrind_test.py.'''
import glob
import logging
import multiprocessing
import optparse
import os
import stat
import subprocess
import sys
import logging_utils
import path_utils
import common
import valgrind_test
class TestNotFound(Exception): pass
class MultipleGTestFiltersSpe... | {
"content_hash": "e16df6efa319335dded924899632db6b",
"timestamp": "",
"source": "github",
"line_count": 799,
"max_line_length": 94,
"avg_line_length": 41.018773466833544,
"alnum_prop": 0.6376701043510099,
"repo_name": "junhuac/MQUIC",
"id": "841eaf7dec91cf8c6fd084422d9d4bcf2d8928ce",
"size": "32963... |
"""A simple test to ensure that the Python wrapper can get xDS config."""
from concurrent.futures import ThreadPoolExecutor
import logging
import os
import queue
import sys
import time
import unittest
from envoy.service.status.v3 import csds_pb2
from envoy.service.status.v3 import csds_pb2_grpc
from google.protobuf i... | {
"content_hash": "76e3a0d69ad7137d352fa370be11b660",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 79,
"avg_line_length": 32.604651162790695,
"alnum_prop": 0.5601521635758441,
"repo_name": "jtattermusch/grpc",
"id": "e34de6ffcfff3757b79d81c0f925f4c257168ce4",
"size": "4... |
"""Config file for collecting policy data with epsilon-greedy noise."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
model_params = (200, 200)
default_policy_root_dir = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'../..... | {
"content_hash": "a0806bfb5b3b25d43bd6ddb59c572998",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 71,
"avg_line_length": 27.125,
"alnum_prop": 0.6209677419354839,
"repo_name": "google-research/google-research",
"id": "efd93f0f6267c12c1849fec334916a2dfafb7bf1",
"size": "... |
"""Keras layers API."""
import tensorflow.compat.v2 as tf
from keras.engine.base_layer import Layer
from keras.engine.base_preprocessing_layer import PreprocessingLayer
# Generic layers.
from keras.engine.input_layer import Input
from keras.engine.input_layer import InputLayer
from keras.engine.input_spec import Inp... | {
"content_hash": "b2169398fddf26ef46fa8adf08b24a3e",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 80,
"avg_line_length": 45.32608695652174,
"alnum_prop": 0.8354916067146283,
"repo_name": "keras-team/keras",
"id": "f4a7b57c205b6eb869c92ac4a936e942df7c09fe",
"size": "131... |
'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Ecs20130110DescribeSnapshotAttributeRequest(RestApi):
def __init__(self,domain='ecs.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.RegionId = None
self.SnapshotId = None
def getapiname(self):
return 'ecs.ali... | {
"content_hash": "12511d365493a2b6be9c76e793a203e1",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 64,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.7527173913043478,
"repo_name": "francisar/rds_manager",
"id": "a65f1a93dcfd93ad399cb0a85fa545ffb30f2992",
"size":... |
'''
JSON related utilities.
This module provides a few things:
1) A handy function for getting an object down to something that can be
JSON serialized. See to_primitive().
2) Wrappers around loads() and dumps(). The dumps() wrapper will
automatically use to_primitive() for you if needed.
3) Th... | {
"content_hash": "b1521c67e6a7d2557980837d5daa4229",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 79,
"avg_line_length": 34.91925465838509,
"alnum_prop": 0.6262895766631092,
"repo_name": "pombredanne/solum",
"id": "f44a89842da73afadc566cafb4148da00ed293b2",
"size": "64... |
"""
The MIT License (MIT)
Copyright (c) 2016 Daniele Linguaglossa <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation th... | {
"content_hash": "627672aeeb76bac2d2e9ec3212ceb5db",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 120,
"avg_line_length": 54.16935483870968,
"alnum_prop": 0.6060741402411791,
"repo_name": "mseclab/PyJFuzz",
"id": "03e2bef92647cc5fb38ca4bfd8ab4ebc46bb8720",
"size": "671... |
from pyqtgraph.Qt import QtGui, QtCore
class ImageDisplay(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent=parent)
self.p = None
self.setSizePolicy(QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Expanding)
def setPixmap(sel... | {
"content_hash": "fa325300fbeaa828fe15a668fa48b6d4",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 74,
"avg_line_length": 35.88095238095238,
"alnum_prop": 0.5653616456536165,
"repo_name": "QudevETH/PycQED_py3",
"id": "3fab7d49b9cb7daf1738191a7b09fc720a7cc029",
"size": "1... |
from .core import ConstExpression
CONST_LISTING = {
"NaN": "not a number (same as JavaScript literal NaN)",
"LN10": "the natural log of 10 (alias to Math.LN10)",
"E": "the transcendental number e (alias to Math.E)",
"LOG10E": "the base 10 logarithm e (alias to Math.LOG10E)",
"LOG2E": "the base 2 logarithm o... | {
"content_hash": "c195cce7874f51355b5d91720f878e7d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 62,
"avg_line_length": 31.703703703703702,
"alnum_prop": 0.6436915887850467,
"repo_name": "ellisonbg/altair",
"id": "cef3398c21e41489d2b9934540c913b0d1290d0e",
"size": "856... |
from django.db import models
import recurrence.fields
class RecurringAlarm(models.Model):
name = models.CharField(max_length=255)
time = models.TimeField()
recurrences = recurrence.fields.RecurrenceField()
def __unicode__(self):
return self.name
class SingleAlarm(models.Model):
name = m... | {
"content_hash": "3b3a59f8b34ac3b34337a8d62290d586",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 53,
"avg_line_length": 23.31578947368421,
"alnum_prop": 0.6975169300225733,
"repo_name": "akoebbe/sweetiepi",
"id": "b460a1df07d4ea2738ee6700bd62f013f6c35529",
"size": "443... |
from SUASSystem import Location
from .settings import GCSSettings
class VehicleState(Location):
def __init__(self, lat, lon, alt, direction, groundspeed, velocity, obstacle_in_path, current_waypoint_number):
"""
Initialize
:param lat: The latitude of the vehicle
:type lat: float
... | {
"content_hash": "9a9b280f5d60d13444e69928386ff130",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 115,
"avg_line_length": 31.181818181818183,
"alnum_prop": 0.6118284048313203,
"repo_name": "FlintHill/SUAS-Competition",
"id": "48d7b23ffc94cc148c4e0f1dac13dfee9eab086c",
"... |
"""ml jobs submit training command."""
from googlecloudsdk.api_lib.ml import jobs
from googlecloudsdk.api_lib.storage import storage_util
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.compute import flags as compute_flags
from googlecloudsdk.command_lib.logs import stream
from googlecloudsdk.... | {
"content_hash": "54ccb36d7518804c47800cd67a3b8595",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 80,
"avg_line_length": 38.7185628742515,
"alnum_prop": 0.6871326940921745,
"repo_name": "Sorsly/subtle",
"id": "85f0ea8f63bedfcfa8721058c54d3e532003dbea",
"size": "7061",
... |
import unittest
from mixbox.vendor.six import StringIO
from stix.core import STIXPackage
from cybox.common import StructuredText
from stix.test import EntityTestCase, assert_warnings
from stix.test import data_marking_test
from stix.test.common import (
confidence_test, information_source_test, related_test, ide... | {
"content_hash": "b1e875b6a341ab8a25feff77466bd3fa",
"timestamp": "",
"source": "github",
"line_count": 515,
"max_line_length": 115,
"avg_line_length": 30.122330097087378,
"alnum_prop": 0.619673821955779,
"repo_name": "STIXProject/python-stix",
"id": "9beb3f7be3dbe212280d5d33663d93c8fcaa2040",
"siz... |
"""
@package mi.dataset.parser.WFP_E_file_common
@file mi/dataset/parser/WFP_E_file_common
@author Emily Hahn, Mike Nicoletti, Maria Lutz
@brief A common parser for the E file type of the wire following profiler
"""
import re
from mi.core.log import get_logger
from mi.core.exceptions import SampleExceptio... | {
"content_hash": "0a9d244e19bfd73ec495c571fd8eb3d4",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 117,
"avg_line_length": 41.44776119402985,
"alnum_prop": 0.6150522146200936,
"repo_name": "oceanobservatories/mi-instrument",
"id": "ee4880341f703a2252cfe94029728aab6700cf83... |
"""
Pelix remote services implementation based on Herald messaging,
jsonrpclib-pelix, and using the Jabsorb format
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 1.0.1
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Vers... | {
"content_hash": "df1f44c283178f8d57b3ab841d443997",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 80,
"avg_line_length": 30.366013071895424,
"alnum_prop": 0.6058975462763667,
"repo_name": "isandlaTech/cohorte-devtools",
"id": "27972cfd26732edde835a243a6defe89683bfb36",
... |
'''
This script allows config of ports on rPi network tap
@author: devopsec
'''
import socket, subprocess
'''
@summary:
This class holds functions for configuring ports
'''
class func:
def getIPAddress():
output = subprocess.check_output(['hostname', '-I'])
return output
def check():
... | {
"content_hash": "5bc25503082a6fb290f83742facb7235",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 125,
"avg_line_length": 42.053763440860216,
"alnum_prop": 0.6149322423932498,
"repo_name": "devopsec/threatdetectionservice",
"id": "a764ef68b48acc307929e0e38c202ef4e681b855"... |
import random, re, socket, Queue, time, select, errno, sys
from threading import Thread
import xmpp
import common
from stunclient import *
from parseconf import *
# global messages list
messages = []
def xmppMessageCB(cnx, msg):
u = msg.getFrom()
m = msg.getBody()
#print u, m
if u ... | {
"content_hash": "5cdb73b8a8b63ccb3a7fa8f97af747df",
"timestamp": "",
"source": "github",
"line_count": 503,
"max_line_length": 93,
"avg_line_length": 36.487077534791254,
"alnum_prop": 0.4782324415626873,
"repo_name": "lezizi/A-Framework",
"id": "d8ba398d64537a33b03a19ea7ad484cdeca30d76",
"size": "... |
"""
This module provides the ``StatusItem`` class used for single system system information.
"""
from typing import Any, Callable, Dict, List, Union
class StatusItem:
"""
A status item provides a common interface to access and format system status information.
"""
def __init__(self, label: s... | {
"content_hash": "502471b3ae72095849574dc3ae4646f3",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 100,
"avg_line_length": 40.22857142857143,
"alnum_prop": 0.5561079545454546,
"repo_name": "BMeu/Orchard",
"id": "fa9fa04ea7ef640d11297d69dda4142a770dd821",
"size": "2841",
... |
import random
import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(*testing.product({
'shape': [(3, 2), ()],
... | {
"content_hash": "3cfcbaa76e41d13182975873e329e70a",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 76,
"avg_line_length": 30.684931506849313,
"alnum_prop": 0.6200892857142857,
"repo_name": "ysekky/chainer",
"id": "6c2965d5f695831b66181d042db37eb492c9e162",
"size": "2240"... |
import os
import pandas as pd
from collections import defaultdict
#Preparea a group of assays
def get_counts(data):
assay_group=data.groupby('LIBRARY_STRATEGY')
assay_count_dict=defaultdict(lambda: defaultdict(lambda: defaultdict(dict)))
#Get counts of assays and histone marks
for assay_name in assay_group... | {
"content_hash": "c2de4fb72e33050d9a1c1801d1da5f92",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 84,
"avg_line_length": 39.906976744186046,
"alnum_prop": 0.6981351981351981,
"repo_name": "avikdatta/python_scripts",
"id": "8bda9d9fba7e596af1a03c7b4bcaa275560213f3",
"siz... |
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each language: one in docutils/languages, the other in
# docutils/parsers/rst/languages.
"""
Polish-language mappings for language-dependent fea... | {
"content_hash": "39dddb8fccc8aa19245272835dbc6d96",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 77,
"avg_line_length": 34.20618556701031,
"alnum_prop": 0.5946353224834238,
"repo_name": "ajaxsys/dict-admin",
"id": "94e02229d2882f9057f46e637aaaded26b392cb5",
"size": "34... |
import os
import enchant
def _win32_data_files():
# This is basically a copy of enchant.utils.win32_data_files as of
# release 1.6.0. We use this as a fallback for older versions of
# enchant which do not have this function.
# enchant is licenced under LGPL.
dataDirs = ("share/enchant/myspell","sha... | {
"content_hash": "d83707f60ba45b55a4364177b267beb0",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 77,
"avg_line_length": 33.642857142857146,
"alnum_prop": 0.6581740976645435,
"repo_name": "TeamSWAP/swap",
"id": "c0414223531a97c84e050251829be9a1791b3c98",
"size": "1347",... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import TestSCons
test = TestSCons.TestSCons()
test.subdir('work', 'repository', ['repository', 'src'])
work_aaa = test.workpath('work', 'aaa')
work_bbb = test.workpath('work', 'bbb')
work_ccc = test.workpath('work', 'ccc')
work_src_xxx = t... | {
"content_hash": "3bd6cf85cf725146fe7b4555b5f414ff",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 82,
"avg_line_length": 31.703703703703702,
"alnum_prop": 0.6433021806853583,
"repo_name": "azatoth/scons",
"id": "62f4785aea6a3c9304eaf128de78c400fd39b1da",
"size": "3670",... |
import sys
import math
class Coordinate:
"""Class to represent a Coordinate in the grid. We can add two coordinates.
The r attribute represents the row and c the column"""
def __init__(self, r, c):
"""Initialisation of the class Coordinate which needs an 'r' and a 'c' coordinate"""
self.r... | {
"content_hash": "21e2290c3f6f68ed09cfdb84e2f08b74",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 142,
"avg_line_length": 35.92084432717678,
"alnum_prop": 0.5986484501248714,
"repo_name": "TGITS/programming-workouts",
"id": "9465e5a77aaffac5f20f15b881a4212645941072",
"... |
"""This code example deactivates a user.
Deactivated users can no longer make requests to the API. The user making the
request cannot deactivate itself. To determine which users exist, run
get_all_users.py."""
# Import appropriate modules from the client library.
from googleads import dfp
USER_ID = 'INSERT_USER_ID_... | {
"content_hash": "3fce240334b2013394e766727b1a339b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 77,
"avg_line_length": 30.490909090909092,
"alnum_prop": 0.6410256410256411,
"repo_name": "wubr2000/googleads-python-lib",
"id": "e1db318eed7dacdf59be3073b4fd44963dd8adbf",
... |
"""Item Loader
See documentation in docs/topics/loaders.rst
"""
from collections import defaultdict
import six
from pyrake.item import Item
from pyrake.selector import Selector
from pyrake.utils.decorator import deprecated
from pyrake.utils.deprecate import create_deprecated_class
from pyrake.utils.misc import arg_t... | {
"content_hash": "056cfd44db19b6e55c6ac35e7d6786d3",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 96,
"avg_line_length": 36.116279069767444,
"alnum_prop": 0.6115582743077914,
"repo_name": "elkingtowa/pyrake",
"id": "a933bbb9d2fecfcda589b1936c95f15307731b50",
"size": "6... |
"""
Generate Allura sitemap xml files. You will need to configure your webserver to serve the files.
This takes a while to run on a prod-sized data set. There are a couple of
things that would make it faster, if we need/want to.
1. Monkeypatch forgetracker.model.ticket.Globals.bin_count to skip the
refresh (Solr ... | {
"content_hash": "25c597ef3055c73fbb17b6f4a24ca651",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 105,
"avg_line_length": 35.4873417721519,
"alnum_prop": 0.584804708400214,
"repo_name": "lym/allura-git",
"id": "9ab8f3833d14055179524465825ed01dfbaa1884",
"size": "6477",... |
"""
Research Object management supporting utility functions
"""
__author__ = "Graham Klyne ([email protected])"
__copyright__ = "Copyright 2011-2013, University of Oxford"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import os.path
from xml.dom import minidom
try:
# Running Python 2.5 with simplej... | {
"content_hash": "83501e66cfa7584270329f3f088d3c0a",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 132,
"avg_line_length": 33.816901408450704,
"alnum_prop": 0.612036651395252,
"repo_name": "wf4ever/ro-manager",
"id": "76db80504dea375dee8af16f0334a7cd9c9d075b",
"size": "... |
'''
an example of creating a distance field using Manhattan distance
'''
GRID_HEIGHT = 6
GRID_WIDTH = 8
def manhattan_distance(row0, col0, row1, col1):
'''
compute the Manhattan distance between the cells (row0, col0) and (row1, col1)
'''
return abs(row0 - row1) + abs(col0 - col1)
def create... | {
"content_hash": "07ea320729587b5c1b349126c7b8c972",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 128,
"avg_line_length": 30.789473684210527,
"alnum_prop": 0.6376068376068376,
"repo_name": "chubbypanda/principles-of-computing",
"id": "c9d20316211ae8170545e35e983b7ddfa4a64... |
import RCPU.emulator.cpu as cpu
import argparse
import struct
import logging
def unpack(raw):
'''Unpacks raw into a list of binary instructions'''
# '>' means big endian
return struct.unpack(">" + "H" * (len(raw) // 2), raw)
def cpu_loop(c):
while c.running:
c.step()
logging.debug(c... | {
"content_hash": "e099938764970b7cf14ea1ff81541c7a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 81,
"avg_line_length": 25.94736842105263,
"alnum_prop": 0.6338742393509128,
"repo_name": "redfast00/RCPU",
"id": "d7adbaae1f037689cb2220fd00496ffc4fadaf0b",
"size": "986",
... |
from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
from bluebottle.activities.models import Activity
from bluebottle.geo.models import Location
from bluebottle.offices.models import OfficeSubRegion, OfficeReg... | {
"content_hash": "3447e8517c3931c552576d8118de6c69",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 84,
"avg_line_length": 33.864583333333336,
"alnum_prop": 0.6179637034758536,
"repo_name": "onepercentclub/bluebottle",
"id": "0634063a2f258045c9515acd16e28787159846df",
"si... |
"""Function to provide hexadecimal representation of data."""
_HEXDUMP_CHARACTER_MAP = [
'.' if byte < 0x20 or byte > 0x7e else chr(byte) for byte in range(256)]
def Hexdump(data):
"""Formats data in a hexadecimal representation.
Args:
data (byte): data.
Returns:
str: hexadecimal representation ... | {
"content_hash": "9536ae1e85006e076ac6d1a771a7e4c1",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 27.405797101449274,
"alnum_prop": 0.632469592808038,
"repo_name": "libyal/winreg-kb",
"id": "b2738dae001f4bc3bb22708a9d74381753c369a7",
"size": "1915... |
from distutils.core import setup
setup(name='KVNest',
version='0.5',
description='Objected Oriented Keys for Redis ... in Python.',
author='Michael Katsevman',
url='https://github.com/anateus/kvnest',
packages=['kvnest'],
package_dir={'kvnest':'src'}) | {
"content_hash": "4ff774c3e9261b67af1849a194a0ac48",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 65,
"avg_line_length": 30,
"alnum_prop": 0.6814814814814815,
"repo_name": "anateus/kvnest",
"id": "cfd5f21415e2f52480672b8e7a76dad5d325f72c",
"size": "293",
"binary": fals... |
from django.conf.urls import url, include
from rest_framework import routers
from task_manager.task_manager import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'employees', views.EmployeeViewSet)
router.register(r'projects', views.ProjectViewSet)
router.register... | {
"content_hash": "1797d1823a4afd5222b2b588620a1792",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 82,
"avg_line_length": 30.625,
"alnum_prop": 0.763265306122449,
"repo_name": "OksanaPiskunova/task-manager",
"id": "40fa103f15dc3ea13b6c470b3b449fe0666cb2da",
"size": "490"... |
from braces.views import LoginRequiredMixin
from django.contrib.auth import authenticate, login
from django.conf import settings
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import render, redirect
from django.utils.decorators ... | {
"content_hash": "ca6bf8d05bf5c99c6b739d293336fe1b",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 91,
"avg_line_length": 31.424460431654676,
"alnum_prop": 0.6721611721611722,
"repo_name": "lsk112233/Clone-test-repo",
"id": "bef4194977ffe2213f3a8079668cc9a3dd1b3874",
"s... |
from django.views.generic import TemplateView
class WelcomeView(TemplateView):
template_name = "about/welcome.html"
class AboutView(TemplateView):
template_name = "about/about.html"
| {
"content_hash": "b7ac19ff5706fab79700bf23b3ebb57f",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 45,
"avg_line_length": 21.555555555555557,
"alnum_prop": 0.7628865979381443,
"repo_name": "toystori/v2",
"id": "a86beab862b5151fab9a3cc5d4f32a68472f5a8d",
"size": "194",
"... |
TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
# An envvar key for determining the pro... | {
"content_hash": "3658ac43f912e916102558c4b76f0430",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 70,
"avg_line_length": 49.125,
"alnum_prop": 0.6857506361323156,
"repo_name": "GoogleCloudPlatform/python-docs-samples",
"id": "dab8523bc726d1cb9bf2e7330b1e35aa4681d0d9",
"... |
import os
import time
from google.cloud import errorreporting_v1beta1
from google.cloud.errorreporting_v1beta1.proto import common_pb2
from google.cloud.errorreporting_v1beta1.proto import report_errors_service_pb2
class TestSystemReportErrorsService(object):
def test_report_error_event(self):
project_id... | {
"content_hash": "acd45995a2f7dbaa963e82e4427b1da7",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 34.46875,
"alnum_prop": 0.6337262012692656,
"repo_name": "dhermes/google-cloud-python",
"id": "a2d1fe1176248a414a7d499c9943a38b3cfa4865",
"size": "17... |
import os
import unittest
# 3p
import mock
# project
from checks.check_status import AgentStatus
class TestRunFiles(unittest.TestCase):
""" Tests that runfiles (.pid, .sock, .pickle etc.) are written to internal agent folders"""
# Mac run directory expected location
_my_dir = os.path.dirname(os.path.abs... | {
"content_hash": "21fd562f05c88fa87fb99d18be10aa59",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 99,
"avg_line_length": 51.36,
"alnum_prop": 0.690809968847352,
"repo_name": "pmav99/praktoras",
"id": "57d9911188d3612361fe5f033bbf8f671b7c4e83",
"size": "2577",
"binary"... |
import shutil
import sys
import pandas as pd
from urlparse import urlparse
from processing import tr_zxing, get_hocr_zones
from processing import tr_get_pdf_text, maketr_get_field_zones
from processing import tr_png, tr_threshold
from processing import tr_tesseract_txt, tr_tesseract_hocr, tr_cuneiform_txt, tr_ocropus_h... | {
"content_hash": "93b4815b383620006991678569fdf389",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 148,
"avg_line_length": 48.86330935251799,
"alnum_prop": 0.6020318021201413,
"repo_name": "devcon14/cmis-capture",
"id": "c36547dae1210bade625d31bcf936e34b8a669cc",
"size"... |
import argparse
import sys
from ros_buildfarm.argument import add_argument_build_name
from ros_buildfarm.argument import add_argument_config_url
from ros_buildfarm.argument import add_argument_dry_run
from ros_buildfarm.argument import add_argument_groovy_script
from ros_buildfarm.argument import add_argument_reposito... | {
"content_hash": "0d83dd9245726cab5ceabce91176e832",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 66,
"avg_line_length": 35.83870967741935,
"alnum_prop": 0.7470747074707471,
"repo_name": "ros-infrastructure/ros_buildfarm",
"id": "4ba2822a98a79d3bb67d61fe1608e491e74a4e0e",... |
import unittest
from katas.beta.trigrams import trigrams
class TrigramsTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(trigrams('the quick red'),
'the he_ e_q _qu qui uic ick ck_ k_r _re red')
def test_equals_2(self):
self.assertEqual(trigrams('H... | {
"content_hash": "2968565168cb4928437595b152081b65",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 71,
"avg_line_length": 27.416666666666668,
"alnum_prop": 0.6291793313069909,
"repo_name": "the-zebulan/CodeWars",
"id": "fa61de7712030647eec054ea858b96a8acb7cd0c",
"size": ... |
"""
Tests for L{twisted.words.protocols.irc}.
"""
import errno
import operator
import time
from twisted.trial import unittest
from twisted.trial.unittest import TestCase
from twisted.words.protocols import irc
from twisted.words.protocols.irc import IRCClient, attributes as A
from twisted.internet import protocol, ta... | {
"content_hash": "2de45d969e772345a6656ec549c7e570",
"timestamp": "",
"source": "github",
"line_count": 2756,
"max_line_length": 101,
"avg_line_length": 34.51124818577649,
"alnum_prop": 0.5652539610778758,
"repo_name": "engdan77/edoAutoHomeMobile",
"id": "66f7baa46216179df354f65f7fc2e1df8b566053",
... |
"""
TensorFlow policy class used for SAC.
"""
import copy
import gym
from gym.spaces import Box, Discrete
from functools import partial
import logging
from typing import Dict, List, Optional, Tuple, Type, Union
import ray
import ray.experimental.tf_utils
from ray.rllib.algorithms.dqn.dqn_tf_policy import (
postpr... | {
"content_hash": "9ae523e8042fcf66f813cef3b0191932",
"timestamp": "",
"source": "github",
"line_count": 794,
"max_line_length": 87,
"avg_line_length": 38.63476070528967,
"alnum_prop": 0.632514017472943,
"repo_name": "ray-project/ray",
"id": "1ae92f237437649c035aacef035d2824590bfe35",
"size": "30676... |
from oslo_config import cfg
import webob.dec
import webob.exc
from jacket.api.compute.openstack import wsgi
from jacket import context
from jacket.wsgi import compute as base_wsgi
CONF = cfg.CONF
CONF.import_opt('use_forwarded_for', 'jacket.api.compute.auth')
class NoAuthMiddlewareBase(base_wsgi.Middleware):
""... | {
"content_hash": "67f3ebfdba801d1bdf8e7547220c31ea",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 36.88732394366197,
"alnum_prop": 0.5990836197021764,
"repo_name": "HybridF5/jacket",
"id": "4f97d1518e9548722cc89fb9fe84be605b99f1ca",
"size": "3282"... |
"""empty message
Revision ID: 3acf60608a7d
Revises: 48a5caa0a762
Create Date: 2015-03-26 11:26:40.461247
"""
# revision identifiers, used by Alembic.
revision = '3acf60608a7d'
down_revision = '48a5caa0a762'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | {
"content_hash": "1390a26dcd8219d86c286f9f32441b4d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 63,
"avg_line_length": 27.444444444444443,
"alnum_prop": 0.6214574898785425,
"repo_name": "RichardKnop/digitalmarketplace-api",
"id": "af1a36a84b57634789682556e1bc5fb8840adfd... |
"""
see README.txt
"""
_marker = object()
class Memojito(object):
propname = '_memojito_'
def clear(self, inst):
if hasattr(inst, self.propname):
delattr(inst, self.propname)
def clearbefore(self, func):
def clear(*args, **kwargs):
inst=args[0]
se... | {
"content_hash": "9e3c135e09b7d3b954d193cac9a438f3",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 66,
"avg_line_length": 28.07843137254902,
"alnum_prop": 0.5405027932960894,
"repo_name": "eykd/owyl",
"id": "fdd8e4f27042f3f0879eb93a05c0b2b4231c1ba4",
"size": "1432",
"b... |
from __future__ import unicode_literals
class BrokenException(Exception):
pass
except_args = (b'Broken!', # plain exception with ASCII text
'¡Broken!', # non-ASCII unicode data
'¡Broken!'.encode('utf-8'), # non-ASCII, utf-8 encoded bytestring
... | {
"content_hash": "6acd32055526618c33f8cf5bf04b3d71",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 81,
"avg_line_length": 37.3,
"alnum_prop": 0.5683646112600537,
"repo_name": "yephper/django",
"id": "dfaeee17bb5c7f0614e1bf2e2f92c4d02ae43285",
"size": "400",
"binary": f... |
"""Tests for `aperitive` package."""
import os
import yaml
from click.testing import CliRunner
from aperitive import console
def test_command_line_interface():
"""Test the CLI."""
runner = CliRunner()
result = runner.invoke(console.cli)
assert result.exit_code == 0
assert 'Usage: ' in result.ou... | {
"content_hash": "f9e1d1c8c7bbaf295ec6c2c25fd4474b",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 74,
"avg_line_length": 29.361702127659573,
"alnum_prop": 0.6253623188405797,
"repo_name": "0x4e3/aperitive",
"id": "cdc3484998c627b85fca024d78398a9268cf1223",
"size": "1427... |
"""
This module integrates Tkinter with twisted.internet's mainloop.
Maintainer: Itamar Shtull-Trauring
To use, do::
| tksupport.install(rootWidget)
and then run your reactor as usual - do *not* call Tk's mainloop(),
use Twisted's regular mechanism for running the event loop.
Likewise, to stop your program you... | {
"content_hash": "6a8e3f6e6130ec5b9130045b3fb5d8b7",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 97,
"avg_line_length": 26.675675675675677,
"alnum_prop": 0.6919959473150963,
"repo_name": "ntuecon/server",
"id": "6923f21af78768edf6ee03b2a1b39946816716c2",
"size": "2048"... |
import pandas as pd
from pyspark import pandas as ps
from pyspark.testing.pandasutils import PandasOnSparkTestCase
class DefaultIndexTest(PandasOnSparkTestCase):
def test_default_index_sequence(self):
with ps.option_context("compute.default_index_type", "sequence"):
sdf = self.spark.range(100... | {
"content_hash": "acccf66e3ac2902a3af89a957cbb2674",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 87,
"avg_line_length": 37.885714285714286,
"alnum_prop": 0.6689291101055806,
"repo_name": "chuckchen/spark",
"id": "4193540bd70aa5ff47f186274d91df37773c784b",
"size": "2111... |
from testworksappium import Page
class MainPage(Page):
def __init__(self, appium_driver):
super(MainPage, self).__init__(appium_driver)
self.create_event_button = self.create_element(
id='calendar_fab')
self.forward_month_button = self.create_element(
id="com.simpl... | {
"content_hash": "7e5a70161c00934e5e4853833ee2eae9",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 72,
"avg_line_length": 37.074074074074076,
"alnum_prop": 0.6633366633366633,
"repo_name": "apallin/testworks-appium",
"id": "6add0398f190c9712b1e0c583af15a3f0f3bb0e6",
"siz... |
import sys
from django.apps import apps
from django.contrib.auth.management import _get_all_permissions
from django.contrib.auth.models import Permission, Group
from django.contrib.contenttypes.management import update_contenttypes
from django.contrib.contenttypes.models import ContentType
from django.core.management.... | {
"content_hash": "853604a82c92fc3857b05f39390d56a9",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 107,
"avg_line_length": 43.75714285714286,
"alnum_prop": 0.633692458374143,
"repo_name": "fragaria/BorIS",
"id": "27e90cbd8f258d685bcf1c0a65ea9a187acc0dd5",
"size": "3079",... |
"""Tests for website.addons.box.utils."""
import mock
from nose.tools import * # noqa (PEP8 asserts)
from framework.auth import Auth
from website.project.model import NodeLog
from tests.factories import ProjectFactory
from website.addons.box.tests.utils import BoxAddonTestCase
from website.addons.box import utils
... | {
"content_hash": "eb0d414e6926caedb745b55dec7ad80b",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 84,
"avg_line_length": 33.13559322033898,
"alnum_prop": 0.6884910485933504,
"repo_name": "njantrania/osf.io",
"id": "3abf3d122d6b8c472a40f8028163a53f011b4cdd",
"size": "197... |
import unittest
from kraken.core.objects.components.component_output import ComponentOutput
class TestComponentOutput(unittest.TestCase):
def testInstance(self):
cmpOutput = ComponentOutput('test')
self.assertIsNotNone(cmpOutput)
def suite():
return unittest.TestLoader().loadTestsFromTest... | {
"content_hash": "fc52682ec672b82aca12e751d14c53f6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 75,
"avg_line_length": 21.36842105263158,
"alnum_prop": 0.7389162561576355,
"repo_name": "oculusstorystudio/kraken",
"id": "72d08de5cdd9c1454ab89ad3d8c96e424c30fb48",
"size... |
from django.conf import settings
if settings.ELASTICSEARCH_MAJOR_VERSION == 1:
raise RuntimeError(
'Elasticsearch version 1 is no longer supported. Please upgrade Elasticsearch. Details: \n'
'https://github.com/dimagi/commcare-cloud/blob/master/changelog/0032-upgrade-to-elasticsearch-2.4.6.yml'
... | {
"content_hash": "c8bf021b1ca7c9f1937e5ef9687e50da",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 112,
"avg_line_length": 29.44776119402985,
"alnum_prop": 0.6882919412062849,
"repo_name": "dimagi/commcare-hq",
"id": "769fcc2126bb4cc15b61f38cc64969e0651d624e",
"size": "1... |
class App:
def __init__(self, appid="",
name="",
type="",
description="",
image="",
deviceList = []):
self.deviceList = deviceList
self.description = description
self.appid = appid
self.type = type
... | {
"content_hash": "7554d39e0ecb73cc523e93a5a9fa94e3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 38,
"avg_line_length": 28.53846153846154,
"alnum_prop": 0.431266846361186,
"repo_name": "CodeLankaHack/team---iAS",
"id": "e035212635a0ced08c83cbbc774ea1fb3c34da13",
"size"... |
def process(input):
return input + '!'
| {
"content_hash": "867d38fe4f3249a1a438128c86812738",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 20,
"avg_line_length": 20.5,
"alnum_prop": 0.6341463414634146,
"repo_name": "massakam/pulsar",
"id": "7a07a16967306445bfaa11ba84dd9506b07e951a",
"size": "831",
"binary": f... |
#! coding:utf-8
"""
compiler tests.
These tests are among the very first that were written when SQLAlchemy
began in 2005. As a result the testing style here is very dense;
it's an ongoing job to break these into much smaller tests with correct pep8
styling and coherent test organization.
"""
import datetime
import... | {
"content_hash": "45fba88b7a4400d4b83e5a16952d498e",
"timestamp": "",
"source": "github",
"line_count": 4605,
"max_line_length": 79,
"avg_line_length": 34.60217155266015,
"alnum_prop": 0.5117764821799514,
"repo_name": "cloudera/hue",
"id": "35d8de5720173e625aac804a69e515d129708a0e",
"size": "159345... |
from __future__ import unicode_literals
HELP_TEXT = """\
PyVim Help
==========
PyVim is a Pure Python Vim Clone.
Thanks to:
- Pyflakes: the tool for checking Python source files for errors.
- Jedi: the Python autocompletion library.
- Pygments: Python syntax highlighter.
- prompt_toolkit: the termin... | {
"content_hash": "b3fa11902acd286bc8670ea24e1373e2",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 69,
"avg_line_length": 23.75,
"alnum_prop": 0.7,
"repo_name": "jonathanslenders/pyvim",
"id": "c43f6cc2043378777c77fd932ea8155ca9295cc0",
"size": "380",
"binary": false,
... |
"""
This file is part of pyCMBS.
(c) 2012- Alexander Loew
For COPYING and LICENSE details, please refer to the LICENSE file
"""
"""
EOF analysis
"""
from pycmbs.examples import download
import matplotlib.pyplot as plt
from pycmbs.diagnostic import EOF
plt.close('all')
air = download.get_sample_file(name='air')
air.... | {
"content_hash": "08508cc002010aea4ce2bf2e11dc59f7",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 88,
"avg_line_length": 25.1,
"alnum_prop": 0.7410358565737052,
"repo_name": "pygeo/pycmbs",
"id": "4e161e78efd7897366a6a260b18ad54210ec588e",
"size": "778",
"binary": fal... |
from django.conf.urls import include, patterns, url
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.views.i18n import javascript_catalog
from django.views.decorators.cache import cache_page
from django.views.generic.base import Redi... | {
"content_hash": "ad69fb7bf99cb0399485bc4c02c8ce8a",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 77,
"avg_line_length": 37.60215053763441,
"alnum_prop": 0.6562768086931656,
"repo_name": "safwanrahman/linuxdesh",
"id": "754d42b3277c99760f0dedc2a47990a6723228f7",
"size":... |
"""Stub version of the Channel API, queues messages and writes them to a log."""
import hashlib
import logging
import random
import time
from google.appengine.api import apiproxy_stub
from google.appengine.api.channel import channel_service_pb
from google.appengine.runtime import apiproxy_errors
def _Genera... | {
"content_hash": "acf45b02c5d3d6bb0f2e3cb1a3bdc15d",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 80,
"avg_line_length": 30.923705722070846,
"alnum_prop": 0.6775046259582342,
"repo_name": "gauribhoite/personfinder",
"id": "c9cc512f761afe27c543fb526803c90e10513355",
"si... |
"""Plugin for Arte.tv, bi-lingual art and culture channel."""
import re
from itertools import chain
from streamlink.compat import urlparse
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
from streamlink.st... | {
"content_hash": "20c81b7d583b0a61aaee851e68a9f635",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 92,
"avg_line_length": 33.149532710280376,
"alnum_prop": 0.5322808006766281,
"repo_name": "wlerin/streamlink",
"id": "d90ac49250ed67a4b90d93342fce331b23dc5184",
"size": "3... |
'''
A toy model for generating flares along a given line-of-sight in LSST
Things I'll need:
- fields of view to compute over
- use Trilegal fields for now
- Kepler flare light curve model (Davenport 2014)
- Kepler -> ugriz flare model or approximation
- LSST cadence, or cadence approximation
- Kepler-based SpT vs ... | {
"content_hash": "deff9d209b1637024aeb31ba56100c78",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 107,
"avg_line_length": 23.098591549295776,
"alnum_prop": 0.6451219512195122,
"repo_name": "jradavenport/MW-Flare",
"id": "9c550e6108623630a4ac5a403aba6cfc680b5c41",
"size"... |
"""Test for the leader_board example."""
# pytype: skip-file
import logging
import unittest
import pytest
import apache_beam as beam
from apache_beam.examples.complete.game import leader_board
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.testing.test_pipeline import TestPipeline... | {
"content_hash": "5a8241d5b4b1d3b2f6f4e43a2f4203c2",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 33.45762711864407,
"alnum_prop": 0.6610942249240122,
"repo_name": "axbaretto/beam",
"id": "4a6c44b9a61542db139d36efe44831c5f550c546",
"size": "2759",... |
__all__ = ['ExplainDetail']
class ExplainDetail(object):
"""
ExplainDetail defines the types of details for explain result.
"""
# The cost information on physical rel node estimated by optimizer.
# e.g. TableSourceScan(..., cumulative cost = {1.0E8 rows, 1.0E8 cpu, 2.4E9 io, 0.0 network,
# 0.... | {
"content_hash": "0512967507cac4e9a6494d447b06865d",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 96,
"avg_line_length": 30.625,
"alnum_prop": 0.6530612244897959,
"repo_name": "GJL/flink",
"id": "0cbcbe9db31160989f59e46537540e6ab99a413f",
"size": "1449",
"binary": fal... |
from sqlalchemy import create_engine
from litex.cxpool import CxOracleSessionPool
def get_user():
return "flxuser"
pool = CxOracleSessionPool(
'oracle://flxuser:flxuser@mesdb/flxnet',
min_sessions=1,
max_sessions=5,
increment=1,
user_source=get_user
)
engine = create_engin... | {
"content_hash": "3006c15aa0eeb8f5fb4eb7fdbefe9c23",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 74,
"avg_line_length": 18.36,
"alnum_prop": 0.690631808278867,
"repo_name": "mabotech/maboss.py",
"id": "e497cd122e1a2df7a5c807993d415dd034de3c41",
"size": "461",
"binary... |
"""Create multiplier quantizer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import logging
import copy
from qkeras.qtools.quantized_operators import multiplier_impl
from qkeras.qtools.quantized_operators import quantizer_impl
class Multip... | {
"content_hash": "abd222ba68a017c65222a8a4def779e3",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 96,
"avg_line_length": 38.70779220779221,
"alnum_prop": 0.5842979365878208,
"repo_name": "google/qkeras",
"id": "07487d44ac73d9fe80709395e1427f313fa48101",
"size": "6618",... |
import sys
import getopt
import subprocess
def run_cufflinks(pulse_path, cell_line_name):
output_file = open(pulse_path + '/output/for_preprocess/' + cell_line_name + '/transcripts.gtf', 'w')
command1 = ['cufflinks',
'-o',
pulse_path + '/output/for_preprocess/' + cell_line_name... | {
"content_hash": "97ffbbdec7574c7395dcc2fdbe4df499",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 105,
"avg_line_length": 34.12820512820513,
"alnum_prop": 0.5589782118707739,
"repo_name": "wonjunetai/pulse",
"id": "a33e24c1ea3f71a961699aa092566418225bf16c",
"size": "133... |
"""Default variable filters."""
from __future__ import unicode_literals
import random as random_module
import re
from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation
from functools import wraps
from pprint import pformat
from django.conf import settings
from django.utils import formats, six
from djan... | {
"content_hash": "747d91876a1e4279c276869363ec5dd4",
"timestamp": "",
"source": "github",
"line_count": 940,
"max_line_length": 102,
"avg_line_length": 28.812765957446807,
"alnum_prop": 0.6115787919066608,
"repo_name": "dpetzold/django",
"id": "02ecb34828cb8658d072344a223ff72e28a99880",
"size": "27... |
#!/usr/bin/python
# encoding: utf-8
import datetime
from decimal import Decimal
import cx_Oracle
__author__ = 'Pavel Popov'
__email__ = '[email protected]'
__version__ = '0.2.0'
def decimal_numbers(cursor, name, defaultType, size, precision, scale):
if defaultType == cx_Oracle.NUMBER:
return cursor.v... | {
"content_hash": "6317bb3290ce712905c96e50e53083bf",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 78,
"avg_line_length": 29.355263157894736,
"alnum_prop": 0.5638727028238458,
"repo_name": "schmooser/ora-static",
"id": "15cb901100c2650a61d96f7055a672128fb43d17",
"size": ... |
from setuptools import setup
setup(
name='horoscope',
version='1.1.0',
description='Fetches and parses data from Ganeshaspeaks.',
author='Tapasweni Pathak',
author_email='[email protected]',
url='https://github.com/tapasweni-pathak/pyhoroscope',
packages=['horoscope'],
)
| {
"content_hash": "e01783855efabf391440e244a06b63e8",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 28.454545454545453,
"alnum_prop": 0.6900958466453674,
"repo_name": "tapasweni-pathak/pyhoroscope",
"id": "20818587843922de7e852cc2e4812682c95495a1",
... |
from gi.overrides.Gtk import Gtk
from os import path
from properties import Directories, Properties
class BoardController(object):
def __init__(self, game_engine):
self._builder = Gtk.Builder()
glade_file = path.join(Directories.APP_GLADES, "board.glade")
self._builder.set_translation_doma... | {
"content_hash": "9afe492093bb34faf23a9edc41be5f0c",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 69,
"avg_line_length": 47.694736842105264,
"alnum_prop": 0.6033988082101082,
"repo_name": "the-dalee/gnome-2048",
"id": "60c58a23aaa689b6cb92e5ed0fb04dab5702e737",
"size": ... |
import datetime
import django.template
from django.template import defaultfilters
from horizon.test import helpers as test
from horizon.utils import filters
# we have to import the filter in order to register it
from horizon.utils.filters import parse_isotime # noqa: F401
class FiltersTests(test.TestCase):
def... | {
"content_hash": "778c8b2d7b08861cf0d81936ce5e7146",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 79,
"avg_line_length": 39.38636363636363,
"alnum_prop": 0.6379111367570687,
"repo_name": "NeCTAR-RC/horizon",
"id": "4b178098fd937a949264986ca9f2fba68861ecec",
"size": "403... |
from scapy import *
import __builtin__
try:
from cert import *
CERT=1
except:
CERT=0
#############################################################################
# Helpers ##
###########################################################... | {
"content_hash": "90740b4fa27089d0b1e228005d88eca5",
"timestamp": "",
"source": "github",
"line_count": 6799,
"max_line_length": 156,
"avg_line_length": 37.33107809972055,
"alnum_prop": 0.5368931579818292,
"repo_name": "tcheneau/NDprotector",
"id": "4b85c46bf82e6e84eaac0184b40614ea173f3cab",
"size"... |
from . import segmentation # must be imported before features
from . import utils # must be imported before other packages
from . import (annotations_and_masks, features, filters, preprocessing,
saliency, workflows)
# list out things that are available for public use
__all__ = (
# sub-packages
... | {
"content_hash": "fc7a6b5b4fbd72c076e92c3cb130e674",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 25.944444444444443,
"alnum_prop": 0.6595289079229122,
"repo_name": "DigitalSlideArchive/HistomicsTK",
"id": "8a4f474764b4e3a3a2d45d7905947a6b61cc3a99",... |
from __future__ import print_function
import os
from psi.app import create_app, init_all
from psi.app.config import CITestConfig
from psi.app.service import Info
def init_app():
from psi.app.config import TestConfig
# warnings.warn("Recreating DB")
# recreate_database(TestConfig)
if os.environ.get('... | {
"content_hash": "e03bb8ced6f419e95a9b4c56f0de0112",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 112,
"avg_line_length": 29.91044776119403,
"alnum_prop": 0.6726546906187625,
"repo_name": "betterlife/psi",
"id": "2aa8922a86941c22875ec2383a9edd611a3d5b55",
"size": "2004"... |
'''
Simple RPC
Copyright (c) 2012-2013, LastSeal S.A.
'''
from simplerpc.base.SimpleRpcLogicBase import SimpleRpcLogicBase
from simplerpc.expose_api.javascript.PackageToJs import PackageToJs
from simplerpc.common.FileManager import FileManager
from simplerpc.expose_api.javascript.data_model import TranslationAstNode, \... | {
"content_hash": "91a0bbae22b75206b97dd407f3ca8074",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 81,
"avg_line_length": 43.770833333333336,
"alnum_prop": 0.7263207996192289,
"repo_name": "joaduo/python-simplerpc",
"id": "90c265f7cca0de586f9edffc7a1c544c2b2c5b9e",
"size... |
from django import forms
from django.forms.util import ErrorList
from django.forms.widgets import Textarea
from django.utils.safestring import mark_safe
from corehq.apps.adm.models import BaseADMColumn, ReducedADMColumn, DaysSinceADMColumn, ConfigurableADMColumn,\
CompareADMColumn, ADMReport, KEY_TYPE_OPTIONS, REPO... | {
"content_hash": "950bf785ccd3e7c6ee9d098c59a916bf",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 153,
"avg_line_length": 47.23952095808383,
"alnum_prop": 0.6819622258841425,
"repo_name": "gmimano/commcaretest",
"id": "d02779c2bec41672a452c1ba54f36a5de92bf1a0",
"size":... |
import shelve
def check_user(user_id, id_room, enter_or_leave):
f = shelve.open("users.txt")
if (id_room + enter_or_leave) in f:
if user_id in f[id_room + enter_or_leave]:
print f[id_room + enter_or_leave]
print user_id
print False
return_value = False
... | {
"content_hash": "b08f9c19efe088bd5f3da988522b2d40",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 52,
"avg_line_length": 27.285714285714285,
"alnum_prop": 0.5209424083769634,
"repo_name": "Jacob-Gray/WelcomeBot",
"id": "d9f1cb104591eb2b5211aad53ef8d83f7dd6d31d",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.