gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
"""Output module for the Excel Spreadsheet (XLSX) output format."""
from __future__ import unicode_literals
import datetime
import os
import re
import xlsxwriter
from plaso.output import dynamic
from plaso.output import interface
from plaso.output import manager
import pytz # pylint: disab... | |
from __future__ import absolute_import
from django.test import TestCase
from .models import Place, Restaurant, Bar, Favorites, Target, UndergroundBar
class OneToOneRegressionTests(TestCase):
def setUp(self):
self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
self.p1.save()
s... | |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# coding: utf-8
import logging
import logging.config
from datetime import datetime, timedelta
import argparse
import os
import sys
from elasticsearch import Elasticsearch, NotFoundError, RequestError
from publication import utils
from articlemeta import client
from processing import choices
import xylose
logger = lo... | |
"""Item Loader
See documentation in docs/topics/loaders.rst
"""
from collections import defaultdict
import six
from scrapy.item import Item
from scrapy.selector import Selector
from scrapy.utils.decorators import deprecated
from scrapy.utils.deprecate import create_deprecated_class
from scrapy.utils.misc import arg_... | |
import json
import logging
from pajbot.managers.db import DBManager
from pajbot.models.module import Module
from pajbot.utils import find
log = logging.getLogger(__name__)
class ModuleSetting:
"""
A single setting for a Module.
Available types:
* text - A text input
Available constraints:... | |
# Copyright (c) Pelagicore AB 2016
import logging
from .parser.TListener import TListener
from .parser.TParser import TParser
from .domain import *
from antlr4 import ParserRuleContext
import yaml
import click
from .profile import get_features, EProfile, EFeature
import codecs
import json
try:
from yaml import CS... | |
import operator
import numpy as np
import pytest
import pandas._libs.sparse as splib
import pandas.util._test_decorators as td
from pandas import Series
import pandas._testing as tm
from pandas.core.arrays.sparse import BlockIndex, IntIndex, _make_index
TEST_LENGTH = 20
plain_case = dict(
xloc=[0, 7, 15],
... | |
# Copyright (c) Microsoft Corporation. All rights reserved.
"""End to end test.
"""
import logging
import unittest
import pydocumentdb.documents as documents
import pydocumentdb.document_client as document_client
import pydocumentdb.errors as errors
import pydocumentdb.http_constants as http_constants
# localhost... | |
import threading
from django.contrib.sessions.models import Session
from django.template import RequestContext, TemplateDoesNotExist
from django.template.loaders import app_directories, filesystem
from django.test import Client, TestCase
from mock import MagicMock, Mock, patch
from django_mobile import get_flavour, set... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
from __future__ import generators
from schema import *
import classutil
def update_graph(self, graph):
'save nodes and edges of graph to self'
for node, d in graph.iteritems():
self += node
saveDict = self[node]
for target, edge in d.iteritems():
saveDict[target] = edge
... | |
#-*- coding: UTF-8 -*-
import os
import sys
import time
import logging
from datetime import date
from datetime import datetime
from BeautifulSoup import BeautifulSoup
import ConfigParser
global cfg
global ids
global url_prefix
global log_level
def getHTML(url):
import httplib
import urllib2
try:
... | |
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# -*- coding: utf-8 -*-
'''
This module implements :class:`SpikeTrain`, an array of spike times.
:class:`SpikeTrain` derives from :class:`BaseNeo`, from
:module:`neo.core.baseneo`, and from :class:`quantites.Quantity`, which
inherits from :class:`numpy.array`.
Inheritance from :class:`numpy.array` is explained here:
... | |
#!/usr/bin/env python3
# Copyright 2017-2021 AVSystem <avsystem@avsystem.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | |
#
# Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
#
"""
VNC service management for kubernetes
"""
import uuid
from vnc_api.vnc_api import *
from config_db import *
from kube_manager.common.kube_config_db import NamespaceKM
from kube_manager.common.kube_config_db import NetworkPolicyKM
from vnc_kuber... | |
# Copyright (c) 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# ... | |
import re
import sys
from alembic.testing import TestBase, exclusions
from alembic.operations import ops
from sqlalchemy import MetaData, Column, Table, String, \
Numeric, CHAR, ForeignKey, DATETIME, Integer, \
CheckConstraint, Unicode, Enum, cast,\
UniqueConstraint, Boolean, ForeignKeyConstraint,\
Pri... | |
from __future__ import absolute_import
import collections
import functools
import logging
import warnings
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_scheme
from .exceptions import (
HTTPWarning,
Locati... | |
# -*- coding: utf-8 -*-
import json
import logging
import os
import re
import time
from slackclient import SlackClient
import markov_slackbot.model_controller as model_controller
import markov_slackbot.message_interpreter as message_interpreter
import markov_slackbot.slack_logs as slack_logs
class MarkovSlackbot(o... | |
#!/usr/bin/env python
"""ROS has a parameter server, we have files.
The parameter store is a persistent key value store, implemented as a directory with a writer lock.
On Android, we store params under params_dir = /data/params. The writer lock is a file
"<params_dir>/.lock" taken using flock(), and data is stored in ... | |
# Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import warnings
import numpy as np
from nose.tools import raises, eq_
import librosa
from test_core import load, srand
# Disable cache
import os
try:
os.environ.pop('LIBROSA_CACHE_DIR')
except KeyError:
pass
__EXAMPLE_FI... | |
"""
Descriptor objects for entities that are part of the LLVM project.
"""
import ConfigParser
import StringIO
import sys
from util import *
class ParseError(Exception):
pass
class ComponentInfo(object):
"""
Base class for component descriptions.
"""
type_name = None
@staticmethod
def ... | |
# Module to read the rather complex config data
# Currently the configuration file is documented in
# tardis/data/example_configuration.ini
import logging
import os
import pprint
import copy
from astropy import constants, units as u
import astropy.utils
import numpy as np
import pandas as pd
import yaml
from model_re... | |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | |
#
#[The "BSD license"]
# Copyright (c) 2013 Terence Parr
# Copyright (c) 2013 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistribution... | |
import argparse
import logging
import json
import os
import traceback
import time
import datetime
import grpc
import subprocess
from concurrent import futures
import ray
import psutil
import ray.ray_constants as ray_constants
import ray.services
import ray.utils
from ray.core.generated import reporter_pb2
from ray.cor... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import MagicMock
from mock import patch
from mock import call
from di... | |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import datetime
import errno
import hashlib
import json
import os
import shutil
import subprocess
import sys
import tempfile
sys.path.append(
os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../.."))
from io import StringIO
f... | |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# encoding: utf-8
#
# Copyright (C) 2011, 2012 Google Inc.
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | |
"""Contains the main class and functions for the niggli reduced
cell. As described in the papers found at:
https://www.mendeley.com/viewer/?fileId=74bc20b9-a7a5-8e3d-4608-6ce09ea453e0&documentId=7b2a0aec-6dcf-3475-8834-96ddbb760220
https://www.mendeley.com/viewer/?fileId=39464089-ceb6-6b27-6e45-ade432b467cc&documentId=... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | |
"""Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | |
import numpy as n, matplotlib.pyplot as p, scipy.special
import cosmolopy.perturbation as pb
import cosmolopy.density as cd
from scipy.integrate import quad,tplquad
import itertools
from scipy.interpolate import interp1d
from scipy.interpolate import RectBivariateSpline as RBS
import optparse, sys
o = optparse.OptionP... | |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
#!/usr/bin/env python
# Copyright (c) 2013, 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=F0401
import json
import optparse
import os
import re
import shutil
import subprocess
import sys
import tempf... | |
import yaml
import json
import xmltodict
import os
import sys
import subprocess
import collections
XSD = 'c:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin\\x64\\xsd.exe'
CommonReplacements = {
'id': 'ID',
'url': 'URL',
'hcontent': 'HContent'
}
_mapping_tag = yaml.resolver.BaseResolver.DEFAUL... | |
# coding: utf-8
# In[1]:
# Setup (Imports)
from LoadData import *
from keras import regularizers
from keras import optimizers
from keras.models import Sequential
from keras.layers.advanced_activations import LeakyReLU
from keras.callbacks import ReduceLROnPlateau, EarlyStopping, ModelCheckpoint
from keras.layers i... | |
"""Detect lesion code."""
# http://scikit-image.org/docs/dev/_downloads/a35d9b7dfd6d18cf5e01952d15cc3af6/plot_blob.py
import logging
from functools import lru_cache, reduce
from math import sqrt
from operator import add
import numpy as np
# import matplotlib as mpl
import matplotlib.pyplot as plt
# import scipy as s... | |
'''
Cache manager
=============
The cache manager can be used to store python objects attached to a unique
key. The cache can be controlled in two ways: with a object limit or a
timeout.
For example, we can create a new cache with a limit of 10 objects and a
timeout of 5 seconds::
# register a new Cache
Cach... | |
import json
from twisted.internet import defer, task
from twisted.trial import unittest
from txjason import service
clock = task.Clock()
class FooException(service.JSONRPCError):
message = "Foo"
code = -32099
class ApplicationError(service.JSONRPCError):
code = -32099
message = "Fake Error"
def ... | |
"""
State Space Representation - Initialization
Author: Chad Fulton
License: Simplified-BSD
"""
import warnings
import numpy as np
from . import tools
class Initialization(object):
r"""
State space initialization
Parameters
----------
k_states : int
exact_diffuse_initialization : bool, opt... | |
#!/usr/bin/python
import sys
import psycopg2
from psycopg2.extras import DictCursor
"""
CREATE TABLE sections (
name TEXT NOT NULL PRIMARY KEY,
description TEXT,
created timestamptz NOT NULl DEFAULT NOW()
);
INSERT INTO sections (name, description) VALUES
('doing',$$What you're doing$$),
('not... | |
from utils import ViewBox, attributesToSVG
from ..utils.struct import Vector as V, identity
from ..utils.dictionary import Dictionary
from re import sub
class Element (object):
def __init__ (self, **attr):
if attr.has_key ('name'):
self.name = attr['name']
else:
self.name ... | |
#!/usr/bin/python -u
#
# generate python wrappers from the XML API description
#
functions = {}
enums = {} # { enumType: { enumConstant: enumValue } }
import string
#######################################################################
#
# That part if purely the API acquisition phase from the
# XML API descripti... | |
from docido_sdk.core import Interface
__all__ = [
'IndexAPI',
'IndexAPIConfigurationProvider',
'IndexAPIProcessor',
'IndexAPIProvider',
'IndexPipelineConfig',
'PullCrawlerIndexingConfig',
]
class IndexAPIProvider(Interface): # pragma: no cover
""" Provide an implementation of IndexAPI
... | |
from pkg_resources import require
require("modulegraph", "altgraph", "macholib")
import os, sys, imp, zipfile, time
from modulegraph.find_modules import PY_SUFFIXES, C_SUFFIXES
from modulegraph.util import *
from modulegraph.modulegraph import os_listdir
from altgraph.compat import *
import macholib.util
import pkg_r... | |
# coding: utf-8
from __future__ import unicode_literals
import os
from boxsdk.client import Client
from boxsdk.object.collaboration import CollaborationRole
from boxsdk.exception import BoxAPIException
from demo.auth import authenticate
def run_user_example(client):
# 'me' is a handy value to get info on the cur... | |
"""Radiative corrections to electron-proton scattering: a Python library
Copyright (c) Alexander Gramolin, 2016
https://github.com/gramolin/rosenbluth/
"""
import numpy as np
from scipy import special
from scipy import integrate
"""Some mathematical and physical constants"""
pi = np.pi
m_e = 0.510998928e-... | |
import json
from robot.libraries.BuiltIn import BuiltIn
from suds.plugin import DocumentPlugin
from suds.client import Client
from suds import WebFault
zoomba = BuiltIn()
class _ObjectNamespacePlugin(DocumentPlugin):
"""_ObjectNamespacePlugin
This class contains a plugin for use in fixing broken WSDL Na... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
from __future__ import unicode_literals
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumTestCase
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import... | |
"""Enables the enhancement of images before their use with other algorithms."""
import SimpleITK as sitk
import numpy as np
import mialab.filtering.filter as fltr
class BiasFieldCorrectorParams(fltr.IFilterParams):
"""Bias field correction filter parameters."""
def __init__(self, mask: sitk.Image):
... | |
"""This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
"""This file contains class definitions for:
Hist: represents a histogram (map from values to integer frequencies).
P... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from .. import models, InputParameterError
from ...coordinates i... | |
#!/usr/bin/env python
"""#
# to run the script
#
# fab -H root@1.1.1.1.1 setup
#
# fab -H root@1.1.1.1.1 my_task:param1
#
# for test
# env SAAS_USER=accounts fab -H root@accounts.test.openerp.com update:saas-1
#
"""
import ConfigParser
import io
import json
import os
import re
from fabric.api import task, env, r... | |
"""Provides database model compliant with sqlalchemy."""
import datetime
import operator
import re
import six
import sqlalchemy as sa
from sqlalchemy.ext import declarative
from sqlalchemy import orm
from seedbox import constants
NONE_TYPE = 'none'
BOOL_TYPE = 'bool'
DATE_TYPE = 'datetime'
INT_TYPE = 'int'
STR_TYPE ... | |
# file findingaids/fa/views.py
#
# Copyright 2012 Emory University Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | |
# coding: utf-8
"""
MasterMind Service Manager
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.0
Contact: gaea@zhaw.ch
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__... | |
"""
Thanks Josh Hemann for the example
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
def simple_scatter(points):
#from mpl_toolkits.mplot3d import Axes3D
xs = zip(*points)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(*xs[:3], c='r', mar... | |
# File: TscSshLib.py ; This file is part of Twister.
# version: 2.004
#
# Copyright (C) 2012-2013 , Luxoft
#
# Authors:
# Adrian Toader <adtoader@luxoft.com>
# Bogdan Popescu <bpopescu@luxoft.com>
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complian... | |
from copy import copy
from django.conf import settings
from django.contrib.contenttypes.generic import GenericRelation
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_model, IntegerField, CharField, FloatField
from django.db.models.signals import post_save, post_delete
class... | |
#!/usr/bin/python2
#
# Copyright 2015 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# generate_new_renderer.py:
# Utility script to generate stubs for a new Renderer class.
# Usage: generate_new_renderer.py <re... | |
# Copyright 2011 Midokura KK
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# -*- coding: utf-8 -*-
# Core modules
from __future__ import print_function
import atexit
import errno
import os
import sys
import time
import signal
class Daemon(object):
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
def __init__(self, pidfile, ... | |
import pytest
from pandas._libs.tslibs.frequencies import INVALID_FREQ_ERR_MSG, _period_code_map
from pandas.errors import OutOfBoundsDatetime
from pandas import Period, Timestamp, offsets
class TestFreqConversion:
"""Test frequency conversion of date objects"""
@pytest.mark.parametrize("freq", ["A", "Q", ... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'DatabaseInfra.ssl_mode'
db.add_column(u'physical_database... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Original source: github.com/okfn/bibserver
# Authors:
# markmacgillivray
# Etienne Posthumus (epoz)
# Francois Boulogne <fboulogne at april dot org>
import sys
import logging
import io
import re
from bibtexparser.bibdatabase import BibDatabase
logger = logging.getLogge... | |
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
A special directive for generating a matplotlib plot.
.. warning::
This is a hacked version of plot_directive.py from Matplotlib.
It's very much subject to change!
Usage
-----
Can be used lik... | |
# Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
#!/usr/bin/env python3
# Name: TUSUserInterface.py
# Description: The callable interface with some facilities.
# Author: Bajron.
from TUSInterface import TUSInterface
from TUSIds import *
import TUSConfiguration
def set_up_consts(aDataRoot, outResource, outBuildings, outHumans):
"""Fills in the given maps with e... | |
# The contents of this file are subject to the Common Public Attribution
# License Version 1.0. (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, ... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Widget that contains auto rename widgets for tpRenamer
"""
from __future__ import print_function, division, absolute_import
import traceback
from functools import partial
from collections import OrderedDict
from Qt.QtCore import *
from Qt.QtWidgets import *
from t... | |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | |
from __future__ import unicode_literals
import copy
import os
import re
import sys
from django.conf import settings
from django.contrib.auth.models import User
from django.core import serializers
from django.core.cache import cache
from django.core.files import File
from django.db import (DatabaseError, DEFAULT_DB_AL... | |
import re, string # re.search(), re.split(), re.sub(), string.find()
from PresentationObject import PresentationObject
from qt import *
from qtcanvas import *
true = success = 1
false = failure = 0
class font( PresentationObject ):
"""
<font> is the base tag for all text in a presentation.
Unfortunately, tex... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | |
import os
import sys
import unittest
import codecs
import base64
import random
import string
import functools
import hashlib
import binascii
import zlib
try:
import urllib.parse as urllibparse
except ImportError:
import urllib as urllibparse
try:
# Python 3
import html
html_encode = html.escape
... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
#!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import re
import fnmatch
import sys
import subprocess
import datetime
import os
#############################... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... | |
"""Common test objects."""
import asyncio
import time
from unittest.mock import AsyncMock, Mock
from zigpy.device import Device as zigpy_dev
from zigpy.endpoint import Endpoint as zigpy_ep
import zigpy.profiles.zha
import zigpy.types
import zigpy.zcl
import zigpy.zcl.clusters.general
import zigpy.zcl.foundation as zcl... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid network messages."""
import os
import struct
from test_framework import... | |
# -*- coding: utf-8 -*-
'''
Created on 20.10.2014
@author: Simon Gwerder
'''
from utilities import utils
from utilities.configloader import ConfigLoader
class TagResults:
cl = ConfigLoader()
results = []
def __init__(self, rdfGraph, rawResults):
self.results = []
self.fillResultList(rd... | |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
salt.utils.nb_popen
~~~~~~~~~~~~~~~~~~~
Non blocking subprocess Popen.
This functionality has been adapted to work on windows following the recipe
found on:
http://code.activestate.com/recipes/44055... | |
# Copyright 2011 Andrew Bogott for the Wikimedia Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from astropy.tests.helper import pytest
from ..nduncertainty_unknown import UnknownUncertainty
from ..nduncertainty_stddev ... | |
# -*- coding: utf-8 -*-
import re
import sys as _sys
from keyword import iskeyword as _iskeyword
from collections import OrderedDict as _OrderedDict
from pkgutil import walk_packages
import inspect
import linecache
import json
def iter_submodules(root_module, recursive=True):
""" """
if isinstance(root_m... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
"""
Functions for helping with serialization and deserialization of
Bokeh objects.
Certain NunPy array dtypes can be serialized to a binary format for
performance and efficiency. The list of supported dtypes is:
%s
"""
from __future__ import absolute_import
import base64
from six import iterkeys
from .dependencie... | |
#!/usr/bin/python
# ----------------------------------------------------------------------------
# generate the prebuilt libs of engine
#
# Copyright 2014 (C) zhangbin
#
# License: MIT
# ----------------------------------------------------------------------------
'''
Generate the prebuilt libs of engine
'''
import os
... | |
"""Tests for the Elgato Key Light config flow."""
import aiohttp
from homeassistant import data_entry_flow
from homeassistant.components import zeroconf
from homeassistant.components.elgato.const import CONF_SERIAL_NUMBER, DOMAIN
from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF
from homeassistant.... | |
"""This module implements decorators for implementing other decorators
as well as some commonly used decorators.
"""
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
import builtins
exec_ = getattr(builtins, "exec")
del builtins
else:
string_... | |
"""
Core components of Home Assistant.
Home Assistant is a Home Automation framework for observing the state
of entities and react to changes.
"""
# pylint: disable=unused-import, too-many-lines
import asyncio
from concurrent.futures import ThreadPoolExecutor
import enum
import logging
import os
import re
import signa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.