code stringlengths 1 199k |
|---|
from __future__ import absolute_import, division, print_function
import unittest
import itertools
import six
import numpy as np
import pandas as pd
import numpy.testing as npt
from skbio import Sequence, DNA, RNA, Protein, TabularMSA
from skbio.util import OperationError, UniqueError
from skbio.util._testing import Rea... |
import logging
from django.conf import settings
from django.contrib.auth import login as auth_login
from django.contrib.auth import authenticate
from django.contrib.sites.models import get_current_site
from oscar.apps.customer.signals import user_registered
from oscar.core.compat import get_user_model
from oscar.core.l... |
from multiprocess import freeze_support as freezeSupport
from multiprocess.managers import BaseManager, BaseProxy
xrange = range
class Foo(object):
def f(self):
print('you called Foo.f()')
def g(self):
print('you called Foo.g()')
def _h(self):
print('you called Foo._h()')
def baz():
... |
from abc import ABCMeta, abstractmethod
import six
from whylog.config.utils import regex
from whylog.converters import CONVERTION_MAPPING, STRING
from whylog.converters.exceptions import UnsupportedConverterError
@six.add_metaclass(ABCMeta)
class AbstractParser(object):
@abstractmethod
def get_regex_params(self... |
from django.db import DatabaseError, InterfaceError
from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
class DatabaseFeatures(BaseDatabaseFeatures):
# Oracle crashes with "ORA-00932: inconsistent datatypes: expected - got
# BLOB" when grouping b... |
r"""
Ordination methods (:mod:`skbio.stats.ordination`)
==================================================
.. currentmodule:: skbio.stats.ordination
This module contains several ordination methods, including Principal
Coordinate Analysis, Correspondence Analysis, Redundancy Analysis and
Canonical Correspondence Analysi... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'DisplayFile'
db.delete_table('submission_displayfile')
def backwards(self, orm):
# Adding model 'DisplayF... |
"""
Tests for DateOffset additions over Daylight Savings Time
"""
from datetime import timedelta
import pytest
import pytz
from pandas._libs.tslibs import Timestamp
from pandas._libs.tslibs.offsets import (
BMonthBegin,
BMonthEnd,
BQuarterBegin,
BQuarterEnd,
BYearBegin,
BYearEnd,
CBMonthBegi... |
from django.conf.urls.defaults import *
urlpatterns = patterns('livesettings.views',
(r'^$', 'site_settings', {}, 'satchmo_site_settings'),
(r'^export/$', 'export_as_python', {}, 'settings_export'),
(r'^(?P<group>[^/]+)/$', 'group_settings'),
) |
from django.contrib.gis.gdal.error import OGRException
from django.utils import six
class OGRGeomType(object):
"Encapulates OGR Geometry Types."
wkb25bit = -2147483648
# Dictionary of acceptable OGRwkbGeometryType s and their string names.
_types = {0 : 'Unknown',
1 : 'Point',
... |
"""Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
>>> os.chdir(datadir)
"""
import os.path as op
import warnings
import nibabel as nb
import nump... |
"""Execute computations asynchronously using threads or processes."""
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
try:
from concurrent.futures import *
except ImportError:
from ._base import (FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
... |
from __future__ import print_function, division, unicode_literals
import os
from itertools import chain
import nltk
from nltk.internals import Counter
from nltk.compat import string_types
from nltk.tag import UnigramTagger, BigramTagger, TrigramTagger, RegexpTagger
from nltk.sem.logic import (Expression, Variable, Vari... |
"""
Django settings for chatbot_website project.
Generated by 'django-admin startproject' using Django 1.10.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import ... |
import urllib
from BeautifulSoup import BeautifulSoup
import re, htmlentitydefs
def unescape(text):
def fixup(m):
text = m.group(0)
if text[:2] == "&#":
# character reference
try:
if text[:3] == "&#x":
return unichr(int(text[3:-1], 16))
... |
import base64
import json
import logging
import urlparse
import werkzeug.urls
import urllib2
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_paypal.controllers.main import PaypalController
from openerp.osv import osv, fields
from openerp.tools.float_utils import fl... |
import unittest
from asq.queryables import Queryable
__author__ = "Robert Smallshire"
class TestToSet(unittest.TestCase):
def test_to_set(self):
a = [1, 2, 4, 8, 16, 32]
b = Queryable(a).to_set()
c = set([1, 2, 4, 8, 16, 32])
self.assertEqual(b, c)
def test_to_set_closed(self):
... |
import os
import glob
import json
import struct
import sqlite3
from collections import deque
class FifoMemoryQueue(object):
"""In-memory FIFO queue, API compliant with FifoDiskQueue."""
def __init__(self):
self.q = deque()
self.push = self.q.append
def pop(self):
q = self.q
r... |
"""
OMERO.fs MonitorServer module.
Copyright 2009 University of Dundee. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import logging
import sys, traceback
import socket
import omero_ext.uuid as uuid # see ticket:3774
try:
from hashlib import sha1 as sha
except:
fro... |
"""Groups Flask Blueprint."""
from sqlalchemy.exc import IntegrityError, SQLAlchemyError
from flask import (Blueprint, render_template, request, jsonify, flash,
url_for, redirect)
from flask_breadcrumbs import default_breadcrumb_root, register_breadcrumb
from flask_login import current_user, login_re... |
"""QGIS Unit tests for the OGR/GPKG provider.
.. note:: 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 2 of the License, or
(at your option) any later version.
"""
__author__ = 'Even R... |
traindat = '../data/fm_train_real.dat'
testdat = '../data/fm_test_real.dat'
parameter_list = [[traindat,testdat],[traindat,testdat]]
def distance_jensen (train_fname=traindat,test_fname=testdat):
from shogun import RealFeatures, JensenMetric, CSVFile
feats_train=RealFeatures(CSVFile(train_fname))
feats_test=RealFeat... |
from sys import version_info
if version_info[0] <= 2:
int2oct = chr
# noinspection PyPep8
ints2octs = lambda s: ''.join([int2oct(x) for x in s])
null = ''
oct2int = ord
# noinspection PyPep8
octs2ints = lambda s: [oct2int(x) for x in s]
# noinspection PyPep8
str2octs = lambda x: x
... |
from itertools import accumulate, starmap
from hypothesis import strategy
from hypothesis.specifiers import integers_in_range, just
from segpy.trace_header import TraceHeaderRev0
from segpy.util import batched
PRINTABLE_ASCII_RANGE = (32, 127)
def multiline_ascii_encodable_text(min_num_lines, max_num_lines):
"""A H... |
import mxnet as mx
from common import *
def detect_cycle_from(sym, visited, stack):
visited.add(sym.handle.value)
stack.add(sym.handle.value)
for s in sym.get_children():
if s.handle.value not in visited:
if detect_cycle_from(sym, visited, stack):
return True
elif... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import BaseHTTPServer
import os
import SocketServer
import unittest
from contextlib import closing, contextmanager
from threading import Thread
import mox
import reques... |
"""An implementation of the OpenID Provider Authentication Policy
Extension 1.0
@see: http://openid.net/developers/specs/
@since: 2.1.0
"""
__all__ = [
'Request',
'Response',
'ns_uri',
'AUTH_PHISHING_RESISTANT',
'AUTH_MULTI_FACTOR',
'AUTH_MULTI_FACTOR_PHYSICAL',
]
from openid.extension import Ex... |
from builtins import range
from airflow.operators import BashOperator, DummyOperator
from airflow.models import DAG
from datetime import datetime, timedelta
seven_days_ago = datetime.combine(datetime.today() - timedelta(7),
datetime.min.time())
args = {
'owner': 'airflow',
'sta... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import choice
from coevolution import Coevolution
class MultiPopulationCoevolution(Coevolution):
""" Coevolution with a number of independent populations. """
numPops = 10
def __str__(self):
return 'MultiPop'+str(self.numPops)+Coevolution.__str__(s... |
from __future__ import unicode_literals, print_function, absolute_import, division, generators, nested_scopes
import unittest
from jsonpath_rw.lexer import JsonPathLexer
from jsonpath_rw.parser import JsonPathParser
from jsonpath_rw.jsonpath import *
class TestParser(unittest.TestCase):
# TODO: This will be much mo... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class UnlikePost(Choreography):
def __init__(self, temboo_session):
"""
Create a new i... |
"""Functional tests for BiasAdd."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorfl... |
"""Tests for tf.contrib.kfac.fisher_blocks."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.kfac.python.ops import fisher_blocks as fb
from tensorflow.contrib.kfac.python.ops import layer_collection as lc
from ten... |
from mimes.image import IMAGE_MIMES
from mimes.audio import AUDIO_MIMES
from mimes.video import VIDEO_MIMES |
from cyder.cydns.srv.models import SRV
from cyder.api.v1.tests.base import APITests
class SRVAPI_Test(APITests):
__test__ = True
model = SRV
def create_data(self):
return SRV.objects.create(
ctnr=self.ctnr, description='SRV', ttl=420, label='_srv',
domain=self.domain, target=... |
from __future__ import absolute_import
import os
from . import config_option
from . import prompt
class TorchOption(config_option.FrameworkOption):
@staticmethod
def config_file_key():
return 'torch_root'
@classmethod
def prompt_title(cls):
return 'Torch'
@classmethod
def prompt_... |
from django.contrib import admin
from test_project.models import Post
admin.site.register(Post) |
import os
import shutil
srcRoot = "../../"
rpmRoot = "/usr/src/redhat/SOURCES/"
rpmBin = "/usr/src/redhat/RPMS/i386/"
rpmSource = "/usr/src/redhat/SRPMS/"
verFileName = srcRoot + "scintilla/version.txt"
vers = open(verFileName)
vFull = vers.read().strip()
vers.close()
vPoint = vFull[0] + "." + vFull[1:]
vComma = vFull[... |
import yaml
def set_module_field_in_file(yaml_file_path, module_name, field_name, new_val):
with open(yaml_file_path) as f:
yaml_text = f.read()
new_yaml_text = set_module_field(yaml_text, module_name,
field_name, new_val)
with open(yaml_file_path, "w") as f:
... |
from views import * |
"""This module contains a object that represents a Telegram GroupChat"""
from telegram import TelegramObject
class GroupChat(TelegramObject):
"""This object represents a Telegram GroupChat.
Attributes:
id (int):
title (str):
Args:
id (int):
title (str):
"""
def __init... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: bigip_trunk
short_description: Manage trunks on a BIG-IP
descr... |
"""delete nightly_builds from crontabber state
Revision ID: 4350f1383a9b
Revises: b91ff5f1954
Create Date: 2015-09-21 15:10:04.834907
"""
revision = '4350f1383a9b'
down_revision = 'b91ff5f1954'
from alembic import op
def upgrade():
op.execute("""
DELETE FROM crontabber WHERE app_name = 'nightly-builds-matvi... |
from __future__ import unicode_literals
from django.db import models
from django.shortcuts import get_object_or_404
from django.test import TestCase
from rest_framework import generics, renderers, serializers, status
from rest_framework.test import APIRequestFactory
from rest_framework.tests.models import BasicModel, C... |
from openerp.osv import fields,osv
import pooler
import netsvc
import time
from xml import dom
CODE_EXEC_DEFAULT = '''\
res = []
cr.execute("select id, code from account_journal")
for record in cr.dictfetchall():
res.append(record['code'])
result = res
'''
class accounting_assert_test(osv.osv):
_name = "account... |
from spack import *
class Sniffles(CMakePackage):
"""Structural variation caller using third generation sequencing."""
homepage = "https://github.com/fritzsedlazeck/Sniffles/wiki"
url = "https://github.com/fritzsedlazeck/Sniffles/archive/v1.0.5.tar.gz"
version('1.0.7', sha256='03fa703873bdf9c32055c... |
"""
Open Issues
@bug not all of a message is shown
@bug Buttons are too small
"""
import gobject
import gtk
import dbus
class _NullHildonModule(object):
pass
try:
import hildon as _hildon
hildon = _hildon # Dumb but gets around pyflakiness
except (ImportError, OSError):
hildon = _NullHildonModule
IS_HILDON_SUPPO... |
from __future__ import absolute_import, division, print_function
import pytest
import nacl.encoding
import nacl.hash
@pytest.mark.parametrize(("inp", "expected"), [
(
b"The quick brown fox jumps over the lazy dog.",
b"ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c",
),
(
... |
"""Functional tests for basic component wise operations using a GPU device."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import threading
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
from tensorfl... |
__author__ = 'sanyang' |
"""Tests closeness centrality algorithm for graphs"""
import unittest
from sparktkregtests.lib import sparktk_test
class ClosenessCentrality(sparktk_test.SparkTKTestCase):
def setUp(self):
edges = self.context.frame.create(
[(0, 1, 1),
(0, 2, 1),
(2, 3, 2),
(2... |
"""Provides device automations for homekit devices."""
from __future__ import annotations
from typing import Any
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.characteristics.const import InputEventValues
from aiohomekit.model.services import ServicesTypes
from aiohomekit.utils... |
import os
from django import http
from django import test as django_test
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.contrib.messages.storage import default_storage
from django.contrib.auth.middleware import AuthenticationMiddleware
from djang... |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
ht... |
from .plot_2d_separator import plot_2d_separator
from .plot_kneighbors_regularization import plot_kneighbors_regularization, \
plot_regression_datasets, make_dataset
from .plot_linear_svc_regularization import plot_linear_svc_regularization
from .plot_interactive_tree import plot_tree_interactive
from .plot_interac... |
'''
Created on Sep 17, 2010
@author: talbertc
'''
from core.modules.vistrails_module import Module
from PyQt4 import QtCore, QtGui
import csv
import utils
from utils import writetolog
import shutil
import os
from core.system import execute_cmdline
import subprocess
try:
_fromUtf8 = QtCore.QString.fromUtf8
except At... |
"""
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigured
... |
command = testshade("--raytype glossy --raytype_opt test") |
from unittest import TestCase
from preggy import expect
from thumbor.console import get_server_parameters
class ConsoleTestCase(TestCase):
def test_can_get_default_server_parameters(self):
params = get_server_parameters()
expect(params.port).to_equal(8888)
expect(params.ip).to_equal('0.0.0.0... |
"""
urlresolver XBMC Addon
Copyright (C) 2016 tknorris
Derived from Shani's LPro Code (https://github.com/Shani-08/ShaniXBMCWork2/blob/master/plugin.video.live.streamspro/unCaptcha.py)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public L... |
"""Documentation Flask Blueprint."""
from __future__ import unicode_literals
import os
from flask import Blueprint, abort, current_app, render_template, url_for
from flask.helpers import send_from_directory
from flask_breadcrumbs import current_breadcrumbs, default_breadcrumb_root, \
register_breadcrumb
from flask_... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_switch_controller_switch_interface_tag
short_descript... |
import capnp # For import hook
import numpy as np
import tempfile
import unittest
from mock import patch
from nupic.encoders.base import defaultDtype
from nupic.encoders.coordinate import CoordinateEncoder
from nupic.encoders.coordinate_capnp import CoordinateEncoderProto
class CoordinateEncoderTest(unittest.TestCase)... |
from weboob.deprecated.browser import Browser
import os
from uuid import uuid4
from urllib2 import Request
from urlparse import urljoin
from weboob.tools.json import json
from weboob.deprecated.browser.parsers.lxmlparser import LxmlHtmlParser
__all__ = ['UnseeBrowser']
def to_bytes(s):
if isinstance(s, unicode):
... |
"""numpy.distutils.fcompiler
Contains FCompiler, an abstract base class that defines the interface
for the numpy.distutils Fortran compiler abstraction model.
Terminology:
To be consistent, where the term 'executable' is used, it means the single
file, like 'gcc', that is executed, and should be a string. In contrast,
... |
import pytest
import psi4
import numpy as np
import re
from ast import literal_eval
import os
from distutils import dir_util
@pytest.fixture
def datadir(tmpdir, request):
"""
from: https://stackoverflow.com/a/29631801
Fixture responsible for searching a folder with the same name of test
module and, if a... |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
float_or_none,
int_or_none,
smuggle_url,
strip_or_none,
)
class TVAIE(InfoExtractor):
_VALID_URL = r'https?://videos?\.tva\.ca/details/_(?P<id>\d+)'
_TESTS = [{
'url': 'https://videos.tva.ca/d... |
def f():
print(f) |
"""
oauthlib.oauth1
~~~~~~~~~~~~~~
This module is a wrapper for the most recent implementation of OAuth 1.0 Client
and Server classes.
"""
from __future__ import absolute_import, unicode_literals
from .rfc5849 import Client
from .rfc5849 import SIGNATURE_HMAC, SIGNATURE_HMAC_SHA1, SIGNATURE_HMAC_SHA256, SIGNATURE_RSA, ... |
"""Module symbol-table generator"""
from . import ast
from .consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL, SC_UNKNOWN
from .misc import mangle
import types
import sys
MANGLE_LEN = 256
class Scope:
# XXX how much information do I need about each name?
def __init__(self, name, module, klass=None):
s... |
"""
Tests for twisted SSL support.
"""
from twisted.trial import unittest
from twisted.internet import protocol, reactor, interfaces, defer
from twisted.internet.error import ConnectionDone
from twisted.protocols import basic
from twisted.python import util
from twisted.python.runtime import platform
from twisted.test.... |
class FakeTI:
def __init__(self, **kwds):
self.__dict__.update(kwds)
def get_dagrun(self, _):
return self.dagrun
def are_dependents_done(self, session):
return self.dependents_done
class FakeTask:
def __init__(self, **kwds):
self.__dict__.update(kwds)
class FakeDag:
d... |
def getToken(adminUser, pw):
data = {'username': adminUser,
'password': pw,
'referer' : 'https://www.arcgis.com',
'f': 'json'}
url = 'https://www.arcgis.com/sharing/rest/generateToken'
jres = requests.post(url, data=data, verify=False).json()
return j... |
from keystoneclient import base
from keystoneclient import exceptions
from keystoneclient.openstack.common import timeutils
class Trust(base.Resource):
"""Represents a Trust.
Attributes:
* id: a uuid that identifies the trust
* impersonation: allow explicit impersonation
* project_id: pr... |
match x:
case Class('foo'
'<caret>bar'):
pass |
import numpy as np
import math
from numba import cuda, double, void
from numba.cuda.testing import unittest, CUDATestCase
RISKFREE = 0.02
VOLATILITY = 0.30
A1 = 0.31938153
A2 = -0.356563782
A3 = 1.781477937
A4 = -1.821255978
A5 = 1.330274429
RSQRT2PI = 0.39894228040143267793994605993438
def cnd(d):
K = 1.0 / (1.0 +... |
"""
digparser
---------
Encode/decode DNS packets from DiG textual representation. Parses
question (if present: +qr flag) & answer sections and returns list
of DNSRecord objects.
Unsupported RR types are skipped (this is different from the packet
parser which will store and encode the RDATA ... |
from ..construct import CString
from ..common.utils import roundup, struct_parse
from ..common.py3compat import bytes2str
from .constants import SH_FLAGS
class Segment(object):
def __init__(self, header, stream):
self.header = header
self.stream = stream
def data(self):
""" The segment d... |
"""
celery.backends.database.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Database tables for the SQLAlchemy result store backend.
"""
from __future__ import absolute_import
from datetime import datetime
import sqlalchemy as sa
from sqlalchemy.types import PickleType
from celery import states
from .session import... |
from misago.acl.providers import providers
def build_acl(roles):
"""
Build ACL for given roles
"""
acl = {}
for extension, module in providers.list():
try:
acl = module.build_acl(acl, roles, extension)
except AttributeError:
message = '%s has to define build_a... |
import sys
import math
if len(sys.argv) < 3:
print("Thermodynamic Integration with Numerical Derivative")
print("Trapezoidal integration of compute_fep results at equally-spaced points")
print("usage: nti.py temperature hderiv < out.fep")
sys.exit()
hderiv = float(sys.argv[2])
line = sys.stdin.readline(... |
import os
import shutil
import subprocess
import infra
class Builder(object):
def __init__(self, config, builddir, logtofile):
self.config = '\n'.join([line.lstrip() for line in
config.splitlines()]) + '\n'
self.builddir = builddir
self.logfile = infra.open_l... |
import json
import os
import shutil
import tempfile
import unittest
from avocado.utils import process
from avocado.utils import script
from virttest import data_dir
BASE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')
BASE_DIR = os.path.abspath(BASE_DIR)
TEST_STATUSES_PY = """from avocado.cor... |
import unittest
import psycopg2
import psycopg2.extras
import sys
sys.path.append("../")
from steersuite.OptimizationExperiment import OptimizationExperiment
ppr_param_xml_file = open("data/ppr-param-config.xml")
ppr_param_xml_data = ppr_param_xml_file.read()
O_ex = OptimizationExperiment(ppr_param_xml_data)
OptimParam... |
import ocl
import camvtk
import time
import vtk
import datetime
import math
def CLPointGrid(minx,dx,maxx,miny,dy,maxy,z):
plist = []
xvalues = [round(minx+n*dx,2) for n in xrange(int(round((maxx-minx)/dx))+1) ]
yvalues = [round(miny+n*dy,2) for n in xrange(int(round((maxy-miny)/dy))+1) ]
for y in yvalue... |
from __future__ import absolute_import
import json
from ...sql import elements
from ... import types as sqltypes
from ... import util
class JSON(sqltypes.JSON):
"""MySQL JSON type.
MySQL supports JSON as of version 5.7. Note that MariaDB does **not**
support JSON at the time of this writing.
The :class... |
import os
import re
import openerp
from openerp import SUPERUSER_ID, tools
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval as eval
from openerp.tools import image_resize_image
class multi_company_default(osv.osv):
"""
Manage multi company d... |
'''socket_options.py'''
from collections import namedtuple
from heron.common.src.python.utils.log import Log
import heron.common.src.python.constants as const
from heron.common.src.python.config import system_config
SocketOptions = namedtuple('Options', 'nw_write_batch_size_bytes, nw_write_batch_time_ms, '
... |
"""Tests for templates module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gast
from tensorflow.python.autograph.pyct import anno
from tensorflow.python.autograph.pyct import origin_info
from tensorflow.python.autograph.pyct import parser
from t... |
import pprint
import sys
import properties
TEST_EMPTY = {
'in': {
'EMPTY_LIST': [],
'NONE': None,
'NONE_LIST': [None],
'STRING' : '',
'STRING_LIST' : [''],
},
'out': {
'EMPTY_LIST': [],
'NONE': [None],
'NONE_LIST': [None],
'STRING' : [''],
'STRING_LIST' : [''],
}
}
TEST_C... |
import xlsxwriter
workbook = xlsxwriter.Workbook('panes.xlsx')
worksheet1 = workbook.add_worksheet('Panes 1')
worksheet2 = workbook.add_worksheet('Panes 2')
worksheet3 = workbook.add_worksheet('Panes 3')
worksheet4 = workbook.add_worksheet('Panes 4')
header_format = workbook.add_format({'bold': True,
... |
import logging
import time
import random
import aexpect
from autotest.client.shared import error
from autotest.client.shared import utils
from virttest import utils_test
from virttest import utils_net
def run(test, params, env):
"""
Nic bonding test in guest.
1) Start guest with four nic models.
2) Setu... |
import os
import stat
import sys
from ansible import constants as C
from ansible.cli import CLI
from ansible.errors import AnsibleError, AnsibleOptionsError
from ansible.executor.playbook_executor import PlaybookExecutor
from ansible.inventory import Inventory
from ansible.parsing import DataLoader
from ansible.parsing... |
"""Test pyflakes on stoq, stoqlib and plugins directories
Useful to early find syntax errors and other common problems.
"""
import _ast
import sys
import unittest
from testutils import SourceTest
from compat import skipIf
try:
from pyflakes import checker
except ImportError as err:
if sys.version_info >= (3,):
... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
xpath_text,
)
class AdultSwimIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?adultswim\.com/videos/(?P<is_playlist>playlists/)?(?P<show_path>[^... |
from django.conf import settings
from django.contrib import messages
from django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.http import require_POST
from django.db import transaction
from django.db.models import Max
from jsonview.decorators import json_view
from airmozilla.main.mo... |
import vtk
cone = vtk.vtkConeSource()
cone.SetHeight(3.0)
cone.SetRadius(1.0)
cone.SetResolution(10)
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInputConnection(cone.GetOutputPort())
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
ren1 = vtk.vtkRenderer()
ren1.AddActor(coneActor)
ren1.SetBackground(0.... |
"""
Utility functions for implementing Proof Key for Code Exchange (PKCE) by OAuth
Public Clients
See RFC7636.
"""
import base64
import hashlib
import os
def code_verifier(n_bytes=64):
"""
Generates a 'code_verifier' as described in section 4.1 of RFC 7636.
This is a 'high-entropy cryptographic random strin... |
DOCUMENTATION = '''
---
module: mongodb_user
short_description: Adds or removes a user from a MongoDB database.
description:
- Adds or removes a user from a MongoDB database.
version_added: "1.1"
options:
login_user:
description:
- The username used to authenticate with
required: fal... |
patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege',
'This command has to be run under ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.