gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import unittest from decimal import Decimal import iso8601 from lxml import etree from pythonic_testcase import assert_equals, assert_raises from soapfish import xsd, xsdspec class Aircraft(xsd.ComplexType): tail_number = xsd.Attribute(xsd.String) class Airport(xsd.ComplexType): type = xsd.Element(xsd.St...
import difflib import pprint import pickle import re import sys import warnings import weakref import inspect from copy import deepcopy from test import support import unittest from .support import ( TestEquality, TestHashing, LoggingResult, ResultWithNoStartTestRunStopTestRun ) class Test(object): "Ke...
from unittest.case import TestCase from tracker.domain import ContestFactory, Participant, Fact, ContestValidator,\ ValidationException, ContestRanker class TestDomainMuurkeKlop(TestCase): ''' This test case covers how we want to create and keep track of a single game of Muurke Klop. - N-down: N Part...
# huffman.py # Author: Dixon Crews # CSC 505-001, Fall 2016 # Homework 3, #5 ############################################################################### # Import needed libraries import math, sys, binascii ############################################################################### # Node class class Node():...
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
""" models.py Defines the database models. """ from datetime import datetime from sqlalchemy import event from sqlalchemy.event import listens_for from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import UserMixin import bcrypt db = SQLAlchemy() resourcecategory = db.Table( 'resourcecategory', ...
# 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...
# -*- coding: utf-8 -*- """ pygments.lexers.html ~~~~~~~~~~~~~~~~~~~~ Lexers for HTML, XML and related markup. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, ExtendedRegexLexer, inclu...
# Copyright 2015: Mirantis 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 b...
""" Core OpenBCI object for handling connections and samples from the board. EXAMPLE USE: def handle_sample(sample): print(sample.channel_data) board = OpenBCIBoard() board.print_register_settings() board.start_streaming(handle_sample) NOTE: If daisy modules is enabled, the callback will occur every two samples, ...
# -*- coding: utf-8 -*- # Copyright 2022 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...
#!/usr/bin/env python import os import sys import subprocess import json from pprint import pprint import StringIO import csv import ast from getpass import getpass from hashlib import md5 def generate_nodesfile(vcname, subnet=None): nodescmd = "cm comet cluster {} --format=rest".format(vcname) proc = subpr...
# flake8: noqa # pylint: skip-file # noqa: E301,E302 class YeditException(Exception): ''' Exception class for Yedit ''' pass # pylint: disable=too-many-public-methods class Yedit(object): ''' Class to modify yaml files ''' re_valid_key = r"(((\[-?\d+\])|([0-9a-zA-Z%s/_-]+)).?)+$" re_key = r"(?:\...
# Copyright 2017 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/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ A test script which attempts to detect memory leaks by calling C functions many times and compare process memory usage before an...
# Lint as: python3 """LIT wrappers for T5, supporting both HuggingFace and SavedModel formats.""" import re from typing import List import attr from lit_nlp.api import model as lit_model from lit_nlp.api import types as lit_types from lit_nlp.examples.models import model_utils from lit_nlp.lib import utils import ten...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import time import warnings from . import basex from . import hansenlaw from . import dasch from . impor...
from __future__ import absolute_import from __future__ import division from __future__ import print_function NX_STATUS_QUALIFIER = (0x3FF63000) NX_STATUS_WARNING = (0x00000000) NX_STATUS_ERROR = (0x80000000) NX_WARNING_BASE = (NX_STATUS_QUALIFIER | NX_STATUS_WARNING) NX_ERROR_BASE = (NX_STATUS_QUALIFIER | NX_STATUS_E...
import unicodedata from collections import OrderedDict from django.conf import settings from django.contrib import messages from django.contrib.auth import update_session_auth_hash from django.core.exceptions import FieldDoesNotExist, ValidationError from django.db import models from django.db.models import Q from dja...
# -*- 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...
__author__ = 'rencui' from afinn import Afinn import numpy import json from textstat.textstat import textstat from nltk.stem.porter import * from tokenizer import simpleTokenize import logging from scipy.sparse import csr_matrix import matplotlib.pyplot as plt import matplotlib as mat from sklearn.ensemble import Extra...
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
#!/usr/bin/env python # _*_ coding:utf-8 _*_ import codecs from datetime import datetime import json import logging import time import urllib import subprocess from flask import Markup, g, render_template, request from slimit import minify from smartypants import smartypants import app_config import copytext logging...
""" mbed SDK Copyright (c) 2011-2017 ARM Limited 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...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2017 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...
# Copyright (c) 2012 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. """Wrapper for running the test under heapchecker and analyzing the output.""" import datetime import logging import os import re import common import ...
import sys, select, time, socket, traceback class SEND: def __init__( self, sock, timeout ): self.fileno = sock.fileno() self.expire = time.time() + timeout def __str__( self ): return 'SEND(%i,%s)' % ( self.fileno, time.strftime( '%H:%M:%S', time.localtime( self.expire ) ) ) class RECV: def ...
# -*- coding: utf-8 -*- # remimplement gpoline.icn and digest.cin python. # This will implement basic functionality of converting gpo locator codes # to html matching thomas/lis . # import re import logging logging.basicConfig(format='%(levelname)s %(pathname)s %(lineno)s:%(message)s', level=logging.DEBUG) #logging.ba...
import pytest from plenum.common.messages.internal_messages import NewViewCheckpointsApplied from plenum.common.messages.node_messages import OldViewPrePrepareRequest, OldViewPrePrepareReply from plenum.common.startable import Mode, Status from plenum.server.consensus.consensus_shared_data import ConsensusSharedData f...
from time_tracking.forms import ClockForm from time_tracking.templatetags import clockformats from expenses.templatetags import moneyformats from time_tracking.middleware import CurrentUserMiddleware from time_tracking.models import Clock, Project, Activity, ClockOptions, ActivityOptions, TimeTrackingGroup from django ...
# -*-python-*- import cgi import os import shutil import tempfile import subprocess import json import re import codecs from threading import Timer import config from cherrypy.lib.static import serve_file from cherrypy.lib.cptools import allow from cherrypy import HTTPRedirect from mako.template import Template fro...
# Copyright 2011 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...
""" 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 pytest from flexmock import flexmock from dockerfile_parse import DockerfileParser from atomi...
import time import math import sys import pygame import jog2d def simu(ns, shared_regs, change_regs): print "simu started" twopi = 2.0 * math.pi pygame.init() xmax = 1000 ymax = 600 size = (xmax, ymax) screen = pygame.display.set_mode(size) tpict = [] tpictply = [] pict1 = j...
# # The Python Imaging Library. # $Id$ # # JPEG (JFIF) file handling # # See "Digital Compression and Coding of Continous-Tone Still Images, # Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1) # # History: # 1995-09-09 fl Created # 1995-09-13 fl Added full parser # 1996-03-25 fl Added hack to use th...
# 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 u...
import inspect import os from importlib import import_module from django.apps import apps from django.conf import settings from django.contrib import admin from django.contrib.admin.views.decorators import staff_member_required from django.contrib.admindocs import utils from django.contrib.admindocs.utils import ( ...
from django.conf.urls import url from rest_framework import routers from rest_framework.response import Response from rest_framework.reverse import reverse from rest_framework.urlpatterns import format_suffix_patterns from rest_framework.views import APIView from onadata.apps.api.viewsets.charts_viewset import ChartsV...
from __future__ import unicode_literals import copy import logging import sys import warnings from django.conf import compat_patch_logging_config, LazySettings from django.core import mail from django.test import TestCase, RequestFactory from django.test.utils import override_settings from django.utils.encoding impor...
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals # # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2015. It is licensed under # the three-clause BSD license; see LICENSE. # Contact...
# 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/python3.4 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # 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...
# Copyright 2014 Mellanox Technologies, Ltd # # 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 t...
# Copyright 2012 Anton Beloglazov # # 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...
# -*- coding: utf-8 # Copyright 2017-2019 The FIAAS 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 applica...
"""Small utilities.""" import functools import operator import string import time from collections.abc import Sequence from pyspark import RDD, SparkContext from sympy import ( sympify, Symbol, Expr, SympifyError, count_ops, default_sort_key, AtomicExpr, Integer, S ) from sympy.core.assumptions import Managed...
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
# Copyright (c) 2018 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...
# Copyright 2015 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 argparse import csv, os, time import MySQLdb # http://sourceforge.net/projects/mysql-python/ import result from result import Result import gspread, getpass # https://pypi.python.org/pypi/gspread/ (v0.1.0) # Get command line arguments parser = argparse.ArgumentParser(description='Load SNP and locus data') pars...
from __future__ import unicode_literals import httplib import logging from django.core.exceptions import ValidationError from django.db import IntegrityError from django.db import connection from django.db import transaction from flask import request from framework.auth import Auth from framework.sessions import ge...
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import math from coremltools.converters.mil.mil import get_new_symbol, types from coremltools.conver...
# -*- coding: utf-8 -*- import hashlib import os from hamcrest import ( assert_that, calling, equal_to, has_entries, has_entry, raises ) from pydeform.exceptions import NotFoundError, ValidationError from testutils import ( DeformSessionProjectClientTestCaseMixin, DeformTokenProjectClie...
__author__ = 'teemu kanstren' import time import os import unittest import shutil import inspect from elasticsearch import Elasticsearch import pkg_resources from pypro.local.loggers.es_network_logger import ESNetLogger from pypro import utils import pypro.tests.t_assert as t_assert import pypro.local.config as confi...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2010 Citrix Systems, 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/...
import numpy as np from numpy import array, sqrt from numpy.testing import (assert_array_almost_equal, assert_equal, assert_almost_equal, assert_allclose) from pytest import raises as assert_raises from scipy import integrate import scipy.special as sc from scipy.special import gamma import ...
import unittest from os import path import pysam from cigar import Cigar from mock import Mock from pyfasta import Fasta from clrsvsim.simulator import ( make_split_read, modify_read, modify_read_for_insertion, invert_read, unpack_cigar, get_max_clip_len, get_inverse_sequence, overlap ...
chemdner_sample_base = "corpora/CHEMDNER/CHEMDNER_SAMPLE_JUNE25/" cpatents_sample_base = "corpora/CHEMDNER-patents/chemdner_cemp_sample_v02/" pubmed_test_base = "corpora/pubmed-test/" transmir_base = "corpora/transmir/" chemdner2017_base = "corpora/CHEMDNER2017/" chemdner2017_1k = "corpora/CHEMDNER2017_1k/" mirnacorpus...
# -*- 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 'UserPageView' db.create_table('website_userpageview', ( ('id', self.gf('django.d...
############################################################## # These constants are used in various files. # If you need to define a value that will be used in those files, # just define it here rather than copying it across each file, so # that it will be easy to change it if you need to. ############################...
#!/usr/bin/env python import sys sys.dont_write_bytecode = True import glob import yaml import json import os import sys import time import logging from argparse import ArgumentParser from slackclient import SlackClient def dbg(debug_string): if debug: logging.info(debug_string) USER_DICT = {} class R...
import json import logging import re import urllib.parse from urllib.error import HTTPError, URLError from urllib.request import Request, urlopen from django.conf import settings DOMAIN = settings.MATRIX_DOMAIN URL = settings.MATRIX_URL class NoSuchUser(Exception): pass def _auth_header(): return {'Author...
""" Objective-C runtime wrapper for use by LLDB Python formatters Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. See https://llvm.org/LICENSE.txt for license information. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """ import lldb import lldb.formatters.cache import lldb.form...
#Copyright 2007-2009 WebDriver committers #Copyright 2007-2009 Google 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 b...
# coding: utf-8 # In[ ]: # opengrid imports from opengrid.library import misc, houseprint, caching, analysis from opengrid import config c=config.Config() # other imports import pandas as pd import charts import numpy as np import os # configuration for the plots DEV = c.get('env', 'type') == 'dev' # DEV is True ...
from __future__ import division, unicode_literals import os import re import sys import time from ..compat import compat_str from ..utils import ( encodeFilename, decodeArgument, format_bytes, timeconvert, ) class FileDownloader(object): """File Downloader class. File downloader objects are...
import argparse from pathlib import Path from typing import Union import tflite_runtime.interpreter as tflite from PIL import Image import numpy as np def check_args(args: argparse.Namespace): """Check the values used in the command-line have acceptable values args: - args: argparse.Namespace ret...
from simulux.disks import Disks from lib.utils import jsonify # Global disks var to use in all the tests disks = Disks() def test_init(): ''' Test default load of the Disks class ''' try: disks = Disks() except Exception as e: print "Exception raised: %s" % (e) assert False...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Canonical Ltd. # # 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...
# # 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...
# Copyright 2017 Google LLC 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 ag...
#!/usr/bin/env python3 # Copyright 2013-2014 The Meson development team # 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...
"""HTTP server classes. Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST, and CGIHTTPRequestHandler for CGI scripts. It does, however, optionally implement HTTP/1.1 persistent connections, as of version 0.3. Notes on CGIHTT...
import os.path import re import urlparse from bs4 import BeautifulSoup import requests import clarify import unicodecsv from openelex.base.datasource import BaseDatasource from openelex.lib import build_github_url from openelex.lib.text import ocd_type_id class Datasource(BaseDatasource): RESULTS_PORTAL_URL = "...
# -*- coding: utf-8 -*- """ Unit tests for the omf plugin """ # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END __author__ = "Stefano Simonelli" __copyright__ = "Copyright (c) 2018 OSIsoft, LLC" __license__ = "Apache 2.0" __version__ = "${VERSION}" import asyncio import logging import pytest import...
# "High performance data structures # " # copied from pypy repo # # Copied and completed from the sandbox of CPython # (nondist/sandbox/collections/pydeque.py rev 1.1, Raymond Hettinger) # # edited for Brython line 558 : catch ImportError instead of AttributeError import operator #try: # from thread import get_i...
"""XML-RPC Servers. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to handle XML-RPC requests in a CGI environment using CGIXMLRPCRequestHandler. The Doc* classes can be...
# Standard imports import logging import attrdict as ad import numpy as np import pandas as pd import datetime as pydt # Our imports import emission.analysis.point_features as pf import emission.analysis.intake.segmentation.trip_segmentation as eaist import emission.core.wrapper.location as ecwl class DwellSegmentati...
# pylint: disable=E0401 # stdlib from functools import partial import logging import time import unittest # 3rd from mock import Mock, patch # project from tests.checks.common import Fixtures from utils.timeout import TimeoutException log = logging.getLogger(__name__) WMISampler = None ProviderArchitecture = None ...
import sys import re import os import json import MarkdownPP ################################################################################ ### @brief length of the swagger definition namespace ################################################################################ defLen = len('#/definitions/') #########...
#!/usr/bin/python # # Copyright 2015 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 b...
# -*- coding: utf-8 -*- """ pygments.lexers.webmisc ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for misc. web stuff. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, byg...
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # from __future__ import ...
# Copyright 2017 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...
# coding: utf-8 # imports import os import re import itertools from time import gmtime, strftime, localtime, time from PIL import Image, ImageFile # django imports from django.core.files.storage import default_storage from django.utils.encoding import smart_str # filebrowser imports from filebrowser.settings import ...
# 6.00 Problem Set 4 # # Caesar Cipher Skeleton # import string import random import numbers WORDLIST_FILENAME = "words.txt" # ----------------------------------- # Helper code # (you don't need to understand this helper code) def load_words(): """ Returns a list of valid words. Words are strings of lowercase...
# First we import parts of the frameworks we're using: # # Flask <http://flask.pocoo.org> is a simple framework for building web # applications in Python. It handles basic things like parsing incoming # HTTP requests and generating responses. # # Flask-RESTful <https://flask-restful.readthedocs.io/> is an add-on to Fla...
import socket import struct import sys import time import threading from Queue import Queue from msgpack import ( packb as packs, unpackb as unpacks ) __all__ = ['Agent'] class Agent(object): """ Validate and package the metrics for graphdat """ # if the queue gets larger than this, stop ad...
# Copyright (c) 2010 Stephen Paul Weber. Based on work by Joao Prado Maia. # Licensed under the ISC License import MySQLdb import time from mimify import mime_encode_header, mime_decode_header import re import settings import mime import strutil import os.path try: import html2text except ImportError: html2te...
"""Support for Z-Wave climate devices.""" # Because we do not compile openzwave on CI import logging from typing import Optional, Tuple from homeassistant.components.climate import ClimateDevice from homeassistant.components.climate.const import ( ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, CURRENT_HVAC_C...
# Copyright 2014 IBM Corp. # # 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 ...
# -*- coding: utf-8 -*- """ Model tests for artifact """ from cStringIO import StringIO import time from datetime import datetime, timedelta from cgi import FieldStorage from pylons import c, g, request, response from nose.tools import assert_raises, assert_equals, with_setup import mock from mock import patch from m...
import os import sys import time import math import numpy as np import theano import theano.tensor as T import theano.tensor.shared_randomstreams from util import datapy, color, paramgraphics from optimization import optimizer from layer import FullyConnected, nonlinearity from layer import GaussianHidden, NoParamsB...
import os from .. import constants, logger from . import ( base_classes, texture, material, geometry, object as object_, utilities, io, api ) class Scene(base_classes.BaseScene): """Class that handles the contruction of a Three scene""" _defaults = { constants.METADATA:...
from copy import copy import pytest from diofant import (Dict, ImmutableDenseNDimArray, ImmutableSparseNDimArray, Indexed, IndexedBase, Matrix, Rational, SparseMatrix, Symbol) from diofant.abc import i, j, w, x, y, z __all__ = () def test_ndim_array_initiation(): arr_...
""" desispec.io.brick ================= I/O routines for working with per-brick files. See ``doc/DESI_SPECTRO_REDUX/SPECPROD/bricks/BRICKID/*-BRICKID.rst`` in desidatamodel for a description of the relevant data models. See :doc:`coadd` and `DESI-doc-1056 <https://desi.lbl.gov/DocDB/cgi-bin/private/ShowDocument?doci...
# -*- coding: utf-8 -*- import datetime import sys from reportlab.graphics import renderPDF from reportlab.graphics.barcode.qr import QrCodeWidget from reportlab.graphics.shapes import Drawing from reportlab.lib.pagesizes import A4 from reportlab.pdfgen import canvas from reportlab.lib.units import mm from reportlab.pl...
#!/usr/bin/python #Copyright (c) 2016, Justin R. Klesmith #All rights reserved. #QuickStats: Get the statistics from a enrich run from __future__ import division from subprocess import check_output from math import log import StringIO import argparse import time import os __author__ = "Justin R. Klesmith" __copyrigh...
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...