gt
stringclasses
1 value
context
stringlengths
2.49k
119k
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------------------------------------------------- # INFO: # ----------------------------------------------------------------------------------------------------------------------- """ Author: Evan Hub...
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Django models for cidb tables.""" from __future__ import print_function from django.db import models from build_annotations import fields as ba_fiel...
#!/usr/bin/python import cv2 import numpy as np from optparse import OptionParser from multiprocessing import Pool from os.path import isfile, join import sys, os, math import dlib # Color print class bcolors: HEADER = '\033[95m' PLAIN = '\033[37m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNIN...
import os import json import uuid # import datetime import logging from collections import OrderedDict import requests from requests_futures.sessions import FuturesSession from bs4 import BeautifulSoup from clint.textui import progress from clint.textui.colored import white, yellow from linkmanager import settings fr...
from django.db.models import CharField, IntegerField, Model, ForeignKey from django.db.models.deletion import DO_NOTHING, PROTECT, SET, SET_NULL from django.utils.encoding import python_2_unicode_compatible from versions.models import Versionable, VersionedManyToManyField, VersionedForeignKey def versionable_descrip...
#! /usr/bin/env python """ Regrid data from WRF hourly files into web mercator for plotting """ import argparse import datetime as dt from functools import partial import logging import os import shutil import sys import warnings import pandas as pd import numpy as np import scipy.interpolate import tables import xar...
# # 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 # ...
import os verbose = os.environ.get('VERBOSE', 'no') == 'yes' from container import * class RecurrentStage: def __init__(self): pass def initTime(self, timespan): """ Initialize stages accross timespan. :param timespan: :return: """ pass def timeForwar...
# encoding: utf-8 """ Objects shared by modules in the docx.oxml subpackage. """ from lxml import etree import re from .exceptions import ValidationError nsmap = { 'a': ('http://schemas.openxmlformats.org/drawingml/2006/main'), 'c': ('http://schemas.openxmlformats.org/drawingml/2006/chart'), 'dgm'...
from __future__ import division import copy import errno import os import signal import subprocess import sys import tempfile import threading import time import unittest import numpy import six from chainer import iterators from chainer import serializer from chainer import testing class DummySerializer(serializer...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The aim of the script is to query the news data base in order to extract the\ description of each new, group them in an 10-day time slice window and infer\ the latent topics. * The PoS tagger and the Chunk tagger are unpickled for later use.\ * The scripts pickles:\ ...
import json import hashlib import tornado.ioloop import tornado.web from tornado.web import MissingArgumentError from tornado.escape import json_decode import tornado.template import tweepy import requests from drenaj.client.config.config import * from drenaj.utils.drenajmongomanager import * from drenaj.drenaj_api.u...
import sys, os, math, random, six from PyQt4 import QtCore, QtGui #from tribalMainWindowUi import Ui_TribalMainWindow from tribalMainLayoutUi import Ui_TribalMainWindow PYTHON_MAJOR_VERSION = sys.version_info.major #if PYTHON_MAJOR_VERSION == 3: # The major version if did not work because the block under that if woul...
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Handlers columns dealing with user roles.""" from sqlalchemy import and_ from ggrc import db from ggrc.converters import errors from ggrc.converters.handlers.handlers import UserColumnHandler from ggrc....
# 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 use ...
import sys import re from sets import Set from Queue import Queue from collections import defaultdict from lib.amr.amr import Dag from data_structures import RuleInstance, CanonicalDerivation, Edge from data_structures import tibFormat, galFormat class DerivationTree(object): """ Simple binary tree class ...
# Copyright 2019, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
""" Lift Curve Widget ----------------- """ from collections import namedtuple import numpy import sklearn.metrics as skl_metrics from PyQt4 import QtGui from PyQt4.QtGui import QColor, QPen from PyQt4.QtCore import Qt import pyqtgraph as pg import Orange from Orange.widgets import widget, gui, settings from Orang...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com> # See LICENSE for details. from hashlib import sha512 from .openssl import OpenSSL from .cipher import Cipher from .hash import hmac_sha256 from struct import pack, unpack class ECC: """ Asymmetric encryp...
import copy from contextlib import contextmanager from typing import Any, Dict, Iterator, Mapping from unittest import mock import orjson from django.conf import settings from django.http import HttpResponse from zerver.lib.actions import do_change_full_name from zerver.lib.test_classes import ZulipTestCase from zerv...
# 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...
# -*- 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 numpy as np from Orange.data import ContinuousVariable, DiscreteVariable, Domain from Orange.data.sql.table import SqlTable from Orange.statistics import distribution, contingency from .transformation import Transformation from . import _discretize __all__ = ["EqualFreq", "EqualWidth", "EntropyMDL", "DomainDis...
"""This module defines a base Exporter class. For Jinja template-based export, see templateexporter.py. """ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function, absolute_import import io import os import copy import collections im...
import datetime from django.conf import settings from django.db import models from django.utils import translation import bleach import caching.base import tower from babel import Locale, numbers from jingo import env from jinja2.filters import do_dictsort from tower import ugettext as _ import amo from amo.helpers ...
# -*- coding: UTF-8 -*- # File: trainer.py # Author: Yuxin Wu <ppwwyyxx@gmail.com> import tensorflow as tf import threading import time from six.moves import zip from .base import Trainer from ..dataflow.common import RepeatedData from ..models import TowerContext from ..utils import * from ..tfutils import * from ...
"""The tests for the Template automation.""" import pytest from homeassistant.core import Context from homeassistant.setup import async_setup_component import homeassistant.components.automation as automation from tests.common import (assert_setup_component, mock_component) from tests.components.automation import com...
#!/usr/bin/env python # coding: utf-8 # # control.py - Interact with an I2P node through json-rpc. import i2py.control.pyjsonrpc, ssl # This isn't really used right now. class RouterStatus(): OK = 0 TESTING = 1 FIREWALLED = 2 HIDDEN = 3 WARN_FIREWALLED_AND_FAST = 4 WARN_FIREWALLED_AND_FLOODFI...
from __future__ import division import collections import ctypes import sys import numpy import six from cupy import binary from cupy import carray from cupy import creation from cupy import cuda from cupy import elementwise from cupy import flags from cupy import indexing from cupy import internal from cupy import i...
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# coding=utf-8 # Copyright 2022 The TensorFlow Datasets 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 appl...
import copy import unittest import warnings import mock import numpy as np import chainer from chainer.backends import cuda from chainer import optimizer from chainer import optimizers from chainer import testing from chainer.testing import attr class TestHyperparameter(unittest.TestCase): def setUp(self): ...
import copy from MuseParse.classes.ObjectHierarchy.TreeClasses.BaseTree import IndexedNode, BackwardSearch, Search from MuseParse.classes.ObjectHierarchy.TreeClasses.VoiceNode import VoiceNode from MuseParse.classes.ObjectHierarchy.TreeClasses.OtherNodes import DirectionNode, ExpressionNode, KeyNode, ClefNode from Mu...
from __future__ import unicode_literals from __future__ import absolute_import, division, print_function """ Annalist test initialization support """ __author__ = "Graham Klyne (GK@ACM.ORG)" __copyright__ = "Copyright 2015, G. Klyne" __license__ = "MIT (http://opensource.org/licenses/MIT)" import logging ...
"""Testing for reddex.""" from datetime import datetime import os from pyramid.config import Configurator from pyramid.httpexceptions import HTTPNotFound from pyramid import testing import pytest from reddex.models import get_tm_session from reddex.models.meta import Base from reddex.models import SubReddit from reddex...
# Copyright (c) 2012 Denis Bilenko. See LICENSE for details. from __future__ import absolute_import import sys import os from gevent._compat import integer_types from gevent.hub import get_hub, getcurrent, sleep, _get_hub from gevent.event import AsyncResult from gevent.greenlet import Greenlet from gevent.pool import ...
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Robert Luke <mail@robertluke.net> # # License: Simplified BSD import os.path as op from col...
#!/usr/bin/env python import sys #import matplotlib #matplotlib.use('GTK') #from matplotlib.figure import Figure #from matplotlib.axes import Subplot #from matplotlib.backends.backend_gtk import FigureCanvasGTK, NavigationToolbar #from matplotlib.numerix import arange, sin, pi import ConfigParser import os try...
import itertools import numpy as np def _zero(data, dim): return np.zeros((dim, 1)) def _d4_ab(data, dim): """dihedral symmetry d4.""" s, t = np.array(data) points = np.array( [[+s, +t], [-s, +t], [+s, -t], [-s, -t], [+t, +s], [-t, +s], [+t, -s], [-t, -s]] ) points = np.moveaxis(poi...
import uuid from datetime import datetime, timedelta from django.test import TestCase from casexml.apps.case.cleanup import rebuild_case_from_forms from casexml.apps.case.mock import CaseBlock from casexml.apps.case.tests.util import delete_all_cases from casexml.apps.case.util import post_case_blocks, primary_action...
#!/usr/bin/env python from fabric.api import local, require, settings, task from fabric.state import env from termcolor import colored import app_config # Other fabfiles import assets import data import flat import issues import render import text import utils if app_config.DEPLOY_TO_SERVERS: import servers if...
#!/usr/bin/python # Copyright (C) 2015 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...
from django.contrib import admin # Register your models here. class GameSettingsAdmin(admin.ModelAdmin): list_display = ('connection_screen', 'global_cd', 'auto_cast_skill_cd', 'can_give_up_quests', 'can_close_dialogue', ...
"""Translation helper functions.""" from __future__ import unicode_literals import gettext as gettext_module import os import re import sys import warnings from collections import OrderedDict from threading import local from django.apps import apps from django.conf import settings from django.conf.locale import LANG_...
# Copyright 2015 # 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 la...
import unittest import logging import torch import numpy as np import gym from gym import Wrapper from gym import ObservationWrapper from gym import RewardWrapper from PIL import Image from termcolor import colored as clr from collections import OrderedDict from utils.torch_types import TorchTypes logger = logging.get...
# -*- coding: utf-8 -*- """ twp support functions @author: Jev Kuznetsov Licence: GPL v2 """ from scipy import polyfit, polyval import datetime as dt #from datetime import datetime, date from pandas import DataFrame, Index, Series import csv import matplotlib.pyplot as plt import numpy as np import pandas as pd de...
""" Base file upload handler classes, and the built-in concrete subclasses """ from __future__ import unicode_literals from io import BytesIO from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.uploadedfile import TemporaryUploadedFile, InMemoryUploadedFile...
import pytest from aiohttp import web from aiohttp.web_urldispatcher import UrlDispatcher @pytest.fixture def router(): return UrlDispatcher() def test_get(router): async def handler(request): pass router.add_routes([web.get('/', handler)]) assert len(router.routes()) == 2 # GET and HEAD ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import re from datetime import datetime from sqlalchemy import Column, Integer, String, DateTime from flexget import plugin from flexget.event import event...
#! /usr/bin/env python from __future__ import print_function from argparse import ArgumentParser import logging import os import re import sys import yaml LOGGER = logging.getLogger('upgrade_dbt_schema') LOGFILE = 'upgrade_dbt_schema_tests_v1_to_v2.txt' COLUMN_NAME_PAT = re.compile(r'\A[a-zA-Z0-9_]+\Z') # compatibil...
""" Django settings for api project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ import os from url...
""" Various complex queries that have been problematic in the past. """ import datetime import pickle import sys from django.db import models from django.db.models.query import Q, ITER_CHUNK_SIZE # Python 2.3 doesn't have sorted() try: sorted except NameError: from django.utils.itercompat import sorted clas...
import os import struct from cStringIO import StringIO import vstruct import vstruct.defs.pe as vs_pe import ordlookup IMAGE_DLLCHARACTERISTICS_RESERVED_1 = 1 IMAGE_DLLCHARACTERISTICS_RESERVED_2 = 2 IMAGE_DLLCHARACTERISTICS_RESERVED_4 = 4 IMAGE_DLLCHARACTERISTICS_RESERVED_8 = 8 IMAGE_DLLCHARACTE...
# -*- coding: utf-8 -*- from django.test import TestCase, override_settings from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.questioner import MigrationQuestioner from django.db.migrations.state import ProjectState, ModelState from django.db.migrations.graph import Migration...
# 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...
# MIT License # # Copyright (c) 2017 Anders Steen Christensen # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mo...
# Copyright (c) 2008 Brian Zimmer <bzimmer@ziclix.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, m...
# Copyright (c) 2016 EMC Corporation. # 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...
from __future__ import print_function, division from os.path import join import tempfile import shutil from io import BytesIO try: from subprocess import STDOUT, CalledProcessError from sympy.core.compatibility import check_output except ImportError: pass from sympy.utilities.exceptions import SymPyDepre...
# Copyright 2013 dotCloud 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 t...
"""Test Axis config flow.""" from homeassistant import data_entry_flow from homeassistant.components.axis import config_flow from homeassistant.components.axis.const import ( CONF_EVENTS, CONF_MODEL, CONF_STREAM_PROFILE, DEFAULT_STREAM_PROFILE, DOMAIN as AXIS_DOMAIN, ) from homeassistant.config_entr...
from __future__ import unicode_literals from __future__ import absolute_import, division, print_function """ Tests for RecordView module and view with inherited bibliographic definitioins """ __author__ = "Graham Klyne (GK@ACM.ORG)" __copyright__ = "Copyright 2014, 2015 G. Klyne" __license__ = "MIT (http:/...
from webapi_pb2 import * import sys import socket import time import logging import uuid import threading logger = logging.getLogger(__name__) # Not defined on Windows in Python for some reason. # https://github.com/Perl/perl5/blob/blead/win32/include/sys/socket.h#L35 if sys.platform == 'win32': MSG_WAITALL = 0x8...
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. Unit tests are in test_collections. """ from abc import ABCMeta, abstractmethod import sys __all__ = ["Awaitable", "Coroutine", "AsyncIterable",...
#!/usr/bin/env python """Tests for the worker.""" import threading import time import mock from grr.lib import aff4 from grr.lib import config_lib from grr.lib import data_store from grr.lib import flags from grr.lib import flow from grr.lib import hunts from grr.lib import queue_manager from grr.lib import queues ...
"""The tests for the Universal Media player platform.""" import asyncio from copy import copy from os import path import unittest from unittest.mock import patch from voluptuous.error import MultipleInvalid from homeassistant import config as hass_config import homeassistant.components.input_number as input_number im...
# @Author # Chloe-Agathe Azencott # chloe-agathe.azencott@mines-paristech.fr # April 2016 import argparse import string import sys import numpy as np import matplotlib.pyplot as plt plt.rcParams.update({'font.size': 16}) orange_color = '#d66000' blue_color = '#005599' def plot_numf(results_dir, figure_path, num_r...
# Copyright 2012 OpenStack Foundation # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ht...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# coding: utf-8 # <h3>minedujob</h3> # # Python script to fetch jobs from Ministry Of Education and convert it into a json object. Fix format problems around the xml. # # # In[ ]: # TODO # # done - Parse description tag for the keys and values hidden within that. # done - Extract email from description, i...
from sympy.utilities.pytest import XFAIL, raises from sympy import (symbols, lambdify, sqrt, sin, cos, pi, atan, Rational, Real, Matrix, Lambda, exp, Integral, oo) from sympy.printing.lambdarepr import LambdaPrinter from sympy import mpmath from sympy.utilities.lambdify import implemented_function import math, ...
# Author: Miguel Martinez Lopez # # Please let me know if you find a bug # Uncomment the next line to see my email # print("Author's email: %s"%"61706c69636163696f6e616d656469646140676d61696c2e636f6d".decode("hex")) """Tkinter Selectors Select widgets using selectors synchronously or asynchronously. This is...
""" Tests for resource Helper """ import random from unittest import TestCase from boto.exception import BotoServerError, EC2ResponseError import boto.ec2.instance from botocore.exceptions import ClientError from mock import patch, MagicMock, create_autospec from disco_aws_automation.exceptions import ExpectedTimeout...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of commands, run ``$ invoke --list``. """ import os import sys import json import platform import subprocess import logging from time import sleep import invoke from invoke import Collection from we...
""" sentry.web.forms.accounts ~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import pytz from captcha.fields import ReCaptchaField from datetime import datetime from django i...
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import subprocess import sys from contextlib import contextmanager from pathlib import Path from textwrap import dedent from pants.backend.python.targets.python_library import P...
import hashlib import json import logging import os import subprocess import sys import time from collections import defaultdict from shutil import copy from shutil import copyfile from shutil import copystat from shutil import copytree from tempfile import mkdtemp import boto3 import botocore import yaml import sys ...
#========================================================================== # # Copyright Insight Software Consortium # # 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...
import os import sys import tempfile import shutil from pip.req import InstallRequirement, RequirementSet, parse_requirements from pip.log import logger from pip.locations import build_prefix, src_prefix, virtualenv_no_global from pip.basecommand import Command from pip.index import PackageFinder from pip.exceptions im...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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/...
import unittest import textwrap import antlr3 import antlr3.tree import testbase import sys class TestAutoAST(testbase.ANTLRTest): def parserClass(self, base): class TParser(base): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._erro...
''' Created on 27.04.2016 @author: selen00r ''' import datetime import json import evalbase import evalcontinously import evalmonthly import evalrunner import evalresult import fetchdata import indexdata import indexdatabase import indexselector import transactionchecker class MultiEvalPrinter(evalresult.Transacti...
from collections import OrderedDict from django import forms from django.conf import settings from django.contrib import admin, messages from django.contrib.admin.widgets import FilteredSelectMultiple from django.contrib.auth import get_user_model from django.shortcuts import get_object_or_404, redirect, render from d...
#!/usr/bin/env python """Data master specific classes.""" import socket import threading import urlparse import urllib3 from urllib3 import connectionpool import logging from grr.lib import config_lib from grr.lib import rdfvalue from grr.lib import utils from grr.server.data_server import constants from grr.ser...
# Copyright (c) 2020 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 appli...
# 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 use ...
# -*- coding: utf-8 -*- """Shared functionality for Elasticsearch output modules.""" from __future__ import unicode_literals import logging import os from dfdatetime import posix_time as dfdatetime_posix_time from dfvfs.serializer.json_serializer import JsonPathSpecSerializer try: import elasticsearch except Impo...
# 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 # distribu...
# Test case for the os.poll() function import os import subprocess import random import select import threading import time import unittest from test.support import run_unittest, cpython_only from test.support import threading_helper from test.support.os_helper import TESTFN try: select.poll except AttributeErro...
from __future__ import absolute_import from django.contrib.admin.helpers import InlineAdminForm from django.contrib.auth.models import User, Permission from django.contrib.contenttypes.models import ContentType from django.test import TestCase # local test models from .admin import InnerInline from .models import (Ho...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributi...
"""Progress bar utilities.""" from enum import Enum from io import StringIO import sys class TermType(Enum): """Enumeration of types of terminals.""" TTY = 1 IPythonTerminal = 2 IPythonGUI = 3 File = 4 Unknown = 0 def _non_ipy_term_type(): """ The terminal type of a non-IPython term...
# 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...
"""Import a file from Illumina BaseSpace.""" import atexit import gzip import os import time import traceback from pathlib import Path from requests import RequestException, Session from resolwe.process import ( BooleanField, FileField, GroupField, IntegerField, Persistence, Process, Secr...
# Copyright (c) 2013 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 ...
# Copyright 2004 by James Casbon. 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. """ Code to deal with COMPASS output, a program for profile/profile comparison. Compass is des...
#!/usr/bin/env python3 import argparse import os import subprocess import sys def setup(): global args, workdir programs = ['ruby', 'git', 'make', 'wget', 'curl'] if args.kvm: programs += ['apt-cacher-ng', 'python-vm-builder', 'qemu-kvm', 'qemu-utils'] elif args.docker and not os.path.isfile('...
# Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the LICENSE.txt file at the root of this distribution. If # you cannot locate the Apache License, Version 2.0, please send an email to # vspython...
from django.test import TestCase from django.contrib.auth.models import Group from hs_access_control.models import PrivilegeCodes from hs_core import hydroshare from hs_core.models import GenericResource from hs_core.testing import MockIRODSTestCaseMixin from hs_access_control.tests.utilities import global_reset, is...