gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" The patch module allows for a grid to be created and for data to be defined on that grid. Typical usage: -- create the grid grid = Grid1d(nx) -- create the data that lives on that grid data = CellCenterData1d(grid) bcObj = bcObject(xlb="reflect", xrb="reflect"_ data.registerVar("densi...
from Datasource import Datasource import numpy as np import h5py import json import os class HDF5(Datasource): """ Loads images from hdf5 files Attributes ------------ _read: list All load functions for :data:`_meta_files` """ # All readers for _meta_files _read = [json.load] ...
import inspect import logging import traceback import urllib import urllib.parse from collections import namedtuple from decorator import decorator from tornado.escape import to_basestring from tornado.web import RequestHandler, HTTPError from dorthy import template from dorthy.enum import DeclarativeEnum from dort...
import h5py from worldengine.version import __version__ from worldengine.biome import biome_name_to_index, biome_index_to_name from worldengine.world import World, Step import numpy def save_world_to_hdf5(world, filename): f = h5py.File(filename, libver='latest', mode='w') general_grp = f.create_group("gener...
#!/usr/bin/env python # # Copyright 2011 Facebook # # 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 a...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class DocumentTestCase(Integrat...
from flask_admin._compat import as_unicode import peewee from wtforms import fields, validators from flask_admin import form from flask_admin._compat import iteritems from flask_admin.contrib.peewee import ModelView from . import setup from datetime import datetime, time, date class CustomModelView(ModelView): ...
#!/usr/bin/env python3 import sys import numpy as np import matplotlib.pyplot as plt from collections import defaultdict, deque, OrderedDict from random import shuffle, choice class Graph(): """This class provides the basic functionality for graph handling.""" def __init__(self): """Initialize the di...
''' Created on 1 Oct 2013 @author: david Interface to obtain wavelet transforms and other measurements. ''' from __future__ import division import math import numpy as np from _cwt import _mwt, _rwt WINDOW = 100 def morlet(t, W0=5.): return np.exp(-0.5 * (t ** 2) - 1j * W0 * t) def ricker(t, a): factor ...
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
import unittest from unittest import mock from reportlab.pdfbase import pdfmetrics from ogre.pdf.font import register_fonts_with_unicode_glyphs from ogre.pdf.font import Font from ogre.pdf.font import FontFamily from ogre.pdf.font import FontWeight from ogre.pdf.font import FontStyle from ogre.pdf.font import FontRe...
# -*- test-case-name: twisted.python.test.test_url -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.url}. """ from __future__ import unicode_literals from ..url import URL unicode = type(u'') from twisted.trial.unittest import SynchronousTestCase theurl = ...
""" desispec.io.frame ================= I/O routines for Frame objects """ import os.path import time import numpy as np import scipy, scipy.sparse from astropy.io import fits from astropy.table import Table import warnings from desiutil.depend import add_dependencies from desiutil.log import get_logger from ..fram...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import...
import abc import errno import os import platform import socket import threading import time import traceback import urlparse import mozprocess __all__ = ["SeleniumServer", "ChromeDriverServer", "GeckoDriverServer", "ServoDriverServer", "WebDriverServer"] class WebDriverServer(object): __...
#!/usr/bin/env python # # Licensed under the BSD license. See full license in LICENSE file. # http://www.lightshowpi.org/ # # Author: Todd Giles (todd@lightshowpi.org) # # Initial commands implemented by Chris Usey (chris.usey@gmail.com) """Command definition file. Enabled commands must be defined in the configuratio...
#!/usr/bin/env python """ systimes() user and system timer implementations for use by pybench. This module implements various different strategies for measuring performance timings. It tries to choose the best available method based on the platforma and available tools. On Windows, it is recommen...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 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.a...
# Copyright 2017-2021 TensorHub, Inc. # # 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 writ...
"""Test various algorithmic properties of selectables.""" from sqlalchemy.testing import eq_, assert_raises, \ assert_raises_message, is_ from sqlalchemy import * from sqlalchemy.testing import fixtures, AssertsCompiledSQL, \ AssertsExecutionResults from sqlalchemy import testing from sqlalchemy.sql import uti...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2012 Lukas Kemmer # # 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...
import pytest import retrying import shakedown import time import traceback from datetime import timedelta from dcos.mesos import DCOSClient from dcos import mesos from shakedown import * from utils import * MAX_CONSECUTIVE_SCALE_FAILS = 9 MAX_HOURS_OF_TEST = 4 EVENT_HEADER = ' event:' ERROR_LAUNCH = 'Error (lau...
# 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...
import json import inspect from six import integer_types, string_types, text_type, with_metaclass from springfield.fields import Field, Empty from springfield.alias import Alias from springfield import fields from anticipate.adapt import adapt, AdaptError from anticipate import adapter class EntityBase(object): "...
#!/usr/bin/env python import sys, os, itertools, shutil, getopt, re, time import const import pdb, traceback from xml.etree.ElementTree import ElementTree from xml.etree.ElementTree import Element from xml.etree.ElementTree import SubElement from datetime import * import metacomm.combinatorics.all_pairs2 import unit...
# Knight.py (Springer / Pferd) from __future__ import division from OpenGL.GL import * from OpenGL.GLU import * from defines import * from objloader import * from openGLFunctions import set_color import Piece # noinspection PyPep8Naming class Knight(Piece.Piece): def __init__(self, c, x, y, useobj): if ...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.release} and L{twisted.python._release}. All of these tests are skipped on platforms other than Linux, as the release is only ever performed on Linux. """ from __future__ import print_function import glob import f...
import urlparse import httplib_fork as httplib from ws4py.client.threadedclient import WebSocketClient import Queue import socket import re class HttpResponse: def __init__(self, method, url, headers={}, body=None, async=False, load=True): headers = headers.copy() u = urlparse.urlp...
from __future__ import absolute_import, division, print_function from fnmatch import fnmatch from glob import glob import os import uuid from warnings import warn import pandas as pd from toolz import merge from ...async import get_sync from ...base import tokenize from ...compatibility import PY3 from ...context im...
#!/usr/bin/env python import json import os.path import hmac from time import time from uuid import uuid1 from datetime import datetime from hashlib import sha256, md5 from snapy.utils import (encrypt, decrypt, decrypt_story, make_media_id, request, get_auth_token, ...
from collections import deque import numpy as np from scipy.stats import itemfreq import theano from theano import shared import theano.tensor as T import lasagne from qtable import QAgent from simple_envs import SimpleMaze class QAgentNN(QAgent): """ Neural-network-based Q Learning Agent This agent replac...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Description # ----------- # Print information about Android DEX files import sys import os import argparse import traceback import lief from lief import DEX EXIT_STATUS = 0 terminal_rows, terminal_columns = 100, 100 try: terminal_rows, terminal_columns = os.popen('s...
import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) from subprocess import check_output from keras.models import Model from keras.layers import Dense, Embedding, Input , Activation from keras.layers import LSTM, Bidirectional, GlobalMaxPool1D, Dropout, GRU from ker...
from __future__ import unicode_literals import logging from django.core import exceptions as django_exceptions from django.db import transaction, IntegrityError from waldur_core.core.models import StateMixin from waldur_core.structure import models as structure_models from ..openstack import models as openstack_mod...
from datetime import datetime, timedelta from django.contrib.contenttypes.models import ContentType from nose.tools import eq_ from kitsune.access.tests import permission from kitsune.flagit.models import FlaggedObject from kitsune.forums import POSTS_PER_PAGE from kitsune.forums.events import NewPostEvent, NewThrea...
# # This file is part of LiteX-Boards. # # Copyright (c) 2013-2014 Sebastien Bourdeauducq <sb@m-labs.hk> # Copyright (c) 2014-2019 Florent Kermarrec <florent@enjoy-digital.fr> # Copyright (c) 2015 Yann Sionneau <ys@m-labs.hk> # SPDX-License-Identifier: BSD-2-Clause from litex.build.generic_platform import * from litex...
# Copyright 2013 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 required by applicable law or ...
import datetime from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.test.client import Client import mock from mock import patch from nose.tools import eq_, ok_ from remo.base.tests import RemoTestCase, requires_login, requires_permission from remo.profiles.tests import Fun...
# Copyright 2021 The TensorFlow Ranking Authors. # # 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 ag...
from billing import Integration, IntegrationNotConfigured from billing.models import GCNewOrderNotification from django.conf import settings from xml.dom import minidom import hmac import hashlib import base64 from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST fro...
import mdtraj import numpy as np from subprocess import call, PIPE def write_cpptraj_script(traj, top, frame1=1, frame2=1, outfile=None, write=True, run=False): """ Create a cpptraj script to load specific range of frames from a trajectory and write them out to a file :param traj...
"""Combination of multiple media players for a universal controller.""" from copy import copy import logging import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.components.media_player.const import ( ATTR_APP_ID, ATTR_APP_NAME, A...
#!/usr/bin/env python """ Compliance Checker """ from functools import wraps import pprint import warnings from netCDF4 import Dataset from owslib.swe.observation.sos100 import SensorObservationService_1_0_0 from owslib.swe.sensor.sml import SensorML from owslib.namespaces import Namespaces from compliance_checker imp...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
from bitstring import BitStream, BitArray def getEqualInnerNeighbours(locationalcode): # Set up the different values of the input materialised path # print "Current node: ", locationalcode # The final digit of the materialised path for calculating inner neighbours leafDecimal = int(locationalcode[-1]) # Check...
# Copyright (c) 2015 Mirantis, Inc. # # 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 writin...
""" FEZ graphics types """ from __future__ import print_function from xnb_parse.file_formats.xml_utils import ET from xnb_parse.xna_types.xna_graphics import (Texture2D, FORMAT_COLOR, get_surface_format, VERSION_31, VERSION_40, FORMAT4_COLOR) class ArtObject(object): ...
################################################################################ # 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...
""" fs.wrapfs.limitsizefs ===================== An FS wrapper class for limiting the size of the underlying FS. This module provides the class LimitSizeFS, an FS wrapper that can limit the total size of files stored in the wrapped FS. """ from __future__ import with_statement from fs.errors import * from fs.path i...
""" ha_test.test_core ~~~~~~~~~~~~~~~~~ Provides tests to verify that Home Assistant core works. """ # pylint: disable=protected-access,too-many-public-methods # pylint: disable=too-few-public-methods import os import unittest import time import threading from datetime import datetime import homeassistant as ha cla...
# -------------------------------------------------------------------------------------- # Author: cgarcia@umw.edu # About: This file contains utility functions and classes used specifically in # running scenarios and generating result reports # -------------------------------------------------------------------...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import glob import o...
#!/usr/bin/env python2 # encoding: utf-8 # Author: Alexandre Fonseca # Description: # Installs, configures and manages Hadoop on a set of nodes # in a cluster. # Associated guide: # http://www.alexjf.net/blog/distributed-systems/hadoop-yarn-installation-definitive-guide import os from fabric.api import run, cd,...
#!/usr/bin/env python # -*-coding:utf-8 -* # # Initial project created by chris@drumminhands.com # Current fork made by Pedro Amorim (contact@pamorim.fr) and Vitor Amorim import os import glob import time from time import sleep import traceback import RPi.GPIO as GPIO import picamera # http://picamera.readthedocs.org...
from insights.parsers import httpd_conf from insights.parsers.httpd_conf import HttpdConf from insights.tests import context_wrap import doctest HTTPD_CONF_1 = """ ServerRoot "/etc/httpd" <Directory /> Options FollowSymLinks AllowOverride None </Directory> SSLProtocol -ALL +SSLv3 #SSLProtocol all -SSLv2 NSSP...
# 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...
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
from django.test import TestCase, Client import factory from . import models from .models import Photos, Album, Face from django.contrib.auth.models import User from django.core.files import File from django.conf import settings class UserFactory(factory.DjangoModelFactory): class Meta: model = models.Use...
""" This module contains functions that allow you to manipulate, encode or decode strings and byte sequences. """ import base64 import re import string import itertools import six import codecs from kwonly_args import kwonly_defaults import pwnypack.main import binascii from six.moves import range from six.moves.urll...
# -*- coding: utf-8 -*- import sys if __name__ == '__main__': sys.path.append('../..') import copy import logging import inspect from mongolog.handlers import MongoHandler from base_state import BaseState from state_tool import after_get_parameter, get_need_verify_types, \ get_next_verify_a...
import numpy import chainer from chainer.backends import cuda from chainer.backends import intel64 from chainer import configuration from chainer import function_node from chainer.utils import argument from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn class Dropout(function_node.Fun...
#!/usr/bin/env python """usage: %prog [options] filename Parse a document to a tree, with optional profiling """ import sys import os import traceback from optparse import OptionParser from html5lib import html5parser, sanitizer from html5lib.tokenizer import HTMLTokenizer from html5lib import treebuilders, serializ...
# Copyright 2021 The Pigweed Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
""" Support for ZhongHong HVAC Controller. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.zhong_hong/ """ import logging import voluptuous as vol from homeassistant.components.climate import ( ATTR_OPERATION_MODE, PLATFORM_SCHEMA, STATE_COO...
#!/usr/bin/env python """Test the collector flows. To reduce the size of this module, additional collector flow tests are split out into collectors_*_test.py files. """ import os import mock import psutil from grr.client.client_actions import standard from grr.lib import action_mocks from grr.lib import aff4 from ...
from nanopore.analyses.abstractAnalysis import AbstractAnalysis from nanopore.analyses.utils import AlignedPair, getFastaDictionary, getFastqDictionary, getExonerateCigarFormatString, samIterator, pathToBaseNanoporeDir import os import pysam import numpy import math import random import xml.etree.cElementTree as ET fro...
#!/usr/bin/env python # Copyright 2016, 2017 Matteo Franchin # # 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...
from appfd import forms, models from appfd.forms import * from appfd.models import * from appfd.scripts import excel, resolve, tables from appfd.scripts.excel import * from bnlp import clean as bnlp_clean from bnlp import getLocationsAndDatesFromEnglishText, getLocationsFromEnglishText from bscrp import getRandomUserAg...
""" textureatlas """ from __future__ import absolute_import, division, print_function, unicode_literals import logging import itertools from OpenGL import GL import numpy from mcedit2.util.load_png import loadPNGData from mcedit2.rendering.lightmap import generateLightmap from mcedit2.resourceloader import Resour...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from collections import defaultdict from operator import attrgetter from flask import flash, jsonify, req...
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
from __future__ import absolute_import, unicode_literals import uuid from collections import defaultdict from copy import copy from django.conf.urls import url from django.db import connections from django.utils.translation import ugettext_lazy as _, ungettext_lazy as __ from debug_toolbar.panels import Panel from d...
# Copyright 2018 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...
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals import os import re import inspect import pytest from atomic_reactor import constants as dconstants...
import abc import time import boto from boto.emr.connection import EmrConnection from boto.regioninfo import RegionInfo from boto.emr.step import PigStep import luigi from luigi.s3 import S3Target, S3PathTask from luigi.contrib.pig import PigJobTask from amazon_web_service.luigi import target_factory import log...
"""Support for OwnTracks.""" from collections import defaultdict import json import logging import re from aiohttp.web import json_response import voluptuous as vol from homeassistant import config_entries from homeassistant.components import mqtt from homeassistant.const import CONF_WEBHOOK_ID from homeassistant.cor...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import unittest import warnings import numpy as np from monty.serialization import loadfn from pymatgen.electronic_structure.core import OrbitalType, Spin from pymatgen.io.vasp import Vasprun from p...
#------------------------------------------------------------------------------- #Name: rptest #Purpose: test module for refprop and multiRP # #Author: Thelen, B.J. # thelen_ben@yahoo.com #-------------------------------------------------------------------------------...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Copyright (c) 2014 Mirantis Inc. # # 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, so...
import json import socket from rejected import consumer, testing from tornado import concurrent, gen import mock from vetoes import config, service class Consumer(service.HTTPServiceMixin, consumer.Consumer): def __init__(self, *args, **kwargs): kwargs['service_map'] = {'fetch-stats': 'h...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ This module defines how to handle lineages. """ from __future__ import print_function import numpy as np import random from tunacell.base.datatools import Coordinates from tunacell.base.timeseries import TimeSeries from tunacell.base.observable import Observable, Fun...
# -*- coding: utf-8 -*- """ pygments.lexers.ml ~~~~~~~~~~~~~~~~~~ Lexers for ML family languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, default, words from...
# Copyright 2019 Verily Life Sciences LLC # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. '''Abstract Syntax Tree. Each node is an operator or operand.''' import collections import uuid from abc import ABCMeta, abstractmethod from typing import (Any, Callable, D...
# coding=utf-8 # Copyright 2022 The TensorFlow GAN Authors. # # 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 applicabl...
from __future__ import print_function import numpy as np import pytest import string from keras.utils.test_utils import get_test_data, keras_test from keras.utils.np_utils import to_categorical from keras.models import Sequential from keras import layers import keras @keras_test def test_temporal_classification(): ...
#!/usr/bin/env python # -*- coding:utf-8 -*- import os, sys import logging import re import glob from inspect import isfunction from event_emitter import EventEmitter from pybot.brain import Brain from pybot.response import Response from pybot.message import CatchAllMessage from pybot.listener import TextListener H...
# Command related to creation and execution: run, new, clean, test, auto-test import sys import os import subprocess import shutil import getopt import urllib2 import webbrowser import time import signal from play.utils import * COMMANDS = ['run', 'new', 'clean', 'test', 'autotest', 'auto-test', 'id', 'new,run', 'cl...
# Copyright 2015 Huawei Technologies Co., Ltd. # 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 # # Unl...
# -*- coding: utf-8 -*- from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, String, Integer, ForeignKey, DateTime, Text, Boolean, UniqueConstraint from datetime import datetime Base = declarative_base() _e...
""" Instruction transformations. """ from __future__ import absolute_import from .ast import Def, Var, Apply from .ti import ti_xform, TypeEnv, get_type_env, TypeConstraint from collections import OrderedDict from functools import reduce try: from typing import Union, Iterator, Sequence, Iterable, List, Dict # no...
# Copyright (c) 2019 PaddlePaddle 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 app...
""" HVAC channels module for Zigbee Home Automation. For more details about this component, please refer to the documentation at https://home-assistant.io/integrations/zha/ """ import asyncio from collections import namedtuple from typing import Any, Dict, List, Optional, Tuple, Union from zigpy.exceptions import Zig...
""" Here is probably the place to write the docs, since the test-cases show how the type behave. Later... """ from ctypes import * import sys, unittest from ctypes.test import xfail from test.test_support import impl_detail try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYP...
#!/usr/bin/python # # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittest for generate_gyp_py. It's tough to test the lower-level GetSourceFiles() and GetObjectFiles() functions, so this focuses...
import json import urllib2 import numpy as np import re class userStats: 'This class will contain the information about the user' def __init__(self,fb_id,fb_name): self.fb_ID = fb_id self.fb_name = fb_name self.num_posts=0 self.num_comments=0 self.likes_on_post...
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license import re from xml.sax.saxutils import escape, unescape import html5lib from html5lib import treebuilders, treewalkers, serializer from html5lib.tokenizer import HTMLTokenizer from html5lib.constants import ...
import copy import unittest from mock import patch from datetime import datetime import lxml.etree import requests import scrapper def monkey_patch_requests_get(): def monkey_patch_get(uri, *args, **kwargs): with open('./fixtures/%s' % uri) as fh: extra_dict = { 'content': fh...