content stringlengths 4 20k |
|---|
from __future__ import unicode_literals
from django.core.management import call_command
from django.db import connection
from django.test import TransactionTestCase, skipUnlessDBFeature
@skipUnlessDBFeature("gis_enabled")
class MigrateTests(TransactionTestCase):
"""
Tests running the migrate command in Geodj... |
from selenium.webdriver.common import by
from openstack_dashboard.test.integration_tests.pages import basepage
from openstack_dashboard.test.integration_tests.regions import forms
from openstack_dashboard.test.integration_tests.regions import tables
class ImageregistryPage(basepage.BaseNavigationPage):
_image_t... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
try:
import pyrax
HAS_PYRAX = True
except ImportError:
HAS_PYRAX = False
from ... |
from __future__ import unicode_literals, absolute_import
import json
from datetime import timedelta
from django.db import models
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now
from ch... |
# -*- coding: utf-8 -*-
import httplib
import time
conn = httplib.HTTPConnection("10.xxx.xxx.xxxx")
hue_uid = "c274b3c285d19cfxxxxxxxxxx"
restcmd = "/api"+hue_uid+"/lights"
str = " "
xhue = [10000,25000,46000,56280]
def shifthue() :
global str
global xhue
xhue.insert(0,xhue[-1])
xhue = xhue[0:4]
... |
import markdown
from markdown import etree
DEFAULT_URL = "http://www.freewisdom.org/projects/python-markdown/"
DEFAULT_CREATOR = "Yuri Takhteyev"
DEFAULT_TITLE = "Markdown in Python"
GENERATOR = "http://www.freewisdom.org/projects/python-markdown/markdown2rss"
month_map = { "Jan" : "01",
"Feb" : "02",
... |
"""Outputs host CPU architecture in format recognized by gyp."""
import platform
import re
import sys
def main():
print DoMain([])
return 0
def DoMain(_):
"""Hook to be called from gyp without starting a separate python
interpreter."""
host_arch = platform.machine()
host_system = platform.system();
#... |
"""
MySQL database specific implementations of changeset classes.
"""
import sqlalchemy
from sqlalchemy.databases import mysql as sa_base
from sqlalchemy import types as sqltypes
from migrate import exceptions
from migrate.changeset import ansisql
from migrate.changeset import util
MySQLSchemaGenerator = sa_bas... |
import novaclient.exceptions
from rally.benchmark.context import base
from rally.benchmark.context.cleanup import manager as resource_manager
from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils
from rally import osclients
LOG = logging.getLogger(__name__)
@base.co... |
import sys
import base64
__all__ = ['PY2', 'string_types', 'integer_types', 'text_type', 'bytes_types', 'bytes', 'long', 'input',
'decodebytes', 'encodebytes', 'bytestring', 'byte_ord', 'byte_chr', 'byte_mask',
'b', 'u', 'b2s', 'StringIO', 'BytesIO', 'is_callable', 'MAXSIZE', 'next']
PY2 = sys.v... |
"""
FR-specific Form helpers
"""
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_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_... |
# Avoid importing `importlib` from this package.
from __future__ import absolute_import
import copy
import os
import sys
import warnings
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.deprecation import RemovedInDjango19Warnin... |
import sys
import json
import time
import gc
import logging
import socket
import warnings
from requests.packages.urllib3 import exceptions
# import own modules
sys.path.append('./')
try:
from miniprobe import MiniProbe
import sensors
import requests
import multiprocessing
except Exception as e:
... |
#! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... |
"""Data types for Microsoft Windows consoles"""
# local imports
from lf.dtypes import LERecord, BERecord
from lf.win.dtypes import SHORT
__docformat__ = "restructuredtext en"
__all__ = [
"COORD_LE", "COORD_BE"
]
class COORD_LE(LERecord):
x = SHORT
y = SHORT
# end class COORD_LE
class COORD_BE(BERecord):... |
from __future__ import unicode_literals
from django.db.backends import BaseDatabaseIntrospection
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django Field types.
data_types_reverse = {
16: 'BooleanField',
20: 'BigIntegerField',
21: 'SmallIntegerField',
... |
"""Fixer for import statements.
If spam is being imported from the local directory, this import:
from spam import eggs
Becomes:
from .spam import eggs
And this import:
import spam
Becomes:
from . import spam
"""
# Local imports
from .. import fixer_base
from os.path import dirname, join,... |
"""This module contains the Question Model."""
__authors__ = [
'"Todd Larsen" <<EMAIL>>',
]
from google.appengine.ext import db
import soc.models.work
class Question(soc.models.work.Work):
"""Model of a Question, which is a specialized form of Work.
Specific types of Questions are actually implemented in s... |
# Initialize App Engine SDK if necessary
try:
from google.appengine.api import api_proxy_stub_map
except ImportError:
from .boot import setup_env
setup_env()
from djangoappengine.utils import on_production_server, have_appserver
DEBUG = not on_production_server
TEMPLATE_DEBUG = DEBUG
ROOT_URLCONF = 'urls... |
"""Dynamic collection API.
Dynamic collections act like Query() objects for read operations and support
basic add/delete mutation.
"""
from .. import log, util, exc
from ..sql import operators
from . import (
attributes, object_session, util as orm_util, strategies,
object_mapper, exc as orm_exc, properties
... |
# Django settings for fle_redesign project.
import os
try:
from local_settings import *
import local_settings
except ImportError:
local_settings = {}
def localor(setting_name, default_val):
"""Returns local_settings version if it exists (and is non-empty), otherwise uses default value"""
return h... |
"""
Test xblock/validation.py
"""
import unittest
from xblock.test.tools import assert_raises
from xmodule.validation import StudioValidationMessage, StudioValidation
from xblock.validation import Validation, ValidationMessage
class StudioValidationMessageTest(unittest.TestCase):
"""
Tests for `ValidationMe... |
from django.core.urlresolvers import reverse_lazy, reverse
from django.utils.translation import ugettext as _ # , ungettext
from django.utils.text import capfirst # , get_text_list
from django.contrib import messages
from django.views import generic
from django.http import HttpResponseRedirect, HttpResponse, JsonResp... |
from nose.tools import eq_
from kitsune.karma.helpers import karma_titles
from kitsune.karma.models import Title
from kitsune.users.tests import TestCase, user, group
class KarmaTitleHelperTests(TestCase):
def setUp(self):
super(KarmaTitleHelperTests, self).setUp()
self.user = user(save=True)
... |
#
# File: psychometrics/psychoanalyze.py
#
# generate pyschometrics plots from PsychometricData
from __future__ import division
import datetime
import logging
import json
import math
import numpy as np
from scipy.optimize import curve_fit
from django.conf import settings
from django.db.models import Sum, Max
from ... |
from __future__ import unicode_literals
import webnotes
from webnotes import _, msgprint
from webnotes.utils import flt
import time
from accounts.utils import get_fiscal_year
from controllers.trends import get_period_date_ranges, get_period_month_ranges
def execute(filters=None):
if not filters: filters = {}
colum... |
from __future__ import print_function
import argparse
import glob
import json
import mmap
import os
import re
import sys
parser = argparse.ArgumentParser()
parser.add_argument("filenames", help="list of files to check, all files if unspecified", nargs='*')
rootdir = os.path.dirname(__file__) + "/../../"
rootdir = os... |
"""Support for the PostgreSQL database via py-postgresql.
Connecting
----------
URLs are of the form ``postgresql+pypostgresql://user:password@host:port/dbname[?key=value&key=value...]``.
"""
from sqlalchemy import util
from sqlalchemy import types as sqltypes
from sqlalchemy.dialects.postgresql.base import PGDiale... |
import time
from openerp.osv import fields, osv
class account_analytic_cost_ledger_journal_report(osv.osv_memory):
_name = 'account.analytic.cost.ledger.journal.report'
_description = 'Account Analytic Cost Ledger For Journal Report'
_columns = {
'date1': fields.date('Start of period', required=T... |
import sys
sys.path.insert(0, "../../mxnet/python/")
import mxnet as mx
import numpy as np
import model_vgg19 as vgg
class PretrainedInit(mx.init.Initializer):
def __init__(self, prefix, params, verbose=False):
self.prefix_len = len(prefix) + 1
self.verbose = verbose
self.arg_params = {k :... |
data = (
'Tani ', # 0x00
'Jiao ', # 0x01
'[?] ', # 0x02
'Zhang ', # 0x03
'Qiao ', # 0x04
'Dun ', # 0x05
'Xian ', # 0x06
'Yu ', # 0x07
'Zhui ', # 0x08
'He ', # 0x09
'Huo ', # 0x0a
'Zhai ', # 0x0b
'Lei ', # 0x0c
'Ke ', # 0x0d
'Chu ', # 0x0e
'Ji ', # 0x0f
'Que ', # 0x10
'... |
import compileall
import imp
import os
import py_compile
import shutil
import struct
import tempfile
from test import test_support
import unittest
class CompileallTests(unittest.TestCase):
def setUp(self):
self.directory = tempfile.mkdtemp()
self.source_path = os.path.join(self.directory, '_test.... |
from django.utils.translation import activate
from haystack import indexes
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
from django.db.models import Q
import logging
from open_municipio.people.models import Institution, InstitutionCharge, Group,... |
#!/usr/bin/env python
from skimage._build import cython
import os.path
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('io', parent_package, top_pa... |
"""Demonstrate the Sankey class by producing three basic diagrams.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.sankey import Sankey
# Example 1 -- Mostly defaults
# This demonstrates how to create a simple diagram by implicitly calling the
# Sankey.add() method and by appending finish() to... |
import unittest
from biicode.common.dev.system_id import SystemID
from biicode.common.settings.version import Version
class SystemIDTest(unittest.TestCase):
def setUp(self):
self.sut = SystemID("open_gl", "CPP")
def test_set_generic_system(self):
self.sut.set_generic_system()
self.a... |
# -*- coding: utf-8 -*-
"""All exceptions for the github3 library."""
class GitHubError(Exception):
"""The base exception class."""
def __init__(self, resp):
super(GitHubError, self).__init__(resp)
#: Response code that triggered the error
self.response = resp
self.code = resp... |
{
"name": "Core extended",
"version": "2.0.13.0",
"author": "Didotech SRL",
"website": "http://www.didotech.com",
"category": "Base",
"description": """
Module extendes OpenERP core functionality:
ir_sequence - add functions:
current_number(cr, uid, sequence_id)
... |
# -----------------
# normal
# -----------------
a = ""
a = 1
#? int()
a
#? []
a.append
a = list
b = 1; b = ""
#? str()
b
# temp should not be accessible before definition
#? []
temp
a = 1
temp = b;
b = a
a = temp
#? int()
b
#? int()
b
#? str()
a
a = tuple
if 1:
a = list
#? ['append']
a.append
#? ['index']
a... |
__all__ = [
'DashApi',
]
try:
import simplejson as json
except ImportError:
import json
class DashApi(object):
def dashboard(self, dash_id):
"""
Return the dashboard with the given id.
See the `dashboard API documentation <http://docs.datadoghq.com/api/#dashboard>`_ for the
... |
"""
Extract a list of speech intervals from the given audio file,
using the MFCC energy-based VAD algorithm.
"""
from __future__ import absolute_import
from __future__ import print_function
import io
import sys
from aeneas.audiofile import AudioFileConverterError
from aeneas.audiofile import AudioFileNotInitializedEr... |
#!/usr/bin/env python3
import os
import time
import pprint
import twitter
import traceback
import rethinkdb as r
from secret import CONSUMER_KEY, CONSUMER_SECRET
def respond(text):
print('Got one: %r' % text)
# TODO
return None
def isAddressedToMe(tweet):
pprint.pprint(tweet)
return tweet['text']... |
# coding: utf-8
from flask import Blueprint, render_template, redirect, request
from flask_login import current_user, login_user
import usecase
web_views = Blueprint('user_web_views', __name__, template_folder='templates')
@web_views.route('/admin')
def admin():
values = {}
if not current_user.is_authentica... |
#! /usr/bin/env python
import sys
import os
gnuplot_scripts = []
def gen_stats_gnuplot(name, y, lines):
global gnuplot_scripts
stat = open(sys.argv[1])
line = stat.readline()
while not 'minute:' in line:
line = stat.readline()
names = line.strip().split(':')
counter = 1
for i in names:
print '%d: %s' % ... |
from django.shortcuts import render, get_object_or_404, redirect
from django.core.urlresolvers import reverse, reverse_lazy
from django.views.generic import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.views.generic.detail import DetailView
from .models import LdapMaill... |
from cStringIO import StringIO
from django import forms
from django.conf import settings
from django.utils.translation import trans_real as translation
import commonware
import requests
from jinja2.filters import do_dictsort
from PIL import Image
from rest_framework import serializers
from rest_framework.serializers ... |
from django.conf import settings
from django.contrib.comments.managers import CommentManager
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.db import models
from djan... |
from django.db import models
from djangotoolbox.fields import ListField
from copy import deepcopy
class ExtraFieldLookup():
def __init__(self, model=None, field_name=None, lookup_type=None,
field_to_add=models.CharField(max_length=500, editable=False, null=True)):
self.model = model
... |
VIRT_FAILED = 1
VIRT_SUCCESS = 0
VIRT_UNAVAILABLE=2
import sys
try:
import libvirt
except ImportError:
HAS_VIRT = False
else:
HAS_VIRT = True
try:
from lxml import etree
except ImportError:
HAS_XML = False
else:
HAS_XML = True
ALL_COMMANDS = []
ENTRY_COMMANDS = ['create', 'status', 'start', ... |
"""
Verifies that 'copies' with app bundles are handled correctly.
"""
import TestGyp
import os
import sys
import time
if sys.platform == 'darwin':
test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
test.run_gyp('framework.gyp', chdir='framework')
test.build('framework.gyp', 'copy_target', chdir='fra... |
import numpy
from trefoil.utilities.color import Color
from trefoil.render.renderers.stretched import StretchedRenderer
from trefoil.render.renderers.classified import ClassifiedRenderer
from trefoil.render.renderers.unique import UniqueValuesRenderer
from trefoil.render.renderers.utilities import get_renderer_b... |
"""
CorpusReader for the Opinion Lexicon.
- Opinion Lexicon information -
Authors: Minqing Hu and Bing Liu, 2004.
Department of Computer Sicence
University of Illinois at Chicago
Contact: Bing Liu, <EMAIL>
http://www.cs.uic.edu/~liub
Distributed with permission.
Related papers:
- Minqing Hu and Bing... |
# Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
import os, sys
APP = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJ_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.append(APP)
ADMINS = (
# ('Your Name', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'de... |
"""Tests the text output of Google C++ Testing Framework.
SYNOPSIS
gtest_output_test.py --build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gtest_output_test_ file.
gtest_output_test.py --gengolden
gtest_output_test.py
"""
__author__ = '<EMAIL> (Zhanyong Wan)'
import ... |
from PyQt5.QtCore import *
from types import MethodType
_QVariant__repr__ = QVariant.__repr__
_QVariant__eq__ = QVariant.__eq__
_QVariant__ne__ = QVariant.__ne__
_QVariant__hash__ = QVariant.__hash__
def __bool__(self):
return not self.isNull()
def __repr__(self):
if self.isNull():
return 'NULL'
... |
"""Tests for ragged_array_ops.concat."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from tensorflow.python.framework... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: vultr_server_facts
deprecated:
removed_in: '2.13'
w... |
from os import path
from urlparse import urlparse
from random import sample, randrange
from jinja2 import Environment, FileSystemLoader
from werkzeug.local import Local, LocalManager
from werkzeug.utils import cached_property
from werkzeug.wrappers import Response
from werkzeug.routing import Map, Rule
from sqlalchemy ... |
from sympy.mpmath import *
def test_approximation():
mp.dps = 15
f = lambda x: cos(2-2*x)/x
p, err = chebyfit(f, [2, 4], 8, error=True)
assert err < 1e-5
for i in range(10):
x = 2 + i/5.
assert abs(polyval(p, x) - f(x)) < err
def test_limits():
mp.dps = 15
assert limit(lamb... |
import sys
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
try:
dataFileName = sys.argv[1]
except IndexError:
print("USAGE: python plotEnergies.py 'filename'")
sys.exit(0)
HFEnergy3 = 3.161921401722216
HFEnergy6 = 20.71924844033019
numPart... |
""" Usage: make_intl_data.py [language-subtag-registry.txt]
This script extracts information about mappings between deprecated and
current BCP 47 language tags from the IANA Language Subtag Registry and
converts it to JavaScript object definitions in IntlData.js. The definitions
are used in Intl.js.
... |
# Getting started with APIC-EM APIs
# First Call to APIC-EM REST API - "Hello World"
# * THIS SAMPLE APPLICATION AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
# * OF ANY KIND BY CISCO, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
# * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICUL... |
from decimal import Decimal as D
import datetime
from django.test import TestCase
from oscar.apps.offer import models
from oscar.core.compat import get_user_model
User = get_user_model()
class TestADateBasedConditionalOffer(TestCase):
def setUp(self):
self.start = datetime.date(2011, 1, 1)
se... |
"""Tests for media.models."""
# pylint: disable=maybe-no-member, too-many-instance-attributes
from base64 import urlsafe_b64encode
from unittest import skipIf
import hashlib
import os
import re
from django.core.files import File
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from... |
dataTypes = ["CPTUndefinedDataType", "CPTIntegerDataType", "CPTUnsignedIntegerDataType", "CPTFloatingPointDataType", "CPTComplexFloatingPointDataType", "CPTDecimalDataType"]
types = { "CPTUndefinedDataType" : [],
"CPTIntegerDataType" : ["int8_t", "int16_t", "int32_t", "int64_t"],
"CPTUnsignedIntegerDat... |
from django.conf import settings
from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.gdal import OGRGeomType
from django.contrib.gis.db import models
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographi... |
import numpy as np
from .base import HomogFamilyAlignment
from .affine import DiscreteAffine, Affine
from .similarity import Similarity
def Scale(scale_factor, n_dims=None):
r"""
Factory function for producing Scale transforms. Zero scale factors are not
permitted.
A :class:`UniformScale` will be pr... |
from gnuradio import gr, audio, uhd
from gnuradio import blocks
from gnuradio import filter
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
from gnuradio import blocks
from gnuradio import digital
from gnuradio import vocoder
import random
import struct
i... |
#!/usr/bin/python
"""Pulls nRF51 IDs from openocd's nrf51.c in a form suitable for
pasting into blackmagic's nrf51.c
"""
import subprocess,re
cmd = 'git archive --remote=git://git.code.sf.net/p/openocd/code HEAD src/flash/nor/nrf51.c | tar -xO'
class Spec():
def __repr__(self):
return "0x%04X: /* %s %s... |
"""Pycuda based
"""
import pycuda.driver
from pycuda.elementwise import ElementwiseKernel
from pycuda.reduction import ReductionKernel
from pycuda.tools import get_or_register_dtype
from pycuda.tools import context_dependent_memoize
from pycuda.tools import dtype_to_ctype
from pytools import match_precision
from pycud... |
# -*- coding: utf-8 -*-
import sys
import cs
def main():
"""
Rotina principal.
"""
# Lê arquivo de dados.
filename = sys.argv[1] if len(sys.argv) > 1 else 'input.dat'
file = open(filename, 'r')
data = file.read()
lines = data.split("\n")
wlims = [int(s) for s in lines[0].split("... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.... |
"""
A second, custom AdminSite -- see tests.CustomAdminSiteTests.
"""
from django.conf.urls.defaults import patterns
from django.contrib import admin
from django.http import HttpResponse
import models, forms
class Admin2(admin.AdminSite):
login_form = forms.CustomAdminAuthenticationForm
login_template = 'cust... |
from pandas.core.api import Series
from pandas.stats.ols import OLS, MovingOLS
from pandas.stats.plm import PanelOLS, MovingPanelOLS, NonPooledPanelOLS
import pandas.stats.common as common
def ols(**kwargs):
"""Returns the appropriate OLS object depending on whether you need
simple or panel OLS, and a... |
from django.db import models
from django.utils import timezone
from edc_base.model.models import BaseUuidModel
from edc_export.models import ExportTrackingFieldsMixin
from edc_sync.models import SyncModelMixin, SyncHistoricalRecords
from ..managers import OrderItemManager
from .aliquot import Aliquot
from .order imp... |
import sys
import atlas_client_cmdline as cmdline
import atlas_config as mc
def main():
conf_dir = cmdline.setup_conf_dir()
jvm_opts_list = cmdline.setup_jvm_opts_list(conf_dir, 'atlas_kafka_setup_hook.log')
atlas_classpath = cmdline.get_atlas_hook_classpath(conf_dir)
topics_array = mc.get_topics_to_cr... |
"""
Classes to represent the definitions of aggregate functions.
"""
class Aggregate(object):
"""
Default Aggregate definition.
"""
def __init__(self, lookup, **extra):
"""Instantiate a new aggregate.
* lookup is the field on which the aggregate operates.
* extra is a diction... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(__, isinstance(string, str))
def test_single_quoted_strings_are_also_strings(self):
st... |
from oosheet import OOSheet as S
import json
import string
def formate( ):
r=[]
r = tab2json('Config_referentiel', r)
r = tab2json('Savoir', r)
r = tab2json('Groupe_savoir', r)
r = tab2json('Competence', r)
r = tab2json('Groupe_competence', r)
r = tab2json('Tache', r)
r = tab2json('Grou... |
from django.core.urlresolvers import reverse
from django.http import HttpRequest # noqa
from mox3.mox import IsA # noqa
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
API_URL = "horizon:project:access_and_security:api_access"
EC2_URL = reverse(API_URL + ":ec2")
OPENRC_URL... |
from api.services import escape_name
class AssignmentService(object):
def __init__(self, storage):
self.storage = storage
def assign(self, experiment, entity):
"""
Query the variant to be used for the given entity
:type experiment: experiment.core.experiment.Experiment
... |
"""curses
The main package for curses support for Python. Normally used by importing
the package, and perhaps a particular module inside it.
import curses
from curses import textpad
curses.initwin()
...
"""
__revision__ = "$Id: __init__.py 61064 2008-02-25 16:29:58Z andrew.kuchling $"
from _curses imp... |
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.0'
}
import os
import tempfile
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from ansible.module_utils.f5_utils import *
from ansible.module_utils.basic import BOOLEANS... |
data = (
'Han ', # 0x00
'Xuan ', # 0x01
'Yan ', # 0x02
'Qiu ', # 0x03
'Quan ', # 0x04
'Lang ', # 0x05
'Li ', # 0x06
'Xiu ', # 0x07
'Fu ', # 0x08
'Liu ', # 0x09
'Ye ', # 0x0a
'Xi ', # 0x0b
'Ling ', # 0x0c
'Li ', # 0x0d
'Jin ', # 0x0e
'Lian ', # 0x0f
'Suo ', # 0x10
'Chii... |
if __name__ == "__main__":
import glob
import unittest
test_file_strings = [ x for x in glob.glob('*_tests.py') if not x in __file__]
module_strings = [file_string[0:len(file_string) - 3] for file_string in test_file_strings]
suites = [unittest.defaultTestLoader.loadTestsFromName(file_string) for f... |
from modules.OsmoseTranslation import T_
from plugins.Plugin import Plugin
class Administrative_TooManyWays(Plugin):
def init(self, logger):
Plugin.init(self, logger)
self.errors[504] = self.def_class(item = 6020, level = 3, tags = ['boundary', 'fix:chair'],
title = T_('Duplicated way... |
# -*- coding: utf-8 -*-
from re import match
import pynes
from pynes.analyzer import analyse
from pynes.c6502 import opcodes, address_mode_def
import io
import inspect
from binascii import hexlify
from pynes.directives import directive_list
from pynes.cartridge import Cartridge
asm65_tokens = [
dict(type='T_IN... |
class Neuron(object):
"""
This Class is representing a Neuron which is corresponding to an action to perform.
.. note:: Neurons are defined in the brain file
"""
def __init__(self, name=None, parameters=dict()):
self.name = name
self.parameters = parameters
def serialize(self)... |
import argparse
import os
import pandas as pd
from sklearn.metrics import (classification_report, confusion_matrix,
accuracy_score)
from baseline_utils import predictions_vote
from plot_utils import (plot_confusion_matrix, plot_train_history,
plot_classification_r... |
import nose
from nose.tools import assert_equal, assert_true
from sklearn.utils.testing import clean_warning_registry
import warnings
import numpy as np
from scipy import sparse as sp
from sklearn.svm.bounds import l1_min_c
from sklearn.svm import LinearSVC
from sklearn.linear_model.logistic import LogisticRegression... |
import errno
import httplib
import os
import re
import socket
import time
import boto
from boto import config, storage_uri_for_key
from boto.connection import AWSAuthConnection
from boto.exception import ResumableDownloadException
from boto.exception import ResumableTransferDisposition
from boto.s3.keyfile import KeyFi... |
from __future__ import absolute_import, division, print_function, \
with_statement
import collections
import logging
import time
# this LRUCache is optimized for concurrency, not QPS
# n: concurrency, keys stored in the cache
# m: visits not timed out, proportional to QPS * timeout
# get & set is O(1), not O(n).... |
#!/usr/bin/env python
import unittest
"""
compare.py - versatile benchmark output compare tool
"""
import argparse
from argparse import ArgumentParser
import sys
import gbench
from gbench import util, report
from gbench.util import *
def check_inputs(in1, in2, flags):
"""
Perform checking on the user provid... |
import osv
import fields
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
# -*- coding: utf-8 -*-
"""
oauthlib.common
~~~~~~~~~~~~~~
This module provides data structures and utilities common
to all implementations of OAuth.
"""
from __future__ import absolute_import, unicode_literals
import collections
import datetime
import logging
import random
import re
import sys
import time
try:
... |
import re
from openerp import netsvc
from openerp.osv import osv, fields
class project(osv.osv):
""""""
_name = 'project.project'
_inherits = { }
_inherit = [ 'project.project' ]
_columns = {
'project_tag_ids': fields.many2many('project_tags.project_tag', 'project_tags___project_tag_... |
"""
Service Object for DBus
"""
# Disable some pylint stuff
# pylint: disable=no-member
import types
import dbus
import dbus.service
def copy_func(function_reference, name=None):
"""
Copy function
:param function_reference: Function
:type function_reference: func
:param name: Name of function
... |
from dice_tools import wizard, DICEObject, diceCall
from ._selection import ModelSelection
import weakref
__all__ = [
'Model'
]
class Model(DICEObject):
"""This type exports model to DICE QML and provides several
features like item selection, item iterators etc.
Model can represent simple lists ... |
import collections
import netaddr
from oslo_concurrency import lockutils
from oslo_log import log as logging
from neutron.agent.linux import ip_lib
from neutron.api.rpc.callbacks.consumer import registry
from neutron.api.rpc.callbacks import events
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.... |
"""
Provides common functionality for integrated unit tests
"""
import random
import string
import uuid
from oslo.config import cfg
import nova.image.glance
from nova.openstack.common import log as logging
from nova import service
from nova import test
from nova.tests import cast_as_call
from nova.tests import fake_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.