content stringlengths 4 20k |
|---|
class Union(object):
def __init__(self, n):
self.root, self.size = range(n), [1] * n
def find(self, n):
root = self.root
while root[n] != n:
root[n] = root[root[n]]
n = root[n]
return n
def union(self, a, b):
root, size = self.root, self.size... |
from threading import Lock
import os
import pickle
from PyQt4 import QtGui, QtCore, QtXml
from implementation.primaries.GUI import renderingErrorPopup, SetupWindow
from implementation.primaries.GUI import qt_threading, PlaylistDialog, \
ImportDialog, licensePopup, \
StartupWindow, MainWindow
from implementation... |
import pytest
from conftest import assert_bash_exec
class TestUmount:
@pytest.fixture(scope="class")
def dummy_mnt(self, request, bash):
"""
umount completion from fstab can't be tested directly because it
(correctly) uses absolute paths. So we create a custom completion which
... |
import os
import tempfile
from django.test import TestCase
from django.conf import settings
from oscar.core import customisation
VALID_FOLDER_PATH = 'tests/_site/apps'
class TestUtilities(TestCase):
def test_subfolder_extraction(self):
folders = list(customisation.subfolders('/var/www/eggs'))
... |
from flask import Flask, render_template, redirect, request, url_for, flash, session
from flask.ext.login import login_user, logout_user, login_required, \
current_user
from . import admin
from .. import db
from ..models import User, Role, Institute, DigitizationProtocol
from ..email import send_email
from .forms i... |
import copy
import json
import functools
import inspect
import os
import uuid
import socket
import six
import pkg_resources
from jinja2 import Template
from oslo_config import cfg
from oslo_concurrency import processutils
from oslo_log import log as logging
from oslo_utils import timeutils
from designate import excep... |
import oslib
from oslib.command import Command, OSLibError
import subprocess
import os.path
class SSH(Command):
"""
This class is used to launch an ssh connection to an instance
it use the config file to find identification information.
In section [Credentials], it uses the key_file and user values.
Argument can ... |
"""
WSGI config for auto project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` set... |
# -*- coding: iso-8859-1 -*-
"""
User-created selections used in ViewerItem.
Copyright (C) 2010-2017 Armin Straub, http://arminstraub.com
"""
"""
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; eit... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
from copy import deepcopy
from ansible import constants as C
from ansible.module_utils._text import to_text
from ansible.module_utils.six import string_types
from ansible.plugins.loader import connection_loade... |
#!/usr/bin/env python
# vim: set fileencoding=utf8 :
# See http://www.python.org/dev/peps/pep-0263/
#----------------------------------------------------------------------------------------------#
# prob Module #
#------------------------... |
#!/usr/bin/env python3
import asyncio
import logging
import signal
from pathlib import Path
import psutil
from i3pyblocks import Runner, types
from i3pyblocks.blocks import (
datetime,
dbus,
http,
i3ipc,
inotify,
ps,
pulse,
shell,
x11,
)
logging.basicConfig(filename=Path.home() /... |
"""Tests for data_utils."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from itertools import cycle
import os
import tarfile
import threading
import unittest
import zipfile
import numpy as np
from six.moves.urllib.parse import urljoin
from six.moves.ur... |
import os
import shutil
import pytest
from tempfile import mkstemp, mkdtemp
from subprocess import Popen, PIPE
from distutils.errors import DistutilsError
from numpy.testing import assert_, assert_equal, assert_raises
from numpy.distutils import ccompiler, customized_ccompiler
from numpy.distutils.system_info import s... |
"""Tests for Coordinator."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import threading
import time
from tensorflow.python.framework import errors_impl
from tensorflow.python.platform import test
from tensorflow.python.training import coor... |
"""The CardConnectionDecorator is a Decorator around the CardConnection
abstract class, and allows dynamic addition of features to the
CardConnection, e.g. implementing a secure channel..
__author__ = "http://www.gemalto.com"
Copyright 2001-2010 gemalto
Author: Jean-Daniel Aussel, mailto:<EMAIL>
This file is part of... |
"""
Django settings for tic_tac_toe project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import o... |
import hashlib
import datetime
from django.db import models
from django_extensions.db.fields import CreationDateTimeField
from django_extensions.db.fields import ModificationDateTimeField
from django.conf import settings
STATUSES = (
('new', 'new'),
('pending', 'pending'),
('processed', 'processed'),
... |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
from metaphor_tools import *
from metaphor_base import *
class MetaphorLeak(MetaphorBase):
# fill_size must be the upper limit for jemalloc's run's region size
DEFAULT_CONFIG = \
{
# Heap shaping configuration
'fill_size': 0x50,
... |
import array
import hashlib
import itertools
import sys
try:
import threading
except ImportError:
threading = None
import unittest
import warnings
from binascii import unhexlify
from test import test_support
from test.test_support import _4G, precisionbigmemtest
# Were we compiled --with-pydebug or with #defi... |
"""Fixer for it.next() -> next(it), per PEP 3114."""
# Things that currently aren't covered:
# - listcomp "next" names aren't warned
# - "with" statement targets aren't checked
# Local imports
from ..pgen2 import token
from ..pygram import python_symbols as syms
from .. import fixer_base
from ..fixer_util import ... |
import os
import six
import stat
from fabric.network import ssh
class FakeFile(six.StringIO):
def __init__(self, value=None, path=None):
def init(x):
six.StringIO.__init__(self, x)
if value is None:
init("")
ftype = 'dir'
size = 4096
else:
... |
from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.tests.test_views import AuthViewsTestCase
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.core.exceptions import Permis... |
import os
import sys
import sqlite3 as sqlite
def gen():
db = sqlite.connect(":memory:")
tablesfile = sys.argv[1]
datafiles = sys.argv[2]
with open(os.path.join("data", tablesfile)) as f:
data = f.read()
db.executescript(data)
with open(os.path.join("data", datafiles)) as f:
... |
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from matplotlib import rc
from matplotlib.font_manager import FontProperties
from matplotlib import rcParams
from matplotlib import cm
from mpl_toolkits.basemap import Basemap
from mpl_toolkits.basemap import cm as... |
#!/bin/env python
# -*- coding: utf-8 -*-
import requests
from project import app
from project.forms.person import PersonForm
from project.models.person import Persons
from flask import request, Response
def retrieve_person_info(facebook_id):
"""Retrieves a person info based on a facebook id
Information re... |
"""Custom chat module for Pidgin."""
__id__ = "$Id$"
__version__ = "$Revision$"
__date__ = "$Date$"
__copyright__ = "Copyright (c) 2010 Joanmarie Diggs."
__license__ = "LGPL"
import orca.chat as chat
########################################################################
# ... |
from nose.tools import eq_
from dstore import MemoryStore, Model
from . import BaseTest, Car
class Init( BaseTest ):
auto_create = False
auto_init = False
def before_init_app( self, event, store ):
store.events.after_init_app += self.after_init_app
self.before = True
def after_init... |
# coding: utf-8
from __future__ import print_function
import os
from PIL import Image as PILImage
from django.conf import settings
import unittest
settings.configure(THUMBNAIL_WATERMARK="mark.png", STATICFILES_DIRS=("src",))
POSITIONS_TO_TEST = (
"" "center",
"south east",
"south west",
"north west"... |
import os, sys
from xdis import IS_PYPY, PYTHON_VERSION
from xdis.load import load_file, check_object_path, load_module
from xdis.codetype import CodeTypeUnionFields
import os.path as osp
def get_srcdir():
filename = osp.normcase(osp.dirname(osp.abspath(__file__)))
return osp.realpath(filename)
def test_loa... |
import re
from textwrap import dedent
from unittest import TestCase
from pcs.cli import nvset
from pcs.common.pacemaker.nvset import (
CibNvpairDto,
CibNvsetDto,
)
from pcs.common.pacemaker.rule import CibRuleExpressionDto
from pcs.common.types import (
CibNvsetType,
CibRuleInEffectStatus,
CibRuleE... |
from __future__ import unicode_literals
import re
from collections import defaultdict
from nltk.ccg.api import PrimitiveCategory, Direction, CCGVar, FunctionalCategory
from nltk.compat import python_2_unicode_compatible
#------------
# Regular expressions used for parsing components of the lexicon
#------------
# P... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('flows', '0037_auto_20151023_1704'),
]
operations = [
migrations.RenameField(
model_name='flowversion',
... |
from thug.ActiveX.modules import WScriptShell
import string
import random
import logging
log = logging.getLogger("Thug")
def OpenTextFile(self, sFilePathAndName, ForWriting = True, flag = True):
log.ThugLogging.add_behavior_warn('[Script.FileSystemObject ActiveX] OpenTextFile("%s", "%s", "%s")' % (sFilePathAndNa... |
# encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import logging as std_logging
import pickle
import django
from django.test import TestCase
from test_haystack.core.models import AFifthMockModel, MockModel
from haystack import connections
from haystack.models impor... |
'''
Created on Jun 1, 2012
@author: mkiyer
'''
import os
import sys
import subprocess
import logging
from chimerascan.lib import config
from chimerascan.lib.base import LibraryTypes
import chimerascan.pipeline
_pipeline_dir = chimerascan.pipeline.__path__[0]
_bowtie2_pe_args = ['--phred33', '--end-to-end', '--very... |
# -*- encoding: utf-8 -*-
from abjad.tools.topleveltools import iterate
def get_next_measure_from_component(component):
'''Get next measure from `component`.
When `component` is a voice, staff or other sequential context,
and when `component` contains a measure, return first measure
in `component`. T... |
from ctypes import (
LittleEndianStructure,
c_char,
c_int32,
c_float
)
from .dataCommon import (
SavedVec3,
SavedColor
)
class DANAE_LLF_HEADER(LittleEndianStructure):
_pack_ = 1
_fields_ = [
("version", c_float),
("ident", c_char * 16),
("la... |
import sys
import re
import os.path
from NetJobs import NetJobs
from JetEdit import JetEdit
path_in = ''
serialNum = 0
config = {
'maxRuns': None,
'sharePath': None,
'jsPath': None,
'jsExePath': None,
'mailboxes': None,
# 'mbStart': None,
# 'mbStepPass': None,
# 'mbStepFail': None,
... |
import cmath
import itertools
import math
import sys
from numba.core.compiler import compile_isolated, Flags, utils
from numba.core import types
from numba.tests.support import TestCase, tag
from .complex_usecases import *
import unittest
enable_pyobj_flags = Flags()
enable_pyobj_flags.enable_pyobject = True
no_pyob... |
{
'name': 'Base Phone Validation',
'version': '1.0',
'author': 'cgstudiomap, Odoo Community Association (OCA)',
'maintainer': 'cgstudiomap',
'license': 'AGPL-3',
'category': 'Sale',
'summary': 'Force the phone numbers to be valid.',
'external_dependencies': {'python': ['phonenumbers']},
... |
import socket, time, imaplib, re, sys
class lightpack:
# host = '127.0.0.1' # The remote host
# port = 3636 # The same port as used by the server
# apikey = 'key' # Secure API key which generates by Lightpack software on Dev tab
# ledMap = [1,2,3,4,5,6,7,8,9,10] #mapped LEDs
def __init... |
from neutron.agent.l2.extensions import qos
from neutron_lib.services.qos import constants as qos_consts
from os_win.utils.network import networkutils
from oslo_log import log as logging
from networking_hyperv.common.i18n import _LI, _LW # noqa
LOG = logging.getLogger(__name__)
class QosHyperVAgentDriver(qos.QosAg... |
#!/usr/bin/env python3
import json
import unittest
SKIP_SCRAMBLES = True # urg
class CcmTest(unittest.TestCase):
def test_ccm_matches_wa(self):
self.maxDiff = None
with open("AtomicCubing2016-CCM.json", "r") as ccm_json_file, open("Results for AtomicCubing2016.json", "r") as wa_json_file:
... |
"""
Basic fossils for data export
"""
from indico.util.fossilize import IFossil
from indico.util.fossilize.conversion import Conversion
class IHTTPAPIErrorFossil(IFossil):
def getMessage(self):
pass
class IHTTPAPIResultFossil(IFossil):
def getTS(self):
pass
getTS.name = 'ts'
def ge... |
import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
AuthUserFactory,
PreprintProviderFactory,
)
@pytest.mark.django_db
class TestPreprintProviderList:
@pytest.fixture(params=['/{}preprint_providers/?version=2.2&', '/{}providers/preprints/?version=2.2&'])
d... |
import pytest
import py
import os
from imagesort import imagesort
import filecmp
import sys
def test_available_operations():
ops = set([op for op in imagesort.OPERATIONS])
# Hardlinks for windows came in version 3.2
if sys.platform == 'win32' and sys.hexversion < 0x03020000:
assert ops == set(['c... |
# -*- encoding: utf-8 -*-
__author__ = 'pp'
"""
georest.model.feature
~~~~~~~~~~~~~~~~~~~~~
feature persistent/representation interface
"""
from datetime import datetime
from .. import geo
from ..geo import jsonhelper as json
from .. import storage
from . import exceptions
class BaseFeatureModel(obj... |
"""Unit test utilities for Google C++ Testing Framework."""
__author__ = '<EMAIL> (Zhanyong Wan)'
import atexit
import os
import shutil
import sys
import tempfile
import unittest
_test_module = unittest
# Suppresses the 'Import not at the top of the file' lint complaint.
# pylint: disable-msg=C6204
try:
import sub... |
from datetime import datetime
from openerp import tools
from openerp.osv import fields, osv
from openerp.tools.translate import _
class wizard_valuation_history(osv.osv_memory):
_name = 'wizard.valuation.history'
_description = 'Wizard that opens the stock valuation history table'
_columns = {
'ch... |
import subprocess
from crisscross.facades import Camera
class GstreamerCamera(Camera):
def _take_picture(self, on_complete, filename=None):
self.on_complete = on_complete
self.filename = filename
try:
name, extension = filename.split(".")
except ValueError:
... |
"""
This modules provides classes for evaluating multi-dimensional constraints.
"""
from pycbc import transforms
from pycbc.io import record
class Constraint(object):
""" Creates a constraint that evaluates to True if parameters obey
the constraint and False if they do not.
"""
name = "custom"
req... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from cryptography.hazmat.primitives import padding
'''
Pads a given string with PKCS#7 padding algorithm provided by python
cryptography padding function.
https://cryptography.io/en/latest/hazmat/primitives/padding/
https://tools.ietf.org/html/rfc5652#section-6.3
Note: If th... |
from unittest import TestCase
from chatterbot import languages
from chatterbot import tagging
class PosLemmaTaggerTests(TestCase):
def setUp(self):
self.tagger = tagging.PosLemmaTagger()
def test_empty_string(self):
tagged_text = self.tagger.get_text_index_string(
''
)
... |
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.sparse import csr_matrix, isspmatrix, isspmatrix_csc, isspmatrix_csr
from ._tools import csgraph_to_dense, csgraph_from_dense,\
csgraph_masked_from_dense, csgraph_from_masked
DTYPE = np.float64
def validate_graph(csgr... |
__author__="Daniel Berenguer"
__date__ ="$Aug 20, 2011 10:36:00 AM$"
#########################################################################
from swap.modem.CcPacket import CcPacket
from SwapValue import SwapValue
from SwapDefs import SwapAddress, SwapFunction
from swap.SwapException import SwapException
from Crypt... |
from django.utils.translation import trans_real
DjangoTranslation = trans_real.DjangoTranslation
class WeblateTranslation(DjangoTranslation):
"""
Workaround to enforce our plural forms over Django ones.
We hook into merge and overwrite plural with each merge. As Weblate locales
load as last this way... |
# -*- coding: utf-8 -*-
import struct
from ethereum import slogging
from raiden.encoding.encoders import integer, optional_bytes
from raiden.encoding.format import buffer_for, make_field, namedbuffer, pad, BYTE
from raiden.encoding.signing import recover_publickey
def to_bigendian(number):
return struct.pack('>... |
''' Simulate l00 hosts to ping server constantly. If group name match the env
capacity config and there is active deploy, it will simulate the full deploy cycle as well.
'''
import commons
import argparse
import time
import threading
states = {}
systems_helper = commons.get_system_helper()
def ping(i, groups):
... |
from common_fixtures import * # NOQA
def test_host_deactivate(super_client, new_context):
host = new_context.host
agent = super_client.reload(host).agent()
assert host.state == 'active'
agent = super_client.wait_success(agent)
assert agent.state == 'active'
host = super_client.wait_success(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: gallery 1
"""
Demonstrating a cloud of points.
"""
import numpy as np
from vispy import gloo
from vispy import app
from vispy.util.transforms import perspective, translate, rotate
vert = """
#version 120
// Uniforms
// ------------------------------------
unif... |
from flask import request
from flask_restful import Resource
from blueprints.api import require_api_key
from blueprints.base import rest_api
add_api_username_verification_token = 'api.auth.add_ip_username_verification'
class MeResource(Resource):
@require_api_key(asuser_must_be_registered=False,
... |
from django.shortcuts import render
from django.http import HttpResponse, Http404, HttpRequest
from models import User, Device
from django.contrib.auth import authenticate, login, logout
def index(request):
if request.user.is_authenticated():
return render(request,'main.html',{'user':request.user})
els... |
"""Support for Homekit device discovery."""
import logging
from homeassistant.components.discovery import SERVICE_HOMEKIT
from homeassistant.helpers import discovery
from homeassistant.helpers.entity import Entity
from .config_flow import load_old_pairings
from .connection import get_accessory_information, HKDevice
f... |
from __future__ import unicode_literals
try:
from django.utils.encoding import smart_unicode
except ImportError:
# Python 3
from django.utils.encoding import smart_text as smart_unicode
try:
from django.utils.timezone import localtime
except ImportError:
def localtime(value):
return value
... |
"""Helper functions for enqueuing data from arrays and pandas `DataFrame`s."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import random
import types as tp
import numpy as np
import six
from tensorflow.python.estimator.inputs.queues ... |
"""Settings that need to be set in order to run the tests."""
import os
DEBUG = True
SITE_ID = 1
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
}
ROOT_URLCONF = 'unshorten.tests.urls'
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(__file__, '..... |
"""
pyboard interface
This module provides the Pyboard class, used to communicate with and
control the pyboard over a serial USB connection.
Example usage:
import pyboard
pyb = pyboard.Pyboard('/dev/ttyACM0')
Or:
pyb = pyboard.Pyboard('192.168.1.1')
Then:
pyb.enter_raw_repl()
pyb.exec('pyb.LE... |
"""
InaSAFE Disaster risk assessment tool developed by AusAid and World Bank
- **GUI Test Cases.**
Contact : <EMAIL>
.. note:: 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 versio... |
import datetime
import operator
from oslo_log import log
from oslo_utils import timeutils
from ceilometer.alarm import evaluator
from ceilometer.alarm.evaluator import utils
from ceilometer.i18n import _, _LW
LOG = log.getLogger(__name__)
COMPARATORS = {
'gt': operator.gt,
'lt': operator.lt,
'ge': opera... |
# Thank you to iAcquire for sponsoring development of this module.
import sys
import time
try:
import boto
import boto.ec2
from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
def create_image(module, ec2):
"""
C... |
from __future__ import print_function
import sys
from codecs import open
import os
import json
from setuptools import setup, find_packages
DESCRIPTION = "A python client and CLI for accessing the SolidFire API."
if os.path.exists('README.rst'):
with open('README.rst', 'r', 'utf-8') as readme_file:
LONG_D... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id: del_build.py $
# pylint: disable=C0301
"""
Interface used by the tinderbox server side software to mark build binaries
deleted.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
avail... |
"""Python client library for the Facebook Platform.
This client library is designed to support the Graph API and the
official Facebook JavaScript SDK, which is the canonical way to
implement Facebook authentication. Read more about the Graph API at
http://developers.facebook.com/docs/api. You can download the Facebook... |
import unittest
import pymic
from offload_device_tests import OffloadDeviceTest
from offload_library_tests import OffloadLibraryTests
from offload_stream_tests import OffloadStreamTests
from offload_array_tests import OffloadArrayTest
from application_kernels import ApplicationKernelTests
if __name__ == "__main__":
... |
import eossdk
import eossdk_utils
import argparse
import functools
import pyinotify
import sys
# The following example shows how to integrate pyinotify with an EOS
# SDK agent and react to a file changing on disk. Here as an example
# of the agent's usage (where lines starting with " >" are operations
# that were per... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import stat
import tempfile
import multiprocessing
import time
import warnings
PASSLIB_AVAILABLE = False
try:
import passlib.hash
PASSLIB_AVAILABLE = True
except:
pass
try:
from __main__ import display
... |
import argparse
import os
import pickle
import subprocess
import sys
import smtplib
comps = ['neutron', 'python-neutronclient', 'horizon']
rmadison_cmd = 'rmadison %(comp)s | grep "%(ppa)s "'
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--ppa', required = True,
... |
"""Datasource for IBMCloud.
IBMCloud is also know as SoftLayer or BlueMix.
IBMCloud hypervisor is xen (2018-03-10).
There are 2 different api exposed launch methods.
* template: This is the legacy method of launching instances.
When booting from an image template, the system boots first into
a "provisioning" m... |
import mock
from oslo.serialization import jsonutils
from nova import db
from nova.tests.functional.v3 import api_sample_base
from nova.tests.functional.v3 import test_servers
fake_db_dev_1 = {
'created_at': None,
'updated_at': None,
'deleted_at': None,
'deleted': None,
'id': 1,
'compute_node... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
from matplotlib.tri import Triangulation
import matplotlib._tri as _tri
import numpy as np
class TriFinder(object):
"""
Abstract base class for classes used to fi... |
"""BiFAC on TensorFlow
Authoers: NUKUI Shun
License: GNU General Public License Version 2
"""
from __future__ import division
import pandas as pd
from itertools import chain
import numpy as np
import tensorflow as tf
from clippedgrad import ClippedAdagradOptimizer
from clippedgrad import ClippedGDOptimizer
class Co... |
import logging
import os
import re
import subprocess
import sys
import time
from telemetry.core import exceptions
from telemetry.core import forwarders
from telemetry.core import util
from telemetry.core.backends import adb_commands
from telemetry.core.backends import browser_backend
from telemetry.core.backends.chrom... |
import scipy
import numpy
import math
from AZutilities import dataUtilities
from AZutilities import Mahalanobis
from rdkit import DataStructs
from rdkit import Chem
from rdkit.Chem.Fingerprints import FingerprintMols
from rdkit.Chem import AllChem
from rdkit.Chem import MACCSkeys
def getRespVar(tanList, tanDict, trai... |
import os
from migrate import exceptions as versioning_exceptions
from migrate.versioning import api as versioning_api
from migrate.versioning import repository as versioning_repository
from oslo.config import cfg
from glance.common import exception
import glance.openstack.common.log as logging
LOG = logging.getLogg... |
#!/usr/bin/env python3
""" Command line interface to difflib.py providing diffs in four formats:
* ndiff: lists every line and highlights interline changes.
* context: highlights clusters of changes in a before/after format.
* unified: highlights clusters of changes in an inline format.
* html: generates side... |
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
pipe2py.modules.pipefetch
~~~~~~~~~~~~~~~~~~~~~~~~~
Provides methods for fetching RSS feeds.
http://pipes.yahoo.com/pipes/docs?doc=sources#FetchFeed
"""
import speedparser
from functools import partial
from itertools import imap, ifilter, starma... |
# -*- coding: utf-8 -*-
"""SQLite parser plugin for Android text messages (SMS) database files."""
from dfdatetime import java_time as dfdatetime_java_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.parsers import sqlite
from plaso.parsers... |
from openstack_dashboard.test.integration_tests import decorators
from openstack_dashboard.test.integration_tests import helpers
from openstack_dashboard.test.integration_tests.regions import messages
class TestKeypair(helpers.TestCase):
"""Checks that the user is able to create/delete keypair."""
KEYPAIR_NAM... |
#!/usr/bin/env python
# This file should be compatible with both Python 2 and 3.
# If it is not, please file a bug report.
"""
High level operations on subusers.
"""
#external imports
import sys
#internal imports
import subuserlib.classes.user,subuserlib.resolve,subuserlib.classes.subuser,subuserlib.verify,subuserlib... |
_BUTTON_STYLE = """
.buttons a, .buttons button{
display:block;
float:left;
margin:0 7px 0 0;
background-color:#f5f5f5;
border:1px solid #dedede;
border-top:1px solid #eee;
border-left:1px solid #eee;
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
font-size:12px;
... |
import numpy as np
import theano.tensor as T
from .. import init
from .base import Layer
__all__ = [
"EmbeddingLayer"
]
class EmbeddingLayer(Layer):
"""
lasagne.layers.EmbeddingLayer(incoming, input_size, output_size,
W=lasagne.init.Normal(), **kwargs)
A layer for word embeddings. The input sh... |
"""
One-vs-all logistic regression.
Note:
1. Normalizing features will lead to much faster convergence but worse performance.
2. Instead, standard scaling features will help achieve better performance.
3. Initializing with linear regression will help get even better result.
4. Bagging is implemented as... |
#==============================================================================
#===============================Import Libraries===============================
#==============================================================================
import sys
from PyQt4.QtGui import QApplication
from Model import mainModel
from... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
import re
from ansible.module_utils.nxos import run_commands, get_config
from ansible.module_utils.nxos import nxos_argument_spec, check_args
from ansible.module_utils.basic impo... |
from __future__ import unicode_literals
from copy import deepcopy
from django.contrib import admin
from django.core.exceptions import PermissionDenied
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from mezzanine.conf import settings
from mezzanine.core.admin import (
... |
"""
Application configuration file. Read the comments by each key for details
"""
# how to run the oag app
SECRET_KEY = 'reallysecret...'
HOST = '0.0.0.0'
PORT = '5000'
DEFAULT_HOST = 'localhost' # not where the app runs (that's HOST), but where elasticsearch and redis live.
# all tests ... |
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gio', '2.0')
from gi.repository import Gtk
from gi.repository import Gio
import mimetypes
import userdirectories
ICONSIZE = 24
class Icons():
def __init__(self, theme):
self.theme = theme
self.userdirs = userdirectories.UserDirec... |
import logging
#from tripchaingame.web.reittiopasAPI import ReittiopasAPI
from reittiopasAPI import ReittiopasAPI
from point import LocationPoint
import json
import collections
from datetime import datetime
from ..models import Point, SecondaryPoint, AnalysisInfo, Trip
'''
A class dedicated to work on place recogn... |
import os
import struct
import logging
from primitives import *
from constants import *
from astypes import MalformedFLV
from astypes import get_script_data_variable, make_script_data_variable
log = logging.getLogger('flvlib.tags')
STRICT_PARSING = False
def strict_parser():
return globals()['STRICT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.