text stringlengths 475 200k |
|---|
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, [EMAIL]
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
from ...format import Form... |
#!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
# 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 the Li... |
# Lint as python3
# Copyright 2020 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 r... |
# Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
import os, sys
import unittest
from test import support
threading = support.import_module("threading")
from platform import machine
# Do this first so test will be skipped if module doesn't exis... |
import threading
import time
import functools
from typing import Dict, Callable, Any, List, Optional # noqa
import h2.exceptions
from h2 import connection
from h2 import events
import queue
from mitmproxy import connections # noqa
from mitmproxy import exceptions
from mitmproxy import http
from mitmproxy.proxy.prot... |
# -*- coding: utf-8 -*-
"""
sphinx.linkcheck
~~~~~~~~~~~~~~~~
The CheckExternalLinksBuilder class.
:copyright: 2008 by Georg Brandl, Thomas Lamb.
:license: BSD.
"""
import socket
from os import path
from urllib2 import build_opener, HTTPError
from docutils import nodes
from sphinx.builder impor... |
"""
Acceptance tests for Studio related to the asset index page.
"""
from ...pages.studio.asset_index import AssetIndexPage
from .base_studio_test import StudioCourseTest
from ...fixtures.base import StudioApiLoginError
class AssetIndexTest(StudioCourseTest):
"""
Tests for the Asset index page.
"""
... |
import pygame
import tmx
class Player(pygame.sprite.Sprite):
def __init__(self, location, orientation, *groups):
super(Player, self).__init__(*groups)
self.image = pygame.image.load('sprites/player.png')
self.imageDefault = self.image.copy()
self.rect = pygame.Rect(location, (64,64)... |
from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
# For more information, see the OGR C API source code:
# http://www.gdal.org/ogr/... |
from django.template import loader, RequestContext
from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone
from django.utils.log import getLogger
import warnings
warnings.warn(
'Function-based generic views have been deprecated; use class-based views instead.',
... |
"""TODO."""
from enum import Enum
import UBX
def isObj(obj, cls):
"""Test if UBX message obj is of class cls."""
return obj._class == cls._class and obj._id == cls._id
def isACK(obj):
"""Test whether message obj is a ACK."""
return isObj(obj, UBX.ACK.ACK)
def isNAK(obj):
"""Test whether messag... |
# -*- coding: utf-8 -*-
import os.path
import posixpath
import re
import urllib
from docutils import nodes
from sphinx import addnodes, util
from sphinx.locale import admonitionlabels
def _parents(node):
while node.parent:
node = node.parent
yield node
class BootstrapTranslator(nodes.NodeVisitor... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# -*- coding: utf-8 -*-
import os
from ._compat import itervalues
from ._globals import GLOBAL_LOCKER, THREAD_LOCAL
from ._load import OrderedDict
from .helpers._internals import Cursor
class ConnectionPool(object):
POOLS = {}
check_active_connection = True
def __init__(self):
_iid_ = str(id(self... |
""" Collect status information for Windows services
"""
# project
from checks import AgentCheck
from checks.wmi_check import WinWMICheck
from utils.containers import hash_mutable
from utils.timeout import TimeoutException
class WindowsService(WinWMICheck):
STATE_TO_VALUE = {
'Stopped': AgentCheck.CRITICAL... |
# 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... |
#! /usr/bin/env python
from pygments.lexer import RegexLexer
from pygments.token import *
class CapnpLexer(RegexLexer):
name = "Cap'n Proto lexer"
aliases = ['capnp']
filenames = ['*.capnp']
tokens = {
'root': [
(r'#.*?$', Comment.Single),
(r'@[0-9a-zA-Z]*', Name.Decor... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 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... |
#!/usr/bin/env python
# encoding: utf-8
"""
connection.py
Created by Thomas Mangin on 2013-07-13.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
import os
import sys
import unittest
from exabgp.util.od import od
def test ():
OPEN = ''.join([chr(int(_,16)) for _ in "FF FF FF FF FF FF FF FF FF FF FF ... |
# -*- coding: utf-8 -*-
"""
New Zealand specific form helpers
"""
from __future__ import unicode_literals
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_str
from djang... |
# -- coding: utf-8 --
# Note that we import as `DjangoRequestFactory` and `DjangoClient` in order
# to make it harder for the user to import the wrong thing without realizing.
from __future__ import unicode_literals
from django.conf import settings
from django.test import testcases
from django.test.client import Clie... |
import sys
import os
import IMP
import IMP.em
import IMP.test
import IMP.core
import IMP.atom
import IMP.multifit
class Tests(IMP.test.TestCase):
"""Test connected components """
def setUp(self):
"""Build test model and optimizer"""
IMP.test.TestCase.setUp(self)
IMP.set_log_level(IMP... |
#!/usr/bin/env python
class Alignment:
def __init__(self):
self.qname = ""
self.tname = ""
self.qstat = 0
self.qend = 0
self.qstrand = 0
self.qlen = 0
self.tstart = 0
self.tend = 0
self.tstrand = 0
self.tlen = 0
self.score... |
"""
Expose each GPU device directly
"""
from __future__ import print_function, absolute_import, division
import functools
from numba import servicelib
from .driver import hsa as driver, Context as _Context
class _culist(object):
"""A thread local list of GPU instances
"""
def __init__(self):
self... |
#!/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 "Lic... |
from __future__ import absolute_import
import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
... |
# -*- test-case-name: twisted.names.test.test_names -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for twisted.names.
"""
import socket, operator, copy
from twisted.trial import unittest
from twisted.internet import reactor, defer, error
from twisted.internet.de... |
#!/usr/bin/env python
# Copyright 2014 Open Connectome Project (http://openconnecto.me)
#
# 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
#
#... |
"""
Mail sending helpers
See documentation in docs/topics/email.rst
"""
import logging
from six.moves import cStringIO as StringIO
import six
from email.utils import COMMASPACE, formatdate
from six.moves.email_mime_multipart import MIMEMultipart
from six.moves.email_mime_text import MIMEText
from six.moves.email_mim... |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 3 of the License, or
# (at your option) any ... |
# Test that locks work when cancelling multiple waiters on the lock
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def task(i, lock, lock_flag):
print("task", i, "start")
try:
await l... |
from django.db import connection, connections
from django.db.migrations.exceptions import (
AmbiguityError, InconsistentMigrationHistory, NodeNotFoundError,
)
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.recorder import MigrationRecorder
from django.test import TestCase, modify_... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
int_or_none,
ExtractorError,
)
class VubeIE(InfoExtractor):
IE_NAME = 'vube'
IE_DESC = 'Vube.com'
_VALID_URL = r'https?://vube\.com/(?:[^/]+/)+(?P<id... |
# -*- coding: utf-8 -*-
"""
werkzeug
~~~~~~~~
Werkzeug is the Swiss Army knife of Python web development.
It provides useful classes and functions for any WSGI application to make
the life of a python web developer much easier. All of the provided
classes are independent from each other so yo... |
import urllib2
from StringIO import StringIO
import gzip
import cookielib
import time
class NZBDownloader(object):
def __init__( self ):
self.cj = cookielib.CookieJar()
self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj))
self.lastRequestTime = None
... |
"""
parser.http.searchCompanyParser module (imdb package).
This module provides the HTMLSearchCompanyParser class (and the
search_company_parser instance), used to parse the results of a search
for a given company.
E.g., when searching for the name "Columbia Pictures", the parsed page would be:
http://akas.imdb.co... |
import os
import sys
from itertools import groupby
from operator import itemgetter
SEPARATOR = "\t"
class Streaming(object):
@staticmethod
def get_job_conf(name):
name = name.replace(".", "_").upper()
return os.environ.get(name)
def __init__(self, infile=sys.stdin, separator=SEPARATOR):... |
from mi.instrument.seabird.sbe37smb.ooicore.driver import NEWLINE
SAMPLE_DS = "SBE37-SMP V 2.6 SERIAL NO. 2165 05 Feb 2013 19:11:43" + NEWLINE + \
"not logging: received stop command" + NEWLINE + \
"sample interval = 20208 seconds" + NEWLINE + \
"samplenumber = 0, free = 200000"... |
# -*- coding: utf-8 -*-
"""This module contains some math and statistics functions.
In the future plan: Eigenvalue, Inverse, Matrix Multiplication,
SVD, PCA
"""
__author__ = 'Wenzhi Mao'
__all__ = ['isSquare', 'ANOVA', 'performRegression', 'performPolyRegression']
def isSquare(x):
"""It is a... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
import random
from urlparse import urljoin
import werkzeug
from openerp.addons.base.ir.ir_mail_server import MailDeliveryException
from openerp.osv import osv, fields
from openerp... |
import random
from functools import reduce
import time
import functools
import numpy as np
import numpy.testing as npt
from numpy import exp
import pytest
import numba
from clifford import Cl
from clifford.g3c import *
from clifford import general_exp
from clifford.tools.g3c import *
from clifford.tools.g3c.rotor_pa... |
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
import ctypes.util
import types
import logging.handlers
from typeutils.TypeChecker import require
# Copyright (c) 2010 Siddhu Warrier (http://siddhuwarrier.homelinux.org,
# siddhuwarrier AT gmail DOT com).
#
# This file is part of the xkb package.
# The xkb package is free software: you can redistribute it and/or m... |
# 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... |
import hashlib
import warnings
import logging
import unittest
import ssl
from itertools import chain
from mock import patch, Mock
from urllib3 import add_stderr_logger, disable_warnings
from urllib3.util.request import make_headers
from urllib3.util.timeout import Timeout
from urllib3.util.url import (
get_host,
... |
### Author: Bert de Bruijn <bert+dstat$debruijn,be>
### VMware memory stats
### Displays memory stats coming from the hypervisor inside VMware VMs.
### The vmGuestLib API from VMware Tools needs to be installed
class dstat_plugin(dstat):
def __init__(self):
self.name = 'vmware memory'
self.vars = ... |
import numpy as np
import chainladder as cl
from rpy2.robjects.packages import importr
from rpy2.robjects import r
CL = importr("ChainLadder")
def test_mcl_paid():
df = r("MunichChainLadder(MCLpaid, MCLincurred)").rx("MCLPaid")
p = cl.MunichAdjustment(paid_to_incurred=("paid", "incurred")).fit(
cl.De... |
# 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... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the L... |
# Definition for a point
class Point:
def __init__(self, a=0, b=0):
self.x = a
self.y = b
class Solution:
# @param points, a list of Points
# @return an integer
def maxPoints(self, points):
result = 0
for i in xrange(len(points)):
d = {}
duplicate... |
# Copyright 2019 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... |
import os
import subprocess
def cpp_demangle(name):
return subprocess.check_output(['c++filt', name]).decode('utf-8').strip()
def split_identifier(identifier):
"""Splits string at _ or between lower case and uppercase letters."""
prev_split = 0
parts = []
if '_' in identifier:
parts = [... |
# -*- test-case-name: twisted.trial._dist.test.test_workerreporter -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test reporter forwarding test results over trial distributed AMP commands.
@since: 12.3
"""
from twisted.python.failure import Failure
from twisted.python.reflect impor... |
from commando.conf import AutoProp, ConfigDict
class TestClass(AutoProp):
@AutoProp.default
def source(self):
return 'source'
def test_auto():
t = TestClass()
assert t.source == 'source'
def test_override():
t = TestClass()
t.source = 'source1'
assert t.source == 'source1'
... |
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
"""
**Contains**
* Medium
"""
from __future__ import division
__all__ = ['Medium']
from sympy import Symbol, sympify, sqrt
from sympy.physics.units import c, u0, e0
class Medium(Symbol):
"""
This class represents an optical medium. The prime reason to implement this is
to facilitate refraction, Fermat... |
# (c) 2012-2014, Michael DeHaan <[EMAIL]>
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
... |
"""Support for Nexia / Trane XL Thermostats."""
from nexia.const import UNIT_CELSIUS
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
PERCENTAGE,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
)
from .const import DOMAIN, NEXIA_DEVICE, UPDATE_COORDINATOR
from .entity import Nexi... |
# Copyright 2013, Nachi Ueno, NTT I3, 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... |
# This file is part of Firemix.
#
# Copyright 2013-2016 Jonathan Evans <[EMAIL]>
#
# Firemix 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 3 of the License, or
# (at your option) any later ver... |
#
# Kickstart module for the storage.
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is di... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Muparser(Package):
"""C++ math expression parser library."""
homepage = "http://mupars... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""End-to-end tests for traffic control library."""
import os
import re
import sys
import unittest
import traffic_control
class... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
import builtins
from collections.abc import Iterable
import operator
from functools import partial
from itertools import product, repeat
from math import factorial, log, ceil, log2
import numpy as np
from numbers import Integral, Number
from tlz import compose, partition_all, get, accumulate, pluck, drop
from . impo... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Project.num_point'
db.alter_column('projects_project', 'num_point', self.gf('django.db.mo... |
#! /usr/bin/env python
from contextlib import closing
import os, sys, subprocess, re, textwrap
def loadFile(path):
with closing( open(path) ) as fd:
return fd.read()
def writeFile(path, buffer):
with closing( open(path, "w") ) as fd:
fd.write(buffer)
def splitSections(buffer):
while buffer:
assert... |
from .results import BaseQueryResults
from .func import Count
from ..base.helper import key_for_cypher, value_for_cypher
class BaseQuery(object):
query_template = '''{match}
{where}
{optional_match}
{with}
{return}'''
delete_template = '''DETACH DELETE {alias}'''
aggregate_template = ''... |
from optparse import make_option
from django.core.management.base import AppCommand, CommandError
from django.core.management.color import no_style
from django.core.management.sql import sql_reset
from django.db import connections, transaction, DEFAULT_DB_ALIAS
class Command(AppCommand):
option_list = AppCommand.... |
#!/usr/bin/python
# created by shead
import sys
import numpy as np
import matplotlib.pyplot as plt
import pylab
"""
USAGE
============
./plotter.py [log]
./plotter.py my_log.log
REQUIRED DEPENDENCIES
============
* Python2
* Matplot http://matplotlib.org/users/installing.html
FILE FORMAT
============
[iterat... |
from meshless.espim.plate2d_add_k0s_cell_based import add_k0s as add_k0s_cell
from meshless.espim.plate2d_add_k0s_cell_based_no_smoothing import add_k0s as add_k0s_cell_no_smoothing
from meshless.espim.plate2d_add_k0s_edge_based import add_k0s as add_k0s_edge
def add_k0s(k0, mesh, prop_from_node, method='cell-based', ... |
# 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... |
"""
Tests for testing the modulestore settings migration code.
"""
import copy
import ddt
from tempfile import mkdtemp
from unittest import TestCase
from xmodule.modulestore.modulestore_settings import (
convert_module_store_setting_if_needed,
update_module_store_settings,
get_mixed_stores,
)
@ddt.ddt
cl... |
import unittest
from hustle.core.column_fn import ip_ntoa
from hustle.core.pipeline import SelectPipe, _get_sort_range
from hustle.core.marble import Marble
from operator import itemgetter
EMP_FIELDS = ("+@2id", "+$name", "+%2hire_date", "+@4salary", "+@2department_id")
DEPT_FIELDS = ("+@2id", "+%2name", "+%2building... |
# 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... |
# Copyright 2014 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 telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SimplePage(page_module.Page):
def __init__(se... |
""" Test Iterator Length Transparency
Some functions or methods which accept general iterable arguments have
optional, more efficient code paths if they know how many items to expect.
For instance, map(func, iterable), will pre-allocate the exact amount of
space required whenever the iterable can report its length.
T... |
#!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <[EMAIL]>
from __future__ import print_function
from capstone import *
import binascii
from xprint import to_x, to_hex, to_x_32
X86_CODE32 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00\x00\x91\x92"
RANDOM_CODE = b"\xed\x00\x00\x00\x00\x1a... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... |
import datetime
class Participant:
def __init__(self):
self.name = ""
self.isStillIn = True
self.hasCheckedIn = False
self.relapseDate = None
@property
def hasRelapsed(self):
return self.relapseDate is not None
def setFromLine(self, lineString):
# form... |
import struct
import unittest
from collections import OrderedDict
from oppy.cell.fixedlen import (
FixedLenCell,
Create2Cell,
Created2Cell,
CreatedFastCell,
CreatedCell,
CreateFastCell,
CreateCell,
DestroyCell,
EncryptedCell,
NetInfoCell,
PaddingCell,
)
from oppy.cell.util ... |
"""."""
import time as _time
import numpy as _np
from epics import PV
from apsuite.optimization import SimulAnneal
from siriuspy.devices import Tune, TuneCorr, CurrInfoSI
from ..utils import MeasBaseClass as _BaseClass, \
ParamsBaseClass as _ParamsBaseClass
class InjSIParams(_ParamsBaseClass):
"""."""
de... |
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
"""
classes to manage the cfme test framework configuration
"""
import os
import warnings
import attr
import yaycl
class Configuration(object):
"""
holds the current configuration
"""
def __init__(self):
self.yaycl_config = None
def configure(self, config_dir, crypt_key_file=None):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ruggero Marchei <[EMAIL]>
# (c) 2015, Brian Coca <[EMAIL]>
#
# This file is part of Ansible
#
# Ansible 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, ei... |
# Copyright (C) 2010 Wil Mahan <[EMAIL]>
#
# This file is part of FatICS.
#
# FatICS 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 ver... |
# 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... |
# 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... |
# (c) 2012-2014, Michael DeHaan <[EMAIL]>
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
... |
"""
Oracle database specific implementations of changeset classes.
"""
import sqlalchemy as sa
from sqlalchemy.databases import oracle as sa_base
from migrate import exceptions
from migrate.changeset import ansisql, SQLA_06
if not SQLA_06:
OracleSchemaGenerator = sa_base.OracleSchemaGenerator
else:
Oracle... |
#
# (c) 2015 Peter Sprygada, <[EMAIL]>
# (c) 2017 Red Hat, Inc
#
# Copyright (c) 2016 Dell Inc.
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible... |
# Copyright (C) 2007-2010 Samuel Abels.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... |
# -*- coding: utf8 -*-
"""Tests for distutils.dist."""
import os
import StringIO
import sys
import unittest
import warnings
import textwrap
from distutils.dist import Distribution, fix_help_options
from distutils.cmd import Command
import distutils.dist
from test.test_support import TESTFN, captured_stdout, run_unitt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright <2013> Suneel Chakravorty <[EMAIL]>
#
# This program 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 3 of the License, or
# (at your op... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.