text stringlengths 4 1.02M | meta dict |
|---|---|
import subprocess
import os
from os.path import join, dirname
def run(script, *args):
this_dir = dirname(os.path.abspath(__file__))
cmd = join(this_dir, script)
args = list(args)
args.insert(0, '/usr/bin/python')
args.insert(1, cmd)
args = list(map(str, args))
p = subprocess.Popen(args, uni... | {
"content_hash": "9893b597203638458be0ff23b77ce110",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 105,
"avg_line_length": 28.36842105263158,
"alnum_prop": 0.6697588126159555,
"repo_name": "mainulhossain/phenowl",
"id": "e5849110d85199f5aa8bc6606a8de786b2a9b728",
"size":... |
from time import time, sleep
file = open("/root/uptime", "r+")
start = int("".join(file.readlines()))
file.close()
while 1:
file = open("/root/uptime", "w+")
file.write(str(int(time() + start)))
file.close()
| {
"content_hash": "e4ed7aeb18d1598fc7f1233d7612dd10",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 38,
"avg_line_length": 23.555555555555557,
"alnum_prop": 0.6320754716981132,
"repo_name": "uniite/imd",
"id": "97a972df2ac846fab381690eb9c2d99b8efcddb1",
"size": "212",
"b... |
"""The tests for Kira sensor platform."""
import unittest
from unittest.mock import MagicMock
from homeassistant.components.sensor import kira as kira
from tests.common import get_test_home_assistant
TEST_CONFIG = {kira.DOMAIN: {
'sensors': [{'host': '127.0.0.1',
'port': 17324}]}}
DISCOVERY_INF... | {
"content_hash": "93d9b218ea4a6b8a5b8255b982052222",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 79,
"avg_line_length": 29.322033898305083,
"alnum_prop": 0.6196531791907515,
"repo_name": "persandstrom/home-assistant",
"id": "76aba46d5144654884f5a22edfe9ea470ca230a9",
"... |
from unittest import TestCase
import numpy as np
from teafacto.blocks.seq.enc import SeqUnroll
from teafacto.blocks.basic import VectorEmbed
from teafacto.blocks.match import SeqMatchScore, CosineDistance
class TestMatchScore(TestCase):
def test_seq_scoring(self):
vocsize = 100
dim = 10
... | {
"content_hash": "2d9cf61ebb64233013276177bba3bce5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 80,
"avg_line_length": 27.72,
"alnum_prop": 0.6695526695526696,
"repo_name": "lukovnikov/teafacto",
"id": "695011840fe87951c8b0cd32ce64cf1f665b5a59",
"size": "693",
"bina... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ala', '0004_common_property_process'),
]
operations = [
migrations.AlterField(
model_name='observation'... | {
"content_hash": "5b66ad229cd33524f5c0652b80b2c76d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 237,
"avg_line_length": 39.541666666666664,
"alnum_prop": 0.6691253951527925,
"repo_name": "gis4dis/poster",
"id": "6dc3b7975211a415fb2e01c20349118a52e2409f",
"size": "1022... |
from typing import Optional, Callable, Tuple, Dict, Any, List, NamedTuple
import functools
import pytest
import eagerpy as ep
import foolbox
import foolbox as fbn
ModelAndData = Tuple[fbn.Model, ep.Tensor, ep.Tensor]
CallableModelAndDataAndDescription = NamedTuple(
"CallableModelAndDataAndDescription",
[
... | {
"content_hash": "258e1028631753f7fd64d8079350c988",
"timestamp": "",
"source": "github",
"line_count": 341,
"max_line_length": 88,
"avg_line_length": 31.19648093841642,
"alnum_prop": 0.6672306824591089,
"repo_name": "bethgelab/foolbox",
"id": "a258fa3e7861b0392cd5c00ca26a831c7dd1a04d",
"size": "10... |
from .getBlobTrajectories import getBlobsTable
def args_(fn, param):
p = param.p_dict
trajectories_param_f = ['traj_min_area', 'traj_min_box_width',
'worm_bw_thresh_factor', 'strel_size', 'analysis_type', 'thresh_block_size',
'n_cores_used']
trajectories_param = {x.replace('traj_', ''):p[x... | {
"content_hash": "895366089aad07268eb59d245c3b7fbb",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 84,
"avg_line_length": 35.416666666666664,
"alnum_prop": 0.5694117647058824,
"repo_name": "ljschumacher/tierpsy-tracker",
"id": "d8812b33c6b4efd5e8e49b6aa28683786fd3737f",
... |
import warnings
from typing import IO, Optional
from rdflib.graph import ConjunctiveGraph, Graph
from rdflib.plugins.serializers.nt import _quoteLiteral
from rdflib.serializer import Serializer
from rdflib.term import Literal
__all__ = ["NQuadsSerializer"]
class NQuadsSerializer(Serializer):
def __init__(self, ... | {
"content_hash": "9a040dfeda76f758d70a44a5c97a7230",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 84,
"avg_line_length": 30.1864406779661,
"alnum_prop": 0.5524985962942167,
"repo_name": "RDFLib/rdflib",
"id": "8d7c807816578d7efd6ed3c0707fe12173c40d6a",
"size": "1781",
... |
import logging
from flask import Flask
from pymongo import MongoClient
from pyelasticsearch import ElasticSearch
from noodles import default_settings
logging.basicConfig(level=logging.DEBUG)
# specific loggers
logging.getLogger('requests').setLevel(logging.WARNING)
logging.getLogger('urllib3').setLevel(logging.WARNI... | {
"content_hash": "b53b0a423113297c6b2b15a7a962bc81",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 78,
"avg_line_length": 32,
"alnum_prop": 0.79125,
"repo_name": "uf6/noodles",
"id": "c0abebebbd2ecbfa167c370cdae10ce636d39006",
"size": "800",
"binary": false,
"copies"... |
#!/usr/bin/python2.4
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | {
"content_hash": "328049567e5576f8be8d643d4193bcb4",
"timestamp": "",
"source": "github",
"line_count": 2586,
"max_line_length": 118,
"avg_line_length": 41.146171693735496,
"alnum_prop": 0.6473440848088418,
"repo_name": "wkrzemien/j-pet-framework",
"id": "f8e9c5bafbfc8e4248e6b1b59f2a0567b8c6f0e2",
... |
import urlparse
# 3rd party
import requests
# project
from checks import AgentCheck
from util import headers
class Fluentd(AgentCheck):
SERVICE_CHECK_NAME = 'fluentd.is_ok'
GAUGES = ['retry_count', 'buffer_total_queued_size', 'buffer_queue_length']
_AVAILABLE_TAGS = frozenset(['plugin_id', 'type'])
... | {
"content_hash": "adc5a2349b62c7f3dede9a7c2399b90b",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 95,
"avg_line_length": 39.05,
"alnum_prop": 0.5659411011523687,
"repo_name": "c960657/dd-agent",
"id": "f338f58392726b95e2074ac5034d8f619502658e",
"size": "2511",
"binary... |
import sys
import json
sys.path.append('/home/sexy/source/deep-visual-odometry/python/snippets/')
sys.path.append('/home/sexy/source/deep-visual-odometry/models/')
import formatData
from alexNet_3 import run_model, create_model
netNum = '3'
Xtr, Ytr, Xte, Yte = formatData.knownEnv(formatData.load_data(),formatData.load... | {
"content_hash": "6b0e476e0d419d33b04bbf010afad8ce",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 153,
"avg_line_length": 57.411764705882355,
"alnum_prop": 0.7074795081967213,
"repo_name": "ksu-mechatronics-research/deep-visual-odometry",
"id": "a016a091063696e07851a0e26c... |
"""
===================
Universal Functions
===================
Ufuncs are, generally speaking, mathematical functions or operations that are
applied element-by-element to the contents of an array. That is, the result
in each output array element only depends on the value in the corresponding
input array (or arrays) a... | {
"content_hash": "94488f23fcd0c9637f0762ead6e34746",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 79,
"avg_line_length": 39.31159420289855,
"alnum_prop": 0.7209216589861751,
"repo_name": "jorisvandenbossche/numpy",
"id": "df2c455ec21f4e995cc0091bd21b00e2d9708c77",
"siz... |
import mysql.connector
from mysql.connector.cursor import MySQLCursorPrepared
from os.path import join, dirname
import json
def main(config):
output = []
db = mysql.connector.Connect(**config)
curprep = db.cursor(cursor_class=MySQLCursorPrepared)
cur = db.cursor()
cur.execute("SELECT * FROM free_... | {
"content_hash": "1f9365429bec138b08ec0cdd48e78c24",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 57,
"avg_line_length": 23.176470588235293,
"alnum_prop": 0.565989847715736,
"repo_name": "jpmunic/udest",
"id": "5bde16284cb3cd1b3261e3f0f61003363d4556df",
"size": "788",
... |
last_unseen = 0
for it in ava.schedule.every(1).minute:
check_task = ava.do('imap.check_gmail',
username='username@gmail.com',
password='password')
messages, unseen = check_task.result()
if unseen > 0 and unseen != last_unseen:
last_unseen = unseen
... | {
"content_hash": "e3d17260f106baf0df1390cd23cac9a4",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 59,
"avg_line_length": 32.785714285714285,
"alnum_prop": 0.55119825708061,
"repo_name": "eavatar/eavatar-me",
"id": "09195afd175e8df02e2ae3ede20f4a3f1cf6a976",
"size": "590... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "trywq.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "a76e3e13b21e543ac79c7ed62c0168b0",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 69,
"avg_line_length": 25.11111111111111,
"alnum_prop": 0.7079646017699115,
"repo_name": "powered-by-wq/try.wq.io",
"id": "4f5a6b8b9987f763444fd3f0f1fd681dae78f634",
"size":... |
import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class CancelDirectOfflineTest(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
def run_test(self):
... | {
"content_hash": "f1413609811c9cd3a65fadba2f142144",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 113,
"avg_line_length": 44.32738095238095,
"alnum_prop": 0.6113871357593662,
"repo_name": "cpacia/openbazaar-go",
"id": "ac38f02ff979fdb15c5c9b57fe0d2a2c58327b02",
"size":... |
""" The node manager looks after a collection of node types. """
# Standard library imports.
import logging
# Enthought library imports.
from enthought.traits.api import HasPrivateTraits, List
# Local imports
from node_type import NodeType
# Create a logger for this module.
logger = logging.getLogger(__name__)
c... | {
"content_hash": "54a2a17dbb7a59adc41fbe2223b11b14",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 79,
"avg_line_length": 32.416,
"alnum_prop": 0.5106120434353406,
"repo_name": "enthought/traitsgui",
"id": "328e3f3b1a544520eea5fa83e04ebfd7a182f3f8",
"size": "4692",
"b... |
"""
Python Flight Mechanics Engine (PyFME).
Copyright (c) AeroPython Development Team.
Distributed under the terms of the MIT License.
Velocity
--------
The aircraft state has
"""
from abc import abstractmethod
import numpy as np
# TODO: think about generic changes from body to horizon that could be used for
# vel... | {
"content_hash": "4dd91d13f41c925b702a57c002287a0a",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 79,
"avg_line_length": 23.78048780487805,
"alnum_prop": 0.5377777777777778,
"repo_name": "AeroPython/PyFME",
"id": "ccbcc99c190554ac665c0c7ffb46b19b240c78b3",
"size": "292... |
import unittest
from pants.util.strutil import camelcase, ensure_binary, ensure_text, pluralize, strip_prefix
# TODO(Eric Ayers): Backfill tests for other methods in strutil.py
class StrutilTest(unittest.TestCase):
def test_camelcase(self) -> None:
self.assertEqual("Foo", camelcase("foo"))
self.... | {
"content_hash": "431e50b5599ca9f9fdd775bf75767574",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 93,
"avg_line_length": 49.03846153846154,
"alnum_prop": 0.6290196078431373,
"repo_name": "wisechengyi/pants",
"id": "e919a5cd8a20fd64eb0ae3fa2127a3c6476d18da",
"size": "268... |
import glob
import inspect
import os
from argparse import ArgumentParser, Namespace
from collections import defaultdict
from copy import deepcopy
from functools import partial
from itertools import product
from numbers import Number
from typing import Dict, Any, Tuple, Union, Callable, Optional, Sequence
import datacl... | {
"content_hash": "f0d9c94f599e901431d7fbad2864208a",
"timestamp": "",
"source": "github",
"line_count": 560,
"max_line_length": 79,
"avg_line_length": 33.38214285714286,
"alnum_prop": 0.5787953354017332,
"repo_name": "imito/odin",
"id": "d6fb139ec68a0b5262afd96b62e819bd2ccd332d",
"size": "18747",
... |
import argparse
from nes import Cartridge
from screen import Screen
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description = 'Dumps NES header information')
parser.add_argument('pathname', help='specify the NES file to open')
args = parser.parse_args()
cart = Cartridg... | {
"content_hash": "2f163de0d1e280275947c2eb021c97f8",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 85,
"avg_line_length": 35.51063829787234,
"alnum_prop": 0.5038945476333133,
"repo_name": "LCClyde/NyraEmulationSystem",
"id": "b8709252798592159ced319504f72a3f82b3e4ec",
"s... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import pkgutil
import shutil
import tempfile
from xml.dom import minidom
from pants.backend.jvm.targets.java_tests import JavaTests
from pants.backend.proje... | {
"content_hash": "cee1efcf86fc41668a4ca9856e8b37b6",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 104,
"avg_line_length": 43.76470588235294,
"alnum_prop": 0.6635752688172043,
"repo_name": "sameerparekh/pants",
"id": "05774129f203220073c7d5b53af66408e7db2dec",
"size": "... |
def extractCardboardtranslationsCom(item):
'''
Parser for 'cardboardtranslations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
chp_prefixes = [
('JM ', 'A Demon Lord\'s Tale: Dungeons, Monst... | {
"content_hash": "6ba95729e6d50290785ac0189e78a11a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 112,
"avg_line_length": 34.142857142857146,
"alnum_prop": 0.6373779637377964,
"repo_name": "fake-name/ReadableWebProxy",
"id": "8e2ba6ea8392b8a263dec5c6b3840502f945829e",
"... |
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# This example demonstrates how to set up flexible joints using
# the transformation pipeline and vtkTransformPolyDataFilter.
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
ren... | {
"content_hash": "d61499d76b074201fa48a00de1d2460c",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 64,
"avg_line_length": 27.8,
"alnum_prop": 0.7380448582310623,
"repo_name": "timkrentz/SunTracker",
"id": "52073cf54c219c79f5665013e796e0a2a46f51cb",
"size": "2386",
"bin... |
"""
Adds rasters identifed in a comma delimited text file to a gdal VRT
and build a mosaic raster. The text file is produced by running the
script "find_raster_path.py". The rasters can be reprojected, reclassed,
copied to a new directory and renamed based on a field in the text file.
"""
from __future__ import print_... | {
"content_hash": "d8bc82d26ef90e97ddde2087875ffc16",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 212,
"avg_line_length": 36.324786324786324,
"alnum_prop": 0.5583529411764706,
"repo_name": "rmichie/PyScripts",
"id": "638bfa9a8ba2cfeb142315053fcfeea832e95dcb",
"size": "... |
"""
Parse one of KLEEs "info" files
"""
import re
import logging
from datetime import datetime, timedelta
from ..exceptions import InputError
_logger = logging.getLogger(__name__)
class Info:
"""
Contains the information from a KLEE "info" file
"""
__re_pid = re.compile(r"PID: (\d+)\r?\n")
__re_s... | {
"content_hash": "87e1f576ffbc12c59620334b8e7b8f3c",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 192,
"avg_line_length": 54.19834710743802,
"alnum_prop": 0.5962183592558707,
"repo_name": "delcypher/klee-runner",
"id": "50ae524db4ed6af975ef4d6c7f44b80502e468d2",
"size"... |
"""
Test harness for the venv module.
Copyright (C) 2011-2012 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
"""
import ensurepip
import os
import os.path
import re
import struct
import subprocess
import sys
import tempfile
from test.support import (captured_stdout, captured_stderr,
... | {
"content_hash": "f5a5f1daa254c6d7c8ae099a1e77ccf3",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 84,
"avg_line_length": 41.3125,
"alnum_prop": 0.5821706729422312,
"repo_name": "batermj/algorithm-challenger",
"id": "c1e656613bf49c98ccc31a938c2f870a0ae3aef5",
"size": "1... |
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.conf import settings
from opps.core.widgets import OppsEditor
from opps.channels.models import Channe... | {
"content_hash": "b250fa32520180ab8b304a1bcfe949e5",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 36.85294117647059,
"alnum_prop": 0.6308858739026337,
"repo_name": "laborautonomo/opps",
"id": "11f0e90a509f8f7f97bc9daffdb24ef84f81253b",
"size": "25... |
from utils import *
import string
import os
import logging
def fetch_previous_binary_from_disk(platform, platform_root_path):
logging.warning('fetch_previous_binary_from_disk() platform_root_path = ' + platform_root_path)
download_result = None
binary_filename = read_text_content_or_return_none(os.path.join(platfor... | {
"content_hash": "8445ead22498f36bdece3de087585e23",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 128,
"avg_line_length": 49.285714285714285,
"alnum_prop": 0.6708074534161491,
"repo_name": "astrofra/emucamp-engine",
"id": "990b20611ca08ae154d0fc7a928325b3843a7793",
"siz... |
"""Support for Xeoma Cameras."""
import logging
from pyxeoma.xeoma import Xeoma, XeomaError
import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers import config_validatio... | {
"content_hash": "4ee519e57de3d0c1497aef04d2442e99",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 86,
"avg_line_length": 30.203125,
"alnum_prop": 0.565700982928091,
"repo_name": "postlund/home-assistant",
"id": "d6f313c0382170caaea3f967a9d17e375243e069",
"size": "3866"... |
import os
import base64
import cPickle as pickle
import cv2
import libvirt
from twisted.python import log
import config
def get_host_macs():
with os.popen('LC_ALL=C /sbin/ip addr') as f:
return map(lambda x: x.split()[1],
filter(lambda x: 'link/ether' in x,
f.readli... | {
"content_hash": "afde7f705bcbd382a70b030e46753576",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 68,
"avg_line_length": 21.75925925925926,
"alnum_prop": 0.6136170212765958,
"repo_name": "sorki/pllm",
"id": "0d6347191bf58c356f692ba3111285a3d2335acf",
"size": "1175",
"... |
import opbeat_pyramid
import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md')) as f:
README = f.read()
MODULE_NAME = opbeat_pyramid.__name__
REQUIRES = [
'pyramid',
'setuptools>=18',
'mock',
'coveralls',
'flake8',
... | {
"content_hash": "8fecfcdcd1fc62ca9e61f8e311074a47",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 77,
"avg_line_length": 20.914893617021278,
"alnum_prop": 0.6408952187182095,
"repo_name": "britco/opbeat_pyramid",
"id": "97497f9335b6ee018f16fb97c535fff2f58be333",
"size":... |
"""Bootstrap a buildout-based project
Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
"""
import os
import shutil
import sys
import tempfile
from optparse import OptionParser
t... | {
"content_hash": "feba928ec7e39565343f31ff0b3ac2c5",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 79,
"avg_line_length": 33.31818181818182,
"alnum_prop": 0.6251705320600273,
"repo_name": "a25kk/hcn",
"id": "eb00b333430d0776c5eda829c9b1b8011729635e",
"size": "6500",
"... |
"""add_url_field_to_task
Revision ID: 3ac6300917e0
Revises: 2d89bdc3fcd
Create Date: 2017-02-22 11:24:19.670228
"""
# revision identifiers, used by Alembic.
revision = '3ac6300917e0'
down_revision = '2d89bdc3fcd'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Al... | {
"content_hash": "03d00109aa55dafc55ca50bd08827abf",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 72,
"avg_line_length": 23.46153846153846,
"alnum_prop": 0.6721311475409836,
"repo_name": "xuhcc/airy",
"id": "04d1e42c50ba0351cad6fe527332927532389927",
"size": "610",
"b... |
import sys
from launchpadlib.launchpad import Launchpad
def stats(distro, arch):
PPAOWNER = 'rafkind'
PPA = 'paintown'
desired_dist_and_arch = 'https://api.launchpad.net/devel/ubuntu/' + distro + '/' + arch
cachedir = "~/.launchpadlib/cache/"
lp_ = Launchpad.login_anonymously('ppastats', 'edge', c... | {
"content_hash": "85a39ecf2c36f6c1f5be927eaca90a01",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 124,
"avg_line_length": 39.67857142857143,
"alnum_prop": 0.6543654365436543,
"repo_name": "boyjimeking/paintown",
"id": "91ea1264a65d0401b993f2744c810e729c7a91c6",
"size": ... |
from typing import Dict, List, Union
from ray import tune
import os
class TuneCallback:
"""Base class for Tune's XGBoost callbacks."""
pass
def __call__(self, env):
raise NotImplementedError
class TuneReportCallback(TuneCallback):
"""XGBoost to Ray Tune reporting callback
Reports metr... | {
"content_hash": "23eaa995cbe1cf2538468ec3b452ee6e",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 79,
"avg_line_length": 31.625,
"alnum_prop": 0.6001317523056654,
"repo_name": "robertnishihara/ray",
"id": "730883c25c797260d929cc0fc933157dde2502db",
"size": "4554",
"b... |
from Queue import Queue
from Stack import Stack
# Set of stacks with threshold
class SetOfStacks:
def __init__(self, threshold = 10):
assert(threshold > 0)
self.threshold = threshold
self.plates = []
self.currentPlateIndex = 0
self.currentStack = []
self.plates.append(self.currentStack)
def push(self, n... | {
"content_hash": "09f46292c4b8114fda8a4f29d707345b",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 46,
"avg_line_length": 20.894736842105264,
"alnum_prop": 0.6876574307304786,
"repo_name": "honghaoz/CrackingTheCodingInterview",
"id": "ae7c23d751e24afea68eedf614d595d8e36565... |
"""HTTP Client for asyncio."""
import asyncio
import base64
import hashlib
import os
import sys
import traceback
import warnings
from multidict import CIMultiDict, MultiDict, MultiDictProxy, istr
from yarl import URL
import aiohttp
from . import hdrs, helpers
from ._ws_impl import WS_KEY, WebSocketParser, WebSocket... | {
"content_hash": "8267938cf867c3cfb216d5a21ad52e03",
"timestamp": "",
"source": "github",
"line_count": 789,
"max_line_length": 79,
"avg_line_length": 33.133079847908746,
"alnum_prop": 0.5256675082243134,
"repo_name": "esaezgil/aiohttp",
"id": "c4b3f3a4d3bec38733bbd2da097af47970b77b7c",
"size": "26... |
from .common import (
DeployedFleetDetails,
LabelSelector,
OperationMetadata,
OperationStatus,
RealmSelector,
Schedule,
SpecSource,
TargetDetails,
TargetState,
)
from .game_server_clusters import (
CreateGameServerClusterRequest,
DeleteGameServerClusterRequest,
GameServer... | {
"content_hash": "8aab1532130d9520e77a23985523d857",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 49,
"avg_line_length": 30.1937984496124,
"alnum_prop": 0.7766367137355584,
"repo_name": "googleapis/python-game-servers",
"id": "0b906f7acf74464b74b35d4be223679b0560898b",
... |
"""
DTP Scapy Extension
~~~~~~~~~~~~~~~~~~~
:version: 2008-12-22
:author: Jochen Bartl <lobo@c3a.de>
:Thanks:
- TLV code derived from the CDP implementation of scapy. (Thanks to Nicolas Bareil and Arnaud Ebalard)
http://trac.secdev.org/scapy/ticket/18
"""
from scapy.packet import *
f... | {
"content_hash": "4beb9646dfde8037930a0d56aca7514e",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 138,
"avg_line_length": 32.43636363636364,
"alnum_prop": 0.570067264573991,
"repo_name": "kisel/trex-core",
"id": "1907300bae137170b04d32030bd89f40c994b1b3",
"size": "3657... |
import openerp_tutoriel_03
| {
"content_hash": "694f97d829523cc852be987a67d358dc",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 26,
"avg_line_length": 3.888888888888889,
"alnum_prop": 0.6571428571428571,
"repo_name": "tonygalmiche/openerp_tutoriel_03",
"id": "1bea722985ca6a979255a26b452950ec52c33ae6",
... |
import asyncio
import pytest
from urllib.parse import urlparse
from aiohttp import web
from aiotg.mock import MockBot
from threading import Thread, Event
# ⚠️ beware, this test is a total hack ⚠️
webhook_url = 'http://localhost:6666/webhook'
server_started = Event()
def bot_loop(bot):
url = urlparse(webhook_ur... | {
"content_hash": "32c2673b69ddd4b3f071d64773a489c5",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 61,
"avg_line_length": 23.323076923076922,
"alnum_prop": 0.6154353562005277,
"repo_name": "derfenix/aiotg",
"id": "9b0007570c567b3199dbf2adc817247a525766d5",
"size": "1524"... |
from operator import mul as func
import pytest
from py_wlc.utils import memo
@pytest.fixture(scope='module')
def decorated_func():
return memo(func)
class TestMemo:
def test_memo(self, decorated_func):
decorated_func.cache = {}
assert decorated_func(2, 2) == func(2, 2)
assert decor... | {
"content_hash": "9c46a861c7c30f980c92af88fb5cd160",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 50,
"avg_line_length": 23.90909090909091,
"alnum_prop": 0.6216730038022814,
"repo_name": "textbook/py_wlc",
"id": "261096f3bea749d98ad4a0a3df26b56a3f80260e",
"size": "526",... |
import logging
from django.conf import settings
from django.core.cache import cache
from django import template
from django.utils.html import format_html
from seahub.avatar.settings import (GROUP_AVATAR_DEFAULT_SIZE, AVATAR_CACHE_TIMEOUT,
GROUP_AVATAR_DEFAULT_URL)
from seahub.avatar.model... | {
"content_hash": "540767f323463abbd8ed85138982cc4d",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 105,
"avg_line_length": 34.76315789473684,
"alnum_prop": 0.6495079485238455,
"repo_name": "miurahr/seahub",
"id": "7e173932e79f82fd7cd5f70a920cf152c9778284",
"size": "2681"... |
import struct
from . import packet_base
from . import packet_utils
class tcp(packet_base.PacketBase):
"""TCP (RFC 793) header encoder/decoder class.
An instance has the following attributes at least.
Most of them are same to the on-wire counterparts but in host byte order.
__init__ takes the corresp... | {
"content_hash": "faeab4f5d654a0a6adef494a6835d127",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 77,
"avg_line_length": 33.552083333333336,
"alnum_prop": 0.5178515988823347,
"repo_name": "Rashminadig/SDN",
"id": "a6f0167881b1792960b831d8720293d0577453fc",
"size": "3834... |
'''
Copyright (c) <2012> Tarek Galal <tare2.galal@gmail.com>
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,
m... | {
"content_hash": "74efcd550db1379889d017a5db15cbf8",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 145,
"avg_line_length": 40.58119658119658,
"alnum_prop": 0.7445240101095199,
"repo_name": "yah0o2010/whatsploit",
"id": "5718980adbf52bee0446687ecd24aa33ba0701d8",
"size":... |
import logging
from uitester.config import Config
from uitester.context import Context
from uitester.device_manager.device_manager import DeviceManager
from uitester.error_handler import handle_error, error_handlers
from uitester.kw import kw, kw_runner
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLo... | {
"content_hash": "b0b310d242b12066bfb5b049adaf7c14",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 68,
"avg_line_length": 22.61111111111111,
"alnum_prop": 0.6255528255528255,
"repo_name": "IfengAutomation/uitester",
"id": "2a7c6667f78cfe8098a86c46addf1c8ddaa41175",
"size... |
'''
Created on 2014.5.5
@author: cc
'''
import traceback
try:
from conf import LOGIN_USER_INFOR,\
COOKIE_FILE
except ImportError as err:
s = traceback.format_exc()
print s
#the keywordprocess module's scan keyword databases interval
KEYWORD_DB_SCAN_INTERVAL = 29
#the weibo_branch ... | {
"content_hash": "bf83ea82ae46220a8ef06063c2084832",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 60,
"avg_line_length": 23.919354838709676,
"alnum_prop": 0.75118004045853,
"repo_name": "xuerenlv/PaperWork",
"id": "204733762e1f6b900a8ee5ae107f7233e5ade258",
"size": "149... |
from __future__ import absolute_import
# Zulip's main markdown implementation. See docs/markdown.md for
# detailed documentation on our markdown syntax.
from typing import Any
import codecs
import markdown
import logging
import traceback
from six.moves import urllib
import re
import os.path
import glob
import twitter... | {
"content_hash": "9b2cadb8ad8ba668f50a010c0d25612c",
"timestamp": "",
"source": "github",
"line_count": 1136,
"max_line_length": 196,
"avg_line_length": 40.896126760563384,
"alnum_prop": 0.576219380946231,
"repo_name": "ryansnowboarder/zulip",
"id": "d04dde74f7c36ab91ca73aba8154f0d4fcc0a482",
"size... |
from privexUtils import q, resolution, epoch, ts_pub_delay
#from router import router
#from tkgserver import tkgserver
from twisted.internet import reactor, protocol, task, ssl
from twisted.protocols import basic
import ast
import json
import time
import argparse
parser = argparse.ArgumentParser(description='')
parser... | {
"content_hash": "15e2aee89e68da8d4cead3e92eb5e67f",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 117,
"avg_line_length": 29.408602150537636,
"alnum_prop": 0.5670932358318098,
"repo_name": "TariqEE/PrivEx",
"id": "ccde63cc56fb281b4719f76056a90bb8c60364a3",
"size": "2735... |
import argparse
import re
import gzip
import sys
from pathlib import Path
from textwrap import wrap
from typing import FrozenSet, Dict, List, Tuple
from Bio.SeqIO.FastaIO import SimpleFastaParser
# Global regexes
FLYBASE_ID_REGEX = re.compile(r"^\s*FB\w\w\d+\s*$")
PARENT_REGEX = re.compile(r"parent=([\w,]+);")
ID_TAG... | {
"content_hash": "45ab4e4faba30b753257e94847272c7d",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 120,
"avg_line_length": 35.68354430379747,
"alnum_prop": 0.6181269953884356,
"repo_name": "FlyBase/bulkfile-scripts",
"id": "3067f575e01019b72c4465b54a3e702be82eb723",
"si... |
import os.path
import webbrowser
import tornado.ioloop
import terminado
STATIC_DIR = os.path.join(os.path.dirname(terminado.__file__), "_static")
TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), "templates")
def run_and_show_browser(url, term_manager):
loop = tornado.ioloop.IOLoop.instance()
loop.add_ca... | {
"content_hash": "0ee8d4fe6fe4d3b6c8aef5762c5e04e4",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 73,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.6821705426356589,
"repo_name": "takluyver/terminado",
"id": "97ba04427a7d71fd41ab7e2a281483b011ec3c5e",
"size": "... |
import Flow,Range
from ryu.ofproto import ofproto_v1_3
#This file contains all the logic for populating the last table, used for the balancing of traffic
#Creates a flow for the table, one for each range
def createFourthTableFlow(flowRange, index, datapath,servers,numOfClients):
ofproto=ofproto_v1_3
parser = ... | {
"content_hash": "4692810e836d87721b4bbea0aeb13af4",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 137,
"avg_line_length": 55.72727272727273,
"alnum_prop": 0.7389885807504079,
"repo_name": "lironsc/ORange",
"id": "7db631ef1e1dc4bed9337f4a194c80a5b821d234",
"size": "1226"... |
import os
import sys
from insights.client.constants import InsightsConstants as constants
from insights.client.apps.ansible.playbook_verifier import verify, loadPlaybookYaml, PlaybookVerificationError
skipVerify = False
def read_playbook():
"""
Read in the stringified playbook yaml from stdin
"""
unv... | {
"content_hash": "bfcc325d44d9b3243668b2d60b923932",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 110,
"avg_line_length": 24.774193548387096,
"alnum_prop": 0.7395833333333334,
"repo_name": "RedHatInsights/insights-core",
"id": "e76f19833c10e24ecb976e813efb6011e6d309a7",
... |
from fuel_health import ceilometermanager
from fuel_health.common.utils.data_utils import rand_name
class CeilometerApiSmokeTests(ceilometermanager.CeilometerBaseTest):
"""TestClass contains tests that check basic Ceilometer functionality."""
def test_create_alarm(self):
"""Ceilometer test to create,... | {
"content_hash": "02e89ac6e084a873c4d9555e74ba1159",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 77,
"avg_line_length": 41.35164835164835,
"alnum_prop": 0.5612543183630082,
"repo_name": "mcloudv/fuel-ostf",
"id": "6a66ca38f186909cf6c80906b3263e4c8d362408",
"size": "433... |
def usersettings(request):
"""
Returns the current ``UserSettings`` based on
the SITE_ID in the project's settings as context variables
If there is no 'usersettings' attribute in the request, fetches the
current UserSettings (from usersettings.shortcuts.get_current_usersettings).
"""
if has... | {
"content_hash": "9312809840c591360accebd35484802d",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 80,
"avg_line_length": 33.411764705882355,
"alnum_prop": 0.6936619718309859,
"repo_name": "mishbahr/django-usersettings2",
"id": "765271c2598338058f6c89e5fb813ebb5f8509e8",
... |
from __future__ import absolute_import
from __future__ import print_function
import requests
class CanonicalizationProvider(object):
def __init__(self, server_addr):
self.server_addr = server_addr
def canonicalize(self, text, t):
payload = {'text': text, 'type': t}
r = requests.post(... | {
"content_hash": "a366dae672da454b22248b74a9bae683",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 57,
"avg_line_length": 29.8,
"alnum_prop": 0.6140939597315436,
"repo_name": "hotpxl/canonicalization-server",
"id": "9040578077ea7f92f158a778918f6c41082be5e4",
"size": "662... |
import logging
import os
from werkzeug.exceptions import HTTPException, NotFound
from werkzeug.local import LocalManager
from werkzeug.middleware.profiler import ProfilerMiddleware
from werkzeug.middleware.shared_data import SharedDataMiddleware
from werkzeug.wrappers import Request, Response
import frappe
import fra... | {
"content_hash": "c87739b00b81f19049ec220306f29caa",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 103,
"avg_line_length": 28.21276595744681,
"alnum_prop": 0.7228506787330317,
"repo_name": "frappe/frappe",
"id": "fc679aa44e14604350003ab2917223b227fc59f1",
"size": "10706... |
from qmf.console import Session
from sys import exit, argv
import time, pwd, os
uid = pwd.getpwuid(os.getuid())[0]
if not uid:
uid = "condor"
__annotations__ = {"Requirements": "com.redhat.grid.Expression"}
ad = {"Cmd": "/bin/sleep",
"Args": "60",
"Requirements": "TRUE",
"Iwd": "/tmp",
... | {
"content_hash": "441f9e5dc87307f5d32eb88051d1c9da",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 91,
"avg_line_length": 23.450704225352112,
"alnum_prop": 0.6738738738738739,
"repo_name": "bbockelm/condor-network-accounting",
"id": "2969488bc53f1f564af3ac77b136828126854d0... |
import re
import unittest
from tvcm import parse_html_deps
from tvcm import html_generation_controller
class ParseTests(unittest.TestCase):
def test_parse_empty(self):
parser = parse_html_deps.HTMLModuleParser()
module = parser.Parse('')
self.assertEquals([], module.scripts_external)
self.assertEqu... | {
"content_hash": "353cd42dc28fdf3cfe20c64cd7f75bcb",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 76,
"avg_line_length": 34.507407407407406,
"alnum_prop": 0.5963292905441666,
"repo_name": "zeptonaut/catapult",
"id": "81cc66d0f7bf2938fc98b42002c2c3d3457f36d9",
"size": "... |
"""Preprocessing stage tests."""
# pylint: disable=g-classes-have-attributes
import time
import numpy as np
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.keras import keras_parameterized
from tensorflow.python.keras.engine import base_preprocessing_layer
from tensorflow.python.keras.layers... | {
"content_hash": "abfa5f227937fa9ebfa801618c49810e",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 81,
"avg_line_length": 33.29577464788732,
"alnum_prop": 0.6979695431472082,
"repo_name": "sarvex/tensorflow",
"id": "7da6e6285d8a135bf38f8dc3024557d4cc299365",
"size": "305... |
"""Unit tests for Rake.py"""
from collections import defaultdict
import nltk
from rake_nltk import Metric, Rake
###########################################################
text = """Compatibility of systems of linear constraints
over the set of natural numbers. Criteria of compatibility of a system
of linear Dioph... | {
"content_hash": "196f75d165a075ec92fcc596e2943738",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 111,
"avg_line_length": 27.303614457831326,
"alnum_prop": 0.5495543200070603,
"repo_name": "csurfer/rake-nltk",
"id": "c66fd27d2376823d06d5bc923c976d4e89713665",
"size": "... |
from kombu import Exchange, Queue
## debug switch
debug=True
## manually set the domain
domain = '<%= @rabbitdomain %>'
## queue to monitor
watch_q = '<%= @rabbit_q %>'
## names of the scripts
workername='<%= @workername %>'
monitorname='<%= @monitorname %>'
## controller info
openstack_controller='<%= @controller... | {
"content_hash": "a3d7d12aa497628e0f83155f3b5823c1",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 110,
"avg_line_length": 38.03225806451613,
"alnum_prop": 0.6423522759400622,
"repo_name": "syspimp/openstack",
"id": "44660595d433cbf23c31fa2a756ce5a8e5d11f70",
"size": "35... |
from netmiko import ConnectHandler
from getpass import getpass
cisco1 = {
"device_type": "cisco_ios",
"host": "cisco1.lasthop.io",
"username": "pyclass",
"password": getpass(),
}
command = "del flash:/test4.txt"
net_connect = ConnectHandler(**cisco1)
# CLI Interaction is as follows:
# cisco1#delete f... | {
"content_hash": "9445ad0d5078ac48d933de7459f3a4df",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 83,
"avg_line_length": 26.227272727272727,
"alnum_prop": 0.708838821490468,
"repo_name": "ktbyers/netmiko",
"id": "f189621b2fd50887c734d46e4221444bdfb4971e",
"size": "1176"... |
from rest_framework.permissions import BasePermission, SAFE_METHODS
from data_models.models import Article, ArticleVersion, Member, Category
class MemberPermissions(BasePermission):
"""
Permissions that describes access rights to members
"""
def has_permission(self, request, view):
"""
... | {
"content_hash": "8c13cb9bb211ff45c561d89f786b6c68",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 98,
"avg_line_length": 27.89855072463768,
"alnum_prop": 0.6205194805194805,
"repo_name": "RadioRevolt/revoltwiki",
"id": "179b788ffa2da7911932d89adbd2e95d0c8697af",
"size"... |
'''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
import flogging
log = flogging.get_loggers()
# Local methods
NODECATALOG = fit_common.node_select()
def _delete_active_tasks(node):
for dummy in range(1,10... | {
"content_hash": "9ad599f08a71b43aeef11a15a3a66772",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 144,
"avg_line_length": 59.08552631578947,
"alnum_prop": 0.5591804921500947,
"repo_name": "geoff-reid/RackHD",
"id": "89e3f2aaf289db11ec41bf86ae12ebac6f5576b4",
"size": "1... |
import os
# try/except added for compatibility with python < 3.8
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER
except ImportError: # pragma: NO COVER
import mock
import math
from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template
fro... | {
"content_hash": "cce3247937914c2369b9cd8288a325c7",
"timestamp": "",
"source": "github",
"line_count": 3582,
"max_line_length": 131,
"avg_line_length": 36.12646566164154,
"alnum_prop": 0.6451991808662726,
"repo_name": "googleapis/python-bigquery-migration",
"id": "1f8ace860d2ed7b7d39b135d1d333d60af6... |
import multiprocessing
multiprocessing.set_start_method('forkserver')
import os
os.environ["OMP_NUM_THREADS"] = str(multiprocessing.cpu_count()) # or to whatever you want
print('BEGIN BIG COPY PASTE ')
# This section is for if/when I copy/paste the code into a ipython sesssion
n_resamp = 0
n_trees = 100
core ... | {
"content_hash": "201d702b7d9212aecfdc60c1b355e547",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 146,
"avg_line_length": 38.246684350132625,
"alnum_prop": 0.5969207295928982,
"repo_name": "exowanderer/SpitzerDeepLearningNetwork",
"id": "522f1edbbd5d87c040eac8b8b3fb48154... |
from cinder import db
from cinder import exception
from cinder.i18n import _
from cinder import objects
from cinder.objects import base
from cinder.objects import fields as c_fields
from oslo_versionedobjects import fields
OPTIONAL_FIELDS = ['volumes', 'volume_types', 'group_snapshots']
@base.CinderObjectRegistry.re... | {
"content_hash": "de3ab9f7dc897b8ddc13f0dada1a5630",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 79,
"avg_line_length": 39.47540983606557,
"alnum_prop": 0.5621539313399778,
"repo_name": "Nexenta/cinder",
"id": "68244080e76bdd014db95537d8bc45f9854c2367",
"size": "7835"... |
from __future__ import absolute_import
import collections
import copy
import re
from threading import RLock
from sqlbuilder import smartsql
from ascetic import interfaces
from ascetic.exceptions import ObjectDoesNotExist, MapperNotRegistered
from ascetic.fields import Field
from ascetic.utils import to_tuple, Specia... | {
"content_hash": "30641753db3f74a584dc6dd0eebd52ab",
"timestamp": "",
"source": "github",
"line_count": 533,
"max_line_length": 133,
"avg_line_length": 36.28705440900563,
"alnum_prop": 0.5904038053875187,
"repo_name": "emacsway/ascetic",
"id": "bc44331716510db2d173ba59008e209c3c876da8",
"size": "19... |
'''
Berkelium Webbrowser Extension
==============================
This extension provide a wrapper in Python / Kivy around Berkelium project.
Berkelium project is a offscreen webbrower based on Chromium. You can check
more about it at http://berkelium.org/
About berkelium
---------------
Berkelium is now used withou... | {
"content_hash": "263a41bfc6e58515efe357de94bd37d9",
"timestamp": "",
"source": "github",
"line_count": 961,
"max_line_length": 136,
"avg_line_length": 32.64620187304891,
"alnum_prop": 0.5721161508303318,
"repo_name": "kivy/kivy-berkelium",
"id": "3996492de9038222fec7aeabb94c5a81ae7b2685",
"size": ... |
"""BGP Protocol"""
import logging
import traceback
import struct
import time
import netaddr
from oslo.config import cfg
from twisted.internet import protocol
from yabgp.common import constants as bgp_cons
from yabgp.message.open import Open
from yabgp.message.keepalive import KeepAlive
from yabgp.message.update impo... | {
"content_hash": "2bc1f3ad756ceaae0ede00ba7087e714",
"timestamp": "",
"source": "github",
"line_count": 466,
"max_line_length": 120,
"avg_line_length": 36.10085836909871,
"alnum_prop": 0.5592938239315223,
"repo_name": "abn/yabgp",
"id": "13658479c1000a2d0caab35ee153302e786419c9",
"size": "17458",
... |
import django.contrib.gis.db.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('passive_data_kit', '0037_datasource_suppress_alerts'),
]
operations = [
migrations.AlterField(
model_name='datapoint',
name='gener... | {
"content_hash": "d02d102e9ef54388609d55fdd40978c2",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 99,
"avg_line_length": 26.294117647058822,
"alnum_prop": 0.6353467561521253,
"repo_name": "audaciouscode/PassiveDataKit-Django",
"id": "5358390552ad94d2f28d8e75a911580783e7bd... |
from __future__ import print_function, division
from sympy.core import S
from sympy.core.compatibility import u
from sympy.core.exprtools import factor_terms
from sympy.core.function import (Function, Derivative, ArgumentIndexError,
AppliedUndef)
from sympy.functions.elementary.miscellaneous import sqrt
from sympy... | {
"content_hash": "f1e1384ecf838e15ccca4b23946cdf32",
"timestamp": "",
"source": "github",
"line_count": 991,
"max_line_length": 101,
"avg_line_length": 30.30676084762866,
"alnum_prop": 0.5277685290004661,
"repo_name": "sahilshekhawat/sympy",
"id": "f2de13b2a23c461dfcf50a18947b5a8fbaea3529",
"size":... |
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
# Create SNMP engine with autogenernated engineID and pre-bound
# to socket transport dispatcher
snmpEngine = engine.SnmpEngine()
# Transport setup
# UDP over IPv4 at 127.0.0.1:161... | {
"content_hash": "5c9d36b9937d5f7fbf1e10a8186c6c73",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 90,
"avg_line_length": 32.16326530612245,
"alnum_prop": 0.7728426395939086,
"repo_name": "ww9rivers/pysnmp",
"id": "91af55e18938a802ca389a8914b72ab723667be0",
"size": "2031... |
'''
datetime.tzinfo timezone definitions generated from the
Olson timezone database:
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
See the datetime section of the Python Library Reference for information
on how to use these modules.
'''
# The Olson database is updated several times a year.
OLSON_VERSION = '2015g'
VERSI... | {
"content_hash": "649050684001a65a8fdcf3698087e92d",
"timestamp": "",
"source": "github",
"line_count": 1514,
"max_line_length": 81,
"avg_line_length": 22.46565389696169,
"alnum_prop": 0.652897421574104,
"repo_name": "mozilla/fjord",
"id": "ec011f11d1d9c0047f398ee8f84e184cc375456a",
"size": "34013"... |
"""Support for TP-Link routers."""
import base64
from datetime import datetime
import hashlib
import logging
import re
from aiohttp.hdrs import (
ACCEPT, COOKIE, PRAGMA, REFERER, CONNECTION, KEEP_ALIVE, USER_AGENT,
CONTENT_TYPE, CACHE_CONTROL, ACCEPT_ENCODING, ACCEPT_LANGUAGE)
import requests
import voluptuous... | {
"content_hash": "1800c47d0815b2053fda4801b310d6ac",
"timestamp": "",
"source": "github",
"line_count": 470,
"max_line_length": 78,
"avg_line_length": 33.82553191489362,
"alnum_prop": 0.579947163165178,
"repo_name": "molobrakos/home-assistant",
"id": "7b665006a44cf77898393cc037f04fc51a651194",
"siz... |
from peewee import *
db = SqliteDatabase("hrcemail.sqlite")
class BaseModel(Model):
class Meta:
database = db
class Document(BaseModel):
docID = CharField(max_length=9,unique=True,primary_key=True)
subject = CharField(null=True)
documentClass = CharField()
pdfLink = CharField()
originalLink = CharField(null=T... | {
"content_hash": "7079eafb5c9bce3f379b48eadcdd306a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 61,
"avg_line_length": 26.482758620689655,
"alnum_prop": 0.7513020833333334,
"repo_name": "wsjdata/clinton-email-cruncher",
"id": "76c52d39003272f3e9ad64a18286018d6d4ca2d4",
... |
class Tag:
"""
An IRC message tag ircv3.net/specs/core/message-tags-3.2.html
"""
@staticmethod
def parse(item):
r"""
>>> Tag.parse('x') == {'key': 'x', 'value': None}
True
>>> Tag.parse('x=yes') == {'key': 'x', 'value': 'yes'}
True
>>> Tag.parse('x=... | {
"content_hash": "269d6370984b0da2f83104610932baca",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 65,
"avg_line_length": 24.17721518987342,
"alnum_prop": 0.46701570680628274,
"repo_name": "jaraco/irc",
"id": "9ea9f418603766b4138b4ee5ed12aea52ab1e700",
"size": "1910",
... |
"""Tests for TFCONFIGClusterResolver."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from tensorflow.python import framework
from tensorflow.python.client import session
from tensorflow.python.distribute.cluster_resolver.tfconfig_cluster_reso... | {
"content_hash": "f812e37306dc824945d6d4e14ce28a3c",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 107,
"avg_line_length": 28.95583596214511,
"alnum_prop": 0.5815448305915677,
"repo_name": "frreiss/tensorflow-fred",
"id": "cc28393d508d6b6afcac601239482563a398badc",
"siz... |
"""
Developed by niphlod@gmail.com
Released under web2py license because includes gluon/cache.py source code
"""
try:
import cPickle as pickle
except:
import pickle
import time
import re
import logging
import thread
import random
from gluon import current
from gluon.cache import CacheAbstract
from gluon.contri... | {
"content_hash": "0be957cf3668543959c07d7bb306e1ad",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 96,
"avg_line_length": 37.0177304964539,
"alnum_prop": 0.5821438835137466,
"repo_name": "frankyrumple/ope",
"id": "0163abb506737b391cae6391c0e035222759f3db",
"size": "1043... |
class ODataV3MetadataLevel:
"""The amount of metadata information to serialize in an OData response."""
def __init__(self):
pass
Verbose = "verbose"
"""Indicates that the service MUST include all control information explicitly in the payload."""
NoMetadata = "nometadata"
"""Indicates t... | {
"content_hash": "b2ea64df2bc8bb0e920cbb92dcf315a4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 116,
"avg_line_length": 43.92307692307692,
"alnum_prop": 0.7320490367775832,
"repo_name": "vgrem/Office365-REST-Python-Client",
"id": "cf704147a991cc6af796c5432ad7aac30a73922... |
__author__ = 'eblubin@mit.edu, nanaya@mit.edu'
import math
import numpy as np
from random import choice
from inspect import isfunction
from matplotlib import pyplot as plt
from UserDict import IterableUserDict
import random
import operator
import heapq
from progressbar import AnimatedProgressBar
# This is used to hel... | {
"content_hash": "72be9d50253fe826332bff8ee023d06a",
"timestamp": "",
"source": "github",
"line_count": 516,
"max_line_length": 305,
"avg_line_length": 47.116279069767444,
"alnum_prop": 0.622861138532412,
"repo_name": "ecbtln/1411wrightfisher",
"id": "9cdc4ac833270bc2e86c2c549937bc1dfbf46bff",
"siz... |
"""Code for Bag-of-SFA Symbols."""
# Author: Johann Faouzi <johann.faouzi@gmail.com>
# License: BSD-3-Clause
import numpy as np
from math import ceil
from scipy.sparse import csr_matrix
from sklearn.base import BaseEstimator
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.utils.validation imp... | {
"content_hash": "58f6888e9be2a391eb1b553eb703a635",
"timestamp": "",
"source": "github",
"line_count": 353,
"max_line_length": 79,
"avg_line_length": 38.3371104815864,
"alnum_prop": 0.5615162935047662,
"repo_name": "johannfaouzi/pyts",
"id": "9f71a513a095167c3b557ce73bc6694b243d103a",
"size": "135... |
__doc__ = """
collections compatibility module for older (pre-2.4) Python versions
This does not not NOT (repeat, *NOT*) provide complete collections
functionality. It only wraps the portions of collections functionality
used by SCons, in an interface that looks enough like collections for
our purposes.
"""
__revisi... | {
"content_hash": "91eb25fde1faae7bc9aff3fb415e36a1",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 71,
"avg_line_length": 30.772727272727273,
"alnum_prop": 0.7001477104874446,
"repo_name": "Distrotech/scons",
"id": "1591b2e7e761cc1c40217717cfd7d73e123469d5",
"size": "175... |
from datetime import datetime
import feedparser
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404
from django_pubsub_couch.models import Subscription
from django_pubsub_couch.signals import verified, updated
def get_subscription_or_404(_id, topic=None, verify_token=None):
... | {
"content_hash": "e778e53fd15d17bc04c0036a5a193225",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 78,
"avg_line_length": 34.946666666666665,
"alnum_prop": 0.6032048836322015,
"repo_name": "stefankoegl/django-pubsub-couch",
"id": "fecf627dec3ea46fe5aec027bb102c6ee11c53c4",... |
__VERSION__="ete2-2.2rev1056"
# -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the t... | {
"content_hash": "525828534686bf5cb78385b2082cf9ef",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 83,
"avg_line_length": 33.864150943396226,
"alnum_prop": 0.6069757075997325,
"repo_name": "csc8630Spring2014/Clusterizer",
"id": "dea74bc4c451f54c56361f5bbffdd559ee20d77a",
... |
"""Generated client library for toolresults version v1beta3."""
# NOTE: This file is autogenerated and should not be edited by hand.
from googlecloudapis.apitools.base.py import base_api
from googlecloudapis.toolresults.v1beta3 import toolresults_v1beta3_messages as messages
class ToolresultsV1beta3(base_api.BaseApi... | {
"content_hash": "697e896c506187d03d439b2ff4d7493f",
"timestamp": "",
"source": "github",
"line_count": 492,
"max_line_length": 336,
"avg_line_length": 46.22560975609756,
"alnum_prop": 0.6685133887349953,
"repo_name": "ychen820/microblog",
"id": "7d2445e03833539bbce165c61e7d008e4ff6ab76",
"size": "... |
import picoweb
import ure as re
import logging
logger = logging.getLogger(__name__)
def exists(filename):
try:
import os
os.stat(filename)
return True
except OSError:
return False
def ok(res, data={}):
yield from picoweb.jsonify(res, data)
def error(res, msg='bad request'):
yield from picoweb... | {
"content_hash": "77305794b2f7c2fc538e6e2115d2c9c0",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 74,
"avg_line_length": 23.638297872340427,
"alnum_prop": 0.6246624662466247,
"repo_name": "twhtanghk/docker.esp8266",
"id": "cb6a6d488ebd189a051c3229438265143efb1a31",
"siz... |
import pkg_resources
import sys
# If there is a conflicting non egg module,
# i.e. an older standard system module installed,
# then replace it with this requirement
def replace_dist(requirement):
try:
return pkg_resources.require(requirement)
except pkg_resources.VersionConflict:
e = sys.exc_in... | {
"content_hash": "8543afe3e8595aa0af250fc1782ca515",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 70,
"avg_line_length": 37.63157894736842,
"alnum_prop": 0.6629370629370629,
"repo_name": "osynge/grid_version_sort",
"id": "843ad9d3c9a26f0933a6617958095b76a4dd0c72",
"size... |
import time
from typing import cast
import lxml
from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
BATCH_SIZE = 1000
def process_batch(apps: StateApps, id_start: int, id_end: int, last_id: int) -> None:
Mess... | {
"content_hash": "2952f3aa69e1b79ec506ac29d7361809",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 98,
"avg_line_length": 38.032967032967036,
"alnum_prop": 0.6443224501589137,
"repo_name": "rht/zulip",
"id": "253282e742ec26ef4d4089ee079b2e1588d7551f",
"size": "3512",
"... |
from oslo.db import exception as d_exc
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import orm
from sqlalchemy import String
from neutron.db import models_v2
from neutron.openstack.common import log as logging
from neutron.plugins.vmware.common import exceptions as p_exc
LOG = logg... | {
"content_hash": "b8a75d017bc092e1e57fcdf410d1a280",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 79,
"avg_line_length": 37.04347826086956,
"alnum_prop": 0.6328638497652582,
"repo_name": "leeseuljeong/leeseulstack_neutron",
"id": "a4865bdfc19dd5c1d95b7a2f95fb58cb0b39a1de... |
from django.shortcuts import render_to_response as render
from django.template import RequestContext
from django.conf import settings
import debug # pyflakes:ignore
def preferences(request, **kwargs):
preferences = request.COOKIES.copy()
new_cookies = {}
del_cookies = []
for... | {
"content_hash": "c790623e2c9c9c2e7197d7f137778cdf",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 101,
"avg_line_length": 40.88461538461539,
"alnum_prop": 0.6265286923800565,
"repo_name": "wpjesus/codematch",
"id": "cb25b55a5eb41df2f849f38c31164144f4a56409",
"size": "21... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='DepartmentWarnings',
fields=[
... | {
"content_hash": "fdd15fc2c3245c3c3cf1293d086832f1",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 114,
"avg_line_length": 52.01960784313726,
"alnum_prop": 0.5827365246890313,
"repo_name": "FireCARES/firecares",
"id": "ad14f21f4255ad952c7ed9d22d29511540c42abf",
"size": "... |
import collections.abc
import copy
import datetime
import decimal
import operator
import uuid
import warnings
from base64 import b64decode, b64encode
from functools import partialmethod, total_ordering
from django import forms
from django.apps import apps
from django.conf import settings
from django.core import checks... | {
"content_hash": "74fccf9af50330ecec39b4fe02d7464c",
"timestamp": "",
"source": "github",
"line_count": 2443,
"max_line_length": 117,
"avg_line_length": 35.970118706508394,
"alnum_prop": 0.5658833570412518,
"repo_name": "simonw/django",
"id": "6bd95f542ce8c7e1dd1a19b02c222e68d243041e",
"size": "879... |
import bge
import sys
sys.path.append(bge.logic.expandPath('//../../'))
from netplay import host
class Button:
def __init__(self, owner):
self.owner = owner
owner['button'] = self
def on_click(self):
pass
class Menu:
def __init__(self):
objects = bge.logic.getCurrentSc... | {
"content_hash": "bbb006caebc1655c74880dd424832e9b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 89,
"avg_line_length": 25.12727272727273,
"alnum_prop": 0.5875542691751086,
"repo_name": "pqftgs/bge-netplay",
"id": "8eb7df58cab30e5e8b1f214a50909440174438c2",
"size": "13... |
from __future__ import absolute_import
import logging
from django.conf import settings
from django.utils.functional import cached_property # noqa
from django.utils.translation import ugettext_lazy as _
import six
from novaclient import client as nova_client
from novaclient import exceptions as nova_exceptions
from ... | {
"content_hash": "90641965153468cf76a5f1084d1ddbd2",
"timestamp": "",
"source": "github",
"line_count": 985,
"max_line_length": 79,
"avg_line_length": 34.434517766497464,
"alnum_prop": 0.6250958193289698,
"repo_name": "redhat-cip/horizon",
"id": "d834665387bd8f95b76a6014b865eb6048986787",
"size": "... |
from django.conf.urls import *
from CnbetaApis.views import *
urlpatterns = [
url(r'^home', get_home_data),
url(r'^article$', get_article_content),
url(r'^video', get_video_realUrl)
]
| {
"content_hash": "0d92693e92112596c09fc9bca2e633fc",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 43,
"avg_line_length": 22,
"alnum_prop": 0.6616161616161617,
"repo_name": "kagenZhao/cnBeta",
"id": "0628bbb198ee606a246cbdc4d7b18a8464a8199f",
"size": "245",
"binary": fa... |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from ..queues.models import Queue
import uuid
@python_2_unicode_compatible
class Entry(models.Mo... | {
"content_hash": "c2685d19fdb932cca696401790caeb26",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 90,
"avg_line_length": 32,
"alnum_prop": 0.7006578947368421,
"repo_name": "luftdanmark/fifo.li",
"id": "b62454e40fe491634a00f6acca75ea7b3098e90d",
"size": "1216",
"binary... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.