content
string
from ctypes import POINTER, Structure, c_char_p, c_float, c_int, string_at from django.contrib.gis.geoip.libgeoip import free, lgeoip # #### GeoIP C Structure definitions #### class GeoIPRecord(Structure): _fields_ = [('country_code', c_char_p), ('country_code3', c_char_p), ('cou...
from datetime import datetime from openerp.tools.translate import _ from openerp.osv import fields, osv from openerp.addons.resource.faces import task as Task class project_phase(osv.osv): _name = "project.phase" _description = "Project Phase" def _check_recursion(self, cr, uid, ids, context=None): ...
"""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 ) from ....
# เติมโค้ดในลูป while เพื่อหาคำสุดท้ายก่อนกด tab def add_to_corpus_index(key, next_word, corpus_index): if key not in corpus_index: corpus_index[key] = {next_word: 1} else: if next_word in corpus_index[key]: corpus_index[key][next_word] += 1 else: corpus_index...
# -*- coding: utf-8 -*- from django.forms import * from django.utils.unittest import TestCase from django.utils.translation import ugettext_lazy, activate, deactivate from regressiontests.forms.models import Cheese class FormsRegressionsTestCase(TestCase): def test_class(self): # Tests to prevent against...
import time from openerp.report import report_sxw class pos_details_summary(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(pos_details_summary, self).__init__(cr, uid, name, context=context) self.total = 0.0 self.localcontext.update({ 'time': time, ...
"""Managing greenlets in a group. The :class:`Group` class in this module abstracts a group of running greenlets. When a greenlet dies, it's automatically removed from the group. The :class:`Pool` which a subclass of :class:`Group` provides a way to limit concurrency: its :meth:`spawn <Pool.spawn>` method blocks if t...
import datetime import os import warnings from optparse import make_option from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import AppCommand from django.db import reset_queries from django.utils.encoding import smart_str from haystack.query impor...
#!/usr/bin/python3 # -*- coding: utf-8 -*- ''' Find a SHA-1 implementation in the language you code in. Don't cheat. It won't work. Do not use the SHA-1 implementation your language already provides (for instance, don't use the "Digest" library in Ruby, or call OpenSSL; in Ruby, you'd want a pure-Ruby SHA-1). Write ...
import json import pipes import shutil import sys import os import yaml run_tests_root = os.path.abspath(os.path.join( os.path.dirname(sys.argv[0]), '../../../tools/run_tests')) sys.path.append(run_tests_root) import performance.scenario_config as scenario_config configs_from_yaml = yaml.load(open(os.path.jo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.forms import ( CharField, ChoiceField, Form, HiddenInput, IntegerField, ModelForm, ModelMultipleChoiceField, MultipleChoiceField, RadioSelect, Select, TextInput, ) from django.test import TestCase, ignore_warnings from django.utils...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.ec2 import (camel_dict_to_snake_dict, ec2_argument_spec, HAS_BOTO3, get_aws_connection_info, boto3_conn, AWSRetry) ...
# -*- coding: utf-8 -*- ''' Covenant Add-on 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 prog...
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 = 'Y-m-d' SHORT_DATETIME_FORMAT = 'Y-m-d H:i' FIRST_DAY_OF_WEEK = 1 # The *_INPUT_FORMATS strings use the Python strftime format syntax, # see http://docs.python.org/library/date...
from copy import deepcopy import random class SpectrumSmearer(object): ''' Simple smearing utility ''' def __init__(self, spectrum): ''' Constructor ''' self.__inputspectrum = spectrum self.__niterations = 1000 self.__smearmodel = None def ...
from ossie.utils import sb GR_CONST_WAVE = 100 GR_SIN_WAVE = 101 GR_COS_WAVE = 102 GR_SQR_WAVE = 103 GR_TRI_WAVE = 104 GR_SAW_WAVE = 105 # Noise types GR_UNIFORM = 200 GR_GAUSSIAN = 201 GR_LAPLACIAN = 202 GR_IMPULSE = 203 class sizeof_char(object): def __init__(self): pass class si...
# -*- coding: utf-8 -*- """ Event objects for the notification system. These are intended to be used within event handlers such as `~trigger.utils.notifications.handlers.email_handler()`. If not customized within :setting:`NOTIFICATION_HANDLERS`, the default notification type is an `~trigger.utils.notification.event...
""" .. dialect:: sybase+pysybase :name: Python-Sybase :dbapi: Sybase :connectstring: sybase+pysybase://<username>:<password>@<dsn>/\ [database name] :url: http://python-sybase.sourceforge.net/ Unicode Support --------------- The python-sybase driver does not appear to support non-ASCII strings of any ...
from __future__ import unicode_literals import frappe, unittest from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry class TestGLEntry(unittest.TestCase): def test_round_off_entry(self): frappe.db.set_value("Company", "_Test Company", "round_off_account", "_Test Write Off - _TC")...
from Queue import Empty from threading import Thread from time import sleep import numpy as np import logging import zmq import devices from utils import ensure_string class ZeroMQAdapter(object): def __init__(self, comm, grc_uplink_address="tcp://localhost:7002", grc_downlink_address="tcp://localhos...
#! /usr/bin/python # -*- coding: utf-8 -*- import re; import sys; import os; textre = re.compile("\!\[CDATA\[(.*?)\]\]", re.DOTALL); def get_text(xml): match = re.search(textre, xml); if not match: return xml; return match.group(1); def get_elements(xml, elem): p = re.compile("<" + elem + ">"...
from zeobuilder import context import molmod.units __all__ = [ "measures", "unit", "units_by_measure", "to_unit", "from_unit", "eval_measure", "express_measure", "express_data_size" ] measures = ["Length", "Energy", "Mass", "Charge", "Angle", "Time"] units = { "au": 1, "A": molmod.units.angstrom, ...
#!/usr/bin/python #ConvertYCoordFlipped.py import plistlib import os.path import argparse import glob import shutil #keys in dictionary metaDataKey = 'metaData' yCoordFlippedConvertedKey = 'yCoordFlippedConverted' yCoordFlippedKey = 'yCoordFlipped' #check if the particle file has been converted def checkFlippedConve...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'sqw.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Quote(object): def setupUi(self, Quote): Quote.setObjectName("Qu...
""" urlresolver XBMC Addon Copyright (C) 2011 t0mm0 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. ...
import mock import requests from django.test import TestCase from ..utils.network import errors from ..utils.network.client import NetworkClient from ..utils.network.urls import get_normalized_url_variations from .helpers import mock_request class TestURLParsing(TestCase): def test_valid_ipv4_address(self): ...
# -*- coding: utf-8 -*- import sys import os from media.saas.launcher import setup_global, launch_instance, setup_logger from media.monitor.config import MMConfig def main(global_config, api_client_config, log_config): """ function to run hosted install """ mm_config = MMConfig(global_config) log = setup_l...
from typing import TYPE_CHECKING from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Optional from azure.core.credentials import TokenCredential from ._configuration import P...
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...
import os import re, unicodedata import tg import gettext import math import inspect class NoDefault(object): """A dummy value used for parameters with no default.""" def slugify(value, type, models): if isinstance(value, dict): for k, v in value.iteritems(): key = k value = ...
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, local, global, or per-user co...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.openstack im...
import datetime, unittest import os, sys from mock import Mock, call, patch from lib import feeds import re from behaviours import translator import json class TestTranslatorMethods(unittest.TestCase): def test_translate(self): path = os.path.dirname(os.path.realpath(__file__)) + '/testdata/translator_get...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='PayPalIPN', fields=[ ('id', models.AutoField(ve...
"""ImageNet preprocessing for ResNet.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf IMAGE_SIZE = 224 CROP_PADDING = 32 def distorted_bounding_box_crop(image_bytes, bbox, ...
"""Generic interface to all dbm clones. Instead of import dbm d = dbm.open(file, 'w', 0666) use import anydbm d = anydbm.open(file, 'w') The returned object is a dbhash, gdbm, dbm or dumbdbm object, dependent on the type of database being opened (determined by whichdb module) in the...
""" Table of Contents Extension for Python-Markdown * * * (c) 2008 [Jack Miller](http://codezen.org) Dependencies: * [Markdown 2.0+](http://www.freewisdom.org/projects/python-markdown/) """ import markdown from markdown import etree import re class TocTreeprocessor(markdown.treeprocessors.Treeprocesso...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' @author: Maribel Acosta @author: Fabian Floeck @author: Michael Ruster ''' import csv import re import functions.TextPostProcessing as TextPostProcessing import functions.WarningTemplates as WarningTemplates import BlockTimeCalculation from datetime import datetime def w...
#!/usr/bin/env python from __future__ import print_function import pygtk import gtk pygtk.require('2.0') import os import shutil import datetime from fnmatch import fnmatch import subprocess class ConfChooser(object): # General Functions def update_combo(self, combo, clist, active): combo.set_se...
import pytest from selenium.common.exceptions import InvalidElementStateException from selenium.webdriver.common.by import By def testWritableTextInputShouldClear(driver, pages): pages.load("readOnlyPage.html") element = driver.find_element(By.ID, "writableTextInput") element.clear() assert "" == ele...
"""Tests for chebyshev module. """ from __future__ import division import numpy as np import numpy.polynomial.chebyshev as ch from numpy.testing import * def trim(x) : return ch.chebtrim(x, tol=1e-6) T0 = [ 1] T1 = [ 0, 1] T2 = [-1, 0, 2] T3 = [ 0, -3, 0, 4] T4 = [ 1, 0, -8, 0, 8] T5 = [ 0, 5, ...
import binascii import copy import datetime import re from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.utils import DatabaseError from django.utils import six from django.utils.text import force_text class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_create_column = "ALT...
# -*- coding: utf-8 -*- """ Coinkit ~~~~~ :copyright: (c) 2014 by Halfmoon Labs :license: MIT, see LICENSE for more details. """ from inspect import isclass from .keypair import * from .passphrase import random_256bit_passphrase, random_160bit_passphrase def is_cryptocurrency_keypair_class(cls): ...
#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import os import re from lib.core.common import singleTimeWarnMessage from lib.core.data import kb from lib.core.enums import DBMS from lib.core.enums import PRIORITY __prio...
from django.template import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError from django.utils.encoding import force_unicode from django.utils.html import escape from django.utils.safestring import SafeData, EscapeData from django.utils.formats import localize class DebugLexer(Lexer): def __init_...
from openerp import SUPERUSER_ID import openerp from openerp import http from openerp.http import request from openerp.addons.web.controllers import main from openerp.addons.auth_from_http_remote_user.model import \ AuthFromHttpRemoteUserInstalled from .. import utils import random import logging import werkzeug ...
import github.GithubObject import github.PaginatedList import github.Gist import github.Repository import github.NamedUser import github.Plan import github.Organization import github.UserKey import github.Issue import github.Event import github.Authorization import github.Notification INTEGRATION_PREVIEW_HEADERS = {"...
"""doctocnet URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-bas...
""" The VyOS interfaces fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is populated based on the configuration. """ from __future__ import absolute_import, division, print_function __metaclass__ = type import platform import re from ansibl...
from urllib.parse import urlparse from pyramid.httpexceptions import HTTPFound, HTTPNotFound from pyramid.view import view_config, view_defaults from via.views._helpers import url_from_user_input from via.views.exceptions import BadURL @view_defaults(route_name="index") class IndexViews: def __init__(self, requ...
from django import forms from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.core.validators import EMPTY_VALUES from django.urls import reverse from django.utils.encoding import force_bytes from django.utils.html import format_html from django.utils.http import urlsafe_base64_encode ...
"""distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to PyPI).""" import os import socket import platform from urllib2 import urlopen, Request, HTTPError from base64 import standard_b64encode import urlparse import cStringIO as StringIO from hashlib import md5 from dist...
from netzob.Common.Utils.Decorators import typeCheck from netzob.Common.Models.Vocabulary.Symbol import Symbol from netzob.Common.Models.Vocabulary.Messages.RawMessage import RawMessage from netzob.Common.Models.Vocabulary.Messages.AbstractMessage import AbstractMessage class UnknownSymbol(Symbol): """An unknown ...
from __future__ import unicode_literals import sys from fuzzywuzzy.string_processing import StringProcessor PY3 = sys.version_info[0] == 3 def validate_string(s): try: return len(s) > 0 except TypeError: return False bad_chars = str("").join([chr(i) for i in range(128, 256)]) # ascii damm...
""" A workload is the unit of execution. It represents a set of activities are are performed and measured together, as well as the necessary setup and teardown procedures. A single execution of a workload produces one :class:`wlauto.core.result.WorkloadResult` that is populated with zero or more :class:`wlauto.core.res...
#import entity_grid from entity_grid import * from parsetree import * import svm as disvm import json import pickle import os import re # from easydict import EDict as edict # args = edict() # args.jobs = 1 # args.mem = 10 args={} args['jobs']=1 args['mem']=10 args['parser']="./stanford-parser/stanford-parser.jar" arg...
import mimetypes import os import sys from exceptions import * PARSERS = [('asf', ['video/asf'], ['asf', 'wmv', 'wma']), ('flv', ['video/flv'], ['flv']), ('mkv', ['video/x-matroska', 'application/mkv'], ['mkv', 'mka', 'webm']), ('mp4', ['video/quicktime', 'video/mp4'], ['mov', 'qt', '...
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...
"""Common utility for testing third party oauth2 features.""" import json import httpretty from provider.constants import PUBLIC from provider.oauth2.models import Client from social.apps.django_app.default.models import UserSocialAuth from student.tests.factories import UserFactory from .testutil import ThirdParty...
import unittest from test import test_support rfc822 = test_support.import_module("rfc822", deprecated=True) try: from cStringIO import StringIO except ImportError: from StringIO import StringIO class MessageTestCase(unittest.TestCase): def create_message(self, msg): return rfc822.Message(String...
"""Constants regarding Estimators. This file is obsoleted in the move of Estimator to core. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function class ProblemType(object): """Enum-like values for the type of problem that the model solves. These values ...
from south.db import db from django.db import models from mysite.search.models import * class Migration: no_dry_run = True def forwards(self, orm): "Write your forwards migration here" def backwards(self, orm): "Write your backwards migration here" models = { ...
from functools import partial from django.contrib.gis.db.models import aggregates class BaseSpatialFeatures(object): gis_enabled = True # Does the database contain a SpatialRefSys model to store SRID information? has_spatialrefsys_table = True # Does the backend support the django.contrib.gis.utils...
from __future__ import unicode_literals import os from django.apps import apps from django.test import SimpleTestCase from django.test.utils import extend_sys_path from django.utils import six from django.utils._os import upath class EggLoadingTest(SimpleTestCase): def setUp(self): self.egg_dir = '%s/e...
""" Define steps for bulk email acceptance test. """ # pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, step from lettuce.django import mail from nose.tools import assert_in, assert_equal # pylint: disable=no-name-in-module from django.core.management import call_co...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
class Group(object): @classmethod def from_dict(cls, data, vm_dict): """ This classmethod creates tree of groups recursively """ groups_list = [] for group_name, group_data in data.items(): group = cls(group_name) groups_list.append(group) ...
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from collections import Mapping from mo_dots import zip as dict_zip, get_logger, wrap from mo_logs import Except def override(func): """ THIS DECORATOR WILL PUT ALL PARAMETERS INTO THE `kwargs` PA...
from __future__ import unicode_literals import os.path from django.forms import FilePathField, ValidationError, forms from django.test import SimpleTestCase from django.utils import six from django.utils._os import upath def fix_os_paths(x): if isinstance(x, six.string_types): return x.replace('\\', '/'...
from cinder.api.contrib import services from cinder import context from cinder import db from cinder import exception from cinder.openstack.common import timeutils from cinder import policy from cinder import test from cinder.tests.api import fakes from datetime import datetime fake_services_list = [{'binary': 'cinde...
# general purpose 'tooltip' routines - currently unused in idlefork # (although the 'calltips' extension is partly based on this code) # may be useful for some purposes in (or almost in ;) the current project scope # Ideas gleaned from PySol from Tkinter import * class ToolTipBase: def __init__(self, button): ...
""" Scrapy Telnet Console extension See documentation in docs/topics/telnetconsole.rst """ import pprint import logging import traceback import binascii import os from twisted.internet import protocol try: from twisted.conch import manhole, telnet from twisted.conch.insults import insults TWISTED_CONCH_A...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} import pipes def update_package_db(module, opkg_path): """ Updates packages list. """ rc, out, err = module.run_command("%s update" % opkg_path) if rc != 0: module.fa...
# external control import datetime import time import string #import urllib2 import math import redis import base64 import json import py_cf.cf_interpreter import os import copy import rabbit_cloud_status_publish import io_control class Moisture_Control(object): def __init__(self, redis_handle , graph_managem...
# -*- coding: utf-8 -*- from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_paypal.controllers.main import PaypalController from openerp.tools import mute_logger from lxml import objectify import u...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import errno from itertools import islice import os import platform import re import shutil import sys import unicodedata if sys.version_info[0] == 3: imap = map os.getcwdu = os.getcwd else: from itertools import imap d...
"""Loading unittests.""" import os import re import sys import traceback import types import unittest from fnmatch import fnmatch from django.utils.unittest import case, suite try: from os.path import relpath except ImportError: from django.utils.unittest.compatibility import relpath __unittest = True de...
from __future__ import absolute_import, division, print_function from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, WorkspaceUnitValidator, \ InstrumentValidator, FileProperty, FileAction from mantid.kernel import Direction, CompositeValidator from mantid.dataobje...
import unittest from qubell.api.private.testing import values __author__ = 'dmakhno' # noinspection PyUnresolvedReferences class ValuesDecoratorTests(unittest.TestCase): class FakeInstance(object): def __init__(self, return_value): self.returnValues = return_value rv = {"str": "some str...
#!/usr/bin/env python3 from __future__ import division from __future__ import print_function from builtins import str from builtins import range from past.utils import old_div import sys import socket import time import subprocess import os from vmrunner import vmrunner from vmrunner.prettify import color test_name="...
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 = r'Y \m. E j \d.' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = r'Y \m. E j \d., H:i:s' YEAR_MONTH_FORMAT = r'Y \m. F' MONTH_DAY_FORMAT = r'E ...
from m5.objects import * from x86_generic import * root = LinuxX86FSSystemUniprocessor(mem_mode='timing', mem_class=DDR3_1600_8x8, cpu_class=TimingSimpleCPU).create_root()
"""Tests for Reshape Bijector.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib.distributions.python.ops.bijectors.reshape import Reshape from tensorflow.python.framework import dtypes from tensorflow.python.fra...
""" LTI user management functionality. This module reconciles the two identities that an individual has in the campus LMS platform and on edX. """ import string import random import uuid from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.auth.models import User fr...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.ec2 import get_aws_connection_info from ansible.module_utils.ec2 import ec2_argument_spec, boto3_conn from ansible.module_utils.ec2 import snake_dict_to_c...
import unittest from test import support import io # C implementation. import _pyio as pyio # Python implementation. # Simple test to ensure that optimizations in the IO library deliver the # expected results. For best testing, run this under a debug-build Python too # (to exercise asserts in the C code). lengths =...
import numpy as np from .. import colors from ...db import ChemlabDB from .base import AbstractRenderer from .sphere import SphereRenderer from .sphere_imp import SphereImpostorRenderer from .point import PointRenderer vdw_dict = ChemlabDB().get("data", 'vdwdict') class AtomRenderer(AbstractRenderer): """Render ...
from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module # Cache of actual callables. _standard_context_processors = None # We need the CSRF processor no matter what the user has in their settings, # because otherwise it is a security vulnerability, and we can't afford t...
import datetime import unittest import os import re import shutil import oeqa.utils.ftools as ftools from oeqa.selftest.base import oeSelfTest from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer class SStateBase(oeSelfTest): def setUpLocal(self): self.temp_sstate_location = None ...
from ordereddict import OrderedDict from qapi import * import sys import os import getopt import errno def generate_fwd_struct(name, members): return mcgen(''' typedef struct %(name)s %(name)s; typedef struct %(name)sList { %(name)s *value; struct %(name)sList *next; } %(name)sList; ''', ...
"""Widgets for Curses-based CLI.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.debug.cli import debugger_cli_common RL = debugger_cli_common.RichLine class NavigationHistoryItem(object): """Individual item in navigation hist...
from __future__ import unicode_literals import webnotes sql = webnotes.conn.sql from webnotes.model.doc import Document, addchild from webnotes.utils import cstr, cint, flt, comma_or from datetime import date,timedelta import datetime from webnotes.model.code import get_obj class DocType: def __init__(self, d...
""" This module houses the ctypes initialization procedures, as well as the notice and error handler function callbacks (get called when an error occurs in GEOS). This module also houses GEOS Pointer utilities, including get_pointer_arr(), and GEOM_PTR. """ import os import re import sys from ctypes import c_char...
import fileManager as fm import camera import numpy as np import cv2 import shader as pts_shader import os import timeit from texture import Mesh from SortBuilding import SortBuilding as sb import math def sortBasedOnZ(mylist,refer_list): return [x for (y,x) in sorted(zip(refer_list,mylist),key = lambda pair:pair[0]...
"""Serve TensorFlow summary data to a web frontend. This is a simple web server to proxy data from the event_loader to the web, and serve static web files. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import socket from tensorflow.python.p...
from autothreadharness.harness_case import HarnessCase import unittest class Border_7_1_3(HarnessCase): role = HarnessCase.ROLE_BORDER case = '7 1 3' golden_devices_required = 3 def on_dialog(self, dialog, title): pass if __name__ == '__main__': unittest.main()
from webob import exc from nova.api.openstack import common from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import compute from nova import exception from nova.policies import suspend_server as ss_policies ALIAS = "os-suspend-server" class SuspendServerController(wsgi.Control...
# stop on signals def setStopBlock(block, signal,dir) : s = signals.getSignalHead(signal) b = jmri.jmrit.tracker.StoppingBlock(block) b.addSignal(s,dir) return b def setStopBlock2(block, signal1, signal2, dir) : s1 = signals.getSignalHead(signal1) s2 = signals.getSignalHead(signal2) b = jmr...
# coding=utf-8 import os.path import unittest from pytrustnfe.xml import render_xml, sanitize_response from tests.const import DEFAULT_RPS, NFSE template_path = 'pytrustnfe/nfse/paulistana/templates' def _get_nfse(tipo_cpfcnpj): nfse = NFSE lista_rps = DEFAULT_RPS for rps in lista_rps: rps['tom...
"""Locations where we look for configs, install stuff, etc""" import sys import site import os import tempfile from distutils.command.install import install, SCHEME_KEYS import getpass from pip.backwardcompat import get_python_lib, get_path_uid, user_site import pip.exceptions DELETE_MARKER_MESSAGE = '''\ This file ...