content stringlengths 4 20k |
|---|
import csv
import sys
import re
import os
def scrub_callsign(callsign):
#callsign = callsign.upper()
callsign = callsign.strip()
if callsign == "MCC":
callsign = "CC"
return callsign
readPageCounter = 1
curRow = 0
errorCount = 0
newTimestamp = 0
lastWasPAO = 0
output_file_name_and_path = "F:\ApolloGit\Apoll... |
"""Test behavior of -maxuploadtarget.
* Verify that getdata requests for old blocks (>1week) are dropped
if uploadtarget has been reached.
* Verify that getdata requests for recent blocks are respected even
if uploadtarget has been reached.
* Verify that the upload counters are reset after 24 hours.
"""
from collectio... |
import re
from oslo_log import log as logging
import paste.urlmap
import six
if six.PY3:
from urllib import request as urllib2
else:
import urllib2
from nova.api.openstack import wsgi
LOG = logging.getLogger(__name__)
_quoted_string_re = r'"[^"\\]*(?:\\.[^"\\]*)*"'
_option_header_piece_re = re.compile(r'... |
"""The tests for the Datadog component."""
from unittest import mock
import homeassistant.components.datadog as datadog
from homeassistant.const import (
EVENT_LOGBOOK_ENTRY,
EVENT_STATE_CHANGED,
STATE_OFF,
STATE_ON,
)
import homeassistant.core as ha
from homeassistant.setup import async_setup_componen... |
"""
Forms and validation code for user registration.
"""
from django.contrib.auth.models import User
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.forms import UserCreationForm
# I put this on all required fields, because it's easier to pick up
# on them ... |
try:
import cccanvas
except:
import sys
sys.path.insert(0,"./../.libs/")
import cccanvas
import fifteen_item
import random
import gtk
import pango
TILE_SIZE = 50.0
class FifteenGrid(cccanvas.Rectangle):
def __init__(self, font_desc):
global TITLE_SIZE
cccanvas.Rectangle.__init__... |
import numpy as np
class FallDetector():
def __init__(self):
self._mean_vecs = []
self._mean_vecs.append([]), self._mean_vecs.append([])
self._delta_pcas = []
self._angle_pcas = []
self._angle_pcas.append([]), self._angle_pcas.append([])
self.var_length = ... |
# -*- coding: utf-8 -*-
from __future__ import division
from relativity import constants
import math
class LorentzFactor(object):
@staticmethod
def get_beta(velocity, is_percent):
if is_percent:
return velocity
return velocity / constants.SPEED_OF_LIGHT
@staticm... |
class NumericDataSet(object):
def __init__(self):
self.data = {}
self.str_to_num_mapping = {}
self.num_to_str_mapping = {}
def add(self, label, image):
try:
self.data[label].append(image)
except:
self.data[label] = [image]
numerical_id... |
#!usr/bin/python
# -*- coding:utf-8 -*-
import pandas as pd
import numpy as np
import scipy as sp
import os
import random
import time
import sys
from LSFS_TEST import print_W
from EProjSimplex_new import *
def append_module_path():
import sys
paths = [ \
"../gen_data",
"../evaluate",
... |
"""
urlquery module
"""
import cache
import database
def compose_response(is_malware=False):
response = { "malware" : str(is_malware) }
return response
def exists_in_cache(url, cache_hostname):
return cache.exists(url, cache_hostname)
def exists_in_database(url, db_hostname, table_name, conf):
... |
import keystone.manage
DEFAULT_FIXTURE = [
# Tenants
('tenant', 'add', '1234'),
('tenant', 'add', 'ANOTHER:TENANT'),
('tenant', 'add', '0000'),
('tenant', 'disable', '0000'),
# Users
('user', 'add', 'joeuser', 'secrete', '1234'),
('user', 'add', 'joeadmin', 'secrete', '1234'),
('user', 'add... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate,
)
class KhanAcademyIE(InfoExtractor):
_VALID_URL = r'^https?://(?:(?:www|api)\.)?khanacademy\.org/(?P<key>[^/]+)/(?:[^/]+/){,2}(?P<id>[^?#/]+)(?:$|[?#])'
IE_NAME = 'KhanAcademy'
... |
"""
############################################################
Impressious - Teste Principal
############################################################
Verifica a funcionalidade do cliente web.
"""
import unittest
from impressious.core import Impressious, Slide, Sprite, Menu, LOREM, DIM, GUI
from impressious impo... |
from gnuradio import gr, gr_unittest
import math
class test_integrate (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_000_ss(self):
src_data = (1, 2, 3, 4, 5, 6)
dst_data = (6, 15)
src = gr.vector_source_s(src_data)
itg... |
import proto # type: ignore
from google.cloud.aiplatform_v1beta1.types import artifact
from google.cloud.aiplatform_v1beta1.types import event
from google.cloud.aiplatform_v1beta1.types import execution
__protobuf__ = proto.module(
package='google.cloud.aiplatform.v1beta1',
manifest={
'LineageSubgra... |
import BoostBuild
import os
def basic():
t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
t.write("file.jam", """\
actions do-print
{
echo updating $(<)
}
NOTFILE target1 ;
ALWAYS target1 ;
do-print target1 ;
UPDATE_NOW target1 ;
DEPENDS all : target1 ;
""")
t.run_build_system(["-ffile.jam"],... |
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on January, 24, 2013
@author: Sourabh Bajaj
@contact: <EMAIL>
@summary: Example tutorial code.
'''... |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from .error import *
from .nodes import *
import datetime, sys, copyreg, types, base64
class RepresenterError(YAMLError):
pass
class BaseRepresenter:
yaml_representers = {}
yaml_multi_representers = {}
def __in... |
from clock import clock
class Measure:
def __init__(self, max_rate_period, fudge = 1):
self.max_rate_period = max_rate_period
self.ratesince = clock() - fudge
self.last = self.ratesince
self.rate = 0.0
self.total = 0l
def update_rate(self, amount):
self.total +=... |
import io
import shutil
import pytest
from unittest import mock
from mitmproxy.test import tflow
from mitmproxy.test import taddons
from mitmproxy.test import tutils
from mitmproxy.addons import dumper
from mitmproxy import exceptions
from mitmproxy.tools import dump
from mitmproxy import http
def test_configure():... |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class Ro220IE(InfoExtractor):
IE_NAME = '220.ro'
_VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)'
_TEST = {
'url': ... |
import time
from openerp.report import report_sxw
from common_report_header import common_report_header
from openerp.tools.translate import _
from openerp.osv import osv
class report_account_common(report_sxw.rml_parse, common_report_header):
def __init__(self, cr, uid, name, context=None):
super(report... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
import datetime
import time
try:
from zabbix_api import ZabbixAPI
HAS_ZABBIX_API = True
except ImportError:
HAS_ZABBIX_API = False
def create_maintenance(zbx, group... |
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
MagicMock,
patch
)
ensure_in_syspath('../../')
# Import Salt Libs
from salt.excepti... |
"""Tests for tensorflow.kernels.edit_distance_op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import ops
from tensorflow.python.framework import ... |
#!/usr/bin/env python
'''
This module runs tests against Cisco IOS devices.
setup_module: setup variables for later use.
test_init_method: verify attributes get set properly in init
test_session_preparation: verify session_preparation method
test_establish_connection: verify SSH connection gets established
test_disab... |
"""Generates API documentation by introspection."""
from django.contrib.auth.models import AnonymousUser
import rest_framework
from rest_framework import viewsets
from rest_framework.serializers import BaseSerializer
from .introspectors import (
APIViewIntrospector,
BaseMethodIntrospector,
IntrospectorHelp... |
"""Platform-independent MediumInteger type."""
from sqlalchemy.types import Integer, TypeDecorator
from sqlalchemy.dialects.mysql import MEDIUMINT
class LegacyMediumInteger(TypeDecorator):
"""Platform-independent MediumInteger type.
Uses MySQL's :class:`~sqlalchemy.dialects.mysql.MEDIUMINT` type, otherwise... |
"""DB related custom exceptions."""
from neutron.openstack.common.gettextutils import _
class DBError(Exception):
"""Wraps an implementation specific exception."""
def __init__(self, inner_exception=None):
self.inner_exception = inner_exception
super(DBError, self).__init__(str(inner_exceptio... |
"""Pylons middleware initialization"""
from beaker.middleware import CacheMiddleware, SessionMiddleware
from paste.cascade import Cascade
from paste.registry import RegistryManager
from paste.urlparser import StaticURLParser
from paste.auth.basic import AuthBasicHandler
from paste.deploy.converters import asbool
from p... |
"""Change the upstream of the current branch."""
import argparse
import sys
import subprocess2
from git_common import upstream, current_branch, run, tags, set_branch_config
from git_common import get_or_create_merge_base, root, manual_merge_base
import git_rebase_update
def main(args):
root_ref = root()
parse... |
import json
import os
from ansible.module_utils.urls import fetch_url
from ansible.module_utils._text import to_text
from ansible.module_utils.basic import env_fallback
class Response(object):
def __init__(self, resp, info):
self.body = None
if resp:
self.body = resp.read()
se... |
# -*- coding: utf-8 -*-
import os
from setuptools import find_packages, setup
def prerelease_local_scheme(version):
"""Return local scheme version unless building on master in CircleCI.
This function returns the local scheme version number
(e.g. 0.0.0.dev<N>+g<HASH>) unless building on CircleCI for a
... |
from __future__ import print_function, division
try:
from pyglet.gl.gl import c_float
except ImportError:
pass
from pyglet.gl import *
from math import sqrt as _sqrt, acos as _acos
def cross(a, b):
return (a[1] * b[2] - a[2] * b[1],
a[2] * b[0] - a[0] * b[2],
a[0] * b[1] - a[1] *... |
from django.contrib.sites.models import Site
from django.db import models
from django.test import TestCase
from models.publication import Publication
from models.article import Article
class Advertisment(models.Model):
customer = models.CharField(max_length=100)
publications = models.ManyToManyField(
... |
import re
import sys
import sqlite3
import numpy as np
import multiprocessing as mp
from lib.data import *
from lib.utils import *
from lib.retriever import DataRetriever
from lib.grapher import *
from lib.stats import compute_eer, find_eer
usage = "Usage: python analyser.py <path to card DB> <path to reader db> <pat... |
"""Unit tests for the access_control_firerole library."""
__revision__ = "$Id$"
import unittest
from invenio.access_control_firerole import compile_role_definition, \
serialize, deserialize, acc_firerole_check_user
from invenio.access_control_config import InvenioWebAccessFireroleError, \
CFG_ACC_EMPTY_R... |
import logging
import logging.handlers
import sys
import warnings
from logging import LogRecord
import ecs_logging
import pytest
import structlog
from elasticapm.conf import Config
from elasticapm.conf.constants import ERROR
from elasticapm.handlers.logging import Formatter, LoggingFilter, LoggingHandler
from elastic... |
"""sympify -- convert objects SymPy internal format"""
from __future__ import print_function, division
from inspect import getmro
from .core import all_classes as sympy_classes
from .compatibility import iterable, string_types, range
from .evaluate import global_evaluate
class SympifyError(ValueError):
def __i... |
import os, re
class IOCommon(object):
conf = {}
def __init__(self, sc):
self.sc = sc
@classmethod
def getProperty(cls, key, default = None):
return cls.conf.get(key, default)
@classmethod
def getPropertiesFromFile(cls):
def split(x):
ret = re.split("\s", x.... |
"""Test init of AccuWeather integration."""
from homeassistant.components.accuweather.const import DOMAIN
from homeassistant.config_entries import (
ENTRY_STATE_LOADED,
ENTRY_STATE_NOT_LOADED,
ENTRY_STATE_SETUP_RETRY,
)
from homeassistant.const import STATE_UNAVAILABLE
from tests.async_mock import patch
fr... |
"""
System settings
===============
"""
from __future__ import with_statement
from fabric.api import hide, run, settings
from fabtools.files import is_file
from fabtools.utils import run_as_root
class UnsupportedFamily(Exception):
"""
Operation not supported on this system family.
::
from fabt... |
import shutil
import datetime
import re
import tempfile
import urlparse
# ==============================================================
# url handling
def url_filename(url):
fn = os.path.basename(urlparse.urlsplit(url)[2])
if fn == '':
return 'index.html'
return fn
def url_get(module, url, dest... |
import pytest
@pytest.fixture
def genetic_modification_1(lab, award):
return {
'modification_type': 'deletion',
'award': award['uuid'],
'lab': lab['uuid'],
'modifiction_description': 'some description'
}
@pytest.fixture
def genetic_modification_2(lab, award):
return {
... |
""" Defines a view model for Graphs. """
#------------------------------------------------------------------------------
# Imports:
#------------------------------------------------------------------------------
import sys
from os.path import join, dirname, expanduser, isfile
import logging
import pickle
from entho... |
import os
import sys
import time
from spacewalk.common import usix
import server.importlib.headerSource
import server.importlib.packageImport
import server.importlib.backendOracle
import server.xmlrpc.up2date
from spacewalk.server import rhnSQL, rhnChannel, rhnServer, rhnUser, rhnServerGroup, rhnActivationKey
from spac... |
import re
from ftrace.common import ParserError
from .register import register_parser
from collections import namedtuple
#from ftrace.third_party.cnamedtuple import namedtuple
TRACEPOINT = 'workqueue_execute_end'
__all__ = [TRACEPOINT]
WorkqueueQueueExecuteEndBase = namedtuple(TRACEPOINT,
[
'work_struct',
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import re
import logging
import six
from w3lib import html
from scrapy.exceptions import NotConfigured
from scrapy.http import HtmlResponse
from scrapy.utils.response import _noscript_re, _script_re
logger = logging.getLogger(__name__)
class AjaxCrawl... |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetR... |
# -*- coding: utf-8 -*-
"""
getargspec excerpted from:
sphinx.util.inspect
~~~~~~~~~~~~~~~~~~~
Helpers for inspecting Python modules.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import inspect
from ipython_genutils.py3compat ... |
"""1-D convolutional neural network glyph classifier model.
Convolves a filter horizontally along a staffline, to classify glyphs at each
x position.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from moonlight.protobuf impor... |
"""
Support for ZoneMinder camera streaming.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.zoneminder/
"""
import logging
from homeassistant.const import CONF_NAME, CONF_VERIFY_SSL
from homeassistant.components.camera.mjpeg import (
CONF_MJP... |
__author__ = "Noah Meltzer"
__copyright__ = "Copyright 2016, McDermott Group"
__license__ = "GPL"
__version__ = "1.0.2"
__maintainer__ = "Noah Meltzer"
__status__ = "Beta"
from MFrame import MFrame
from PyQt4 import QtCore
from PyQt4.QtCore import QObject, pyqtSignal, pyqtSlot, QThread
import threading
from... |
"""
.. todo::
WRITEME
"""
__author__ = "Ian Goodfellow"
# TODO: add citation
import numpy as np
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
class Iris(DenseDesignMatrix):
"""
.. todo::
WRITEME
"""
def __init__(self, preprocessor=None):
"""
.. ... |
from __future__ import absolute_import
from __future__ import print_function
import base64
import cStringIO
from PIL import Image
import json
import math
import numpy as np
import os
import shutil
import sys
import tempfile
import unittest
import tensorflow as tf
from tensorflow.python.lib.io import file_io
# To mak... |
import sys
import string
import getpass
from optparse import OptionParser, Option
import rhn_log
import cfg_exceptions
import local_config
class HandlerBase:
_options_table = []
_option_parser_class = OptionParser
_usage_options = "[options]"
_option_class = Option
def __init__(self, args, reposit... |
from units.compat import unittest
from oneview_module_loader import NetworkSetInfoModule
from hpe_test_utils import FactsParamsTestCase
ERROR_MSG = 'Fake message error'
PARAMS_GET_ALL = dict(
config='config.json',
name=None
)
PARAMS_GET_ALL_WITHOUT_ETHERNET = dict(
config='config.json',
name=None,
... |
from ...attrs import LIKE_NUM
_num_words = [
"సున్నా",
"శూన్యం",
"ఒకటి",
"రెండు",
"మూడు",
"నాలుగు",
"ఐదు",
"ఆరు",
"ఏడు",
"ఎనిమిది",
"తొమ్మిది",
"పది",
"పదకొండు",
"పన్నెండు",
"పదమూడు",
"పద్నాలుగు",
"పదిహేను",
"పదహారు",
"పదిహేడు",
"పద్దెనిమి... |
import sys, json, httplib, time, datetime, mysqlutil, couchdb
class OH:
def __init__(self):
# only works for one session
# need to look at how the login is being done
self.authToken = "502294fa-10b1-4cd5-ae2c-c46f13a440d6"
self.account = "1880009"
self.host = "trading.optionshouse.com"
s = couchdb.Ser... |
from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, string_types
__all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN",
"TreeWalker", "NonRecursiveTreeWalker"]
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE... |
from contextlib import nested
import mock
from oslo.config import cfg
from neutron.agent import rpc
from neutron.openstack.common import context
from neutron.tests import base
class AgentRPCPluginApi(base.BaseTestCase):
def _test_rpc_call(self, method):
agent = rpc.PluginApi('fake_topic')
ctxt = ... |
from astropy.io import fits as pyfits
import pyregion
import warnings
import numpy
class FitsRegionFile(object):
def __init__(self, filename, minimumSize=0):
with pyfits.open(filename) as f:
header = f['EVENTS'].header
self.X = f['EVENTS'].... |
import pytest
from pip._internal.cli.status_codes import ERROR, SUCCESS
from tests.lib.path import Path
from tests.lib.wheel import make_wheel
@pytest.fixture()
def make_fake_wheel(script):
def _make_fake_wheel(wheel_tag):
wheel_house = script.scratch_path.joinpath("wheelhouse")
wheel_house.mkdi... |
"""Simple DNS server comparison benchmarking tool.
Designed to assist system administrators in selection and prioritization.
"""
__author__ = '<EMAIL> (Thomas Stromberg)'
import Queue
import random
import threading
import time
class BenchmarkThreads(threading.Thread):
"""Benchmark multiple nameservers in paralle... |
# -*- coding:utf-8 -*-
from __future__ import division
import logging
import numpy as np
import os
import pandas as pd
from liam2.importer import array_to_disk_array
from ipp_macro_series_parser.scripts.utils import line_prepender
log = logging.getLogger(__name__)
def check_directory_existence(directory):
i... |
from __future__ import division
from __future__ import unicode_literals
__all__ = ['freqz']
import numpy
from numpy import *
Num=numpy
def atleast_1d(*arys):
""" Force a sequence of arrays to each be at least 1D.
Description:
Force an array to be at least 1D. If an array is 0D, the
... |
from oslo_log import log as logging
from nova.scheduler import filters
from nova.scheduler.filters import utils
LOG = logging.getLogger(__name__)
class AggregateMultiTenancyIsolation(filters.BaseHostFilter):
"""Isolate tenants in specific aggregates."""
# Aggregate data and tenant do not change within a r... |
from __future__ import unicode_literals
from django.core.paginator import Paginator, InvalidPage
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, ContextMixin, View
c... |
# -*- coding: utf-8 -*-
"""
cupoftee.pages
~~~~~~~~~~~~~~
The pages.
:copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import operator
from werkzeug import redirect
from werkzeug.exceptions import NotFound
from cupoftee.applic... |
import unittest
import os
import numpy as np
from ..sensitivity_tools import gen_params
cwd = os.getcwd()
class TestGenParams(unittest.TestCase):
"""Tests for gen_params"""
def test_num_vars_not_integer(self):
"""Is an error raised if num_vars is not an integer?"""
names = ['para1', 'para2'... |
"""SHA-512 cryptographic hash algorithm.
SHA-512 belongs to the SHA-2_ family of cryptographic hashes.
It produces the 512 bit digest of a message.
>>> from Crypto.Hash import SHA512
>>>
>>> h = SHA512.new()
>>> h.update(b'Hello')
>>> print h.hexdigest()
*SHA* stands for Secure Hash Algorithm.
.... |
"""An implementation of the Zephyr Abstract Syntax Definition Language.
See http://asdl.sourceforge.net/ and
http://www.cs.princeton.edu/research/techreps/TR-554-97
Only supports top level module decl, not view. I'm guessing that view
is intended to support the browser and I'm not interested in the
browser.
Changes... |
"""Tests for SparseSoftmaxCrossEntropyWithLogits op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import time
import numpy as np
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.client import session
from tensorflow.... |
import account_invoice
import account_journal
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
from Screens.Screen import Screen
from Screens.Standby import TryQuitMainloop
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Pixmap import Pixmap
from Components.Sources.StaticText import StaticText
from Components.MenuList import MenuList
from Plugins.Plugin ... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-ComputerDetails',
'Author': ['@JosephBialek'],
'Description': ('Enumerates useful information on the system. By default, all checks are run.'),
... |
"""
================================================
Kernel Density Estimate of Species Distributions
================================================
This shows an example of a neighbors-based query (in particular a kernel
density estimate) on geospatial data, using a Ball Tree built upon the
Haversine distance metric... |
"""Support for Amcrest IP camera sensors."""
from datetime import timedelta
import logging
from amcrest import AmcrestError
from homeassistant.const import CONF_NAME, CONF_SENSORS, PERCENTAGE
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from .c... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import determine_ext
class ThisAVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?thisav\.com/video/(?P<id>[0-9]+)/.*'
_TEST = {
'url': 'http://www.thisav.com/video/47734/%98%26sup1%3... |
import os
import glob
from fable import front
from fable import config
from fable.logs import log, handler, shutdown
from fable.back.end import main, bye
from sanic import Sanic
from sanic import log as sanic_log
_app = Sanic()
_log = log('backend')
def add_static(app, root, path):
extensions = {'png', 'woff', 'w... |
import webob
from nova.api.openstack.compute.schemas import flavor_manage
from nova.api.openstack.compute.views import flavors as flavors_view
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api import validation
from nova.compute import flavors
from nova import exception
ALIAS... |
"""
Utility class for VHD related operations.
Official VHD format specs can be retrieved at:
http://technet.microsoft.com/en-us/library/bb676673.aspx
See "Download the Specifications Without Registering"
Official VHDX format specs can be retrieved at:
http://www.microsoft.com/en-us/download/details.aspx?id=34750
VHD... |
"""Utilities for working with and creating SaveableObjects."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.python.eager import context
from tensorflow.python.framework import device as pydev
from tensorflow.python.framework im... |
# -*- coding: utf-8 -*-
""" *==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3... |
# -*- coding: utf-8 -*-
"""
Remove (delete) files and directories.
usage: rm.py [-h] [-r] [-i] [-f] [-v] paths [paths ...]
positional arguments:
paths files or directories to delete
optional arguments:
-h, --help show this help message and exit
-r, --recursive remove directory and its c... |
"""Test the fulltext implementation"""
import logging
import os
import transaction
import urllib
from pyramid import testing
from unittest import TestCase
from bookie.lib.readable import ReadContent
from bookie.lib.readable import ReadUrl
from bookie.models import DBSession
from bookie.tests import empty_db
LOG = ... |
from __future__ import print_function, division, absolute_import
import logging
from numpy import nan
from .base_predictor import BasePredictor
from .binding_prediction import BindingPrediction
from .binding_prediction_collection import BindingPredictionCollection
from .unsupported_allele import UnsupportedAllele
lo... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'core',
'version': '1.0'}
DOCUMENTATION = r'''
---
module: win_owner
version_added: "2.1"
short_description: Set owner
description:
- Set owner of files or directories
options:
path:
description:
- Path t... |
import os,sys
sys.path.append("/opt/livingdata/lib")
from livdatbender import *
from libsoma import *
import pygsheets
from bs4 import BeautifulSoup
def get_color_json(dictionary):
formatted_json=get_formatted_json(dictionary)
colorful_json = highlight(unicode(formatted_json, 'UTF-8'), lexers.JsonLexer(), formatte... |
import copy
from st2common.constants.rules import TRIGGER_PAYLOAD_PREFIX
from st2common.constants.system import SYSTEM_KV_PREFIX
from st2common.services.keyvalues import KeyValueLookup
from st2common.util import jinja as jinja_utils
class Jinja2BasedTransformer(object):
def __init__(self, payload):
self.... |
from lammps_data.bonds import extrapolate_bonds
def test_atoms_too_close_should_not_be_bonded():
atoms = [(0.0, 0.0, 0.0, 1), (0.0, 0.0, 0.159, 1)]
bonds = extrapolate_bonds(atoms)
assert len(bonds) == 0
def test_atoms_at_0_16_angstrom_should_be_bonded():
atoms = [(0.0, 0.0, 0.0, 1), (0.0, 0.0, 0.16... |
import logging
import os
import shutil
import sys
from typing import List
import semver
logger = logging.getLogger(__name__)
INSTALL_PATH = sys.path[0]
SOFTWARE_REPO = "virtool/virtool"
RELEASE_KEYS = [
"name",
"body",
"prerelease",
"published_at",
"html_url"
]
def check_software_files(path):... |
# -*- coding: utf-8 -*-
import unittest
from flask import current_app
from app import create_app, db
from app.models import User, Todo, TodoList
class TodolistTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
self.a... |
from geonition_utils.HttpResponseExtenders import HttpResponseNotImplemented
from geonition_utils.HttpResponseExtenders import HttpResponseCreated
from geonition_utils.HttpResponseExtenders import HttpResponseUnauthorized
from django.core.urlresolvers import reverse
from models import MediaItem
import json
def media_... |
import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FEC COMMITTEE ID NUMBER', 'number': '2'},
{'name': 'NAT PARTY COMMITTEES %', 'number': '3'}... |
#-*- coding: utf-8 -*-
import features
from model import NeuralNetworkModel, SVMModel, RandomModel, MaximumModel, FannModel
import datetime
# from helpers import normalize
try:
from Summarizer.helpers import normalize
except ImportError:
from helpers import normalize
try:
from Summarizer.models import Si... |
from boto.rds.dbsecuritygroup import DBSecurityGroup
from boto.rds.parametergroup import ParameterGroup
from boto.rds.statusinfo import StatusInfo
from boto.rds.dbsubnetgroup import DBSubnetGroup
from boto.rds.vpcsecuritygroupmembership import VPCSecurityGroupMembership
from boto.resultset import ResultSet
class DBIn... |
"""
sage_parser.py
Code for parsing Sage code blocks sensibly.
"""
#########################################################################################
# Copyright (C) 2013 William Stein <<EMAIL>> #
# ... |
#=======================================================================
#
# Python Lexical Analyser
#
# Exception classes
#
#=======================================================================
class PlexError(Exception):
message = ""
class PlexTypeError(PlexError, TypeError):
pass
class PlexValue... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.