text
stringlengths
4
1.02M
meta
dict
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implementer from typing import Callable, List, Optional, Tuple @implementer(IPlugin, IModuleData) class ServerTime(ModuleData): name = "ServerTime" def actions(self) -> List[Tuple[str, int, Cal...
{ "content_hash": "4ccc9cec746f60c37454bc4ac73ba965", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 70, "avg_line_length": 33.806451612903224, "alnum_prop": 0.7337786259541985, "repo_name": "Heufneutje/txircd", "id": "9b13d05f314ee5647f186035fb60f3ca688a61ac", "size": "10...
import unittest from hwt.simulator.simTestCase import SimTestCase from hwtSimApi.constants import CLK_PERIOD from hwtLib.examples.arithmetic.privateSignals import PrivateSignalsOfStructType class PrivateSignalsOfStructTypeTC(SimTestCase): @classmethod def setUpClass(cls): cls.u = PrivateSignalsOfStr...
{ "content_hash": "9a72f8ad6d0647f7850450bd5ef8648c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 80, "avg_line_length": 29.96875, "alnum_prop": 0.6809176225234619, "repo_name": "Nic30/hwtLib", "id": "a088c5978c3145ea377c475c7731900b2282d821", "size": "1007", "binary"...
""" Copyright (c) 2011, 2012, Regents of the University of California 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, thi...
{ "content_hash": "432eb34d89f00e128898c4a1e9fafd67", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 106, "avg_line_length": 39.340425531914896, "alnum_prop": 0.599242833964305, "repo_name": "jf87/smap", "id": "f85491c08c90350a9904411cb62e370bb7962dd2", "size": "5547", ...
''' Test Cases for Document Class for Word Cloud Project Daniel Klein Computer-Based Honors Program The University of Alabama 9.12.2013 ''' import unittest import pickle from src.core.python.Metadata import Metadata from src.core.python.Document import Document import os, os.path class DocumentTest(unittest.TestCase...
{ "content_hash": "0d86026ffd04542a17b23199ec0ff7ad", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 91, "avg_line_length": 35.056179775280896, "alnum_prop": 0.6076923076923076, "repo_name": "dmarklein/WordCloud", "id": "3297d030f76812043624f6b4a501f9fdde8b673a", "size": "...
""" Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.21 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import kinow_client from kinow_client.rest import ApiException from...
{ "content_hash": "29504e65cc9d153b271b1839b6a7f039", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 72, "avg_line_length": 19.075, "alnum_prop": 0.6736566186107471, "repo_name": "kinow-io/kinow-python-sdk", "id": "bdb56c38249d6259a3cab3f532cab711ae183a0b", "size": "780", ...
import logging import numpy as np import dill from collections import defaultdict from skipthought import utils class Batch: def __init__(self, data, pad_value, go_value, eos_value): """Class which creates batch from data and could be passed into SkipthoughtModel._fill_feed_dict_* methods. ...
{ "content_hash": "cdcf896d7d2bf8356c30d66ba97be12d", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 115, "avg_line_length": 36.48870056497175, "alnum_prop": 0.5841913757064334, "repo_name": "persiyanov/skip-thought-tf", "id": "bc8d06d9805a3c69f1c0728bf336d4ec6fcc02b8", "...
from __future__ import absolute_import from .fastq_screen_module import MultiqcModule
{ "content_hash": "1a87cee4d11394e93eee2eba3b648d58", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 46, "avg_line_length": 28.666666666666668, "alnum_prop": 0.813953488372093, "repo_name": "moonso/MultiQC", "id": "e95b17cf94c9b714a8c4fe9712c2036762bbddc8", "size": "86", ...
import tempfile import unittest from pyspark.ml import Estimator, Model from pyspark.ml.classification import LogisticRegression, LogisticRegressionModel, OneVsRest from pyspark.ml.evaluation import BinaryClassificationEvaluator, \ MulticlassClassificationEvaluator, RegressionEvaluator from pyspark.ml.linalg impor...
{ "content_hash": "b1e49308dfbfa7bce605f4bd4460acc7", "timestamp": "", "source": "github", "line_count": 527, "max_line_length": 95, "avg_line_length": 42.42125237191651, "alnum_prop": 0.6199677938808373, "repo_name": "mdespriee/spark", "id": "39bb921aaf43dc0f5208cfd6bb1148129eecb740", "size": "2314...
""" Chat Room Demo for Miniboa. """ from miniboa import TelnetServer IDLE_TIMEOUT = 300 CLIENT_LIST = [] SERVER_RUN = True def on_connect(client): """ Sample on_connect function. Handles new connections. """ print "++ Opened connection to %s" % client.addrport() broadcast('%s joins the conve...
{ "content_hash": "02f40eefe83227a052462526a4b5dcec", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 79, "avg_line_length": 26.5, "alnum_prop": 0.5637605725439168, "repo_name": "tectronics/miniboa", "id": "42666e6167449056db050dd8176f1929b05e1612", "size": "3854", "bina...
from django.db import models from django.conf import settings from django.http import QueryDict from django.utils.http import urlencode from six.moves.urllib.request import urlopen from six.moves.urllib.parse import unquote_plus from paypal.standard.models import PayPalStandardBase from paypal.standard.conf import POS...
{ "content_hash": "94974aecc1ddc0f11dc87a981cef0a4a", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 116, "avg_line_length": 37.212765957446805, "alnum_prop": 0.6246426529445397, "repo_name": "caleb/idea-color-themes", "id": "9ad330342da81de82fabf98ed6a54272d8d84267", "siz...
from sklearn2sql_heroku.tests.classification import generic as class_gen class_gen.test_model("MLPClassifier" , "FourClass_500" , "hive")
{ "content_hash": "bf0553d611f84db219f617b85e2a3164", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 72, "avg_line_length": 35, "alnum_prop": 0.7785714285714286, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "57499ab98ebab0443c5fcb95fcdb3f74d86faf87", "size": "140",...
import version version.append ('$Revision: 89494 $') del version import ktl import os import time import tkFileDialog import Tkinter from Tkinter import N, E, S, W import traceback import Color import Font import Event import Log import Popup as kPopup # avoid name conflict with class Popup below import Value des...
{ "content_hash": "710c60bbf8c23d0060dece908bd4c181", "timestamp": "", "source": "github", "line_count": 1332, "max_line_length": 102, "avg_line_length": 21.813063063063062, "alnum_prop": 0.6483221476510067, "repo_name": "alexrudy/Cauldron", "id": "bb40bd00558d566498953c0b5a85a2de02d9baf3", "size": ...
'''Tests jython.bat using the --print option''' import os import sys import unittest import tempfile from test import test_support from java.lang import IllegalThreadStateException from java.lang import Runtime from java.lang import System from java.lang import Thread from java.io import File from java.io import Buf...
{ "content_hash": "98776d1e33a484f610b353b586b04702", "timestamp": "", "source": "github", "line_count": 411, "max_line_length": 105, "avg_line_length": 34.175182481751825, "alnum_prop": 0.5685604442545921, "repo_name": "nvoron23/socialite", "id": "0cb73842fccc314d797bbb6ed8381d797b5ed88a", "size": ...
import bowerstatic from webtest import TestApp as Client import os import sys import json from datetime import datetime, timedelta import pytest from bowerstatic import compat from bowerstatic import filesystem_microsecond_autoversion def test_local_falls_back_to_components(): bower = bowerstatic.Bower() co...
{ "content_hash": "77d2bc63255b8da70e23db573b3afb3f", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 79, "avg_line_length": 32.03266331658291, "alnum_prop": 0.622715507098596, "repo_name": "Preston-Landers/bowerstatic", "id": "da7fdbce9aaa496923ad73c33bccc0889d3a7cba", "s...
"""Support for Salda Smarty XP/XV Ventilation Unit Binary Sensors.""" import logging from homeassistant.core import callback from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import DOMAIN, SIGNAL_UPDATE_SMARTY _LOGGER =...
{ "content_hash": "4c6636f053c32a048ab8df49eed9515b", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 88, "avg_line_length": 27.89908256880734, "alnum_prop": 0.6106543900032884, "repo_name": "fbradyirl/home-assistant", "id": "2d79700db78507194b4b08260e356f7a0d1f2dcd", "siz...
import pytest from tests.providers.google.cloud.utils.gcp_authenticator import GCP_AI_KEY from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, GoogleSystemTest, provide_gcp_context @pytest.mark.backend("mysql", "postgres") @pytest.mark.credential_file(GCP_AI_KEY) class CloudNaturalLanguageExampleDagsTes...
{ "content_hash": "2452fd80a214af5be3f8f5b29c175a10", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 103, "avg_line_length": 32.388888888888886, "alnum_prop": 0.7358490566037735, "repo_name": "lyft/incubator-airflow", "id": "4bcd05f7f4995cc4e38c5f3225fb240b06041af6", "size...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/installation/shared_mockup_power_generator_fusion_style_1.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return r...
{ "content_hash": "82961bfef7c3a39db4e637f573325a10", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 96, "avg_line_length": 25, "alnum_prop": 0.7046153846153846, "repo_name": "obi-two/Rebelion", "id": "79b15b68132aed9311aae5d8d1d24682c5d72651", "size": "470", "binary": f...
"""fabric ops""" import os from fabric.api import cd from fabric.api import env from fabric.api import get from fabric.api import put from fabric.api import run from fabric.api import shell_env import robotx # env.user = 'root' env.password = os.environ['all_slave_password'] # env.hosts = ['192.168.122.56', '192....
{ "content_hash": "d8a336d046298e2b9de740b121a6fd13", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 78, "avg_line_length": 28, "alnum_prop": 0.6614285714285715, "repo_name": "ylbian/robot-d", "id": "cd5cb8263adaad5378c4542f0c876b2cfc482092", "size": "1400", "binary": fa...
""" ================================================== Automatic Relevance Determination Regression (ARD) ================================================== Fit regression model with :ref:`bayesian_ridge_regression`. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shifted ...
{ "content_hash": "86ad39071a52a1f3cd8838b05f113ae1", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 80, "avg_line_length": 31.135802469135804, "alnum_prop": 0.6324345757335448, "repo_name": "ominux/scikit-learn", "id": "c0610210f88305f0e0797c8f85dd1598d1151dd4", "size": "...
""" Provides caparg version information. """ # This file is auto-generated! Do not edit! # Use `python -m incremental.update caparg` to change this file. from incremental import Version __version__ = Version('caparg', 17, 4, 0) __all__ = ["__version__"]
{ "content_hash": "1916aebaafa518d5002ca87d91f79c85", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 64, "avg_line_length": 23.363636363636363, "alnum_prop": 0.6809338521400778, "repo_name": "moshez/caparg", "id": "cb8a30435d9e34452d816bb0368641754c5cbfc4", "size": "257", ...
import logging import sys from datetime import datetime from django.conf import settings from django.views.debug import technical_500_response from django.http import HttpResponseRedirect, HttpResponse from npactweb import MissingFileError, ImmediateHttpResponseException, \ RedirectException logger = logging.get...
{ "content_hash": "b5bf157fab3e76ace293af95f223c133", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 79, "avg_line_length": 36.78181818181818, "alnum_prop": 0.6183885318833415, "repo_name": "victor-lin/npact", "id": "68d14799178a9d28b18604071de1844b635dc1d7", "size": "2023...
import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) # Test generated documentation of attributes, elements, and classes import pyxb.binding.generate import pyxb.binding.datatypes as xs import pyxb.binding.basis import pyxb.utils.domutils from pyxb.utils import six imp...
{ "content_hash": "5e8b694aa2a608be4ccb813ba5580c86", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 135, "avg_line_length": 36.523809523809526, "alnum_prop": 0.7066492829204694, "repo_name": "CantemoInternal/pyxb", "id": "d11723ef77813a91739e426dca732141d1ccf515", "size"...
from unittest.mock import patch from django.core.cache import cache from django.db import connection from django.test import TestCase from explorer.app_settings import EXPLORER_DEFAULT_CONNECTION as CONN from explorer import schema class TestSchemaInfo(TestCase): def setUp(self): cache.clear() @pa...
{ "content_hash": "9fd5c9a1fb56c10455677abc791f046d", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 74, "avg_line_length": 37.89772727272727, "alnum_prop": 0.64047976011994, "repo_name": "groveco/django-sql-explorer", "id": "73d1f43aa0c29431c5dcdcb38ea31a7c0746bd7d", "siz...
import unittest2 as unittest from mocker import Mocker from zope.component import getUtility from zope.component import getMultiAdapter from zope.interface import alsoProvides from plone.registry.interfaces import IRegistry from plone.app.testing import setRoles from plone.app.testing import TEST_USER_ID from z3c.form....
{ "content_hash": "b4d426a72caac430e52f77f8f9d14f7e", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 246, "avg_line_length": 38.056338028169016, "alnum_prop": 0.6352701702442635, "repo_name": "chrigl/docker-library", "id": "51d1183abcfd38aea8a7005f3f0cd4fc9d7c22a0", "size...
import mock import prawdditions.patch import pytest from .. import IntegrationTest class TestPrawdditionWikiPage(IntegrationTest): @mock.patch("time.sleep", return_value=None) def test_update__no_conflict(self, _): prawdditions.patch.patch() subreddit = self.reddit.subreddit(pytest.placeholde...
{ "content_hash": "7706bbae67a553db89b1b7462d79be2e", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 77, "avg_line_length": 32.73684210526316, "alnum_prop": 0.6181672025723473, "repo_name": "praw-dev/prawdditions", "id": "09339a227000adb58aa4d1d7e7079475b9b26385", "size": ...
"""Helpers to help coordinate updates.""" from __future__ import annotations import asyncio from collections.abc import Awaitable from datetime import datetime, timedelta import logging from time import monotonic from typing import Callable, Generic, TypeVar import urllib.error import aiohttp import requests from ho...
{ "content_hash": "add2588df1295190afa20f8d8c1679d1", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 87, "avg_line_length": 34.294642857142854, "alnum_prop": 0.5957649917556191, "repo_name": "FreekingDean/home-assistant", "id": "2203ab240ef570962932c057624a245a9f36568b", ...
from __future__ import absolute_import from future.utils import PY3 if PY3: from reprlib import * else: __future_module__ = True from repr import *
{ "content_hash": "a1d778ade82a6f2a076de7d539cb2acd", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 38, "avg_line_length": 21.125, "alnum_prop": 0.650887573964497, "repo_name": "noisemaster/AdamTestBot", "id": "0a40eb09424575d4b756b08c4af4982a6cf5a071", "size": "169", "b...
from django.utils.translation import gettext_lazy as _ from shop.models.delivery import BaseDelivery class Delivery(BaseDelivery): """Default materialized model for OrderShipping""" class Meta(BaseDelivery.Meta): verbose_name = _("Delivery") verbose_name_plural = _("Deliveries")
{ "content_hash": "88e042639baa35ddf9402d2c335236f5", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 54, "avg_line_length": 34, "alnum_prop": 0.7222222222222222, "repo_name": "awesto/django-shop", "id": "54b532b5a1f5d8609cd458809e16b0a06e9814b0", "size": "306", "binary": ...
import json import logging logger = logging.getLogger(__name__) def load_encoded_json(encoded_data): """ Args: encoded_data (str): Encoded JSON data Returns: data (dict): Dictionary of decoded JSON content """ # TODO(joshblum): grep around the code base and use this fu...
{ "content_hash": "44ca3a2ddc384f01ce757812e25beb64", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 78, "avg_line_length": 25.956521739130434, "alnum_prop": 0.6147403685092128, "repo_name": "b12io/orchestra", "id": "8dcb59fd949b72017c8dcaf149f67bcad31c3055", "size": "597"...
from runner.koan import * class AboutGenerators(Koan): def test_generating_values_on_the_fly(self): result = list() bacon_generator = (n + ' bacon' for \ n in ['crunchy', 'veggie', 'danish']) for bacon in bacon_generator: result.append(bacon) self.asser...
{ "content_hash": "09581858db11e793341d9636f469271c", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 92, "avg_line_length": 33.74242424242424, "alnum_prop": 0.5541086663673103, "repo_name": "Turivniy/Python_koans", "id": "5c4b9242d8a5fb17e9fa433a4d1b6c7ca8b8c9df", "size":...
import logging import re from fabric.api import execute, hide, sudo RING_TYPES = ['account', 'container', 'object'] _host_lshw_output = {} LOG = logging.getLogger(__name__) def _parse_lshw_output(output, blockdev): disks = re.split('\s*\*', output.strip()) alldisks = [] for disk in disks: d = ...
{ "content_hash": "fe4e07218e0922f02025f0da5905e9ac", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 74, "avg_line_length": 35.56382978723404, "alnum_prop": 0.48818426562967393, "repo_name": "blueboxgroup/swifttool", "id": "451338938553073a64dbddeae154fd5f550a3034", "size"...
import pygame import time as timer import socket import sys #INITILIZE WINDOW AND CONSOLE pygame.init() for x in range(0, 20): print " " print(" ____ _ ____ \n| _ \ ___ _ __ ___ ___ | |_ ___ / ___|__ _ _ __ \n| |_) / _ \ '_ ` _ \ / _ \| __/ _ \ | | / _` | '__|\n| _ ...
{ "content_hash": "79f842dbeef3d23ba5f1078a75d3dea9", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 284, "avg_line_length": 28.193693693693692, "alnum_prop": 0.5230867550726953, "repo_name": "ComputerCandy/PiPyBot", "id": "876b3b5a8dbe5a9b9ba0c34ef9dfbd174610bfba", "size...
""" CacheManager provides encapsulation to the caching mechanism used in GGRC for resource collection. """ from cache import all_cache_entries, all_mapping_entries class CacheManager: """Cache manager provides encapsulation to caching mechanism such as Memcache. Attributes: cache: Ordered dictiona...
{ "content_hash": "c240f8bc5ffe0092217c6c703ca0ffc8", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 79, "avg_line_length": 31.11, "alnum_prop": 0.660559305689489, "repo_name": "edofic/ggrc-core", "id": "18156b846d6741c988d9e6eed4322413784d6344", "size": "6336", "binary...
from __future__ import absolute_import import xml.etree.ElementTree as ET from flask import request, current_app, abort, flash from sqlalchemy.orm.exc import NoResultFound from flask_wtf import Form from flask_login import current_user from oauthlib.oauth2 import OAuth2Error from .oauth import OAuthMethod, OAuthUser ...
{ "content_hash": "e66e4191071d73208d3a54295a8c819d", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 84, "avg_line_length": 38.82634730538922, "alnum_prop": 0.5780382479950648, "repo_name": "paxswill/evesrp", "id": "e7672e502a2bf145b7eee3fa65285c346d929a1a", "size": "6484...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.db.models import Q from django.utils import timezone from django.utils.functional import cached_property from django.utils.encoding import python_2_unicode_compatible from django.utils.translati...
{ "content_hash": "ea36e525f0602e569338a6f0da93c65c", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 79, "avg_line_length": 38.6426116838488, "alnum_prop": 0.5873721654068474, "repo_name": "KnowNo/reviewboard", "id": "832783582655d29e1c1ebb96190486dbd6170724", "size": "11...
from .resource import Resource class ApplicationGatewayFirewallRuleSet(Resource): """A web application firewall rule set. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :param id: Resou...
{ "content_hash": "6b6ee10c43239132ef2cd55a4e7df99a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 175, "avg_line_length": 40.596774193548384, "alnum_prop": 0.6324990067540723, "repo_name": "lmazuel/azure-sdk-for-python", "id": "5df851b1412d1977be4d2971b524abc3635f7165", ...
from unittest import TestCase import mox import os import ConfigParser import random import shutil from nappingcat import config class TestOfConfig(TestCase): def setUp(self): self.mox = mox.Mox() self.filename = 'tests/.%d.conf' % random.randint(1,100) def tearDown(self): self.mox.Uns...
{ "content_hash": "567aa11ecbe3b33bdd3f9f2ae91c2da5", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 71, "avg_line_length": 27.653061224489797, "alnum_prop": 0.6302583025830258, "repo_name": "chrisdickinson/nappingcat", "id": "2a0274945f072934fb14909174015747ed66d9ea", "si...
import pytest import unittest from modules.sfp_talosintel import sfp_talosintel from sflib import SpiderFoot @pytest.mark.usefixtures class TestModuleTalosintel(unittest.TestCase): def test_opts(self): module = sfp_talosintel() self.assertEqual(len(module.opts), len(module.optdescs)) def te...
{ "content_hash": "b664ff85023c66f9cd41af6959779766", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 64, "avg_line_length": 28.73076923076923, "alnum_prop": 0.7001338688085676, "repo_name": "smicallef/spiderfoot", "id": "10a888ca5ecc32bd0df7a50277bede65a5d0bd00", "size": "...
"""Module for testing the add dns environment command.""" import unittest if __name__ == "__main__": import utils utils.import_depends() from brokertest import TestBrokerCommand class TestUpdateDnsEnvironment(TestBrokerCommand): def test_100_update_comments(self): self.noouttest(["update_dns_e...
{ "content_hash": "eac650c962d15b30a79abcd94cb132b9", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 81, "avg_line_length": 37.41463414634146, "alnum_prop": 0.6323337679269883, "repo_name": "quattor/aquilon", "id": "305a3e69dfa6b0ef48523bc81b907152953b7f09", "size": "2249"...
import pytest import netmiko import time from DEVICE_CREDS import * def setup_module(module): module.EXPECTED_RESPONSES = { 'base_prompt' : 'root@pynet-jnpr-srx1', 'router_prompt' : 'root@pynet-jnpr-srx1>', 'router_conf_mode' : 'root@pynet-jnpr-srx1#', 'interface_ip' ...
{ "content_hash": "8d09847d4d95c18c5f3ae8b5c5bac8bf", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 97, "avg_line_length": 25.91304347826087, "alnum_prop": 0.6669463087248322, "repo_name": "nvoron23/netmiko", "id": "3d735c139db1753984fbaf369ded9f6d9d2e313b", "size": "2407...
from os.path import expanduser HOME = expanduser('~') ROOT_PATH = HOME + '/Dropbox/Projeto/Entropia/Fidelidade' TWITTER_DATA_PATH = HOME + "/Twitter.Info" FRIENDS_INFO_PATH = TWITTER_DATA_PATH + '/Friends.Info' INTERACTIONS_INFO_PATH = TWITTER_DATA_PATH + '/Interactions.Info' FILE_NAMES = ['interacoesLikes', 'int...
{ "content_hash": "f33b41e9e3276893b1df99012ebf6ca9", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 120, "avg_line_length": 42.05263157894737, "alnum_prop": 0.737171464330413, "repo_name": "jblupus/PyLoyaltyProject", "id": "4f0fcd45ccfaaa60245cc0f68536214c93b23f8e", "size...
from openerp.osv import fields, osv class res_company(osv.osv): _inherit = "res.company" _columns = { 'expects_chart_of_accounts': fields.boolean('Expects a Chart of Accounts'), 'tax_calculation_rounding_method': fields.selection([ ('round_per_line', 'Round per Line'), (...
{ "content_hash": "3bdbe4b78e519dbb2c7af6f717359a1b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 610, "avg_line_length": 59.645161290322584, "alnum_prop": 0.7133585722011898, "repo_name": "ntiufalara/openerp7", "id": "a4624ae5ad5ef247281c2058b2c723b9ef74c4d7", "size": ...
""" Copyright (c) 2008, appengine-utilities project 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 of conditions and ...
{ "content_hash": "54667f5814e7923cf82c855365d519ac", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 83, "avg_line_length": 38.64957264957265, "alnum_prop": 0.6437417072091994, "repo_name": "yesudeep/pyebs", "id": "ebab4933ff4d193aeb6204e280e8a5c1d36e11d3", "size": "4522"...
import sys import json import datetime #NOTE: NEVER TESTED!!! US_CHAR = 0x1F; try: args = sys.argv[1] incomming = args[0].split(us+"",2); if(incomming[0] == "GetTime"): now = datetime.datetime.now() time = "%d:%d" % (now.hour, now.minute) print time elif(incomming[0] == "FoundPerson"): now = datetime.dat...
{ "content_hash": "4160e9b6c918c014e388046f4f898ea3", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 41, "avg_line_length": 17.5, "alnum_prop": 0.65, "repo_name": "kammce/STARC", "id": "d6d9cbb8c60df5d70fac709a496f6b814de8d5cf", "size": "420", "binary": false, "copies"...
""" Common utilities for OpenStack """ import sys import binascii import os import datetime from libcloud.utils.py3 import httplib from libcloud.utils.iso8601 import parse_date from libcloud.common.base import ConnectionUserAndKey, Response from libcloud.compute.types import (LibcloudError, InvalidCredsError, ...
{ "content_hash": "3304218f34ed212b30ebaba977c3eebd", "timestamp": "", "source": "github", "line_count": 649, "max_line_length": 93, "avg_line_length": 35.8828967642527, "alnum_prop": 0.5737718996908279, "repo_name": "IsCoolEntertainment/debpkg_libcloud", "id": "ba1425a177604f131318e62e2a979b3af544242...
from django.db import models from accounts.models import Profile from courses.models import Course class Article(models.Model): title = models.CharField(max_length=100) content = models.TextField() source_url = models.URLField(null=True) created_by = models.ManyToManyField(Profile) created_at = m...
{ "content_hash": "4659ec0f2a39a594f0527f6470ebc5fa", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 73, "avg_line_length": 30.734177215189874, "alnum_prop": 0.6911037891268533, "repo_name": "lockhawksp/beethoven", "id": "d58734cf61037f66a31da090f52f896e5d8f85ae", "size": ...
import itertools from oslo_log import log as logging from webtest import TestApp from designate.api import admin as admin_api from designate.api import middleware from designate.tests.test_api import ApiTestCase LOG = logging.getLogger(__name__) INVALID_ID = [ '2fdadfb1-cf96-4259-ac6b-bb7b6d2ff98g', '2fda...
{ "content_hash": "ef8de6bd9edaa7a23039b1e8d1dbcc03", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 79, "avg_line_length": 33.48148148148148, "alnum_prop": 0.5480088495575222, "repo_name": "openstack/designate", "id": "82bbec2949ff7ad51647b15b5b457f5fc51bc4cf", "size": "...
import numpy as np import copy from sklearn.base import BaseEstimator from scipy.ndimage import rotate def load_images(filenames): '''Expects filenames to be a list of .fits file locations''' from astropy.io.fits import getdata return [ normalized_positive_image(getdata(filename)) for filename in filenam...
{ "content_hash": "b2fcf1d0627103798e26eef9ce06b20a", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 100, "avg_line_length": 31.079646017699115, "alnum_prop": 0.6007972665148064, "repo_name": "cavestruz/StrongCNN", "id": "e172035a5423479f6478ab697d8605f08795f7cc", "size":...
from decimal import * import getpass import math import os import os.path import platform import sys import time from jsonrpc import ServiceProxy, json BASE_FEE=Decimal("0.001") def check_json_precision(): """Make sure json library being used does not lose precision converting SRI values""" n = Decimal("20000...
{ "content_hash": "5f46f0de658ca657f717f9571634c0c1", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 111, "avg_line_length": 38.24603174603175, "alnum_prop": 0.6140278065988795, "repo_name": "CoinAge-DAO/solari", "id": "9d803027cde2285be92b41dd25130e6ee8fe3346", "size": "...
import os from shutil import rmtree from urlparse import urlparse from uuid import uuid4 from django.contrib.auth.models import User from django.contrib.auth.tokens import default_token_generator from django.contrib.contenttypes.models import ContentType from django.core import mail from django.core.urlresolvers impor...
{ "content_hash": "73f0449681258c7c00a25c3ab13141fe", "timestamp": "", "source": "github", "line_count": 532, "max_line_length": 79, "avg_line_length": 42.578947368421055, "alnum_prop": 0.6130584495850256, "repo_name": "westinedu/newertrends", "id": "c8b798cbd49c387aeb0ed3855fd99ec7ce8e6540", "size"...
from enum import Enum, unique from django.db import models from django.utils.translation import ugettext_lazy as _ @unique class Fields(Enum): ENERGY = 1 MARITIME_FISHERIES = 2 HEALTH = 3 DEFENSE = 4 ENVIRONMENT = 5 SOCIAL = 6 EDUCATION = 7 TECHNOLOGY = 8 CULTURE_AND_LANGUAGE = 9 ...
{ "content_hash": "435a4eeec90886868351e821ea34c2b2", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 110, "avg_line_length": 36.11290322580645, "alnum_prop": 0.6158999553372041, "repo_name": "SeiryuZ/magnet", "id": "cbc3f20f02939c0f5cd8f3f415e559180ed7509a", "size": "2239"...
from st2common import log as logging from st2common.constants.keyvalue import SYSTEM_SCOPE, FULL_SYSTEM_SCOPE from st2common.constants.keyvalue import USER_SCOPE, FULL_USER_SCOPE from st2common.constants.keyvalue import ALLOWED_SCOPES from st2common.constants.keyvalue import DATASTORE_KEY_SEPARATOR from st2common.exce...
{ "content_hash": "c6dbac8c1e528b04fbd76e45042dd770", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 96, "avg_line_length": 32.747191011235955, "alnum_prop": 0.6170869788986104, "repo_name": "lakshmi-kannan/st2", "id": "be443eda56812339a80ff15a2d26de7c004e79ba", "size": "...
"""This module provides functions to generate an ec2stack configuration file. """ import os import argparse from ConfigParser import SafeConfigParser def main(): """ Entry point into the configuration application. """ config_folder = _create_config_folder() _create_config_file(config_folder) ...
{ "content_hash": "33cf11aa9e8b52b39ba0fb17a1153cde", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 108, "avg_line_length": 28.99283154121864, "alnum_prop": 0.6515020398071455, "repo_name": "terbolous/cloudstack-ec2stack", "id": "0c7f9d40a9320ef5b8203ca999ab7afcef3942c3", ...
import json import sys def write_gender_cont_person(): try: f_json = open('data_extracted/person_lookup.json','r',encoding="utf8") except IOError: print('Need to create person_lookup.json first. (Execute write_personlist_by_type.py)') # Load person lookup created by write_personlist_by_type.py (Maps: *page of ...
{ "content_hash": "74d4694559a668dd01cae7ef1d8d3846", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 112, "avg_line_length": 30.261904761904763, "alnum_prop": 0.7025963808025177, "repo_name": "kandy-koblenz/people-networks", "id": "fe8ceb1dc831455893c4e8ccebee6734d467c0f7", ...
import RPi.GPIO as GPIO import time class Alexa(object): def __init__(self, port): self.port = port GPIO.setmode(GPIO.BCM) GPIO.setup(self.port, GPIO.OUT) GPIO.output(self.port, GPIO.HIGH) self.on_state = GPIO.HIGH self.off_state = not self.on_state def set_on(se...
{ "content_hash": "bc8c25e799a2bf83024322ec8c75f554", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 54, "avg_line_length": 23.228571428571428, "alnum_prop": 0.5547355473554736, "repo_name": "eddieruano/SentinelGreen", "id": "0ce8a84e463d0368cfe7e26e891a3ffde0665953", "siz...
from unittest import TestCase, SkipTest try: from unittest.mock import Mock except: from mock import Mock import uuid from holoviews import Tiles try: import plotly.graph_objs as go except: go = None from holoviews.streams import ( BoundsXY, BoundsX, BoundsY, RangeXY, RangeX, RangeY, Selection1D ...
{ "content_hash": "6e3ae9dff5281975d3dea9544d563c11", "timestamp": "", "source": "github", "line_count": 648, "max_line_length": 87, "avg_line_length": 37.08179012345679, "alnum_prop": 0.5467143867826376, "repo_name": "ioam/holoviews", "id": "df614f4e8ee55d07f375864a218628c41ce721f5", "size": "24029...
""" usage: python nbmerge.py A.ipynb B.ipynb C.ipynb > merged.ipynb """ import io import os import sys from IPython.nbformat import current def merge_notebooks(filenames): merged = None for fname in filenames: with io.open(fname, 'r', encoding='utf-8') as f: nb = current.read(f, 'json') ...
{ "content_hash": "f902f2144fe3fc5fd4f2c1add43137fc", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 69, "avg_line_length": 22.923076923076923, "alnum_prop": 0.6140939597315436, "repo_name": "zaqwes8811/micro-apps", "id": "ba01784e6208fa140ab72eda9efe7cd6fd654820", "size":...
from __future__ import absolute_import from __future__ import print_function from __future__ import division from utils import get_all_files import codecs import re TAG_DELIMITER = ';' def filter_tags(tags, regex): tags = set(tags) filtered_tags = [] for tag in tags: if not regex.search(tag): ...
{ "content_hash": "836e857f474787cd782427efb1b066f6", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 105, "avg_line_length": 33.515625, "alnum_prop": 0.5603729603729604, "repo_name": "osmanbaskaya/coarse-wsd", "id": "5f0054ae9c7191a6cce95615c1463d905fa1c1cf", "size": "2145...
import sys from oslo_config import cfg from oslo_upgradecheck import common_checks from oslo_upgradecheck import upgradecheck from stevedore import driver as stevedore_driver # Need to import to load config from octavia.common import config # noqa: F401 pylint: disable=unused-import from octavia.common import consta...
{ "content_hash": "f6aa150e5c04b18c2223554306e17061", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 43.68695652173913, "alnum_prop": 0.5732484076433121, "repo_name": "openstack/octavia", "id": "f98d51dad4a7867933bee961d0ee4903572f95d8", "size": "56...
"""Checkpointing utilities.""" import os import pickle from absl import logging import tensorflow as tf class _PyWrapper(tf.train.experimental.PythonState): """Wraps a Python object for storage in an object-based checkpoint.""" def __init__(self, obj): """Specify an object to wrap. Args: obj: Th...
{ "content_hash": "95b5e1942b9e302d3045c8e904a41787", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 80, "avg_line_length": 33.14685314685315, "alnum_prop": 0.6822784810126582, "repo_name": "deepmind/dm_c19_modelling", "id": "036b3f3c08d8de9ebb435692f64e85d947c57f0b", "si...
from mssqlrelayclient import MSSQLRelayClient from smbrelayclient import SMBRelayClient from ldaprelayclient import LDAPRelayClient from httprelayclient import HTTPRelayClient from imaprelayclient import IMAPRelayClient
{ "content_hash": "976cbaa16eb4a3a5cde2b5f41002f7fd", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 45, "avg_line_length": 43.8, "alnum_prop": 0.91324200913242, "repo_name": "tholum/PiBunny", "id": "b55d6edbf8736dc67821e59a403e0917e7ba7a32", "size": "219", "binary": fals...
import uuid from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_service import service from oslo_utils import timeutils import requests import six from six.moves.urllib import parse as urlparse from conveyor.conveyorheat.common import crypt from conveyor.conveyorheat.common import e...
{ "content_hash": "65bb6f8c53dc3e88b4636e6150296f44", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 79, "avg_line_length": 41.43604651162791, "alnum_prop": 0.5952013469903185, "repo_name": "Hybrid-Cloud/conveyor", "id": "5edfbb1d9f8de024e5851845ab29551c80c2eb31", "size":...
import redis from ast import literal_eval from . import RoundRobinDb, range_func class RedisRoundRobinDb(RoundRobinDb): def __init__(self, redis_db): server,port=redis_db.split(":") port = int(port) self.db = redis.StrictRedis(host=server, port=port, db=0) self._init_db() s...
{ "content_hash": "82b2460936770871b25aa0c8c1c73343", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 89, "avg_line_length": 37.017391304347825, "alnum_prop": 0.5759924829692271, "repo_name": "adeadman/rrd-tool", "id": "65d67b022f49d48324b45a771d03859ed682b051", "size": "4...
from . import AWSObject from . import AWSProperty class Target(AWSProperty): props = { 'TargetAddress': (basestring, False), 'TargetType': (basestring, False), } class NotificationRule(AWSObject): resource_type = "AWS::CodeStarNotifications::NotificationRule" props = { 'Deta...
{ "content_hash": "38e7c553d4e3c9103c8336fccb54d1e7", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 66, "avg_line_length": 25.391304347826086, "alnum_prop": 0.5958904109589042, "repo_name": "ikben/troposphere", "id": "a1e27ca4d59e223d01a146ae0ef7b69e88739db5", "size": "79...
''' Created on May 17, 2013 Example for creating LCIO events and filling them with MCParticles and SimTrackerHits. @author: <a href="mailto:christian.grefe@cern.ch">Christian Grefe</a> ''' from __future__ import absolute_import, unicode_literals from __future__ import print_function, division from pyLCIO import EVEN...
{ "content_hash": "118e6e73f7a41a4e09f2b895ce03f2bf", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 98, "avg_line_length": 36.621212121212125, "alnum_prop": 0.6263963591228796, "repo_name": "petricm/LCIO", "id": "70b0fd3b2ec09801df05873d63feb9f7944b922b", "size": "4834",...
from __future__ import unicode_literals from django.apps import AppConfig class PedidosConfig(AppConfig): name = 'pedidos'
{ "content_hash": "4da4c0178e2af6b5cc8237702a92291c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 18.571428571428573, "alnum_prop": 0.7538461538461538, "repo_name": "vallemrv/tpvB3", "id": "acc2041c333d009c6e2880319956dcf323279ab4", "size": "130", ...
import sys import gi import time gi.require_version("Tcam", "1.0") gi.require_version("Gst", "1.0") gi.require_version("GLib", "2.0") from gi.repository import Tcam, Gst, GLib def main(): Gst.init(sys.argv) # init gstreamer # this line sets the gstreamer default logging level # it can be removed in n...
{ "content_hash": "5c8020274f9f5561e1193021f5aab36f", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 100, "avg_line_length": 28.608695652173914, "alnum_prop": 0.6312056737588653, "repo_name": "TheImagingSource/tiscamera", "id": "187b67a41409888872ce14c76b3e5150493d6f20", "...
from django.contrib.admin.templatetags.admin_static import static from django.contrib.admin.widgets import FilteredSelectMultiple from django.utils.safestring import mark_safe from .settings import WIDGET_STORAGE_ID class OrderedFilteredSelectMultiple(FilteredSelectMultiple): @property def media(self): ...
{ "content_hash": "cac1f263a8cc3142c5c27e597f22b960", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 87, "avg_line_length": 31.955555555555556, "alnum_prop": 0.5403337969401947, "repo_name": "jnovinger/django-ordered-m2m", "id": "6dea7be73d2e0090fb4f1483818aca47fddb1daf", ...
from django.conf import settings class InvalidRevision(Exception): pass class VCS(object): ''' Defines the public API for all subclasses ''' repo_clone_dir = settings.REPO_CLONE_DIR def __init__(self, project): self.project = project self.checkout_dir = project.get_checkout...
{ "content_hash": "2f704ef48a9bc4df5723c832ecd1c96a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 60, "avg_line_length": 19.615384615384617, "alnum_prop": 0.6568627450980392, "repo_name": "joealcorn/berth.cc", "id": "f3aef6c3ca3a19fa17e96acd950cceb901d81588", "size": "5...
from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('layout_page', '0001_initial'), ] operations = [ migrations.AddField( model...
{ "content_hash": "06efa213a6f88294c0554a8b0864d337", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 174, "avg_line_length": 33.58974358974359, "alnum_prop": 0.6160305343511451, "repo_name": "ic-labs/django-icekit", "id": "7a7cdc7a2d93ee858655b7f4f9dfeacb2df5c681", "size":...
from ethereum import blocks from ethereum.db import DB from ethereum.config import Env from pyethapp.utils import merge_dict from pyethapp.utils import update_config_from_genesis_json import pyethapp.config as konfig from pyethapp.profiles import PROFILES def test_genesis(): for profile in ['frontier']: # fixme ...
{ "content_hash": "e9af9af9793518872658c33bba0dc8de", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 93, "avg_line_length": 30.428571428571427, "alnum_prop": 0.6497652582159624, "repo_name": "vaporry/pyethapp", "id": "da7791a6ed38f7c4f335f54f2016e46a849dca46", "size": "106...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class NextVenue(Choreography): def __init__(self, temboo_session): """ Create a new...
{ "content_hash": "d0e781c0952feb8d07deaf36cc319940", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 205, "avg_line_length": 44.38157894736842, "alnum_prop": 0.6999703528016602, "repo_name": "jordanemedlock/psychtruths", "id": "4c3885bf48297e13e4659d7f9188d0346d83c8a0", "s...
from canari.maltego.utils import debug from canari.framework import configure from canari.maltego.entities import Phrase from canari.maltego.message import Label, UIMessage from common.entities import Comment, Actor, Case, CoursesOfAction, Incident, Indicator, TTP from common.client import search, encode_to_utf8, lower...
{ "content_hash": "3a8e02b883a1d23ff8b8a89cb67b020b", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 108, "avg_line_length": 40.95505617977528, "alnum_prop": 0.5486968449931413, "repo_name": "ThreatCentral/blackberries", "id": "49d94660ccad9ff99f14ab07f9e89f62a85c7380", "s...
""" Name: 'Nexus Buddy 2 (.br2)...' Blender: 249 Group: 'Export' Tooltip: 'Export to Nexus Buddy 2 format (.br2).' """ __author__ = ["Deliverator"] __url__ = ("") __version__ = "0.1" __bpydoc__ = """\ Nexus Buddy 2 Import """ ###################################################### # Importing modules ################...
{ "content_hash": "e95ab24b80ca084717ab3e45ac4a130a", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 190, "avg_line_length": 34.95, "alnum_prop": 0.598838677101742, "repo_name": "venetianthief/civ-dbs", "id": "d6e7fd076e6554f003273a54409276153f75fc04", "size": "11905", ...
from candidate.models import CandidateCampaign from config.base import get_environment_variable from datetime import date, datetime from django.db import models from django.db.models import F, Q, Count from election.models import ElectionManager from exception.models import handle_exception, handle_record_found_more_th...
{ "content_hash": "c8a7d7446c62c7ca7b5c56dab4c396c2", "timestamp": "", "source": "github", "line_count": 3691, "max_line_length": 120, "avg_line_length": 52.931725819561095, "alnum_prop": 0.5746451622809936, "repo_name": "jainanisha90/WeVoteServer", "id": "15b2b1f397ccb47dc10604483bec467944e34cc0", ...
"""Deprecate AWS specific Account fields (role_name, number, s3_name) Account.number is being replaced with Account.identifier. Revision ID: 55725cc4bf25 Revises: 1c847ae1209a Create Date: 2017-02-16 13:41:08.162000 """ # revision identifiers, used by Alembic. revision = '55725cc4bf25' down_revision = '1c847ae1209a...
{ "content_hash": "0f793e2ada2f2815c59ef09dbeb63f12", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 112, "avg_line_length": 30.62162162162162, "alnum_prop": 0.6796116504854369, "repo_name": "stackArmor/security_monkey", "id": "c0e4fe48c6fa71f9db7674cda38ac9b04c7cc17b", "...
from __future__ import print_function import subprocess import os import os.path import re import warnings import textwrap import types import sys import stat # Use the c version of ElementTree, which is faster, if possible: try: from xml.etree import cElementTree as ElementTree except ImportError: from xml.etree impo...
{ "content_hash": "908365eed4dea61793b2102fe2859d28", "timestamp": "", "source": "github", "line_count": 856, "max_line_length": 93, "avg_line_length": 38.48364485981308, "alnum_prop": 0.560135996600085, "repo_name": "jjhuff/fcc-comments", "id": "ed8a6b621c0b7dd79c0b1e26fc051cf0504bb2e8", "size": "3...
"""The match_hostname() function from Python 3.3.3, essential when using SSL.""" import re import sys # ipaddress has been backported to 2.6+ in pypi. If it is installed on the # system, use it to handle IPAddress ServerAltnames (this was added in # python-3.5) otherwise only do DNS matching. This allows # backport...
{ "content_hash": "9930aa710a5ca8a5d7ad1525d03a9d3e", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 80, "avg_line_length": 36.1948051948052, "alnum_prop": 0.6194833153928956, "repo_name": "amisrs/one-eighty", "id": "06538ec6899adc761df2952cf9f2a01c3fe73aca", "size": "557...
'text file write or read' import os #current path file fname='' ls=os.linesep while True: print '$$$$$ please select file operation\n'+'(1)read a text file' print '(2)write to a text file\n'+'(x)exit the op' op=raw_input('select op=') if op=='x': print 'closed' break #read a text file elif op=='1': pr...
{ "content_hash": "ea8dca40ae9abb707592d3bdfc74e1d5", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 67, "avg_line_length": 18.96551724137931, "alnum_prop": 0.6181818181818182, "repo_name": "shenhzou654321/TDDDemo", "id": "33f19de0fea79da9239b13a7be8d661bf2754a04", "size":...
''' he3.db.tools.mappers contains mappers written to work with App Engine MapReduce http://code.google.com/p/appengine-mapreduce/ Created on Jun 27, 2010 @author: Ben Davies, Helium 3 IT Solutions ''' import google.appengine.ext.db as db import mapreduce.operation as op class Mapper (object): '''A stan...
{ "content_hash": "d4909670dd91b6828e36d6eda7603fa4", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 71, "avg_line_length": 26.5, "alnum_prop": 0.6777358490566038, "repo_name": "chartjes/liesitoldmykids", "id": "643436caea6e48bd2debb31e402a8239addacd08", "size": "1325", ...
import pytz from datetime import datetime, timedelta from django.db.models.signals import post_save from django.contrib.auth.models import Group, Permission from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.test.client import Client, RequestFactory from django.utils.timezon...
{ "content_hash": "695ca9ed42aa73378ae5ad493ba90d3b", "timestamp": "", "source": "github", "line_count": 548, "max_line_length": 97, "avg_line_length": 49.32664233576642, "alnum_prop": 0.5802227072620325, "repo_name": "mozilla/remo", "id": "c73ca19739c95a2bfd1052ffc2221684c61d4673", "size": "27031",...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify that we have proper strings like Copyright notices on all the right files in our distributions. Note that this is a source file and packaging test, not a functional test, so the name of this script doesn't end in *Tests.py. """ import fnmatch i...
{ "content_hash": "3bb98bced34cd572121d17a16ddff1b1", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 83, "avg_line_length": 28.59504132231405, "alnum_prop": 0.5332369942196532, "repo_name": "andrewyoung1991/scons", "id": "3288d5f62b7b74d0b65ad04f3a318c57a6448cb2", "size":...
import gc from ilastik.gui.ribbons.ilastikTabBase import IlastikTabBase, TabButton from ilastik.core.dataMgr import PropertyMgr from ilastik.gui.overlayWidget import OverlayWidget from ilastik.gui.iconMgr import ilastikIcons from ilastik.modules.classification.gui.guiThreads import * from ilastik.modules.classific...
{ "content_hash": "81b35b76b28d951ffd2edbae58544db5", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 237, "avg_line_length": 48.06535947712418, "alnum_prop": 0.6694316018493337, "repo_name": "ilastik/ilastik-0.5", "id": "7fed66f036770172b521879e8c6f0bd3782bbe1d", "size": ...
from thrift.Thrift import TType, TMessageType, TException, TApplicationException from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class ErrorType(object): NoError = 0 Server = 1 Network = 2 ...
{ "content_hash": "d94bae7cf9ae4a78e2b7a5b75c1e1e97", "timestamp": "", "source": "github", "line_count": 1159, "max_line_length": 188, "avg_line_length": 31.055220017256257, "alnum_prop": 0.6163976328730586, "repo_name": "longaccess/longaccess-client", "id": "f6efefd88528bc58ae1549a966d87d998f5cf16d",...
import optparse import os import sys from util import build_utils from util import proguard_util def _ParseOptions(args): parser = optparse.OptionParser() build_utils.AddDepfileOption(parser) parser.add_option('--proguard-path', help='Path to the proguard executable.') parser.add_option('...
{ "content_hash": "10b3f9ce492e075178c018d68ff56a78", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 80, "avg_line_length": 32.33802816901409, "alnum_prop": 0.6890243902439024, "repo_name": "wuhengzhi/chromium-crosswalk", "id": "d019350a33ce56bd05c4d051f2757a99630e7c6f", "...
"""The jewish_calendar component.""" import logging from typing import Optional import hdate import voluptuous as vol from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import async_load_platform _LOGGER =...
{ "content_hash": "4ad1a031e69b99e250397186b4c99c37", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 88, "avg_line_length": 34.48571428571429, "alnum_prop": 0.6174399337199669, "repo_name": "tchellomello/home-assistant", "id": "dfde274faa8c910d9c5631cadf398f90c958699b", "...
""" # test_fil2h5 """ import pytest import os import blimpy as bl from tests.data import voyager_fil VOYA_DIR = os.path.dirname(voyager_fil) + "/" def name_case(in_string, out_string): infile = in_string outfile = out_string os.system("cp " + voyager_fil + " " + infile) bl.fil2h5.make_h5_file(infil...
{ "content_hash": "4154f2bc9b4f2f04d26c9066e685752a", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 98, "avg_line_length": 24.861538461538462, "alnum_prop": 0.6262376237623762, "repo_name": "UCBerkeleySETI/blimpy", "id": "9a08710439a1966251fe6756ac42e8b1f6168954", "size":...
from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer import sys from bunch import * import numpy as np import random from sklearn.linear_model import LogisticRegression from nltk.stem import WordNetLemmatizer import re import cPickle def load_unlabele...
{ "content_hash": "0508602d96a3cdb2e15ee0aaba327560", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 76, "avg_line_length": 34.05172413793103, "alnum_prop": 0.6632911392405063, "repo_name": "HazyResearch/dd-genomics", "id": "83b4cf2c6964279ebd9501ca3dd77d7cf7a8cbd5", "size...
""" Zonomi DNS Driver """ from libcloud.common.zonomi import ZonomiConnection, ZonomiResponse from libcloud.common.zonomi import ZonomiException from libcloud.dns.base import DNSDriver, Zone, Record from libcloud.dns.types import ZoneDoesNotExistError, ZoneAlreadyExistsError from libcloud.dns.types import RecordAlread...
{ "content_hash": "d3592449598b657028f78951fea92efd", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 79, "avg_line_length": 31.51212121212121, "alnum_prop": 0.5400519280700067, "repo_name": "ByteInternet/libcloud", "id": "4f0eea0751ea1d80ed28fd58560fbf8297cf08e5", "size":...
import sys # for reading from argv import boto.sqs import boto.sqs.queue from boto.sqs.message import Message from boto.sqs.connection import SQSConnection from boto.exception import SQSError conn = boto.sqs.connect_to_region("eu-west-1", aws_access_key_id='xxIAINXYPLZEZUALDFYQ', aws_secret_access_key='xxfZms2LJR39mi/...
{ "content_hash": "f328ed31feb9b9ba502c5153c9c39707", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 154, "avg_line_length": 35.388888888888886, "alnum_prop": 0.7409733124018838, "repo_name": "mcgettin/dockerLab", "id": "2a6a302fa8bbe6f279568f22e9e156a997e26503", "size": "...
""" rdf tools package """ from .helpers import * from .association import *
{ "content_hash": "a938313a4d6701cf94919e5eadd00a17", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 26, "avg_line_length": 12.833333333333334, "alnum_prop": 0.6883116883116883, "repo_name": "SemanticComputing/rdf_dm", "id": "178ad0fd8f6a67450f8825aeb7857e206733d386", "size...
""" The `Chain` class inherits from `Link` and allow chaining together several applications into a single object. """ from __future__ import absolute_import, division, print_function import sys import os from collections import OrderedDict from fermipy.jobs.utils import is_null, is_not_null from fermipy.jobs.link im...
{ "content_hash": "fe142a0dd7c0e910961271ee0790294a", "timestamp": "", "source": "github", "line_count": 415, "max_line_length": 81, "avg_line_length": 35.93253012048193, "alnum_prop": 0.5519045064377682, "repo_name": "jefemagril/fermipy", "id": "bacccdfafeddbcd8f05fcf23dac9880acb6930d0", "size": "1...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Domain(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "treemap" _path_str = "treemap.domain" _valid_props = {"column", "row", "x", "y"} # colu...
{ "content_hash": "d6ae1d5cb6f434314b26b9c6efd66b7c", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 82, "avg_line_length": 27.806763285024154, "alnum_prop": 0.5062543432939541, "repo_name": "plotly/python-api", "id": "7a49e2974d5f54e8b95ab51a8f075900aa3376b4", "size": "5...
"""\ Test against issue #25. <https://github.com/heuer/cablemap/issues/25> :author: Lars Heuer (heuer[at]semagia.com) :organization: Semagia - <http://www.semagia.com/> :license: BSD license """ from nose.tools import eq_ from cablemap.core import cable_by_id def test_issue25(): cable = cable_by_id('09...
{ "content_hash": "aa390a4e64fd7d89fbc946b0b93f0a63", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 86, "avg_line_length": 28.05, "alnum_prop": 0.6702317290552585, "repo_name": "heuer/cablemap", "id": "4f3ee6fd4f663981c8e2f8a7fbad5dade4da78c0", "size": "729", "binary": ...
from frappe import _ from frappe.utils import get_fullname, now from frappe.model.document import Document from frappe.core.utils import set_timeline_doc import frappe from frappe.query_builder import DocType, Interval from frappe.query_builder.functions import Now from pypika.terms import PseudoColumn class ActivityL...
{ "content_hash": "26f105ccb50b16d26414e1d71e41d159", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 79, "avg_line_length": 29.918367346938776, "alnum_prop": 0.7257844474761255, "repo_name": "almeidapaulopt/frappe", "id": "69565a2c2ad59b832b9e95170d65b8544a2bd54b", "size":...
""" Unit tests for pyspark.sql; additional tests are implemented as doctests in individual modules. """ import os import sys import subprocess import pydoc import shutil import tempfile import pickle import functools import time import datetime import array import ctypes import warnings import py4j from contextlib impo...
{ "content_hash": "4ce96bed8cb6a687ff911d3c454407c2", "timestamp": "", "source": "github", "line_count": 6501, "max_line_length": 100, "avg_line_length": 42.64851561298262, "alnum_prop": 0.5775162484040136, "repo_name": "rekhajoshm/spark", "id": "8e5bc6729dfa44be94a978b9e8d0025d0a011ff0", "size": "2...
"""Common classes and functions for zones.""" from googlecloudsdk.calliope import exceptions as calliope_exceptions from googlecloudsdk.compute.lib import request_helper from googlecloudsdk.compute.lib import utils from googlecloudsdk.core.util import console_io class ZoneResourceFetcher(object): """Mixin class for...
{ "content_hash": "634bb0700b6aaf245d177311c4e03781", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 80, "avg_line_length": 37.824742268041234, "alnum_prop": 0.6009811937857726, "repo_name": "ychen820/microblog", "id": "0143a807af7c28e2e5abdcfe78f8b34e8b1b34b7", "size": "3...
from bitstream import * import types_python_primitives import types_numpy
{ "content_hash": "21e21693a959ad1b213f472aca151927", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 30, "avg_line_length": 24.666666666666668, "alnum_prop": 0.8378378378378378, "repo_name": "devast8a/bitstream_python", "id": "04cc1c4ea7eddf281db797b317f9a62bf677dac7", "siz...
"""The test for light device automation.""" from datetime import timedelta import pytest import homeassistant.components.automation as automation from homeassistant.components.device_automation import DeviceAutomationType from homeassistant.components.light import DOMAIN from homeassistant.const import CONF_PLATFORM,...
{ "content_hash": "c5f088a25b25e88d8794e15053fbfcff", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 87, "avg_line_length": 35.204402515723274, "alnum_prop": 0.4884323358642251, "repo_name": "mezz64/home-assistant", "id": "6cedb51f661261673277b4024156808833359d16", "size"...
import json import sys class TwOrder: # Default Values conf = { 'user': '', 'query': '', 'since': '', 'until': '', 'max_tweets': 0, 'max_comments': 0, 'bufferlength': 0, 'near': '', 'within': '', 'lang': 'en' } @staticmet...
{ "content_hash": "ad00f121529c268dc9a4ff4011f7bd00", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 115, "avg_line_length": 34.09615384615385, "alnum_prop": 0.4873096446700508, "repo_name": "mutux/TwEater", "id": "3124715f9a5ae0d0c660b4edea2bf42b07ca7ee5", "size": "1797",...