text
stringlengths
4
1.02M
meta
dict
__all__ = ('EVENT_SCHEDULER_START', 'EVENT_SCHEDULER_SHUTDOWN', 'EVENT_JOBSTORE_ADDED', 'EVENT_JOBSTORE_REMOVED', 'EVENT_JOBSTORE_JOB_ADDED', 'EVENT_JOBSTORE_JOB_REMOVED', 'EVENT_JOB_EXECUTED', 'EVENT_JOB_ERROR', 'EVENT_JOB_MISSED', 'EVENT_ALL', 'SchedulerEvent', 'JobStoreEvent', 'JobEvent') EVE...
{ "content_hash": "95d85fdb819d5edb35fca4f137c21323", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 113, "avg_line_length": 40.885245901639344, "alnum_prop": 0.6603849238171612, "repo_name": "yonglehou/apscheduler", "id": "2c262d412675e651acb5b449861332457ba3fa6a", "size"...
import re import pep8 import six # Guidelines for writing new hacking checks # # - Use only for Neutron specific tests. OpenStack general tests # should be submitted to the common 'hacking' module. # - Pick numbers in the range N3xx. Find the current test with # the highest allocated number and then pick the ...
{ "content_hash": "19b19ae41401393f749cfbc702b39ff2", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 79, "avg_line_length": 36.851851851851855, "alnum_prop": 0.5989949748743718, "repo_name": "dims/neutron", "id": "af72744f5ab27122628cc7453a9c973daa16d4c1", "size": "9546",...
from setuptools import setup, find_packages __author__ = 'Abraham Othman' __copyright__ = 'Copyright 2018, Abraham Othman' __version__ = '1.6.0' __maintainer__ = 'Abraham Othman' __email__ = 'abrahamo@wharton.upenn.edu' long_description = open('README.md').read() install_requires = [ 'numpy', 'cvxpy>=1.0.0', ...
{ "content_hash": "a54134606e43cf4222012533de256bff", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 78, "avg_line_length": 26.583333333333332, "alnum_prop": 0.658307210031348, "repo_name": "aothman/hiscore", "id": "46fde4235475e624217b5d347caa9aab59afe84b", "size": "957",...
import argparse import ipaddress import json import logging import os import random import socket import subprocess import sys from contextlib import contextmanager from typing import Dict, Generator, List, Optional, Union from kazoo.client import KazooClient from kazoo.exceptions import ConnectionLoss, LockTimeout, S...
{ "content_hash": "2f8344c0735798d0fd9184d8187ca103", "timestamp": "", "source": "github", "line_count": 799, "max_line_length": 124, "avg_line_length": 36.26157697121402, "alnum_prop": 0.5852000138059573, "repo_name": "dcos/dcos", "id": "6bdb39c898a39247e571ab9883a05d3bf1190664", "size": "28996", ...
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.config import ConfigValidationError from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from txircd.utils import timestampStringFromTime, timestampStringFromTimeSeconds, trimStringToByteLength from zope.int...
{ "content_hash": "be9d7db610c59a55cbf8a4df5e73fdf2", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 188, "avg_line_length": 39.41379310344828, "alnum_prop": 0.7184601924759405, "repo_name": "Heufneutje/txircd", "id": "75407afc74a3db181c1df1f6e0d7d6697236dd74", "size": "5...
"""Tests for workflow specific imports.""" from datetime import date from os.path import abspath from os.path import dirname from os.path import join from integration.ggrc import TestCase from ggrc import db from ggrc.converters import errors from ggrc_workflows.models.task_group import TaskGroup from ggrc_workflows...
{ "content_hash": "cc222138bacb4fae13652a6cbcf15e73", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 79, "avg_line_length": 35.537848605577686, "alnum_prop": 0.591255605381166, "repo_name": "AleksNeStu/ggrc-core", "id": "5123e434d8c0a220924ab759547fc4d0ccdcd9d7", "size": ...
from __future__ import print_function, unicode_literals, absolute_import from django import template __author__ = 'peter' register = template.Library() from .jqm import * from .bootstrap import *
{ "content_hash": "0300bd634a4c815057f8107104f82128", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 72, "avg_line_length": 20, "alnum_prop": 0.74, "repo_name": "PeterHo/mysite", "id": "ff20b3e859ad3acf2a34f38bd30a1acac0fad0cd", "size": "215", "binary": false, "copies"...
from kivy.app import App from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.lang import Builder Builder.load_string(''' <SeedOptionsDialog@Popup> id: popup opt_bip39: False opt_ext: False is_bip39: False is_ext: False title: _('Seed Options') size_hint: 0....
{ "content_hash": "3a8e03fa86cc91fac379db3d32d88d8f", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 71, "avg_line_length": 30.22972972972973, "alnum_prop": 0.49530621367903443, "repo_name": "spesmilo/electrum", "id": "f244c6d8a94b57bcff264fb6a43fa9b9fa1a1ef4", "size": "22...
""" hmmlearn ======== ``hmmlearn`` is a set of algorithms for learning and inference of Hidden Markov Models. """ try: import setuptools_scm __version__ = setuptools_scm.get_version( # xref setup.py root="../..", relative_to=__file__, version_scheme="post-release", local_scheme="node-and-date...
{ "content_hash": "b4424a8de3c8948cb5701afb2b498c19", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 68, "avg_line_length": 25.38888888888889, "alnum_prop": 0.6323851203501094, "repo_name": "hmmlearn/hmmlearn", "id": "da9221d1055399bf0948bb7162c4759cced5c532", "size": "457...
"""An object that maps git ref names to bzr branch names. Note that it is not used to map git ref names to bzr tag names.""" import re class BranchMapper(object): _GIT_TRUNK_RE = re.compile('(?:git-)*trunk') def git_to_bzr(self, ref_name): """Map a git reference name to a Bazaar branch name. ...
{ "content_hash": "4f33ec64b0959dd77dab5bdc6ba31204", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 83, "avg_line_length": 36, "alnum_prop": 0.542989417989418, "repo_name": "levibostian/launchpad-2-github", "id": "047fb3f8ee05656ca0a8abb307b1a1e1760f3e4d", "size": "2184",...
import configparser from os.path import expanduser from kubernetes import client from kfserving import KFServingClient from kfserving import constants KFSERVING_TEST_NAMESPACE = "kfserving-ci-e2e-test" gcp_testing_creds = '''ewogICAgImNsaWVudF9pZCI6ICI3NjA1MTg1MDY0MDgtNnFyNHA2Z3BpNmhuNTA2cH\ Q4ZWp1cTgzZGkzNDFodXIuYXB...
{ "content_hash": "de7ca010c506851eb8ef00f905bfac18", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 105, "avg_line_length": 42.706896551724135, "alnum_prop": 0.6522002422285023, "repo_name": "kubeflow/kfserving-lts", "id": "d90096e878609fdd356f77db34fe0ff86fd0ba5b", "siz...
"""Server trace events. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import abc import enum # pylint: disable=wrong-import-order import logging from .. import _events _LOGGER = logging.getLogger(__name__) ...
{ "content_hash": "851ffc0631c436161cdd9f0210ac7d78", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 79, "avg_line_length": 27.427480916030536, "alnum_prop": 0.5754244364041191, "repo_name": "ceache/treadmill", "id": "3c0f1dd308b4da1ed5e5e044b109325ddf1acd5e", "size": "71...
"""This module contains a Google Cloud Video Intelligence Hook.""" from __future__ import annotations from typing import Sequence from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault from google.api_core.operation import Operation from google.api_core.retry import Retry from google.cloud.videointellige...
{ "content_hash": "22977d75a69abaa5707fa00d281df6a8", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 108, "avg_line_length": 46.30555555555556, "alnum_prop": 0.6716656668666267, "repo_name": "cfei18/incubator-airflow", "id": "9c7f8847f34405cce539e2bb4d90baf8f985219f", "si...
""" This is your project's main settings file that can be committed to your repo. If you need to override a setting locally, use local.py """ import os import logging # Normally you should not import ANYTHING from Django directly # into your settings, but ImproperlyConfigured is an exception. from django.core.excepti...
{ "content_hash": "ceb4cf5ccecbf8c79454792e026be16d", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 84, "avg_line_length": 31.9375, "alnum_prop": 0.7116077865897621, "repo_name": "michaelBenin/django-base-template", "id": "8be75a06a384eba8ddf1b6065ad6d4a237e78867", "size...
from __future__ import absolute_import import unittest from pysasl import SASLAuth from pysasl.creds.client import ClientCredentials from pysasl.creds.external import (ExternalVerificationRequired, ExternalCredentials) from pysasl.exception import InvalidResponse, UnexpectedChalleng...
{ "content_hash": "c0b16d99451d4fae5c0e1fe05ccbd2c2", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 75, "avg_line_length": 44.48717948717949, "alnum_prop": 0.6446685878962536, "repo_name": "icgood/pysasl", "id": "3b7268a87a5aaf5b1a8b79b037340e585a8a5328", "size": "3471", ...
import requests import defaults class address_test(): def __init__(self, user_id, base_url): self.request = None self.user_id = user_id self.base_url = base_url def usps_address_verify(self, user_id, base_url, api='Verify'): url = '%s?API=%s&XML=<AddressValidateRequest USERID="%s">\ <Address>\ <Addr...
{ "content_hash": "06dae4461ddf2d959dd194100f918e63", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 76, "avg_line_length": 27.89864864864865, "alnum_prop": 0.6500363284088156, "repo_name": "luxnovalabs/pyUspsLib", "id": "4d938132262c553507acbdf34fbe2a0fcc34cc5a", "size":...
from __future__ import print_function, absolute_import, unicode_literals, division import sys as _coconut_sys, os.path as _coconut_os_path _coconut_file_path = _coconut_os_path.dirname(_coconut_os_path.abspath(__file__)) _coconut_sys.path.insert(0, _coconut_file_path) from __coconut__ import _coconut, _coconut_MatchEr...
{ "content_hash": "c796f8f14d57d16365fe8c6ade4b784b", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 285, "avg_line_length": 38.21518987341772, "alnum_prop": 0.6142762504140444, "repo_name": "cgarciae/tfinterface", "id": "a565ece8eb46e4c84f638a5784ee7c394de603d8", "size":...
import twitter import json import requests from pprint import pprint import hackupc.settings as settings from bestin.utils import convert_degs_to_decimal from bestin.models import Activity from bestin.process import content_analyzer from instagram_scrabber import get_self_media def analyze_feed(user): if user.socia...
{ "content_hash": "7975985df78d7d02ec6e71d25acc59d7", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 187, "avg_line_length": 46.82795698924731, "alnum_prop": 0.5970149253731343, "repo_name": "IKholopov/HackUPC2017", "id": "bd1e2a1206dc804fec911b0cd061c6def251deb9", "size":...
import json import httpretty import mock import requests.exceptions from testfixtures import log_capture from analyticsclient.constants import data_format from analyticsclient.client import Client from analyticsclient.exceptions import ClientError, TimeoutError from analyticsclient.tests import ClientTestCase class...
{ "content_hash": "bcceac578107a0b971259f12b1e40374", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 107, "avg_line_length": 42.088235294117645, "alnum_prop": 0.6771488469601677, "repo_name": "nagyistoce/edx-analytics-data-api-client", "id": "2a8d981f70929028e5d6ba45210f470...
""" EasyBuild support for intel compiler toolchain (includes Intel compilers (icc, ifort), Parastation MPICH, Intel Math Kernel Library (MKL), and Intel FFTW wrappers). """ from easybuild.toolchains.ipsmpi import Ipsmpi from easybuild.toolchains.fft.intelfftw import IntelFFTW from easybuild.toolchains.linalg.intelmkl...
{ "content_hash": "29d42885d3da984940618d0fb47b46a6", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 105, "avg_line_length": 31.5, "alnum_prop": 0.7548500881834215, "repo_name": "ULHPC/modules", "id": "31e12d638bfaab4add160793da3a44a56589bcf0", "size": "1625", "binary": ...
"""Vocoder functions """ import numpy as np from scipy.signal import butter, lfilter, filtfilt import warnings from .._utils import verbose_dec def _freq_to_erbn(f): """Convert frequency to ERB number""" return 21.4 * np.log10(0.00437 * f + 1) def _erbn_to_freq(e): """Convert ERB number to frequency""...
{ "content_hash": "5a2092074b068a3432459299a4bfacb2", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 78, "avg_line_length": 33.50902527075812, "alnum_prop": 0.5717517776341305, "repo_name": "lkishline/expyfun", "id": "d0837417305f1ba74e23a7e975f2973e62be1ea6", "size": "93...
import sys import csv import pandas as pd import numpy as np import codecs class Transcript(): def __init__(self, inputFileName,outputFileName): self.inputFileName = inputFileName self.outputFileName = outputFileName self.raw_messages = [] self.speakerlist = [] self.messagelist = [] self.paragraphList = [...
{ "content_hash": "d4164d6bee69ec4fa77483d45c435d65", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 121, "avg_line_length": 31.13953488372093, "alnum_prop": 0.6807318894697535, "repo_name": "gtadiparthi/whatsapp-parser-lite", "id": "745d03eca19f81db334b8ea6e0d20754973a0065"...
"""Built-in WideNDeep model classes.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.eager import backprop from tensorflow.python.keras import activations from tensorflow.python.keras import backend as K from tensorflow.python.kera...
{ "content_hash": "dac3ef64239b9efbf28c8c9ae3f007bf", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 109, "avg_line_length": 40.926829268292686, "alnum_prop": 0.6829558998808105, "repo_name": "annarev/tensorflow", "id": "1f70a38cc9306a846947a36f56b7587ef72ea396", "size": ...
from mapperpy.object_mapper import ObjectMapper from mapperpy.one_way_mapper import OneWayMapper from mapperpy.mapper_options import MapperOptions from mapperpy.exceptions import ConfigurationException
{ "content_hash": "f3314d8627f25c559f7311797c20379e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 54, "avg_line_length": 50.5, "alnum_prop": 0.8811881188118812, "repo_name": "lgrech/MapperPy", "id": "28ce25e5ebe7b048d1df90ef1cd313e6a1448841", "size": "202", "binary": f...
""" Default database bootstrap. """ from antioch.core import interface, bootstrap from antioch.util import sql for name in interface.default_permissions: exchange.connection.runOperation(sql.build_insert('permission', name=name)) exchange.load_permissions() system = exchange.instantiate('object', name='System...
{ "content_hash": "b8fc956184d03d4bb62bd31990aa1261", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 94, "avg_line_length": 29.0561797752809, "alnum_prop": 0.6635730858468677, "repo_name": "philchristensen/antioch", "id": "f077651aac798a4274337209cc70aaee83003173", "size":...
from .flow_controller import FlowController from .outstanding_count_flow_controller import OutstandingCountFlowController from .rate_limiter_flow_controller import RateLimiterFlowController
{ "content_hash": "ba078c3fec30cbb0f3f3d12643e711ce", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 77, "avg_line_length": 63.333333333333336, "alnum_prop": 0.8842105263157894, "repo_name": "GoogleCloudPlatform/pubsub", "id": "4b7de1d1ace4a88894779c8eaa758196f86c6c51", "si...
import csv from bs4 import BeautifulSoup from collections import Counter import re csv_file = open('data_detikcom_740.csv') csv_reader = csv.DictReader(csv_file) words = [] for row in csv_reader: title = row['title'].strip().lower() raw_content = row['raw_content'] clean_content = BeautifulSoup(raw_conten...
{ "content_hash": "ebdb9d6ee7e4e8d7c548abb02fc0049a", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 59, "avg_line_length": 26.424242424242426, "alnum_prop": 0.6100917431192661, "repo_name": "bobbypriambodo/rojak", "id": "10df2fb6cb84e6a1c6e7fef8683e9e3748b9c0bd", "size": ...
from communities.models import Community from django.core.management.base import BaseCommand from django.utils import timezone from django.shortcuts import get_object_or_404 from issues.models import Issue, IssueStatus, IssueComment, \ IssueCommentRevision, Proposal, ProposalVote from meetings.models import Meetin...
{ "content_hash": "733f92e8c1c11fb071372d6dac5a17c0", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 70, "avg_line_length": 33.22727272727273, "alnum_prop": 0.7606019151846786, "repo_name": "nonZero/OpenCommunity", "id": "f205a6a724b6be73ebb7fc9f33738baad91b16d4", "size": ...
"""Test to verify that Home Assistant core works.""" # pylint: disable=protected-access import asyncio import logging import os import unittest from unittest.mock import patch, MagicMock, sentinel from datetime import datetime, timedelta from tempfile import TemporaryDirectory import pytz import pytest import homeass...
{ "content_hash": "6e5c3f0947b049abbe49b012026e7d3b", "timestamp": "", "source": "github", "line_count": 955, "max_line_length": 79, "avg_line_length": 31.352879581151832, "alnum_prop": 0.5930799545788524, "repo_name": "ewandor/home-assistant", "id": "09ddf721628790999039a9722fa75731f977f808", "size...
""" ##################################################################################### # # Copyright (c) 2013 M.R.Z <zgd1348833@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...
{ "content_hash": "4e419fdaf10c15b769815d2caad28af9", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 109, "avg_line_length": 33.368852459016395, "alnum_prop": 0.5824121837386391, "repo_name": "GdZ/AutoTest", "id": "9d95a9de80eab214cc73504a1af3203c32a70da5", "size": "4071"...
class LoopType(object): def __init__(self): self.loop = None def pretest(self): return self.loop == 0 def posttest(self): return self.loop == 1 def endless(self): return self.loop == 2 def set_pretest(self): self.loop = 0 def set_posttest(self): ...
{ "content_hash": "47d08afa10f3202c62b2703d17acf3de", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 78, "avg_line_length": 24.33830845771144, "alnum_prop": 0.5676614881439084, "repo_name": "mrmans0n/sublime-text-3-config", "id": "c7f1c8562783852f574c544c94d7d163f31b4983", ...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models class Clients(models.Model): first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) iban = models.CharField(max_length=34) country = models.CharField(nul...
{ "content_hash": "5bd8723d96a74acf8b56e22b6ae93e70", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 89, "avg_line_length": 43.76923076923077, "alnum_prop": 0.7065026362038664, "repo_name": "rexhepberlajolli/RHChallenge", "id": "ada690b71674bd393510afdae8fc12f43635ce2a", "...
import jedi def test_path_issues(): """ See pull request #684 for details. """ source = '''from datetime import ''' assert jedi.Script(source).completions()
{ "content_hash": "80ce39862c54bee41d2b3f037246ecfb", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 44, "avg_line_length": 22.25, "alnum_prop": 0.6235955056179775, "repo_name": "NcLang/vimrc", "id": "e5d8cd0d4edc5d084dfe06b55d28efb2b29b11af", "size": "178", "binary": fal...
from django import template from django.utils.safestring import mark_safe from django.template.defaultfilters import stringfilter import markdown register = template.Library() @register.filter(is_safe=True) @stringfilter def md(text): html = markdown.markdown(text, safe_mode='replace', output_format='html5') ...
{ "content_hash": "9f86aaa9c15e852685f0cf804f6df920", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 78, "avg_line_length": 23.066666666666666, "alnum_prop": 0.7774566473988439, "repo_name": "jaseiler/researchcompendia", "id": "4114ac87f57a2430a8c342f3ad2847526ac371b4", "s...
from __future__ import division, print_function import warnings import numpy as np from scipy.special import gammainccinv from scipy.ndimage.filters import convolve def _inv_nchi_cdf(N, K, alpha): """Inverse CDF for the noncentral chi distribution See [1]_ p.3 section 2.3""" return gammainccinv(N * K, 1...
{ "content_hash": "75e6315e558143f0267e4881c7a12e49", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 81, "avg_line_length": 31.737373737373737, "alnum_prop": 0.5838107362614047, "repo_name": "Messaoud-Boudjada/dipy", "id": "17d80560c0f853e46697f4474cde918d3f873437", "size...
""" Quick and dirty script to generate test case inputs. """ from __future__ import print_function from os.path import ( dirname, join, ) from pandas_datareader.data import DataReader here = join(dirname(__file__)) def main(): symbols = ['AAPL', 'MSFT', 'BRK-A'] # Specifically chosen to include the A...
{ "content_hash": "0c4aa2dbfd8ae87041c710250957fe90", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 68, "avg_line_length": 23.926829268292682, "alnum_prop": 0.48216106014271154, "repo_name": "magne-max/zipline-ja", "id": "42021d40aca0b007d3b581ae55c66f0a293c8fa3", "size":...
""" Edget detection routines """ import warnings import numpy as np from scipy import ndimage, signal try: # Protect this import as it is compiled code from nipy.algorithms.statistics import quantile except ImportError, e: warnings.warn('Could not import fast quantile function: %s' % e) quantile = Non...
{ "content_hash": "ba8952ecc167944a7c2a9d63ea4d02fe", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 80, "avg_line_length": 35.687943262411345, "alnum_prop": 0.5945945945945946, "repo_name": "bthirion/nipy", "id": "5530b2c22803bc5aa53c65f3f360ea49ef75f3e1", "size": "5146"...
"""Tests for grr.lib.email_alerts.""" from grr.lib import config_lib from grr.lib import email_alerts from grr.lib import flags from grr.lib import test_lib class SendEmailTests(test_lib.GRRBaseTest): def testSplitEmailsAndAppendEmailDomain(self): self.assertEqual(email_alerts.SplitEmailsAndAppendEmailDomain...
{ "content_hash": "ddf2b4bf75c95c5acb7099e4f8fed668", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 76, "avg_line_length": 37.189189189189186, "alnum_prop": 0.6613372093023255, "repo_name": "defaultnamehere/grr", "id": "bd53a472c35fbb5f3c09502c15cd21f34a165261", "size": "...
""" Collect the elasticsearch stats for the local node #### Dependencies * urlib2 """ import urllib2 import re try: import json json # workaround for pyflakes issue #13 except ImportError: import simplejson as json import diamond.collector RE_LOGSTASH_INDEX = re.compile('^(.*)-\d\d\d\d\.\d\d\.\d\d$...
{ "content_hash": "bb8322ca9edde056155779ef84277b5f", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 80, "avg_line_length": 38.855670103092784, "alnum_prop": 0.52383479260635, "repo_name": "metamx/Diamond", "id": "536957faaf0a2ba874a94bf88f3c45807dc5a7d9", "size": "11323"...
"""Tests for GCI logic for profiles. """ import unittest from soc.modules.gci.logic import profile as profile_logic from soc.modules.gci.models.organization import GCIOrganization from soc.modules.gci.models.profile import GCIProfile from soc.modules.seeder.logic.seeder import logic as seeder_logic class ProfileTe...
{ "content_hash": "89d4cc98013b7d63a69060f2d7b94fc2", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 79, "avg_line_length": 38.5, "alnum_prop": 0.699443413729128, "repo_name": "adviti/melange", "id": "067f4e92f98dbb469b0f6f927eae52f8b05c4e79", "size": "2766", "binary": f...
from django.db import models from django.utils.translation import gettext_lazy from uuid import uuid4 import json from memoized import memoized from corehq import toggles class DialerSettings(models.Model): domain = models.CharField(max_length=128, unique=True) aws_instance_id = models.CharField(max_length=...
{ "content_hash": "e6266c158a5ccda93be6651251994a4c", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 94, "avg_line_length": 34.6695652173913, "alnum_prop": 0.6328066215199398, "repo_name": "dimagi/commcare-hq", "id": "b3ab6957dcb0d1d74e4305ec820581264dcb4a74", "size": "39...
""" Allows utilizing telegram webhooks. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/telegram_bot.webhooks/ """ import asyncio import datetime as dt from ipaddress import ip_network import logging import voluptuous as vol from homeassistant.component...
{ "content_hash": "08f8cb7faea6627ab794e07e905b2be6", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 79, "avg_line_length": 35.208, "alnum_prop": 0.6659850034083163, "repo_name": "stefan-jonasson/home-assistant", "id": "055f68884a6f3eccbf6c3f7e6798c5b19bea5be9", "size": "...
from lxml import html import requests def text_tostring(element): text_string = html.tostring(element, method="text", encoding="UTF-8") return text_string.decode('unicode_escape').strip() class Page(object): url = None text = None tree = None def __init__(self, url, html_text=None): ...
{ "content_hash": "c06178edef0e71b84b26dafa75966161", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 88, "avg_line_length": 27.868852459016395, "alnum_prop": 0.6347058823529412, "repo_name": "FreeMusicNinja/api.freemusic.ninja", "id": "3fb70bc8a3a987a72a83246cd7438c1e2f760a8...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 30, transform = "Anscombe", sigma = 0.0, exog_count = 20, ar_order = 12);
{ "content_hash": "7c0e573f25b039550d6b492eb483cbea", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 169, "avg_line_length": 38.42857142857143, "alnum_prop": 0.7100371747211895, "repo_name": "antoinecarme/pyaf", "id": "d6ed06edf632bfb14f945c9283dd79be5f2f252f", "size": "269...
import _plotly_utils.basevalidators class TextinfoValidator(_plotly_utils.basevalidators.FlaglistValidator): def __init__(self, plotly_name="textinfo", parent_name="funnel", **kwargs): super(TextinfoValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "6b3e319bf457bc467a2e4d5faa62e906", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 33.875, "alnum_prop": 0.46494464944649444, "repo_name": "plotly/plotly.py", "id": "7931d3e4bbccc7d897898a467fafa2d55c9ef28c", "size": "813", "binar...
from django import template from django.contrib.contenttypes.models import ContentType from django.template import Context from hcomments import models from hcomments import settings import hashlib import urllib register = template.Library() def _get_comment_list(object): ctype = ContentType.objects.get_for_mo...
{ "content_hash": "2b3551a57ee7ae03c26bcb1390a28ddc", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 96, "avg_line_length": 26.261904761904763, "alnum_prop": 0.6500453309156845, "repo_name": "matrixise/epcon", "id": "ad5dcf0979a9b7f865c825ab5cee93b2ba518d38", "size": "333...
import os import logging from multiprocessing import Process from django.conf import settings from django.core.cache import cache as django_cache from django.core.management.base import BaseCommand from django.db import connection as django_connection, connections from kombu import Connection, Exchange, Queue from aw...
{ "content_hash": "500cbdaad25a5dc991e9316ba2bb18ad", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 96, "avg_line_length": 38.698412698412696, "alnum_prop": 0.5607054963084496, "repo_name": "wwitzel3/awx", "id": "312c146e205045ba4a8777a730a26a193d6641d9", "size": "4934",...
""" Mixcloud OAuth2 backend, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/mixcloud.html """ from .oauth import BaseOAuth2 class MixcloudOAuth2(BaseOAuth2): name = 'mixcloud' ID_KEY = 'username' AUTHORIZATION_URL = 'https://www.mixcloud.com/oauth/authorize' ACCESS_TOKEN_URL...
{ "content_hash": "760481442a9b44a390ae356f198f8a49", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 37.07692307692308, "alnum_prop": 0.5881742738589212, "repo_name": "IKholopov/HackUPC2017", "id": "8b1b77e531dd1015aaaad0304f1a51f75c02f0da", "size": ...
from django.forms import ModelForm from bootstrap3_datetime.widgets import DateTimePicker from django import forms from django.db import models from django.forms.fields import DateField, ChoiceField, MultipleChoiceField from django.forms.widgets import RadioSelect, CheckboxSelectMultiple import re #from django.core imp...
{ "content_hash": "a310d592b5a2d1b56a2475e7e1ba4213", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 80, "avg_line_length": 25.28994082840237, "alnum_prop": 0.5807206364061769, "repo_name": "seshagiriprabhu/ayudh-portal", "id": "d8d8505b5d085fd9881079f526031fd28307accb", ...
import logging import numpy as np import scipy.interpolate as intpl from pySDC.core.Nodes import NodesGenerator from pySDC.core.Errors import CollocationError from pySDC.core.Lagrange import LagrangeApproximation class CollBase(object): """ Generic collocation class, that contains everything to do integrati...
{ "content_hash": "33a6f64fd4881bfc3af6d3aebf89ca3a", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 114, "avg_line_length": 35.79251700680272, "alnum_prop": 0.5620070322151478, "repo_name": "Parallel-in-Time/pySDC", "id": "e86ea5d9c65c0fada40faec62232df955984f5c9", "size...
from snovault import COLLECTIONS from snovault.calculated import calculate_properties from snovault.validation import ValidationFailure from snovault.validators import no_validate_item_content_post from operator import itemgetter from pyramid.authentication import CallbackAuthenticationPolicy import requests from pyram...
{ "content_hash": "7af98515d3016b21a8f01667110bb0cf", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 96, "avg_line_length": 31.671717171717173, "alnum_prop": 0.6479030457662255, "repo_name": "T2DREAM/t2dream-portal", "id": "04a2ac57105bd36e17b1d6a08147c672c93c077a", "size...
from .response_codes import ResponseCodes class Response(object): def __init__(self, return_value, code=0, details={}): self._return_value = return_value self._code = code self._details = details def __repr__(self): return 'Reply<return_value={}, code={}, details={}>'.format(s...
{ "content_hash": "32b4219a855aa5de0d443bd4d8560e5e", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 111, "avg_line_length": 26.543478260869566, "alnum_prop": 0.5921375921375921, "repo_name": "cbigler/jackrabbit", "id": "828f83f417f6c0540d30616f66ce6c3d5e528853", "size": "...
""" :codeauthor: :email:`Bo Maryniuk <bo@suse.de>` """ import copy import os import pathlib import shutil import sys import tarfile import tempfile import jinja2 import pytest import salt.exceptions import salt.utils.hashutils import salt.utils.json import salt.utils.platform import salt.utils.stringutils from s...
{ "content_hash": "2f39d25660da11438f9c21b40909d386", "timestamp": "", "source": "github", "line_count": 1375, "max_line_length": 105, "avg_line_length": 36.58472727272727, "alnum_prop": 0.5286458333333334, "repo_name": "saltstack/salt", "id": "cb3cf7e521ed74dad827132aec78023ac3f3f9f5", "size": "503...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons from common import write_fake_link _python_ = TestSCons._python_ _exe = TestSCons._exe test = TestSCons.TestSCons() write_fake_link(test) test.write('myfortran.py', r""" import getopt import sys comment = '#' + sys.argv[1] opts, args...
{ "content_hash": "db03e5a8b493230bd3bb7f1f3ac9d842", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 67, "avg_line_length": 34.614285714285714, "alnum_prop": 0.6413536937680562, "repo_name": "timj/scons", "id": "92e30ead5717198222b3477233d796201ca016ea", "size": "3525", ...
from regeste.serializers import RegesteSerializer from person.models import Person from regeste.models import Regeste from rest_framework.response import Response from django.shortcuts import get_object_or_404 from rest_framework.views import APIView class RegestDetail(APIView): def get(self, request, pk, format...
{ "content_hash": "1272afe01fc3a538eb2144fbc4cdef55", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 66, "avg_line_length": 32.333333333333336, "alnum_prop": 0.7752577319587629, "repo_name": "danielbaak/imperii-viz", "id": "ada9e13d60edd634374af5a14f7431b173910475", "size"...
import pytest,datetime,json,os.path from fixture.application import Application import importlib,jsonpickle from fixture.db import DbFixture now_time = datetime.datetime.now() fixture = None target = None @pytest.fixture def app(request): global fixture browser = request.config.getoption("--brow...
{ "content_hash": "d0dc4d33886c15bba0c9b708270e7ddc", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 152, "avg_line_length": 37.82716049382716, "alnum_prop": 0.6693864229765013, "repo_name": "maximencia/python_traning", "id": "6d20c5685acea5f5206893383cbbfda093530c91", "si...
"""Dell Force10 Driver - supports DNOS9.""" from netmiko.cisco_base_connection import CiscoSSHConnection class DellForce10SSH(CiscoSSHConnection): """Dell Force10 Driver - supports DNOS9.""" def save_config( self, cmd: str = "copy running-configuration startup-configuration", confirm:...
{ "content_hash": "a3a902482a5d7e96635134a8ca828554", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 71, "avg_line_length": 31.176470588235293, "alnum_prop": 0.6358490566037736, "repo_name": "ktbyers/netmiko", "id": "9ce811f66082410671c30f6eab4b029766adf701", "size": "530"...
import sys import os from PySide import QtCore, QtGui from PySide.QtGui import QFileDialog from juma.core import app, signals from juma.qt.TopEditorModule import TopEditorModule, QtMainWindow, SubEditorModule ##----------------------------------------------------------------## cl...
{ "content_hash": "ff99de6b5d01ff10a13964d61d37113d", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 91, "avg_line_length": 30.961038961038962, "alnum_prop": 0.49538590604026844, "repo_name": "cloudteampro/juma-editor", "id": "a895bdf98f4911c243379aa8300ac2d22ca0f664", "si...
"""Remove id column from xcom Revision ID: bbf4a7ad0465 Revises: cf5dc11e79ad Create Date: 2019-10-29 13:53:09.445943 """ from collections import defaultdict from alembic import op from sqlalchemy import Column, Integer from airflow.compat.sqlalchemy import inspect # revision identifiers, used by Alembic. revisio...
{ "content_hash": "4a8ff70f4b1aef671829dbc58e1bc89b", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 103, "avg_line_length": 38.93396226415094, "alnum_prop": 0.668524351829416, "repo_name": "danielvdende/incubator-airflow", "id": "a588af5c53917ab2b2ebac2bb3a660f608bd29b9", ...
from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score import numpy as np SEED = 5 np.random.seed(SEED) import pandas as pd uri = 'https://gist.githubusercontent.com/guilhermesilveira/4d1d4a16ccbf6ea4e0a64a38a24ec884/raw/afd05cb0c796d18f3f5a6537053ded308ba94bf7/car-prices.csv'...
{ "content_hash": "43a36cc7e1705df72ae6e412194cada1", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 155, "avg_line_length": 30.992481203007518, "alnum_prop": 0.7147016011644832, "repo_name": "wesleyegberto/courses-projects", "id": "5810e379301c06dce3e6441eb07ed18d62d76283"...
"""Generic mapping to Select statements""" from sqlalchemy.testing import assert_raises, assert_raises_message import sqlalchemy as sa from sqlalchemy import testing from sqlalchemy import String, Integer, select from sqlalchemy.testing.schema import Table, Column from sqlalchemy.orm import mapper, Session from sqlalch...
{ "content_hash": "2036a1ab4de6342b7563452095e16ba3", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 85, "avg_line_length": 32.98684210526316, "alnum_prop": 0.6382130035899481, "repo_name": "Abi1ity/uniclust2.0", "id": "42347213e186eb74684615c5075a2a49f3922923", "size": "2...
from pandac.PandaModules import * from pandac.PandaModules import * from direct.directnotify import DirectNotifyGlobal from direct.showbase import PythonUtil from otp.otpbase import OTPLocalizer import HTTPUtil import RemoteValueSet import copy accountServer = '' accountServer = launcher.getAccountServer() print 'TTAcc...
{ "content_hash": "851e9f925333e1c59f51f6b64f074006", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 284, "avg_line_length": 42.84642857142857, "alnum_prop": 0.6246561640410102, "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "id": "eaac4460c56bcc52fa5a808cecf53897811...
import contextlib import mock import webob.exc from neutron.api.v2 import attributes from neutron import context from neutron.plugins.nec.common import exceptions as nexc from neutron.plugins.nec.extensions import packetfilter as ext_pf from neutron.tests.unit.nec import test_nec_plugin from neutron.tests.unit import...
{ "content_hash": "fcf496eea076d3e9a338da1e1b53d753", "timestamp": "", "source": "github", "line_count": 699, "max_line_length": 79, "avg_line_length": 42.693848354792564, "alnum_prop": 0.5712897496900445, "repo_name": "aaron-fz/neutron_full_sync", "id": "24c2f9aa14fe4a52c41bc1b2a12bf6e885cc7791", "...
"""Support for UK Met Office weather service.""" from __future__ import annotations from homeassistant.components.sensor import SensorEntity, SensorEntityDescription from homeassistant.const import ( ATTR_ATTRIBUTION, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, LENGTH_KILOMETERS, PERCENTAGE, ...
{ "content_hash": "cdf6f4a86e465ab2842888dd5b31c3f7", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 93, "avg_line_length": 31.019607843137255, "alnum_prop": 0.6127686472819216, "repo_name": "sander76/home-assistant", "id": "4919e36bd5888cd73891195c85651a0ab2da447b", "siz...
import collections import random from representations.embedding import Embedding, SVDEmbedding class SequentialEmbedding: def __init__(self, year_embeds, **kwargs): self.embeds = year_embeds @classmethod def load(cls, path, years, **kwargs): embeds = collections.OrderedDict() for...
{ "content_hash": "bc910245b0da95782a9da42211821410", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 100, "avg_line_length": 38.10294117647059, "alnum_prop": 0.6256271709764569, "repo_name": "ruhulsbu/WEAT4TwitterGroups", "id": "733bd01626a6a167cfb685270ae004ff3bea88d7", "...
"""Copyright 2008 Orbitz WorldWide Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
{ "content_hash": "661d4a57fb5c0ab8efef08f52a86281f", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 92, "avg_line_length": 30.71212121212121, "alnum_prop": 0.6684755796743956, "repo_name": "deniszh/graphite-web", "id": "ce1659565ffd690ac02bf84382aa3511dbed383f", "size": "...
import os import subprocess import json import ConfigParser import random from optparse import OptionParser def configuring (): print("Configuring Wizard: ") configer = ConfigParser.RawConfigParser() try: config_file = open(config_path, 'w') except IOError as e: print("Creating the config file was unsuccesful"...
{ "content_hash": "a8bd08a4f5cda8c5d8435a3194b7b049", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 203, "avg_line_length": 33.57236842105263, "alnum_prop": 0.6807760141093474, "repo_name": "Emilien-P/scripts-dump", "id": "2f6e10d84321a572841a3f59ce14af3225a0ae84", "size...
from collections import defaultdict import asyncio from flowirc.log import log class MiddleWareBase: _listeners = defaultdict(list) def on(self, event, callback): self.add_listener(event, callback, event) @asyncio.coroutine def trigger(self, event): log.debug("Received event: %s", ev...
{ "content_hash": "f13cd469810a03b93518527e9e3da0a5", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 67, "avg_line_length": 31.107142857142858, "alnum_prop": 0.6291618828932262, "repo_name": "lndbrg/flowirc", "id": "238eebb72145b39a95deb88d7c089ee26fd00e8f", "size": "871",...
"""Tests for contrib.resampler.python.ops.resampler_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.contrib import resampler from tensorflow.python....
{ "content_hash": "ec3019016d77ac818fe08bb24ca6fe1b", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 80, "avg_line_length": 38.41732283464567, "alnum_prop": 0.6295347407255585, "repo_name": "xuleiboy1234/autoTitle", "id": "9aa1e0562844cf8fed0eadb038599f02d94d0cd6", "size"...
import flask import jinja2 def repo_visibility(repo): """Convert repo to its visibility attribute as string :param repo: Repository to show its visibility as string :type repo: ``repocribro.models.Repository`` :return: Text representation of repo visibility :rtype: str """ if repo.is_publ...
{ "content_hash": "ea9ab6e5f9e6478748a5cecd4460d92e", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 74, "avg_line_length": 29.29078014184397, "alnum_prop": 0.6365617433414044, "repo_name": "MarekSuchanek/repocribro", "id": "f49504456182c39363f517a00261c91fe63e5756", "siz...
from __future__ import absolute_import, print_function, division from theano import gof class TypedListType(gof.Type): """ Parameters ---------- ttype Type of theano variable this list will contains, can be another list. depth Optionnal parameters, any value above 0 will create a ...
{ "content_hash": "b71ef8dd2089c9920cff2afee71350e7", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 77, "avg_line_length": 27.517482517482517, "alnum_prop": 0.5064803049555273, "repo_name": "JazzeYoung/VeryDeepAutoEncoder", "id": "a565562b1e06a44322ea416aa9745e8d4576a7e6",...
import sys sys.path.append('dependencies/ipyxact') import argparse from ipyxact.ipyxact import Component from mako.lookup import TemplateLookup from mako.template import Template from mako.runtime import Context parser = argparse.ArgumentParser(description='Generate registers') parser.add_argument('xml_path', metav...
{ "content_hash": "acb8125e4f459b36df6891e144afa4e5", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 86, "avg_line_length": 28.823529411764707, "alnum_prop": 0.7418367346938776, "repo_name": "tudortimi/rgen", "id": "4dedbf16f6e1b7a5c81c1c9fdc0fdc40dae6c21e", "size": "1003"...
from flask import send_from_directory from backend import app import os def serve_static_path(directory, path): return app.send_static_file(os.path.join(directory, path).replace('\\','/')) @app.route('/') def root(): return app.send_static_file('index.html') @app.route('/js/<path:path>') def static_js(p...
{ "content_hash": "546541d266398a7cfd7fc35620d468ad", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 90, "avg_line_length": 26.794871794871796, "alnum_prop": 0.676555023923445, "repo_name": "ghostsp15/Fort-Nitta", "id": "f5a190f69ad4d26d649c8e9093eb20a8eec799f6", "size": "...
import os def get_default_config_path(): return os.path.join(os.path.dirname(os.path.abspath(__file__)), "atcodertools-default.toml")
{ "content_hash": "6e7950a01172a9eb0c99b6bd087eed70", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 96, "avg_line_length": 28, "alnum_prop": 0.7142857142857143, "repo_name": "kyuridenamida/ToolsForAtCoder", "id": "c415a7e04dc01ff5c57783b2d736fe91ccd84516", "size": "140", ...
from __future__ import division, unicode_literals, print_function import json import glob import itertools import logging import math import os import re import warnings import xml.etree.cElementTree as ET from collections import defaultdict from io import StringIO import numpy as np from monty.io import zopen, rever...
{ "content_hash": "14390a57d491026a2f0d731e59b56530", "timestamp": "", "source": "github", "line_count": 4152, "max_line_length": 139, "avg_line_length": 41.331647398843934, "alnum_prop": 0.5115699060072607, "repo_name": "czhengsci/pymatgen", "id": "dbd6e6d30c60f6de823ffef27fece3973e5901e1", "size":...
"""Gradients for operators defined in control_flow_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.python.framework import ops from tensorflow.python.ops import math...
{ "content_hash": "cd824873d3cc02104b0d33ba2e415467", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 76, "avg_line_length": 31.18095238095238, "alnum_prop": 0.6973121563836285, "repo_name": "MemeticParadigm/TensorFlow", "id": "d6a0c6e6c27a3a53448e0ad1db2daace4569f91b", "s...
print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!" print "hello dude!!!"
{ "content_hash": "672703f4873c4c9a603d57beb89f6399", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 21, "avg_line_length": 20.5, "alnum_prop": 0.6341463414634146, "repo_name": "ramaganapathy1/AMuDA-Ir-back-end", "id": "590218c05a393b9837cfde7626ff0264d6038def", "size": "2...
"""Read and cache directory listings. The listdir() routine returns a sorted list of the files in a directory, using a cache to avoid reading the directory more often than necessary. The annotate() routine appends slashes to directories.""" import os __all__ = ["listdir", "opendir", "annotate", "reset"] c...
{ "content_hash": "08ea49d1ea361f2bc1e2c6a2089255f4", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 72, "avg_line_length": 27.473684210526315, "alnum_prop": 0.6015325670498084, "repo_name": "ericlink/adms-server", "id": "1ce80b1b6d65b661884191ae657da2e9a3f34c54", "size": ...
from typing import Collection, List, Optional, Set, Tuple, Union from django.db.models.query import QuerySet from django.utils.timezone import now as timezone_now from django.utils.translation import gettext as _ from typing_extensions import TypedDict from zerver.lib.exceptions import StreamAdministratorRequired fro...
{ "content_hash": "975b4bb226ac5e814eafe6832774d214", "timestamp": "", "source": "github", "line_count": 703, "max_line_length": 100, "avg_line_length": 36.61735419630156, "alnum_prop": 0.6699168673762722, "repo_name": "punchagan/zulip", "id": "d945663e4a0d068b6891dce023e9c7c02bbf575b", "size": "257...
import os from resolverapi import create_app app = create_app(os.environ.get('RESOLVER_ENV', 'prod')) if __name__ == '__main__': app.run()
{ "content_hash": "643a139d4b842d0bc637d1ff4096ebf0", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 56, "avg_line_length": 20.714285714285715, "alnum_prop": 0.6413793103448275, "repo_name": "opendns/OpenResolve", "id": "429ecd0023d7557341af3c32b423bee194862e4e", "size": "1...
def find_all_around(row, column, matrix): arr = [] try: c = matrix[row][column] d = matrix[row + 1][column] r = matrix[row][column + 1] dr = matrix[row + 1][column + 1] return [c, r, d, dr] except IndexError: pass def differentSquares(matrix): row = 0...
{ "content_hash": "61f2a644f82c62518de2e8e11cce3b6e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 69, "avg_line_length": 28.09090909090909, "alnum_prop": 0.5226537216828478, "repo_name": "emirot/codefights", "id": "b9ccdae379211c71e05125f49c0fb71519957cd6", "size": "619...
#------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://w...
{ "content_hash": "fd21e04cfa3e781e8d5bfd4ab478b1df", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 79, "avg_line_length": 28.796296296296298, "alnum_prop": 0.594855305466238, "repo_name": "rjhunter8285/nsc-cloudproject-s22016", "id": "1961b196a4aa397fe5010a68f5f11c4da03b4c...
import numpy as np from functools import reduce from string import ascii_uppercase from ..externals.six import string_types # The following function is a rewriting of scipy.stats.f_oneway # Contrary to the scipy.stats.f_oneway implementation it does not # copy the data while keeping the inputs unchanged. def _f_one...
{ "content_hash": "eac7bf4d20f8a9f90eb65ae512b52e1a", "timestamp": "", "source": "github", "line_count": 332, "max_line_length": 78, "avg_line_length": 34.7289156626506, "alnum_prop": 0.5853425845620122, "repo_name": "nicproulx/mne-python", "id": "831c8baa49f2a1c7b861e0ff7e04453734e88573", "size": "...
from icontrol.exceptions import iControlUnexpectedHTTPError def test_cluster_load(request, mgmt_root): # Load will produce exception on non-cluster BIGIP. # iControlUnexpectedHTTPError: 404 Unexpected Error: Not Found for uri: try: assert str(mgmt_root.tm.sys.cluster.default.load().kind) == 'tm:sy...
{ "content_hash": "0e67f9b5f0e197bdd8d56c1e0948f12b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 103, "avg_line_length": 49, "alnum_prop": 0.7363945578231292, "repo_name": "F5Networks/f5-common-python", "id": "5ade5b4208a834fd4ba8058803bef7fe6e94ddca", "size": "1758", ...
"""Regenerates all the .isolated test data files. Keep in sync with ../run_isolated_smoke_test.py. """ import glob import hashlib import json import os import sys ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) # Ordering is important to keep this script simple. INCLUDES_TO_FIX = [ ('manifest2.isolated',...
{ "content_hash": "43dacc62ce1af6fc73cf0184b8167a87", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 79, "avg_line_length": 21.85483870967742, "alnum_prop": 0.6583025830258302, "repo_name": "espadrine/opera", "id": "bfe3da3b660b248a2594de3f6e1427b7658a9452", "size": "1544"...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * ''' IMPORTS ''' from datetime import timedelta, datetime import requests import os import re import copy import json # disable insecure warnings requests.packages.urllib3.disable_warnings() ''' GLOBAL VARS ''' API_K...
{ "content_hash": "89553c622ffce6ae305817fb9f719975", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 127, "avg_line_length": 33.124605678233436, "alnum_prop": 0.597495357363935, "repo_name": "demisto/content", "id": "0bdf2dd8c2c2fc942ee64a33418e94b887e4fe18", "size": "210...
import os from unittest.mock import MagicMock import cauldron from cauldron.environ.response import Response from cauldron.test import support from cauldron.test.support import scaffolds from cauldron.test.support.messages import Message from cauldron.cli.commands.steps import actions as step_actions class TestStepA...
{ "content_hash": "926150abe9faf7eae167f0420efff17e", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 33.07826086956522, "alnum_prop": 0.667192429022082, "repo_name": "sernst/cauldron", "id": "d776b766764b50ed5f5a5ad47e6137097d2f2b95", "size": "3804"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('register', '0014_auto_20160225_2045'), ] operations = [ migrations.AlterField( model_name='detailapross', name='work_done', ...
{ "content_hash": "583b9576fbb66b9d595155cda8272e16", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 22.88888888888889, "alnum_prop": 0.6067961165048543, "repo_name": "nanomolina/JP", "id": "8dce5a3308ce661ad86dc423b8fc1177af90c6b4", "size": "484", ...
""" This module is for the miscellaneous GEOS routines, particularly the ones that return the area, distance, and length. """ from ctypes import c_int, c_double, POINTER from django.contrib.gis.geos.libgeos import lgeos, GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_dbl ### ctypes ge...
{ "content_hash": "d5399891883015086d2bd21a78586137", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 69, "avg_line_length": 35.18518518518518, "alnum_prop": 0.7, "repo_name": "greggian/TapdIn", "id": "b6df25ddd649838fdc0fc42c7b034f61ab523f34", "size": "950", "binary": fa...
from __future__ import unicode_literals import sys from django import forms from django.apps.registry import Apps from django.core.checks import Error from django.core.exceptions import ValidationError from django.db import models from django.db.models.fields import NOT_PROVIDED from django.test import SimpleTestCase...
{ "content_hash": "6e4f2123ebb286bda8e645468b1d1ae1", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 120, "avg_line_length": 43.664739884393065, "alnum_prop": 0.5741329097167064, "repo_name": "Vitagene1/django-colorful", "id": "776c9c725ee6d915b9e598bb83d9fe5c5f7fd0a8", "...
if __name__ == '__main__': import argparse import os import time parser = argparse.ArgumentParser(description='Launches a Java JBosen application.') parser.add_argument('host_file', type=str, help='Path to the host file to use.') parser.add_argument('class_path', type=str, help='Java classpath that co...
{ "content_hash": "4914d0a1f0cf4ee6528335c661c261ed", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 129, "avg_line_length": 45.391304347826086, "alnum_prop": 0.6460727969348659, "repo_name": "petuum/jbosen", "id": "1be42f8153cff19ada61ddc6403af220fdcbb06f", "size": "2111"...
from __future__ import with_statement import os from shutil import copytree from os.path import dirname, exists, join import re from subprocess import check_call, Popen, PIPE from datetime import datetime from distutils.core import Command from citools.build import ReplaceTemplateFiles, RenameTemplateFiles from citoo...
{ "content_hash": "cad6efa20f7c79f9ce2e8ecdb33a806c", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 159, "avg_line_length": 31.735714285714284, "alnum_prop": 0.6308050116287793, "repo_name": "ella/citools", "id": "11b45ef99515650142e2b50032e5b6e48db6914e", "size": "13329...
import numpy as np import os import fabio class edfmemmap: """Access edf data with memmaps (cannot handle certain things like compression)""" def __init__(self, filename, mode="r"): # f = fabio.edfimage.EdfImage(filename) f = fabio.open(filename) self.dtype = f.bytecode self....
{ "content_hash": "6e551305c48f51a32445ffe8c2612e3b", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 86, "avg_line_length": 24.333333333333332, "alnum_prop": 0.5955926146515783, "repo_name": "woutdenolf/spectrocrunch", "id": "a5188e59fefea7f9e3dba84aba5c5554ef350771", "siz...
from flask import request, url_for, g from flask_peewee.rest import RestAPI, RestrictOwnerResource, Authentication, RestResource from app import app from auth import auth from models import * class IntApi(RestAPI): @property def registry(self): return self._registry class IntAuthentication(Authenti...
{ "content_hash": "75c6bf8cdf958201cc4b4ec9d926e3fd", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 90, "avg_line_length": 29.361702127659573, "alnum_prop": 0.6710144927536232, "repo_name": "ak64th/IntQuiz", "id": "6326c5ba3cc70c3a1ccb73b75a955372d6cf8715", "size": "2775"...
from msrest.serialization import Model class NetworkInterfaceDnsSettings(Model): """DNS settings of a network interface. :param dns_servers: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IP...
{ "content_hash": "0497f1db5e58d59b69834900918d03f8", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 117, "avg_line_length": 48.08108108108108, "alnum_prop": 0.6908375491849353, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "dc60cbe8fba3c620ca37e8f44ebf1db5294dd21c",...
from unittest import TestCase import oeis class TestChoose(TestCase): def test_equal(self): r = oeis.choose(9, 9) self.assertEqual(r, 1)
{ "content_hash": "5fd62d5bc5662a1028cacb8dfd077bb9", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 30, "avg_line_length": 19.875, "alnum_prop": 0.660377358490566, "repo_name": "GuySrinivasan/oeis", "id": "23571de6496372c98dbc4f0ba2caaf88a0747445", "size": "159", "binary...
""" Copyright (c) 2015 SONATA-NFV and Paderborn University ALL RIGHTS RESERVED. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by ap...
{ "content_hash": "6afc3ddbf84475c3213a94c46736ba1c", "timestamp": "", "source": "github", "line_count": 1164, "max_line_length": 121, "avg_line_length": 41.28865979381443, "alnum_prop": 0.578401997503121, "repo_name": "knodir/son-emu", "id": "759ed419000544f59e762aee2673f43d1a8bf882", "size": "4806...
'''Arsenal API network_interfaces.''' # Copyright 2015 CityGrid Media, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
{ "content_hash": "4230296456d1c9429762f0ecd92162fc", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 131, "avg_line_length": 38.484771573604064, "alnum_prop": 0.4971311745696762, "repo_name": "CityGrid/arsenal", "id": "5920b99de3c4781d5c2fba697b0c62f3bcbc2ac1", "size": "1...
import copy import errno import os import time from oslo_log import log as logging from oslo_serialization import jsonutils as json import six from six.moves.urllib import parse as urllib from tempest.common import glance_http from tempest import exceptions from tempest.lib.common import rest_client from tempest.lib....
{ "content_hash": "47fd580d368a8445bb6575d36ea5fc54", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 77, "avg_line_length": 38.21785714285714, "alnum_prop": 0.5509765442482011, "repo_name": "zsoltdudas/lis-tempest", "id": "e29ff89466a1cfb488659200169187be948ce10f", "size"...
for codec in ['latin_1', 'utf_8', 'utf_16']: try: print(codec, 'El 你好'.encode(codec), sep='\t') except UnicodeEncodeError as e: print(e) ######################## # decode demo octets = b'Hello\xe9al' print(octets.decode('cp1252')) print(octets.decode('iso8859_7')) try: print(octets.decode(...
{ "content_hash": "46bff5ac37bb64daede7e82c815483a7", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 66, "avg_line_length": 28.36764705882353, "alnum_prop": 0.5800933125972006, "repo_name": "stoneflyop1/fluent_py", "id": "d3e4dce464a340301ab57936a8345e4fa7263835", "size": ...