gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" Testing of admin inline formsets. """ import random from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models class Parent(models.Model): name = models.CharField(max_length=50) def __str__(self): retur...
#! /usr/bin/env python import MySQLdb as mdb import os import sys import logging from operator import itemgetter import warnings import cPickle as pk # The assumption is that the table that is being written to is cleared! tardir = '../data/ast/' logdir = '../log/populatedb/' USESKIPLIST = True #problemList = [(1,1)...
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2020 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import base64 import codecs import datetime from email import message_from_file import hashlib i...
# 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...
"""The instruments module contains functions to open and close VISA, NI-DAQ or COM instruments. """ import traceback, importlib, pkgutil, os, sys, time import pyslave.drivers class InstrumentError(Exception): pass # Get VISA resource manager try: import pyvisa as visa from pyvisa import VisaIOError #...
"""(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017""" import json import re from time import sleep from django.test import tag from django.urls import reverse from rest_framework.test import APITestCase from api import rancher from api.redis import flush_all from api.tests ...
"""The tests for the Template lock platform.""" import logging from homeassistant.core import callback from homeassistant import setup from homeassistant.components import lock from homeassistant.const import STATE_ON, STATE_OFF from tests.common import (get_test_home_assistant, assert_setup...
"""Provides a variety of introspective-type support functions for things like call tips and command auto completion.""" __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>" __cvsid__ = "$Id: introspect.py 39896 2006-06-29 22:24:00Z RD $" __revision__ = "$Revision: 39896 $"[11:-2] import cStringIO import inspect im...
""" Unit tests for the spade module. :copyright: Copyright 2014-2016 by the Elephant team, see AUTHORS.txt. :license: Modified BSD, see LICENSE.txt for details. """ from __future__ import division import unittest import os import warnings import neo import numpy as np from numpy.testing.utils import assert_array_almo...
# Copyright (c) 2013 Rackspace, 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 wr...
# Copyright 2017 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
import json from decimal import Decimal from django.conf import settings from django.core.urlresolvers import reverse import commonware.log from rest_framework import response, serializers from django.utils.translation import ungettext as ngettext import mkt from mkt.api.fields import (ESTranslationSerializerField, ...
"""Utilities for writing code that runs on Python 2 and 3""" # flake8: noqa # Copyright (c) 2010-2013 Benjamin Peterson # # 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,...
################################################################################ # (c) [2013] The Johns Hopkins University / Applied Physics Laboratory All Rights Reserved. # Contact the JHU/APL Office of Technology Transfer for any additional rights. www.jhuapl.edu/ott # # Licensed under the Apache License, Version ...
""" This module implements multioutput regression and classification. The estimators provided in this module are meta-estimators: they require a base estimator to be provided in their constructor. The meta-estimator extends single output estimators to multioutput estimators. """ # Author: Tim Head <betatim@gmail.com>...
# Third-party imports import pytest # Local imports from uplink import commands, converters, arguments, utils class TestHttpMethodFactory(object): def test_call_as_decorator_with_no_args(self): @commands.HttpMethodFactory(None) def func(): pass assert isinstance(func, command...
# -*- encoding: utf-8 -*- import ConfigParser import datetime from functools import wraps import json import os import re import requests import time from rdopkg import exception from rdopkg.utils import cmd from rdopkg.utils import log COPR_URL = 'https://copr.fedoraproject.org' COPR_RESULTS_URL = 'http://copr-be....
import unittest from copy import deepcopy from pulsar.utils.structures import AttributeDictionary from .utils import TestFailure, LOGGER __all__ = ['Plugin', 'TestStream', 'TestRunner', 'TestResult'] STDOUT_LINE = '\nStdout:\n%s' STDERR_LINE = '\nStderr:\n%s' def def_return_val(...
# sqlalchemy_dremio/pyodbc.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Support for Dremio via pyodbc. pyodbc is available at: http://py...
# Copyright 2015-2016, 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 list of conditions and ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import # Standard imports from future import standard_library standard_library.install_aliases() from builtins import * import unittest import datetime as pydt import logging imp...
""" .. module:: fhmm :platform: Unix :synopsis: Contains methods for training and fitting Factorials HMMs. .. moduleauthor:: Phil Ngo <ngo.phil@gmail.com> .. moduleauthor:: Miguel Perez <miguel.a.perez4@gmail.com> .. moduleauthor:: Stephen Suffian <stephen.suffian@gmail.com> .. moduleauthor:: Sabina Tomkins <sab...
#!/usr/bin/env python """Start CockroachDB. CockroachDB clusters need to be bootstrapped. This is done by starting the very first node without the --join=<ip1,ip2,...,ipN> parameter. Once bootstrapped, no node must ever be started without the --join parameter again, doing so would initialize a new cluster causing th...
#!/usr/bin/env python from __future__ import print_function """ test_split_subdivide_checkpointing.py """ tempdir = "testing_dir/" import os import sys # add grandparent to search path for testing grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) sys.path.insert(0, grandpa...
# This script is executed in the main console namespace so # that all the variables defined here become console variables. import ddapp import os import sys import PythonQt import json from PythonQt import QtCore, QtGui from time import time import imp import ddapp.applogic as app from ddapp import drcargs from ddapp...
import datetime import json import httpretty import pytest from django.utils import timezone from nose.tools import * # flake8: noqa from framework.auth.core import Auth from addons.github.tests.factories import GitHubAccountFactory from osf.models import AbstractNode as Node from website.util import waterbutler_ap...
import inspect from abc import ABCMeta from collections import OrderedDict from functools import wraps from operator import attrgetter from types import MethodType import six from six import add_metaclass from theano import tensor from theano.gof import Variable from blocks.graph import add_annotation, Annotation fro...
#!/usr/bin/env python import praw # pip install praw import humanfriendly # pip install humanfriendly import imgurpython # pip install imgurpython import argparse from time import sleep import socket import warnings import os import os.path import sys from imgurpython.helpers.error import ImgurClientError import re...
import numpy as np from pandas.util._decorators import Appender, Substitution from pandas.core.dtypes.cast import maybe_downcast_to_dtype from pandas.core.dtypes.common import is_integer_dtype, is_list_like, is_scalar from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries import pandas.core.common as com fro...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2016 Futur Solo # # 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 # # ...
# # Copyright 2016 Quantopian, 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 wr...
# Copyright (c) 2022 Matt Colligan # # 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, publish, distr...
# -*- coding: utf-8 -*- from typing import NamedTuple, Tuple import pytest import numpy as np class UnivariateData(NamedTuple): x: np.ndarray y: np.ndarray xi: np.ndarray yi: np.ndarray yi_d1: np.ndarray yi_d2: np.ndarray yi_ad1: np.ndarray integral: float smooth: float @pytest...
"""Built-in Source baseclasses. In order of increasing functionality and decreasing generality: * Source: only sets up default arguments and helper functions for caching. Use e.g. if you have an analytic pdf * HistogramPdfSource: + fetch/interpolate the PDF/PMF from a (multihist) histogram Use e.g. if you ha...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2011-2018, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. import sys import os import io import getopt import unittest import doctest import inspect from multiprocessing import Process, Queue import nbformat from nbc...
import numpy as np import matplotlib.pyplot as plt from traitsui.qt4.editor import Editor from traitsui.qt4.basic_editor_factory import BasicEditorFactory from traits.api import Instance, HasTraits, Int, Str, Float, List, Array, Bool, Tuple, Button, Dict, Enum, Range, on_trait_change from traitsui.api import Handler, ...
from django.conf import settings from django.utils import translation from elasticsearch_dsl import F, query from elasticsearch_dsl.filter import Bool from rest_framework.filters import BaseFilterBackend import mkt from mkt.api.base import form_errors, get_region_from_request from mkt.constants.applications import ge...
from __future__ import print_function,division import logging import subprocess as sp import os, re import time try: import numpy as np import pandas as pd from astropy.units import UnitsError from astropy.coordinates import SkyCoord except ImportError: np, pd = (None, None) UnitsError, SkyCo...
import enum class Severity(enum.IntEnum): info = 0 # Problem with the scanner notice = 1 # Speculative weakness warning = 2 # Theoretical weakness error = 4 # Expensive attack critical = 8 # Cheap attack class Issue(object): def __init__(self, severity, what, details=None, instructio...
# Copyright (c) 2016 Red Hat, 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 require...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
#!/usr/bin/env python import gflags import json import logging import math import numpy import os import pprint import sys from scipy.misc import pilutil FLAGS = gflags.FLAGS gflags.DEFINE_integer('start_year', 2013, 'Start processing from this year') gflags.DEFINE_integer('start_month', 1, 'Start processing from t...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Installation and deployment script.""" import os import pkg_resources import sys try: from setuptools import find_packages, setup except ImportError: from distutils.core import find_packages, setup try: from distutils.command.bdist_msi import bdist_msi except Im...
""" Beacon to fire events at failed login of users .. versionadded:: 2015.5.0 Example Configuration ===================== .. code-block:: yaml # Fire events on all failed logins beacons: btmp: [] # Matching on user name, using a default time range beacons: btmp: - users: ...
"""Subclass of MainFrameBase, which is generated by wxFormBuilder.""" from multiprocessing import synchronize import string import wx import pickle import re import base64 import os import threading import mst_gui from threaded import * import traced import LogViewer import LogEntry import LogManager from Experiment...
# most of this code was politely stolen from https://github.com/berkeleydeeprlcourse/homework/ # all credit goes to https://github.com/abhishekunique # (if I got the author right) import numpy as np from gym.utils import seeding try: from graphviz import Digraph import graphviz has_graphviz = True except I...
# Copyright (c) 2013 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 ...
#!/usr/bin/env python3 # Copyright (c) 2021 The Dash Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import time from test_framework.messages import msg_qgetdata, msg_qwatch from test_framework.mininode import ( ...
""" Tests for stuff in django.utils.datastructures. """ import copy import pickle import unittest from django.utils.datastructures import * class DatastructuresTestCase(unittest.TestCase): def assertRaisesErrorWithMessage(self, error, message, callable, *args, **kwargs): self.assertRaises(error,...
#!/usr/bin/python """ $Id: cwm.py,v 1.198 2012/01/30 09:30:20 timbl Exp $ Closed World Machine (also, in Wales, a valley - topologiclly a partially closed world perhaps?) This is an application which knows a certian amount of stuff and can manipulate it. It uses llyn, a (forward chaining) query engine, not an (back...
from __future__ import with_statement import os import re import pytest import time import six from fanstatic import (Library, Resource, NeededResources, Group, init_needed, del_needed, ...
from __future__ import print_function import os import json import unittest import abc import riotwatcher import data_path default_report_freq = 100 default_report_callback = print default_summoner_id = 30890339 default_n_ids_min = 10 default_summoner_ids_directory = data_path.summoner_ids_dir default_champions_us...
# Copyright 2014 Open Source Robotics Foundation, 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...
""" Filename: calc_global_metric.py Author: Damien Irving, irving.damien@gmail.com Description: Calculate global metric """ # Import general Python modules import sys, os, pdb import argparse import numpy import iris import iris.analysis.cartography from iris.experimental.equalise_cubes import equalise_at...
# Copyright (c) 2015 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 writ...
# moose_parse.py # This parser is basically a somewhat stripped-down version of the # public domain Yeanpypa parser by Markus Brueckner. Very many thanks # to Markus for doing Yeanpypa. # The main differences: Some of the leading underscores have been # removed from variable names. Some code comments have...
import os import redis from wsgiref.simple_server import WSGIRequestHandler from pymongo import MongoClient import mysql.connector import oauth2.store.mongodb import oauth2.store.memory import oauth2.store.dbapi.mysql import oauth2.store.redisdb class NoLoggingHandler(WSGIRequestHandler): """ Turn off logging...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() # NOQA from chainer import optimizers from chainer import testing import gym import gym.spaces im...
# 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...
from random import randint from random import choice from decimal import * from enum import Enum from money import Money from tabulate import tabulate CURRENCY = 'UKP' MONEYPERPLAYERSTART = Money(amount='5000.00', currency='UKP') MONEYBANKSTART = Money(amount='100000.00', currency='UKP') MONEYZEROFUNDS = Money(amo...
from __future__ import unicode_literals from datetime import datetime from django.contrib.auth import get_user_model from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible fro...
# 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 req...
from __future__ import division import json import os import pickle import pprint from random import shuffle import numpy import patterny.synthesize.topic as _tsynthesize from patterny.db import dao from patterny.config import Config from patterny.semafor.adapter import SemaforClient from test_main import PatternyTe...
from copy import deepcopy import pytest from mock import MagicMock from switchboard.module import SwitchboardModule, ModuleError from switchboard.device import RESTDevice, get_device_suffix def set_value_callback(device, value): set_value_callback.values[device.name] = value set_value_callback.values = {} def...
"""Test the split module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix, csc_matrix, csr_matrix from scipy import stats from scipy.misc import comb from itertools import combinations from sklearn.utils.fixes import combinations_with_replacement from sklearn.u...
# 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 #gtkwin32.py __version__ = '1.01' import sys import win32gui import winxpgui GWL_WNDPROC = -4 GWL_EXSTYLE = -20 IDI_APPLICATION = 32512 LWA_ALPHA = 0x02 WM_TASKBARCREATED = win32gui.RegisterWindowMessage('TaskbarCreated') WM_USER = 1024 WM_TRAYMESSAGE = WM_USER + 20 WS_EX_LAYERED = 0x80000 cl...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals import logging from fractions import Fraction from pymatgen.analysis.bond_valence import BVAnalyzer from pymatgen.analysis.ewald import EwaldSummation, Ewald...
#!/usr/bin/env python ################################################################################ # # proxy_logger.py # # # Copyright (c) 10/9/2009 Leo Goodstadt # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Soft...
#ipython --pylab import scipy import glob from mpl_toolkits.basemap import Basemap from netCDF4 import Dataset import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab _viridis_data = [[0.267004, 0.004874, 0.329415], [0.268510, 0.009605, 0.335427], [0.269944,...
#!/usr/bin/env python3 import os import sys import string from importlib import reload import getKerningPairsFromOTF reload(getKerningPairsFromOTF) __doc__ = '''\ This script extracts a viable kern feature file from a compiled OTF. It requires the script 'getKerningPairsFromOTF.py'; which is distributed ...
# -*- coding: cp936 -*- """ The main purpose of this script is to generate stat for Single end Read (Stranded) mainly CLIP-Seq reads regarding to transcript END. ============================= Usage: python SE_RNASeq_diff_TailStat_obj_v0.1.alpha.py -h help -i files to processed *[No default v...
import ms_utils import numpy import matplotlib.pyplot as plt plt.rcParams['pdf.fonttype'] = 42 #leaves most text as actual text in PDFs, not outlines import os import scipy.stats as stats import operator def all_library_rpm_scatter(mse): output_file = os.path.join( mse.settings.get_rdir(), 'plots',...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
import tempfile import shutil import os import sys import posixpath from StringIO import StringIO from django.test import TestCase from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command from django.db.models.loading import load_app from ...
#!/usr/bin/env python ''' 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")...
#!/usr/bin/python # # Copyright (C) 2011 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of...
# Copyright 2014 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 ag...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 - 2012, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may ...
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from mmdet.core import bbox2result, bbox2roi, bbox_xyxy_to_cxcywh from mmdet.core.bbox.samplers import PseudoSampler from ..builder import HEADS from .cascade_roi_head import CascadeRoIHead @HEADS.register_module() class SparseRoIHead(Ca...
import boto3 import os import time from boto3.exceptions import Boto3Error import logging from .cloud_provider import CloudProviderBase from .node import Node logging.getLogger('boto3').setLevel(logging.CRITICAL) logging.getLogger('botocore').setLevel(logging.CRITICAL) AWS_REGION = 'us-east-2' AWS_REGION_AZ = 'us-e...
#!/usr/bin/python # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
import pygame as pg import heapq from os import path from random import choice vec = pg.math.Vector2 TILESIZE = 48 GRIDWIDTH = 30 GRIDHEIGHT = 15 WIDTH = TILESIZE * GRIDWIDTH HEIGHT = TILESIZE * GRIDHEIGHT FPS = 60 MOB_SPEED = 5 WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) FOREST = (...
from app.models import ( NOTIFICATION_STATUS_LETTER_ACCEPTED, NOTIFICATION_STATUS_LETTER_RECEIVED, NOTIFICATION_STATUS_TYPES, NOTIFICATION_TYPES, ) from app.schema_validation.definitions import personalisation, uuid template = { "$schema": "http://json-schema.org/draft-04/schema#", "description...
# -*- coding: utf-8 -*- # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
# Copyright 2015 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
#! /usr/bin/env python # coding=utf-8 import struct import bitarray import io class Page: def __init__(self, buffer, number): self._buffer = buffer self.clean = True self.busy = True self._type = 0 self.number = number self.temp = False self.pointer_fmt = s...
"""TestSuite""" import sys import unittest import six from unittest2 import case, util __unittest = True class BaseTestSuite(unittest.TestSuite): """A simple test suite that doesn't provide class or module shared fixtures. """ _cleanup = True def __init__(self, tests=()): self._tests = []...
# 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-2...
#!/usr/bin/env python #Script for analyzing the PBS accounting files #Print statistics for users, queues, nodes, or jobs #Print a sorted list of user statistics #See usage summary import numpy as np import pylab as plt import sys from optparse import OptionParser def ec2str(exitCode): #Returns a descriptive string f...
# -*- coding: utf-8 -*- """ Default Controllers @author: Fran Boon """ module = "default" # Options Menu (available in all Functions) response.menu_options = [ #[T("About Sahana"), False, URL(r=request, f="about")], ] def call(): "Call an XMLRPC, JSONRPC or RSS service" # If webservices don't u...
""" TOC directive ~~~~~~~~~~~~~ The TOC directive syntax looks like:: .. toc:: Title :depth: 3 "Title" and "depth" option can be empty. "depth" is an integer less than 6, which defines the max heading level writers want to include in TOC. """ from .base import Directive ...
import json import os import sys from collections import namedtuple from datetime import datetime from config_util import parse_args, parse_contexts, generate_file_path from train import do_training import mxnet as mx from stt_io_iter import STTIter from label_util import LabelUtil from log_util import LogUtil import n...
# Copyright (C) 2011 Midokura KK # Copyright (C) 2011 Nicira, Inc # Copyright 2011 OpenStack Foundation # All Rights Reserved. # Copyright 2016 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...
# -*- test-case-name: twisted.test.test_unix,twisted.internet.test.test_unix,twisted.internet.test.test_posixbase -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ UNIX socket support for Twisted. End users shouldn't use this module directly - use the reactor APIs instead. Maintainer: I...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
import os import re import sys import code from PyQt4.QtGui import * from PyQt4.QtCore import * class MyInterpreter(QWidget): def __init__(self, parent): super(MyInterpreter, self).__init__(parent) hBox = QHBoxLayout() self.setLayout(hBox) self.textEdit = PyInterp(self) ...
#******************************************************************************* # # Filename : crablogger.py # Description : class for managing crab outputfile logging # Author : Yi-Mu "Enoch" Chen [ ensc@hep1.phys.ntu.edu.tw ] # #************************************************************************...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012-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/LICENS...