gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" Utilities for working with data format specifications. See :ref:`data_specs` for a high level overview of the relevant concepts. """ from collections import Sized from pylearn2.space import CompositeSpace, NullSpace, Space from pylearn2.utils import safe_zip class DataSpecsMapping(object): """ Converts b...
from __future__ import division, print_function, absolute_import import warnings from . import _minpack import numpy as np from numpy import (atleast_1d, dot, take, triu, shape, eye, transpose, zeros, product, greater, array, all, where, isscalar, asarray, inf, abs, ...
""" test special properties (eg. column_property, ...) """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import six from sqlalchemy import select, func from sqlalchemy.orm import column_property from elixir import * ...
# Copyright 2009-2012 James P Goodwin ped tiny python editor """ module that contains the symbolic names of the keys """ import curses KEYTAB_NOKEY=chr(0) KEYTAB_ALTA=chr(27)+'a' KEYTAB_ALTB=chr(27)+'b' KEYTAB_ALTC=chr(27)+'c' KEYTAB_ALTD=chr(27)+'d' KEYTAB_ALTE=chr(27)+'e' KEYTAB_ALTF=chr(27)+'f' KEYTAB_ALTG=chr(27)+...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Red Hat, 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 # #...
import unittest from lxml import etree from soapfish import wsa, xsd from soapfish.core import SOAPError, SOAPRequest, SOAPResponse from soapfish.middlewares import ExceptionToSoapFault from soapfish.soap_dispatch import SOAPDispatcher from soapfish.testutil import EchoInputHeader, EchoOutputHeader, echo_handler, ech...
#!/usr/bin/python2.7 # Copyright 2010 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 ...
#!/usr/bin/env python import Queue, crawle, socket, unittest ADDRESS_0 = ('127.0.0.1', 80), False ADDRESS_1 = ('127.0.0.1', 443), True ADDRESS_2 = ('127.0.0.1', 8080), False class TestCQueueLRU(unittest.TestCase): def setUp(self): self.lru = crawle.CQueueLRU(10, 10) def assert_newest(self, key): ...
# Copyright 2014 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
# Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
""" # ============================================================================= Copyright Government of Canada 2015 Written by: Eric Enns, Public Health Agency of Canada, National Microbiology Laboratory Mark Iskander, Public Health Agency of Canada, Natio...
# Generated by Django 2.0.7 on 2018-07-12 17:10 import django.contrib.auth.validators from django.db import migrations, models import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('ui', '0020_auto_20180608_1144'), ] operations = [ migrations.AddField( ...
# Abstract Syntax Tree produced by parser #from __future__ import generators import types import string import fracttypes import re from ffloat import Float class Node: def __init__(self,type,pos,children=None,leaf=None,datatype=None): self.type = type if children: self.children =...
import errno import os import re import sublime import sublime_plugin import shlex from ..anf_util import * from ..platform.windows_platform import WindowsPlatform from ..platform.nix_platform import NixPlatform from ..completions.nix_completion import NixCompletion from ..completions.windows_completion import Windows...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2014 Alex Forencich 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 righ...
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright (c) 2020, NVIDIA 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 required by appli...
import sys import numpy as np import argparse import scipy.io import theano import theano.tensor as T import lasagne from sklearn import preprocessing from spacy.en import English import time sys.path.append('/home/mayank/visual_question_ans/tools/') from tools2 import selectFrequentAnswers, grouper from feature_ext...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
from datetime import datetime, timedelta from django.conf import settings from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from django.db.models import Q from django.http import Http404 from django.shortcuts import get_object_or_404 from source.articles.models import Arti...
# 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 # distrib...
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Softwa...
#!/usr/bin/env python """Linux client repackers.""" import io import logging import os import shutil import subprocess import zipfile from grr_response_client_builder import build from grr_response_client_builder import build_helpers from grr_response_core import config from grr_response_core.lib import utils clas...
#!/usr/bin/env python import logging import tornado.auth import tornado.escape import tornado.ioloop import tornado.options import tornado.web import os.path import uuid import json import pprint import math import urllib import urllib2 import bitly_api from urllib2 import Request, urlopen, URLError import os, shutil ...
# 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...
# Copyright (c) 2012 Rackspace Hosting # 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 req...
"""CILogon OAuthAuthenticator for JupyterHub Usese OAuth 1.0a with cilogon.org Setup: 1. generate rsa keypair: openssl genrsa -out oauth-privkey.pem 2048 openssl rsa -in oauth-privkey.pem -pubout -out oauth-pubkey.pem 2. generate certificate request (interactive) openssl req -new -key oauth-p...
from __future__ import absolute_import import cgi import email.utils import getpass import json import logging import mimetypes import os import platform import re import shutil import sys import tempfile try: import ssl # noqa HAS_TLS = True except ImportError: HAS_TLS = False from pip._vendor.six.move...
# This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import os import mimetypes from nereid import route from nereid.helpers import send_file, url_for from nereid.globals import _request_ctx_stack from werkzeug import abort fro...
#! /usr/bin/env python """ *************************** Modified Numpy Matrix Class *************************** """ #todo: update 'close' to match numpy's implementation for all_close import numpy import itertools import helpers from decorator import decorator @decorator def expandCallable(fun, self, ...
# 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 ...
#!/usr/bin/env python import curses import os MAX_FILENAME_LENGTH = os.pathconf('.', 'PC_NAME_MAX') def debug(text): with open('/tmp/fileStuff.log', 'a') as f: f.write(str(text) + '\n') class Colors(object): WHITE_ON_BLACK = 1 WHITE_ON_BLUE = 2 class TextScreen(object): def __init__(self...
from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.test import APIClient from openslides.agenda.models import Item, Speaker from openslides.core.config import config from openslides.core.models import CustomSlide, Projector ...
import unittest import os import time import pg8000 import datetime from .connection_settings import db_connect from sys import exc_info from pg8000.six import b, IS_JYTHON from distutils.version import LooseVersion # DBAPI compatible interface tests class Tests(unittest.TestCase): def setUp(self): self.d...
# -*- coding: utf-8 -*- import json from os import path from gluon import current from gluon.html import * from gluon.storage import Storage from gluon.http import redirect from s3 import FS, ICON, S3CustomController from s3theme import formstyle_foundation_inline THEME = "historic.RW" # =========================...
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Gouthaman Balaraman # # 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...
# # Copyright 2014-2015 University of Southern California # Distributed under the (new) BSD License. See LICENSE.txt for more info. # from . import np as numpylib import re import datetime import sys import os import random import numpy as np from numpy import array, float32, int32, empty, newaxis, dot, cross, zeros,...
'''Test module for cssccc''' from __future__ import ( absolute_import, print_function, unicode_literals, ) from unittest import TestCase, main as unittest_main from pocketlint.contrib.cssccc import ( CSSCodingConventionChecker, CSSAtRule, CSSRuleSet, CSSStatementMember) class TestCSSCodingConventio...
""" audfprint_match.py Fingerprint matching code for audfprint 2014-05-26 Dan Ellis dpwe@ee.columbia.edu """ import librosa import numpy as np import scipy.signal import time # for checking phys mem size import resource # for localtest and illustrate import audfprint_analyze import matplotlib.pyplot as plt import a...
from sympy.simplify import simplify, trigsimp from sympy import pi, sqrt, symbols, ImmutableMatrix as Matrix, \ sin, cos, Function, Integral, Derivative, diff, integrate from sympy.vector.vector import Vector, BaseVector, VectorAdd, \ VectorMul, VectorZero from sympy.vector.coordsysrect import CoordSysCartesi...
from twisted.trial import unittest from twisted.internet import defer from coherence.dispatcher import Dispatcher, UnknownSignal, Receiver, \ SignalingProperty, ChangedSignalingProperty, CustomSignalingProperty class TestDispatcher(Dispatcher): __signals__ = {'test': 'Test signal'} class SimpleTarget(obj...
# # Copyright (c) 2008-2015 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/LICENSE-2.0 # # Unless required by applicable l...
from __future__ import absolute_import from typing import Any, Dict, List, Optional, Text import logging import re from email.header import decode_header import email.message as message from django.conf import settings from zerver.lib.actions import decode_email_address, get_email_gateway_message_string_from_addres...
import base64 import cProfile import cStringIO import collections import gzip import hmac import inspect import itertools import logging import math import os import socket import struct import time from urlparse import urljoin from django.conf import settings from django.db.models import Model, FloatField from django...
# # 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 """ KubeVirt API This is KubeVirt API an add-on for Kubernetes. OpenAPI spec version: 1.0.0 Contact: kubevirt-dev@googlegroups.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1KubeVi...
# Copyright (c) 2013 dotCloud, 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 requir...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Filters ======= Filter bank construction ------------------------ .. autosummary:: :toctree: generated/ dct mel chroma constant_q Miscellaneous ------------- .. autosummary:: :toctree: generated/ constant_q_lengths cq_to_chroma wi...
# Copyright 2012 Calvin Rien # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
"""Copyright 2008 Orbitz WorldWide 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...
# This file is part of beets. # Copyright 2013, Adrian Sampson. # # 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, ...
# 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 unittest from mock import Mock, patch, call from pumphouse import exceptions from pumphouse import task from pumphouse.tasks.network.nova import floating_ip class TestFloatingIP(unittest.TestCase): def setUp(self): self.test_address = "10.0.0.1" self.test_pool = "test-pool" self.te...
''' This script creates carbon pools in the year of loss (emitted-year carbon) and in 2000. For the year 2000, it creates aboveground, belowground, deadwood, litter, and total carbon emitted_pools (soil is created in a separate script but is brought in to create total carbon). All but total carbon are to the extent of ...
#!/usr/bin/env python from __future__ import print_function from builtins import str from builtins import range import tables import os import sys def splitH5all(basename1,basename2,size,start,finaltime,stride): print("==================") print(" Extracting") print("==================") for proc ...
try: from matplotlib.widgets import RectangleSelector except ImportError: RectangleSelector = object print("Could not import matplotlib -- skimage.viewer not available.") from skimage.viewer.canvastools.base import CanvasToolBase from skimage.viewer.canvastools.base import ToolHandles __all__ = ['Rectang...
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license """ Fields: basic data structures that make up parts of packets. """ import struct,copy,socket from .config import conf ...
#!/usr/bin/env python # Copyright (c) 2013-2015, Rethink Robotics # 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, # ...
from collections import defaultdict from email.Utils import formatdate import re from string import Template import sys from time import time from urlparse import parse_qsl import commonware.log import jinja2 from utils import log_configure import settings_local as settings # This has to be imported after the sett...
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import heapq from datetime import datetime from sqlalchemy import Column, Integer, String, Text, DateTime, Boolean from sqlalchemy.sql import functions, expression from sqlalchemy.exc import DataError, IntegrityError, Programmin...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
"""Arcam media player.""" import logging from arcam.fmj import SourceCodes from arcam.fmj.state import State from homeassistant.components.media_player import BrowseMedia, MediaPlayerEntity from homeassistant.components.media_player.const import ( MEDIA_CLASS_DIRECTORY, MEDIA_CLASS_MUSIC, MEDIA_TYPE_MUSIC...
from __future__ import absolute_import, unicode_literals import datetime from django.contrib.admin import (site, ModelAdmin, SimpleListFilter, BooleanFieldListFilter) from django.contrib.admin.views.main import ChangeList from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals from __future__ import absolute_import, print_function """ This module provides classes used to enumerate surface sites and to find adsorption sites on slabs "...
# Copyright (c) 2014 The mitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing # # Add python-mitcoinrpc to module search path: import os import sys from decimal impor...
# Copyright 2014 Red Hat, 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 a...
# Status: being ported by Steven Watanabe # Base revision: 47077 # TODO: common.jam needs to be ported # TODO: generators.jam needs to have register_c_compiler. # # Copyright 2001 David Abrahams. # Copyright 2002-2006 Rene Rivera. # Copyright 2002-2003 Vladimir Prus. # Copyright (c) 2005 Reece H. Dunn. # Copyright 200...
# Note that the dataset must be already downloaded for this script to work, do: # $ cd data/ # $ python download_dataset.py # quoc_trinh import tensorflow as tf import numpy as np import matplotlib import matplotlib.pyplot as plt from sklearn import metrics import os import sys import datetime # get current...
# Copyright 2014 NeuroData (http://neurodata.io) # # 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 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...
"""A module to provide a copy of all the default data within the IATI SSOT. This includes Codelists, Schemas and Rulesets at various versions of the Standard. Todo: Handle multiple versions of the Standard rather than limiting to the latest. Implement more than Codelists. """ import json import os from collec...
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Ord...
#!/usr/bin/env python """ @package mi.dataset.parser.test.test_flobn_cm_subcon @fid marine-integrations/mi/dataset/parser/test/test_flobn_cm_subcon.py @author Rachel Manoni @brief Test code for FLOBN-CM data parser """ from mi.dataset.parser.flobn_cm_subcon import FlobnMSubconTemperatureParser, FlobnCSubconParser, Flo...
# Copyright 2019 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 os import sys import logging, logging.handlers import environment import logconfig ############################ # Relative Filepaths ############################ path = lambda root,*a: os.path.join(root, *a) ROOT = os.path.dirname(os.path.abspath(__file__)) ############################ # Administrators #####...
#!/usr/bin/env python """List, determine, and modify experiment status. This can be used either as a module or standalone. """ import csv import hashlib import logging import optparse import os import re import sys from . import gmacpyutil from . import defaults from . import systemconfig import yaml # knobs for e...
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. from iptest.assert_util import skiptest from iptest.cominterop_util import * from System import * from clr impo...
# # 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 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...
''' Get the level of compliance for 'old' versions of the apps. That is, run the test harness over the suite from 31 Dec in some year. Pass-rates are written to files for later use, one file per year/version. ''' import os from collections import Counter import numpy as np import matplotlib.pyplot as plt ...
#!/usr/bin/python # coding=utf-8 import codecs import cPickle class Route: def __init__(self, id, route, name, trans, days, stops): self.id = int(id) self.route = route self.name = name self.trans = trans self.days = days self.stops = stops class Stop: def __init__(self, id, name, street): self.id =...
# Copyright 2014, 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 # # http://www.apache.org/licenses/LICENSE-...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (c) 2013 VMware, 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...
# Copyright 2016 Rackspace Hosting # 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...
"""Support for Synology NAS Sensors.""" import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_HOST, CONF_USERNAME, CONF_PASSWORD, CONF_PORT, CONF...
# 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 # distributed under t...
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
import os from keen.client import KeenClient from keen.exceptions import InvalidEnvironmentError __author__ = 'dkador' _client = None project_id = None write_key = None read_key = None def _initialize_client_from_environment(): global _client, project_id, write_key, read_key if _client is None: # c...
import copy import os import uuid import braintree from unittest2 import TestCase, main from btnamespace import Namespace, NamespaceError braintree.Configuration.configure( braintree.Environment.Sandbox, os.environ['BT_MERCHANT_ID'], os.environ['BT_PUBLIC_KEY'], os.environ['BT_PRIVATE_KEY'], ) def ...
""" Thierry Bertin-Mahieux (2010) Columbia University tb2332@columbia.edu This code contains a set of routines to create HDF5 files containing features and metadata of a song. This is part of the Million Song Dataset project from LabROSA (Columbia University) and The Echo Nest. Copyright 2010, Thierry Bertin-Mahieux Th...
# lexer.py # Copyright (C) 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """provides the Lexer class for parsing template strings into parse trees.""" import re, codecs fro...
import uuid from collections import OrderedDict, defaultdict from collections.abc import Sequence from django import forms from django.core.exceptions import NON_FIELD_ERRORS, ValidationError from django.forms.utils import ErrorList from django.template.loader import render_to_string from django.templatetags.static im...
# 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 ...
"""Geolocation support for GDACS Feed.""" from __future__ import annotations import logging from homeassistant.components.geo_location import GeolocationEvent from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( ATTR_ATTRIBUTION, CONF_UNIT_SYSTEM_IMPERIAL, LENGTH_KILOMETE...
"""Tests for question endpoints.""" import json import unittest import backend import harness class QuestionTest(harness.TestHarness): """Tests for question endpoints.""" @harness.with_sess(user_id=1) def test_crud(self): """Basic CRUD tests.""" # create a user harness.create_u...
import mimetypes import os.path from django.conf import settings from django.core import mail from django.core.files.storage import default_storage as storage from django.core.mail import EmailMessage from django.utils import translation from unittest import mock import six from celery.exceptions import Retry from ...
#!/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...
""" This module contains utility functions to construct and manipulate counting data structures for frames. When performing statistical profiling we obtain many call stacks. We aggregate these call stacks into data structures that maintain counts of how many times each function in that call stack has been called. Be...