gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from __future__ import division, unicode_literals import contextlib import json import numbers try: import requests except ImportError: requests = None from jsonschema import _utils, _validators from jsonschema.compat import ( PY3, Sequence, urljoin, urlsplit, urldefrag, unquote, urlopen, str_types, ...
import ctypes, ctypes.util, operator, sys from . import model if sys.version_info < (3,): bytechr = chr else: unicode = str long = int xrange = range bytechr = lambda num: bytes([num]) class CTypesType(type): pass class CTypesData(object): __metaclass__ = CTypesType __slots__ = ['__we...
from django.db.models import Q from django.utils import timezone import calendar from collections import defaultdict from datetime import datetime, timedelta from functools import reduce, partial import re from dateutil.parser import parse as parse_date from .models import Attribute, local_now, localize_dt from parce...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # loan-status documentation build configuration file, created by # sphinx-quickstart on Tue Aug 15 14:05:13 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this ...
# encoding: utf-8 """Unit-test suite for `pptx.slide` module.""" import pytest from pptx.dml.fill import FillFormat from pptx.enum.shapes import PP_PLACEHOLDER from pptx.package import Package from pptx.parts.presentation import PresentationPart from pptx.parts.slide import SlideLayoutPart, SlideMasterPart, SlidePar...
#!/usr/bin/python doc = """\ Storage Compute manager """ import sys from gevent import monkey monkey.patch_all(thread=not 'unittest' in sys.modules) import os import glob import socket import subprocess import json import time import datetime import pdb import re import argparse import ConfigParser import signal imp...
"""Integration with Rope library.""" import os.path import re import site import sys from rope.base import project, libutils, exceptions, change, worder, pycore from rope.base.fscommands import FileSystemCommands # noqa from rope.base.taskhandle import TaskHandle # noqa from rope.contrib import autoimport as rope_aut...
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 ...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
import datetime import logging import pymongo import random import re import subprocess from pymongo import son_manipulator from pylons import config from anygit.backends import common from anygit.data import exceptions logger = logging.getLogger(__name__) max_transaction_window = 1000 curr_transaction_window = 0 c...
# Copyright 2006-2009 by Peter Cock. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. # # This module is for reading and writing FASTA format files as SeqRecord # objects. The co...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
# should re-write compiled functions to take a local and global dict # as input. from __future__ import absolute_import, print_function import sys import os from . import ext_tools from . import catalog from . import common_info from numpy.core.multiarray import _get_ndarray_c_version ndarray_api_version = '/* NDARRA...
# Copyright (c) 2011-2014 Exxeleron GmbH # # 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...
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Download all Native Client toolchains for this platform. This module downloads multiple tgz's and expands them. """ import cy...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC """ """ import os import random rando...
# -*- coding: utf-8 -*- # This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. import os import string import subprocess from os.path import expanduser try: from scandir import walk except ImportError: from os import walk from viper.common.abs...
#!/usr/bin/env python # # Copyright 2013 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. import argparse import os import re import shutil import sys import tempfile import zipfile from util import build_utils from util i...
# -*- coding: utf-8 -*- # Copyright (2017-2018) Hewlett Packard Enterprise Development LP # # 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 # -------------------------------------------------------------------------- # 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 ...
"""Constraints definition for minimize.""" import numpy as np from ._hessian_update_strategy import BFGS from ._differentiable_functions import ( VectorFunction, LinearVectorFunction, IdentityVectorFunction) from .optimize import OptimizeWarning from warnings import warn from numpy.testing import suppress_warnings ...
# -*- 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 field 'Event.calendar_link' db.add_column(u'media_event', 'calendar_link', se...
## -*- coding: utf-8 -*- ## (C) 2015-2019 Muthiah Annamalai, ## from __future__ import print_function import abc import sys import codecs import pickle from tamil import utf8 from pprint import pprint PYTHON3 = (sys.version[0] == '3') class Queue(list): ExceptionMsg = u"Queue does not support list method %s" ...
import bottle import os import time from redis import StrictRedis from bmf.simpledb import Connection from bmf.bottleplugin.userauth import RedisLockoutManager, SqlSessionStorage, UserStore, SecurityScheme, UserAuthPlugin, AuthenticationException def test_session_storage(session_storage): assert session_storage.ge...
# 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 (t...
#!/usr/bin/env python3 # # Copyright (c) 2019, The OpenThread Authors. # 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. Redistributions of source code must retain the above copyright # ...
from __future__ import print_function from corpkit.constants import STRINGTYPE, PYTHON_VERSION def plotter(df, title=False, kind='line', x_label=None, y_label=None, style='ggplot', figsize=(8, 4), save=False, legend_pos='be...
# 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 (c) 2013 Huawei Technologies Co., Ltd. # 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:...
""" These managers handles the """ from django.db import models from django.db.models import Q from evennia.typeclasses.managers import (TypedObjectManager, TypeclassManager, returns_typeclass_list, returns_typeclass) _GA = object.__getattribute__ _PlayerDB = None _ObjectDB = Non...
"""Methods for getting information about short phone numbers, such as short codes and emergency numbers. Note most commercial short numbers are not handled here, but by phonenumberutil.py """ # Based on original Java code: # java/src/com/google/i18n/phonenumbers/ShortNumberInfo.java # Copyright (C) 2013 The Libpho...
import hashlib from contextlib import contextmanager from django import forms from django.conf import settings from django.contrib.auth.models import AbstractBaseUser from django.core import validators from django.core.urlresolvers import reverse from django.db import models from django.utils import translation from d...
############################################################################### # FlattenedPowerPotential.py: Power-law potential that is flattened in the # potential (NOT the density) # # amp # phi(R,z)= --------- ; m^2 = R^2...
# -*- 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...
''' This module provides the Bus32 class. The Bus32 class provides higher-level generic functionality on top of a low-level driver that knows how to access a particular bus. The class provides the following services: - Allows reads and writes with single or multiple bytes, halfwords, or words - Handles alignment iss...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ ZFS APIs. """ from __future__ import absolute_import import os from contextlib import contextmanager from uuid import uuid4 from subprocess import ( CalledProcessError, STDOUT, PIPE, Popen, check_call, check_output ) from characteristic import att...
# Working with neural networks # @author: Matheus Cesario <mts.cesario@gmail.com> # Train data # Test data # Parameters # Output # Expected output # Abstracting Input/Output from a cell class Edge(object): """ Edge (input or output of cell) """ # Properties _value = 0 _weight = 0 # Ctor def...
# -*- test-case-name: twisted.test.test_abstract -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Support for generic select()able objects. """ from zope.interface import implements # Twisted Imports from twisted.python import reflect, failure from twisted.internet import interfaces, ...
# (c) 2009-2014 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Original PyFileServer (c) 2005 Ho Chun Wei. # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ Implementation of a WebDAV provider that provides a very basic, read-only resource layer emul...
from __future__ import unicode_literals import warnings from django import forms from django.contrib import admin from django.contrib.contenttypes.admin import GenericStackedInline from django.core import checks from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from .models imp...
""" All of the metadata related to MITgcm variables, grids, naming conventions, etc. """ # python 3 compatiblity from __future__ import print_function, division import numpy as np from xarray.core.pycompat import OrderedDict # We are trying to combine the following two things: # - MITgcm grid # http://mitgcm.org/se...
# 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 -*- import os import unittest # prepare for test os.environ['ANIMA_TEST_SETUP'] = "" from anima.dcc import mayaEnv # to setup maya extensions import pymel.core class SequencerExtensionTestCase(unittest.TestCase): """tests the anima.animation.SequencerExtension class """ def setUp...
from flask import Flask from flaskext.htmlbuilder import init_htmlbuilder, html, render_template, \ render, Attr, root_block, block from html5boilerplate import html5_boilerplate app = Flask(__name__) init_htmlbuilder(app) @app.route('/') def index(): html.block('title')( 'Element Consistency Tes...
import os import pprint import json import shutil from datetime import datetime from pathlib import Path from queue import Empty from traitlets.config import Config from nbconvert.preprocessors import Preprocessor from nbconvert.preprocessors.execute import ExecutePreprocessor, CellExecutionError from nbformat.noteboo...
# Script for collecting PRs in need of review, and informing maintainers via # slack. # NOTE: Slack IDs can be found in the user's full profile from within Slack. from __future__ import print_function import datetime import os import sys import github from slack_sdk import WebClient from slack_sdk.errors import Slac...
import hashlib from contextlib import contextmanager from django import forms from django.conf import settings from django.contrib.auth.models import AbstractBaseUser from django.core import validators from django.core.urlresolvers import reverse from django.db import models from django.utils import translation from d...
# 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/LICENSE-2.0 # # Unless required by applicable law or agreed to...
import asyncio from collections import namedtuple from datetime import datetime from email.utils import format_datetime, parsedate_to_datetime import time import logging from django.utils import timezone import aiohttp from aiohttp.errors import ConnectionError, HttpException from celery import shared_task import fee...
from stream_framework import exceptions as stream_framework_exceptions from stream_framework.utils import make_list_unique, datetime_to_epoch from stream_framework.utils.five import long_t import datetime import uuid import six MAX_AGGREGATED_ACTIVITIES_LENGTH = 15 class BaseActivity(object): ''' Common pa...
from builtins import str from geventwebsocket import WebSocketApplication from promise import Promise import gevent import json SUBSCRIPTION_FAIL = 'subscription_fail' SUBSCRIPTION_END = 'subscription_end' SUBSCRIPTION_DATA = 'subscription_data' SUBSCRIPTION_START = 'subscription_start' SUBSCRIPTION_SUCCESS = 'subscri...
#!/usr/bin/env python import unittest import base64 import gflags import os import sys from ct.crypto import cert from ct.crypto import error from ct.crypto import pem from ct.crypto import verify from ct.proto import client_pb2 from ct.serialization import tls_message import mock FLAGS = gflags.FLAGS gflags.DEFINE...
## Copyright (c) 2010, Coptix, Inc. All rights reserved. ## See the LICENSE file for license terms and warranty disclaimer. """features -- XMPP stream features""" from __future__ import absolute_import import sasl, weakref, random, hashlib, base64 from . import plugin, xml, interfaces as i from .prelude import * __...
from flask import Flask, url_for, request, Response import json import logging from random import randint class RestService: #class RestService: app = Flask(__name__) deployer = None discovery = None @app.route('/') def api_root(): return 'Read <a href="https://github.com/lyndon160/Siren...
#!/usr/bin/env python """ Setuptools bootstrapping installer. Maintained at https://github.com/pypa/setuptools/tree/bootstrap. Run this script to install or upgrade setuptools. """ import os import shutil import sys import tempfile import zipfile import optparse import subprocess import platform import textwrap imp...
# # Copyright (c) 2016, The OpenThread Authors. # 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. Redistributions of source code must retain the above copyright # notice, this list of ...
# Copyright 2015 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, s...
"""Support for NuHeat thermostats.""" from datetime import datetime import logging import time from nuheat.config import SCHEDULE_HOLD, SCHEDULE_RUN, SCHEDULE_TEMPORARY_HOLD from nuheat.util import ( celsius_to_nuheat, fahrenheit_to_nuheat, nuheat_to_celsius, nuheat_to_fahrenheit, ) from homeassistant...
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
# 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...
# python3 # 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 ...
################################################################################ # Copyright (C) 2013-2014 Jaakko Luttinen # # This file is licensed under the MIT License. ################################################################################ import numpy as np import matplotlib.pyplot as plt import functoo...
from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from dcim.choices import * from dcim.constants import * from extras.models import ObjectChange from utilities.fields import NaturalOrderingField fr...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ General utility functions. """ __all__ = ["InterruptiblePool", "short_hash", "wrapper"] import functools import logging import os import signal import sys from six import string_types from six.moves import cPickle as pickle from tempfile import mkstemp from time impo...
#!/usr/bin/env python """ Created by stevertaylor Copyright (c) 2014 Stephen R. Taylor Code contributions by Rutger van Haasteren (piccard) and Justin Ellis (PAL/PAL2). """ import numpy as np from numpy import * import os import math from scipy import integrate from scipy import optimize as sciopt from scipy import...
import argparse import cloud import fractions import json import math import subprocess import sys def calculate_euler_phi_prime_power(p, k): '''Assuming p is prime, calculates and returns Phi(p^k) quickly. ''' return (p - 1) * p**(k - 1) def trial_divide(n, upper_bound=None): '''Does trial division...
""" Various important consts """ ARGVAL = 0xffff ARGVAL1 = 0xfffe ARGVAL2 = 0xfffc # name, num_args, effect on stack, # effect on the alternate ptr stack BYTECODES = [ ('ILLEGAL', 0, 0), ('DISCARD_TOP', 0, -1), ('DUP', 0, 1), ('SWAP', 0, 0), ('ROT', 1, 0), ('STORE', 0, 0), # -1 ('STORE_UN...
# Main script for running all files import os import time import logging import gzip import shutil import threading from analyzer import * from multiprocessing import Process, cpu_count # Setup folder paths logging.info('Creating directories for data and results...') extracted_file_dir = os.path.join(os.getcwd(), 'ex...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
import glob import os import textwrap import yaml # ========================================= # Write out file for special functions # ========================================= def _initiate_specials(): ''' Initiate python file for special functions which are present in the Rmath.h file -- used mainly ...
# urllib3/connectionpool.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging import socket import errno from socket import error as SocketError, time...
# 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...
"""Substitution & interpolation formatting.""" from collections.abc import Mapping, Set, Sequence from string import Formatter class RecursionSpec(): """Parse a string formatting spec. This class just parses a format_spec string. It looks for a leading 'ff' or 'rf'. A format expression looks like th...
"""Support for the Xiaomi vacuum cleaner robot.""" import asyncio from functools import partial import logging import voluptuous as vol from homeassistant.components.vacuum import ( ATTR_CLEANED_AREA, DOMAIN, PLATFORM_SCHEMA, SUPPORT_BATTERY, SUPPORT_CLEAN_SPOT, SUPPORT_FAN_SPEED, SUPPORT_LOCATE, SUPPORT_PAUS...
import pygame, sys, time from enum import Enum from math import cos, sin, pi import numpy as np from sklearn.preprocessing import normalize as norm class colors(Enum): Black=(0,0,0) Blue=(0,100,255) Orange=(255,180,70) Red=(255,0,0) White=(255,255,255) class Atarigame: def __init__(self, speed=1, brickx=8,brick...
# Copyright 2012 OpenStack 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...
import numpy as np, os from glob import glob from scipy.interpolate import LinearNDInterpolator,interp1d from scipy import integrate import matplotlib.pyplot as plt import matplotlib.cm as cm from astropy.cosmology import WMAP9 as cosmo f0 = 1420405751.7667 # Hz def build_model_interp(parm_array,delta2_array,k_array...
import os import pickle import math import sys import time import StringIO import json from bdcloud_interface import baidupcsi from bmplugin import * class bdcloud: #path must unicode main=None pcsi=baidupcsi() def __init__(self,flag=None): bdcloud.main.reloadconfig() self.config={'token...
# -*- 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...
""" Source Extraction Helpers. These are used in conjunction with image.ImageData. """ import logging from collections import MutableMapping import numpy try: import ndimage except ImportError: from scipy import ndimage from sourcefinder.deconv import deconv from sourcefinder.utility import coordinates from...
import re from datetime import datetime from lxml import etree def parse_result(xml): return etree.XML(xml) def pretty_print(res): print(etree.tostring(res, pretty_print=True, encoding='unicode')) class Result(object): def __init__(self, xml): tree = etree.fromstring(bytes(xml)) self....
# 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 ...
""" Filename: calc_interhemispheric_metric.py Author: Damien Irving, irving.damien@gmail.com Description: Calculate the interhemispheric timeseries for a general input variable """ # Import general Python modules import sys, os, pdb import argparse import numpy import iris from iris.experimental.equalise_...
# Copyright (c) 2014 Cisco Systems # 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...
import kivy import random from kivy.app import App from kivy.core.window import Window import glob from jnius import cast from jnius import autoclass import os from commands import * from utils import * from kivy.lang import Builder from kivy.metrics import metrics from kivy.uix.floatlayout import FloatLayout from unic...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # Database Module # -------------------- from __future__ import unicode_literals import warnings import datetime import frappe import frappe.defaults import frappe.async from time import time import re import frappe.mo...
#!/usr/bin/python3 """ ================================================ ABElectronics IO Pi 32-Channel Port Expander Version 1.0 Created 29/02/2015 Requires python 3 smbus to be installed with: sudo apt-get install python-smbus ================================================ Each MCP23017 chip is split into two...
""" This module contains functions related to quantum circuits. """ import numpy as np from qitensor import HilbertAtom, HilbertArray, HilbertError, \ HilbertShapeError, MismatchedSpaceError __all__ = [ 'cphase', 'cnot', 'swap', 'controlled_U', 'toffoli', 'fredkin', 'max_entangled', ] def cphase(h1, h2):...
from __future__ import print_function from builtins import zip from builtins import str from builtins import range from builtins import object import os import re import ast import glob import hashlib from pathlib import Path from typing import Union import pandas import numpy as np import datetime import subprocess f...
import os, sys from decimal import Decimal import gzip from collections import OrderedDict import logging def blast_result_iterator(blast_file): _ = blast_file.readline() # burn header for line in blast_file: if not line.startswith("#"): yield BlastHit(line) class BlastHit(object): ""...
from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement from cms.models.fields import PageField from django.db import models from django.utils.encoding import python_2_unicode_compatible, smart_text from django.utils.functional import cached_propert...
from __future__ import absolute_import __all__ = ( "TestCase", "TransactionTestCase", "APITestCase", "TwoFactorAPITestCase", "AuthProviderTestCase", "RuleTestCase", "PermissionTestCase", "PluginTestCase", "CliTestCase", "AcceptanceTestCase", "IntegrationTestCase", "Snuba...
""" Utility classes and functions for the polynomial modules. This module provides: error and warning objects; a polynomial base class; and some routines used in both the `polynomial` and `chebyshev` modules. Error objects ------------- .. autosummary:: :toctree: generated/ PolyError base class for...
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
# Copyright 2010 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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.apach...
from __future__ import print_function from django.test import TestCase from django.contrib.auth.models import User from django.test import Client from models import Photo, Album import factory class UserFactory(factory.django.DjangoModelFactory): class Meta: model = User django_get_or_create = ('...
# Copyright (C) 2016, Hitachi, 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...
# Copyright 2020 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. import web_idl from . import name_style from .blink_v8_bridge import blink_class_name from .blink_v8_bridge import blink_type_info from .blink_v8_bridge imp...
#!/usr/bin/env python3 """ Test script for the 'cmd' module Original by Michael Schneider """ import cmd import sys import re import unittest import io from test import support class samplecmdclass(cmd.Cmd): """ Instance the sampleclass: >>> mycmd = samplecmdclass() Test for the function parseline()...
from settings.secure import OAUTH_TOKEN, CANVAS_URL from canvas_sdk.methods import submissions, assignments, courses from canvas_sdk.utils import get_all_list_data from canvas_sdk import RequestContext import sys import os.path import logging import json import argparse import xlwt import datetime logging.basicConfig(...