text
stringlengths
17
737k
# -*- coding: utf-8 -*- """Main Controller""" from ebetl.model import * from itertools import groupby try: from collections import OrderedDict except: from ordereddict import OrderedDict """ from ebetl.model import * DBSession.query(Prodotti).join(Inventarir).join(Inventarirconta).filter(Inventarir.numeroinv...
#! /usr/bin/env python # vi:ts=4:et # $Id$ # # a simple self-test # try: # need Python 2.2 or better from gc import get_objects import gc del get_objects gc.enable() except ImportError: gc = None import copy, os, sys from StringIO import StringIO try: import cPickle except ImportError: ...
# -*- coding: utf-8 -*- # Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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...
# Copyright 2014 Algolia # # 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...
from __future__ import division from collections import OrderedDict from numbers import Integral import warnings import os import copy from abc import ABCMeta import itertools from six import add_metaclass, string_types import numpy as np import openmc import openmc.checkvalue as cv from openmc.tallies import ESTIMA...
#!/usr/bin/env python # -*- coding: utf-8 -*- from libavg import * import sys g_player = avg.Player.get() class VideoApp(AVGApp): def init(self): self.videoNode = VideoNode( href=sys.argv[1], parent=self._parentNode) self.videoNode.play() VideoApp.start(r...
from typing import List, Optional import os.path from pathlib import Path from collections import ChainMap import json from tempfile import TemporaryDirectory import subprocess from click import BadParameter from doit.action import CmdAction from doit.tools import create_folder, config_changed from elm_doc import elm...
#! /usr/bin/env python import pytest import sys import os import subprocess PYTEST_ARGS = { 'default': ['tests', '--cov', 'core_serializers', '--cov', 'tests', '--cov-report', 'term', '--cov-report', 'html'], 'travis': ['tests', '--cov', 'core_serializers', '--cov', 'tests', '--cov-report', 'term', '-v'] } F...
# Copyright 2012 OpenStack Foundation # Copyright 2013 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/LIC...
from django.db.models.aggregates import Avg, Count, StdDev, Variance from django.db.models.expressions import Ref, Value from django.db.models.functions import ConcatPair, Length, Substr from django.db.models.sql import compiler from django.db.transaction import TransactionManagementError from django.db.utils import Da...
from __future__ import absolute_import import logging import zipfile from six import StringIO from contextlib2 import ExitStack from fulltext import BaseBackend, get LOGGER = logging.getLogger(__name__) LOGGER.addHandler(logging.NullHandler()) class Backend(BaseBackend): def handle_fobj(self, f): wi...
#!/usr/bin/env python3 import sys import getopt import os import pvcheck import parser import testdata import formatter import jsonformatter import csvformatter import executor import valgrind import i18n __doc__ = i18n.HELP_en _ = i18n.translate _DEFAULT_LOG_FILE = os.path.expanduser("~/.pvcheck.log") def parse...
import os import socket import time import datetime import json import functools import traceback import copy import numpy as np from zlib import adler32 from pandacommon.pandalogger.PandaLogger import PandaLogger from pandacommon.pandalogger import logger_utils from pandaserver.config import panda_config from sci...
import slate import string import time iterations = 0 number_words = 0 pdfpath = '../text.pdf' ''' Set page_begin < 0 and page_end < 0 to process whole file ''' page_begin = -1 page_end = -1 ''' Counting function ''' def count_words(word, word_list): global iterations iterations += 1 s = word.lower().t...
import glob import os import optparse import sys import shutil import re import random import pinax from optparse import make_option from django.core.management.base import BaseCommand EXCLUDED_PATTERNS = ('.svn',) DEFAULT_PINAX_ROOT = None # fallback to the normal PINAX_ROOT in settings.py. PINAX_ROOT_RE = re.compil...
# Django settings for conf project. import os import sys IS_PRODUCTION = True if os.environ['SERVER_SOFTWARE'].startswith('Google App Engine') else False CONFIG_DIR = os.path.abspath(os.path.dirname(__file__)) PROJECT_DIR = os.path.dirname(CONFIG_DIR) STATIC_ROOT = os.path.join(PROJECT_DIR, 'static') DEBUG = True T...
import os import discord import asyncio import sys from discord.ext.commands import Bot my_bot = Bot(command_prefix="!") @my_bot.event @asyncio.coroutine def on_read(): print("Client logged in") @my_bot.command() @asyncio.coroutine def hello(*args): return my_bot.say("Hello, world!") @my_bot.command() @a...
"""ndb model definitions Many of these are similar to models in models.py, which are Django models. We need these ndb versions for use with runtime: python27, which is required by endpoints. """ import collections import logging import math from google.appengine.ext import ndb # TODO: move to global config SALES_TA...
#!/usr/bin/env python ### # Copyright (c) 2002, Jeremiah Fincher # 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, # ...
''' Created on Jan 27, 2011 @author: peyman kazemian ''' from sts.headerspace.headerspace.hs import * from sts.headerspace.headerspace.tf import * from sts.headerspace.config_parser.openflow_parser import get_uniq_port_id import sts.headerspace.config_parser.openflow_parser as of import sys import glob import os impo...
# -*- coding: utf-8 -*- ''' Global tests for open academy courses ''' from psycopg2 import IntegrityError from openerp.tests.common import TransactionCase from openerp.tools import mute_logger class GlobalTestOpenAcademyCourse(TransactionCase): ''' Global tests for open academy courses ''' # Pseudo...
#-*- coding: utf-8 -*- import os import subprocess import shutil from datetime import datetime from src.shell.analysis.arity import ArityAnalysis from src.shell.analysis.type import TypeAnalysis from src.shell.analysis.couple import CoupleAnalysis from src.shell.analysis.analysis import Analysis class Pintool(object...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import os import glob import pytest from flexget import plugin, plugins from flexget.event import event, fire_event class TestPluginApi(object): """ Contains plugin ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011,2012 Akira YOSHIYAMA <akirayoshiyama@gmail.com> # All Rights Reserved. # # Licensed un...
"""Codegen for functions used as kernels in NumPy functions Typically, the kernels of several ufuncs that can't map directly to Python builtins """ import math from llvmlite.llvmpy import core as lc from numba.core.imputils import impl_ret_untracked from numba.core import typing, types, errors, lowering, cgutils f...
# -*- coding: utf-8 -*- from openprocurement.api.utils import opresource from openprocurement.api.views.cancellation import TenderCancellationResource from openprocurement.tender.openua.utils import add_next_award @opresource(name='Tender UA Cancellations', collection_path='/tenders/{tender_id}/cancellati...
#!/usr/bin/env python # GTK Interactive Console # (C) 2003, Jon Anderson # See www.python.org/2.2/license.html for # license details. # import code import sys from rlcompleter import Completer from gi.repository import Gdk from gi.repository import Gtk from gi.repository import Pango banner = ( """Gaphor I...
import os import sys import re import shutil from os.path import abspath, basename, join, islink, isfile from utils import on_win, site_packages, rm_rf verbose = False bin_dir = join(sys.prefix, 'Scripts' if on_win else 'bin') def cp_exe(dst): src = join(site_packages, 'setuptools', 'cli.exe') if isfile(sr...
#/usr/bin/env python3 import itertools import random from pokerHands import * class BankRoll(object): def __init__(self, balance=None): if (balance is None): balance = 0 self.balance = balance def __str__(self): return str(self.balance) def __repr__(self): ret...
""" Unit tests for :mod:`manwe.resources`. """ import datetime import json from mock import Mock, patch from nose.tools import * import requests from manwe import resources, session class TestAnnotation(): """ Test :class:`manwe.resources.Annotation` and :class:`manwe.resources.AnnotationCollection` c...
# This is only meant to add docs to objects defined in C-extension modules. # The purpose is to allow easier editing of the docstrings without # requiring a re-compile. # NOTE: Many of the methods of ndarray have corresponding functions. # If you update these docstrings, please keep also the ones in # core...
""" This is only meant to add docs to objects defined in C-extension modules. The purpose is to allow easier editing of the docstrings without requiring a re-compile. NOTE: Many of the methods of ndarray have corresponding functions. If you update these docstrings, please keep also the ones in core/fromnum...
# -*- coding: utf-8 -*- # Copyright (c) 2012-2013, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version...
import asyncio import discord import praw import time class RedditFeed(object): subreddits = ["bourbon", "scotch", "worldwhisky"] def __init__(self, client): self._reddit = praw.Reddit("default", check_for_updates=False, user_agent="python:elmerdiscord:v1.0.0") self._last = time.time() ...
""" Django settings for MinecrunchWeb project. Generated by 'django-admin startproject' using Django 1.10. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ impor...
"""Implements Gauss' method for orbit determination from three topocentric angular measurements of celestial bodies. """ import math import numpy as np from jplephem.spk import SPK import matplotlib.pyplot as plt from scipy.optimize import newton # from scipy.optimize import least_squares def load_data_mpc(fname)...
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
"""BST data structure.""" import timeit class Node(object): """Node class used for the bst.""" def __init__(self, data=None): """Init node.""" self.data = data self.left = None self.right = None self.parent = None def _set_child(self, child): """Set child ...
from sqlobject import col from sqlobject import dberrors from sqlobject.dbconnection import DBAPI class ErrorMessage(str): def __new__(cls, e, append_msg=''): obj = str.__new__(cls, e.args[1] + append_msg) obj.code = int(e.args[0]) obj.module = e.__module__ obj.exception = e.__clas...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 EMBL - European Bioinformatics Institute # # 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/LICEN...
# Copyright 2016 Matthias Gazzari # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
from distutils.util import strtobool from fabric.api import task, local, cd, settings, run, sudo, put, get, abort from fabric.contrib import files from fabric.contrib.console import confirm import aws, utils from decorators import requires_project, requires_aws_stack, requires_steady_stack, echo_output, setdefault, deb...
# Copyright 2013 Google Inc. All rights reserved. # Use of this source code is governed by the Apache license that can be # found in the LICENSE file. """Presubmit checks for bitmapper.""" import subprocess import sys from git_cl import Changelist import tempfile import os def CheckChangeOnUpload(input_api, output_...
__author__ = "Jurismarches <it@jurismarches.com>" __version__ = "3.15.0"
# Utility routines for processing values. # Routine "value_summary" creates 'summary' (printable representation of value) # that is the same in Python 2 and Python 3, and includes a hash of the entire value # if the value display is longer than a threshold length. # Other routines are used to support this and for Pytho...
""" Complete test for a SAML to SAML proxy. """ import inspect import os import os.path import sys from urllib.parse import urlsplit, parse_qs, urlencode, quote, urlparse import pytest from saml2 import BINDING_HTTP_REDIRECT, BINDING_HTTP_POST from saml2.config import SPConfig, IdPConfig from werkzeug.test import Clie...
from __future__ import (absolute_import, division, print_function, unicode_literals) import os from ccdproc import ImageFileCollection import matplotlib.pyplot as plt import time import numpy as np from mpl_toolkits.mplot3d import Axes3D import re import glob import logging import argparse from ...
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
#!/usr/bin/env python# -*- coding: utf-8 -*- # Copyright (C) 2017, AGB & GC # Full license can be found in License.md # ---------------------------------------------------------------------------- """Scale data affected by magnetic field direction or electric field References ---------- .. [1] Chisham, G. (2017), A ne...
"""Unit tests for `pycall.call`.""" from unittest import TestCase from nose.tools import assert_false, eq_, ok_, raises from pycall import Call class TestCall(TestCase): """Test the `pycall.call.Call` class.""" @raises(TypeError) def test_create_call(self): """Ensure creating an empty `Call` object fails.""...
import os import shutil import unittest from xml.etree import ElementTree import cothread from mock import MagicMock, call from scanpointgenerator import CompoundGenerator, LineGenerator, SpiralGenerator from malcolm.core import Context, Future, Process, TimeoutError from malcolm.modules.ADCore.blocks import hdf_writ...
from __future__ import absolute_import, unicode_literals import py.test import time import riemann_client.client import riemann_client.riemann_pb2 import riemann_client.transport @py.test.fixture def blank_transport(): return riemann_client.transport.BlankTransport() @py.test.fixture def self_discharging_queu...
# Copyright (C) 2019 Andrew Hamilton. All rights reserved. # Licensed under the Artistic License 2.0. import functools import os import pickle import shutil class PagedList: def __init__(self, list_, pages_dir, page_size, cache_size, exist_ok=False, open_func=open): self.pages_dir = pa...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
"""Tests for the Wikidata parts of the page module.""" # # (C) Pywikibot team, 2008-2021 # # Distributed under the terms of the MIT license. # import copy import json from contextlib import suppress from decimal import Decimal import pywikibot from pywikibot import pagegenerators from pywikibot.page import ( Wik...
# -*- coding: utf-8 -*- import sys import urllib from bsdconv import Bsdconv def bsdconv01(dt): dt=dt.lstrip("0").upper() if len(dt) & 1: return "010"+dt else: return "01"+dt def bnf(s): return ",".join([bsdconv01(x) for x in s.strip().split(" ")]) iotest=[ ["big5:utf-8","\xa5\x5c\x5c\xaf\xe0","功\能"], ["b...
# Copyright (c) 2012-2014 Leif Johnson <leif@leifjohnson.net> # # 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...
#!/usr/bin/env python """Event Man(ager) Your friendly manager of attendees at an event. Copyright 2015-2016 Davide Alberani <da@erlug.linux.it> RaspiBO <info@raspibo.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the Licen...
from compsoc.settings import CHOOB_FILE from time import mktime from datetime import datetime import codecs def mapred(f1,f2,list): return reduce(f1,map(f2,list)) def write_file_callback(sender, **kwargs): from compsoc.events.models import Event choob_file = codecs.open(CHOOB_FILE,"w", "utf-8" ) event...
from subprocess import Popen, PIPE import shlex import re import os from gpm.utils.console import puts from gpm.utils.log import Log from gpm.const.status import Status from gpm.utils.string import decode as str_decode class LocalOperation(object): _RE_CD = re.compile(r"cd\s([\w\d_\/\s\~\.]+)") @classmethod ...
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Provide cache classes to handle creation of OpenMM Context objects. """ # ====================================...
import datetime import unittest from ..toml import loads class LoadsTest(unittest.TestCase): def test_empty(self): self.assertEqual(loads(''), {}) self.assertEqual(loads('\n'), {}) self.assertEqual(loads('\t'), {}) def test_comment(self): self.assertEqual(loads('# comment'),...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# ignore useless warnings about modules already imported. import warnings warnings.filterwarnings('ignore', r'module.*already imported', UserWarning) from flask import Flask, _request_ctx_stack from flask.ext.script import Manager from werkzeug.exceptions import default_exceptions from ownpaste.models import Ip, Paste...
# -*- coding: utf-8 -*- # # 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 requi...
# All edits to original document Copyright 2016 Vincent Berthiaume. # # 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 # # ht...
import correlations as cor import dataset as dt import numpy as np # Read user input aux = input("1 - Ler dados brutos, 2 - Ler dados de frequencia: ") data_file = input("Entre com o nome do arquivo csv: ") if aux == '1': dataset = dt.read_raw_input(data_file) population_file = input("Entre com o nome do arqui...
### # Copyright (c) 2002-2004, Jeremiah Fincher # 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 list of co...
#!/bin/env python # # glidein_status.py # # Description: # Equivalent to condor_status, but with glidein specific info # # Usage: # glidein_status.py [-help] [-gatekeeper] [-glidecluster] [-withmonitor] # # Author: # Igor Sfiligoi # import time import sys,os.path sys.path.append(os.path.join(sys.path[0],"../lib")...
__author__ = 'Tony' from TournamentService import * from AllPlayAll import * from RPSPlayerExample import * from RPSGame import * # Create a tournament service that will set the tournament accordingly, register the players to the tournament # and run the instance of Tournament class RPSDriver(TournamentService.Tourna...
#!usr/bin/python import sys, os, random from PyQt4 import QtGui, QtCore import numpy, csv from Plotter import * class PostprocessorWidget(QtGui.QWidget): def __init__(self, input_file_widget, execute_widget): QtGui.QWidget.__init__(self) self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self...
""" Topographica Bitmap Class. Encapsulates the PIL Image class so that an input matrix can be displayed as a bitmap image without needing to know about PIL proper. There are three different base image Classes which inherit Bitmap: PaletteBitmap - 1 2D Matrix, 1 1D Color Map HSVBitmap - 3 2D Matrices, Color (H),...
#!/usr/bin/env python import rospy import math import autobot from autobot.msg import drive_param from sensor_msgs.msg import LaserScan from autobot.msg import pid_input from autobot.msg import wall_dist from autobot.msg import pathFinderState from autobot.srv import * """ TODO: - [x] Decide if you want to hug right/l...
''' Copyright (c) 2016-2017 Wind River 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 applicabl...
# -*- coding: utf-8 -*- import xml.etree.cElementTree as ET import logging from util import DictObj import client from playlist import Playlist from favourite import Favourite from track import Track from exceptions import HarvestMediaError, MissingParameter logger = logging.getLogger('harvestmedia') class MemberCre...
from __future__ import absolute_import, unicode_literals from collections import Counter, defaultdict, OrderedDict from decimal import Decimal, InvalidOperation import operator from dateutil.relativedelta import relativedelta from enum import Enum import pytz from django.conf import settings from django.core.cache i...
from __future__ import absolute_import, unicode_literals from collections import Counter, OrderedDict from decimal import Decimal, InvalidOperation from itertools import chain, groupby from operator import itemgetter from dateutil.relativedelta import relativedelta from enum import Enum import numpy import pytz from...
#!/usr/bin/env python import math from src.gene_part import GenePart import src.translate as translate def length_of_segment(index_pair): return math.fabs(index_pair[1] - index_pair[0]) + 1 class MRNA: def __init__(self, identifier, indices, parent_id, annotations=None): self.identifier = identifier...
# Copyright 2017 IBM 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 agreed t...
""" Mine grid point extracted values for our good and the good of the IEM Use Unidata's motherlode server :) $Id: $: """ import sys import db, network table = network.Table( ['AWOS', 'IA_ASOS'] ) dbconn = db.connect('mos') dbconn.query("SET TIME ZONE 'GMT'") import csv, urllib2 import mx.DateTime BASE_URL = "http:/...
# # Jasy - Web Tooling Framework # Copyright 2010-2012 Zynga Inc. # import os, random from jasy.core.Error import JasyError from jasy.core.Permutation import Permutation from jasy.core.Logging import * from jasy.env.File import writeFile from jasy.js.Class import ClassError from jasy.js.Resolver import Resolver fro...
#!/usr/bin/env python """Convert Plink ped/map files into VCF format using plink and Plink/SEQ. Latest version available as part of bcbio-nextgen: https://github.com/chapmanb/bcbio-nextgen/blob/master/scripts/plink_to_vcf.py Requires: plink: http://pngu.mgh.harvard.edu/~purcell/plink/ PLINK/SEQ: http://atgu.mgh.harv...
""" Interative DQL client """ import os from fnmatch import fnmatch import botocore import cmd import functools import json import shlex import six import subprocess import traceback from pyparsing import ParseException from .engine import FragmentEngine from .help import (ALTER, ANALYZE, CREATE, DELETE, DROP, DUMP, ...
import logging import random from time import sleep import unittest import hashlib import os from unittest.case import SkipTest from prismriver.main import search from prismriver.struct import SearchConfig class TestPlugins(unittest.TestCase): def check_plugin(self, plugin_id, artist, title, lyric_hashes): ...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Django settings for hippocampus project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside th...
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GAM # # Copyright 2015, LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, create_fakecm_account import constants as cs def test(q, bus, mc): # Get the AccountManager interface account_manager = bus.get_object(cs.AM, cs.AM_PATH) ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 IBM # 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/LI...
import logging formatter = logging.Formatter(fmt='[%(asctime)s %(levelname)s] %(name)s: %(message)s') console_handler = logging.StreamHandler() console_handler.setLevel(logging.DEBUG) console_handler.setFormatter(formatter) file_handler = logging.FileHandler('iron-lady.log') file_handler.setLevel(logging.DEBUG) fil...
#!/usr/bin/env python """Unit tests for the Clinical Trials API.""" import unittest from mock import Mock from api import api from clinical_trials import Trials class TestTrialsInit(unittest.TestCase): def test_Trials_class_init(self): trials = Trials() self.assertEquals(trials.base_url, 'htt...
# -*- coding: utf-8 -*- # FIXME color_index param """ Display bitcoin prices using bitcoincharts.com. Configuration parameters: cache_timeout: refresh interval for this module. A message from the site: Don't query more often than once every 15 minutes! (default 900) color_index: Index of the ma...
## easyReg.py ## Author: Daniel "Albinohat" Mercado ## A simple wrapper module for _winreg. ## This module provides easy access to registry keys via strings as well objects to store registry keys and entries. ## TODO - Modify walkReg's fn function to take a list as a parameter. [TESTING REQUIRED] ## -...
# 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. from master import master_config from master.factory import webrtc_factory defaults = {} def mac(): return webrtc_factory.WebRTCFactory('src/out', '...
from .paths import Paths import logging logger = logging.getLogger(__name__) def get(name=None): maps = [] for mapdir in (p for p in Paths.MAPS.iterdir()): if mapdir.is_dir(): for mapfile in (p for p in mapdir.iterdir() if p.is_file()): if mapfile.suffix == ".SC2Map": ...
""" A client in an RBFT system. Client sends requests to each of the nodes, and receives result of the request execution from nodes. """ import base64 import json import logging import os import time from binascii import unhexlify from collections import deque, OrderedDict from typing import List, Union, Dict, Optional...
import uuid from . import bigquery_client from ...auth import get_default_credentials from collections import defaultdict _ENRICHMENT_ID = 'enrichment_id' # TODO: process column name in metadata, remove spaces and points def enrich_points(data, variables, data_geom_column='geometry', filters=dict()): credent...
import json import logging from flask import request from sqlalchemy import text from sqlalchemy.exc import DatabaseError from webargs import fields, missing from webargs.flaskparser import parser, use_kwargs from scuevals_api.models import Course, Quarter, Department, School, Section from scuevals_api import api, db f...
""" imports for GCS """ # coding=utf-8 from __future__ import print_function # python3 import os import json # to parse URL import urllib2 # to fetch URL import datetime # to compose URL import sys # for get_size import logging from jsondiff import diff # to show difference between json content import cloudstora...
# encoding: utf-8 # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import unicode_literals from pym...