content stringlengths 4 20k |
|---|
"""Classes for conversion between XML dates and Python objects."""
from suds import UnicodeMixin
import datetime
import re
import time
_SNIPPET_DATE = \
r"(?P<year>\d{1,})-(?P<month>\d{1,2})-(?P<day>\d{1,2})"
_SNIPPET_TIME = \
r"(?P<hour>\d{1,2}):(?P<minute>[0-5]?[0-9]):(?P<second>[0-5]?[0-9])" \
r"(... |
# <pep8-80 compliant>
bl_info = {
"name": "RoR Exporter",
"author": "ulteq",
"version": (0, 0, 2),
"blender": (2, 82, 0),
"category": "RoR",
}
import bpy
import json
import bmesh
from bpy.props import StringProperty
from bpy_extras.io_utils import ExportHelper
def register():
bpy.context.pref... |
"""
Module containing the network portion of XEP-115 (Entity Capabilities)
"""
import logging
log = logging.getLogger('gajim.c.p.caps')
from common import gajim
from common import ged
from common.connection_handlers_events import CapsPresenceReceivedEvent, \
CapsDiscoReceivedEvent, CapsReceivedEvent
class Conne... |
import inspect
def decorate_methods(decorator):
if not hasattr(decorator, '_decorated_methods'):
decorator._decorated_methods = {}
def meta_decorator(methods_to_decorate):
for model, method_name in list(set(methods_to_decorate)):
model_class = model.__class__
if hasattr... |
'''Splitter
======
.. versionadded:: 1.5.0
.. image:: images/splitter.jpg
:align: right
The :class:`Splitter` is a widget that helps you re-size it's child
widget/layout by letting you re-size it via dragging the boundary or
double tapping the boundary. This widget is similar to the
:class:`~kivy.uix.scrollview.... |
'''fileobject
emulate a fileobject using a seperate process to handle IO for coroutine
concurrency
Written by Libor Michalek. 2006
'''
import coro
import corofile
import coroqueue
# corofile.emulate_popen2()
import os
import sys
import struct
import exceptions
import pickle
import signal
import weakref
import sign... |
import mock
from nova import exception
from nova.openstack.common import log as logging
from nova import test
from nova import utils
from nova.virt.libvirt import rbd_utils
LOG = logging.getLogger(__name__)
CEPH_MON_DUMP = """dumped monmap epoch 1
{ "epoch": 1,
"fsid": "33630410-6d93-4d66-8e42-3b953cf194aa",
"... |
try:
import pyrax
HAS_PYRAX = True
except ImportError:
HAS_PYRAX = False
def alarm(module, state, label, entity_id, check_id, notification_plan_id, criteria,
disabled, metadata):
if len(label) < 1 or len(label) > 255:
module.fail_json(msg='label must be between 1 and 255 characters l... |
import os
from gi.repository import Gtk, Pango, Gdk, GObject
class Breadcrumbs(Gtk.HBox):
"""Widget for displaying paths with clickable segments."""
TYPE_NONE = 0
TYPE_NORMAL = 1
TYPE_SMART = 2
def __init__(self, parent):
GObject.GObject.__init__(self)
self._parent = parent
self._type = self._parent._b... |
import ast
import _ast
from nimoy.specification import Specification
from nimoy.ast_tools.expression_transformer import ComparisonExpressionTransformer, ThrownExpressionTransformer
class ComparisonExpressionTransformerSpec(Specification):
def equality_expressions_are_transformed(self):
with setup:
... |
'''
Easy integration of DataFrame into pyqt framework
Copyright: Jev Kuznetsov
Licence: BSD
'''
from PyQt4.QtCore import (QAbstractTableModel,Qt,QVariant,QModelIndex,SIGNAL)
from PyQt4.QtGui import (QApplication,QDialog,QVBoxLayout, QHBoxLayout, QTableView, QPushButton,
QWidget,QTabl... |
import collections
import re
import optparse
import os
from string import Template
import sys
from util import build_utils
# List of C++ types that are compatible with the Java code generated by this
# script.
ENUM_FIXED_TYPE_WHITELIST = ['char', 'unsigned char',
'short', 'unsigned short',
'int', 'int8_t', 'int16... |
# -*- coding: utf-8 -*-
"""The application's model objects"""
from zope.sqlalchemy import ZopeTransactionExtension
from sqlalchemy.orm import scoped_session, sessionmaker
#from sqlalchemy import MetaData
from sqlalchemy.ext.declarative import declarative_base
# Global session manager: DBSession() returns the Thread-l... |
import gdb
import re
import itertools
class EigenMatrixPrinter:
"Print Eigen Matrix or Array of some kind"
def __init__(self, variety, val):
"Extract all the necessary information"
# Save the variety (presumably "Matrix" or "Array") for later usage
self.variety = variety
# The gdb extension does not ... |
import sark
import idc
import idaapi
import idautils
import re
from sark.debug import Registers
################################################################
#
# IDA Connector is a utility the wraps around IDA SDK.
# It publishes convenience functions used to query and edit data
# from IDA.
#
#########... |
import logging # isort:skip
log = logging.getLogger(__name__)
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Standard library imports
from json import loads
# Bokeh imports
from ...core.json_enc... |
# stdlib
import logging
import unittest
# project
from dogstream.cassandra import parse_cassandra
logger = logging.getLogger(__name__)
class TestCassandraDogstream(unittest.TestCase):
def testStart(self):
events = parse_cassandra(logger, " INFO [main] 2012-12-11 21:46:26,995 StorageService.java (line 6... |
{
'name': 'Attendances',
'version': '1.1',
'category': 'Human Resources',
'description': """
This module aims to manage employee's attendances.
==================================================
Keeps account of the attendances of the employees on the basis of the
actions(Sign in/Sign out) performed by... |
import random
from pylib import constants
from pylib.base import test_instance
_SINGLE_EVENT_TIMEOUT = 100 # Milliseconds
class MonkeyTestInstance(test_instance.TestInstance):
def __init__(self, args, _):
super(MonkeyTestInstance, self).__init__()
self._categories = args.categories
self._event_count... |
'''
Created on 2014. 3. 21.
@author: Su-Jin Lee
'''
from time import sleep, time
from random import randint
from sqlite3 import dbapi2 as sqlite
from sqlstmt import *
from sweep import LazySweeper, INTERVAL
class DataMan(object):
conn = sqlite.connect(':memory:', check_same_thread=False)
cur = conn.cur... |
import unittest
import ap_configurator_factory
import dlink_ap_configurator
import linksys_ap_configurator
import pyauto_ap_configurator # must preceed pyauto
import pyauto
class ConfiguratorTest(pyauto.PyUITest):
"""This test needs to be run against the UI interface.
The purpose of this test is to act as a b... |
import datetime
import pytz
from graphql import GraphQLError
from pytest import fixture
from ..datetime import Date, DateTime, Time
from ..objecttype import ObjectType
from ..schema import Schema
class Query(ObjectType):
datetime = DateTime(_in=DateTime(name="in"))
date = Date(_in=Date(name="in"))
time... |
from __future__ import print_function
import os, sys
from os.path import isdir, isfile, islink, join
from optparse import OptionParser
from subprocess import check_call, CalledProcessError, PIPE
options = None
args = []
available_types = set(['scons'])
tool_stdout = PIPE
def main():
global options
global a... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : Oct 13, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : <EMAIL>
The... |
"""Self-test suite for Crypto.Hash.SHA384"""
__revision__ = "$Id$"
# Test vectors from various sources
# This is a list of (expected_result, input[, description]) tuples.
test_data = [
# RFC 4634: Section Page 8.4, "Test 1"
('cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358b... |
import re
import sys
import parse_tree as pt
import mod_collins_head_finder as mchf
import warnings
import pdb
# Adapted from the Berkeley coreference system.
def extract_dependency_structure(num_words, parse_tree, head_finder):
constituents = parse_tree.get_constituents()
subtree_heads = dict()
trees = pa... |
from sympy import S, Symbol, sin, cos
from sympy.physics.vector import ReferenceFrame, Vector, Point, \
dynamicsymbols
from sympy.physics.vector.fieldfunctions import divergence, \
gradient, curl, is_conservative, is_solenoidal, \
scalar_potential, scalar_potential_difference
from sympy.utilities.pytest ... |
from py4j.protocol import Py4JJavaError
from pyflink.table import expressions as expr
from pyflink.table.window import Session, Slide, Tumble, Over
from pyflink.testing.test_case_utils import PyFlinkStreamTableTestCase, PyFlinkBatchTableTestCase
class StreamTableWindowTests(PyFlinkStreamTableTestCase):
def test... |
#!/usr/bin/env python
import os
import sys
import subprocess
from setuptools import setup, find_packages
subprocess.call(
('mkdir -p seqmagick/data && '
'git describe --tags --dirty > seqmagick/data/ver.tmp '
'&& mv seqmagick/data/ver.tmp seqmagick/data/ver '
'|| rm -f seqmagick/data/ver.tmp'),
... |
import os
import re
import sys
try:
import selinux
HAS_SELINUX = True
except ImportError:
HAS_SELINUX = False
# getter subroutines
def get_config_state(configfile):
myfile = open(configfile, "r")
lines = myfile.readlines()
myfile.close()
for line in lines:
stateline = re.match('^SE... |
# -*- 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 'Stat'
db.create_table(u'mhf_stat', (
(u'id', self.gf('django.db.models.fields.Au... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Parse ace format files.
"""
import os
import sys
import logging
from Bio.Sequencing import Ace
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from jcvi.apps.base import OptionParser, ActionDispatcher
from jcvi.formats.base import m... |
import os
import cap.plugin.toy.animal
import cap.plugin.toy.extra_animal
import matplotlib.pyplot as plt
from cap.model.som import SOM2D
from cap.settings import TYPE_TRAINING_SAMPLE
from cap.settings import TYPE_TEST_SAMPLE
ANIMAL_WEIGHT_STEP_SIZE = 0.2
ANIMAL_NBH_STEP_SIZE = 8
ANIMAL_MAX_NBH_SIZE = 5
ANIMAL_MAP_ROW... |
from __future__ import unicode_literals, print_function
import os
from pygments import highlight
from pygments.lexers import get_lexer_for_filename, TextLexer
from pygments.formatters import HtmlFormatter
from nikola.plugin_categories import Task
from nikola import utils
class Listings(Task):
"""Render pretty ... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six import iteritems
from ansible.module_utils.pycompat24 import get_exception
def _fail_mode_to_st... |
import copy
import webob
from nova.api.openstack.compute import extension_info
from nova import exception
from nova import policy
from nova import test
from nova.tests.unit.api.openstack import fakes
FAKE_UPDATED_DATE = extension_info.FAKE_UPDATED_DATE
class fake_extension(object):
def __init__(self, name, al... |
from __future__ import print_function
import getpass
import inspect
import os
import sys
import textwrap
import prettytable
import six
from six import moves
from healingclient.openstack.common.apiclient import exceptions
from healingclient.openstack.common.gettextutils import _
from healingclient.openstack.common im... |
"""
=========================================
Understanding the decision tree structure
=========================================
The decision tree structure can be analysed to gain further insight on the
relation between the features and the target to predict. In this example, we
show how to retrieve:
- the binary t... |
# bg is always black.
# effect is white
# func decl: red bold
# class decl: blue bold
# predefined decl: green bold
# predefined usage: yellow bold
<info descr="null" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">len</info>("")
len = [] # redefine... |
"""
A simple example of an animated plot... In 3D!
"""
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib.animation as animation
def Gen_RandLine(length, dims=2):
"""
Create a line using a random walk algorithm
length is the number of points for ... |
"""Argument-less script to select what to run on the buildbots."""
import os
import shutil
import subprocess
import sys
if sys.platform in ['win32', 'cygwin']:
EXE_SUFFIX = '.exe'
else:
EXE_SUFFIX = ''
BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__))
TRUNK_DIR = os.path.dirname(BUILDBOT_DIR)
ROOT_DIR... |
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources
import google.auth # type: ignore
import google.api_core # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # ty... |
"""
Default scope implementation relying on bit shifting. See
:attr:`provider.constants.SCOPES` for the list of available scopes.
Scopes can be combined, such as ``"read write"``. Note that a single
``"write"`` scope is *not* the same as ``"read write"``.
See :class:`provider.scope.to_int` on how scopes are combined.... |
"""Tests for distutils.unixccompiler."""
import os
import sys
import unittest
from test.support import EnvironmentVarGuard, run_unittest
from distutils import sysconfig
from distutils.unixccompiler import UnixCCompiler
class UnixCCompilerTestCase(unittest.TestCase):
def setUp(self):
self._backup_platform... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class RTPIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rtp\.pt/play/p(?P<program_id>[0-9]+)/(?P<id>[^/?#]+)/?'
_TESTS = [{
'url': 'http://www.rtp.pt/play/p405/e174042/paixoes-cruzadas',
... |
import controllers
import models |
import os
import sys
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
def compile_messages(locale=None):
basedirs = [os.path.join('conf', 'locale'), 'locale']
if os.environ.get('DJANGO_SETTINGS_MODULE'):
from django.conf import settings
basedirs... |
from oslo.serialization import jsonutils
import sqlalchemy as sa
from nailgun.db import db
from nailgun.test import base
class TestRepoMetadataToRepoSetup(base.BaseAlembicMigrationTest):
prepare_revision = '1b1d4016375d'
test_revision = '37608259013'
@classmethod
def prepare(cls):
meta = sa... |
from pyramid.security import NO_PERMISSION_REQUIRED
from pyramid.view import view_config
from sqlalchemy import select
from ns_portal.Models import DBSession, User, dbConfig, Base, Site
import base64
@view_config(
route_name='core/site',
permission=NO_PERMISSION_REQUIRED,
renderer='json'
)
def site(request... |
class ModuleDocFragment(object):
DOCUMENTATION = """
options:
- See respective platform section for more details
requirements:
- See respective platform section for more details
notes:
- Ansible modules are available for the following NetApp Storage Platforms: E-Series, ONTAP, SolidFire
"""
# Documentat... |
import os, sys
import glob
import optparse
import traceback
import WebIDL
class TestHarness(object):
def __init__(self, test, verbose):
self.test = test
self.verbose = verbose
self.printed_intro = False
def start(self):
if self.verbose:
self.maybe_print_intro()
... |
#!/usr/bin/env python
# -*- coding: us-ascii -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
"""Not Apples to Apples (tm) nor is it
Cards Against Humanity(tm).
"""
"""DELIBERATELY NOT MAKING THIS FILE PY3 COMPATIBLE"""
import os
import sys
import random
import pprint
import cgi
# json support, TODO consider ht... |
from nltk.grammar import Nonterminal, parse_cfg
def generate(grammar, start=None):
if not start:
start = grammar.start()
return _generate_all(grammar, [start])[0]
def _generate_all(grammar, items):
frags = []
if len(items) == 1:
if isinstance(items[0], Nonterminal):
for pro... |
#!/usr/bin/env python
# *-* coding: UTF-8 *-*
"""Tuxy dorește să împlementeze un nou paint pentru consolă.
În timpul dezvoltării proiectului s-a izbit de o problemă
pe care nu o poate rezolva singur și a apelat la ajutorul tău.
El dorește să adauge o unealtă care să permită umplerea unei
forme închise.
Exemplu:
Po... |
from pysnmp.proto import rfc1157, rfc1905
readClassPDUs = {
rfc1157.GetRequestPDU.tagSet: 1,
rfc1157.GetNextRequestPDU.tagSet: 1,
rfc1905.GetRequestPDU.tagSet: 1,
rfc1905.GetNextRequestPDU.tagSet: 1,
rfc1905.GetBulkRequestPDU.tagSet: 1
}
writeClassPDUs = {
rfc1157.SetRequestPDU.tagSet: 1,
... |
import os
import sys
import unittest2
from st2auth_flat_file_backend.flat_file import FlatFileAuthenticationBackend
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class FlatFileAuthenticationBackendTestCase(unittest2.TestCase):
def test_authenticate_httpasswd_file_without_comments(self):
file_pa... |
#!/usr/bin/env python
""" Clean incoming of old unused files """
# Copyright (C) 2000, 2001, 2002, 2006 James Troup <<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 Software Foundation; either version 2 ... |
"""
Tests for L{twisted.internet.protocol}.
"""
from twisted.python.failure import Failure
from twisted.internet.defer import CancelledError
from twisted.internet.protocol import Protocol, ClientCreator
from twisted.internet.task import Clock
from twisted.trial.unittest import TestCase
from twisted.test.proto_helpers ... |
from __future__ import absolute_import
from datetime import datetime
from django.utils.translation import ungettext, ugettext as _
from .utils import now
JUST_NOW = _("just now")
SECONDS_AGO = (_("%(seconds)d second ago"), _("%(seconds)d seconds ago"))
MINUTES_AGO = (_("%(minutes)d minute ago"), _("%(minutes)d minut... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Lexers for math languages.
:copyright: 2007-2008 by Christopher Creutzig, Ken Schutte, Stou Sandalski,
Laurent Gautier <<EMAIL>>.
:license: BSD, see LICENSE for more details.
"""
import re
try:
set
except Na... |
"""
Cameras are responsible for determining which part of a scene is displayed
in a viewbox and for handling user input to change the view.
Several Camera subclasses are available to customize the projection of the
scene such as 3D perspective and orthographic projections, 2D
scale/translation, and other specialty c... |
import datetime
import core
import copy
from core import ParseError, Field, auto_store, PySchema
import binascii
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
def ordereddict_push_front(dct, key, value):
"""Set a value at the front of an OrderedDict
... |
#!/usr/bin/env python
# -*- coding: utf-8
# pytest unit tests for spinalcordtoolbox.labels
import logging
from time import time
import numpy as np
import pytest
import spinalcordtoolbox.labels as sct_labels
from spinalcordtoolbox.image import Image, zeros_like
from spinalcordtoolbox.utils import sct_test_path
from s... |
{
'name': 'Italy - Accounting',
'version': '0.2',
'depends': ['base_vat','account_chart','base_iban'],
'author': 'OpenERP Italian Community',
'description': """
Piano dei conti italiano di un'impresa generica.
================================================
Italian accounting chart and localizatio... |
import unittest
import numpy as np
import chainer
from chainer.backends import cuda
from chainer.functions import relu
from chainer import testing
from chainermn import create_communicator
from chainercv.links.model.mobilenet import TFConv2DBNActiv
from chainercv.utils.testing import attr
def _add_one(x):
retu... |
"""Tests for event_file_loader."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
from tensorflow.python.framework import test_util
from tensorflow.python.platform import googletest
from tensorflow.python.summary.impl import even... |
data = (
'Zhui ', # 0x00
'Zi ', # 0x01
'Ke ', # 0x02
'Xiang ', # 0x03
'Jian ', # 0x04
'Mian ', # 0x05
'Lan ', # 0x06
'Ti ', # 0x07
'Miao ', # 0x08
'Qi ', # 0x09
'Yun ', # 0x0a
'Hui ', # 0x0b
'Si ', # 0x0c
'Duo ', # 0x0d
'Duan ', # 0x0e
'Bian ', # 0x0f
'Xian ', # 0x10
'... |
"""
Copyright (c) Jupyter Development Team.
Distributed under the terms of the Modified BSD License.
"""
from notebook.notebookapp import NotebookApp
import os
from jinja2 import FileSystemLoader
from notebook.base.handlers import IPythonHandler, FileFindHandler
from traitlets import Unicode
HERE = os.path.dirname(__... |
#!/usr/bin/env python
import time
import datetime
import sys
import getopt, argparse
from collections import defaultdict
import json
import MySQLdb
import unicodecsv
ITEM_MAP_VARCHAR_INSERT = "insert into item_map_varchar (item_id, attr_id, value) values ((select item_id from items where client_item_id = %(id)s),(selec... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import fnmatch
import traceback
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ovirt import (
check_sdk,
create_connection,
get_dict_o... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import json
import traceback
from ansible.module_utils.api import basic_auth_argument_spec
... |
#coding=UTF8
"""
El proposito de este experimento es analizar la convergencia del método de
Newton para x0 == alpha
"""
import itertools
from copy import deepcopy
from pylab import plt, legend
from tp1 import Experimento
alphas = [10 ** (n * 2) for n in range(-25, 25, 2)]
marker = itertools.cycle(('+', 'o', '*'))
... |
import threading
from dataclasses import dataclass
import queue
from typing import Optional, Any, Callable
from uuid import UUID
from sslyze.plugins.scan_commands import ScanCommand
@dataclass(frozen=True)
class CompletedScanJob:
for_server_scan_uuid: UUID
for_scan_command: ScanCommand
return_value: Opt... |
import sys
import os
def abort( problem ):
'''Print error message and exit'''
sys.stderr.write( '\n' )
sys.stderr.write( problem )
sys.stderr.write( '\n\n' )
sys.exit(2)
if sys.version_info < (2,6): #pragma: no cover
def resolve_symlinks(orig_path):
drive,tmp = os.path.splitdrive(os... |
from __future__ import unicode_literals
from django.db.models import Q
from django.test import TestCase
from .models import (SystemDetails, Item, PropertyValue, SystemInfo, Forum,
Post, Comment)
class NullFkTests(TestCase):
def test_null_fk(self):
d = SystemDetails.objects.create(details='First det... |
from settings import namespaces
import settings
from utils import remove_duplicated_lines, left_equals
from SmartFile import SmartFile
#==============================================================================
# SingleCodeUnit
#==============================================================================
class ... |
import requests
import re
from pushbullet import Pushbullet
# Nom d'utilisateur/mot de passe pour le compte CROUS
CROUS_USERNAME = '12345678'
CROUS_PASSWORD = 'azerty1234'
# Seuil de solde sous lequel une alerte sera envoyée
BALANCE_THRESHOLD = 3.20
# URL de base du site de monétique du CROUS
MONETIQUE_BASE_URL = '... |
# -*- coding: utf-8 -*-
"""
Number & PhoneNumber classes - along with their list classes
"""
from plivo.base import (ListResponseObject, PlivoResource,
PlivoResourceInterface)
from plivo.utils import to_param_dict
from plivo.utils.validators import *
class Number(PlivoResource):
_name = '... |
# This script compares the db schema of 2 eden apps to tell the differences
#
# Just run the script with 3 necessary arguments in this order
# 1. WEB2PY_PATH
# 2. OLD_APP
# 3. NEW_APP
# python applications/eden/static/scripts/tools/apps_db_comparison.py /home/web2py eden_old eden_new
#
# This script also has a Test scr... |
"""The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams;... |
from __future__ import division
import math
__author__ = 'Matt Clarke-Lauer'
__email__ = '<EMAIL>'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 8 / 1 / 13
__version__ = '0.1'
__status__ = 'Development'
'''
Example analysis
'''
name = "Calculate String Entropy"
description = "Calcualtes the average string entropy ... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgssymbolexpressionvariables.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Matthias Kuhn
Email : matthias at opengis dot ch
*... |
"""
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
from __future__ import unicode_literals
import inspect
from collections im... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import json
from itertools import chain
from ansible.module_utils._text import to_text
from ansible.module_utils.network.common.utils import to_list
from ansible.plugins.cliconf import CliconfBase, enable_mode
class C... |
# coding: utf-8
import filecmp
import os
from corehq.apps.app_manager.management.commands.build_app_manager_v2_diffs import (
get_diff_filename,
get_diff,
)
from django.test import SimpleTestCase
RELATIVE_DIFF_STORAGE_YAML = 'data/v2_diffs/yaml'
RELATIVE_YAML_V1 = '../static/app_manager/json/v1'
RELATIVE_YAML... |
#==============================================================================
# adsodtest.py
#==============================================================================
from gandalf.analysis.facade import *
import matplotlib.pyplot as plt
from matplotlib import rc
from mpl_toolkits.axes_grid1 import AxesGrid
impo... |
import warnings
import unittest
import sys
from nose.tools import assert_raises
from sklearn.utils.testing import (
_assert_less,
_assert_greater,
assert_less_equal,
assert_greater_equal,
assert_warns,
assert_no_warnings,
assert_equal,
set_random_state,
assert_raise_message)
from ... |
import proto # type: ignore
__protobuf__ = proto.module(
package='google.ads.googleads.v6.enums',
marshal='google.ads.googleads.v6',
manifest={
'AdGroupAdRotationModeEnum',
},
)
class AdGroupAdRotationModeEnum(proto.Message):
r"""Container for enum describing possible ad rotation modes ... |
import mraa as m
import unittest as u
from i2c_checks_shared import *
class I2cChecksReadByteData(u.TestCase):
def setUp(self):
self.i2c = m.I2c(MRAA_I2C_BUS_NUM)
def tearDown(self):
del self.i2c
def test_i2c_read_byte_data(self):
self.i2c.address(MRAA_MOCK_I2C_ADDR)
expected_res = MRAA_MOCK_I... |
"""Manage HTTP servers with CherryPy."""
import warnings
import cherrypy
from cherrypy.lib import attributes
# We import * because we want to export check_port
# et al as attributes of this module.
from cherrypy.process.servers import *
class Server(ServerAdapter):
"""An adapter for an HTTP server.
Yo... |
"""Utilities related to Keras layers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.keras.python.keras import backend as K
from tensorflow.contrib.keras.python.keras.utils.conv_utils import convert_kernel
d... |
__author__ = 'sei'
from PIStage._base import Controller
import math
class E545(Controller):
def __init__(self, ip=None, port=None, coordinate_mapping = None, z_correction_angle = None):
#super(E545, self).__init__()
super().__init__(ip=ip,port=port,coordinate_mapping=coordinate_mapping,z_correctio... |
# encoding: 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 field 'UserProfile.date_mozillian'
db.add_column('profile', 'date_mozillian', self.gf('django.db.... |
import graphene
class UserField(graphene.ObjectType):
id = graphene.String().NonNull
email = graphene.String().NonNull
name = graphene.String().NonNull
username = graphene.String().NonNull
groups = graphene.List('GroupField')
class CreateUser(graphene.Mutation):
user = graphene.Field(UserF... |
"""Tests for the init module."""
import asyncio
from pyheos import CommandFailedError, HeosError, const
import pytest
from homeassistant.components.heos import (
ControllerManager,
async_setup_entry,
async_unload_entry,
)
from homeassistant.components.heos.const import (
DATA_CONTROLLER_MANAGER,
D... |
"""The tests for the geolocation trigger."""
import pytest
from homeassistant.components import automation, zone
from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_OFF
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
from tests.common import asyn... |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO # importamos libreria entradas-salidas
import time # importamos libreria temporizadores
from flask import Flask, jsonify, render_template # servicio WEB
#import pygame, sys # Chamadas do sistema
#from pygame.locals import * # Aplicación para as fotos... |
import hashlib
import random
import string
import time
from libcloud.common.base import ConnectionUserAndKey
from libcloud.common.base import JsonResponse
from libcloud.common.types import InvalidCredsError, ProviderError
from libcloud.utils.py3 import basestring, httplib, urlencode
SALT_CHARACTERS = string.ascii_le... |
# -*- coding: utf-8 -*-
"""
Local settings
- Run in Debug mode
{% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' %}
- Use mailhog for emails
{% else %}
- Use console backend for emails
{% endif %}
- Add Django Debug Toolbar
- Add django-extensions as app
"""
import socket
import os
from .common... |
# -*- coding: utf-8 -*-
"""
Swedish specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
from django.contrib.localflavor.se.se_counties import COUNTY... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.