content stringlengths 4 20k |
|---|
import os
import sys
import re
import types
import itertools
import matplotlib.pyplot as plt
import numpy
import numpy.ma
from ChipseqReport import *
import Annotations
##########################################################################
##########################################################################... |
import os
import unittest
from ott.otp_client.transit_index.routes import Routes
from ott.otp_client.transit_index.stops import Stops
from ott.utils.geo.bbox import BBox
from ott.utils.geo.point import Point
from .base import *
class TiTest(unittest.TestCase):
db = None
DO_PG = False
PG_URL = "postgresq... |
"""Fetches, embeds, and displays lyrics.
"""
from __future__ import print_function
import re
import logging
import urllib
import json
import unicodedata
import difflib
from beets.plugins import BeetsPlugin
from beets import ui
from beets import config
# Global logger.
log = logging.getLogger('beets')
DIV_RE = re.... |
import os
import re
from cadb.utils import FileSystem
PATTERN_DIRECTIVES = re.compile(r"^(#.+)")
PATTERN_INCLUDES = re.compile(r"^#include (.+)")
class SourceFile:
def __init__(self, includes_config, path, file_type, db_hash=None, object_file_path=None):
"""
Creates a new source file object.
... |
from unittest import TestCase
import dnaStringLibrary
def TEST_STR():
return "GATGGAACTTGACTACGTAAATT"
def EXPECTED_STR():
return "GAUGGAACUUGACUACGUAAAUU"
class RnaTranscriptionTestClass(TestCase):
def testDnaToRnaTranscriptionUpperCase(self):
transStr = dnaStringLibrary.dnaToRnaTranscription(... |
#-*- coding: utf-8 -*-
import hashlib
from django.conf import settings
from django.core.cache import get_cache
TIME_DICT = {
's': 1,
'm': 60,
}
class RateLimit:
def __init__(self, request, func_name, method=None, field=None, rate='5/5m'):
self.request = request
self.func_name = func_n... |
#!/usr/bin/env python
"""
Dump out all the pictures from a keynote presentation keeping their
adjusted sizes. It assumes the slides are for arranging pictures
on a full or half size presentation board.
This example relies on having PIL installed.
"""
import os
import sys
import argparse
try:
import Image
PI... |
from weboob.tools.test import BackendTest
class YahooTest(BackendTest):
BACKEND = 'yahoo'
def test_meteo(self):
l = list(self.backend.iter_city_search('paris'))
self.assertTrue(len(l) > 0)
city = l[0]
current = self.backend.get_current(city.id)
self.assertTrue(current... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : <EMAIL>
**... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 07 15:11:49 2014
@author: Maurizio Napolitano <<EMAIL>>
The MIT License (MIT)
Copyright (c) 2016 Fondazione Bruno Kessler http://fbk.eu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentat... |
"""Defines interface for DB access.
Functions in this module are imported into the sahara.db namespace. Call these
functions from sahara.db namespace, not the sahara.db.api namespace.
All functions in this module return objects that implement a dictionary-like
interface.
**Related Flags**
:db_backend: string to lo... |
from __future__ import unicode_literals
import sys
from xylem.install import install
from xylem.config import get_config
from xylem.log_utils import info
from xylem.log_utils import error
from xylem.exception import exc_to_str
from xylem.util import indent
from .main import command_handle_args
DESCRIPTION = ""... |
'''
Created on Apr 18, 2012
@package: superdesk media archive
@copyright: 2012 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Gabriel Nistor
Contains the SQL alchemy meta for media meta info API.
'''
from ..api.meta_info import MetaInfo
from sqlalchemy.dialects.mysql.base import INTEG... |
import numpy as np
import gdal
import glob
from raster_mask import *
from smoothn import *
def auto_rmask(input_in, shape_in):
'''
This function takes:
1. An input Landsat 8 image.
2. An input shapefile
which will:
1. Mask the input file to the boundaries of the input shapefile.
Notes:
... |
# Breadth First Search
def bfs(graph, start):
color = dict()
distance = dict()
parent= dict()
for key in graph.keys():
color[key] = 'W'
distance[key] = 0
parent[key] = None
color[start] = 'G'
queue = list()
queue.append(start)
while len(queue) > 0:
u = q... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... |
import os
from mi.core.versioning import version
from mi.dataset.dataset_driver import SimpleDatasetDriver, ParticleDataHandler
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.dataset.parser.dofst_k_wfp import DofstKWfpParser
from mi.dataset.parser.wfp_c_file_common import WfpCFileCommonConfigKey... |
import random
import getopt
import sys
import errno
import base64
optlist, args = getopt.getopt(sys.argv[1:], '?c:w:dhob6ks:X:N:', ["help"])
if len(args) > 0:
sys.stderr.write("%s: Error: Unexpected command line argument '%s'.\n" % (sys.argv[0], args[0]))
sys.exit(errno.EINVAL);
FMT_DEC = 0
... |
__author__ = 'kevin'
from PySide.QtCore import QCoreApplication
END_OF_OPTIONS = "--"
class TokenType(object):
OptionalToken, RequiredToken = range(2)
class OptionsParser(object):
NO_LOAD_OPTION = "-noload"
TEST_OPTION = "-test"
PROFILE_OPTION = "-profile"
def __init__(self, args, appOptions... |
import unittest
import IECore
import Gaffer
import GafferUI
import GafferUITest
class StandardNodeGadgetTest( GafferUITest.TestCase ) :
def testContents( self ) :
n = Gaffer.Node()
g = GafferUI.StandardNodeGadget( n )
self.failUnless( isinstance( g.getContents(), GafferUI.NameGadget ) )
self.assert... |
"""A microbenchmark for measuring DistributionAccumulator performance
This runs a sequence of distribution.update for random input value to calculate
average update time per input.
A typical update operation should run into 0.6 microseconds
Run as
python -m apache_beam.tools.distribution_counter_microbenchmark
"""
... |
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import exceptions
from tempest.test import attr
class KeyPairsNegativeTestJSON(base.BaseV2ComputeTest):
_interface = 'json'
@classmethod
def setUpClass(cls):
super(KeyPairsNegativeTestJSON, cls).setUpCla... |
import time
t0t=time.time()
from os.path import join
import os
import numpy as n
import glob
import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as p
import astropy.io.fits as fits
from scipy.interpolate import interp1d
from scipy.stats import norm as gaussD
plate = sys.argv[1]
mjd =... |
"""
Helper for views.py
"""
from base_handler import base_handler
import traceback
import urllib2
from flask import session
from docker import Client
from utils import randomword, copyfiles
import ssl
import os
import shutil
DOCKER_URL = 'unix://var/run/docker.sock'
class container_handler(base_handler):
def _... |
from indico.modules.events.editing.controllers import frontend
from indico.modules.events.editing.controllers.backend import common, editable_list, management, service, timeline
from indico.web.flask.wrappers import IndicoBlueprint
_bp = IndicoBlueprint('event_editing', __name__, url_prefix='/event/<int:event_id>', t... |
import time
import yampy
#Secrets scrubbed
client_id = ""
client_secret = ""
redirect_uri = ""
code = ""
access_token = ""
newestMsgID = 0
currentID = 0
MAX_MSG_LIMIT = 10000000000
currentPgLowerMsgID = MAX_MSG_LIMIT
users = dict()
moreToProcess = True
MAX_MSG_PER_PAGE = 20
restCall = 0 # Keep track of how many tim... |
from __future__ import unicode_literals
from __future__ import absolute_import
from .. import unittest
from fig import Service
from fig.service import ConfigError, split_port
class ServiceTest(unittest.TestCase):
def test_name_validations(self):
self.assertRaises(ConfigError, lambda: Service(name=''))
... |
import sys
import re
import json
import datetime
import collections
import textwrap
try:
import urllib2
except ImportError:
import urllib.request as urllib2
# List of people to ping when the status of a tool changed.
MAINTAINERS = {
'miri': '@oli-obk @RalfJung @eddyb',
'clippy-driver': '@Manishearth @l... |
"""
soapdenovo2_pregraph_sparse.py
A wrapper script for SOAPdenovo2 pregraph sparse module
Copyright Peter Li - GigaScience and BGI-HK
"""
import optparse
import os
import shutil
import subprocess
import sys
import tempfile
import re
import fnmatch
def stop_err(msg):
sys.stderr.write(msg)
sys.exit()
def ... |
'''
Segregated version of #12
Things to try:
- Go/NoGo populations also inhibit each other (so no two actions can fire at once)
'''
import os,sys
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0,parentdir)
from pyN import *
#substantia nigra releases dopamine. Stimulate this ... |
from __future__ import division
from xml.auto_gen import XMLDAOListBase
from sql.auto_gen import SQLDAOListBase
from vistrails.core.system import get_elementtree_library
from vistrails.db import VistrailsDBException
from vistrails.db.versions.v0_9_0 import version as my_version
ElementTree = get_elementtree_library(... |
from spack import *
class RRda(RPackage):
"""Shrunken Centroids Regularized Discriminant Analysis for the
classification purpose in high dimensional data."""
homepage = "https://cran.r-project.org/web/packages/rda/index.html"
url = "https://cran.r-project.org/src/contrib/rda_1.0.2-1.tar.gz"
... |
"""Calculate and manipulate CRC32.
http://en.wikipedia.org/wiki/Cyclic_redundancy_check
-- StalkR
"""
import struct
import sys
# Polynoms in reversed notation
POLYNOMS = {
'CRC-32-IEEE': 0x04C11DB7, # 802.3
}
class Error(Exception):
pass
class CRC32(object):
"""A class to calculate and manipulate CRC32.
Use... |
"""
Created on Wed Nov 19 00:18:55 2014
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 2 of the License, or
(at your option) any later version.
This program is distributed in the ho... |
## 3. Read in a CSV file ##
import pandas as pd
food_info = pd.read_csv('food_info.csv')
print(type(food_info))
## 4. Exploring the DataFrame ##
print(food_info.head(3))
dimensions = food_info.shape
print(dimensions)
num_rows = dimensions[0]
print(num_rows)
num_cols = dimensions[1]
print(num_cols)
first_twenty = foo... |
import MySQLdb
import sys
import re
host = 'localhost'
user = 'teseo'
password = 'teseo'
database='teseo'
conn = MySQLdb.Connection(db=database, host=host, user=user, passwd=password)
cursor = conn.cursor()
cursor.execute('select count(*) from person;')
total_persons = cursor.fetchall()[0][0]
sql_regex = '^([[:space... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
from lib import HashHelper
from lib import ValidationHelper, ConversionHelper, WsIntrospectionHelper, ComparisonHelper, ScrapyItemizableMixin
from ..base import BaseWrapper
from .exception import InvalidMimeStringError, MarkupAttributeNotFo... |
"""Hierarchical cluster AL method.
Implements algorithm described in Dasgupta, S and Hsu, D,
"Hierarchical Sampling for Active Learning, 2008
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from sklearn.cluster import AgglomerativeCl... |
from setuptools import setup
from codecs import open
import os
here = os.path.abspath(os.path.dirname(__file__))
package_name = "pyboot"
# Get the long description from the README file
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
packages = [package_name]
for di... |
"""This module contains all classes related to configuration file
generation.
"""
import sys, os, re, datetime, shutil
from django.db import models
from slam.models import SLAMBaseModel
class DuplicateRecordError(Exception):
"""Raised when a record already exists in a configuration file."""
pass
class Conf... |
"""
Convenient shortcuts to manage or check object permissions.
"""
from django.contrib.auth.models import Permission, User, Group
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import Q
from django.shortcuts import _get_queryset
from guardian.core import O... |
class NotReadyException(Exception):
pass
class Future(object):
def __init__(self, cid=None, response=None):
assert cid is not None or response is not None
self._cid = cid
self._response = response
def __response_eq__(self, resp1, resp2):
return resp1 == resp2
... |
"""PrimitiveWrapper subclass for Date primitives."""
import datetime
from typing import cast, Any, Callable, Dict, Tuple, Type, TypeVar
from google.protobuf import message
from google.fhir import _primitive_time_utils
from google.fhir import fhir_errors
from google.fhir.json_format.wrappers import _primitive_wrappers... |
import base64
import unittest
from google.cloud._helpers import _to_bytes
from google.cloud._helpers import _bytes_to_unicode
IMAGE_SOURCE = 'gs://some/image.jpg'
IMAGE_CONTENT = _to_bytes('/9j/4QNURXhpZgAASUkq')
B64_IMAGE_CONTENT = _bytes_to_unicode(base64.b64encode(IMAGE_CONTENT))
CLIENT_MOCK = {'source': ''}
cla... |
#!/usr/bin/env python
# Standard packages
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import annotation
from ddb_ngsflow import pipeline
from ddb_ngsflow.coverage import sambamba
if __name__ == "__main__":
parser = ... |
import datetime
import os
import hashlib
from PIL import Image
from django.db import models
from django.core.files import File
from django.core.files.base import ContentFile
from django.core.files.storage import get_storage_class
from django.utils.translation import ugettext as _
from django.utils import six
from djan... |
#!/usr/bin/env python
"""
obf_handler.py:
Outbound faxing handler object which is responsible to deliver the fax;
each handler will run on its own little thread environment so multiple
requests could be handle at the same time.
Note: this class will NOT utilize any locking mechanism since each
ins... |
""" Link Layer Discovery Protocol TLVs """
import functools
# See http://construct.readthedocs.io/en/latest/index.html
import construct
from construct import core
import netaddr
from ironic_inspector import utils
LOG = utils.getProcessingLogger(__name__)
# Constants defined according to 802.1AB-2016 LLDP spec
# ht... |
import click
from datalake.common.conf import load_config
from ingester import Ingester
DEFAULT_CONFIG = '/etc/datalake-ingester.env'
@click.group(invoke_without_command=True)
@click.version_option()
@click.option('-c', '--config',
help='config file. The format is just a dotenv file')
@click.option('-... |
"""
This file is a special version of the configuration loader. It has been modified to
support the conversion from CONF to YAML format. This configuration loader is only called
by the converter tools/conf_to_yaml_converter.py.
"""
import os
RUAMEL_YAML_INSTALLED = False
try:
import ruamel.yaml as yaml
... |
import codecs
import os
from conda_kapsel.internal.test.tmpfile_utils import with_directory_contents
from conda_kapsel.project_file import ProjectFile, DEFAULT_PROJECT_FILENAME, possible_project_file_names
expected_default_file = """# This is an Anaconda project file.
#
# Here you can describe your project and how to... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.contrib.contenttypes.models import ContentType
from datatrans.models import make_digest, KeyValue
from datatrans.utils import get_registry
from collections import defaultdict
class Mig... |
from oslo_log import log as logging
from six import moves
import sqlalchemy
from sqlalchemy.orm import properties
from neutron.common import exceptions as n_exc
LOG = logging.getLogger(__name__)
def paginate_query(query, model, limit, sorts, marker_obj=None):
"""Returns a query with sorting / pagination criter... |
"""Management of sessions - saved tabs/windows."""
import os
import sip
import os.path
from PyQt5.QtCore import pyqtSignal, QUrl, QObject, QPoint, QTimer
from PyQt5.QtWidgets import QApplication
import yaml
try:
from yaml import CSafeLoader as YamlLoader, CSafeDumper as YamlDumper
except ImportError: # pragma: n... |
import rnftools
import pysam
import re, sys
class RnfLifter:
def __init__(
self,
chain_fn,
fai_fn,
invert=False,
):
self._fai_fn = fai_fn
self._chain_fn = chain_fn
self._invert = invert
if chain_fn is not None:
with open(chain_fn) a... |
from sahara.plugins.cdh import confighints_helper as ch_helper
from sahara.plugins.cdh import edp_engine
from sahara.plugins.cdh.v5_11_0 import cloudera_utils as cu
from sahara.service.edp.oozie import engine as oozie_engine
from sahara.utils import edp
class EdpOozieEngine(edp_engine.EdpOozieEngine):
def __init... |
import asposeslidescloud
from asposeslidescloud.SlidesApi import SlidesApi
from asposeslidescloud.SlidesApi import ApiException
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage
apiKey = "XXXXX" #sepcify App Key
appSid = "XXXXX" #s... |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Employee and Attendance"),
"items": [
{
"type": "doctype",
"name": "Employee",
"description": _("Employee records."),
},
{
"type": "doctype",
"name": "Employee Attendance To... |
# system import
import base64
# local import
from kad_id import kad_id
from kad_delay import kad_delay
class kad_rec:
'''Class to contain a kad_rec'''
def __init__( self, args = [] ):
'''Constructor'''
assert len( args ) == 4
self.recid = kad_id( args[0] )
self.keyid = kad_id( args[1] )
assert isinstan... |
from sentry.lang.native.utils import get_sdk_from_event
def test_get_sdk_from_event():
sdk_info = get_sdk_from_event({
'debug_meta': {
'sdk_info': {
'dsym_type': 'macho',
'sdk_name': 'iOS',
'version_major': 9,
'version_minor': 3,
... |
from __future__ import absolute_import
from django.core import serializers
from ajax.exceptions import AlreadyRegistered, NotRegistered
from django.db.models.fields import FieldDoesNotExist
from django.db import models
from django.conf import settings
from django.utils.html import escape
from django.db.models.query imp... |
from openerp import models, fields, api
class clv_insured_mng(models.Model):
_inherit = 'clv_insured_mng'
insurance_id = fields.Many2one('clv_insurance', 'Insurance') |
"""This module contains setup instructions for python-lambda."""
import codecs
import os
import sys
from shutil import rmtree
from setuptools import Command
from setuptools import find_packages
from setuptools import setup
REQUIREMENTS = [
"boto3>=1.4.4",
"click==6.6",
"PyYAML==5.1",
]
PACKAGE_DATA = {
... |
#!/usr/bin/python
from datetime import timedelta
from pymongo import Connection
import datetime
import json
import os
import requests
import time
import timeit
c = Connection()
#SETUP
report_query = """
import requests;
import json;
query_data=json.dumps({"user": "<EMAIL>",
"star... |
import logging
from friendlyurls.models import *
from django.core.urlresolvers import resolve
from django.http import HttpResponseForbidden, HttpResponse, Http404
from django.conf import settings
from django.core.cache import cache
log = logging.getLogger(__name__)
def resolve_friendly_url(request):
# Check to see... |
'''
spread.py
Takes a list of input ingredient names. Rotates and/or shifts each ingredient
slightly, importing it to the scene if it is not already there.
Thomas Storey
2016
'''
import sys
import argparse
import bpy
import numpy as np
import os
import bmesh
from math import *
from mathutils import *
import random
... |
#!/usr/bin/env python
import unittest
import os
import shutil
import json
gitgot = __import__('git-got')
class Utility:
def loadGotConfiguration(self, root):
file = open('%s/.got/storage' % root, 'r')
configuration = json.load(file)
file.close()
return configuration
class TestBase(unittest.TestCase... |
from oslo.config import cfg
import webob
from keystone.common import controller
from keystone.common import dependency
from keystone import exception
CONF = cfg.CONF
@dependency.requires('token_provider_api')
class SimpleCert(controller.V3Controller):
def _get_certificate(self, name):
try:
... |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: errors.py
import mcl.status
ERR_SUCCESS = mcl.status.MCL_SUCCESS
ERR_INVALID_PARAM = mcl.status.framework.ERR_START
ERR_NOT_IMPLEMENTED = mcl.status.... |
from django.contrib.auth.models import User
from django.db import models
from django.utils.functional import cached_property
from contract.models import Contract, Contractor, ParkingLot, ParkingPosition, ContractPayment
from master.models import BankAccount
from utils import constants, errors
from utils.django_base im... |
"""@author: Bryan Silverthorn <<EMAIL>>"""
import os
import pty
import subprocess
import borg
log = borg.get_logger(__name__)
def _child_preexec(environment):
"""Run in the child code prior to execution."""
# update the environment
for (key, value) in environment.iteritems():
os.putenv(key, str(... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
# system
from datetime import datetime, timedelta
from functools import wraps
import pprint
import random
import re
import sys
import time
# pypi
import argh
import click
from cl... |
import os
import mock
from uuid import uuid4
from urllib2 import urlopen
from django.test import TestCase
from django.core.files.base import ContentFile
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from boto.s3.key import Key
from storages.backends import s3bot... |
import sys
IS_WIN = sys.platform == 'win32'
IS_LINUX = sys.platform == 'linux'
IS_MACOS = sys.platform == 'darwin'
IS_HAIKU = sys.platform == 'haiku1'
# These variables are set by pyinstaller if running from a packaged build
# See http://pyinstaller.readthedocs.io/en/stable/runtime-information.html
IS_FROZEN = getat... |
import sqlite3
import datetime
class Reader:
_sqlite_db = 'subway_status.db'
def _query_dbase(self, q, a = ''):
connection = sqlite3.connect(self._sqlite_db)
cursor = connection.cursor()
cursor.execute(q, a)
result = cursor.fetchall()
connection.close()
retu... |
import sys
import json
from collections import defaultdict
import itertools
import cPickle as pickle
import re
from sets import Set
from crossdomain import get_amazon_graphs
from crossdomain.hierarchy import get_categories
import numpy as np
def get_parents(item):
parents = []
if item.__class__ is dict:
... |
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
import ctypes
from .linux import netlinkh as netlink
from . import _cproto
# int mnl_socket_get_fd(const struct mnl_socket *nl)
socket_get_fd = _cproto.c_socket_get_fd
# unsigned int mnl_socket_get_portid(const struct mnl_socket *nl)
s... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
from nose.plugins.skip import SkipTest
if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.module_utils.basic import AnsibleModu... |
from modshogun import RealFeatures
from modshogun import MulticlassLabels
from modshogun import QDA
from pylab import pcolor, contour, colorbar, connect, show, plot, axis
import numpy as np
import util
N = 500
size = 100
# positive examples
mean_pos = [-1, 4]
cov_pos = [[1,40], [50, -2]]
x_pos, y_pos = np.random.... |
"""Tests of `worker_training_state.py` utilities."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
from absl.testing import parameterized
from tensorflow.python.distribute import combinations as ds_combinations
from tensorflow.python.... |
"""
Test ContactInfo support.
"""
from servicetest import call_async, EventPattern, assertEquals, sync_dbus
from gabbletest import exec_test, acknowledge_iq, make_result_iq
import constants as cs
import dbus
def test(q, bus, conn, stream):
event = q.expect('stream-iq', to=None, query_ns='vcard-temp',
... |
from __future__ import absolute_import
import binascii
import glob
import gzip
import io
import logging
import os
import pickle
import random
import re
import sys
import unittest
from builtins import range
import crcmod
import apache_beam as beam
from apache_beam import Create
from apache_beam import coders
from apa... |
import itk
import tempfile
import os
dim = 2
PixelType = itk.UC
# check the repr string
assert "<itkTemplate itk::Image>" == repr(itk.Image)
# template should work with CType instance and with numbers
ImageType = itk.Image[PixelType, dim]
# template should return the same class with a class as parameter
# or with a... |
"""
KeepNote
MaskDict model. Mask certain keys from an underlying dictionary
"""
#
# KeepNote
# Copyright (c) 2008-2011 Matt Rasmussen
#
# 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 Foundat... |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - edit a page
This either calls the text or the GUI page editor.
@copyright: 2000-2004 Juergen Hermann <<EMAIL>>,
2006 MoinMoin:ThomasWaldmann
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin import wikiutil
from MoinMoi... |
"""
MySQL field class handler
"""
# -*- coding: utf-8 -*-
# emma
#
# Copyright (C) 2006 Florian Schmidt (<EMAIL>)
# 2014 Nickolay Karnaukhov (<EMAIL>)
#
# 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 ... |
"""Dump the current elasticsearch index to a JSON file,
This should be used to re-create the cached 1000 genomes
example index if the indexer changes. It dumps the main
index and its mappings, as well as the '_fields' index.
This tool can also be used to dump any other index.
- Ensure the elastic search index is alr... |
__author__ = 'justinarmstrong'
from . import setup,tools
from .states import main_menu,load_screen,level1
from . import constants as c
import pygame as pg
from pygame.surfarray import pixels3d
def main():
"""Add states to control here."""
run_it = tools.Control(setup.ORIGINAL_CAPTION)
state_dict = {c.MAIN... |
import utils.helpers as helpers
import core.Staff as stf
import core.School as sch
import print.html_gen as html_gen
import print.utils as print_utils
def add_staff(full_name):
name_parts = helpers.get_human_name_parts(full_name)
staff_info = dict(fname=name_parts.first, lname=name_parts.last)
if name_par... |
from __future__ import unicode_literals
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from modoboa.parameters import tools as param_tools
def get_sort_order(qdict, default, allowed_values=None):
"""Return a sort order from a querydict object
:param QueryDict qdict: the object to ... |
"""
Support for BloomSky weather station.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/bloomsky/
"""
from datetime import timedelta
import logging
from aiohttp.hdrs import AUTHORIZATION
import requests
import voluptuous as vol
from homeassistant.con... |
from werkzeug.exceptions import HTTPException
from jinja2 import DictLoader, Environment
from six import text_type
ERROR_RESPONSE = u"""<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Errors>
<Error>
<Code>{{error_type}}</Code>
<Message>{{message}}</Message>
{% block extra %}{% ... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'LoveDeclaration'
db.create_table(u'love_lovedeclaration', (
(u'id', self.gf('dja... |
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools import cffLib
from . import DefaultTable
class table_C_F_F_(DefaultTable.DefaultTable):
def __init__(self, tag=None):
DefaultTable.DefaultTable.__init__(self, tag)
self.cff = cffLib.CFFFontSet()
s... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from glob import glob
from setuptools import setup
__version__ = '0.1.28'
setup(
name = 'tapioca',
version = __version__,
description = "Tapioca is a small and flexible micro-framework on top of "\
"Tornado. It provides a simpler way to create RESTfu... |
import sys, os
import getopt
import shlex
try:
# Python >=3.0
from subprocess import getstatusoutput as subprocess_getstatusoutput
except ImportError:
# Python <3.0
from commands import getstatusoutput as subprocess_getstatusoutput
try:
my_getopt = getopt.gnu_getopt
except AttributeError:
my_getopt = g... |
import py
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.test.test_llinterp import gengraph, interpret, interpret_raises
class BaseRtypingTest(object):
FLOAT_PRECISION = 8
def gengraph(self, func, argtypes=[], viewbefore='auto', policy=None,
backendopt=False, config=None):
... |
#!/usr/local/bin/python2
# Py2 Delegate version
import abc
import math
class Shape(object):
"""
Shape abstract base class.
"""
__metaclass__ = abc.ABCMeta
"""
=====================================================================
Place your shape functions here. The functions needed are... |
from read_output import parse_som_unit
from csv2som import filter_quote
import requests
import rdflib
from sparql_request import run_sparql
endpoint = "http://localhost:8890/sparql/"
unit = None
docs = None
dloc = None
keyloc = None
def parse_doc_kw(filename):
"""
load csv and returns a map from document to ... |
"""
This package implements access to Gramps configuration.
"""
#---------------------------------------------------------------
#
# Gramps imports
#
#---------------------------------------------------------------
import os
import re
import logging
#---------------------------------------------------------------
#
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.