gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import os import numpy import pdb from astrometry.util.fits import fits_table from legacyzpts import psfzpt_cuts ccdnamenumdict = {'S1': 25, 'S2': 26, 'S3': 27, 'S4':28, 'S5': 29, 'S6': 30, 'S7': 31, 'S8': 19, 'S9': 20, 'S10': 21, 'S11': 22, 'S12': 23, 'S13': 24, ...
import codecs import hashlib import logging import os from Crypto.Cipher import AES, DES3 from Crypto.PublicKey import DSA as DSAKey from Crypto.PublicKey import RSA as RSAKey from ecdsa import der, curves, SigningKey from pyasn1.codec.ber import decoder as ber_decoder from pyasn1.codec.der import decoder as der_decod...
# -*- coding: utf-8 -*- # Copyright 2014 - 2016 OpenMarket 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 applic...
# 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...
"""Defines SolutionArray class""" from collections import Iterable from functools import reduce as functools_reduce from operator import mul import numpy as np from .posyarray import PosyArray from .nomials import Monomial from .varkey import VarKey from .small_classes import Strings, Quantity from .small_classes imp...
""" sample code that deploys a VM. """ import os import sys import time from zvmconnector import connector client = connector.ZVMConnector(connection_type = 'rest', port = 8080) def delete_guest(userid): """ Destroy a virtual machine. Input parameters: :userid: USERID of the guest, last 8...
import operator import warnings from datetime import timedelta from sys import getsizeof import numpy as np import pandas.core.common as com import pandas.core.indexes.base as ibase from pandas import compat from pandas._libs import index as libindex from pandas.compat import get_range_parameters, lrange, range from ...
# 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 json from datetime import datetime from functools import wraps from flask import current_app, session, abort from flask_sqlalchemy import SQLAlchemy from sqlalchemy.orm import validates db = SQLAlchemy() MAX_SEGMENT_DURATION = 86400 # Maximum TimeSegment duration in seconds config = { 'admins': None, ...
""" Define all model classes following the definition of Abstract_Model. """ import downhill import theano import theano.tensor as TT data_type = 'float32' #Single precision: theano.config.floatX = data_type theano.config.mode = 'FAST_RUN' # 'Mode', 'ProfileMode'(deprecated), 'DebugMode', 'FAST_RUN', 'FAST_COMPILE' ...
import jsongit import helpers import os import json # import pygit2 # import shutil class TestJsonGitRepository(helpers.RepoTestCase): def test_create_path_arg(self): repo = jsongit.init('test_create_repo') self.assertTrue(os.path.isdir('test_create_repo')) repo.destroy() def test_cre...
#! /usr/bin/env python """ Takes hit tables (eg from blast, last, or hmmer) and generates a table (or tables) of hit counts for gene families, gene classes, or pathways. Multiple pathway or classification levels can be given. If they are, multiple output tables will be generated with the level as a ...
#!/usr/bin/env python # """ These functions, when given a magnitude mag between cmin and cmax, return a colour tuple (red, green, blue). yellow is cold (low magnitude) and red is hot (high magnitude). """ #import math def floatRgb(mag, cmin, cmax): """ Return a tuple of floats between 0 and 1 for the r...
"""A collection of (internal usage) utils for rule type checking.""" import networkx as nx from networkx.exception import NetworkXNoPath from regraph.exceptions import (ReGraphError, RewritingError, HierarchyError, InvalidH...
from __future__ import unicode_literals import datetime import os import re import sys import types from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.http import (HttpResponse, HttpResponseServerError, HttpResponseNotFound, HttpRequest, build_request_repr) from d...
import binascii import pytest from unittest import mock from mitmproxy import exceptions from mitmproxy.addons import proxyauth from mitmproxy.test import taddons from mitmproxy.test import tflow class TestMkauth: def test_mkauth_scheme(self): assert proxyauth.mkauth('username', 'password') == 'basic dX...
from flask import Flask import requests import json import yaml import os import time import copy import urllib2 from wsgi.mongo import get_mongo_connection from wsgi.migration import MigrationTemplateGenerator from sdk.mcn import util import sys sys.stdout = sys.stderr app = Flask('hurtle-so') cc_admin_url = os.envi...
"""RCS interface module. Defines the class RCS, which represents a directory with rcs version files and (possibly) corresponding work files. """ import fnmatch import os import regsub import string import tempfile class RCS: """RCS interface class (local filesystem version). An instance of this class re...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import pprint import sys import textwrap import py import pytest from _pytest.main import _in_venv from _pytest.main import EXIT_NOTESTSCOLLECTED from _pytest.main import Session class TestCollector(object)...
# 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. import hashlib import json import logging import re import compiled_file_system as compiled_fs from file_system import FileNotFoundError import third_pa...
# # 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 2016 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
from datetime import datetime import numpy as np import pytest import pandas as pd from pandas import NaT, Series, Timestamp from pandas.core.internals.blocks import IntBlock import pandas.util.testing as tm from pandas.util.testing import assert_series_equal class TestSeriesInternals: # GH 10265 def test_...
# coding=utf-8 """ Diamond handler that check if values are too high or too low, if so send an alert to a Sentry server This handler requires the Python module Raven: http://raven.readthedocs.org/en/latest/index.html To work this handler need a similar configuration: [[SentryHandler]] # Create a new project in Sen...
import astropy.io.fits as pyfits import astropy.wcs as pywcs import os import numpy as np import montage_wrapper as montage import shutil import sys import glob import time from matplotlib.path import Path from scipy.ndimage import zoom from pdb import set_trace _TOP_DIR = '/data/tycho/0/leroy.42/allsky/' _INDEX_DIR ...
# Copyright (c) Charl P. Botha, TU Delft. # All rights reserved. # See COPYRIGHT for details. import comedi_utils reload(comedi_utils) import vtk import vtktudoss from module_kits import vtk_kit import wx ########################################################################### # 2D: # * Checkerboard. # * differe...
# # 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...
"""Tests related to retraction of public registrations""" import datetime import httplib as http import mock import pytest from django.utils import timezone from django.db import DataError from nose.tools import * # noqa from framework.auth import Auth from framework.exceptions import PermissionsError from tests.ba...
"""TestSuite""" import sys from . import case from . import util __unittest = True class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(self, tests=()): self._tests = [] self.addTests(tests) def __repr__(self): ...
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( ProjectFactory, AuthUserFactory, PrivateLinkFactory, ) from website.util import permissions @pytest.fixture() def user(): return AuthUserFactory() @pytest.fixture() def read_contrib(): return AuthUserF...
"""trackball_camera.py - An OpenGL Trackball Camera Class for Pyglet by Roger Allen, July 2008 roger@rogerandwendy.com A class for simple-minded 3d example apps. Usage: Initialize with a radius from the center/focus point: tbcam = TrackballCamera(5.0) After adjusting your projection matrix, set the modelview m...
# 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 ...
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana 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.o...
import os import shutil from django.contrib.auth.models import Group from django.contrib.messages import get_messages from django.core.urlresolvers import reverse from rest_framework import status from hs_core.testing import ViewTestCase from hs_core import hydroshare from hs_core.views import create_user_group, upd...
#!/usr/bin/env python3 from . import command_codes as cc import asyncio from collections import namedtuple import logging import re from typing import List, Callable, Union, Sequence, Any from types import coroutine class LoggerMetaClass(type): def __new__(mcs, name, bases, namespace): inst = type.__ne...
""" Modified version of build_clib that handles fortran source files. """ from __future__ import division, absolute_import, print_function import os from glob import glob import shutil from distutils.command.build_clib import build_clib as old_build_clib from distutils.errors import DistutilsSetupError, DistutilsError...
# 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...
#!/usr/bin/env python3 # # Copyright (c) 2016-2017 Nest Labs, 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/lic...
"""Support for Vallox ventilation unit sensors.""" from __future__ import annotations from dataclasses import dataclass from datetime import datetime, timedelta from homeassistant.components.sensor import ( STATE_CLASS_MEASUREMENT, SensorEntity, SensorEntityDescription, ) from homeassistant.const import (...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
# pylint: disable=C0111,R0902,R0913 # Smartsheet Python SDK. # # Copyright 2016 Smartsheet.com, 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/LICE...
## # Copyright (c) 2008-2010, 2012, 2013 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import importlib import sys import yaml from importkit import meta, context as lang_context, loader as lang_loader from importkit.import_ import utils as import_utils from importkit.yaml import loader, dumper...
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor', 'ConstructorError'] from error import * from nodes import * import datetime import binascii, re, sys, types class ConstructorError(MarkedYAMLError): pass class BaseConstructor(object): yaml_constructors = {} yaml_multi_constructors =...
from __future__ import absolute_import from bokeh.models.glyphs import ( AnnularWedge, Annulus, Arc, Bezier, Circle, Gear, Image, ImageRGBA, ImageURL, Line, MultiLine, Oval, Patch, Patches, Quad, Quadratic, Ray, Rect, Segment, Text, Wedge) from bokeh.models.glyp...
import warnings import numpy as np from .base import _fit_liblinear, BaseSVC, BaseLibSVM from ..base import BaseEstimator, RegressorMixin from ..linear_model.base import LinearClassifierMixin, SparseCoefMixin, \ LinearModel from ..feature_selection.from_model import _LearntSelectorMixin from ..utils import check_X...
from __future__ import absolute_import import os.path from typing import Dict, List, Optional, TypeVar, Any, Text from django.conf import settings from django.conf.urls import url from django.core.urlresolvers import LocaleRegexProvider from django.utils.module_loading import import_string from django.utils.safestring...
# Copyright 2013 Mario Graff Guerrero # 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 wri...
# Copyright 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 by applicable law or agreed to in writing, ...
from datetime import datetime, date, timedelta from django.test import TestCase from selvbetjening.core.user.models import SUser from selvbetjening.core.events.models import Attend, Event, OptionGroup from selvbetjening.core.events.options.dynamic_selections import dynamic_selections_form_factory, _pack_id, SCOPE, \ ...
##=============================================================================== # This file is part of TEMPy. # It implements a genetic algorithm for the purpose of fitting multiple component into the assembly map # # TEMPy is a software designed to help the user in the manipulation # and analys...
from django.test import TestCase from moneyed import Money from .. import api, models, enums, exceptions from . import factories class WalletTest(TestCase): def test_get_wallet(self): wallet_obj = factories.WalletFactory.create() item_obj = api.get_wallet(wallet_obj.owner_id, wallet_obj.currency) ...
""" Copyright 2015 Paul T. Grogan, Massachusetts Institute of Technology Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicabl...
#!/usr/bin/env python2.7 """ File : utils_t.py Author : Bjorn Barrefors <bjorn dot peter dot barrefors AT cern dot ch> Description: Test class for all utils functions """ # system modules import unittest import os import json import datetime from bson.objectid import ObjectId # package modules from cuadrnt....
""" Test framework for cvs-fast-export. """ import sys, os, shutil, subprocess, time, filecmp DEBUG_STEPS = 1 DEBUG_COMMANDS = 2 DEBUG_VCS = 3 DEBUG_LIFTER = 4 verbose = 0 os.putenv("PATH", os.getenv("PATH") + os.pathsep + "..") def noisy_run(dcmd, legend=""): "Either execute a command or raise a fat...
# 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...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <rawcell> # #!/usr/bin/env python # <codecell> from __future__ import division from __future__ import with_statement import numpy as np from pylab import ion import matplotlib as mpl from matplotlib.path import Path from matplotlib import pyplot as plt from matp...
#! /usr/bin/env python # -*- coding: utf-8 -*- from selenium import webdriver import time import logging import random import re import collections logging.basicConfig(level=logging.INFO) _TIME_WAIT_TO_LOAD = 5 _TIME_WAIT_TO_REPLY = 15 _TIME_INTERVAL = 5 _COLLECT_COUNT = 100 _REPLY_POST_COUNT = random.randint(35, 40)...
# 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...
data = ( 'Hu ', # 0x00 'Qi ', # 0x01 'He ', # 0x02 'Cui ', # 0x03 'Tao ', # 0x04 'Chun ', # 0x05 'Bei ', # 0x06 'Chang ', # 0x07 'Huan ', # 0x08 'Fei ', # 0x09 'Lai ', # 0x0a 'Qi ', # 0x0b 'Meng ', # 0x0c 'Ping ', # 0x0d 'Wei ', # 0x0e 'Dan ', # 0x0f 'Sha ', # 0x10 'Hu...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import json import logging import os import re from collections import deque from functools import wraps, partial from flask import Flask, request, jsonify, make_response ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import unittest from pymatgen.io.qchem.sets import * from pymatgen.util.testing import PymatgenTest __author__ = "Samuel Blau, Brandon Wood, Shyam Dwaraknath, Evan Spotte-Smith" __copyright__ = "Co...
from datetime import date, datetime, time, timedelta from unittest.mock import patch from django.contrib.auth import get_user_model from django.core.management import call_command from django.test import TestCase from django.utils import timezone from model_mommy import mommy from .. models import ( Action, C...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-07 17:05:11 import os import json import time import logging import itertools from six.moves import queue as Queue from collections import deque ...
import os import sys from stopwords_video import vid_stopwords from stop_words import stopword import nltk import re from nltk import stem stemmer = stem.PorterStemmer() from operator import itemgetter import math def remove_hyphen(g): if g.count("-")>0: temp=g.split("-") l=len(temp) word="...
import json import os from unittest.mock import MagicMock from unittest.mock import patch import cauldron as cd from cauldron import environ from cauldron.cli.commands.create import actions as create_actions from cauldron.test import support from cauldron.test.support import scaffolds class TestCreate(scaffolds.Resu...
# Copyright 2013 Dell Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
#!/usr/bin/env python # Copyright 2016 Canonical UK 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 requ...
""" class that provides the ability to use topic pages (monitoring functionality) through the API """ import six, json from eventregistry.Base import * from eventregistry.ReturnInfo import * class TopicPage(QueryParamsBase): def __init__(self, eventRegistry): """ create an instance of a topic page...
#!/usr/bin/env python3 # Copyright 2020 The IREE Authors # # Licensed 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 """Manages IREE Docker image definitions. Includes information on their depend...
# # 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...
# -*- coding: utf-8 -*- from __future__ import print_function import mock try: # for py26 import unittest2 as unittest except ImportError: import unittest try: from collections import OrderedDict except ImportError: # for py26 from ordereddict import OrderedDict from . import captured_output ...
# 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. """Defines a set of constants shared by test runners and other scripts.""" # TODO(jbudorick): Split these constants into coherent modules. # pylint: di...
# -*- coding: utf-8 -*- """The old AMQP result backend, deprecated and replaced by the RPC backend.""" from __future__ import absolute_import, unicode_literals import socket from collections import deque from operator import itemgetter from kombu import Consumer, Exchange, Producer, Queue from celery import states f...
# 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/...
from sympy.core import symbols, Eq, pi, Catalan, Lambda, Dummy from sympy.core.compatibility import StringIO from sympy import erf, Integral from sympy.utilities.codegen import (CCodeGen, Routine, InputArgument, CodeGenError, FCodeGen, codegen, CodeGenArgumentListError, OutputArgument, InOutArgument) from sympy...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
"""Code to handle the Plenticore API.""" from __future__ import annotations import asyncio from collections import defaultdict from collections.abc import Iterable from datetime import datetime, timedelta import logging from aiohttp.client_exceptions import ClientError from kostal.plenticore import ( PlenticoreAp...
#!/usr/bin/env python2.7 # Copyright 2017, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this lis...
import codecs import configparser import datetime import fnmatch import logging import operator import os import polib import shutil import silme.core import silme.format.properties import silme.format.dtd import silme.format.ini import StringIO import urllib2 import zipfile from django.conf import settings from ponto...
# -*- coding: utf-8 -*- # This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and # is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012) import os #DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__)) SITE_ROOT = ...
#!/usr/bin/env python # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COP...
# -*- coding: utf-8 -*- # # xarray documentation build configuration file, created by # sphinx-quickstart on Thu Feb 6 18:57:54 2014. # # 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 # autogenerated file. # # Al...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest from faker import Faker from machina.apps.forum_conversation.forum_polls.forms import TopicPollOptionFormset from machina.apps.forum_conversation.forum_polls.forms import TopicPollVoteForm from machina.core.db.models import get_model from ...
#!python import os import time import datetime from fabric.api import * from fabric.contrib import * from fabric.contrib.files import * from fabric.operations import run, put from fabric.colors import red, green, yellow, cyan, magenta import boto import boto.ec2.elb import boto.utils import time # Set Fabric environm...
#!/usr/bin/env python """ Annotation endpoints and supporting functions. """ __author__ = 'M@Campbell' from datetime import datetime import time import requests from requests.exceptions import (ConnectionError, Timeout) from flask import (jsonify, request, current_app) from dateutil.parser import parse as parse_date ...
# Copyright 2021 HTCondor Team, Computer Sciences Department, # University of Wisconsin-Madison, WI. # # 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/LICE...
# Copyright (c) 2013-2021 khal contributors # # 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, merge, publi...
from datetime import datetime import inspect import requests import sys from threading import Thread import time import traceback import csv from decimal import Decimal from electrum.bitcoin import COIN from electrum.plugins import BasePlugin, hook from electrum.i18n import _ from electrum.util import PrintError, Thre...
#!/usr/bin/env python # 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. """Utility script for emulating common unix commands.""" from __future__ import print_function import argparse import fnmatch imp...
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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 (...
''' Created on May 30, 2017 @author: Rawad ''' import re import sys import time import loader from loop import Graph from molecule import Bond, HBondType import numpy as np # frames should be a dictionary. def analyzeFrames(frames, maxAngle, maxHBondDistance, maxBondDistance, maxIntermoleculeDistance): centralA...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import * from django.test import TestCase from django.utils.safestring import mark_safe from django.utils.encoding import python_2_unicode_compatible class ...
from __future__ import print_function import collections import sys import weakref import numba.unittest_support as unittest from numba.controlflow import CFGraph, Loop from numba.compiler import compile_extra, compile_isolated, Flags from numba import types from .support import TestCase enable_pyobj_flags = Flags()...
from vote_controller import VoteSkipController, VoteMutinyController from room_controller import EventSource from nose.tools import * class MockUserSession(object): def __init__(self, username): self.username = username self.messages = [] def __eq__(self, other): return self is other def send(self, message...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2012 OpenStack, LLC # Copyright 2012 Justin Santa Barbara # 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 Li...
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
import os import string import urllib2 import binascii import json import math from sqlite3 import dbapi2 as sqlite3 from flask import Flask, request, g, redirect, url_for, abort, render_template, jsonify from wtforms import Form, StringField, validators CURRPATH = os.path.dirname(os.path.realpath(__file__)) app = F...
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2013 Carlo Bressan # # 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 lim...
#!/usr/bin/env python # # ----------------------------------------------------------------------------- # Copyright (c) 2018 The Regents of the University of California # # This file is part of kevlar (http://github.com/dib-lab/kevlar) and is # licensed under the MIT license: see LICENSE. # ----------------------------...
"""The tests for the person component.""" from unittest.mock import Mock import pytest from homeassistant.components.device_tracker import ( ATTR_SOURCE_TYPE, SOURCE_TYPE_GPS, SOURCE_TYPE_ROUTER, ) from homeassistant.components.person import ( ATTR_SOURCE, ATTR_USER_ID, DOMAIN, PersonManag...