content string |
|---|
# -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from operator import itemgetter
# Django
from django import forms
# Za... |
"""
This module provides various representations of transformed structures. A
TransformedStructure is a structure that has been modified by undergoing a
series of transformations.
"""
import os
import re
import json
import datetime
from monty.json import MontyDecoder, jsanitize
from pymatgen.core.structure import St... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
js_to_json,
remove_end,
)
class HellPornoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hellporno\.com/videos/(?P<id>[^/]+)'
_TEST = {
'url': 'http://hellporno.com/videos/dixie-is-... |
#!/usr/bin/env python
import os
import re
import shutil
import subprocess
import sys
import stat
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
get_target_arch, get_chromedriver_version
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
... |
from webkitpy.common.checkout.scm import CommitMessage
from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system.executive_mock import MockExecutive
class MockSCM(object):
def __init__(self, filesystem=None, executive=None):
self.checkout_root = "/mock-checkout"
... |
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import syscall_name
usage = "perf script -s syscall-counts.py [comm]\n";
for_comm = None
if len(sys.argv) > 2:
sys.exit(usage)
if ... |
import tensorflow as tf
import numpy as np
class BaseController:
def __init__(self, input_size, output_size, memory_read_heads, memory_word_size, batch_size=1):
"""
constructs a controller as described in the DNC paper:
http://www.nature.com/nature/journal/vaop/ncurrent/full/nature20101.ht... |
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
... |
from __future__ import (absolute_import, division, print_function)
import json
from units.compat.mock import patch
from ansible.modules.network.nso import nso_verify
from . import nso_module
from .nso_module import MockResponse
from units.modules.utils import set_module_args
class TestNsoVerify(nso_module.TestNsoM... |
"""Load / save to libwww-perl (LWP) format files.
Actually, the format is slightly extended from that used by LWP's
(libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information
not recorded by LWP.
It uses the version string "2.0", though really there isn't an LWP Cookies
2.0 format. This indicates that ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, 7):
pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7")
from ansible.module_utils.basic import AnsibleModule
try:
from librar... |
"""
StateCoverage: choose the (aname, args) whose next state has been used least
"""
import sys
import random
# Tester state is a bag of states: [ ( state , n of times used ), ... ]
# Implement bag of states as list of pairs, not dictionary with state keys
# because our states are themselves dictionaries, w... |
"""This module attaches the HDF5 input output methods to the TimeSeries.
"""
from astropy import units
from ...io import registry as io_registry
from ...io.hdf5 import (identify_hdf5, with_read_hdf5, with_write_hdf5)
from ...types.io.hdf5 import (read_hdf5_array, write_hdf5_series)
from .. import (TimeSeries, TimeSer... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
from ansible.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
import pytest
try:
from ansible.modules.network.fortimanager import fmgr_fwpol_package
except ImportError:
pytes... |
import datetime
import json
from nose.tools import eq_, ok_, assert_raises
from django.contrib.auth.models import User, Permission
from django.conf import settings
from django.test.client import RequestFactory
from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.sessions.middleware ... |
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_wants_static_library_dependencies_adjusted = False
generator_default_variables = {
}
for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT... |
import argparse
import logging
import os
import sys
from pyprint.ConsolePrinter import ConsolePrinter
from coala_utils.FilePathCompleter import FilePathCompleter
from coala_utils.Question import ask_question
from coala_quickstart import __version__
from coala_quickstart.interaction.Logo import print_welcome_message
... |
import os
import sys
import re
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):... |
"""Tests for baremetal volume driver."""
from oslo.config import cfg
from nova import exception
from nova import test
from nova.virt.baremetal import volume_driver
from nova.virt import fake
from nova.virt.libvirt import volume as libvirt_volume
CONF = cfg.CONF
SHOW_OUTPUT = """Target 1: iqn.2010-10.org.openstack:v... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
import json
from ansible.module_utils.basic import AnsibleModule
def image_exists(module, executable, name):
com... |
"""
Utility functions for generating "lorem ipsum" Latin text.
"""
from __future__ import unicode_literals
import random
COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ... |
import frappe
from frappe import _
change_icons_map = [
{
"module_name": "Patient",
"color": "#6BE273",
"icon": "fa fa-user",
"doctype": "Patient",
"type": "link",
"link": "List/Patient",
"label": _("Patient")
},
{
"module_name": "Patient Encounter",
"color": "#2ecc71",
"icon": "fa fa-stethoscop... |
"""
Low-level helpers for the SecureTransport bindings.
These are Python functions that are not directly related to the high-level APIs
but are necessary to get them to work. They include a whole bunch of low-level
CoreFoundation messing about and memory management. The concerns in this module
are almost entirely abou... |
import hashlib
from twisted.internet import reactor
from autobahn.twisted.websocket import WebSocketServerFactory, \
WebSocketServerProtocol, \
listenWS
class FrameBasedHashServerProtocol(WebSocketServerProtocol):
"""
Frame... |
from nova.tests.functional.api_sample_tests import test_servers
import nova.tests.functional.api_samples_test_base as astb
def fake_get(*args, **kwargs):
nova_group = {}
nova_group['id'] = 1
nova_group['description'] = 'default'
nova_group['name'] = 'default'
nova_group['project_id'] = astb.PROJEC... |
"""xcom dag task indices
Revision ID: 8504051e801b
Revises: 4addfa1236f1
Create Date: 2016-11-29 08:13:03.253312
"""
# revision identifiers, used by Alembic.
revision = '8504051e801b'
down_revision = '4addfa1236f1'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade()... |
import operator
import itertools
import numpy as np
import scipy.optimize
from core import cal_thermal_noise, cal_umi_nlos, cal_umi_exp_los
from functools import reduce
def _sum(func, *args):
return reduce(operator.add, map(func, *args), 0)
def cal_D2D_basic_tp(d2d_ues, g_d2d_bs, kappa, bw, alpha, freq):
"... |
import os
import sys
target = sys.argv[1]
if not os.path.isdir(target):
print >>sys.stderr, "Directory doesn't exist: ", target
os.mkdir(target)
if os.listdir(target) == []:
print >>sys.stderr, "Directory is empty: ", target
fileName = os.path.join(target, "submissionDocumentation.log")
f = open(fil... |
'''
SpeedWatch.io resolveurl plugin
Copyright (C) 2019 gujal
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 option) any later version.
This program is d... |
'''
anitya tests of the plugins.
'''
__requires__ = ['SQLAlchemy >= 0.7']
import pkg_resources
import datetime
import unittest
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(
os.path.abspath(__file__)), '..'))
import anitya.lib.plugins as plugins
from tests import Modeltests
class Plugin... |
'''
<Loads Stanford backbone network into appropriate objects (e.g. emulated_tf)>
Copyright 2012, Stanford University. This file is licensed under GPL v2 plus
a special exception, as described in included LICENSE_EXCEPTION.txt.
Created on Aug 13, 2011
@author: Peyman Kazemian
'''
from headerspace.tf ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Copyright 2019 Palo Alto 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 ... |
"""Unittests for heapq."""
import sys
import random
import unittest
from test import support
from unittest import TestCase, skipUnless
py_heapq = support.import_fresh_module('heapq', blocked=['_heapq'])
c_heapq = support.import_fresh_module('heapq', fresh=['_heapq'])
# _heapq.nlargest/nsmallest are saved in heapq._... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
determine_protocol,
parse_duration,
int_or_none,
)
class Lecture2GoIE(InfoExtractor):
_VALID_URL = r'https?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(... |
"""ACME JSON fields."""
import logging
import pyrfc3339
from acme import jose
logger = logging.getLogger(__name__)
class Fixed(jose.Field):
"""Fixed field."""
def __init__(self, json_name, value):
self.value = value
super(Fixed, self).__init__(
json_name=json_name, default=val... |
import py
import timeit
class Listdir:
numiter = 100000
numentries = 100
def setup(self):
tmpdir = py.path.local.make_numbered_dir(self.__class__.__name__)
for i in range(self.numentries):
tmpdir.join(str(i))
self.tmpdir = tmpdir
def run(self):
return self.... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
try:
from ansible.module_utils.network.avi.avi import (
avi_common_argument_spec, HAS_AVI, avi_ansible_api)
except ... |
from openerp.osv import fields,osv,orm
from openerp.tools.translate import _
class project_issue(osv.osv):
_inherit = 'project.issue'
_description = 'project issue'
_columns = {
'timesheet_ids': fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
'analytic_account_id': field... |
"""
This module implements Pauli algebra by subclassing Symbol. Only algebraic
properties of Pauli matrices are used (we don't use the Matrix class).
See the documentation to the class Pauli for examples.
See also:
http://en.wikipedia.org/wiki/Pauli_matrices
"""
from sympy import Symbol, I
def delta(i,j):
i... |
"""Validators for ``pci_passthrough`` namespaced extra specs."""
from nova.api.validation.extra_specs import base
EXTRA_SPEC_VALIDATORS = [
base.ExtraSpecValidator(
name='pci_passthrough:alias',
description=(
'Specify the number of ``$alias`` PCI device(s) to attach to the '
... |
import posixpath
import sys
from file_system import FileSystem, StatInfo, FileNotFoundError
from future import Future
from path_util import IsDirectory, ToDirectory
from third_party.json_schema_compiler.memoize import memoize
class CachingFileSystem(FileSystem):
'''FileSystem which implements a caching layer on to... |
from smart.option import OptionParser
from smart.const import NEVER
from smart import *
import string
import time
import re
USAGE=_("smart update [options] [channelalias] ...")
DESCRIPTION=_("""
This command will update the known information about the
given channels. If no channels are given, all channels
which are n... |
"""
Test the PB change source.
"""
import mock
from twisted.trial import unittest
from twisted.internet import defer
from buildbot.changes import pb
from buildbot.test.util import changesource, pbmanager
from buildbot.util import epoch2datetime
class TestPBChangeSource(
changesource.ChangeSourceMixin,
... |
"""SCons.Variables.PathVariable
This file defines an option type for SCons implementing path settings.
To be used whenever a a user-specified path override should be allowed.
Arguments to PathVariable are:
option-name = name of this option on the command line (e.g. "prefix")
option-help = help string for optio... |
"""plot_income_scaling.py
Plot the number of households from a given class as a function of the total
number of households per city
"""
import csv
import math
from matplotlib import pylab as plt
from scipy.stats import linregress
colours = {'Lower':'#4F8F6B',
'Higher':'#C1A62E',
'Middle':'#4B453C'}
... |
"""
Mozilla Persona authentication backend, docs at:
http://psa.matiasaguirre.net/docs/backends/persona.html
"""
from social.utils import handle_http_errors
from social.backends.base import BaseAuth
from social.exceptions import AuthFailed, AuthMissingParameter
class PersonaAuth(BaseAuth):
"""BrowserID authen... |
{
"name": "Hr Payroll Cancel",
"version": "1.0",
"author": "Vauxoo",
"category": "Localization/Mexico",
"description": """
This module change the workflow from hr.payslip to can cancel after to confirm this
""",
"website": "http://www.vauxoo.com/",
"license": "AGPL-3",
"de... |
"""
Mixin class that provides authoring capabilities for XBlocks.
"""
import logging
from django.conf import settings
from xblock.core import XBlock
from xblock.fields import XBlockMixin
from xblock.fragment import Fragment
log = logging.getLogger(__name__)
VISIBILITY_VIEW = 'visibility_view'
@XBlock.needs("i18n... |
''' Guide renderers for various kinds of axes that can be added to
Bokeh plots
'''
#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __future__ import absolute_import, division, print_functio... |
from django.apps import apps
from django.db import DEFAULT_DB_ALIAS, router
from django.utils import six
from django.utils.six.moves import input
def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS, **kwargs):
"""
Creates content types for models in the given app, removin... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Verify that when a source file is generated and the -j option is used,
the source file correctly gets re-scanned for implicit dependencies
after it's built.
"""
import TestSCons
test = TestSCons.TestSCons()
test.write('SConstruct', """\
env = Environ... |
import gettext
import logging
from collections import namedtuple, OrderedDict
log = logging.getLogger(__name__)
def install(locale_code):
try:
translations = gettext.translation(
'canute', localedir='ui/locale', languages=[locale_code],
fallback=False
)
except OSError ... |
# EndlessScroll.py
# Objective: Make an endless scrollable world.
# Imports
import pygame
# Start PyGame
pygame.init()
# Define Colors
black = [0, 0 ,0]
white = [255, 255, 255]
blue = [ 0, 0 , 255]
green = [ 0, 255, 0]
red = [255, 0, 0]
class Block(pygame.sprite.Sprite):
def __init__(self, locX, locY, img):
# C... |
from __future__ import unicode_literals
from .common import InfoExtractor
class FiveMinIE(InfoExtractor):
IE_NAME = '5min'
_VALID_URL = r'(?:5min:|https?://(?:[^/]*?5min\.com/|delivery\.vidible\.tv/aol)(?:(?:Scripts/PlayerSeed\.js|playerseed/?)?\?.*?playList=)?)(?P<id>\d+)'
_TESTS = [
{
... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.rust
~~~~~~~~~~~~~~~~~~~~
Lexers for the Rust language.
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, words, default
from pygments... |
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from d... |
from .resource import Resource
class RecoverResponse(Resource):
"""Response for an app recovery request.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource Id.
:vartype id: str
:param name: Resource Name.
:type name: str
:param ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
import logging
import traceback
import time
from google.appengine.api import app_identity, mail, capabilities
from google.appengine.runtime import DeadlineExceededError
from tekton.router import PathNotFound
def get_apis_st... |
import ui
import graphics
import time
import contextlib
from ui import stream
from ui import ctrl
from client import freeciv
SELECT_POPUP = 0
class MapWidget(ui.Widget):
def __init__(self, client):
self.client = client
self.size = (0, 0)
self.drawer = TileDrawer(client)
self.tile_... |
from django.db import connection
from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite
from django.utils import unittest
test_srs = ({'srid' : 4326,
'auth_name' : ('EPSG', True),
'auth_srid' : 4326,
'srtext' : 'GEOGCS["WGS 84",DATUM["WGS_1984",S... |
"""This demo program computes the value of the functional
M(v) = int v^2 + (grad v)^2 dx
on the unit square for v = sin(x) + cos(y). The exact
value of the functional is M(v) = 2 + 2*sin(1)*(1 - cos(1))
The functional M corresponds to the energy norm for a
simple reaction-diffusion equation."""
# Copyright (C) ... |
"""Request handlers for the OAuth authorization process."""
__author__ = 'Ka-Ping Yee <<EMAIL>>'
from google.appengine.ext import db
import datetime
import latitude
import model
import oauth
import oauth_webapp
import utils
class RegisterHandler(utils.Handler):
"""Registration and Latitude API authorization for... |
import os
import math
import cPickle as pickle
import random
import collections
def save_file(data, filename):
"""
Save data into pickle format.
data: the data to save.
filename: the output filename.
"""
pickle.dump(data, open(filename, 'wb'), protocol=pickle.HIGHEST_PROTOCOL)
def save_list(... |
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import ckanext.resourceproxy.plugin as proxy
import ckan.lib.datapreview as datapreview
from ckan.common import json
class GeojsonviewPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer, inherit=True)
plugins.implements(... |
def getSocialData(post):
# Get Thread Object
threadObject = post["thread"]
domain_rank = threadObject["domain_rank"] #domain_rank
#print 'domain_rank:' + str(domain_rank)
socialObject = threadObject["social"] #social data object
facebookData = socialObject["facebook"] #facebook data
#print 'facebook data:... |
# -*- coding: utf-8 -*-
"""
Unit tests for preview.py
"""
import unittest
from calc import preview
import pyparsing
class LatexRenderedTest(unittest.TestCase):
"""
Test the initializing code for LatexRendered.
Specifically that it stores the correct data and handles parens well.
"""
def test_sim... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from ansible.compat.tests.mock import patch
from ansible.modules.network.nxos import nxos_system
from .nxos_module import TestNxosModule, load_fixture, set_module_args
class TestNxosSystemModule(TestNxosModule):
... |
# -*- coding: utf-8 -*-
"""
content.py
~~~~~~
:copyright: (c) 2014 by @zizzamia
:license: BSD (See LICENSE for details)
"""
from flask import (Blueprint, abort, request, session, g, current_app,
render_template, send_from_directory)
# Imports inside Bombolone
import bombolone.model.pa... |
import argparse
import re
import sys
USAGE = """find_used_resources.py [-h] [-i INPUT] [-o OUTPUT]
Outputs the sorted list of resource ids that are part of unknown pragma warning
in the given build log.
This script is used to find the resources that are actually compiled in Chrome
in order to only include the needed... |
"""Contains helper functions and classes necessary for decoding data.
While data providers read data from disk, sstables or other formats, data
decoders decode the data (if necessary). A data decoder is provided with a
serialized or encoded piece of data as well as a list of items and
returns a set of tensors, each of... |
from __future__ import unicode_literals
import json
from django.test import TestCase
from django.test.client import RequestFactory
from rest_framework import generics, status, serializers
from rest_framework.compat import patterns, url
from rest_framework.tests.models import Anchor, BasicModel, ManyToManyModel, BlogPos... |
import multiprocessing
from six.moves import queue
DEBUG = True
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': '%(levelname)s %(message)s'
},
'standard': {
'format': '[%(asctime)s] %(levelname)s [%(name)s:%... |
"""The `interface.table_wait` test checks that waiting for a table returns when the table is available for writing."""
from __future__ import print_function
import multiprocessing, os, sys, time, traceback, pprint
startTime = time.time()
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pat... |
import logging
import pretend
import pytest
from pip._internal.cli.status_codes import NO_MATCHES_FOUND, SUCCESS
from pip._internal.commands import create_command
from pip._internal.commands.search import (
highest_version,
print_results,
transform_hits,
)
from tests.lib import pyversion
if pyversion >= ... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import traceback
from ansible.module_utils.basic import AnsibleModule
from ansible.module_u... |
"""Extended file operations available in POSIX.
f = posixfile.open(filename, [mode, [bufsize]])
will create a new posixfile object
f = posixfile.fileopen(fileobject)
will create a posixfile object from a builtin file object
f.file()
will return the original builtin file object
f.dup()
will r... |
import optparse
import shutil
import tempfile
import unittest2 as unittest
from webkitpy.common.host_mock import MockHost
from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system.executive_mock import MockExecutive2, ScriptError
from webkitpy.common.system.outputcapture import Outp... |
"""
Author: James Ma
Email stuff here: <EMAIL>
"""
"""
API doumentation:
https://www.interactivebrokers.com/en/software/api/apiguide/java/reqhistoricaldata.htm
https://www.interactivebrokers.com/en/software/api/apiguide/tables/tick_types.htm
"""
FIELD_BID_SIZE = 0
FIELD_BID_PRICE = 1
FIELD_ASK_PRICE = 2
FIELD_ASK_SIZ... |
"""
This module contains generic base85 encoding and decoding functions. The
whoosh.util.numeric module contains faster variants for encoding and
decoding integers.
Modified from:
http://paste.lisp.org/display/72815
"""
import struct
from whoosh.compat import xrange
# Instead of using the character set from the as... |
import os
import tempfile
import shutil
from collections import defaultdict
from cerbero.config import Architecture
from cerbero.ide.pkgconfig import PkgConfig
from cerbero.utils import shell
from cerbero.utils import messages as m
class FrameworkLibrary(object):
'''
Combine several shared library into a sin... |
#!/usr/bin/env python3
"""calculate BLEU scores
script taken from https://github.com/vikasnar/Bleu
and adjusted by Jörg Tiedemann
"""
import sys
import codecs
import os
import math
import operator
import json
import functools
def fetch_data(cand, ref):
""" Store each reference and candidate sentences as a lis... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['stableinterface'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.cloudstack import (
AnsibleCloudStack,
CloudStackException,
cs_argument_spec,
... |
"""GDB support for Chrome types.
Add this to your gdb by amending your ~/.gdbinit as follows:
python
import sys
sys.path.insert(0, "/path/to/tools/gdb/")
import gdb_chrome
end
This module relies on the WebKit gdb module already existing in
your Python path.
Use
(gdb) p /r any_variable
to print |any_varia... |
import re, time, random
from openerp import api
from openerp.osv import fields, osv
from openerp.tools.translate import _
import logging
from openerp.exceptions import UserError
_logger = logging.getLogger(__name__)
"""
account.invoice object:
- Add support for Belgian structured communication
- Ren... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
class Repository(object):
"""An artifact repository, such as a maven repo."""
def __init__(self, name=None, url=None, push_db_basedir=None, **kwargs):... |
# import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API
pytan_loc = "~/gh/pytan"
pytan_static_path =... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
import re
import json
from ansible.module_utils.basic import AnsibleModule
from ansible.modu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from logging import getLogger
from HTTPRequest import HTTPRequest
from HTTPDownload import HTTPDownload
class Browser(object):
__slots__ = ("log", "options", "bucket", "cj", "_size", "http", "dl")
def __init__(self, bucket=None, options={}):
self.log = ... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: aci_contract
short_description: Manage contract resources (v... |
import os
import time
from libcloud.loadbalancer.base import Member, Algorithm
from libcloud.loadbalancer.types import Provider, State
from libcloud.loadbalancer.providers import get_driver
def main():
cls = get_driver(Provider.RACKSPACE)
driver = cls('username', 'api key', region='ord')
balancers = dri... |
import re
BATCH_QUERY_REGEX = re.compile(r'Item\.(\d+)\.(.*)')
PUT_ATTRIBUTE_QUERY_REGEX = re.compile(r'Attribute\.(\d+)\.(Name|Value|Replace)')
DELETE_QUERY_ARG_REGEX = re.compile(r'Attribute\.(\d+)\.(Name|Value)')
EXPECTED_QUERY_ARG_REGEX = re.compile(r'Expected\.(\d+)\.(Name|Value|Exists)')
def extract_numbered_ar... |
from spack import *
class Pigz(MakefilePackage):
"""A parallel implementation of gzip for modern multi-processor,
multi-core machines."""
homepage = "http://zlib.net/pigz/"
url = "https://github.com/madler/pigz/archive/v2.3.4.tar.gz"
version('2.4', '3c8a601db141d3013ef9fe5f2daaf73f')
... |
"""Tests for adb."""
import cStringIO
import struct
import unittest
from adb import adb_commands
from adb import adb_protocol
import common_stub
BANNER = 'blazetest'
LOCAL_ID = 1
REMOTE_ID = 2
class BaseAdbTest(unittest.TestCase):
@classmethod
def _ExpectWrite(cls, usb, command, arg0, arg1, data):
usb.Ex... |
import simplejson as json
from mongrel2 import handler
import wsutil
import sys
import time
import re
sender_id = "82209006-86FF-4982-B5EA-D1E29E55D480"
conn = handler.Connection(sender_id, "tcp://127.0.0.1:9990",
"tcp://127.0.0.1:9989")
CONNECTION_TIMEOUT=5
closingMessages={}
badUnicode=... |
import logging
import psutil
import socket
from getpass import getuser
from random import choice
from tests.common.impala_service import *
from tests.util.shell_util import exec_process_async, exec_process
from time import sleep
logging.basicConfig(level=logging.ERROR, format='%(threadName)s: %(message)s')
LOG = logg... |
import os,sys,pdb
import argparse
ap = argparse.ArgumentParser()
ap.add_argument('--height','-H',help='input height',type=int)
ap.add_argument('--width','-W',help='input width',type=int)
ap.add_argument('--layers','-F',help='layer info txt with each line for one layer')
ap.add_argument('--deconv','-D',help='0 for con... |
import os
import subprocess
script_path = os.getcwd() + "/" + os.path.splitext(__file__)[0] + ".tcl"
script_file = open(script_path, "w+")
os.chdir("..")
project_path = os.getcwd()
script_file.write(
"######################################################\n" +
"# Generated file to open the virtual logic analyyer\... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*
import os
from app import create_app, db
from app.models import User, Role, Permission, Coupon, SecKill, Datemark
from flask_script import Manager, Shell
from flask_migrate import Migrate, MigrateCommand
app = create_app(os.getenv('ATH_CONFIG') or 'default')
manager = Manag... |
"""Model script to test TF-TensorRT integration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test_base as trt_test
from tensorflow.python.framework import con... |
from __future__ import absolute_import
import six
from collections import OrderedDict
from django.db.models import F
from rest_framework.response import Response
from sentry import tsdb
from sentry.api.base import StatsMixin
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.exceptions import Resou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.