repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
windyuuy/opera
chromium/src/third_party/python_26/Lib/SimpleXMLRPCServer.py
51
21906
"""Simple XML-RPC Server. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to handle XML-RPC requests in a CGI environment using CGIXMLRPCRequestHandler. A list of possible usage patterns follows: 1. Install functions: server = SimpleXMLRPCServer(("localhost", 8000)) server.register_function(pow) server.register_function(lambda x,y: x+y, 'add') server.serve_forever() 2. Install an instance: class MyFuncs: def __init__(self): # make all of the string functions available through # string.func_name import string self.string = string def _listMethods(self): # implement this method so that system.listMethods # knows to advertise the strings methods return list_public_methods(self) + \ ['string.' + method for method in list_public_methods(self.string)] def pow(self, x, y): return pow(x, y) def add(self, x, y) : return x + y server = SimpleXMLRPCServer(("localhost", 8000)) server.register_introspection_functions() server.register_instance(MyFuncs()) server.serve_forever() 3. Install an instance with custom dispatch method: class Math: def _listMethods(self): # this method must be present for system.listMethods # to work return ['add', 'pow'] def _methodHelp(self, method): # this method must be present for system.methodHelp # to work if method == 'add': return "add(2,3) => 5" elif method == 'pow': return "pow(x, y[, z]) => number" else: # By convention, return empty # string if no help is available return "" def _dispatch(self, method, params): if method == 'pow': return pow(*params) elif method == 'add': return params[0] + params[1] else: raise 'bad method' server = SimpleXMLRPCServer(("localhost", 8000)) server.register_introspection_functions() server.register_instance(Math()) server.serve_forever() 4. Subclass SimpleXMLRPCServer: class MathServer(SimpleXMLRPCServer): def _dispatch(self, method, params): try: # We are forcing the 'export_' prefix on methods that are # callable through XML-RPC to prevent potential security # problems func = getattr(self, 'export_' + method) except AttributeError: raise Exception('method "%s" is not supported' % method) else: return func(*params) def export_add(self, x, y): return x + y server = MathServer(("localhost", 8000)) server.serve_forever() 5. CGI script: server = CGIXMLRPCRequestHandler() server.register_function(pow) server.handle_request() """ # Written by Brian Quinlan (brian@sweetapp.com). # Based on code written by Fredrik Lundh. import xmlrpclib from xmlrpclib import Fault import SocketServer import BaseHTTPServer import sys import os import traceback try: import fcntl except ImportError: fcntl = None def resolve_dotted_attribute(obj, attr, allow_dotted_names=True): """resolve_dotted_attribute(a, 'b.c.d') => a.b.c.d Resolves a dotted attribute name to an object. Raises an AttributeError if any attribute in the chain starts with a '_'. If the optional allow_dotted_names argument is false, dots are not supported and this function operates similar to getattr(obj, attr). """ if allow_dotted_names: attrs = attr.split('.') else: attrs = [attr] for i in attrs: if i.startswith('_'): raise AttributeError( 'attempt to access private attribute "%s"' % i ) else: obj = getattr(obj,i) return obj def list_public_methods(obj): """Returns a list of attribute strings, found in the specified object, which represent callable attributes""" return [member for member in dir(obj) if not member.startswith('_') and hasattr(getattr(obj, member), '__call__')] def remove_duplicates(lst): """remove_duplicates([2,2,2,1,3,3]) => [3,1,2] Returns a copy of a list without duplicates. Every list item must be hashable and the order of the items in the resulting list is not defined. """ u = {} for x in lst: u[x] = 1 return u.keys() class SimpleXMLRPCDispatcher: """Mix-in class that dispatches XML-RPC requests. This class is used to register XML-RPC method handlers and then to dispatch them. There should never be any reason to instantiate this class directly. """ def __init__(self, allow_none=False, encoding=None): self.funcs = {} self.instance = None self.allow_none = allow_none self.encoding = encoding def register_instance(self, instance, allow_dotted_names=False): """Registers an instance to respond to XML-RPC requests. Only one instance can be installed at a time. If the registered instance has a _dispatch method then that method will be called with the name of the XML-RPC method and its parameters as a tuple e.g. instance._dispatch('add',(2,3)) If the registered instance does not have a _dispatch method then the instance will be searched to find a matching method and, if found, will be called. Methods beginning with an '_' are considered private and will not be called by SimpleXMLRPCServer. If a registered function matches a XML-RPC request, then it will be called instead of the registered instance. If the optional allow_dotted_names argument is true and the instance does not have a _dispatch method, method names containing dots are supported and resolved, as long as none of the name segments start with an '_'. *** SECURITY WARNING: *** Enabling the allow_dotted_names options allows intruders to access your module's global variables and may allow intruders to execute arbitrary code on your machine. Only use this option on a secure, closed network. """ self.instance = instance self.allow_dotted_names = allow_dotted_names def register_function(self, function, name = None): """Registers a function to respond to XML-RPC requests. The optional name argument can be used to set a Unicode name for the function. """ if name is None: name = function.__name__ self.funcs[name] = function def register_introspection_functions(self): """Registers the XML-RPC introspection methods in the system namespace. see http://xmlrpc.usefulinc.com/doc/reserved.html """ self.funcs.update({'system.listMethods' : self.system_listMethods, 'system.methodSignature' : self.system_methodSignature, 'system.methodHelp' : self.system_methodHelp}) def register_multicall_functions(self): """Registers the XML-RPC multicall method in the system namespace. see http://www.xmlrpc.com/discuss/msgReader$1208""" self.funcs.update({'system.multicall' : self.system_multicall}) def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data. XML-RPC methods are dispatched from the marshalled (XML) data using the _dispatch method and the result is returned as marshalled data. For backwards compatibility, a dispatch function can be provided as an argument (see comment in SimpleXMLRPCRequestHandler.do_POST) but overriding the existing method through subclassing is the prefered means of changing method dispatch behavior. """ try: params, method = xmlrpclib.loads(data) # generate response if dispatch_method is not None: response = dispatch_method(method, params) else: response = self._dispatch(method, params) # wrap response in a singleton tuple response = (response,) response = xmlrpclib.dumps(response, methodresponse=1, allow_none=self.allow_none, encoding=self.encoding) except Fault, fault: response = xmlrpclib.dumps(fault, allow_none=self.allow_none, encoding=self.encoding) except: # report exception back to server exc_type, exc_value, exc_tb = sys.exc_info() response = xmlrpclib.dumps( xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)), encoding=self.encoding, allow_none=self.allow_none, ) return response def system_listMethods(self): """system.listMethods() => ['add', 'subtract', 'multiple'] Returns a list of the methods supported by the server.""" methods = self.funcs.keys() if self.instance is not None: # Instance can implement _listMethod to return a list of # methods if hasattr(self.instance, '_listMethods'): methods = remove_duplicates( methods + self.instance._listMethods() ) # if the instance has a _dispatch method then we # don't have enough information to provide a list # of methods elif not hasattr(self.instance, '_dispatch'): methods = remove_duplicates( methods + list_public_methods(self.instance) ) methods.sort() return methods def system_methodSignature(self, method_name): """system.methodSignature('add') => [double, int, int] Returns a list describing the signature of the method. In the above example, the add method takes two integers as arguments and returns a double result. This server does NOT support system.methodSignature.""" # See http://xmlrpc.usefulinc.com/doc/sysmethodsig.html return 'signatures not supported' def system_methodHelp(self, method_name): """system.methodHelp('add') => "Adds two integers together" Returns a string containing documentation for the specified method.""" method = None if method_name in self.funcs: method = self.funcs[method_name] elif self.instance is not None: # Instance can implement _methodHelp to return help for a method if hasattr(self.instance, '_methodHelp'): return self.instance._methodHelp(method_name) # if the instance has a _dispatch method then we # don't have enough information to provide help elif not hasattr(self.instance, '_dispatch'): try: method = resolve_dotted_attribute( self.instance, method_name, self.allow_dotted_names ) except AttributeError: pass # Note that we aren't checking that the method actually # be a callable object of some kind if method is None: return "" else: import pydoc return pydoc.getdoc(method) def system_multicall(self, call_list): """system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => \ [[4], ...] Allows the caller to package multiple XML-RPC calls into a single request. See http://www.xmlrpc.com/discuss/msgReader$1208 """ results = [] for call in call_list: method_name = call['methodName'] params = call['params'] try: # XXX A marshalling error in any response will fail the entire # multicall. If someone cares they should fix this. results.append([self._dispatch(method_name, params)]) except Fault, fault: results.append( {'faultCode' : fault.faultCode, 'faultString' : fault.faultString} ) except: exc_type, exc_value, exc_tb = sys.exc_info() results.append( {'faultCode' : 1, 'faultString' : "%s:%s" % (exc_type, exc_value)} ) return results def _dispatch(self, method, params): """Dispatches the XML-RPC method. XML-RPC calls are forwarded to a registered function that matches the called XML-RPC method name. If no such function exists then the call is forwarded to the registered instance, if available. If the registered instance has a _dispatch method then that method will be called with the name of the XML-RPC method and its parameters as a tuple e.g. instance._dispatch('add',(2,3)) If the registered instance does not have a _dispatch method then the instance will be searched to find a matching method and, if found, will be called. Methods beginning with an '_' are considered private and will not be called. """ func = None try: # check to see if a matching function has been registered func = self.funcs[method] except KeyError: if self.instance is not None: # check for a _dispatch method if hasattr(self.instance, '_dispatch'): return self.instance._dispatch(method, params) else: # call instance method directly try: func = resolve_dotted_attribute( self.instance, method, self.allow_dotted_names ) except AttributeError: pass if func is not None: return func(*params) else: raise Exception('method "%s" is not supported' % method) class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """Simple XML-RPC request handler class. Handles all HTTP POST requests and attempts to decode them as XML-RPC requests. """ # Class attribute listing the accessible path components; # paths not on this list will result in a 404 error. rpc_paths = ('/', '/RPC2') def is_rpc_path_valid(self): if self.rpc_paths: return self.path in self.rpc_paths else: # If .rpc_paths is empty, just assume all paths are legal return True def do_POST(self): """Handles the HTTP POST request. Attempts to interpret all HTTP POST requests as XML-RPC calls, which are forwarded to the server's _dispatch method for handling. """ # Check that the path is legal if not self.is_rpc_path_valid(): self.report_404() return try: # Get arguments by reading body of request. # We read this in chunks to avoid straining # socket.read(); around the 10 or 15Mb mark, some platforms # begin to have problems (bug #792570). max_chunk_size = 10*1024*1024 size_remaining = int(self.headers["content-length"]) L = [] while size_remaining: chunk_size = min(size_remaining, max_chunk_size) L.append(self.rfile.read(chunk_size)) size_remaining -= len(L[-1]) data = ''.join(L) # In previous versions of SimpleXMLRPCServer, _dispatch # could be overridden in this class, instead of in # SimpleXMLRPCDispatcher. To maintain backwards compatibility, # check to see if a subclass implements _dispatch and dispatch # using that method if present. response = self.server._marshaled_dispatch( data, getattr(self, '_dispatch', None) ) except Exception, e: # This should only happen if the module is buggy # internal error, report as HTTP server error self.send_response(500) # Send information about the exception if requested if hasattr(self.server, '_send_traceback_header') and \ self.server._send_traceback_header: self.send_header("X-exception", str(e)) self.send_header("X-traceback", traceback.format_exc()) self.end_headers() else: # got a valid XML RPC response self.send_response(200) self.send_header("Content-type", "text/xml") self.send_header("Content-length", str(len(response))) self.end_headers() self.wfile.write(response) # shut down the connection self.wfile.flush() self.connection.shutdown(1) def report_404 (self): # Report a 404 error self.send_response(404) response = 'No such page' self.send_header("Content-type", "text/plain") self.send_header("Content-length", str(len(response))) self.end_headers() self.wfile.write(response) # shut down the connection self.wfile.flush() self.connection.shutdown(1) def log_request(self, code='-', size='-'): """Selectively log an accepted request.""" if self.server.logRequests: BaseHTTPServer.BaseHTTPRequestHandler.log_request(self, code, size) class SimpleXMLRPCServer(SocketServer.TCPServer, SimpleXMLRPCDispatcher): """Simple XML-RPC server. Simple XML-RPC server that allows functions and a single instance to be installed to handle requests. The default implementation attempts to dispatch XML-RPC calls to the functions or instance installed in the server. Override the _dispatch method inhereted from SimpleXMLRPCDispatcher to change this behavior. """ allow_reuse_address = True # Warning: this is for debugging purposes only! Never set this to True in # production code, as will be sending out sensitive information (exception # and stack trace details) when exceptions are raised inside # SimpleXMLRPCRequestHandler.do_POST _send_traceback_header = False def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=True, allow_none=False, encoding=None, bind_and_activate=True): self.logRequests = logRequests SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding) SocketServer.TCPServer.__init__(self, addr, requestHandler, bind_and_activate) # [Bug #1222790] If possible, set close-on-exec flag; if a # method spawns a subprocess, the subprocess shouldn't have # the listening socket open. if fcntl is not None and hasattr(fcntl, 'FD_CLOEXEC'): flags = fcntl.fcntl(self.fileno(), fcntl.F_GETFD) flags |= fcntl.FD_CLOEXEC fcntl.fcntl(self.fileno(), fcntl.F_SETFD, flags) class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): """Simple handler for XML-RPC data passed through CGI.""" def __init__(self, allow_none=False, encoding=None): SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding) def handle_xmlrpc(self, request_text): """Handle a single XML-RPC request""" response = self._marshaled_dispatch(request_text) print 'Content-Type: text/xml' print 'Content-Length: %d' % len(response) print sys.stdout.write(response) def handle_get(self): """Handle a single HTTP GET request. Default implementation indicates an error because XML-RPC uses the POST method. """ code = 400 message, explain = \ BaseHTTPServer.BaseHTTPRequestHandler.responses[code] response = BaseHTTPServer.DEFAULT_ERROR_MESSAGE % \ { 'code' : code, 'message' : message, 'explain' : explain } print 'Status: %d %s' % (code, message) print 'Content-Type: text/html' print 'Content-Length: %d' % len(response) print sys.stdout.write(response) def handle_request(self, request_text = None): """Handle a single XML-RPC request passed through a CGI post method. If no XML data is given then it is read from stdin. The resulting XML-RPC response is printed to stdout along with the correct HTTP headers. """ if request_text is None and \ os.environ.get('REQUEST_METHOD', None) == 'GET': self.handle_get() else: # POST data is normally available through stdin try: length = int(os.environ.get('CONTENT_LENGTH', None)) except (TypeError, ValueError): length = -1 if request_text is None: request_text = sys.stdin.read(length) self.handle_xmlrpc(request_text) if __name__ == '__main__': print 'Running XML-RPC server on port 8000' server = SimpleXMLRPCServer(("localhost", 8000)) server.register_function(pow) server.register_function(lambda x,y: x+y, 'add') server.serve_forever()
bsd-3-clause
yvaucher/stock-logistics-workflow
__unported__/stock_picking_invoice_link/__openerp__.py
8
1704
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## { 'name': "Picking Invoice Link", 'version': '0.2', 'category': 'Warehouse Management', 'summary': 'Adds link between pickings and generated invoices', 'description': """ This module adds a link between pickings and generated invoices. So that user can easly reach the invoice related to the picking. Probably to be modified according to bug 1169998 (when solution will come) https://bugs.launchpad.net/openobject-addons/+bug/1169998 """, 'author': 'Agile Business Group', 'website': 'http://www.agilebg.com', 'license': 'AGPL-3', "depends": ['stock'], "data": [ "stock_view.xml", "account_invoice_view.xml", ], "demo": [], 'test': [], "active": False, 'installable': False }
agpl-3.0
mcgoddard/widgetr
env/Lib/site-packages/flask/json.py
428
8113
# -*- coding: utf-8 -*- """ flask.jsonimpl ~~~~~~~~~~~~~~ Implementation helpers for the JSON support in Flask. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import io import uuid from datetime import datetime from .globals import current_app, request from ._compat import text_type, PY2 from werkzeug.http import http_date from jinja2 import Markup # Use the same json implementation as itsdangerous on which we # depend anyways. try: from itsdangerous import simplejson as _json except ImportError: from itsdangerous import json as _json # figure out if simplejson escapes slashes. This behavior was changed # from one version to another without reason. _slash_escape = '\\/' not in _json.dumps('/') __all__ = ['dump', 'dumps', 'load', 'loads', 'htmlsafe_dump', 'htmlsafe_dumps', 'JSONDecoder', 'JSONEncoder', 'jsonify'] def _wrap_reader_for_text(fp, encoding): if isinstance(fp.read(0), bytes): fp = io.TextIOWrapper(io.BufferedReader(fp), encoding) return fp def _wrap_writer_for_text(fp, encoding): try: fp.write('') except TypeError: fp = io.TextIOWrapper(fp, encoding) return fp class JSONEncoder(_json.JSONEncoder): """The default Flask JSON encoder. This one extends the default simplejson encoder by also supporting ``datetime`` objects, ``UUID`` as well as ``Markup`` objects which are serialized as RFC 822 datetime strings (same as the HTTP date format). In order to support more data types override the :meth:`default` method. """ def default(self, o): """Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) return JSONEncoder.default(self, o) """ if isinstance(o, datetime): return http_date(o) if isinstance(o, uuid.UUID): return str(o) if hasattr(o, '__html__'): return text_type(o.__html__()) return _json.JSONEncoder.default(self, o) class JSONDecoder(_json.JSONDecoder): """The default JSON decoder. This one does not change the behavior from the default simplejson encoder. Consult the :mod:`json` documentation for more information. This decoder is not only used for the load functions of this module but also :attr:`~flask.Request`. """ def _dump_arg_defaults(kwargs): """Inject default arguments for dump functions.""" if current_app: kwargs.setdefault('cls', current_app.json_encoder) if not current_app.config['JSON_AS_ASCII']: kwargs.setdefault('ensure_ascii', False) kwargs.setdefault('sort_keys', current_app.config['JSON_SORT_KEYS']) else: kwargs.setdefault('sort_keys', True) kwargs.setdefault('cls', JSONEncoder) def _load_arg_defaults(kwargs): """Inject default arguments for load functions.""" if current_app: kwargs.setdefault('cls', current_app.json_decoder) else: kwargs.setdefault('cls', JSONDecoder) def dumps(obj, **kwargs): """Serialize ``obj`` to a JSON formatted ``str`` by using the application's configured encoder (:attr:`~flask.Flask.json_encoder`) if there is an application on the stack. This function can return ``unicode`` strings or ascii-only bytestrings by default which coerce into unicode strings automatically. That behavior by default is controlled by the ``JSON_AS_ASCII`` configuration variable and can be overriden by the simplejson ``ensure_ascii`` parameter. """ _dump_arg_defaults(kwargs) encoding = kwargs.pop('encoding', None) rv = _json.dumps(obj, **kwargs) if encoding is not None and isinstance(rv, text_type): rv = rv.encode(encoding) return rv def dump(obj, fp, **kwargs): """Like :func:`dumps` but writes into a file object.""" _dump_arg_defaults(kwargs) encoding = kwargs.pop('encoding', None) if encoding is not None: fp = _wrap_writer_for_text(fp, encoding) _json.dump(obj, fp, **kwargs) def loads(s, **kwargs): """Unserialize a JSON object from a string ``s`` by using the application's configured decoder (:attr:`~flask.Flask.json_decoder`) if there is an application on the stack. """ _load_arg_defaults(kwargs) if isinstance(s, bytes): s = s.decode(kwargs.pop('encoding', None) or 'utf-8') return _json.loads(s, **kwargs) def load(fp, **kwargs): """Like :func:`loads` but reads from a file object. """ _load_arg_defaults(kwargs) if not PY2: fp = _wrap_reader_for_text(fp, kwargs.pop('encoding', None) or 'utf-8') return _json.load(fp, **kwargs) def htmlsafe_dumps(obj, **kwargs): """Works exactly like :func:`dumps` but is safe for use in ``<script>`` tags. It accepts the same arguments and returns a JSON string. Note that this is available in templates through the ``|tojson`` filter which will also mark the result as safe. Due to how this function escapes certain characters this is safe even if used outside of ``<script>`` tags. The following characters are escaped in strings: - ``<`` - ``>`` - ``&`` - ``'`` This makes it safe to embed such strings in any place in HTML with the notable exception of double quoted attributes. In that case single quote your attributes or HTML escape it in addition. .. versionchanged:: 0.10 This function's return value is now always safe for HTML usage, even if outside of script tags or if used in XHTML. This rule does not hold true when using this function in HTML attributes that are double quoted. Always single quote attributes if you use the ``|tojson`` filter. Alternatively use ``|tojson|forceescape``. """ rv = dumps(obj, **kwargs) \ .replace(u'<', u'\\u003c') \ .replace(u'>', u'\\u003e') \ .replace(u'&', u'\\u0026') \ .replace(u"'", u'\\u0027') if not _slash_escape: rv = rv.replace('\\/', '/') return rv def htmlsafe_dump(obj, fp, **kwargs): """Like :func:`htmlsafe_dumps` but writes into a file object.""" fp.write(unicode(htmlsafe_dumps(obj, **kwargs))) def jsonify(*args, **kwargs): """Creates a :class:`~flask.Response` with the JSON representation of the given arguments with an `application/json` mimetype. The arguments to this function are the same as to the :class:`dict` constructor. Example usage:: from flask import jsonify @app.route('/_get_current_user') def get_current_user(): return jsonify(username=g.user.username, email=g.user.email, id=g.user.id) This will send a JSON response like this to the browser:: { "username": "admin", "email": "admin@localhost", "id": 42 } For security reasons only objects are supported toplevel. For more information about this, have a look at :ref:`json-security`. This function's response will be pretty printed if it was not requested with ``X-Requested-With: XMLHttpRequest`` to simplify debugging unless the ``JSONIFY_PRETTYPRINT_REGULAR`` config parameter is set to false. .. versionadded:: 0.2 """ indent = None if current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] \ and not request.is_xhr: indent = 2 return current_app.response_class(dumps(dict(*args, **kwargs), indent=indent), mimetype='application/json') def tojson_filter(obj, **kwargs): return Markup(htmlsafe_dumps(obj, **kwargs))
mit
jef-n/QGIS
python/plugins/processing/algs/qgis/KNearestConcaveHull.py
30
21491
# -*- coding: utf-8 -*- """ /*************************************************************************** KNearestConcaveHull.py ---------------------- Date : November 2014 Copyright : (C) 2014 by Detlev Neumann Dr. Neumann Consulting - Geospatial Services Email : dneumann@geospatial-services.de ***************************************************************************/ /*************************************************************************** * * * 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__ = 'Detlev Neumann' __date__ = 'November 2014' __copyright__ = '(C) 2014, Detlev Neumann' import os.path import math from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtCore import QVariant from qgis.core import (QgsApplication, QgsExpression, QgsFeature, QgsFeatureRequest, QgsFeatureSink, QgsField, QgsFields, QgsGeometry, QgsProcessing, QgsProcessingException, QgsProcessingParameterFeatureSink, QgsProcessingParameterFeatureSource, QgsProcessingParameterField, QgsProcessingParameterNumber, QgsPoint, QgsPointXY, QgsWkbTypes) from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm class KNearestConcaveHull(QgisAlgorithm): KNEIGHBORS = 'KNEIGHBORS' INPUT = 'INPUT' OUTPUT = 'OUTPUT' FIELD = 'FIELD' def name(self): return 'knearestconcavehull' def displayName(self): return self.tr('Concave hull (k-nearest neighbor)') def shortDescription(self): return self.tr('Creates a concave hull using the k-nearest neighbor algorithm.') def icon(self): return QgsApplication.getThemeIcon("/algorithms/mAlgorithmConcaveHull.svg") def svgIconPath(self): return QgsApplication.iconPath("/algorithms/mAlgorithmConcaveHull.svg") def group(self): return self.tr('Vector geometry') def groupId(self): return 'vectorgeometry' def __init__(self): super().__init__() def initAlgorithm(self, config=None): self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'))) self.addParameter(QgsProcessingParameterNumber(self.KNEIGHBORS, self.tr('Number of neighboring points to consider (a lower number is more concave, a higher number is smoother)'), QgsProcessingParameterNumber.Integer, defaultValue=3, minValue=3)) self.addParameter(QgsProcessingParameterField(self.FIELD, self.tr('Field (set if creating concave hulls by class)'), parentLayerParameterName=self.INPUT, optional=True)) self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Concave hull'), QgsProcessing.TypeVectorPolygon)) def processAlgorithm(self, parameters, context, feedback): # Get variables from dialog source = self.parameterAsSource(parameters, self.INPUT, context) if source is None: raise QgsProcessingException(self.invalidSourceError(parameters, self.INPUT)) field_name = self.parameterAsString(parameters, self.FIELD, context) kneighbors = self.parameterAsInt(parameters, self.KNEIGHBORS, context) use_field = bool(field_name) field_index = -1 fields = QgsFields() fields.append(QgsField('id', QVariant.Int, '', 20)) current = 0 # Get properties of the field the grouping is based on if use_field: field_index = source.fields().lookupField(field_name) if field_index >= 0: fields.append(source.fields()[field_index]) # Add a field with the name of the grouping field # Initialize writer (sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context, fields, QgsWkbTypes.Polygon, source.sourceCrs()) if sink is None: raise QgsProcessingException(self.invalidSinkError(parameters, self.OUTPUT)) success = False fid = 0 # Get unique values of grouping field unique_values = source.uniqueValues(field_index) total = 100.0 / float(source.featureCount() * len(unique_values)) for unique in unique_values: points = [] filter = QgsExpression.createFieldEqualityExpression(field_name, unique) request = QgsFeatureRequest().setFilterExpression(filter) request.setSubsetOfAttributes([]) # Get features with the grouping attribute equal to the current grouping value features = source.getFeatures(request) for in_feature in features: if feedback.isCanceled(): break # Add points or vertices of more complex geometry points.extend(extract_points(in_feature.geometry())) current += 1 feedback.setProgress(int(current * total)) # A minimum of 3 points is necessary to proceed if len(points) >= 3: out_feature = QgsFeature() the_hull = concave_hull(points, kneighbors) if the_hull: vertex = [QgsPointXY(point[0], point[1]) for point in the_hull] poly = QgsGeometry().fromPolygonXY([vertex]) out_feature.setGeometry(poly) # Give the polygon the same attribute as the point grouping attribute out_feature.setAttributes([fid, unique]) sink.addFeature(out_feature, QgsFeatureSink.FastInsert) success = True # at least one polygon created fid += 1 if not success: raise QgsProcessingException('No hulls could be created. Most likely there were not at least three unique points in any of the groups.') else: # Field parameter provided but can't read from it raise QgsProcessingException('Unable to find grouping field') else: # Not grouped by field # Initialize writer (sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context, fields, QgsWkbTypes.Polygon, source.sourceCrs()) if sink is None: raise QgsProcessingException(self.invalidSinkError(parameters, self.OUTPUT)) points = [] request = QgsFeatureRequest() request.setSubsetOfAttributes([]) features = source.getFeatures(request) # Get all features total = 100.0 / source.featureCount() if source.featureCount() else 0 for in_feature in features: if feedback.isCanceled(): break # Add points or vertices of more complex geometry points.extend(extract_points(in_feature.geometry())) current += 1 feedback.setProgress(int(current * total)) # A minimum of 3 points is necessary to proceed if len(points) >= 3: out_feature = QgsFeature() the_hull = concave_hull(points, kneighbors) if the_hull: vertex = [QgsPointXY(point[0], point[1]) for point in the_hull] poly = QgsGeometry().fromPolygonXY([vertex]) out_feature.setGeometry(poly) out_feature.setAttributes([0]) sink.addFeature(out_feature, QgsFeatureSink.FastInsert) else: # the_hull returns None only when there are less than three points after cleaning raise QgsProcessingException('At least three unique points are required to create a concave hull.') else: raise QgsProcessingException('At least three points are required to create a concave hull.') return {self.OUTPUT: dest_id} def clean_list(list_of_points): """ Deletes duplicate points in list_of_points """ return list(set(list_of_points)) def find_min_y_point(list_of_points): """ Returns that point of *list_of_points* having minimal y-coordinate :param list_of_points: list of tuples :return: tuple (x, y) """ min_y_pt = list_of_points[0] for point in list_of_points[1:]: if point[1] < min_y_pt[1] or (point[1] == min_y_pt[1] and point[0] < min_y_pt[0]): min_y_pt = point return min_y_pt def add_point(vector, element): """ Returns vector with the given element append to the right """ vector.append(element) return vector def remove_point(vector, element): """ Returns a copy of vector without the given element """ vector.pop(vector.index(element)) return vector def euclidean_distance(point1, point2): """ Returns the euclidean distance of the 2 given points. :param point1: tuple (x, y) :param point2: tuple (x, y) :return: float """ return math.sqrt(math.pow(point1[0] - point2[0], 2) + math.pow(point1[1] - point2[1], 2)) def nearest_points(list_of_points, point, k): """ Returns a list of the indices of the k closest neighbors from list_of_points to the specified point. The measure of proximity is the Euclidean distance. Internally, k becomes the minimum between the given value for k and the number of points in list_of_points :param list_of_points: list of tuples :param point: tuple (x, y) :param k: integer :return: list of k tuples """ # build a list of tuples of distances between point *point* and every point in *list_of_points*, and # their respective index of list *list_of_distances* list_of_distances = [] for index in range(len(list_of_points)): list_of_distances.append((euclidean_distance(list_of_points[index], point), index)) # sort distances in ascending order list_of_distances.sort() # get the k nearest neighbors of point nearest_list = [] for index in range(min(k, len(list_of_points))): nearest_list.append((list_of_points[list_of_distances[index][1]])) return nearest_list def angle(from_point, to_point): """ Returns the angle of the directed line segment, going from *from_point* to *to_point*, in radians. The angle is positive for segments with upward direction (north), otherwise negative (south). Values ranges from 0 at the right (east) to pi at the left side (west). :param from_point: tuple (x, y) :param to_point: tuple (x, y) :return: float """ return math.atan2(to_point[1] - from_point[1], to_point[0] - from_point[0]) def angle_difference(angle1, angle2): """ Calculates the difference between the given angles in clockwise direction as radians. :param angle1: float :param angle2: float :return: float; between 0 and 2*Pi """ if (angle1 > 0 and angle2 >= 0) and angle1 > angle2: return abs(angle1 - angle2) elif (angle1 >= 0 and angle2 > 0) and angle1 < angle2: return 2 * math.pi + angle1 - angle2 elif (angle1 < 0 and angle2 <= 0) and angle1 < angle2: return 2 * math.pi + angle1 + abs(angle2) elif (angle1 <= 0 and angle2 < 0) and angle1 > angle2: return abs(angle1 - angle2) elif angle1 <= 0 < angle2: return 2 * math.pi + angle1 - angle2 elif angle1 >= 0 >= angle2: return angle1 + abs(angle2) else: return 0 def intersect(line1, line2): """ Returns True if the two given line segments intersect each other, and False otherwise. :param line1: 2-tuple of tuple (x, y) :param line2: 2-tuple of tuple (x, y) :return: boolean """ a1 = line1[1][1] - line1[0][1] b1 = line1[0][0] - line1[1][0] c1 = a1 * line1[0][0] + b1 * line1[0][1] a2 = line2[1][1] - line2[0][1] b2 = line2[0][0] - line2[1][0] c2 = a2 * line2[0][0] + b2 * line2[0][1] tmp = (a1 * b2 - a2 * b1) if tmp == 0: return False sx = (c1 * b2 - c2 * b1) / tmp if (sx > line1[0][0] and sx > line1[1][0]) or (sx > line2[0][0] and sx > line2[1][0]) or\ (sx < line1[0][0] and sx < line1[1][0]) or (sx < line2[0][0] and sx < line2[1][0]): return False sy = (a1 * c2 - a2 * c1) / tmp if (sy > line1[0][1] and sy > line1[1][1]) or (sy > line2[0][1] and sy > line2[1][1]) or\ (sy < line1[0][1] and sy < line1[1][1]) or (sy < line2[0][1] and sy < line2[1][1]): return False return True def point_in_polygon_q(point, list_of_points): """ Return True if given point *point* is laying in the polygon described by the vertices *list_of_points*, otherwise False Based on the "Ray Casting Method" described by Joel Lawhead in this blog article: http://geospatialpython.com/2011/01/point-in-polygon.html """ x = point[0] y = point[1] poly = [(pt[0], pt[1]) for pt in list_of_points] n = len(poly) inside = False p1x, p1y = poly[0] for i in range(n + 1): p2x, p2y = poly[i % n] if y > min(p1y, p2y): if y <= max(p1y, p2y): if x <= max(p1x, p2x): if p1y != p2y: xints = (y - p1y) * (p2x - p1x) / (p2y - p1y) + p1x if p1x == p2x or x <= xints: inside = not inside p1x, p1y = p2x, p2y return inside def extract_points(geom): """ Generate list of QgsPoints from QgsGeometry *geom* ( can be point, line, or polygon ) Code taken from fTools plugin :param geom: an arbitrary geometry feature :return: list of points """ multi_geom = QgsGeometry() temp_geom = [] # point geometry if geom.type() == 0: if geom.isMultipart(): temp_geom = geom.asMultiPoint() else: temp_geom.append(geom.asPoint()) # line geometry if geom.type() == 1: # if multipart feature explode to single part if geom.isMultipart(): multi_geom = geom.asMultiPolyline() for i in multi_geom: temp_geom.extend(i) else: temp_geom = geom.asPolyline() # polygon geometry elif geom.type() == 2: # if multipart feature explode to single part if geom.isMultipart(): multi_geom = geom.asMultiPolygon() # now single part polygons for i in multi_geom: # explode to line segments for j in i: temp_geom.extend(j) else: multi_geom = geom.asPolygon() # explode to line segments for i in multi_geom: temp_geom.extend(i) return temp_geom def sort_by_angle(list_of_points, last_point, last_angle): """ returns the points in list_of_points in descending order of angle to the last segment of the envelope, measured in a clockwise direction. Thus, the rightmost of the neighboring points is always selected. The first point of this list will be the next point of the envelope. """ def getkey(item): return angle_difference(last_angle, angle(last_point, item)) vertex_list = sorted(list_of_points, key=getkey, reverse=True) return vertex_list def concave_hull(points_list, k): """ Calculates a valid concave hull polygon containing all given points. The algorithm searches for that point in the neighborhood of k nearest neighbors which maximizes the rotation angle in clockwise direction without intersecting any previous line segments. This is an implementation of the algorithm described by Adriano Moreira and Maribel Yasmina Santos: CONCAVE HULL: A neighborhood_k-NEAREST NEIGHBORS APPROACH FOR THE COMPUTATION OF THE REGION OCCUPIED BY A SET OF POINTS. GRAPP 2007 - International Conference on Computer Graphics Theory and Applications; pp 61-68. :param points_list: list of tuples (x, y) :param k: integer :return: list of tuples (x, y) """ # return an empty list if not enough points are given if k > len(points_list): k = len(points_list) # the number of nearest neighbors k must be greater than or equal to 3 kk = max(k, 3) # delete duplicate points point_set = clean_list(points_list) # if point_set has less then 3 points no polygon can be created and an empty list will be returned if len(point_set) < 3: return None # if point_set has 3 points then these are already vertices of the hull. Append the first point to # close the hull polygon if len(point_set) == 3: return add_point(point_set, point_set[0]) # make sure that k neighbors can be found kk = min(kk, len(point_set)) # start with the point having the smallest y-coordinate (most southern point) first_point = find_min_y_point(point_set) # add this points as the first vertex of the hull hull = [first_point] # make the first vertex of the hull to the current point current_point = first_point # remove the point from the point_set, to prevent him being among the nearest points point_set = remove_point(point_set, first_point) previous_angle = math.pi # step counts the number of segments step = 2 # as long as point_set is not empty or search is returning to the starting point while (current_point != first_point) or (step == 2) and (len(point_set) > 0): # after 3 iterations add the first point to point_set again, otherwise a hull cannot be closed if step == 5: point_set = add_point(point_set, first_point) # search the k nearest neighbors of the current point k_nearest_points = nearest_points(point_set, current_point, kk) # sort the candidates (neighbors) in descending order of right-hand turn. This way the algorithm progresses # in clockwise direction through as many points as possible c_points = sort_by_angle(k_nearest_points, current_point, previous_angle) its = True i = -1 # search for the nearest point to which the connecting line does not intersect any existing segment while its is True and (i < len(c_points) - 1): i += 1 if c_points[i] == first_point: last_point = 1 else: last_point = 0 j = 2 its = False while its is False and (j < len(hull) - last_point): its = intersect((hull[step - 2], c_points[i]), (hull[step - 2 - j], hull[step - 1 - j])) j += 1 # there is no candidate to which the connecting line does not intersect any existing segment, so the # for the next candidate fails. The algorithm starts again with an increased number of neighbors if its is True: return concave_hull(points_list, kk + 1) # the first point which complies with the requirements is added to the hull and gets the current point current_point = c_points[i] hull = add_point(hull, current_point) # calculate the angle between the last vertex and his precursor, that is the last segment of the hull # in reversed direction previous_angle = angle(hull[step - 1], hull[step - 2]) # remove current_point from point_set point_set = remove_point(point_set, current_point) # increment counter step += 1 all_inside = True i = len(point_set) - 1 # check if all points are within the created polygon while (all_inside is True) and (i >= 0): all_inside = point_in_polygon_q(point_set[i], hull) i -= 1 # since at least one point is out of the computed polygon, try again with a higher number of neighbors if all_inside is False: return concave_hull(points_list, kk + 1) # a valid hull has been constructed return hull
gpl-2.0
rishizek/deep-learning
transfer-learning/tensorflow_vgg/test_vgg19_trainable.py
152
1435
""" Simple tester for the vgg19_trainable """ import tensorflow as tf from tensoflow_vgg import vgg19_trainable as vgg19 from tensoflow_vgg import utils img1 = utils.load_image("./test_data/tiger.jpeg") img1_true_result = [1 if i == 292 else 0 for i in range(1000)] # 1-hot result for tiger batch1 = img1.reshape((1, 224, 224, 3)) with tf.device('/cpu:0'): sess = tf.Session() images = tf.placeholder(tf.float32, [1, 224, 224, 3]) true_out = tf.placeholder(tf.float32, [1, 1000]) train_mode = tf.placeholder(tf.bool) vgg = vgg19.Vgg19('./vgg19.npy') vgg.build(images, train_mode) # print number of variables used: 143667240 variables, i.e. ideal size = 548MB print(vgg.get_var_count()) sess.run(tf.global_variables_initializer()) # test classification prob = sess.run(vgg.prob, feed_dict={images: batch1, train_mode: False}) utils.print_prob(prob[0], './synset.txt') # simple 1-step training cost = tf.reduce_sum((vgg.prob - true_out) ** 2) train = tf.train.GradientDescentOptimizer(0.0001).minimize(cost) sess.run(train, feed_dict={images: batch1, true_out: [img1_true_result], train_mode: True}) # test classification again, should have a higher probability about tiger prob = sess.run(vgg.prob, feed_dict={images: batch1, train_mode: False}) utils.print_prob(prob[0], './synset.txt') # test save vgg.save_npy(sess, './test-save.npy')
mit
mathemage/h2o-3
h2o-py/h2o/transforms/preprocessing.py
4
6756
from .transform_base import H2OTransformer import warnings class H2OScaler(H2OTransformer): """ Standardize an H2OFrame by demeaning and scaling each column. The default scaling will result in an H2OFrame with columns having zero mean and unit variance. Users may specify the centering and scaling values used in the standardization of the H2OFrame. """ def __init__(self, center=True, scale=True): """ :param center: A boolean or list of numbers. If True, then columns will be demeaned before scaling. If False, then columns will not be demeaned before scaling. If centers is an array of numbers, then len(centers) must match the number of columns in the dataset. Each value is removed from the respective column before scaling. :param scale: A boolean or list of numbers. If True, then columns will be scaled by the column's standard deviation. If False, then columns will not be scaled. If scales is an array, then len(scales) must match the number of columns in the dataset. Each column is scaled by the respective value in this array. :returns: An instance of H2OScaler. """ self.parms = locals() self.parms = {k: v for k, v in self.parms.items() if k != "self"} if center is None or scale is None: raise ValueError("centers and scales must not be None.") self._means = None self._stds = None @property def means(self): return self._means @property def stds(self): return self._stds def fit(self, X, y=None, **params): """ Fit this object by computing the means and standard deviations used by the transform method. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: Ignored :returns: This H2OScaler instance """ if isinstance(self.parms["center"], (tuple, list)): self._means = self.parms["center"] if isinstance(self.parms["scale"], (tuple, list)): self._stds = self.parms["scale"] if self.means is None and self.parms["center"]: self._means = X.mean(return_frame=True).getrow() else: self._means = False if self.stds is None and self.parms["scale"]: self._stds = X.sd() else: self._stds = False return self def transform(self, X, y=None, **params): """ Scale an H2OFrame with the fitted means and standard deviations. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: (Ignored) :returns: A scaled H2OFrame. """ return X.scale(self.means, self.stds) def inverse_transform(self, X, y=None, **params): """ Undo the scale transformation. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: (Ignored) :returns: An H2OFrame """ for i in range(X.ncol): X[i] = self.means[i] + self.stds[i] * X[i] return X class H2OColSelect(H2OTransformer): def __init__(self, cols): self.cols = cols def fit(self, X, y=None, **params): return self def transform(self, X, y=None, **params): return X[self.cols] def to_rest(self, step_name): args = [step_name, "H2OColSelect", ("(cols_py dummy %r)" % self.cols), False, "|"] return super(H2OColSelect, self).to_rest(args) class H2OColOp(H2OTransformer): """ Perform a column operation. If inplace is True, then cbind the result onto original frame, otherwise, perform the operation in place. """ def __init__(self, op, col=None, inplace=True, new_col_name=None, **params): self.fun = op self.col = col self.inplace = inplace self.params = params self.new_col_name = new_col_name if inplace and new_col_name is not None: warnings.warn("inplace was False, but new_col_name was not empty. Ignoring new_col_name.") if isinstance(col, (list, tuple)): raise ValueError("col must be None or a single column.") def fit(self, X, y=None, **params): return self def transform(self, X, y=None, **params): res = H2OColOp._transform_helper(X, params) if self.inplace: X[self.col] = res else: return X.cbind(res) return X def _transform_helper(self, X, **params): if not self.params: if self.col is not None: res = self.fun(X[self.col]) else: res = self.fun(X) else: if self.col is not None: res = self.fun(X[self.col], **self.params) else: res = self.fun(X, **self.params) return res def to_rest(self, step_name): ast = self._transform_helper(self._dummy_frame())._ex._to_string() new_col_names = self.new_col_name if new_col_names is None: new_col_names = ["|"] elif not isinstance(new_col_names, (list, tuple)): new_col_names = [new_col_names] return super(H2OColOp, self).to_rest( [step_name, self.__class__.__name__, ast, self.inplace, "|".join(new_col_names)]) class H2OBinaryOp(H2OColOp): """Perform a binary operation on a column. If left is None, then the column will appear on the left in the operation; otherwise it will be appear on the right. A ValueError is raised if both left and right are None. """ def __init__(self, op, col, inplace=True, new_col_name=None, left=None, right=None, **params): super(H2OBinaryOp, self).__init__(op, col, inplace, new_col_name, **params) self.left_is_col = isinstance(left, H2OCol) self.right_is_col = isinstance(right, H2OCol) self.left = left self.right = right if left is None and right is None: raise ValueError("left and right cannot both be None") def _transform_helper(self, X, **params): if self.left is None: return self.fun(X[self.col], X[self.right.col] if self.right_is_col else self.right) return self.fun(X[self.left.col] if self.left_is_col else self.left, X[self.col]) class H2OCol(object): """ Wrapper class for H2OBinaryOp step's left/right args. Use if you want to signal that a column actually comes from the train to be fitted on. """ def __init__(self, column): self.col = column # TODO: handle arbitrary (non H2OFrame) inputs -- sql, web, file, generated
apache-2.0
mxOBS/deb-pkg_trusty_chromium-browser
native_client/tools/process_perf_output.py
11
4450
#!/usr/bin/python # Copyright (c) 2011 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re import sys # Process log output from various components (e.g., sel_ldr, browser tester), # line-by-line and prints out a summary of TIME performance measurements. # # ================ # LOG INPUTS: # ================ # Logs can contain information from any number of Sources. # # For example, the sel_ldr logs and browser test logs might be Sources. # # This processor expects to match at least one line of info from each # Source. If a source does not provide any events, then this is an error # (the motivation being that we will pick up on log format changes this way). # TODO(jvoung): Allow an escape hatch for some Sources. # # Each Eventful line with time info should contain: # # (a) an event name # (b) a time value # # The time values can be in any unit, but will be converted to millisecs. # # NOTE: If multiple events with the same event name are present, then # the time values will be summed. This is useful, for example, to get the # total validation time of all dynamic libraries that are loaded. # However, this means that if a nexe is loaded twice, then the two time # values will get merged into one. # TODO(jvoung): provide a mechanism to split multiple merged event streams. # # ================ # SUMMARY OUTPUT: # ================ # Should be formatted according to the chrome buildbot format. def GetEventPatterns(): return [ # NaClPerfCounterInterval (${SERIES} ${EVENT_A}:*${EVENT_B}): N microsecs # --> # RESULT ${GRAPH}: ${EVENT_B}_${SETUP_INFO}= N/1000 ms # Thus, this assumes that the EVENT_B provides the useful name # E.g., EVENT_A might be "Pre-Validation" # while EVENT_B is "Validation" (so this times validation) # Note, there is an asterisk in EVENT_B to indicate that it is important # enough to be included here. Pattern('SelLdr', 'NaClPerfCounterInterval\(.*:\*(.*)\): (\d+) microsecs', 1, 2, 0.001), # NaClPerf [${EVENT_NAME}]: N millisecs # --> # RESULT ${GRAPH}: ${EVENT_NAME}_${SETUP_INFO}= N ms Pattern('BrowserTester', 'NaClPerf \[(.*)\] (\d+\.*\d*) millisecs', 1, 2, 1.0), ] class Pattern(object): def __init__(self, name, patternRE, eventIndex, timeIndex, scaleToMilli): self.name = name self.re = re.compile(patternRE) self.eventIndex = eventIndex self.timeIndex = timeIndex self.scaleToMilli = scaleToMilli self.didMatch = False self.accumulatedTimes = {} def _eventLabel(self, match): return match.group(self.eventIndex) def _timeInMillis(self, match): return float(match.group(self.timeIndex)) * self.scaleToMilli def _match(self, s): return self.re.search(s) def ProcessLine(self, line): match = self._match(line) if not match: return False self.didMatch = True event = self._eventLabel(match) time = self._timeInMillis(match) # Sum up the times for a particular event. self.accumulatedTimes[event] = self.accumulatedTimes.get(event, 0) + time return True def SanityCheck(self): # Make sure all patterns matched at least once. if not self.didMatch: sys.stderr.write(('Pattern for %s did not match anything.\n' 'Perhaps the format has changed.\n') % self.name) assert False def PrintSummary(self, graph_label, trace_label_extra): for event, time in self.accumulatedTimes.iteritems(): sys.stdout.write('RESULT %s: %s_%s= %f ms\n' % (graph_label, event, trace_label_extra, time)) def Main(): usage = 'usage: %prog graphLabel traceExtra < stdin\n' if len(sys.argv) != 3: sys.stderr.write(usage) return 1 graph_label = sys.argv[1] trace_label_extra = sys.argv[2] event_patterns = GetEventPatterns() for line in sys.stdin.readlines(): for pat in event_patterns: if pat.ProcessLine(line): continue # Also echo the original data for debugging. sys.stdout.write(line) # Print the summary in the end. for pat in event_patterns: pat.SanityCheck() pat.PrintSummary(graph_label, trace_label_extra) return 0 if __name__ == '__main__': sys.exit(Main())
bsd-3-clause
westinedu/newertrends
django/contrib/comments/moderation.py
246
13528
""" A generic comment-moderation system which allows configuration of moderation options on a per-model basis. To use, do two things: 1. Create or import a subclass of ``CommentModerator`` defining the options you want. 2. Import ``moderator`` from this module and register one or more models, passing the models and the ``CommentModerator`` options class you want to use. Example ------- First, we define a simple model class which might represent entries in a Weblog:: from django.db import models class Entry(models.Model): title = models.CharField(maxlength=250) body = models.TextField() pub_date = models.DateField() enable_comments = models.BooleanField() Then we create a ``CommentModerator`` subclass specifying some moderation options:: from django.contrib.comments.moderation import CommentModerator, moderator class EntryModerator(CommentModerator): email_notification = True enable_field = 'enable_comments' And finally register it for moderation:: moderator.register(Entry, EntryModerator) This sample class would apply two moderation steps to each new comment submitted on an Entry: * If the entry's ``enable_comments`` field is set to ``False``, the comment will be rejected (immediately deleted). * If the comment is successfully posted, an email notification of the comment will be sent to site staff. For a full list of built-in moderation options and other configurability, see the documentation for the ``CommentModerator`` class. """ import datetime from django.conf import settings from django.core.mail import send_mail from django.contrib.comments import signals from django.db.models.base import ModelBase from django.template import Context, loader from django.contrib import comments from django.contrib.sites.models import Site class AlreadyModerated(Exception): """ Raised when a model which is already registered for moderation is attempting to be registered again. """ pass class NotModerated(Exception): """ Raised when a model which is not registered for moderation is attempting to be unregistered. """ pass class CommentModerator(object): """ Encapsulates comment-moderation options for a given model. This class is not designed to be used directly, since it doesn't enable any of the available moderation options. Instead, subclass it and override attributes to enable different options:: ``auto_close_field`` If this is set to the name of a ``DateField`` or ``DateTimeField`` on the model for which comments are being moderated, new comments for objects of that model will be disallowed (immediately deleted) when a certain number of days have passed after the date specified in that field. Must be used in conjunction with ``close_after``, which specifies the number of days past which comments should be disallowed. Default value is ``None``. ``auto_moderate_field`` Like ``auto_close_field``, but instead of outright deleting new comments when the requisite number of days have elapsed, it will simply set the ``is_public`` field of new comments to ``False`` before saving them. Must be used in conjunction with ``moderate_after``, which specifies the number of days past which comments should be moderated. Default value is ``None``. ``close_after`` If ``auto_close_field`` is used, this must specify the number of days past the value of the field specified by ``auto_close_field`` after which new comments for an object should be disallowed. Default value is ``None``. ``email_notification`` If ``True``, any new comment on an object of this model which survives moderation will generate an email to site staff. Default value is ``False``. ``enable_field`` If this is set to the name of a ``BooleanField`` on the model for which comments are being moderated, new comments on objects of that model will be disallowed (immediately deleted) whenever the value of that field is ``False`` on the object the comment would be attached to. Default value is ``None``. ``moderate_after`` If ``auto_moderate_field`` is used, this must specify the number of days past the value of the field specified by ``auto_moderate_field`` after which new comments for an object should be marked non-public. Default value is ``None``. Most common moderation needs can be covered by changing these attributes, but further customization can be obtained by subclassing and overriding the following methods. Each method will be called with three arguments: ``comment``, which is the comment being submitted, ``content_object``, which is the object the comment will be attached to, and ``request``, which is the ``HttpRequest`` in which the comment is being submitted:: ``allow`` Should return ``True`` if the comment should be allowed to post on the content object, and ``False`` otherwise (in which case the comment will be immediately deleted). ``email`` If email notification of the new comment should be sent to site staff or moderators, this method is responsible for sending the email. ``moderate`` Should return ``True`` if the comment should be moderated (in which case its ``is_public`` field will be set to ``False`` before saving), and ``False`` otherwise (in which case the ``is_public`` field will not be changed). Subclasses which want to introspect the model for which comments are being moderated can do so through the attribute ``_model``, which will be the model class. """ auto_close_field = None auto_moderate_field = None close_after = None email_notification = False enable_field = None moderate_after = None def __init__(self, model): self._model = model def _get_delta(self, now, then): """ Internal helper which will return a ``datetime.timedelta`` representing the time between ``now`` and ``then``. Assumes ``now`` is a ``datetime.date`` or ``datetime.datetime`` later than ``then``. If ``now`` and ``then`` are not of the same type due to one of them being a ``datetime.date`` and the other being a ``datetime.datetime``, both will be coerced to ``datetime.date`` before calculating the delta. """ if now.__class__ is not then.__class__: now = datetime.date(now.year, now.month, now.day) then = datetime.date(then.year, then.month, then.day) if now < then: raise ValueError("Cannot determine moderation rules because date field is set to a value in the future") return now - then def allow(self, comment, content_object, request): """ Determine whether a given comment is allowed to be posted on a given object. Return ``True`` if the comment should be allowed, ``False otherwise. """ if self.enable_field: if not getattr(content_object, self.enable_field): return False if self.auto_close_field and self.close_after is not None: close_after_date = getattr(content_object, self.auto_close_field) if close_after_date is not None and self._get_delta(datetime.datetime.now(), close_after_date).days >= self.close_after: return False return True def moderate(self, comment, content_object, request): """ Determine whether a given comment on a given object should be allowed to show up immediately, or should be marked non-public and await approval. Return ``True`` if the comment should be moderated (marked non-public), ``False`` otherwise. """ if self.auto_moderate_field and self.moderate_after is not None: moderate_after_date = getattr(content_object, self.auto_moderate_field) if moderate_after_date is not None and self._get_delta(datetime.datetime.now(), moderate_after_date).days >= self.moderate_after: return True return False def email(self, comment, content_object, request): """ Send email notification of a new comment to site staff when email notifications have been requested. """ if not self.email_notification: return recipient_list = [manager_tuple[1] for manager_tuple in settings.MANAGERS] t = loader.get_template('comments/comment_notification_email.txt') c = Context({ 'comment': comment, 'content_object': content_object }) subject = '[%s] New comment posted on "%s"' % (Site.objects.get_current().name, content_object) message = t.render(c) send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list, fail_silently=True) class Moderator(object): """ Handles moderation of a set of models. An instance of this class will maintain a list of one or more models registered for comment moderation, and their associated moderation classes, and apply moderation to all incoming comments. To register a model, obtain an instance of ``Moderator`` (this module exports one as ``moderator``), and call its ``register`` method, passing the model class and a moderation class (which should be a subclass of ``CommentModerator``). Note that both of these should be the actual classes, not instances of the classes. To cease moderation for a model, call the ``unregister`` method, passing the model class. For convenience, both ``register`` and ``unregister`` can also accept a list of model classes in place of a single model; this allows easier registration of multiple models with the same ``CommentModerator`` class. The actual moderation is applied in two phases: one prior to saving a new comment, and the other immediately after saving. The pre-save moderation may mark a comment as non-public or mark it to be removed; the post-save moderation may delete a comment which was disallowed (there is currently no way to prevent the comment being saved once before removal) and, if the comment is still around, will send any notification emails the comment generated. """ def __init__(self): self._registry = {} self.connect() def connect(self): """ Hook up the moderation methods to pre- and post-save signals from the comment models. """ signals.comment_will_be_posted.connect(self.pre_save_moderation, sender=comments.get_model()) signals.comment_was_posted.connect(self.post_save_moderation, sender=comments.get_model()) def register(self, model_or_iterable, moderation_class): """ Register a model or a list of models for comment moderation, using a particular moderation class. Raise ``AlreadyModerated`` if any of the models are already registered. """ if isinstance(model_or_iterable, ModelBase): model_or_iterable = [model_or_iterable] for model in model_or_iterable: if model in self._registry: raise AlreadyModerated("The model '%s' is already being moderated" % model._meta.module_name) self._registry[model] = moderation_class(model) def unregister(self, model_or_iterable): """ Remove a model or a list of models from the list of models whose comments will be moderated. Raise ``NotModerated`` if any of the models are not currently registered for moderation. """ if isinstance(model_or_iterable, ModelBase): model_or_iterable = [model_or_iterable] for model in model_or_iterable: if model not in self._registry: raise NotModerated("The model '%s' is not currently being moderated" % model._meta.module_name) del self._registry[model] def pre_save_moderation(self, sender, comment, request, **kwargs): """ Apply any necessary pre-save moderation steps to new comments. """ model = comment.content_type.model_class() if model not in self._registry: return content_object = comment.content_object moderation_class = self._registry[model] # Comment will be disallowed outright (HTTP 403 response) if not moderation_class.allow(comment, content_object, request): return False if moderation_class.moderate(comment, content_object, request): comment.is_public = False def post_save_moderation(self, sender, comment, request, **kwargs): """ Apply any necessary post-save moderation steps to new comments. """ model = comment.content_type.model_class() if model not in self._registry: return self._registry[model].email(comment, comment.content_object, request) # Import this instance in your own code to use in registering # your models for moderation. moderator = Moderator()
bsd-3-clause
DiamondLightSource/ispyb-api
tests/model/test_detector.py
1
1080
import ispyb.model.__future__ import ispyb.model.detector def test_detector(testdb, testconfig): ispyb.model.__future__.enable(testconfig) detector = testdb.get_detector(4) assert str(detector) == "Detector id: 4 (not yet loaded from database)" detector.load() assert detector.id == 4 assert detector.manufacturer == "In-house" assert detector.model == "Excalibur" assert detector.serial_number == "1109-434" assert detector.distance_min == 100 assert detector.distance_max == 300 assert ( str(detector) == """\ Detector id : 4 manufacturer : In-house model : Excalibur serial_number : 1109-434 pixel_size_horizontal : None pixel_size_vertical : None pixels_x : None pixels_y : None distance_min : 100.0 distance_max : 300.0""" ) def test_dc_detector(testdb, testconfig): ispyb.model.__future__.enable(testconfig) dc = testdb.get_data_collection(1066786) assert dc.detector is None
apache-2.0
Friedbaumer/litecoin
test/functional/net.py
28
4224
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPC calls related to net. Tests correspond to code in rpc/net.cpp. """ import time from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_raises_jsonrpc, connect_nodes_bi, p2p_port, ) class NetTest(BitcoinTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = True self.num_nodes = 2 def run_test(self): self._test_connection_count() self._test_getnettotals() self._test_getnetworkinginfo() self._test_getaddednodeinfo() self._test_getpeerinfo() def _test_connection_count(self): # connect_nodes_bi connects each node to the other assert_equal(self.nodes[0].getconnectioncount(), 2) def _test_getnettotals(self): # check that getnettotals totalbytesrecv and totalbytessent # are consistent with getpeerinfo peer_info = self.nodes[0].getpeerinfo() assert_equal(len(peer_info), 2) net_totals = self.nodes[0].getnettotals() assert_equal(sum([peer['bytesrecv'] for peer in peer_info]), net_totals['totalbytesrecv']) assert_equal(sum([peer['bytessent'] for peer in peer_info]), net_totals['totalbytessent']) # test getnettotals and getpeerinfo by doing a ping # the bytes sent/received should change # note ping and pong are 32 bytes each self.nodes[0].ping() time.sleep(0.1) peer_info_after_ping = self.nodes[0].getpeerinfo() net_totals_after_ping = self.nodes[0].getnettotals() for before, after in zip(peer_info, peer_info_after_ping): assert_equal(before['bytesrecv_per_msg']['pong'] + 32, after['bytesrecv_per_msg']['pong']) assert_equal(before['bytessent_per_msg']['ping'] + 32, after['bytessent_per_msg']['ping']) assert_equal(net_totals['totalbytesrecv'] + 32*2, net_totals_after_ping['totalbytesrecv']) assert_equal(net_totals['totalbytessent'] + 32*2, net_totals_after_ping['totalbytessent']) def _test_getnetworkinginfo(self): assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True) assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2) self.nodes[0].setnetworkactive(False) assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], False) timeout = 3 while self.nodes[0].getnetworkinfo()['connections'] != 0: # Wait a bit for all sockets to close assert timeout > 0, 'not all connections closed in time' timeout -= 0.1 time.sleep(0.1) self.nodes[0].setnetworkactive(True) connect_nodes_bi(self.nodes, 0, 1) assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True) assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2) def _test_getaddednodeinfo(self): assert_equal(self.nodes[0].getaddednodeinfo(), []) # add a node (node2) to node0 ip_port = "127.0.0.1:{}".format(p2p_port(2)) self.nodes[0].addnode(ip_port, 'add') # check that the node has indeed been added added_nodes = self.nodes[0].getaddednodeinfo(ip_port) assert_equal(len(added_nodes), 1) assert_equal(added_nodes[0]['addednode'], ip_port) # check that a non-existant node returns an error assert_raises_jsonrpc(-24, "Node has not been added", self.nodes[0].getaddednodeinfo, '1.1.1.1') def _test_getpeerinfo(self): peer_info = [x.getpeerinfo() for x in self.nodes] # check both sides of bidirectional connection between nodes # the address bound to on one side will be the source address for the other node assert_equal(peer_info[0][0]['addrbind'], peer_info[1][0]['addr']) assert_equal(peer_info[1][0]['addrbind'], peer_info[0][0]['addr']) if __name__ == '__main__': NetTest().main()
mit
suttond/MODOI
ase/utils/deprecate.py
12
1411
import warnings class Deprecate: def __init__(self, obj, name, newmodule, oldmodule='ase'): self.obj = obj self.name = name self.newmodule = newmodule self.oldmodule = oldmodule def __call__(self, *args, **kwargs): message = ('%s.%s is deprecated, use %s.%s instead' % (self.oldmodule, self.name, self.newmodule, self.name)) warnings.warn(message, DeprecationWarning, stacklevel=2) return self.obj(*args, **kwargs) def _dep(method): def _method(self, *args): message = ('ase.%s is deprecated, use %s.%s instead' % (self.name, self.newmodule, self.name)) warnings.warn(message, DeprecationWarning, stacklevel=2) return method(self, *args) return _method class DeprecatedFloat(float): def __new__(cls, value, name, newmodule): return float.__new__(cls, value) def __init__(self, value, name, newmodule): self.name = name self.newmodule = newmodule __mul__ = _dep(float.__mul__) __rmul__ = _dep(float.__rmul__) __div__ = _dep(float.__div__) __rdiv__ = _dep(float.__rdiv__) class DeprecatedNumpyImport: def __init__(self): import numpy self.numpy = numpy def __getattr__(self, key): warnings.warn('ase.np is deprecated; use import numpy as np instead') return getattr(self.numpy, key)
lgpl-3.0
joequery/django
django/contrib/sessions/backends/db.py
227
3637
import logging from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, router, transaction from django.utils import timezone from django.utils.encoding import force_text from django.utils.functional import cached_property class SessionStore(SessionBase): """ Implements database session store. """ def __init__(self, session_key=None): super(SessionStore, self).__init__(session_key) @classmethod def get_model_class(cls): # Avoids a circular import and allows importing SessionStore when # django.contrib.sessions is not in INSTALLED_APPS. from django.contrib.sessions.models import Session return Session @cached_property def model(self): return self.get_model_class() def load(self): try: s = self.model.objects.get( session_key=self.session_key, expire_date__gt=timezone.now() ) return self.decode(s.session_data) except (self.model.DoesNotExist, SuspiciousOperation) as e: if isinstance(e, SuspiciousOperation): logger = logging.getLogger('django.security.%s' % e.__class__.__name__) logger.warning(force_text(e)) self._session_key = None return {} def exists(self, session_key): return self.model.objects.filter(session_key=session_key).exists() def create(self): while True: self._session_key = self._get_new_session_key() try: # Save immediately to ensure we have a unique entry in the # database. self.save(must_create=True) except CreateError: # Key wasn't unique. Try again. continue self.modified = True return def create_model_instance(self, data): """ Return a new instance of the session model object, which represents the current session state. Intended to be used for saving the session data to the database. """ return self.model( session_key=self._get_or_create_session_key(), session_data=self.encode(data), expire_date=self.get_expiry_date(), ) def save(self, must_create=False): """ Saves the current session data to the database. If 'must_create' is True, a database error will be raised if the saving operation doesn't create a *new* entry (as opposed to possibly updating an existing entry). """ if self.session_key is None: return self.create() data = self._get_session(no_load=must_create) obj = self.create_model_instance(data) using = router.db_for_write(self.model, instance=obj) try: with transaction.atomic(using=using): obj.save(force_insert=must_create, using=using) except IntegrityError: if must_create: raise CreateError raise def delete(self, session_key=None): if session_key is None: if self.session_key is None: return session_key = self.session_key try: self.model.objects.get(session_key=session_key).delete() except self.model.DoesNotExist: pass @classmethod def clear_expired(cls): cls.get_model_class().objects.filter(expire_date__lt=timezone.now()).delete()
bsd-3-clause
eharney/nova
nova/openstack/common/timeutils.py
83
6305
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ Time related utilities and helper functions. """ import calendar import datetime import time import iso8601 import six # ISO 8601 extended time format with microseconds _ISO8601_TIME_FORMAT_SUBSECOND = '%Y-%m-%dT%H:%M:%S.%f' _ISO8601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S' PERFECT_TIME_FORMAT = _ISO8601_TIME_FORMAT_SUBSECOND def isotime(at=None, subsecond=False): """Stringify time in ISO 8601 format.""" if not at: at = utcnow() st = at.strftime(_ISO8601_TIME_FORMAT if not subsecond else _ISO8601_TIME_FORMAT_SUBSECOND) tz = at.tzinfo.tzname(None) if at.tzinfo else 'UTC' st += ('Z' if tz == 'UTC' else tz) return st def parse_isotime(timestr): """Parse time from ISO 8601 format.""" try: return iso8601.parse_date(timestr) except iso8601.ParseError as e: raise ValueError(six.text_type(e)) except TypeError as e: raise ValueError(six.text_type(e)) def strtime(at=None, fmt=PERFECT_TIME_FORMAT): """Returns formatted utcnow.""" if not at: at = utcnow() return at.strftime(fmt) def parse_strtime(timestr, fmt=PERFECT_TIME_FORMAT): """Turn a formatted time back into a datetime.""" return datetime.datetime.strptime(timestr, fmt) def normalize_time(timestamp): """Normalize time in arbitrary timezone to UTC naive object.""" offset = timestamp.utcoffset() if offset is None: return timestamp return timestamp.replace(tzinfo=None) - offset def is_older_than(before, seconds): """Return True if before is older than seconds.""" if isinstance(before, six.string_types): before = parse_strtime(before).replace(tzinfo=None) else: before = before.replace(tzinfo=None) return utcnow() - before > datetime.timedelta(seconds=seconds) def is_newer_than(after, seconds): """Return True if after is newer than seconds.""" if isinstance(after, six.string_types): after = parse_strtime(after).replace(tzinfo=None) else: after = after.replace(tzinfo=None) return after - utcnow() > datetime.timedelta(seconds=seconds) def utcnow_ts(): """Timestamp version of our utcnow function.""" if utcnow.override_time is None: # NOTE(kgriffs): This is several times faster # than going through calendar.timegm(...) return int(time.time()) return calendar.timegm(utcnow().timetuple()) def utcnow(): """Overridable version of utils.utcnow.""" if utcnow.override_time: try: return utcnow.override_time.pop(0) except AttributeError: return utcnow.override_time return datetime.datetime.utcnow() def iso8601_from_timestamp(timestamp): """Returns a iso8601 formatted date from timestamp.""" return isotime(datetime.datetime.utcfromtimestamp(timestamp)) utcnow.override_time = None def set_time_override(override_time=None): """Overrides utils.utcnow. Make it return a constant time or a list thereof, one at a time. :param override_time: datetime instance or list thereof. If not given, defaults to the current UTC time. """ utcnow.override_time = override_time or datetime.datetime.utcnow() def advance_time_delta(timedelta): """Advance overridden time using a datetime.timedelta.""" assert(not utcnow.override_time is None) try: for dt in utcnow.override_time: dt += timedelta except TypeError: utcnow.override_time += timedelta def advance_time_seconds(seconds): """Advance overridden time by seconds.""" advance_time_delta(datetime.timedelta(0, seconds)) def clear_time_override(): """Remove the overridden time.""" utcnow.override_time = None def marshall_now(now=None): """Make an rpc-safe datetime with microseconds. Note: tzinfo is stripped, but not required for relative times. """ if not now: now = utcnow() return dict(day=now.day, month=now.month, year=now.year, hour=now.hour, minute=now.minute, second=now.second, microsecond=now.microsecond) def unmarshall_time(tyme): """Unmarshall a datetime dict.""" return datetime.datetime(day=tyme['day'], month=tyme['month'], year=tyme['year'], hour=tyme['hour'], minute=tyme['minute'], second=tyme['second'], microsecond=tyme['microsecond']) def delta_seconds(before, after): """Return the difference between two timing objects. Compute the difference in seconds between two date, time, or datetime objects (as a float, to microsecond resolution). """ delta = after - before return total_seconds(delta) def total_seconds(delta): """Return the total seconds of datetime.timedelta object. Compute total seconds of datetime.timedelta, datetime.timedelta doesn't have method total_seconds in Python2.6, calculate it manually. """ try: return delta.total_seconds() except AttributeError: return ((delta.days * 24 * 3600) + delta.seconds + float(delta.microseconds) / (10 ** 6)) def is_soon(dt, window): """Determines if time is going to happen in the next window seconds. :param dt: the time :param window: minimum seconds to remain to consider the time not soon :return: True if expiration is within the given duration """ soon = (utcnow() + datetime.timedelta(seconds=window)) return normalize_time(dt) <= soon
apache-2.0
gauribhoite/personfinder
env/google_appengine/google/appengine/_internal/django/utils/termcolors.py
417
6885
""" termcolors.py """ color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white') foreground = dict([(color_names[x], '3%s' % x) for x in range(8)]) background = dict([(color_names[x], '4%s' % x) for x in range(8)]) RESET = '0' opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'reverse': '7', 'conceal': '8'} def colorize(text='', opts=(), **kwargs): """ Returns your text, enclosed in ANSI graphics codes. Depends on the keyword arguments 'fg' and 'bg', and the contents of the opts tuple/list. Returns the RESET code if no parameters are given. Valid colors: 'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white' Valid options: 'bold' 'underscore' 'blink' 'reverse' 'conceal' 'noreset' - string will not be auto-terminated with the RESET code Examples: colorize('hello', fg='red', bg='blue', opts=('blink',)) colorize() colorize('goodbye', opts=('underscore',)) print colorize('first line', fg='red', opts=('noreset',)) print 'this should be red too' print colorize('and so should this') print 'this should not be red' """ code_list = [] if text == '' and len(opts) == 1 and opts[0] == 'reset': return '\x1b[%sm' % RESET for k, v in kwargs.iteritems(): if k == 'fg': code_list.append(foreground[v]) elif k == 'bg': code_list.append(background[v]) for o in opts: if o in opt_dict: code_list.append(opt_dict[o]) if 'noreset' not in opts: text = text + '\x1b[%sm' % RESET return ('\x1b[%sm' % ';'.join(code_list)) + text def make_style(opts=(), **kwargs): """ Returns a function with default parameters for colorize() Example: bold_red = make_style(opts=('bold',), fg='red') print bold_red('hello') KEYWORD = make_style(fg='yellow') COMMENT = make_style(fg='blue', opts=('bold',)) """ return lambda text: colorize(text, opts, **kwargs) NOCOLOR_PALETTE = 'nocolor' DARK_PALETTE = 'dark' LIGHT_PALETTE = 'light' PALETTES = { NOCOLOR_PALETTE: { 'ERROR': {}, 'NOTICE': {}, 'SQL_FIELD': {}, 'SQL_COLTYPE': {}, 'SQL_KEYWORD': {}, 'SQL_TABLE': {}, 'HTTP_INFO': {}, 'HTTP_SUCCESS': {}, 'HTTP_REDIRECT': {}, 'HTTP_NOT_MODIFIED': {}, 'HTTP_BAD_REQUEST': {}, 'HTTP_NOT_FOUND': {}, 'HTTP_SERVER_ERROR': {}, }, DARK_PALETTE: { 'ERROR': { 'fg': 'red', 'opts': ('bold',) }, 'NOTICE': { 'fg': 'red' }, 'SQL_FIELD': { 'fg': 'green', 'opts': ('bold',) }, 'SQL_COLTYPE': { 'fg': 'green' }, 'SQL_KEYWORD': { 'fg': 'yellow' }, 'SQL_TABLE': { 'opts': ('bold',) }, 'HTTP_INFO': { 'opts': ('bold',) }, 'HTTP_SUCCESS': { }, 'HTTP_REDIRECT': { 'fg': 'green' }, 'HTTP_NOT_MODIFIED': { 'fg': 'cyan' }, 'HTTP_BAD_REQUEST': { 'fg': 'red', 'opts': ('bold',) }, 'HTTP_NOT_FOUND': { 'fg': 'yellow' }, 'HTTP_SERVER_ERROR': { 'fg': 'magenta', 'opts': ('bold',) }, }, LIGHT_PALETTE: { 'ERROR': { 'fg': 'red', 'opts': ('bold',) }, 'NOTICE': { 'fg': 'red' }, 'SQL_FIELD': { 'fg': 'green', 'opts': ('bold',) }, 'SQL_COLTYPE': { 'fg': 'green' }, 'SQL_KEYWORD': { 'fg': 'blue' }, 'SQL_TABLE': { 'opts': ('bold',) }, 'HTTP_INFO': { 'opts': ('bold',) }, 'HTTP_SUCCESS': { }, 'HTTP_REDIRECT': { 'fg': 'green', 'opts': ('bold',) }, 'HTTP_NOT_MODIFIED': { 'fg': 'green' }, 'HTTP_BAD_REQUEST': { 'fg': 'red', 'opts': ('bold',) }, 'HTTP_NOT_FOUND': { 'fg': 'red' }, 'HTTP_SERVER_ERROR': { 'fg': 'magenta', 'opts': ('bold',) }, } } DEFAULT_PALETTE = DARK_PALETTE def parse_color_setting(config_string): """Parse a DJANGO_COLORS environment variable to produce the system palette The general form of a pallete definition is: "palette;role=fg;role=fg/bg;role=fg,option,option;role=fg/bg,option,option" where: palette is a named palette; one of 'light', 'dark', or 'nocolor'. role is a named style used by Django fg is a background color. bg is a background color. option is a display options. Specifying a named palette is the same as manually specifying the individual definitions for each role. Any individual definitions following the pallete definition will augment the base palette definition. Valid roles: 'error', 'notice', 'sql_field', 'sql_coltype', 'sql_keyword', 'sql_table', 'http_info', 'http_success', 'http_redirect', 'http_bad_request', 'http_not_found', 'http_server_error' Valid colors: 'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white' Valid options: 'bold', 'underscore', 'blink', 'reverse', 'conceal' """ if not config_string: return PALETTES[DEFAULT_PALETTE] # Split the color configuration into parts parts = config_string.lower().split(';') palette = PALETTES[NOCOLOR_PALETTE].copy() for part in parts: if part in PALETTES: # A default palette has been specified palette.update(PALETTES[part]) elif '=' in part: # Process a palette defining string definition = {} # Break the definition into the role, # plus the list of specific instructions. # The role must be in upper case role, instructions = part.split('=') role = role.upper() styles = instructions.split(',') styles.reverse() # The first instruction can contain a slash # to break apart fg/bg. colors = styles.pop().split('/') colors.reverse() fg = colors.pop() if fg in color_names: definition['fg'] = fg if colors and colors[-1] in color_names: definition['bg'] = colors[-1] # All remaining instructions are options opts = tuple(s for s in styles if s in opt_dict.keys()) if opts: definition['opts'] = opts # The nocolor palette has all available roles. # Use that palette as the basis for determining # if the role is valid. if role in PALETTES[NOCOLOR_PALETTE] and definition: palette[role] = definition # If there are no colors specified, return the empty palette. if palette == PALETTES[NOCOLOR_PALETTE]: return None return palette
apache-2.0
mistercrunch/panoramix
superset/db_engine_specs/kylin.py
3
2219
# 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 file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. from datetime import datetime from typing import Optional from superset.db_engine_specs.base import BaseEngineSpec from superset.utils import core as utils class KylinEngineSpec(BaseEngineSpec): # pylint: disable=abstract-method """Dialect for Apache Kylin""" engine = "kylin" engine_name = "Apache Kylin" _time_grain_expressions = { None: "{col}", "PT1S": "CAST(FLOOR(CAST({col} AS TIMESTAMP) TO SECOND) AS TIMESTAMP)", "PT1M": "CAST(FLOOR(CAST({col} AS TIMESTAMP) TO MINUTE) AS TIMESTAMP)", "PT1H": "CAST(FLOOR(CAST({col} AS TIMESTAMP) TO HOUR) AS TIMESTAMP)", "P1D": "CAST(FLOOR(CAST({col} AS TIMESTAMP) TO DAY) AS DATE)", "P1W": "CAST(FLOOR(CAST({col} AS TIMESTAMP) TO WEEK) AS DATE)", "P1M": "CAST(FLOOR(CAST({col} AS TIMESTAMP) TO MONTH) AS DATE)", "P0.25Y": "CAST(FLOOR(CAST({col} AS TIMESTAMP) TO QUARTER) AS DATE)", "P1Y": "CAST(FLOOR(CAST({col} AS TIMESTAMP) TO YEAR) AS DATE)", } @classmethod def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]: tt = target_type.upper() if tt == utils.TemporalType.DATE: return f"CAST('{dttm.date().isoformat()}' AS DATE)" if tt == utils.TemporalType.TIMESTAMP: datetime_fomatted = dttm.isoformat(sep=" ", timespec="seconds") return f"""CAST('{datetime_fomatted}' AS TIMESTAMP)""" return None
apache-2.0
nagnath006/Soccer-Analytics
Soccer-Analytics/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py
2936
3291
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to Python # Shy Shalom - original C code # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .charsetgroupprober import CharSetGroupProber from .sbcharsetprober import SingleByteCharSetProber from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel, Latin5CyrillicModel, MacCyrillicModel, Ibm866Model, Ibm855Model) from .langgreekmodel import Latin7GreekModel, Win1253GreekModel from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel from .langthaimodel import TIS620ThaiModel from .langhebrewmodel import Win1255HebrewModel from .hebrewprober import HebrewProber class SBCSGroupProber(CharSetGroupProber): def __init__(self): CharSetGroupProber.__init__(self) self._mProbers = [ SingleByteCharSetProber(Win1251CyrillicModel), SingleByteCharSetProber(Koi8rModel), SingleByteCharSetProber(Latin5CyrillicModel), SingleByteCharSetProber(MacCyrillicModel), SingleByteCharSetProber(Ibm866Model), SingleByteCharSetProber(Ibm855Model), SingleByteCharSetProber(Latin7GreekModel), SingleByteCharSetProber(Win1253GreekModel), SingleByteCharSetProber(Latin5BulgarianModel), SingleByteCharSetProber(Win1251BulgarianModel), SingleByteCharSetProber(Latin2HungarianModel), SingleByteCharSetProber(Win1250HungarianModel), SingleByteCharSetProber(TIS620ThaiModel), ] hebrewProber = HebrewProber() logicalHebrewProber = SingleByteCharSetProber(Win1255HebrewModel, False, hebrewProber) visualHebrewProber = SingleByteCharSetProber(Win1255HebrewModel, True, hebrewProber) hebrewProber.set_model_probers(logicalHebrewProber, visualHebrewProber) self._mProbers.extend([hebrewProber, logicalHebrewProber, visualHebrewProber]) self.reset()
mpl-2.0
ebar0n/django
django/contrib/gis/db/backends/spatialite/operations.py
7
8206
""" SQL functions reference lists: https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html """ from django.contrib.gis.db.backends.base.operations import ( BaseSpatialOperations, ) from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.db.models import aggregates from django.contrib.gis.geos.geometry import GEOSGeometry, GEOSGeometryBase from django.contrib.gis.geos.prototypes.io import wkb_r, wkt_r from django.contrib.gis.measure import Distance from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.operations import DatabaseOperations from django.utils.functional import cached_property from django.utils.version import get_version_tuple class SpatialiteNullCheckOperator(SpatialOperator): def as_sql(self, connection, lookup, template_params, sql_params): sql, params = super().as_sql(connection, lookup, template_params, sql_params) return '%s > 0' % sql, params class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations): name = 'spatialite' spatialite = True Adapter = SpatiaLiteAdapter collect = 'Collect' extent = 'Extent' makeline = 'MakeLine' unionagg = 'GUnion' from_text = 'GeomFromText' gis_operators = { # Binary predicates 'equals': SpatialiteNullCheckOperator(func='Equals'), 'disjoint': SpatialiteNullCheckOperator(func='Disjoint'), 'touches': SpatialiteNullCheckOperator(func='Touches'), 'crosses': SpatialiteNullCheckOperator(func='Crosses'), 'within': SpatialiteNullCheckOperator(func='Within'), 'overlaps': SpatialiteNullCheckOperator(func='Overlaps'), 'contains': SpatialiteNullCheckOperator(func='Contains'), 'intersects': SpatialiteNullCheckOperator(func='Intersects'), 'relate': SpatialiteNullCheckOperator(func='Relate'), # Returns true if B's bounding box completely contains A's bounding box. 'contained': SpatialOperator(func='MbrWithin'), # Returns true if A's bounding box completely contains B's bounding box. 'bbcontains': SpatialOperator(func='MbrContains'), # Returns true if A's bounding box overlaps B's bounding box. 'bboverlaps': SpatialOperator(func='MbrOverlaps'), # These are implemented here as synonyms for Equals 'same_as': SpatialiteNullCheckOperator(func='Equals'), 'exact': SpatialiteNullCheckOperator(func='Equals'), # Distance predicates 'dwithin': SpatialOperator(func='PtDistWithin'), } disallowed_aggregates = (aggregates.Extent3D,) @cached_property def select(self): return 'CAST (AsEWKB(%s) AS BLOB)' if self.spatial_version >= (4, 3, 0) else 'AsText(%s)' function_names = { 'Length': 'ST_Length', 'LineLocatePoint': 'ST_Line_Locate_Point', 'NumPoints': 'ST_NPoints', 'Reverse': 'ST_Reverse', 'Scale': 'ScaleCoords', 'Translate': 'ST_Translate', 'Union': 'ST_Union', } @cached_property def unsupported_functions(self): unsupported = {'BoundingCircle', 'ForceRHR', 'MemSize'} if not self.lwgeom_version(): unsupported |= {'Azimuth', 'GeoHash', 'IsValid', 'MakeValid'} return unsupported @cached_property def spatial_version(self): """Determine the version of the SpatiaLite library.""" try: version = self.spatialite_version_tuple()[1:] except Exception as exc: raise ImproperlyConfigured( 'Cannot determine the SpatiaLite version for the "%s" database. ' 'Was the SpatiaLite initialization SQL loaded on this database?' % ( self.connection.settings_dict['NAME'], ) ) from exc if version < (4, 1, 0): raise ImproperlyConfigured('GeoDjango only supports SpatiaLite versions 4.1.0 and above.') return version def convert_extent(self, box): """ Convert the polygon data received from SpatiaLite to min/max values. """ if box is None: return None shell = GEOSGeometry(box).shell xmin, ymin = shell[0][:2] xmax, ymax = shell[2][:2] return (xmin, ymin, xmax, ymax) def geo_db_type(self, f): """ Return None because geometry columns are added via the `AddGeometryColumn` stored procedure on SpatiaLite. """ return None def get_distance(self, f, value, lookup_type): """ Return the distance parameters for the given geometry field, lookup value, and lookup type. """ if not value: return [] value = value[0] if isinstance(value, Distance): if f.geodetic(self.connection): if lookup_type == 'dwithin': raise ValueError( 'Only numeric values of degree units are allowed on ' 'geographic DWithin queries.' ) dist_param = value.m else: dist_param = getattr(value, Distance.unit_attname(f.units_name(self.connection))) else: dist_param = value return [dist_param] def _get_spatialite_func(self, func): """ Helper routine for calling SpatiaLite functions and returning their result. Any error occurring in this method should be handled by the caller. """ cursor = self.connection._cursor() try: cursor.execute('SELECT %s' % func) row = cursor.fetchone() finally: cursor.close() return row[0] def geos_version(self): "Return the version of GEOS used by SpatiaLite as a string." return self._get_spatialite_func('geos_version()') def proj4_version(self): "Return the version of the PROJ.4 library used by SpatiaLite." return self._get_spatialite_func('proj4_version()') def lwgeom_version(self): """Return the version of LWGEOM library used by SpatiaLite.""" return self._get_spatialite_func('lwgeom_version()') def spatialite_version(self): "Return the SpatiaLite library version as a string." return self._get_spatialite_func('spatialite_version()') def spatialite_version_tuple(self): """ Return the SpatiaLite version as a tuple (version string, major, minor, subminor). """ version = self.spatialite_version() return (version,) + get_version_tuple(version) def spatial_aggregate_name(self, agg_name): """ Return the spatial aggregate SQL template and function for the given Aggregate instance. """ agg_name = 'unionagg' if agg_name.lower() == 'union' else agg_name.lower() return getattr(self, agg_name) # Routines for getting the OGC-compliant models. def geometry_columns(self): from django.contrib.gis.db.backends.spatialite.models import SpatialiteGeometryColumns return SpatialiteGeometryColumns def spatial_ref_sys(self): from django.contrib.gis.db.backends.spatialite.models import SpatialiteSpatialRefSys return SpatialiteSpatialRefSys def get_geometry_converter(self, expression): geom_class = expression.output_field.geom_class if self.spatial_version >= (4, 3, 0): read = wkb_r().read def converter(value, expression, connection): return None if value is None else GEOSGeometryBase(read(value), geom_class) else: read = wkt_r().read srid = expression.output_field.srid if srid == -1: srid = None def converter(value, expression, connection): if value is not None: geom = GEOSGeometryBase(read(value), geom_class) if srid: geom.srid = srid return geom return converter
bsd-3-clause
tmerrick1/spack
var/spack/repos/builtin/packages/fabtests/package.py
4
1638
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # # For details, see https://github.com/spack/spack # Please also see the NOTICE and LICENSE files for our notice and the LGPL. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License (as # published by the Free Software Foundation) version 2.1, February 1999. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and # conditions of the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * class Fabtests(AutotoolsPackage): """Fabtests provides a set of examples that uses libfabric""" homepage = "http://libfabric.org" url = "https://github.com/ofiwg/fabtests/releases/download/v1.5.3/fabtests-1.5.3.tar.gz" version('1.6.0', '0441aa0aeda391b1bf1eb71250a4afbc') version('1.5.3', 'f60cb95843ebf62e4eaa128e08ccdc7d') depends_on('libfabric')
lgpl-2.1
msiedlarek/grpc
src/python/grpcio/tests/unit/_adapter/_intermediary_low_test.py
5
16914
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """Tests for the old '_low'.""" import Queue import threading import time import unittest from grpc._adapter import _intermediary_low as _low _STREAM_LENGTH = 300 _TIMEOUT = 5 _AFTER_DELAY = 2 _FUTURE = time.time() + 60 * 60 * 24 _BYTE_SEQUENCE = b'\abcdefghijklmnopqrstuvwxyz0123456789' * 200 _BYTE_SEQUENCE_SEQUENCE = tuple( bytes(bytearray((row + column) % 256 for column in range(row))) for row in range(_STREAM_LENGTH)) class LonelyClientTest(unittest.TestCase): def testLonelyClient(self): host = 'nosuchhostexists' port = 54321 method = 'test method' deadline = time.time() + _TIMEOUT after_deadline = deadline + _AFTER_DELAY metadata_tag = object() finish_tag = object() completion_queue = _low.CompletionQueue() channel = _low.Channel('%s:%d' % (host, port), None) client_call = _low.Call(channel, completion_queue, method, host, deadline) client_call.invoke(completion_queue, metadata_tag, finish_tag) first_event = completion_queue.get(after_deadline) self.assertIsNotNone(first_event) second_event = completion_queue.get(after_deadline) self.assertIsNotNone(second_event) kinds = [event.kind for event in (first_event, second_event)] self.assertItemsEqual( (_low.Event.Kind.METADATA_ACCEPTED, _low.Event.Kind.FINISH), kinds) self.assertIsNone(completion_queue.get(after_deadline)) completion_queue.stop() stop_event = completion_queue.get(_FUTURE) self.assertEqual(_low.Event.Kind.STOP, stop_event.kind) del client_call del channel del completion_queue def _drive_completion_queue(completion_queue, event_queue): while True: event = completion_queue.get(_FUTURE) if event.kind is _low.Event.Kind.STOP: break event_queue.put(event) class EchoTest(unittest.TestCase): def setUp(self): self.host = 'localhost' self.server_completion_queue = _low.CompletionQueue() self.server = _low.Server(self.server_completion_queue) port = self.server.add_http2_addr('[::]:0') self.server.start() self.server_events = Queue.Queue() self.server_completion_queue_thread = threading.Thread( target=_drive_completion_queue, args=(self.server_completion_queue, self.server_events)) self.server_completion_queue_thread.start() self.client_completion_queue = _low.CompletionQueue() self.channel = _low.Channel('%s:%d' % (self.host, port), None) self.client_events = Queue.Queue() self.client_completion_queue_thread = threading.Thread( target=_drive_completion_queue, args=(self.client_completion_queue, self.client_events)) self.client_completion_queue_thread.start() def tearDown(self): self.server.stop() self.server.cancel_all_calls() self.server_completion_queue.stop() self.client_completion_queue.stop() self.server_completion_queue_thread.join() self.client_completion_queue_thread.join() del self.server def _perform_echo_test(self, test_data): method = 'test method' details = 'test details' server_leading_metadata_key = 'my_server_leading_key' server_leading_metadata_value = 'my_server_leading_value' server_trailing_metadata_key = 'my_server_trailing_key' server_trailing_metadata_value = 'my_server_trailing_value' client_metadata_key = 'my_client_key' client_metadata_value = 'my_client_value' server_leading_binary_metadata_key = 'my_server_leading_key-bin' server_leading_binary_metadata_value = b'\0'*2047 server_trailing_binary_metadata_key = 'my_server_trailing_key-bin' server_trailing_binary_metadata_value = b'\0'*2047 client_binary_metadata_key = 'my_client_key-bin' client_binary_metadata_value = b'\0'*2047 deadline = _FUTURE metadata_tag = object() finish_tag = object() write_tag = object() complete_tag = object() service_tag = object() read_tag = object() status_tag = object() server_data = [] client_data = [] client_call = _low.Call(self.channel, self.client_completion_queue, method, self.host, deadline) client_call.add_metadata(client_metadata_key, client_metadata_value) client_call.add_metadata(client_binary_metadata_key, client_binary_metadata_value) client_call.invoke(self.client_completion_queue, metadata_tag, finish_tag) self.server.service(service_tag) service_accepted = self.server_events.get() self.assertIsNotNone(service_accepted) self.assertIs(service_accepted.kind, _low.Event.Kind.SERVICE_ACCEPTED) self.assertIs(service_accepted.tag, service_tag) self.assertEqual(method, service_accepted.service_acceptance.method) self.assertEqual(self.host, service_accepted.service_acceptance.host) self.assertIsNotNone(service_accepted.service_acceptance.call) metadata = dict(service_accepted.metadata) self.assertIn(client_metadata_key, metadata) self.assertEqual(client_metadata_value, metadata[client_metadata_key]) self.assertIn(client_binary_metadata_key, metadata) self.assertEqual(client_binary_metadata_value, metadata[client_binary_metadata_key]) server_call = service_accepted.service_acceptance.call server_call.accept(self.server_completion_queue, finish_tag) server_call.add_metadata(server_leading_metadata_key, server_leading_metadata_value) server_call.add_metadata(server_leading_binary_metadata_key, server_leading_binary_metadata_value) server_call.premetadata() metadata_accepted = self.client_events.get() self.assertIsNotNone(metadata_accepted) self.assertEqual(_low.Event.Kind.METADATA_ACCEPTED, metadata_accepted.kind) self.assertEqual(metadata_tag, metadata_accepted.tag) metadata = dict(metadata_accepted.metadata) self.assertIn(server_leading_metadata_key, metadata) self.assertEqual(server_leading_metadata_value, metadata[server_leading_metadata_key]) self.assertIn(server_leading_binary_metadata_key, metadata) self.assertEqual(server_leading_binary_metadata_value, metadata[server_leading_binary_metadata_key]) for datum in test_data: client_call.write(datum, write_tag, _low.WriteFlags.WRITE_NO_COMPRESS) write_accepted = self.client_events.get() self.assertIsNotNone(write_accepted) self.assertIs(write_accepted.kind, _low.Event.Kind.WRITE_ACCEPTED) self.assertIs(write_accepted.tag, write_tag) self.assertIs(write_accepted.write_accepted, True) server_call.read(read_tag) read_accepted = self.server_events.get() self.assertIsNotNone(read_accepted) self.assertEqual(_low.Event.Kind.READ_ACCEPTED, read_accepted.kind) self.assertEqual(read_tag, read_accepted.tag) self.assertIsNotNone(read_accepted.bytes) server_data.append(read_accepted.bytes) server_call.write(read_accepted.bytes, write_tag, 0) write_accepted = self.server_events.get() self.assertIsNotNone(write_accepted) self.assertEqual(_low.Event.Kind.WRITE_ACCEPTED, write_accepted.kind) self.assertEqual(write_tag, write_accepted.tag) self.assertTrue(write_accepted.write_accepted) client_call.read(read_tag) read_accepted = self.client_events.get() self.assertIsNotNone(read_accepted) self.assertEqual(_low.Event.Kind.READ_ACCEPTED, read_accepted.kind) self.assertEqual(read_tag, read_accepted.tag) self.assertIsNotNone(read_accepted.bytes) client_data.append(read_accepted.bytes) client_call.complete(complete_tag) complete_accepted = self.client_events.get() self.assertIsNotNone(complete_accepted) self.assertIs(complete_accepted.kind, _low.Event.Kind.COMPLETE_ACCEPTED) self.assertIs(complete_accepted.tag, complete_tag) self.assertIs(complete_accepted.complete_accepted, True) server_call.read(read_tag) read_accepted = self.server_events.get() self.assertIsNotNone(read_accepted) self.assertEqual(_low.Event.Kind.READ_ACCEPTED, read_accepted.kind) self.assertEqual(read_tag, read_accepted.tag) self.assertIsNone(read_accepted.bytes) server_call.add_metadata(server_trailing_metadata_key, server_trailing_metadata_value) server_call.add_metadata(server_trailing_binary_metadata_key, server_trailing_binary_metadata_value) server_call.status(_low.Status(_low.Code.OK, details), status_tag) server_terminal_event_one = self.server_events.get() server_terminal_event_two = self.server_events.get() if server_terminal_event_one.kind == _low.Event.Kind.COMPLETE_ACCEPTED: status_accepted = server_terminal_event_one rpc_accepted = server_terminal_event_two else: status_accepted = server_terminal_event_two rpc_accepted = server_terminal_event_one self.assertIsNotNone(status_accepted) self.assertIsNotNone(rpc_accepted) self.assertEqual(_low.Event.Kind.COMPLETE_ACCEPTED, status_accepted.kind) self.assertEqual(status_tag, status_accepted.tag) self.assertTrue(status_accepted.complete_accepted) self.assertEqual(_low.Event.Kind.FINISH, rpc_accepted.kind) self.assertEqual(finish_tag, rpc_accepted.tag) self.assertEqual(_low.Status(_low.Code.OK, ''), rpc_accepted.status) client_call.read(read_tag) client_terminal_event_one = self.client_events.get() client_terminal_event_two = self.client_events.get() if client_terminal_event_one.kind == _low.Event.Kind.READ_ACCEPTED: read_accepted = client_terminal_event_one finish_accepted = client_terminal_event_two else: read_accepted = client_terminal_event_two finish_accepted = client_terminal_event_one self.assertIsNotNone(read_accepted) self.assertIsNotNone(finish_accepted) self.assertEqual(_low.Event.Kind.READ_ACCEPTED, read_accepted.kind) self.assertEqual(read_tag, read_accepted.tag) self.assertIsNone(read_accepted.bytes) self.assertEqual(_low.Event.Kind.FINISH, finish_accepted.kind) self.assertEqual(finish_tag, finish_accepted.tag) self.assertEqual(_low.Status(_low.Code.OK, details), finish_accepted.status) metadata = dict(finish_accepted.metadata) self.assertIn(server_trailing_metadata_key, metadata) self.assertEqual(server_trailing_metadata_value, metadata[server_trailing_metadata_key]) self.assertIn(server_trailing_binary_metadata_key, metadata) self.assertEqual(server_trailing_binary_metadata_value, metadata[server_trailing_binary_metadata_key]) self.assertSetEqual(set(key for key, _ in finish_accepted.metadata), set((server_trailing_metadata_key, server_trailing_binary_metadata_key,))) self.assertSequenceEqual(test_data, server_data) self.assertSequenceEqual(test_data, client_data) def testNoEcho(self): self._perform_echo_test(()) def testOneByteEcho(self): self._perform_echo_test([b'\x07']) def testOneManyByteEcho(self): self._perform_echo_test([_BYTE_SEQUENCE]) def testManyOneByteEchoes(self): self._perform_echo_test(_BYTE_SEQUENCE) def testManyManyByteEchoes(self): self._perform_echo_test(_BYTE_SEQUENCE_SEQUENCE) class CancellationTest(unittest.TestCase): def setUp(self): self.host = 'localhost' self.server_completion_queue = _low.CompletionQueue() self.server = _low.Server(self.server_completion_queue) port = self.server.add_http2_addr('[::]:0') self.server.start() self.server_events = Queue.Queue() self.server_completion_queue_thread = threading.Thread( target=_drive_completion_queue, args=(self.server_completion_queue, self.server_events)) self.server_completion_queue_thread.start() self.client_completion_queue = _low.CompletionQueue() self.channel = _low.Channel('%s:%d' % (self.host, port), None) self.client_events = Queue.Queue() self.client_completion_queue_thread = threading.Thread( target=_drive_completion_queue, args=(self.client_completion_queue, self.client_events)) self.client_completion_queue_thread.start() def tearDown(self): self.server.stop() self.server.cancel_all_calls() self.server_completion_queue.stop() self.client_completion_queue.stop() self.server_completion_queue_thread.join() self.client_completion_queue_thread.join() del self.server def testCancellation(self): method = 'test method' deadline = _FUTURE metadata_tag = object() finish_tag = object() write_tag = object() service_tag = object() read_tag = object() test_data = _BYTE_SEQUENCE_SEQUENCE server_data = [] client_data = [] client_call = _low.Call(self.channel, self.client_completion_queue, method, self.host, deadline) client_call.invoke(self.client_completion_queue, metadata_tag, finish_tag) self.server.service(service_tag) service_accepted = self.server_events.get() server_call = service_accepted.service_acceptance.call server_call.accept(self.server_completion_queue, finish_tag) server_call.premetadata() metadata_accepted = self.client_events.get() self.assertIsNotNone(metadata_accepted) for datum in test_data: client_call.write(datum, write_tag, 0) write_accepted = self.client_events.get() server_call.read(read_tag) read_accepted = self.server_events.get() server_data.append(read_accepted.bytes) server_call.write(read_accepted.bytes, write_tag, 0) write_accepted = self.server_events.get() self.assertIsNotNone(write_accepted) client_call.read(read_tag) read_accepted = self.client_events.get() client_data.append(read_accepted.bytes) client_call.cancel() # cancel() is idempotent. client_call.cancel() client_call.cancel() client_call.cancel() server_call.read(read_tag) server_terminal_event_one = self.server_events.get() server_terminal_event_two = self.server_events.get() if server_terminal_event_one.kind == _low.Event.Kind.READ_ACCEPTED: read_accepted = server_terminal_event_one rpc_accepted = server_terminal_event_two else: read_accepted = server_terminal_event_two rpc_accepted = server_terminal_event_one self.assertIsNotNone(read_accepted) self.assertIsNotNone(rpc_accepted) self.assertEqual(_low.Event.Kind.READ_ACCEPTED, read_accepted.kind) self.assertIsNone(read_accepted.bytes) self.assertEqual(_low.Event.Kind.FINISH, rpc_accepted.kind) self.assertEqual(_low.Status(_low.Code.CANCELLED, ''), rpc_accepted.status) finish_event = self.client_events.get() self.assertEqual(_low.Event.Kind.FINISH, finish_event.kind) self.assertEqual(_low.Status(_low.Code.CANCELLED, 'Cancelled'), finish_event.status) self.assertSequenceEqual(test_data, server_data) self.assertSequenceEqual(test_data, client_data) class ExpirationTest(unittest.TestCase): @unittest.skip('TODO(nathaniel): Expiration test!') def testExpiration(self): pass if __name__ == '__main__': unittest.main(verbosity=2)
bsd-3-clause
johnkeepmoving/oss-ftp
python27/win32/Lib/test/test_abc.py
119
7715
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Unit tests for abc.py.""" import unittest, weakref from test import test_support import abc from inspect import isabstract class TestABC(unittest.TestCase): def test_abstractmethod_basics(self): @abc.abstractmethod def foo(self): pass self.assertTrue(foo.__isabstractmethod__) def bar(self): pass self.assertFalse(hasattr(bar, "__isabstractmethod__")) def test_abstractproperty_basics(self): @abc.abstractproperty def foo(self): pass self.assertTrue(foo.__isabstractmethod__) def bar(self): pass self.assertFalse(hasattr(bar, "__isabstractmethod__")) class C: __metaclass__ = abc.ABCMeta @abc.abstractproperty def foo(self): return 3 class D(C): @property def foo(self): return super(D, self).foo self.assertEqual(D().foo, 3) def test_abstractmethod_integration(self): for abstractthing in [abc.abstractmethod, abc.abstractproperty]: class C: __metaclass__ = abc.ABCMeta @abstractthing def foo(self): pass # abstract def bar(self): pass # concrete self.assertEqual(C.__abstractmethods__, set(["foo"])) self.assertRaises(TypeError, C) # because foo is abstract self.assertTrue(isabstract(C)) class D(C): def bar(self): pass # concrete override of concrete self.assertEqual(D.__abstractmethods__, set(["foo"])) self.assertRaises(TypeError, D) # because foo is still abstract self.assertTrue(isabstract(D)) class E(D): def foo(self): pass self.assertEqual(E.__abstractmethods__, set()) E() # now foo is concrete, too self.assertFalse(isabstract(E)) class F(E): @abstractthing def bar(self): pass # abstract override of concrete self.assertEqual(F.__abstractmethods__, set(["bar"])) self.assertRaises(TypeError, F) # because bar is abstract now self.assertTrue(isabstract(F)) def test_subclass_oldstyle_class(self): class A: __metaclass__ = abc.ABCMeta class OldstyleClass: pass self.assertFalse(issubclass(OldstyleClass, A)) self.assertFalse(issubclass(A, OldstyleClass)) def test_isinstance_class(self): class A: __metaclass__ = abc.ABCMeta class OldstyleClass: pass self.assertFalse(isinstance(OldstyleClass, A)) self.assertTrue(isinstance(OldstyleClass, type(OldstyleClass))) self.assertFalse(isinstance(A, OldstyleClass)) # This raises a recursion depth error, but is low-priority: # self.assertTrue(isinstance(A, abc.ABCMeta)) def test_registration_basics(self): class A: __metaclass__ = abc.ABCMeta class B(object): pass b = B() self.assertFalse(issubclass(B, A)) self.assertFalse(issubclass(B, (A,))) self.assertNotIsInstance(b, A) self.assertNotIsInstance(b, (A,)) A.register(B) self.assertTrue(issubclass(B, A)) self.assertTrue(issubclass(B, (A,))) self.assertIsInstance(b, A) self.assertIsInstance(b, (A,)) class C(B): pass c = C() self.assertTrue(issubclass(C, A)) self.assertTrue(issubclass(C, (A,))) self.assertIsInstance(c, A) self.assertIsInstance(c, (A,)) def test_isinstance_invalidation(self): class A: __metaclass__ = abc.ABCMeta class B(object): pass b = B() self.assertFalse(isinstance(b, A)) self.assertFalse(isinstance(b, (A,))) A.register(B) self.assertTrue(isinstance(b, A)) self.assertTrue(isinstance(b, (A,))) def test_registration_builtins(self): class A: __metaclass__ = abc.ABCMeta A.register(int) self.assertIsInstance(42, A) self.assertIsInstance(42, (A,)) self.assertTrue(issubclass(int, A)) self.assertTrue(issubclass(int, (A,))) class B(A): pass B.register(basestring) self.assertIsInstance("", A) self.assertIsInstance("", (A,)) self.assertTrue(issubclass(str, A)) self.assertTrue(issubclass(str, (A,))) def test_registration_edge_cases(self): class A: __metaclass__ = abc.ABCMeta A.register(A) # should pass silently class A1(A): pass self.assertRaises(RuntimeError, A1.register, A) # cycles not allowed class B(object): pass A1.register(B) # ok A1.register(B) # should pass silently class C(A): pass A.register(C) # should pass silently self.assertRaises(RuntimeError, C.register, A) # cycles not allowed C.register(B) # ok def test_register_non_class(self): class A(object): __metaclass__ = abc.ABCMeta self.assertRaisesRegexp(TypeError, "Can only register classes", A.register, 4) def test_registration_transitiveness(self): class A: __metaclass__ = abc.ABCMeta self.assertTrue(issubclass(A, A)) self.assertTrue(issubclass(A, (A,))) class B: __metaclass__ = abc.ABCMeta self.assertFalse(issubclass(A, B)) self.assertFalse(issubclass(A, (B,))) self.assertFalse(issubclass(B, A)) self.assertFalse(issubclass(B, (A,))) class C: __metaclass__ = abc.ABCMeta A.register(B) class B1(B): pass self.assertTrue(issubclass(B1, A)) self.assertTrue(issubclass(B1, (A,))) class C1(C): pass B1.register(C1) self.assertFalse(issubclass(C, B)) self.assertFalse(issubclass(C, (B,))) self.assertFalse(issubclass(C, B1)) self.assertFalse(issubclass(C, (B1,))) self.assertTrue(issubclass(C1, A)) self.assertTrue(issubclass(C1, (A,))) self.assertTrue(issubclass(C1, B)) self.assertTrue(issubclass(C1, (B,))) self.assertTrue(issubclass(C1, B1)) self.assertTrue(issubclass(C1, (B1,))) C1.register(int) class MyInt(int): pass self.assertTrue(issubclass(MyInt, A)) self.assertTrue(issubclass(MyInt, (A,))) self.assertIsInstance(42, A) self.assertIsInstance(42, (A,)) def test_all_new_methods_are_called(self): class A: __metaclass__ = abc.ABCMeta class B(object): counter = 0 def __new__(cls): B.counter += 1 return super(B, cls).__new__(cls) class C(A, B): pass self.assertEqual(B.counter, 0) C() self.assertEqual(B.counter, 1) def test_cache_leak(self): # See issue #2521. class A(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def f(self): pass class C(A): def f(self): A.f(self) r = weakref.ref(C) # Trigger cache. C().f() del C test_support.gc_collect() self.assertEqual(r(), None) def test_main(): test_support.run_unittest(TestABC) if __name__ == "__main__": unittest.main()
mit
ygol/dotfiles
bin/.venv-ansible-venv/lib/python2.6/site-packages/ansible/modules/core/packaging/os/rhn_register.py
77
12335
#!/usr/bin/python # (c) James Laska # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. DOCUMENTATION = ''' --- module: rhn_register short_description: Manage Red Hat Network registration using the C(rhnreg_ks) command description: - Manage registration to the Red Hat Network. version_added: "1.2" author: James Laska notes: - In order to register a system, rhnreg_ks requires either a username and password, or an activationkey. requirements: - rhnreg_ks options: state: description: - whether to register (C(present)), or unregister (C(absent)) a system required: false choices: [ "present", "absent" ] default: "present" username: description: - Red Hat Network username required: False default: null password: description: - Red Hat Network password required: False default: null server_url: description: - Specify an alternative Red Hat Network server URL required: False default: Current value of I(serverURL) from C(/etc/sysconfig/rhn/up2date) is the default activationkey: description: - supply an activation key for use with registration required: False default: null channels: description: - Optionally specify a list of comma-separated channels to subscribe to upon successful registration. required: false default: [] ''' EXAMPLES = ''' # Unregister system from RHN. - rhn_register: state=absent username=joe_user password=somepass # Register as user (joe_user) with password (somepass) and auto-subscribe to available content. - rhn_register: state=present username=joe_user password=somepass # Register with activationkey (1-222333444) and enable extended update support. - rhn_register: state=present activationkey=1-222333444 enable_eus=true # Register as user (joe_user) with password (somepass) against a satellite # server specified by (server_url). - rhn_register: > state=present username=joe_user password=somepass server_url=https://xmlrpc.my.satellite/XMLRPC # Register as user (joe_user) with password (somepass) and enable # channels (rhel-x86_64-server-6-foo-1) and (rhel-x86_64-server-6-bar-1). - rhn_register: state=present username=joe_user password=somepass channels=rhel-x86_64-server-6-foo-1,rhel-x86_64-server-6-bar-1 ''' import sys import types import xmlrpclib import urlparse # Attempt to import rhn client tools sys.path.insert(0, '/usr/share/rhn') try: import up2date_client import up2date_client.config except ImportError, e: module.fail_json(msg="Unable to import up2date_client. Is 'rhn-client-tools' installed?\n%s" % e) # INSERT REDHAT SNIPPETS from ansible.module_utils.redhat import * # INSERT COMMON SNIPPETS from ansible.module_utils.basic import * class Rhn(RegistrationBase): def __init__(self, username=None, password=None): RegistrationBase.__init__(self, username, password) self.config = self.load_config() def load_config(self): ''' Read configuration from /etc/sysconfig/rhn/up2date ''' self.config = up2date_client.config.initUp2dateConfig() # Add support for specifying a default value w/o having to standup some # configuration. Yeah, I know this should be subclassed ... but, oh # well def get_option_default(self, key, default=''): # ignore pep8 W601 errors for this line # setting this to use 'in' does not work in the rhn library if self.has_key(key): return self[key] else: return default self.config.get_option = types.MethodType(get_option_default, self.config, up2date_client.config.Config) return self.config @property def hostname(self): ''' Return the non-xmlrpc RHN hostname. This is a convenience method used for displaying a more readable RHN hostname. Returns: str ''' url = urlparse.urlparse(self.config['serverURL']) return url[1].replace('xmlrpc.','') @property def systemid(self): systemid = None xpath_str = "//member[name='system_id']/value/string" if os.path.isfile(self.config['systemIdPath']): fd = open(self.config['systemIdPath'], 'r') xml_data = fd.read() fd.close() # Ugh, xml parsing time ... # First, try parsing with libxml2 ... if systemid is None: try: import libxml2 doc = libxml2.parseDoc(xml_data) ctxt = doc.xpathNewContext() systemid = ctxt.xpathEval(xpath_str)[0].content doc.freeDoc() ctxt.xpathFreeContext() except ImportError: pass # m-kay, let's try with lxml now ... if systemid is None: try: from lxml import etree root = etree.fromstring(xml_data) systemid = root.xpath(xpath_str)[0].text except ImportError: pass # Strip the 'ID-' prefix if systemid is not None and systemid.startswith('ID-'): systemid = systemid[3:] return int(systemid) @property def is_registered(self): ''' Determine whether the current system is registered. Returns: True|False ''' return os.path.isfile(self.config['systemIdPath']) def configure(self, server_url): ''' Configure system for registration ''' self.config.set('serverURL', server_url) self.config.save() def enable(self): ''' Prepare the system for RHN registration. This includes ... * enabling the rhnplugin yum plugin * disabling the subscription-manager yum plugin ''' RegistrationBase.enable(self) self.update_plugin_conf('rhnplugin', True) self.update_plugin_conf('subscription-manager', False) def register(self, enable_eus=False, activationkey=None): ''' Register system to RHN. If enable_eus=True, extended update support will be requested. ''' register_cmd = "/usr/sbin/rhnreg_ks --username='%s' --password='%s' --force" % (self.username, self.password) if self.module.params.get('server_url', None): register_cmd += " --serverUrl=%s" % self.module.params.get('server_url') if enable_eus: register_cmd += " --use-eus-channel" if activationkey is not None: register_cmd += " --activationkey '%s'" % activationkey # FIXME - support --profilename # FIXME - support --systemorgid rc, stdout, stderr = self.module.run_command(register_cmd, check_rc=True, use_unsafe_shell=True) def api(self, method, *args): ''' Convenience RPC wrapper ''' if not hasattr(self, 'server') or self.server is None: if self.hostname != 'rhn.redhat.com': url = "https://%s/rpc/api" % self.hostname else: url = "https://xmlrpc.%s/rpc/api" % self.hostname self.server = xmlrpclib.Server(url, verbose=0) self.session = self.server.auth.login(self.username, self.password) func = getattr(self.server, method) return func(self.session, *args) def unregister(self): ''' Unregister a previously registered system ''' # Initiate RPC connection self.api('system.deleteSystems', [self.systemid]) # Remove systemid file os.unlink(self.config['systemIdPath']) def subscribe(self, channels=[]): if len(channels) <= 0: return current_channels = self.api('channel.software.listSystemChannels', self.systemid) new_channels = [item['channel_label'] for item in current_channels] new_channels.extend(channels) return self.api('channel.software.setSystemChannels', self.systemid, new_channels) def _subscribe(self, channels=[]): ''' Subscribe to requested yum repositories using 'rhn-channel' command ''' rhn_channel_cmd = "rhn-channel --user='%s' --password='%s'" % (self.username, self.password) rc, stdout, stderr = self.module.run_command(rhn_channel_cmd + " --available-channels", check_rc=True) # Enable requested repoid's for wanted_channel in channels: # Each inserted repo regexp will be matched. If no match, no success. for available_channel in stdout.rstrip().split('\n'): # .rstrip() because of \n at the end -> empty string at the end if re.search(wanted_repo, available_channel): rc, stdout, stderr = self.module.run_command(rhn_channel_cmd + " --add --channel=%s" % available_channel, check_rc=True) def main(): # Read system RHN configuration rhn = Rhn() module = AnsibleModule( argument_spec = dict( state = dict(default='present', choices=['present', 'absent']), username = dict(default=None, required=False), password = dict(default=None, required=False), server_url = dict(default=rhn.config.get_option('serverURL'), required=False), activationkey = dict(default=None, required=False), enable_eus = dict(default=False, type='bool'), channels = dict(default=[], type='list'), ) ) state = module.params['state'] rhn.username = module.params['username'] rhn.password = module.params['password'] rhn.configure(module.params['server_url']) activationkey = module.params['activationkey'] channels = module.params['channels'] rhn.module = module # Ensure system is registered if state == 'present': # Check for missing parameters ... if not (activationkey or rhn.username or rhn.password): module.fail_json(msg="Missing arguments, must supply an activationkey (%s) or username (%s) and password (%s)" % (activationkey, rhn.username, rhn.password)) if not activationkey and not (rhn.username and rhn.password): module.fail_json(msg="Missing arguments, If registering without an activationkey, must supply username or password") # Register system if rhn.is_registered: module.exit_json(changed=False, msg="System already registered.") else: try: rhn.enable() rhn.register(module.params['enable_eus'] == True, activationkey) rhn.subscribe(channels) except Exception, e: module.fail_json(msg="Failed to register with '%s': %s" % (rhn.hostname, e)) module.exit_json(changed=True, msg="System successfully registered to '%s'." % rhn.hostname) # Ensure system is *not* registered if state == 'absent': if not rhn.is_registered: module.exit_json(changed=False, msg="System already unregistered.") else: try: rhn.unregister() except Exception, e: module.fail_json(msg="Failed to unregister: %s" % e) module.exit_json(changed=True, msg="System successfully unregistered from %s." % rhn.hostname) main()
mit
Diegojnb/JdeRobot
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_dataflash_logger.py
4
10786
#!/usr/bin/env python ''' DataFlash Logging Module June 2015 ArduPilot supports transmission of DataFlash logs over MavLink. This module pokes the UAV to start sending logs, and stores them in a local directory. The relevant code in the ArduPilot code base can be found in libraries/DataFlash/DataFlash_MAVLink.* ''' import logging import os import os.path import threading import types import sys from pymavlink import mavutil import random import errno from MAVProxy.modules.lib import mp_module from MAVProxy.modules.lib import mp_util import time from MAVProxy.modules.lib import mp_settings class dataflash_logger(mp_module.MPModule): def __init__(self, mpstate): """Initialise module. We start poking the UAV for messages after this is called""" super(dataflash_logger, self).__init__(mpstate, "dataflash_logger", "logging of mavlink dataflash messages") self.new_log_started = False self.stopped = False self.time_last_start_packet_sent = 0 self.time_last_stop_packet_sent = 0 self.dataflash_dir = self._dataflash_dir(mpstate) self.log_settings = mp_settings.MPSettings( [ ('verbose', bool, False), ]) self.add_command('dataflash_logger', self.cmd_dataflash_logger, "dataflash logging control", ['status','start','stop','set (LOGSETTING)']) self.add_completion_function('(LOGSETTING)', self.log_settings.completion) def usage(self): '''show help on a command line options''' return "Usage: dataflash_logger <status|start|stop|set>" def cmd_dataflash_logger(self, args): '''control behaviour of the module''' if len(args) == 0: print (self.usage()) elif args[0] == "status": print (self.status()) elif args[0] == "stop": self.new_log_started = False self.stopped = True elif args[0] == "start": self.stopped = False elif args[0] == "set": self.log_settings.command(args[1:]) else: print (self.usage()) def _dataflash_dir(self, mpstate): '''returns directory path to store DF logs in. May be relative''' if mpstate.settings.state_basedir is None: ret = 'dataflash' else: ret = os.path.join(mpstate.settings.state_basedir,'dataflash') try: os.makedirs(ret) except OSError as e: if e.errno != errno.EEXIST: print("DFLogger: OSError making (%s): %s" % (ret, str(e))) except Exception as e: print("DFLogger: Unknown exception making (%s): %s" % (ret, str(e))) return ret def new_log_filepath(self): '''returns a filepath to a log which does not currently exist and is suitable for DF logging''' lastlog_filename = os.path.join(self.dataflash_dir,'LASTLOG.TXT') if os.path.exists(lastlog_filename) and os.stat(lastlog_filename).st_size != 0: fh = open(lastlog_filename,'rb') log_cnt = int(fh.read()) + 1 fh.close() else: log_cnt = 1 self.lastlog_file = open(lastlog_filename,'w+b') self.lastlog_file.write(log_cnt.__str__()) self.lastlog_file.close() return os.path.join(self.dataflash_dir, '%u.BIN' % (log_cnt,)); def start_new_log(self): '''open a new dataflash log, reset state''' filename = self.new_log_filepath() self.block_cnt = 0 self.logfile = open(filename, 'w+b') print("DFLogger: logging started (%s)" % (filename)) self.prev_cnt = 0 self.download = 0 self.prev_download = 0 self.last_idle_status_printed_time = time.time() self.last_status_time = time.time() self.missing_blocks = {} self.acking_blocks = {} self.blocks_to_ack_and_nack = [] self.missing_found = 0 self.abandoned = 0 def status(self): '''returns information about module''' transfered = self.download - self.prev_download now = time.time() interval = now - self.last_status_time self.last_status_time = now return("DFLogger: %(state)s Rate(%(interval)ds):%(rate).3fkB/s Block:%(block_cnt)d Missing:%(missing)d Fixed:%(fixed)d Abandoned:%(abandoned)d" % {"interval": interval, "rate": transfered/(interval*1000), "block_cnt": self.block_cnt, "missing": len(self.missing_blocks), "fixed": self.missing_found, "abandoned": self.abandoned, "state": "Inactive" if self.stopped else "Active" }) def idle_print_status(self): '''print out statistics every 10 seconds from idle loop''' now = time.time() if (now - self.last_idle_status_printed_time) >= 10: print (self.status()) self.last_idle_status_printed_time = now self.prev_download = self.download def idle_send_acks_and_nacks(self): '''Send packets to UAV in idle loop''' max_blocks_to_send = 10 blocks_sent = 0 i=0 now = time.time() while i < len(self.blocks_to_ack_and_nack) and blocks_sent < max_blocks_to_send: # print("ACKLIST: %s" % ([x[1] for x in self.blocks_to_ack_and_nack],)) stuff = self.blocks_to_ack_and_nack[i] [master, block, status, first_sent, last_sent] = stuff if status == 1: # print("DFLogger: ACKing block (%d)" % (block,)) self.master.mav.remote_log_block_status_send(block,status) blocks_sent += 1 del self.acking_blocks[block] del self.blocks_to_ack_and_nack[i] continue if block not in self.missing_blocks: # we've received this block now del self.blocks_to_ack_and_nack[i] continue # give up on packet if we have seen one with a much higher # number: if self.block_cnt - block > 200 or \ now - first_sent > 60: print("DFLogger: Abandoning block (%d)" % (block,)) del self.blocks_to_ack_and_nack[i] del self.missing_blocks[block] self.abandoned += 1 continue i += 1 # only send each nack every-so-often: if last_sent is not None: if now - last_sent < 0.1: continue print("DFLogger: NACKing block (%d)" % (block,)) self.master.mav.remote_log_block_status_send(block,status) blocks_sent += 1 stuff[4] = now def idle_task_started(self): '''called in idle task only when logging is started''' if self.log_settings.verbose: self.idle_print_status() self.idle_send_acks_and_nacks() def idle_task(self): if self.new_log_started == True: self.idle_task_started() def mavlink_packet(self, m): '''handle REMOTE_LOG_DATA_BLOCK packets''' now = time.time() if m.get_type() == 'REMOTE_LOG_DATA_BLOCK': if self.stopped: # send a stop packet every second until the other end gets the idea: if now - self.time_last_stop_packet_sent > 1: if self.log_settings.verbose: print("DFLogger: Sending stop packet") self.master.mav.remote_log_block_status_send(mavutil.mavlink.MAV_REMOTE_LOG_DATA_BLOCK_STOP,1) return # if random.random() < 0.1: # drop 1 packet in 10 # return if not self.new_log_started: if self.log_settings.verbose: print("DFLogger: Received data packet - starting new log") self.start_new_log() self.new_log_started = True if self.new_log_started == True: size = m.block_size data = ''.join(str(chr(x)) for x in m.data[:size]) ofs = size*(m.block_cnt) self.logfile.seek(ofs) self.logfile.write(data) if m.block_cnt in self.missing_blocks: if self.log_settings.verbose: print("DFLogger: Received missing block: %d" % (m.block_cnt,)) del self.missing_blocks[m.block_cnt] self.missing_found += 1 self.blocks_to_ack_and_nack.append([self.master,m.block_cnt,1,now,None]) self.acking_blocks[m.block_cnt] = 1 # print("DFLogger: missing blocks: %s" % (str(self.missing_blocks),)) else: # ACK the block we just got: if m.block_cnt in self.acking_blocks: # already acking this one; we probably sent # multiple nacks and received this one # multiple times pass else: self.blocks_to_ack_and_nack.append([self.master,m.block_cnt,1,now,None]) self.acking_blocks[m.block_cnt] = 1 # NACK any blocks we haven't seen and should have: if(m.block_cnt - self.block_cnt > 1): for block in range(self.block_cnt+1, m.block_cnt): if block not in self.missing_blocks and \ block not in self.acking_blocks: self.missing_blocks[block] = 1 if self.log_settings.verbose: print ("DFLogger: setting %d for nacking" % (block,)) self.blocks_to_ack_and_nack.append([self.master,block,0,now,None]) #print "\nmissed blocks: ",self.missing_blocks if self.block_cnt < m.block_cnt: self.block_cnt = m.block_cnt self.download += size elif not self.new_log_started and not self.stopped: # send a start packet every second until the other end gets the idea: if now - self.time_last_start_packet_sent > 1: if self.log_settings.verbose: print("DFLogger: Sending start packet") self.master.mav.remote_log_block_status_send(mavutil.mavlink.MAV_REMOTE_LOG_DATA_BLOCK_START,1) self.time_last_start_packet_sent = now def init(mpstate): '''initialise module''' return dataflash_logger(mpstate)
gpl-3.0
ryokbys/nap
pmd/util/mk_workdir.py
1
1218
#!/usr/bin/python #----------------------------------------------------------------------- # Make work directory at /tmp/ in each to-be-used host #----------------------------------------------------------------------- # Usage: # ./mk_workdir.py numNodes workdir import sys,os,pwd from datetime import date if len(sys.argv) != 3: print "usage: ./mk_workdir.py numNodes workdir" sys.exit() numNodes= int(sys.argv[1]) workdir = sys.argv[2] #-----decide work dir name username= pwd.getpwuid(os.getuid())[0] today= date.today() #workdir= "/tmp/"+username+"/"+today.strftime("%y%m%d") # workdir= "~/"+today.strftime("%y%m%d") #-----list of hosts hostfile= open("hosts.list",'r') lines= map(lambda x:x[:-1], hostfile.readlines()) # print lines n= 0 for host in lines: print "ssh %s@%s \"mkdir -p %s\"" % (username,host,workdir) os.system("ssh %s@%s \"mkdir -p %s\"" % (username,host,workdir)) print "scp ./[1234]* pmd pmd.in hosts.list ini%03d %s@%s:%s/" % (n,username,host,workdir) os.system("scp ./[1234]* pmd pmd.in hosts.list ini%03d %s@%s:%s/" % (n,username,host,workdir)) # os.system("scp ./* %s@%s:%s/" % (username,host,workdir)) n=n+1 if n >= numNodes: sys.exit()
mit
fuziontech/sentry
tests/sentry/coreapi/tests.py
3
11167
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from datetime import datetime from uuid import UUID from sentry.coreapi import ( APIError, APIUnauthorized, Auth, ClientApiHelper, InvalidTimestamp, get_interface ) from sentry.testutils import TestCase class BaseAPITest(TestCase): def setUp(self): self.user = self.create_user('coreapi@example.com') self.team = self.create_team(name='Foo') self.project = self.create_project(team=self.team) self.pm = self.project.team.member_set.get_or_create(user=self.user)[0] self.pk = self.project.key_set.get_or_create()[0] self.helper = ClientApiHelper() class AuthFromRequestTest(BaseAPITest): def test_valid(self): request = mock.Mock() request.META = {'HTTP_X_SENTRY_AUTH': 'Sentry sentry_key=value, biz=baz'} result = self.helper.auth_from_request(request) assert result.public_key == 'value' def test_invalid_header_defers_to_GET(self): request = mock.Mock() request.META = {'HTTP_X_SENTRY_AUTH': 'foobar'} request.GET = {'sentry_version': '1', 'foo': 'bar'} result = self.helper.auth_from_request(request) assert result.version == '1' def test_invalid_legacy_header_defers_to_GET(self): request = mock.Mock() request.META = {'HTTP_AUTHORIZATION': 'foobar'} request.GET = {'sentry_version': '1', 'foo': 'bar'} result = self.helper.auth_from_request(request) assert result.version == '1' class ProjectFromAuthTest(BaseAPITest): def test_invalid_if_missing_key(self): self.assertRaises(APIUnauthorized, self.helper.project_from_auth, Auth({})) def test_valid_with_key(self): auth = Auth({'sentry_key': self.pk.public_key}) result = self.helper.project_from_auth(auth) self.assertEquals(result, self.project) def test_invalid_key(self): auth = Auth({'sentry_key': 'z'}) self.assertRaises(APIUnauthorized, self.helper.project_from_auth, auth) def test_invalid_secret(self): auth = Auth({'sentry_key': self.pk.public_key, 'sentry_secret': 'z'}) self.assertRaises(APIUnauthorized, self.helper.project_from_auth, auth) class ProcessDataTimestampTest(BaseAPITest): def test_iso_timestamp(self): d = datetime(2012, 01, 01, 10, 30, 45) data = self.helper._process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45' }, current_datetime=d) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], 1325413845.0) def test_iso_timestamp_with_ms(self): d = datetime(2012, 01, 01, 10, 30, 45, 434000) data = self.helper._process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45.434' }, current_datetime=d) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], 1325413845.0) def test_timestamp_iso_timestamp_with_Z(self): d = datetime(2012, 01, 01, 10, 30, 45) data = self.helper._process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45Z' }, current_datetime=d) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], 1325413845.0) def test_invalid_timestamp(self): self.assertRaises(InvalidTimestamp, self.helper._process_data_timestamp, { 'timestamp': 'foo' }) def test_invalid_numeric_timestamp(self): self.assertRaises(InvalidTimestamp, self.helper._process_data_timestamp, { 'timestamp': '100000000000000000000.0' }) def test_future_timestamp(self): self.assertRaises(InvalidTimestamp, self.helper._process_data_timestamp, { 'timestamp': '2052-01-01T10:30:45Z' }) def test_long_microseconds_value(self): d = datetime(2012, 01, 01, 10, 30, 45) data = self.helper._process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45.341324Z' }, current_datetime=d) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], 1325413845.0) class ValidateDataTest(BaseAPITest): def test_missing_project_id(self): data = self.helper.validate_data(self.project, { 'message': 'foo', }) assert data['project'] == self.project.id @mock.patch('uuid.uuid4', return_value=UUID('031667ea1758441f92c7995a428d2d14')) def test_empty_event_id(self, uuid4): data = self.helper.validate_data(self.project, { 'event_id': '', }) assert data['event_id'] == '031667ea1758441f92c7995a428d2d14' @mock.patch('uuid.uuid4', return_value=UUID('031667ea1758441f92c7995a428d2d14')) def test_missing_event_id(self, uuid4): data = self.helper.validate_data(self.project, {}) assert data['event_id'] == '031667ea1758441f92c7995a428d2d14' @mock.patch('uuid.uuid4', return_value=UUID('031667ea1758441f92c7995a428d2d14')) def test_invalid_event_id(self, uuid4): data = self.helper.validate_data(self.project, { 'event_id': 'a' * 33, }) assert data['event_id'] == '031667ea1758441f92c7995a428d2d14' assert len(data['errors']) == 1 assert data['errors'][0]['type'] == 'value_too_long' assert data['errors'][0]['name'] == 'event_id' assert data['errors'][0]['value'] == 'a' * 33 def test_invalid_event_id_raises(self): self.assertRaises(APIError, self.helper.validate_data, self.project, { 'event_id': 1 }) def test_unknown_attribute(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'foo': 'bar', }) assert 'foo' not in data assert len(data['errors']) == 1 assert data['errors'][0]['type'] == 'invalid_attribute' assert data['errors'][0]['name'] == 'foo' def test_invalid_interface_name(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'foo.baz': 'bar', }) assert 'foo.baz' not in data assert len(data['errors']) == 1 assert data['errors'][0]['type'] == 'invalid_attribute' assert data['errors'][0]['name'] == 'foo.baz' def test_invalid_interface_import_path(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'sentry.interfaces.Exception2': 'bar', }) assert 'sentry.interfaces.Exception2' not in data assert len(data['errors']) == 1 assert data['errors'][0]['type'] == 'invalid_attribute' assert data['errors'][0]['name'] == 'sentry.interfaces.Exception2' def test_does_expand_list(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'exception': [{ 'type': 'ValueError', 'value': 'hello world', 'module': 'foo.bar', }] }) assert 'sentry.interfaces.Exception' in data def test_log_level_as_string(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'level': 'error', }) assert data['level'] == 40 def test_invalid_log_level(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'level': 'foobar', }) assert data['level'] == 40 assert len(data['errors']) == 1 assert data['errors'][0]['type'] == 'invalid_data' assert data['errors'][0]['name'] == 'level' assert data['errors'][0]['value'] == 'foobar' def test_tags_as_string(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'tags': 'bar', }) assert 'tags' not in data def test_tags_out_of_bounds(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'tags': {'f' * 33: 'value', 'foo': 'v' * 201, 'bar': 'value'}, }) assert data['tags'] == [('bar', 'value')] assert len(data['errors']) == 2 def test_tags_as_invalid_pair(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'tags': [('foo', 'bar'), ('biz', 'baz', 'boz')], }) assert data['tags'] == [('foo', 'bar')] assert len(data['errors']) == 1 assert data['errors'][0]['type'] == 'invalid_data' assert data['errors'][0]['name'] == 'tags' assert data['errors'][0]['value'] == ('biz', 'baz', 'boz') def test_extra_as_string(self): data = self.helper.validate_data(self.project, { 'message': 'foo', 'extra': 'bar', }) assert 'extra' not in data def test_invalid_culprit_raises(self): self.assertRaises(APIError, self.helper.validate_data, self.project, { 'culprit': 1 }) def test_release_too_long(self): data = self.helper.validate_data(self.project, { 'release': 'a' * 65, }) assert not data.get('release') assert len(data['errors']) == 1 assert data['errors'][0]['type'] == 'value_too_long' assert data['errors'][0]['name'] == 'release' assert data['errors'][0]['value'] == 'a' * 65 def test_release_as_non_string(self): data = self.helper.validate_data(self.project, { 'release': 42, }) assert data.get('release') == '42' class GetInterfaceTest(TestCase): def test_does_not_let_through_disallowed_name(self): with self.assertRaises(ValueError): get_interface('subprocess') def test_allows_http(self): from sentry.interfaces.http import Http result = get_interface('sentry.interfaces.Http') assert result is Http result = get_interface('request') assert result is Http class EnsureHasIpTest(BaseAPITest): def test_with_remote_addr(self): inp = { 'sentry.interfaces.Http': { 'env': { 'REMOTE_ADDR': '192.168.0.1', }, }, } out = inp.copy() self.helper.ensure_has_ip(out, '127.0.0.1') assert inp == out def test_with_user_ip(self): inp = { 'sentry.interfaces.User': { 'ip_address': '192.168.0.1', }, } out = inp.copy() self.helper.ensure_has_ip(out, '127.0.0.1') assert inp == out def test_without_ip_values(self): out = { 'sentry.interfaces.User': { }, 'sentry.interfaces.Http': { 'env': {}, }, } self.helper.ensure_has_ip(out, '127.0.0.1') assert out['sentry.interfaces.User']['ip_address'] == '127.0.0.1' def test_without_any_values(self): out = {} self.helper.ensure_has_ip(out, '127.0.0.1') assert out['sentry.interfaces.User']['ip_address'] == '127.0.0.1'
bsd-3-clause
msimacek/freeipa
ipaplatform/fedora/tasks.py
10
1143
# Authors: Simo Sorce <ssorce@redhat.com> # Alexander Bokovoy <abokovoy@redhat.com> # Martin Kosek <mkosek@redhat.com> # Tomas Babej <tbabej@redhat.com> # # Copyright (C) 2007-2014 Red Hat # see file 'COPYING' for use and warranty information # # 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 distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. ''' This module contains default Fedora-specific implementations of system tasks. ''' from ipaplatform.redhat.tasks import RedHatTaskNamespace class FedoraTaskNamespace(RedHatTaskNamespace): pass tasks = FedoraTaskNamespace()
gpl-3.0
int3rlop3r/crony
tests/test_parsers.py
2
1843
import os import unittest from crony import parsers BASEPATH = os.path.dirname(os.path.abspath(__file__)) + '/' class TestParsers(unittest.TestCase): def test_parse_range(self): # test normal comma separated range range_str1 = '1,2,3,4,5' range_set1 = set([1, 2, 3, 4, 5]) self.assertEquals(parsers.parse_range(range_str1), range_set1) # test range with hyphen range_str2 = '1-5,9-13' range_set2 = set([1, 2, 3, 4, 5, 9, 10, 11, 12, 13]) self.assertEquals(parsers.parse_range(range_str2), range_set2) # test adding an invalid job with self.assertRaises(ValueError): # 0 is an invalid id parsers.parse_range('0-5,9-13') def test_parse_file(self): # parse using filepath jobs1 = parsers.parse_file(cronfile=BASEPATH + 'cronfile') self.assertEquals(len(jobs1), 3) # parse using file descriptor parsers.parse_file(cronfd=open(BASEPATH + 'cronfile')) self.assertEquals(len(jobs1), 3) def test_parse_hostname(self): host_details1 = parsers.parse_hostname('somedomain.com') host_and_port = {'hostname':'somedomain.com', 'port':'22'} self.assertEquals(host_details1, host_and_port) host_details2 = parsers.parse_hostname('someuser@somedomain.com') user_host_and_port = { 'username':'someuser', 'hostname':'somedomain.com', 'port':'22' } self.assertEquals(host_details2, user_host_and_port) user_host_and_customport = { 'username':'someuser', 'hostname':'somedomain.com', 'port':'5200' } host_details3 = parsers.parse_hostname('someuser@somedomain.com:5200') self.assertEquals(host_details3, user_host_and_customport)
gpl-3.0
jteehan/cfme_tests
cfme/tests/containers/test_chargeback_for_images.py
2
4273
# -*- coding: utf-8 -*- import fauxfactory from random import random import pytest from utils import testgen from utils.log import logger from cfme.containers.provider import ContainersProvider from cfme.intelligence.chargeback import assignments, rates from cfme.intelligence.reports.reports import CustomReport pytestmark = [ pytest.mark.tier(3), pytest.mark.long_running, pytest.mark.meta( server_roles='+ems_metrics_coordinator +ems_metrics_collector +ems_metrics_processor'), pytest.mark.usefixtures('setup_provider_modscope') ] pytest_generate_tests = testgen.generate([ContainersProvider], scope='module') def new_chargeback_rate(appliance, include_variable_rates=True): # Create a new Chargeback compute rate def rand_float_str(): return str(round(random() * fauxfactory.gen_integer(1, 20), 2)) def gen_var_rate(): return (rand_float_str() if include_variable_rates else 0) description = 'custom_rate_' + fauxfactory.gen_alphanumeric() data = { 'Used CPU Cores': {'per_time': 'Hourly', 'fixed_rate': fauxfactory.gen_integer(1, 4), 'variable_rate': gen_var_rate()}, 'Fixed Compute Cost 1': {'per_time': 'Hourly', 'fixed_rate': rand_float_str()}, 'Fixed Compute Cost 2': {'per_time': 'Hourly', 'fixed_rate': rand_float_str()}, 'Used Memory': {'per_time': 'Hourly', 'fixed_rate': rand_float_str(), 'variable_rate': gen_var_rate()}, 'Used Network I/O': {'per_time': 'Hourly', 'fixed_rate': rand_float_str(), 'variable_rate': gen_var_rate()} } ccb = rates.ComputeRate(description, fields=data, appliance=appliance) ccb.create() return ccb @pytest.yield_fixture(scope="module") def new_chargeback_fixed_rate(appliance): # Create a new Chargeback compute fixed rate ccb = new_chargeback_rate(appliance, include_variable_rates=False) yield ccb ccb.delete() @pytest.yield_fixture(scope="module") def assign_compute_custom_rate(new_chargeback_fixed_rate, provider): # Assign custom Compute rate to the Selected Containers Provider asignment = assignments.Assign( assign_to="Labeled Container Images", docker_labels="Architecture", selections={ 'x86_64': new_chargeback_fixed_rate.description }) asignment.computeassign() logger.info('ASSIGNING COMPUTE RATE FOR LABELED CONTAINER IMAGES') yield new_chargeback_fixed_rate.description asignment = assignments.Assign( assign_to="Selected Containers Providers", selections={ provider.name: "Default" }) asignment.computeassign() @pytest.yield_fixture(scope="module") def chargeback_report_custom(assign_compute_custom_rate, provider): # Create a Chargeback report based on a custom Compute rate; Queue the report title = 'report_' + assign_compute_custom_rate data = {'menu_name': title, 'title': title, 'base_report_on': 'Chargeback Container Images', 'report_fields': ['Archived', 'Chargeback Rates', 'Fixed Compute Metric', 'Cpu Cores Used Cost', 'Cpu Cores Used Metric', 'Network I/O Used', 'Network I/O Used Cost', 'Fixed Compute Cost 1', 'Fixed Compute Cost 2', 'Memory Used', 'Memory Used Cost', 'Provider Name', 'Fixed Total Cost', 'Total Cost'], 'filter_show_costs': 'Container Image', 'provider': provider.name} report = CustomReport(is_candu=True, **data) report.create() logger.info('QUEUING CUSTOM CHARGEBACK REPORT FOR CONTAINER IMAGE') report.queue(wait_for_finish=True) yield list(report.get_saved_reports()[0].data) report.delete() @pytest.mark.long_running_env @pytest.mark.long_running_provider @pytest.mark.polarion('CMP-10432') def test_image_chargeback_fixed_rate(chargeback_report_custom): assert chargeback_report_custom, 'Error in produced report, No records found'
gpl-2.0
a-pertsev/flask-security
tests/test_datastore.py
21
4046
# -*- coding: utf-8 -*- """ test_datastore ~~~~~~~~~~~~~~ Datastore tests """ from pytest import raises from flask_security import UserMixin, RoleMixin from flask_security.datastore import Datastore, UserDatastore from utils import init_app_with_options class User(UserMixin): pass class Role(RoleMixin): pass def test_unimplemented_datastore_methods(): datastore = Datastore(None) assert datastore.db is None with raises(NotImplementedError): datastore.put(None) with raises(NotImplementedError): datastore.delete(None) assert not datastore.commit() def test_unimplemented_user_datastore_methods(): datastore = UserDatastore(None, None) with raises(NotImplementedError): datastore.find_user(None) with raises(NotImplementedError): datastore.find_role(None) with raises(NotImplementedError): datastore.get_user(None) def test_toggle_active(): datastore = UserDatastore(None, None) user = User() user.active = True assert datastore.toggle_active(user) is True assert not user.active assert datastore.toggle_active(user) is True assert user.active is True def test_deactivate_user(): datastore = UserDatastore(None, None) user = User() user.active = True assert datastore.deactivate_user(user) is True assert not user.active def test_activate_user(): datastore = UserDatastore(None, None) user = User() user.active = False assert datastore.activate_user(user) is True assert user.active is True def test_deactivate_returns_false_if_already_false(): datastore = UserDatastore(None, None) user = User() user.active = False assert not datastore.deactivate_user(user) def test_activate_returns_false_if_already_true(): datastore = UserDatastore(None, None) user = User() user.active = True assert not datastore.activate_user(user) def test_get_user(app, datastore): init_app_with_options(app, datastore, **{ 'SECURITY_USER_IDENTITY_ATTRIBUTES': ('email', 'username') }) with app.app_context(): user_id = datastore.find_user(email='matt@lp.com').id user = datastore.get_user(user_id) assert user is not None user = datastore.get_user('matt@lp.com') assert user is not None user = datastore.get_user('matt') assert user is not None def test_find_role(app, datastore): init_app_with_options(app, datastore) role = datastore.find_role('admin') assert role is not None role = datastore.find_role('bogus') assert role is None def test_add_role_to_user(app, datastore): init_app_with_options(app, datastore) # Test with user object user = datastore.find_user(email='matt@lp.com') assert user.has_role('editor') is False assert datastore.add_role_to_user(user, 'editor') is True assert datastore.add_role_to_user(user, 'editor') is False assert user.has_role('editor') is True # Test with email assert datastore.add_role_to_user('jill@lp.com', 'editor') is True user = datastore.find_user(email='jill@lp.com') assert user.has_role('editor') is True # Test remove role assert datastore.remove_role_from_user(user, 'editor') is True assert datastore.remove_role_from_user(user, 'editor') is False def test_create_user_with_roles(app, datastore): init_app_with_options(app, datastore) role = datastore.find_role('admin') datastore.commit() user = datastore.create_user(email='dude@lp.com', username='dude', password='password', roles=[role]) datastore.commit() user = datastore.find_user(email='dude@lp.com') assert user.has_role('admin') is True def test_delete_user(app, datastore): init_app_with_options(app, datastore) user = datastore.find_user(email='matt@lp.com') datastore.delete_user(user) datastore.commit() user = datastore.find_user(email='matt@lp.com') assert user is None
mit
savi-dev/heat
heat/engine/service.py
1
32075
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import functools import json from oslo.config import cfg import webob cfg.CONF.import_opt('max_resources_per_stack', 'heat.common.config') cfg.CONF.import_opt('max_stacks_per_tenant', 'heat.common.config') from heat.openstack.common import timeutils from heat.common import context from heat.db import api as db_api from heat.engine import api from heat.rpc import api as rpc_api from heat.engine import attributes from heat.engine import clients from heat.engine.event import Event from heat.engine import environment from heat.common import exception from heat.common import identifier from heat.common import heat_keystoneclient as hkc from heat.engine import parameters from heat.engine import parser from heat.engine import properties from heat.engine import resource from heat.engine import resources from heat.engine import template as tpl from heat.engine import watchrule from heat.openstack.common import log as logging from heat.openstack.common import threadgroup from heat.openstack.common.gettextutils import _ from heat.openstack.common.rpc import service from heat.openstack.common import uuidutils logger = logging.getLogger(__name__) def request_context(func): @functools.wraps(func) def wrapped(self, ctx, *args, **kwargs): if ctx is not None and not isinstance(ctx, context.RequestContext): ctx = context.RequestContext.from_dict(ctx.to_dict()) return func(self, ctx, *args, **kwargs) return wrapped class EngineService(service.Service): """ Manages the running instances from creation to destruction. All the methods in here are called from the RPC backend. This is all done dynamically so if a call is made via RPC that does not have a corresponding method here, an exception will be thrown when it attempts to call into this class. Arguments to these methods are also dynamically added and will be named as keyword arguments by the RPC caller. """ def __init__(self, host, topic, manager=None): super(EngineService, self).__init__(host, topic) # stg == "Stack Thread Groups" self.stg = {} resources.initialise() def _start_in_thread(self, stack_id, func, *args, **kwargs): if stack_id not in self.stg: self.stg[stack_id] = threadgroup.ThreadGroup() self.stg[stack_id].add_thread(func, *args, **kwargs) def _timer_in_thread(self, stack_id, func, *args, **kwargs): """ Define a periodic task, to be run in a separate thread, in the stack threadgroups. Periodicity is cfg.CONF.periodic_interval """ if stack_id not in self.stg: self.stg[stack_id] = threadgroup.ThreadGroup() self.stg[stack_id].add_timer(cfg.CONF.periodic_interval, func, *args, **kwargs) def _service_task(self): """ This is a dummy task which gets queued on the service.Service threadgroup. Without this service.Service sees nothing running i.e has nothing to wait() on, so the process exits.. This could also be used to trigger periodic non-stack-specific housekeeping tasks """ pass def _start_watch_task(self, stack_id, cnxt): def stack_has_a_watchrule(sid): wrs = db_api.watch_rule_get_all_by_stack(cnxt, sid) now = timeutils.utcnow() start_watch_thread = False for wr in wrs: # reset the last_evaluated so we don't fire off alarms when # the engine has not been running. db_api.watch_rule_update(cnxt, wr.id, {'last_evaluated': now}) if wr.state != rpc_api.WATCH_STATE_CEILOMETER_CONTROLLED: start_watch_thread = True children = db_api.stack_get_all_by_owner_id(cnxt, sid) for child in children: if stack_has_a_watchrule(child.id): start_watch_thread = True return start_watch_thread if stack_has_a_watchrule(stack_id): self._timer_in_thread(stack_id, self._periodic_watcher_task, sid=stack_id) def start(self): super(EngineService, self).start() # Create dummy service task, because when there is nothing queued # on self.tg the process exits self.tg.add_timer(cfg.CONF.periodic_interval, self._service_task) # Create a periodic_watcher_task per-stack admin_context = context.get_admin_context() stacks = db_api.stack_get_all(admin_context) for s in stacks: self._start_watch_task(s.id, admin_context) @request_context def identify_stack(self, cnxt, stack_name): """ The identify_stack method returns the full stack identifier for a single, live stack given the stack name. arg1 -> RPC context. arg2 -> Name or UUID of the stack to look up. """ if uuidutils.is_uuid_like(stack_name): s = db_api.stack_get(cnxt, stack_name, show_deleted=True) else: s = db_api.stack_get_by_name(cnxt, stack_name) if s: stack = parser.Stack.load(cnxt, stack=s) return dict(stack.identifier()) else: raise exception.StackNotFound(stack_name=stack_name) def _get_stack(self, cnxt, stack_identity, show_deleted=False): identity = identifier.HeatIdentifier(**stack_identity) if identity.tenant != cnxt.tenant_id: raise exception.InvalidTenant(target=identity.tenant, actual=cnxt.tenant_id) s = db_api.stack_get(cnxt, identity.stack_id, show_deleted=show_deleted) if s is None: raise exception.StackNotFound(stack_name=identity.stack_name) if identity.path or s.name != identity.stack_name: raise exception.StackNotFound(stack_name=identity.stack_name) return s @request_context def show_stack(self, cnxt, stack_identity): """ Return detailed information about one or all stacks. arg1 -> RPC cnxt. arg2 -> Name of the stack you want to show, or None to show all """ if stack_identity is not None: stacks = [self._get_stack(cnxt, stack_identity, show_deleted=True)] else: stacks = db_api.stack_get_all_by_tenant(cnxt) or [] def format_stack_detail(s): stack = parser.Stack.load(cnxt, stack=s) return api.format_stack(stack) return [format_stack_detail(s) for s in stacks] @request_context def list_stacks(self, cnxt): """ The list_stacks method returns attributes of all stacks. arg1 -> RPC cnxt. """ def format_stack_details(stacks): for s in stacks: try: stack = parser.Stack.load(cnxt, stack=s, resolve_data=False) except exception.NotFound: # The stack may have been deleted between listing # and formatting pass else: yield api.format_stack(stack) stacks = db_api.stack_get_all_by_tenant(cnxt) or [] return list(format_stack_details(stacks)) def _validate_deferred_auth_context(self, cnxt, stack): if cfg.CONF.deferred_auth_method != 'password': return if not stack.requires_deferred_auth(): return if cnxt.username is None: raise exception.MissingCredentialError(required='X-Auth-User') if cnxt.password is None: raise exception.MissingCredentialError(required='X-Auth-Key') @request_context def create_stack(self, cnxt, stack_name, template, params, files, args): """ The create_stack method creates a new stack using the template provided. Note that at this stage the template has already been fetched from the heat-api process if using a template-url. :param cnxt: RPC context. :param stack_name: Name of the stack you want to create. :param template: Template of stack you want to create. :param params: Stack Input Params :param files: Files referenced from the template :param args: Request parameters/args passed from API """ logger.info('template is %s' % template) def _stack_create(stack): # Create the stack, and create the periodic task if successful stack.create() if stack.action == stack.CREATE and stack.status == stack.COMPLETE: # Schedule a periodic watcher task for this stack self._start_watch_task(stack.id, cnxt) else: logger.warning("Stack create failed, status %s" % stack.status) if db_api.stack_get_by_name(cnxt, stack_name): raise exception.StackExists(stack_name=stack_name) tenant_limit = cfg.CONF.max_stacks_per_tenant if db_api.stack_count_all_by_tenant(cnxt) >= tenant_limit: message = _("You have reached the maximum stacks per tenant, %d." " Please delete some stacks.") % tenant_limit raise exception.RequestLimitExceeded(message=message) tmpl = parser.Template(template, files=files) if len(tmpl[tpl.RESOURCES]) > cfg.CONF.max_resources_per_stack: raise exception.RequestLimitExceeded( message=exception.StackResourceLimitExceeded.msg_fmt) # Extract the common query parameters common_params = api.extract_args(args) env = environment.Environment(params) stack = parser.Stack(cnxt, stack_name, tmpl, env, **common_params) self._validate_deferred_auth_context(cnxt, stack) stack.validate() stack_id = stack.store() self._start_in_thread(stack_id, _stack_create, stack) return dict(stack.identifier()) @request_context def update_stack(self, cnxt, stack_identity, template, params, files, args): """ The update_stack method updates an existing stack based on the provided template and parameters. Note that at this stage the template has already been fetched from the heat-api process if using a template-url. arg1 -> RPC context. arg2 -> Name of the stack you want to create. arg3 -> Template of stack you want to create. arg4 -> Stack Input Params arg4 -> Request parameters/args passed from API """ logger.info('template is %s' % template) # Get the database representation of the existing stack db_stack = self._get_stack(cnxt, stack_identity) current_stack = parser.Stack.load(cnxt, stack=db_stack) if current_stack.action == current_stack.SUSPEND: msg = _('Updating a stack when it is suspended') raise exception.NotSupported(feature=msg) if current_stack.status == current_stack.IN_PROGRESS: msg = _('Updating a stack when another action is in progress') raise exception.NotSupported(feature=msg) # Now parse the template and any parameters for the updated # stack definition. tmpl = parser.Template(template, files=files) if len(tmpl[tpl.RESOURCES]) > cfg.CONF.max_resources_per_stack: raise exception.RequestLimitExceeded( message=exception.StackResourceLimitExceeded.msg_fmt) stack_name = current_stack.name common_params = api.extract_args(args) env = environment.Environment(params) updated_stack = parser.Stack(cnxt, stack_name, tmpl, env, **common_params) self._validate_deferred_auth_context(cnxt, updated_stack) updated_stack.validate() self._start_in_thread(db_stack.id, current_stack.update, updated_stack) return dict(current_stack.identifier()) @request_context def validate_template(self, cnxt, template): """ The validate_template method uses the stack parser to check the validity of a template. arg1 -> RPC context. arg3 -> Template of stack you want to create. arg4 -> Stack Input Params """ logger.info('validate_template') if template is None: msg = _("No Template provided.") return webob.exc.HTTPBadRequest(explanation=msg) tmpl = parser.Template(template) tmpl_resources = tmpl.get('Resources', []) if not tmpl_resources: return {'Error': 'At least one Resources member must be defined.'} for res in tmpl_resources.values(): try: if not res.get('Type'): return {'Error': 'Every Resource object must ' 'contain a Type member.'} except AttributeError: type_res = type(res) if isinstance(res, unicode): type_res = "string" return {'Error': 'Resources must contain Resource. ' 'Found a [%s] instead' % type_res} ResourceClass = resource.get_class(res['Type']) if ResourceClass == resources.template_resource.TemplateResource: # we can't validate a TemplateResource unless we instantiate # it as we need to download the template and convert the # paramerters into properties_schema. continue props = properties.Properties(ResourceClass.properties_schema, res.get('Properties', {})) try: ResourceClass.validate_deletion_policy(res) props.validate(with_value=False) except Exception as ex: return {'Error': str(ex)} tmpl_params = parser.Parameters(None, tmpl, validate_value=False) format_validate_parameter = lambda p: dict(p.schema) is_real_param = lambda p: p.name not in parameters.PSEUDO_PARAMETERS params = tmpl_params.map(format_validate_parameter, is_real_param) result = { 'Description': tmpl.get('Description', ''), 'Parameters': params, } return result @request_context def authenticated_to_backend(self, cnxt): """ Verify that the credentials in the RPC context are valid for the current cloud backend. """ return clients.Clients(cnxt).authenticated() @request_context def get_template(self, cnxt, stack_identity): """ Get the template. arg1 -> RPC context. arg2 -> Name of the stack you want to see. """ s = self._get_stack(cnxt, stack_identity, show_deleted=True) if s: return s.raw_template.template return None @request_context def delete_stack(self, cnxt, stack_identity): """ The delete_stack method deletes a given stack. arg1 -> RPC context. arg2 -> Name of the stack you want to delete. """ st = self._get_stack(cnxt, stack_identity) logger.info('deleting stack %s' % st.name) stack = parser.Stack.load(cnxt, stack=st) # Kill any pending threads by calling ThreadGroup.stop() if st.id in self.stg: self.stg[st.id].stop() del self.stg[st.id] # use the service ThreadGroup for deletes self.tg.add_thread(stack.delete) return None def list_resource_types(self, cnxt): """ Get a list of supported resource types. arg1 -> RPC context. """ return list(resource.get_types()) def resource_schema(self, cnxt, type_name): """ Return the schema of the specified type. arg1 -> RPC context. arg2 -> Name of the resource type to obtain the schema of. """ try: resource_class = resource.get_class(type_name) except exception.StackValidationFailed: raise exception.ResourceTypeNotFound(type_name=type_name) def properties_schema(): for name, schema_dict in resource_class.properties_schema.items(): schema = properties.Schema.from_legacy(schema_dict) if schema.implemented: yield name, dict(schema) def attributes_schema(): for schema_item in resource_class.attributes_schema.items(): schema = attributes.Attribute(*schema_item) yield schema.name, {schema.DESCRIPTION: schema.description} return { rpc_api.RES_SCHEMA_RES_TYPE: type_name, rpc_api.RES_SCHEMA_PROPERTIES: dict(properties_schema()), rpc_api.RES_SCHEMA_ATTRIBUTES: dict(attributes_schema()), } def generate_template(self, cnxt, type_name): """ Generate a template based on the specified type. arg1 -> RPC context. arg2 -> Name of the resource type to generate a template for. """ try: return \ resource.get_class(type_name).resource_to_template(type_name) except exception.StackValidationFailed: raise exception.ResourceTypeNotFound(type_name=type_name) @request_context def list_events(self, cnxt, stack_identity): """ The list_events method lists all events associated with a given stack. arg1 -> RPC context. arg2 -> Name of the stack you want to get events for. """ if stack_identity is not None: st = self._get_stack(cnxt, stack_identity, show_deleted=True) events = db_api.event_get_all_by_stack(cnxt, st.id) else: events = db_api.event_get_all_by_tenant(cnxt) stacks = {} def get_stack(stack_id): if stack_id not in stacks: stacks[stack_id] = parser.Stack.load(cnxt, stack_id) return stacks[stack_id] return [api.format_event(Event.load(cnxt, e.id, e, get_stack(e.stack_id))) for e in events] def _authorize_stack_user(self, cnxt, stack, resource_name): ''' Filter access to describe_stack_resource for stack in-instance users - The user must map to a User resource defined in the requested stack - The user resource must validate OK against any Policy specified ''' # We're expecting EC2 credentials because all in-instance credentials # are deployed as ec2 keypairs try: ec2_creds = json.loads(cnxt.aws_creds).get('ec2Credentials') except (TypeError, AttributeError): ec2_creds = None if ec2_creds: access_key = ec2_creds.get('access') # Then we look up the AccessKey resource and check the stack try: akey_rsrc = self.find_physical_resource(cnxt, access_key) except exception.PhysicalResourceNotFound: logger.warning("access_key % not found!" % access_key) return False akey_rsrc_id = identifier.ResourceIdentifier(**akey_rsrc) if stack.identifier() == akey_rsrc_id.stack(): # The stack matches, so check if access is allowed to this # resource via the AccessKey resource access_allowed() ak_akey_rsrc = stack[akey_rsrc_id.resource_name] return ak_akey_rsrc.access_allowed(resource_name) else: logger.warning("Cannot access resource from wrong stack!") else: logger.warning("Cannot access resource, invalid credentials!") return False @request_context def describe_stack_resource(self, cnxt, stack_identity, resource_name): s = self._get_stack(cnxt, stack_identity) stack = parser.Stack.load(cnxt, stack=s) if cfg.CONF.heat_stack_user_role in cnxt.roles: if not self._authorize_stack_user(cnxt, stack, resource_name): logger.warning("Access denied to resource %s" % resource_name) raise exception.Forbidden() if resource_name not in stack: raise exception.ResourceNotFound(resource_name=resource_name, stack_name=stack.name) resource = stack[resource_name] if resource.id is None: raise exception.ResourceNotAvailable(resource_name=resource_name) return api.format_stack_resource(stack[resource_name]) @request_context def resource_signal(self, cnxt, stack_identity, resource_name, details): s = self._get_stack(cnxt, stack_identity) # This is not "nice" converting to the stored context here, # but this happens because the keystone user associated with the # signal doesn't have permission to read the secret key of # the user associated with the cfn-credentials file stack_context = self._load_user_creds(s.user_creds_id) stack = parser.Stack.load(stack_context, stack=s) if resource_name not in stack: raise exception.ResourceNotFound(resource_name=resource_name, stack_name=stack.name) resource = stack[resource_name] if resource.id is None: raise exception.ResourceNotAvailable(resource_name=resource_name) if callable(stack[resource_name].signal): stack[resource_name].signal(details) @request_context def find_physical_resource(self, cnxt, physical_resource_id): """ Return an identifier for the resource with the specified physical resource ID. arg1 -> RPC context. arg2 -> The physical resource ID to look up. """ rs = db_api.resource_get_by_physical_resource_id(cnxt, physical_resource_id) if not rs: raise exception.PhysicalResourceNotFound( resource_id=physical_resource_id) stack = parser.Stack.load(cnxt, stack=rs.stack) resource = stack[rs.name] return dict(resource.identifier()) @request_context def describe_stack_resources(self, cnxt, stack_identity, resource_name): s = self._get_stack(cnxt, stack_identity) stack = parser.Stack.load(cnxt, stack=s) return [api.format_stack_resource(resource) for name, resource in stack.iteritems() if resource_name is None or name == resource_name] @request_context def list_stack_resources(self, cnxt, stack_identity): s = self._get_stack(cnxt, stack_identity) stack = parser.Stack.load(cnxt, stack=s) return [api.format_stack_resource(resource, detail=False) for resource in stack.values()] @request_context def stack_suspend(self, cnxt, stack_identity): ''' Handle request to perform suspend action on a stack ''' def _stack_suspend(stack): logger.debug("suspending stack %s" % stack.name) stack.suspend() s = self._get_stack(cnxt, stack_identity) stack = parser.Stack.load(cnxt, stack=s) self._start_in_thread(stack.id, _stack_suspend, stack) @request_context def stack_resume(self, cnxt, stack_identity): ''' Handle request to perform a resume action on a stack ''' def _stack_resume(stack): logger.debug("resuming stack %s" % stack.name) stack.resume() s = self._get_stack(cnxt, stack_identity) stack = parser.Stack.load(cnxt, stack=s) self._start_in_thread(stack.id, _stack_resume, stack) def _load_user_creds(self, creds_id): user_creds = db_api.user_creds_get(creds_id) stored_context = context.RequestContext.from_dict(user_creds) # heat_keystoneclient populates the context with an auth_token # either via the stored user/password or trust_id, depending # on how deferred_auth_method is configured in the conf file kc = hkc.KeystoneClient(stored_context) return stored_context @request_context def metadata_update(self, cnxt, stack_identity, resource_name, metadata): """ Update the metadata for the given resource. """ s = self._get_stack(cnxt, stack_identity) stack = parser.Stack.load(cnxt, stack=s) if resource_name not in stack: raise exception.ResourceNotFound(resource_name=resource_name, stack_name=stack.name) resource = stack[resource_name] resource.metadata_update(new_metadata=metadata) # This is not "nice" converting to the stored context here, # but this happens because the keystone user associated with the # WaitCondition doesn't have permission to read the secret key of # the user associated with the cfn-credentials file stack_context = self._load_user_creds(s.user_creds_id) refresh_stack = parser.Stack.load(stack_context, stack=s) # Refresh the metadata for all other resources, since we expect # resource_name to be a WaitCondition resource, and other # resources may refer to WaitCondition Fn::GetAtt Data, which # is updated here. for res in refresh_stack.dependencies: if res.name != resource_name and res.id is not None: res.metadata_update() return resource.metadata def _check_stack_watches(self, sid): # Retrieve the stored credentials & create context # Require admin=True to the stack_get to defeat tenant # scoping otherwise we fail to retrieve the stack logger.debug("Periodic watcher task for stack %s" % sid) admin_context = context.get_admin_context() stack = db_api.stack_get(admin_context, sid, admin=True) if not stack: logger.error("Unable to retrieve stack %s for periodic task" % sid) return stack_context = self._load_user_creds(stack.user_creds_id) # recurse into any nested stacks. children = db_api.stack_get_all_by_owner_id(admin_context, sid) for child in children: self._check_stack_watches(child.id) # Get all watchrules for this stack and evaluate them try: wrs = db_api.watch_rule_get_all_by_stack(stack_context, sid) except Exception as ex: logger.warn('periodic_task db error (%s) %s' % ('watch rule removed?', str(ex))) return def run_alarm_action(actions, details): for action in actions: action(details=details) stk = parser.Stack.load(stack_context, stack=stack) for res in stk.itervalues(): res.metadata_update() for wr in wrs: rule = watchrule.WatchRule.load(stack_context, watch=wr) actions = rule.evaluate() if actions: self._start_in_thread(sid, run_alarm_action, actions, rule.get_details()) def _periodic_watcher_task(self, sid): """ Periodic task, created for each stack, triggers watch-rule evaluation for all rules defined for the stack sid = stack ID """ self._check_stack_watches(sid) @request_context def create_watch_data(self, cnxt, watch_name, stats_data): ''' This could be used by CloudWatch and WaitConditions and treat HA service events like any other CloudWatch. ''' def get_matching_watches(): if watch_name: yield watchrule.WatchRule.load(cnxt, watch_name) else: for wr in db_api.watch_rule_get_all(cnxt): if watchrule.rule_can_use_sample(wr, stats_data): yield watchrule.WatchRule.load(cnxt, watch=wr) rule_run = False for rule in get_matching_watches(): rule.create_watch_data(stats_data) rule_run = True if not rule_run: if watch_name is None: watch_name = 'Unknown' raise exception.WatchRuleNotFound(watch_name=watch_name) return stats_data @request_context def show_watch(self, cnxt, watch_name): ''' The show_watch method returns the attributes of one watch/alarm arg1 -> RPC context. arg2 -> Name of the watch you want to see, or None to see all ''' if watch_name: wrn = [watch_name] else: try: wrn = [w.name for w in db_api.watch_rule_get_all(cnxt)] except Exception as ex: logger.warn('show_watch (all) db error %s' % str(ex)) return wrs = [watchrule.WatchRule.load(cnxt, w) for w in wrn] result = [api.format_watch(w) for w in wrs] return result @request_context def show_watch_metric(self, cnxt, metric_namespace=None, metric_name=None): ''' The show_watch method returns the datapoints for a metric arg1 -> RPC context. arg2 -> Name of the namespace you want to see, or None to see all arg3 -> Name of the metric you want to see, or None to see all ''' # DB API and schema does not yet allow us to easily query by # namespace/metric, but we will want this at some point # for now, the API can query all metric data and filter locally if metric_namespace is not None or metric_name is not None: logger.error("Filtering by namespace/metric not yet supported") return try: wds = db_api.watch_data_get_all(cnxt) except Exception as ex: logger.warn('show_metric (all) db error %s' % str(ex)) return result = [api.format_watch_data(w) for w in wds] return result @request_context def set_watch_state(self, cnxt, watch_name, state): ''' Temporarily set the state of a given watch arg1 -> RPC context. arg2 -> Name of the watch arg3 -> State (must be one defined in WatchRule class ''' wr = watchrule.WatchRule.load(cnxt, watch_name) if wr.state == rpc_api.WATCH_STATE_CEILOMETER_CONTROLLED: return actions = wr.set_watch_state(state) for action in actions: self._start_in_thread(wr.stack_id, action) # Return the watch with the state overriden to indicate success # We do not update the timestamps as we are not modifying the DB result = api.format_watch(wr) result[rpc_api.WATCH_STATE_VALUE] = state return result
apache-2.0
gurneyalex/odoo
odoo/addons/base/wizard/base_export_language.py
6
2261
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import contextlib import io from odoo import api, fields, models, tools, _ NEW_LANG_KEY = '__new__' class BaseLanguageExport(models.TransientModel): _name = "base.language.export" _description = 'Language Export' @api.model def _get_languages(self): langs = self.env['res.lang'].get_installed() return [(NEW_LANG_KEY, _('New Language (Empty translation template)'))] + \ langs name = fields.Char('File Name', readonly=True) lang = fields.Selection(_get_languages, string='Language', required=True, default=NEW_LANG_KEY) format = fields.Selection([('csv','CSV File'), ('po','PO File'), ('tgz', 'TGZ Archive')], string='File Format', required=True, default='csv') modules = fields.Many2many('ir.module.module', 'rel_modules_langexport', 'wiz_id', 'module_id', string='Apps To Export', domain=[('state','=','installed')]) data = fields.Binary('File', readonly=True, attachment=False) state = fields.Selection([('choose', 'choose'), ('get', 'get')], # choose language or get the file default='choose') def act_getfile(self): this = self[0] lang = this.lang if this.lang != NEW_LANG_KEY else False mods = sorted(this.mapped('modules.name')) or ['all'] with contextlib.closing(io.BytesIO()) as buf: tools.trans_export(lang, mods, buf, this.format, self._cr) out = base64.encodestring(buf.getvalue()) filename = 'new' if lang: filename = tools.get_iso_codes(lang) elif len(mods) == 1: filename = mods[0] extension = this.format if not lang and extension == 'po': extension = 'pot' name = "%s.%s" % (filename, extension) this.write({'state': 'get', 'data': out, 'name': name}) return { 'type': 'ir.actions.act_window', 'res_model': 'base.language.export', 'view_mode': 'form', 'res_id': this.id, 'views': [(False, 'form')], 'target': 'new', }
agpl-3.0
ossobv/asterisklint
tests/alintregress/test_asterisk_dp.py
1
1730
# AsteriskLint -- an Asterisk PBX config syntax checker # Copyright (C) 2017 Walter Doekes, OSSO B.V. # # 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 distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from importlib import import_module from asterisklint.alinttest import ALintTestCase from asterisklint.application import AppLoader class AsteriskDpTest(ALintTestCase): """ Test extensions.conf as supplied by Asterisk 13; after a few edits. """ def test_extensions_conf(self): filename = __file__.rsplit('.', 1)[0] + '.conf' # drop '.py[c]' # Hack to preserve chosen Background-case. This dialplan would # "unfix" the defaults for the other tests. background = AppLoader().get('background') chosen_spelling = background.chosen_spelling try: mainmod = import_module('asterisklint.commands.dialplan-check') mainmod.main([filename], {}) finally: # Reset original Background-case. background.chosen_spelling = chosen_spelling self.assertLinted( {'I_NOTIMPL_IGNOREPAT': 3, 'I_NOTIMPL_SWITCH': 1, 'W_DP_PRIO_BADORDER': 4})
gpl-3.0
xuxiao19910803/edx
common/test/acceptance/fixtures/certificates.py
80
1221
""" Tools for creating certificates config fixture data. """ import json from . import STUDIO_BASE_URL from .base import StudioApiFixture class CertificateConfigFixtureError(Exception): """ Error occurred while installing certificate config fixture. """ pass class CertificateConfigFixture(StudioApiFixture): """ Fixture to create certificates configuration for a course """ certificates = [] def __init__(self, course_id, certificates_data): self.course_id = course_id self.certificates = certificates_data super(CertificateConfigFixture, self).__init__() def install(self): """ Push the certificates config data to certificate endpoint. """ response = self.session.post( '{}/certificates/{}'.format(STUDIO_BASE_URL, self.course_id), data=json.dumps(self.certificates), headers=self.headers ) if not response.ok: raise CertificateConfigFixtureError( "Could not create certificate {0}. Status was {1}".format( json.dumps(self.certificates), response.status_code ) ) return self
agpl-3.0
jameslegg/boto
tests/unit/provider/test_provider.py
9
6945
#!/usr/bin/env python from datetime import datetime, timedelta from tests.unit import unittest import mock from boto import provider INSTANCE_CONFIG = { 'allowall': { u'AccessKeyId': u'iam_access_key', u'Code': u'Success', u'Expiration': u'2012-09-01T03:57:34Z', u'LastUpdated': u'2012-08-31T21:43:40Z', u'SecretAccessKey': u'iam_secret_key', u'Token': u'iam_token', u'Type': u'AWS-HMAC' } } class TestProvider(unittest.TestCase): def setUp(self): self.environ = {} self.config = {} self.metadata_patch = mock.patch('boto.utils.get_instance_metadata') self.config_patch = mock.patch('boto.provider.config.get', self.get_config) self.has_config_patch = mock.patch('boto.provider.config.has_option', self.has_config) self.environ_patch = mock.patch('os.environ', self.environ) self.get_instance_metadata = self.metadata_patch.start() self.config_patch.start() self.has_config_patch.start() self.environ_patch.start() def tearDown(self): self.metadata_patch.stop() self.config_patch.stop() self.has_config_patch.stop() self.environ_patch.stop() def has_config(self, section_name, key): try: self.config[section_name][key] return True except KeyError: return False def get_config(self, section_name, key): try: return self.config[section_name][key] except KeyError: return None def test_passed_in_values_are_used(self): p = provider.Provider('aws', 'access_key', 'secret_key', 'security_token') self.assertEqual(p.access_key, 'access_key') self.assertEqual(p.secret_key, 'secret_key') self.assertEqual(p.security_token, 'security_token') def test_environment_variables_are_used(self): self.environ['AWS_ACCESS_KEY_ID'] = 'env_access_key' self.environ['AWS_SECRET_ACCESS_KEY'] = 'env_secret_key' p = provider.Provider('aws') self.assertEqual(p.access_key, 'env_access_key') self.assertEqual(p.secret_key, 'env_secret_key') self.assertIsNone(p.security_token) def test_config_values_are_used(self): self.config = { 'Credentials': { 'aws_access_key_id': 'cfg_access_key', 'aws_secret_access_key': 'cfg_secret_key', } } p = provider.Provider('aws') self.assertEqual(p.access_key, 'cfg_access_key') self.assertEqual(p.secret_key, 'cfg_secret_key') self.assertIsNone(p.security_token) def test_keyring_is_used(self): self.config = { 'Credentials': { 'aws_access_key_id': 'cfg_access_key', 'keyring': 'test', } } import sys try: import keyring imported = True except ImportError: sys.modules['keyring'] = keyring = type(mock)('keyring', '') imported = False try: with mock.patch('keyring.get_password', create=True): keyring.get_password.side_effect = ( lambda kr, login: kr+login+'pw') p = provider.Provider('aws') self.assertEqual(p.access_key, 'cfg_access_key') self.assertEqual(p.secret_key, 'testcfg_access_keypw') self.assertIsNone(p.security_token) finally: if not imported: del sys.modules['keyring'] def test_env_vars_beat_config_values(self): self.environ['AWS_ACCESS_KEY_ID'] = 'env_access_key' self.environ['AWS_SECRET_ACCESS_KEY'] = 'env_secret_key' self.config = { 'Credentials': { 'aws_access_key_id': 'cfg_access_key', 'aws_secret_access_key': 'cfg_secret_key', } } p = provider.Provider('aws') self.assertEqual(p.access_key, 'env_access_key') self.assertEqual(p.secret_key, 'env_secret_key') self.assertIsNone(p.security_token) def test_metadata_server_credentials(self): self.get_instance_metadata.return_value = INSTANCE_CONFIG p = provider.Provider('aws') self.assertEqual(p.access_key, 'iam_access_key') self.assertEqual(p.secret_key, 'iam_secret_key') self.assertEqual(p.security_token, 'iam_token') self.assertEqual( self.get_instance_metadata.call_args[1]['data'], 'meta-data/iam/security-credentials') def test_refresh_credentials(self): now = datetime.now() first_expiration = (now + timedelta(seconds=10)).strftime( "%Y-%m-%dT%H:%M:%SZ") credentials = { u'AccessKeyId': u'first_access_key', u'Code': u'Success', u'Expiration': first_expiration, u'LastUpdated': u'2012-08-31T21:43:40Z', u'SecretAccessKey': u'first_secret_key', u'Token': u'first_token', u'Type': u'AWS-HMAC' } instance_config = {'allowall': credentials} self.get_instance_metadata.return_value = instance_config p = provider.Provider('aws') self.assertEqual(p.access_key, 'first_access_key') self.assertEqual(p.secret_key, 'first_secret_key') self.assertEqual(p.security_token, 'first_token') self.assertIsNotNone(p._credential_expiry_time) # Now set the expiration to something in the past. expired = now - timedelta(seconds=20) p._credential_expiry_time = expired credentials['AccessKeyId'] = 'second_access_key' credentials['SecretAccessKey'] = 'second_secret_key' credentials['Token'] = 'second_token' self.get_instance_metadata.return_value = instance_config # Now upon attribute access, the credentials should be updated. self.assertEqual(p.access_key, 'second_access_key') self.assertEqual(p.secret_key, 'second_secret_key') self.assertEqual(p.security_token, 'second_token') @mock.patch('boto.provider.config.getint') @mock.patch('boto.provider.config.getfloat') def test_metadata_config_params(self, config_float, config_int): config_int.return_value = 10 config_float.return_value = 4.0 self.get_instance_metadata.return_value = INSTANCE_CONFIG p = provider.Provider('aws') self.assertEqual(p.access_key, 'iam_access_key') self.assertEqual(p.secret_key, 'iam_secret_key') self.assertEqual(p.security_token, 'iam_token') self.get_instance_metadata.assert_called_with( timeout=4.0, num_retries=10, data='meta-data/iam/security-credentials') if __name__ == '__main__': unittest.main()
mit
craisins/yosbot
plugins/youtube.py
7
2351
import re import time from util import hook, http youtube_re = (r'(?:youtube.*?(?:v=|/v/)|youtu\.be/|yooouuutuuube.*?id=)' '([-_a-z0-9]+)', re.I) base_url = 'https://www.googleapis.com/youtube/v3/' info_url = base_url + 'videos?part=snippet,contentDetails,statistics' search_api_url = base_url + 'search' video_url = 'http://youtube.com/watch?v=%s' def get_video_description(vid_id, api_key): j = http.get_json(info_url, id=vid_id, key=api_key) if not j['pageInfo']['totalResults']: return j = j['items'][0] duration = j['contentDetails']['duration'].replace('PT', '').lower() published = time.strptime(j['snippet']['publishedAt'], "%Y-%m-%dT%H:%M:%S.000Z") published = time.strftime("%Y.%m.%d", published) views = group_int_digits(j['statistics']['viewCount'], ',') out = (u'\x02{snippet[title]}\x02 - length \x02{duration}\x02 - ' u'{statistics[likeCount]}\u2191{statistics[dislikeCount]}\u2193 - ' u'\x02{views}\x02 views - ' u'\x02{snippet[channelTitle]}\x02 on \x02{published}\x02' ).format(duration=duration, views=views, published=published, **j) # TODO: figure out how to detect NSFW videos return out def group_int_digits(number, delimiter=' ', grouping=3): base = str(number).strip() builder = [] while base: builder.append(base[-grouping:]) base = base[:-grouping] builder.reverse() return delimiter.join(builder) @hook.api_key('google') @hook.regex(*youtube_re) def youtube_url(match, api_key=None): return get_video_description(match.group(1), api_key) @hook.api_key('google') @hook.command('yt') @hook.command('y') @hook.command def youtube(inp, api_key=None): '.youtube <query> -- returns the first YouTube search result for <query>' params = { 'key': api_key, 'fields': 'items(id,snippet(channelId,title))', 'part': 'snippet', 'type': 'video', 'q': inp } j = http.get_json(search_api_url, **params) if 'error' in j: return 'error while performing the search' results = j.get("items") if not results: return 'no results found' vid_id = j['items'][0]['id']['videoId'] return get_video_description(vid_id, api_key) + " - " + video_url % vid_id
unlicense
ayakubovich/bat-country
setup.py
6
1106
from distutils.core import setup setup( name='bat-country', packages=['batcountry'], version='0.2', description='A lightweight, extendible, easy to use Python package for deep dreaming and image generation with Caffe and CNNs', author='Adrian Rosebrock', author_email='adrian@pyimagesearch.com', url='https://github.com/jrosebr1/bat-country', download_url='https://github.com/jrosebr1/bat-country/tarball/0.1', license='MIT', install_requires=[ 'Pillow==2.9.0', 'argparse==1.2.1', 'decorator==3.4.2', 'imutils==0.2.2', 'matplotlib==1.4.3', 'mock==1.0.1', 'networkx==1.9.1', 'nose==1.3.7', 'numpy==1.9.2', 'protobuf==2.6.1', 'pyparsing==2.0.3', 'python-dateutil==2.4.2', 'pytz==2015.4', 'scikit-image==0.11.3', 'scipy==0.15.1', 'six==1.9.0', 'wsgiref==0.1.2', ], keywords=['computer vision', 'machine learning', 'deep learning', 'convolutional neural network', 'deep dream', 'inceptionism'], classifiers=[], )
mit
PeterKietzmann/RIOT
dist/tools/esptool/espreset.py
21
2424
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2019 Gunar Schorcht <gunar@schorcht.net> # 2014 Oliver Hahm <oliver.hahm@inria.fr> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA try: import configparser except ImportError: import ConfigParser as configparser import serial import sys import time import argparse try: serial.Serial except AttributeError: print("\033[1;37;41m\n") print("Something went terribly wrong when loading the pyserial package.") print("There is a good chance that you installed the 'serial' package instead") print("of 'pyserial'. Try running 'pip uninstall serial && pip install pyserial'") print("\033[0m") sys.exit(1) # default serial port defaultport = "/dev/ttyUSB0" # default baudrate for serial connection defaultbaud = 115200 if __name__ == "__main__": parser = argparse.ArgumentParser(description="espreset - ESP reset program") parser.add_argument("-p", "--port", help="Specifies the serial port to use, default is %s" % defaultport, default=defaultport) parser.add_argument("-b", "--baudrate", help="Specifies baudrate for the serial port, default " "is %s" % defaultbaud, default=defaultbaud) args = parser.parse_args() ser = serial.Serial(port=args.port, dsrdtr=0, rtscts=0) ser.baudrate = args.baudrate # set RST low and GPIO0 high ser.setRTS(1) ser.setDTR(0) # keep the RST line low for 0.1 seconds time.sleep(0.1) # set the RST high ser.setRTS(1) ser.setDTR(1) # wait 1 second for boot time.sleep(1) sys.exit(0)
lgpl-2.1
UstadMobile/exelearning-extjs5-mirror
nevow/taglibrary/progressbar.py
14
1208
from nevow import static, tags as t _progress_glue = """ function setPercProgress(nodeName, val) { var node = document.getElementById(nodeName+'_meter'); if (!node.hasAttribute('style')) { node.setAttribute('style', 'width: 0%'); } node.style['width'] = val+'%'; } """ _progress_css = """ .progressbar { width: 50%; height: 15px; border-style: solid; border-width: 1px; } .progressbar div { height: 15px; background-color: #aaaaaa; } """ progressGlueJS = static.File(_progress_glue, 'text/javascript') progressGlue = t.inlineJS(_progress_glue) progressCSSFile = static.File(_progress_css, 'text/css') progressCSS = t.style(type_='text/css')[_progress_css] class ProgressBarComponent(object): def progressBar(self, ctx, data): name = data.get('name', 'progressbar') start_perc = data.get('start', 0) bar = t.div(id_=str(name), class_="progressbar") meter = t.div(id_="%s_meter" % str(name)) return bar[meter(style="width:%s%%" % (start_perc))] progressBar = ProgressBarComponent().progressBar __all__ = ["progressGlueJS", "progressGlue", "progressBar", "progressCSS", "progressCSSFile"]
gpl-2.0
jacquesd/indico
indico/MaKaC/webinterface/rh/calendar.py
2
4564
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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. # # Indico is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Indico; if not, see <http://www.gnu.org/licenses/>. import MaKaC.webinterface.rh.base as base import MaKaC.conference as conference import MaKaC.webinterface.wcalendar as wcalendar import MaKaC.webinterface.urlHandlers as urlHandlers import MaKaC.webinterface.pages.conf_calendar as calendar from MaKaC.common.timezoneUtils import nowutc, DisplayTZ from datetime import datetime from pytz import timezone from MaKaC.errors import AccessError from dateutil.relativedelta import relativedelta class RHCalendar(base.RHProtected): _uh = urlHandlers.UHCalendar def _checkProtection(self): if self._getUser() == None: self._checkSessionUser() categNoAccess = [] for item in self._categList[:]: if not item.canAccess(self.getAW()): categNoAccess.append(item) self._categList.remove(item) if len(self._categList) > 0: self._target = self._categList self._categ = self._categList[0] else: # 'categNoAccess' is necessary in order to be able to retrieve the # 'Contact Info' from all categs the user has no access (see WAccessError) self._target = categNoAccess raise AccessError() def _checkParams(self, params): categIdList = self._normaliseListParam(params.get("selCateg", [])) self._categList = [] cm = conference.CategoryManager() for id in categIdList: try: self._categList.append(cm.getById(id)) except KeyError: continue self._target = self._categList if not self._categList: cm = conference.CategoryManager() self._categList.append(cm.getRoot()) tz = DisplayTZ(self._aw).getDisplayTZ() months = params.get("months", 3) columns = params.get("columns", 3) startDate = nowutc() - relativedelta(months=1) month = int(params.get("month", startDate.astimezone(timezone(tz)).month)) year = int(params.get("year", startDate.astimezone(timezone(tz)).year)) sdate = timezone(tz).localize(datetime(year, month, 1)) self._cal = wcalendar.MonthCalendar(self._aw, sdate, months, columns, self._categList) self._categ = self._categList[0] def _process( self ): p = calendar.WPCalendar( self, self._cal, self._categ ) return p.display() class RHCalendarSelectCategories( base.RH ): _uh = urlHandlers.UHCalendarSelectCategories def _checkParams( self, params ): categIdList = self._normaliseListParam( params.get("selCateg", []) ) self._categList = [] cm = conference.CategoryManager() for id in categIdList: self._categList.append( cm.getById(id) ) tz = DisplayTZ(self._aw).getDisplayTZ() sdate = timezone(tz).localize(datetime(int(params.get("sDate", "")[0:4]),\ int(params.get("sDate", "")[5:7]),\ int(params.get("sDate", "")[8:]))) months = params.get("months", 6) self._cal = wcalendar.MonthCalendar( self._aw, \ sdate, \ months, \ 3, \ self._categList ) xs = self._normaliseListParam( params.get("xs", []) ) self._expanded = [] for id in xs: self._expanded.append( cm.getById( id ) ) def _process( self ): p = calendar.WPCalendarSelectCategories( self, self._cal ) return p.display( expanded=self._expanded )
gpl-3.0
Pankaj-Sakariya/android-source-browsing.git-repo
subcmds/rebase.py
13
4229
# # Copyright (C) 2010 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function import sys from command import Command from git_command import GitCommand class Rebase(Command): common = True helpSummary = "Rebase local branches on upstream branch" helpUsage = """ %prog {[<project>...] | -i <project>...} """ helpDescription = """ '%prog' uses git rebase to move local changes in the current topic branch to the HEAD of the upstream history, useful when you have made commits in a topic branch but need to incorporate new upstream changes "underneath" them. """ def _Options(self, p): p.add_option('-i', '--interactive', dest="interactive", action="store_true", help="interactive rebase (single project only)") p.add_option('-f', '--force-rebase', dest='force_rebase', action='store_true', help='Pass --force-rebase to git rebase') p.add_option('--no-ff', dest='no_ff', action='store_true', help='Pass --no-ff to git rebase') p.add_option('-q', '--quiet', dest='quiet', action='store_true', help='Pass --quiet to git rebase') p.add_option('--autosquash', dest='autosquash', action='store_true', help='Pass --autosquash to git rebase') p.add_option('--whitespace', dest='whitespace', action='store', metavar='WS', help='Pass --whitespace to git rebase') p.add_option('--auto-stash', dest='auto_stash', action='store_true', help='Stash local modifications before starting') def Execute(self, opt, args): all_projects = self.GetProjects(args) one_project = len(all_projects) == 1 if opt.interactive and not one_project: print('error: interactive rebase not supported with multiple projects', file=sys.stderr) return -1 for project in all_projects: cb = project.CurrentBranch if not cb: if one_project: print("error: project %s has a detached HEAD" % project.relpath, file=sys.stderr) return -1 # ignore branches with detatched HEADs continue upbranch = project.GetBranch(cb) if not upbranch.LocalMerge: if one_project: print("error: project %s does not track any remote branches" % project.relpath, file=sys.stderr) return -1 # ignore branches without remotes continue args = ["rebase"] if opt.whitespace: args.append('--whitespace=%s' % opt.whitespace) if opt.quiet: args.append('--quiet') if opt.force_rebase: args.append('--force-rebase') if opt.no_ff: args.append('--no-ff') if opt.autosquash: args.append('--autosquash') if opt.interactive: args.append("-i") args.append(upbranch.LocalMerge) print('# %s: rebasing %s -> %s' % (project.relpath, cb, upbranch.LocalMerge), file=sys.stderr) needs_stash = False if opt.auto_stash: stash_args = ["update-index", "--refresh", "-q"] if GitCommand(project, stash_args).Wait() != 0: needs_stash = True # Dirty index, requires stash... stash_args = ["stash"] if GitCommand(project, stash_args).Wait() != 0: return -1 if GitCommand(project, args).Wait() != 0: return -1 if needs_stash: stash_args.append('pop') stash_args.append('--quiet') if GitCommand(project, stash_args).Wait() != 0: return -1
apache-2.0
sgerhart/ansible
lib/ansible/modules/cloud/openstack/os_image.py
30
6246
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type # TODO(mordred): we need to support "location"(v1) and "locations"(v2) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: os_image short_description: Add/Delete images from OpenStack Cloud extends_documentation_fragment: openstack version_added: "2.0" author: "Monty Taylor (@emonty)" description: - Add or Remove images from the OpenStack Image Repository options: name: description: - The name of the image when uploading - or the name/ID of the image if deleting required: true id: version_added: "2.4" description: - The ID of the image when uploading an image checksum: version_added: "2.5" description: - The checksum of the image disk_format: description: - The format of the disk that is getting uploaded default: qcow2 container_format: description: - The format of the container default: bare owner: description: - The owner of the image min_disk: description: - The minimum disk space (in GB) required to boot this image min_ram: description: - The minimum ram (in MB) required to boot this image is_public: description: - Whether the image can be accessed publicly. Note that publicizing an image requires admin role by default. type: bool default: 'yes' filename: description: - The path to the file which has to be uploaded ramdisk: description: - The name of an existing ramdisk image that will be associated with this image kernel: description: - The name of an existing kernel image that will be associated with this image properties: description: - Additional properties to be associated with this image default: {} state: description: - Should the resource be present or absent. choices: [present, absent] default: present availability_zone: description: - Ignored. Present for backwards compatibility requirements: ["openstacksdk"] ''' EXAMPLES = ''' # Upload an image from a local file named cirros-0.3.0-x86_64-disk.img - os_image: auth: auth_url: https://identity.example.com username: admin password: passme project_name: admin name: cirros container_format: bare disk_format: qcow2 state: present filename: cirros-0.3.0-x86_64-disk.img kernel: cirros-vmlinuz ramdisk: cirros-initrd properties: cpu_arch: x86_64 distro: ubuntu ''' from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs, openstack_cloud_from_module def main(): argument_spec = openstack_full_argument_spec( name=dict(required=True), id=dict(default=None), checksum=dict(default=None), disk_format=dict(default='qcow2', choices=['ami', 'ari', 'aki', 'vhd', 'vmdk', 'raw', 'qcow2', 'vdi', 'iso', 'vhdx', 'ploop']), container_format=dict(default='bare', choices=['ami', 'aki', 'ari', 'bare', 'ovf', 'ova', 'docker']), owner=dict(default=None), min_disk=dict(type='int', default=0), min_ram=dict(type='int', default=0), is_public=dict(type='bool', default=False), filename=dict(default=None), ramdisk=dict(default=None), kernel=dict(default=None), properties=dict(type='dict', default={}), state=dict(default='present', choices=['absent', 'present']), ) module_kwargs = openstack_module_kwargs() module = AnsibleModule(argument_spec, **module_kwargs) sdk, cloud = openstack_cloud_from_module(module) try: changed = False if module.params['checksum']: image = cloud.get_image(name_or_id=None, filters={'checksum': module.params['checksum']}) else: image = cloud.get_image(name_or_id=module.params['name']) if module.params['state'] == 'present': if not image: kwargs = {} if module.params['id'] is not None: kwargs['id'] = module.params['id'] image = cloud.create_image( name=module.params['name'], filename=module.params['filename'], disk_format=module.params['disk_format'], container_format=module.params['container_format'], wait=module.params['wait'], timeout=module.params['timeout'], is_public=module.params['is_public'], min_disk=module.params['min_disk'], min_ram=module.params['min_ram'], **kwargs ) changed = True if not module.params['wait']: module.exit_json(changed=changed, image=image, id=image.id) cloud.update_image_properties( image=image, kernel=module.params['kernel'], ramdisk=module.params['ramdisk'], **module.params['properties']) image = cloud.get_image(name_or_id=image.id) module.exit_json(changed=changed, image=image, id=image.id) elif module.params['state'] == 'absent': if not image: changed = False else: cloud.delete_image( name_or_id=module.params['name'], wait=module.params['wait'], timeout=module.params['timeout']) changed = True module.exit_json(changed=changed) except sdk.exceptions.OpenStackCloudException as e: module.fail_json(msg=str(e), extra_data=e.extra_data) if __name__ == "__main__": main()
mit
rosmo/ansible
lib/ansible/modules/network/fortios/fortios_application_rule_settings.py
24
7379
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2018 Fortinet, Inc. # # 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 distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. # # the lib use python logging can get it if the following is set in your # Ansible config. __metaclass__ = type ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} DOCUMENTATION = ''' --- module: fortios_application_rule_settings short_description: Configure application rule settings in Fortinet's FortiOS and FortiGate. description: - This module is able to configure a FortiGate or FortiOS by allowing the user to configure application feature and rule_settings category. Examples includes all options and need to be adjusted to datasources before usage. Tested with FOS v6.0.2 version_added: "2.8" author: - Miguel Angel Munoz (@mamunozgonzalez) - Nicolas Thomas (@thomnico) notes: - Requires fortiosapi library developed by Fortinet - Run as a local_action in your playbook requirements: - fortiosapi>=0.9.8 options: host: description: - FortiOS or FortiGate ip address. required: true username: description: - FortiOS or FortiGate username. required: true password: description: - FortiOS or FortiGate password. default: "" vdom: description: - Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit. default: root https: description: - Indicates if the requests towards FortiGate must use HTTPS protocol type: bool default: false application_rule_settings: description: - Configure application rule settings. default: null suboptions: state: description: - Indicates whether to create or remove the object choices: - present - absent id: description: - Rule ID. required: true ''' EXAMPLES = ''' - hosts: localhost vars: host: "192.168.122.40" username: "admin" password: "" vdom: "root" tasks: - name: Configure application rule settings. fortios_application_rule_settings: host: "{{ host }}" username: "{{ username }}" password: "{{ password }}" vdom: "{{ vdom }}" application_rule_settings: state: "present" id: "3" ''' RETURN = ''' build: description: Build number of the fortigate image returned: always type: str sample: '1547' http_method: description: Last method used to provision the content into FortiGate returned: always type: str sample: 'PUT' http_status: description: Last result given by FortiGate on last operation applied returned: always type: str sample: "200" mkey: description: Master key (id) used in the last call to FortiGate returned: success type: str sample: "id" name: description: Name of the table used to fulfill the request returned: always type: str sample: "urlfilter" path: description: Path of the table used to fulfill the request returned: always type: str sample: "webfilter" revision: description: Internal revision number returned: always type: str sample: "17.0.2.10658" serial: description: Serial number of the unit returned: always type: str sample: "FGVMEVYYQT3AB5352" status: description: Indication of the operation's result returned: always type: str sample: "success" vdom: description: Virtual domain used returned: always type: str sample: "root" version: description: Version of the FortiGate returned: always type: str sample: "v5.6.3" ''' from ansible.module_utils.basic import AnsibleModule fos = None def login(data): host = data['host'] username = data['username'] password = data['password'] fos.debug('on') if 'https' in data and not data['https']: fos.https('off') else: fos.https('on') fos.login(host, username, password) def filter_application_rule_settings_data(json): option_list = ['id'] dictionary = {} for attribute in option_list: if attribute in json and json[attribute] is not None: dictionary[attribute] = json[attribute] return dictionary def application_rule_settings(data, fos): vdom = data['vdom'] application_rule_settings_data = data['application_rule_settings'] filtered_data = filter_application_rule_settings_data(application_rule_settings_data) if application_rule_settings_data['state'] == "present": return fos.set('application', 'rule-settings', data=filtered_data, vdom=vdom) elif application_rule_settings_data['state'] == "absent": return fos.delete('application', 'rule-settings', mkey=filtered_data['id'], vdom=vdom) def fortios_application(data, fos): login(data) methodlist = ['application_rule_settings'] for method in methodlist: if data[method]: resp = eval(method)(data, fos) break fos.logout() return not resp['status'] == "success", resp['status'] == "success", resp def main(): fields = { "host": {"required": True, "type": "str"}, "username": {"required": True, "type": "str"}, "password": {"required": False, "type": "str", "no_log": True}, "vdom": {"required": False, "type": "str", "default": "root"}, "https": {"required": False, "type": "bool", "default": "False"}, "application_rule_settings": { "required": False, "type": "dict", "options": { "state": {"required": True, "type": "str", "choices": ["present", "absent"]}, "id": {"required": True, "type": "int"} } } } module = AnsibleModule(argument_spec=fields, supports_check_mode=False) try: from fortiosapi import FortiOSAPI except ImportError: module.fail_json(msg="fortiosapi module is required") global fos fos = FortiOSAPI() is_error, has_changed, result = fortios_application(module.params, fos) if not is_error: module.exit_json(changed=has_changed, meta=result) else: module.fail_json(msg="Error in repo", meta=result) if __name__ == '__main__': main()
gpl-3.0
amar-sharma/selenium
py/test/selenium/webdriver/common/text_handling_tests.py
65
8062
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import pytest import unittest from selenium.webdriver.common.by import By class TextHandlingTests(unittest.TestCase): newLine = "\n" def testShouldReturnTheTextContentOfASingleElementWithNoChildren(self): self._loadSimplePage() selectText = self.driver.find_element(by=By.ID, value="oneline").text self.assertEqual(selectText, "A single line of text") getText = self.driver.find_element(by=By.ID, value="oneline").text self.assertEqual(getText, "A single line of text") def testShouldReturnTheEntireTextContentOfChildElements(self): self._loadSimplePage() text = self.driver.find_element(by=By.ID, value="multiline").text self.assertTrue("A div containing" in text) self.assertTrue("More than one line of text" in text) self.assertTrue("and block level elements" in text) #@Ignore(SELENESE) def testShouldIgnoreScriptElements(self): self._loadPage("javascriptEnhancedForm") labelForUsername = self.driver.find_element(by=By.ID, value="labelforusername") text = labelForUsername.text self.assertEqual(len(labelForUsername.find_elements(by=By.TAG_NAME, value="script")), 1) self.assertTrue("document.getElementById" not in text) self.assertEqual(text, "Username:") def testShouldRepresentABlockLevelElementAsANewline(self): self._loadSimplePage() text = self.driver.find_element(by=By.ID, value="multiline").text self.assertTrue(text.startswith("A div containing" + self.newLine)) self.assertTrue("More than one line of text" + self.newLine in text) self.assertTrue(text.endswith("and block level elements")) def testShouldCollapseMultipleWhitespaceCharactersIntoASingleSpace(self): self._loadSimplePage() text = self.driver.find_element(by=By.ID, value="lotsofspaces").text self.assertEqual(text, "This line has lots of spaces.") def testShouldTrimText(self): self._loadSimplePage() text = self.driver.find_element(by=By.ID, value="multiline").text self.assertTrue(text.startswith("A div containing")) self.assertTrue(text.endswith("block level elements")) def testShouldConvertANonBreakingSpaceIntoANormalSpaceCharacter(self): self._loadSimplePage() text = self.driver.find_element(by=By.ID, value="nbsp").text self.assertEqual(text, "This line has a non-breaking space") #@Ignore({IPHONE, SELENESE}) def testShouldTreatANonBreakingSpaceAsAnyOtherWhitespaceCharacterWhenCollapsingWhitespace(self): if self.driver.capabilities['browserName'] == 'chrome' and int(self.driver.capabilities['version'].split('.')[0]) < 16: pytest.skip("only works on chrome >= 16") self._loadSimplePage() element = self.driver.find_element(by=By.ID, value="nbspandspaces") text = element.text self.assertEqual(text, "This line has a non-breaking space and spaces") #@Ignore(IPHONE) def testHavingInlineElementsShouldNotAffectHowTextIsReturned(self): self._loadSimplePage() text = self.driver.find_element(by=By.ID, value="inline").text self.assertEqual(text, "This line has text within elements that are meant to be displayed inline") def testShouldReturnTheEntireTextOfInlineElements(self): self._loadSimplePage() text = self.driver.find_element(by=By.ID, value="span").text self.assertEqual(text, "An inline element") #@Ignore(value = {SELENESE, IPHONE, IE}, reason = "iPhone: sendKeys is broken") def testShouldBeAbleToSetMoreThanOneLineOfTextInATextArea(self): self._loadPage("formPage") textarea = self.driver.find_element(by=By.ID, value="withText") textarea.clear() expectedText = "I like cheese" + self.newLine + self.newLine + "It's really nice" textarea.send_keys(expectedText) seenText = textarea.get_attribute("value") self.assertEqual(seenText, expectedText) def testShouldBeAbleToEnterDatesAfterFillingInOtherValuesFirst(self): self._loadPage("formPage") input_ = self.driver.find_element(by=By.ID, value="working") expectedValue = "10/03/2007 to 30/07/1993" input_.send_keys(expectedValue) seenValue = input_.get_attribute("value") self.assertEqual(seenValue, expectedValue) def testShouldReturnEmptyStringWhenTextIsOnlySpaces(self): self._loadPage("xhtmlTest") text = self.driver.find_element(by=By.ID, value="spaces").text self.assertEqual(text, "") def testShouldReturnEmptyStringWhenTextIsEmpty(self): self._loadPage("xhtmlTest") text = self.driver.find_element(by=By.ID, value="empty").text self.assertEqual(text, "") def testShouldReturnEmptyStringWhenTagIsSelfClosing(self): pytest.skip("Skipping till issue 1225 is fixed") self._loadPage("xhtmlTest") text = self.driver.find_element(by=By.ID, value="self-closed").text self.assertEqual(text, "") def testShouldHandleSiblingBlockLevelElements(self): self._loadSimplePage() text = self.driver.find_element(by=By.ID, value="twoblocks").text self.assertEqual(text, "Some text" + self.newLine + "Some more text") def testShouldHandleWhitespaceInInlineElements(self): self._loadSimplePage() text = self.driver.find_element(by=By.ID, value="inlinespan").text self.assertEqual(text, "line has text") #@Ignore(value = {SELENESE, IPHONE}) def testReadALargeAmountOfData(self): self._loadPage("macbeth") source = self.driver.page_source.strip().lower() self.assertTrue(source.endswith("</html>")) #@Ignore({SELENESE, IPHONE}) def testShouldOnlyIncludeVisibleText(self): self._loadPage("javascriptPage") empty = self.driver.find_element(by=By.ID, value="suppressedParagraph").text explicit = self.driver.find_element(by=By.ID, value="outer").text self.assertEqual("", empty) self.assertEqual("sub-element that is explicitly visible", explicit) def testShouldGetTextFromTableCells(self): self._loadPage("tables") tr = self.driver.find_element(by=By.ID, value="hidden_text") text = tr.text self.assertTrue("some text" in text) self.assertFalse("some more text" in text) def testShouldGetTextWhichIsAValidJSONObject(self): self._loadSimplePage() element = self.driver.find_element(by=By.ID, value="simpleJsonText") self.assertEqual("{a=\"b\", c=1, d=true}", element.text) # self.assertEqual("{a=\"b\", \"c\"=d, e=true, f=\\123\\\\g\\\\\"\"\"\\\'}", element.text) def testShouldGetTextWhichIsAValidComplexJSONObject(self): self._loadSimplePage() element = self.driver.find_element(by=By.ID, value="complexJsonText") self.assertEqual("""{a=\"\\\\b\\\\\\\"\'\\\'\"}""", element.text) def _pageURL(self, name): return self.webserver.where_is(name + '.html') def _loadSimplePage(self): self._loadPage("simpleTest") def _loadPage(self, name): self.driver.get(self._pageURL(name))
apache-2.0
SaturninoMateus/jaikuengine
common/templatetags/test/presence.py
35
1632
# Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import settings from common.templatetags import presence from django import test class PresenceTest(test.TestCase): def test_presence_str(self): self.assertEquals(u'str', presence.location(u'str')) def test_presence_country(self): self.assertEquals(u'co', presence.location({'country': {'name': u'co'}})) def test_presence_city(self): self.assertEquals(u'ci', presence.location({'city': {'name': u'ci'}})) def test_presence_base(self): self.assertEquals(u'ba', presence.location( {'base': {'current': {'name': u'ba'}}})) def test_presence_cell(self): self.assertEquals(u'ce', presence.location({'cell': {'name': u'ce'}})) def test_presence_join(self): self.assertEquals(u'ce, ci, co', presence.location({ 'cell': {'name': u'ce'}, 'city': {'name': u'ci'}, 'country': {'name': u'co'}})) def test_presence_join_unicode(self): self.assertEquals(u'c\xe4, ci, co', presence.location({ 'cell': {'name': u'c\xe4'}, 'city': {'name': u'ci'}, 'country': {'name': u'co'}}))
apache-2.0
n-west/gnuradio-volk
gr-digital/python/digital/qa_pn_correlator_cc.py
57
1657
#!/usr/bin/env python # # Copyright 2007,2010,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. # from gnuradio import gr, gr_unittest, digital, blocks class test_pn_correlator_cc(gr_unittest.TestCase): def setUp(self): self.tb = gr.top_block() def tearDown(self): self.tb = None def test_000_make(self): c = digital.pn_correlator_cc(10) def test_001_correlate(self): degree = 10 length = 2**degree-1 src = digital.glfsr_source_f(degree) head = blocks.head(gr.sizeof_float, length*length) f2c = blocks.float_to_complex() corr = digital.pn_correlator_cc(degree) dst = blocks.vector_sink_c() self.tb.connect(src, head, f2c, corr, dst) self.tb.run() data = dst.data() self.assertEqual(data[-1], (1.0+0j)) if __name__ == '__main__': gr_unittest.run(test_pn_correlator_cc, "test_pn_correlator_cc.xml")
gpl-3.0
alexfernandez/elyxer
src/elyxer/maths/array.py
2
6765
#! /usr/bin/env python # -*- coding: utf-8 -*- # eLyXer -- convert LyX source files to HTML output. # # Copyright (C) 2009 Alex Fernández # # 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 distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # --end-- # Alex 20090427 # eLyXer arrays in formulae from elyxer.gen.container import * from elyxer.util.trace import Trace from elyxer.util.clone import * from elyxer.conf.config import * from elyxer.maths.formula import * from elyxer.maths.command import * from elyxer.maths.symbol import * class FormulaEquation(CommandBit): "A simple numbered equation." piece = 'equation' def parsebit(self, pos): "Parse the array" self.output = ContentsOutput() self.add(self.factory.parsetype(WholeFormula, pos)) class FormulaCell(FormulaCommand): "An array cell inside a row" def setalignment(self, alignment): self.alignment = alignment self.output = TaggedOutput().settag('span class="arraycell align-' + alignment +'"', True) return self def parsebit(self, pos): self.factory.clearskipped(pos) if pos.finished(): return self.add(self.factory.parsetype(WholeFormula, pos)) class FormulaRow(FormulaCommand): "An array row inside an array" cellseparator = FormulaConfig.array['cellseparator'] def setalignments(self, alignments): self.alignments = alignments self.output = TaggedOutput().settag('span class="arrayrow"', True) return self def parsebit(self, pos): "Parse a whole row" index = 0 pos.pushending(self.cellseparator, optional=True) while not pos.finished(): cell = self.createcell(index) cell.parsebit(pos) self.add(cell) index += 1 pos.checkskip(self.cellseparator) if len(self.contents) == 0: self.output = EmptyOutput() def createcell(self, index): "Create the cell that corresponds to the given index." alignment = self.alignments[index % len(self.alignments)] return self.factory.create(FormulaCell).setalignment(alignment) class MultiRowFormula(CommandBit): "A formula with multiple rows." def parserows(self, pos): "Parse all rows, finish when no more row ends" self.rows = [] first = True for row in self.iteraterows(pos): if first: first = False else: # intersparse empty rows self.addempty() row.parsebit(pos) self.addrow(row) self.size = len(self.rows) def iteraterows(self, pos): "Iterate over all rows, end when no more row ends" rowseparator = FormulaConfig.array['rowseparator'] while True: pos.pushending(rowseparator, True) row = self.factory.create(FormulaRow) yield row.setalignments(self.alignments) if pos.checkfor(rowseparator): self.original += pos.popending(rowseparator) else: return def addempty(self): "Add an empty row." row = self.factory.create(FormulaRow).setalignments(self.alignments) for index, originalcell in enumerate(self.rows[-1].contents): cell = row.createcell(index) cell.add(FormulaConstant(u' ')) row.add(cell) self.addrow(row) def addrow(self, row): "Add a row to the contents and to the list of rows." self.rows.append(row) self.add(row) class FormulaArray(MultiRowFormula): "An array within a formula" piece = 'array' def parsebit(self, pos): "Parse the array" self.output = TaggedOutput().settag('span class="array"', False) self.parsealignments(pos) self.parserows(pos) def parsealignments(self, pos): "Parse the different alignments" # vertical self.valign = 'c' literal = self.parsesquareliteral(pos) if literal: self.valign = literal # horizontal literal = self.parseliteral(pos) self.alignments = [] for l in literal: self.alignments.append(l) class FormulaMatrix(MultiRowFormula): "A matrix (array with center alignment)." piece = 'matrix' def parsebit(self, pos): "Parse the matrix, set alignments to 'c'." self.output = TaggedOutput().settag('span class="array"', False) self.valign = 'c' self.alignments = ['c'] self.parserows(pos) class FormulaCases(MultiRowFormula): "A cases statement" piece = 'cases' def parsebit(self, pos): "Parse the cases" self.output = ContentsOutput() self.alignments = ['l', 'l'] self.parserows(pos) for row in self.contents: for cell in row.contents: cell.output.settag('span class="case align-l"', True) cell.contents.append(FormulaConstant(u' ')) array = TaggedBit().complete(self.contents, 'span class="bracketcases"', True) brace = BigBracket(len(self.contents), '{', 'l') self.contents = brace.getcontents() + [array] class EquationEnvironment(MultiRowFormula): "A \\begin{}...\\end equation environment with rows and cells." def parsebit(self, pos): "Parse the whole environment." self.output = TaggedOutput().settag('span class="environment"', False) environment = self.piece.replace('*', '') if environment in FormulaConfig.environments: self.alignments = FormulaConfig.environments[environment] else: Trace.error('Unknown equation environment ' + self.piece) self.alignments = ['l'] self.parserows(pos) class BeginCommand(CommandBit): "A \\begin{}...\end command and what it entails (array, cases, aligned)" commandmap = {FormulaConfig.array['begin']:''} types = [FormulaEquation, FormulaArray, FormulaCases, FormulaMatrix] def parsebit(self, pos): "Parse the begin command" command = self.parseliteral(pos) bit = self.findbit(command) ending = FormulaConfig.array['end'] + '{' + command + '}' pos.pushending(ending) bit.parsebit(pos) self.add(bit) self.original += pos.popending(ending) self.size = bit.size def findbit(self, piece): "Find the command bit corresponding to the \\begin{piece}" for type in BeginCommand.types: if piece.replace('*', '') == type.piece: return self.factory.create(type) bit = self.factory.create(EquationEnvironment) bit.piece = piece return bit FormulaCommand.types += [BeginCommand]
gpl-3.0
astrofrog/glue-3d-viewer
glue_vispy_viewers/extern/vispy/scene/cameras/magnify.py
20
5520
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import numpy as np from .panzoom import PanZoomCamera from ...visuals.transforms.nonlinear import (MagnifyTransform, Magnify1DTransform) from ...app import Timer class MagnifyCamera(PanZoomCamera): """Camera implementing a MagnifyTransform combined with PanZoomCamera. Parameters ---------- size_factor : float The size factor to use. radius_ratio : float The radius ratio to use. **kwargs : dict Keyword arguments to pass to `PanZoomCamera` and create a transform. Notes ----- This Camera uses the mouse cursor position to set the center position of the MagnifyTransform, and uses mouse wheel events to adjust the magnification factor. At high magnification, very small mouse movements can result in large changes, so we use a timer to animate transitions in the transform properties. The camera also adjusts the size of its "lens" area when the view is resized. """ transform_class = MagnifyTransform def __init__(self, size_factor=0.25, radius_ratio=0.9, **kwargs): # what fraction of the view width to use for radius self.size_factor = size_factor # ratio of inner to outer lens radius self.radius_ratio = radius_ratio # Extract kwargs for panzoom camkwargs = {} for key in ('parent', 'name', 'rect', 'aspect'): if key in kwargs: camkwargs[key] = kwargs.pop(key) # Create the mag transform - kwrds go here self.mag = self.transform_class(**kwargs) # for handling smooth transitions self.mag_target = self.mag.mag self.mag._mag = self.mag_target self.mouse_pos = None self.timer = Timer(interval=0.016, connect=self.on_timer) super(MagnifyCamera, self).__init__(**camkwargs) # This tells the camera to insert the magnification transform at the # beginning of the transform it applies to the scene. This is the # correct place for the mag transform because: # 1. We want it to apply to everything inside the scene, and not to # the ViewBox itself or anything outside of the ViewBox. # 2. We do _not_ want the pan/zoom transforms applied first, because # the scale factors implemented there should not change the shape # of the lens. self.pre_transform = self.mag def _viewbox_set(self, viewbox): PanZoomCamera._viewbox_set(self, viewbox) def _viewbox_unset(self, viewbox): PanZoomCamera._viewbox_unset(self, viewbox) self.timer.stop() def viewbox_mouse_event(self, event): """ViewBox mouse event handler Parameters ---------- event : instance of Event The mouse event. """ # When the attached ViewBox reseives a mouse event, it is sent to the # camera here. self.mouse_pos = event.pos[:2] if event.type == 'mouse_wheel': # wheel rolled; adjust the magnification factor and hide the # event from the superclass m = self.mag_target m *= 1.2 ** event.delta[1] m = m if m > 1 else 1 self.mag_target = m else: # send everything _except_ wheel events to the superclass super(MagnifyCamera, self).viewbox_mouse_event(event) # start the timer to smoothly modify the transform properties. if not self.timer.running: self.timer.start() self._update_transform() def on_timer(self, event=None): """Timer event handler Parameters ---------- event : instance of Event The timer event. """ # Smoothly update center and magnification properties of the transform k = np.clip(100. / self.mag.mag, 10, 100) s = 10**(-k * event.dt) c = np.array(self.mag.center) c1 = c * s + self.mouse_pos * (1-s) m = self.mag.mag * s + self.mag_target * (1-s) # If changes are very small, then it is safe to stop the timer. if (np.all(np.abs((c - c1) / c1) < 1e-5) and (np.abs(np.log(m / self.mag.mag)) < 1e-3)): self.timer.stop() self.mag.center = c1 self.mag.mag = m self._update_transform() def viewbox_resize_event(self, event): """ViewBox resize event handler Parameters ---------- event : instance of Event The viewbox resize event. """ PanZoomCamera.viewbox_resize_event(self, event) self.view_changed() def view_changed(self): # make sure radii are updated when a view is attached. # when the view resizes, we change the lens radii to match. if self._viewbox is not None: vbs = self._viewbox.size r = min(vbs) * self.size_factor self.mag.radii = r * self.radius_ratio, r PanZoomCamera.view_changed(self) class Magnify1DCamera(MagnifyCamera): transform_class = Magnify1DTransform __doc__ = MagnifyCamera.__doc__
bsd-2-clause
Y--/root
interpreter/llvm/src/tools/clang/bindings/python/tests/cindex/util.py
88
2293
# This file provides common utility functions for the test suite. from clang.cindex import Cursor from clang.cindex import TranslationUnit def get_tu(source, lang='c', all_warnings=False, flags=[]): """Obtain a translation unit from source and language. By default, the translation unit is created from source file "t.<ext>" where <ext> is the default file extension for the specified language. By default it is C, so "t.c" is the default file name. Supported languages are {c, cpp, objc}. all_warnings is a convenience argument to enable all compiler warnings. """ args = list(flags) name = 't.c' if lang == 'cpp': name = 't.cpp' args.append('-std=c++11') elif lang == 'objc': name = 't.m' elif lang != 'c': raise Exception('Unknown language: %s' % lang) if all_warnings: args += ['-Wall', '-Wextra'] return TranslationUnit.from_source(name, args, unsaved_files=[(name, source)]) def get_cursor(source, spelling): """Obtain a cursor from a source object. This provides a convenient search mechanism to find a cursor with specific spelling within a source. The first argument can be either a TranslationUnit or Cursor instance. If the cursor is not found, None is returned. """ # Convenience for calling on a TU. root_cursor = source if isinstance(source, Cursor) else source.cursor for cursor in root_cursor.walk_preorder(): if cursor.spelling == spelling: return cursor return None def get_cursors(source, spelling): """Obtain all cursors from a source object with a specific spelling. This provides a convenient search mechanism to find all cursors with specific spelling within a source. The first argument can be either a TranslationUnit or Cursor instance. If no cursors are found, an empty list is returned. """ # Convenience for calling on a TU. root_cursor = source if isinstance(source, Cursor) else source.cursor cursors = [] for cursor in root_cursor.walk_preorder(): if cursor.spelling == spelling: cursors.append(cursor) return cursors __all__ = [ 'get_cursor', 'get_cursors', 'get_tu', ]
lgpl-2.1
tensorflow/tensorflow
tensorflow/python/ops/ragged/ragged_tensor_shape.py
14
26466
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Shapes & broadcasting for RaggedTensors.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_shape from tensorflow.python.framework import tensor_util from tensorflow.python.ops import array_ops from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops.ragged import ragged_array_ops from tensorflow.python.ops.ragged import ragged_config from tensorflow.python.ops.ragged import ragged_tensor from tensorflow.python.ops.ragged import ragged_util class RaggedTensorDynamicShape(object): """A collection of tensors encoding the shape of a potentially ragged tensor. Each `RaggedTensorDynamicShape` consists of an ordered list of dimension sizes. There are two dimension types: * "Uniform dimensions" are dimensions where all slices have the same length. `RaggedTensorDynamicShape` records the size of each uniform dimension using a single scalar integer. * "Ragged dimensions" are dimensions whose slices may have different lengths. `RaggedTensorDynamicShape` records the size of each ragged dimension using an integer vector containing the slice lengths for all the slices across that dimension. Furthermore, there are two ways a dimension might be encoded: * "Partitioned dimensions" are dimensions that are encoded using a `RaggedTensor`'s `nested_row_splits`. The outermostmost partitioned dimension must be uniform, and the innermost partitioned dimension must be ragged. * "Inner dimensions" are dimensions that are encoded using a `RaggedTensor`'s `flat_values`. Inner dimensions are always uniform. The sizes of partitioned dimensions are recorded using `partitioned_dim_sizes` and `inner_dim_sizes`: * `partitioned_dim_sizes` is a list of tensors (one for each partitioned dimension). * For uniform dimensions, the tensor is an integer scalar specifying the size of all slices across that dimension. * For ragged dimensions, the tensor is an integer vector specifying the size of each slice across that dimension. * `inner_dim_sizes` is a single integer vector, where each element specifies the size of a single inner dimension. Examples: Tensor | Ragged | Partitioned Dim Sizes | Inner Dim : Rank : : Sizes ------------------------------ | ------ | ---------------------- | ---------- `[[1, 2, 3], [4, 5, 6]]` | 0 | | `2, 3` `[[1, 2], [], [3, 4, 5]]` | 1 | `3, (2, 0, 3)` | `[[[1, 2], [3, 4]], [[5, 6]]]` | 1 | `2, (2, 1)` | 2 `[[[1, 2], [3]], [[4, 5]]]` | 2 | `2, (2, 1), (2, 1, 2)` | """ def __init__(self, partitioned_dim_sizes, inner_dim_sizes, dim_size_dtype=None): """Creates a RaggedTensorDynamicShape. Args: partitioned_dim_sizes: A `list` of 0-D or 1-D integer `Tensor`, one for each partitioned dimension. If dimension `d` is uniform, then `partitioned_dim_sizes[d]` must be an integer scalar, specifying the size of all slices across dimension `d`. If dimension `d` is ragged, then `partitioned_dim_sizes[d]` must be an integer vector, specifying the size of each slice across dimension `d`. inner_dim_sizes: A 1-D integer `Tensor`, whose length is equal to the number of inner dimensions. `inner_dim_sizes[n]` is the size of all slices across the `n`th inner dimension (which is the `(len(partitioned_dim_sizes)+n)`th dimension in the overall tensor. dim_size_dtype: dtype for dimension sizes. If not specified, then it is chosen based on the dtypes of `partitioned_dim_sizes` and `inner_dim_sizes`. """ assert isinstance(partitioned_dim_sizes, (list, tuple)) with ops.name_scope(None, 'RaggedTensorDynamicShape', (partitioned_dim_sizes, inner_dim_sizes)): partitioned_dim_sizes = tuple( ops.convert_to_tensor(size, name='partitioned_dimension_size_%d' % i) for (i, size) in enumerate(partitioned_dim_sizes)) inner_dim_sizes = ops.convert_to_tensor( inner_dim_sizes, name='inner_dim_sizes') # Validate shapes. if partitioned_dim_sizes: for axis, dimension_size in enumerate(partitioned_dim_sizes): if dimension_size.shape.ndims is None: raise ValueError( 'rank of partitioned_dim_sizes[%d] is unknown' % axis) dimension_size.shape.with_rank_at_most(1) if partitioned_dim_sizes[0].shape.ndims == 1: raise ValueError('outermost partitioned dimension must be uniform') if partitioned_dim_sizes[-1].shape.ndims == 0: raise ValueError('innermost partitioned dimension must be ragged') inner_dim_sizes.shape.assert_has_rank(1) # Convert dimension size tensors to a single dtype. if dim_size_dtype is None: dim_size_dtypes = set( p.dtype for p in partitioned_dim_sizes if p.shape.ndims == 1) if not dim_size_dtypes: dim_size_dtype = dtypes.int64 elif len(dim_size_dtypes) == 1: dim_size_dtype = dim_size_dtypes.pop() else: if not ragged_config.auto_cast_partition_dtype(): raise ValueError('partitioned_dim_sizes must have matching dtypes') dim_size_dtype = dtypes.int64 partitioned_dim_sizes = tuple(math_ops.cast(p, dim_size_dtype) for p in partitioned_dim_sizes) inner_dim_sizes = math_ops.cast(inner_dim_sizes, dim_size_dtype) self._partitioned_dim_sizes = partitioned_dim_sizes self._inner_dim_sizes = inner_dim_sizes def __repr__(self): return ('RaggedTensorDynamicShape' '(partitioned_dim_sizes=%r, inner_dim_sizes=%r)' % (self._partitioned_dim_sizes, self._inner_dim_sizes)) @staticmethod def from_dim_sizes(dim_sizes): """Constructs a ragged shape from a list of dimension sizes. This list contains a single tensor for each dimension, where the tensor is a scalar if the dimension is uniform, or a vector if the dimension is ragged. Args: dim_sizes: List of int32 or int64 scalars or vectors. Returns: A RaggedTensorDynamicShape. """ with ops.name_scope(None, 'RaggedTensorDynamicShapeFromDimensionSizes', [dim_sizes]): dim_sizes = tuple( ops.convert_to_tensor(size, preferred_dtype=dtypes.int64, name='dim_sizes') for size in dim_sizes) # Split the dimensions into partitioned & inner dimensions. inner_split = 0 for dim, dim_size in enumerate(dim_sizes): if dim_size.shape.ndims == 1: inner_split = dim + 1 elif dim_size.shape.ndims != 0: raise ValueError('Each dim_size must be a scalar or a vector') return RaggedTensorDynamicShape(dim_sizes[:inner_split], dim_sizes[inner_split:]) @classmethod def from_tensor(cls, rt_input, dim_size_dtype=None): """Constructs a ragged shape for a potentially ragged tensor.""" with ops.name_scope(None, 'RaggedTensorDynamicShapeFromTensor', [rt_input]): rt_input = ragged_tensor.convert_to_tensor_or_ragged_tensor(rt_input) if not ragged_tensor.is_ragged(rt_input): return cls([], array_ops.shape(rt_input)) else: partitioned_dim_sizes = ( (rt_input.nrows(),) + rt_input.nested_row_lengths()) return RaggedTensorDynamicShape( partitioned_dim_sizes, array_ops.shape(rt_input.flat_values)[1:], dim_size_dtype=dim_size_dtype) def dimension_size(self, axis): """Returns the size of slices across the specified dimension.""" if not isinstance(axis, int): raise TypeError('axis must be an integer') partitioned_ndims = len(self._partitioned_dim_sizes) if axis < partitioned_ndims: return self._partitioned_dim_sizes[axis] else: return self._inner_dim_sizes[axis - partitioned_ndims] def is_ragged(self, axis): """Returns true if the indicated dimension is ragged.""" if not isinstance(axis, int): raise TypeError('axis must be an integer') rank = self.rank if axis < 0: raise ValueError('Negative axis values are not supported') elif rank is not None and axis >= rank: raise ValueError('Expected axis=%s < rank=%s' % (axis, rank)) else: return (axis > 0 and axis < len(self._partitioned_dim_sizes) and self._partitioned_dim_sizes[axis].shape.ndims == 1) @property def rank(self): """The number of dimensions in this shape, or None if unknown.""" inner_ndims = tensor_shape.dimension_value(self._inner_dim_sizes.shape[0]) if inner_ndims is None: return None else: return len(self._partitioned_dim_sizes) + inner_ndims @property def partitioned_dim_sizes(self): """The partitioned dimension sizes for this shape. Returns: A `list` of 0-D or 1-D integer `Tensor`. """ return self._partitioned_dim_sizes @property def inner_dim_sizes(self): """The inner dimension sizes for this shape. Returns: A 1-D integer `Tensor`. """ return self._inner_dim_sizes @property def num_partitioned_dimensions(self): """The number of partitioned dimensions in this shape.""" return len(self._partitioned_dim_sizes) @property def num_inner_dimensions(self): """The number of inner dimensions, or `None` if not statically known.""" return tensor_shape.dimension_value(self._inner_dim_sizes.shape[0]) @property def dim_size_dtype(self): """DType used by this shape for dimension sizes.""" return self._inner_dim_sizes.dtype def broadcast_to_rank(self, rank): """Adds leading size-1 dimensions to broadcast `self` to the given rank. E.g., if `shape1` is `[3, (D2), 4]`, then `shape1.broadcast_to_rank(5)` is `[1, 1, 3, (D2), 4]`. Args: rank: The rank for the returned shape. Returns: A RaggedTensorDynamicShape with `rank` dimensions, whose inner dimensions have the same size as `self` and whose outer dimensions have size `1`. Raises: ValueError: If `self.rank` is unknown or greater than `rank`. """ if self.rank is None: raise ValueError('Unable to broadcast: self.rank is unknown') dims_to_add = rank - self.rank if dims_to_add < 0: raise ValueError('Unable to broadcast: rank=%d must be greater than ' 'self.rank=%d.' % (rank, self.rank)) elif dims_to_add == 0: return self elif self._partitioned_dim_sizes: partitioned_dims = (1,) * dims_to_add + self._partitioned_dim_sizes return RaggedTensorDynamicShape(partitioned_dims, self._inner_dim_sizes) else: inner_dims = array_ops.concat( [array_ops.ones([dims_to_add], self.dim_size_dtype), self.inner_dim_sizes], axis=0) return RaggedTensorDynamicShape([], inner_dims) def broadcast_dimension(self, axis, lengths): """Returns a shape that is broadcast-compatible with self & lengths. * If dimension[axis] is uniform and lengths is a scalar, the check that either lengths==1 or axis==1 or lengths==axis, and tile dimension[axis] with tf.where(lengths==axis, 1, axis) repeats. * If dimension[axis] is uniform and lengths is a vector, then check that dimension[axis]==1, and raggedly tile dimension[axis] with lengths repeats. (we can skip tiling if we statically know that slice_lengths == 1??) * If dimension[axis] is ragged and lengths is a scalar, then check that lengths==1. * If dimension[axis] is ragged and lengths is a vector, then check that self.dimension_size(axis) == lengths. Args: axis: `int`. The dimension to broadcast. lengths: 0-D or 1-D integer `Tensor`. Returns: A `RaggedTensorDynamicShape`. """ lengths = ragged_util.convert_to_int_tensor( lengths, name='lengths', dtype=self.dim_size_dtype) # Check whether lengths is a scalar (for uniform dimensions) or # vector (for ragged dimensions). if lengths.shape.ndims is None: raise ValueError('lengths must have a known rank.') elif lengths.shape.ndims > 1: raise ValueError('lengths must be a scalar or vector') else: lengths_is_scalar = (lengths.shape.ndims == 0) # Verify that the shapes are compatible. if self.is_ragged(axis): if lengths_is_scalar: condition = math_ops.equal(lengths, 1) else: condition = math_ops.reduce_all( math_ops.equal(lengths, self.dimension_size(axis))) else: axis_dim_size = self.dimension_size(axis) if lengths_is_scalar: condition = ( math_ops.equal(lengths, 1) | math_ops.equal(axis_dim_size, 1) | math_ops.equal(axis_dim_size, lengths)) else: condition = math_ops.equal(axis_dim_size, 1) broadcast_err = [ 'Unable to broadcast: dimension size mismatch in dimension', axis, 'lengths=', lengths, 'dim_size=', self.dimension_size(axis) ] broadcast_check = control_flow_ops.Assert( condition, data=broadcast_err, summarize=10) with ops.control_dependencies([broadcast_check]): # Partitioned dimensions: if axis < self.num_partitioned_dimensions: if self.is_ragged(axis): # Use an identity op to make sure the check actually gets run. return RaggedTensorDynamicShape( self._partitioned_dim_sizes, array_ops.identity(self.inner_dim_sizes)) else: return self._broadcast_uniform_partitioned_dimension(axis, lengths) # Inner dimensions: else: if lengths_is_scalar: return self._broadcast_inner_dimension_to_uniform(axis, lengths) else: if axis == 0: raise ValueError('Unable to broadcast: ' 'outermost dimension must be uniform.') return self._broadcast_inner_dimension_to_ragged(axis, lengths) def num_slices_in_dimension(self, axis): """Returns the total number of slices across the indicated dimension.""" if axis < 0: return constant_op.constant(1, dtype=self.dim_size_dtype) elif self.is_ragged(axis): return math_ops.reduce_sum(self._partitioned_dim_sizes[axis]) else: return self.dimension_size(axis) * self.num_slices_in_dimension(axis - 1) def _broadcast_uniform_partitioned_dimension(self, axis, lengths): """Broadcasts the partitioned dimension `axis` to match `lengths`.""" axis_dim_size = self.dimension_size(axis) partitioned_sizes = list(self._partitioned_dim_sizes[:axis]) if lengths.shape.ndims == 0: lengths = array_ops.where( math_ops.equal(axis_dim_size, 1), lengths, axis_dim_size) repeats = array_ops.where(math_ops.equal(axis_dim_size, 1), lengths, 1) splits = array_ops.stack([0, self.num_slices_in_dimension(axis)]) else: splits = math_ops.range( array_ops.size(lengths, out_type=self.dim_size_dtype) + 1) repeats = lengths partitioned_sizes.append(lengths) for dim_size in self._partitioned_dim_sizes[axis + 1:]: if dim_size.shape.ndims == 0: partitioned_sizes.append(dim_size) splits *= dim_size else: partitioned_sizes.append( ragged_util.repeat_ranges(dim_size, splits, repeats)) splits = array_ops.gather( ragged_util.lengths_to_splits(dim_size), splits) inner_sizes = self._inner_dim_sizes return RaggedTensorDynamicShape(partitioned_sizes, inner_sizes) def _broadcast_inner_dimension_to_uniform(self, axis, length): """Broadcasts the inner dimension `axis` to match `lengths`.""" dim_size = self.dimension_size(axis) axis_in_inner_dims = axis - self.num_partitioned_dimensions partitioned_sizes = self._partitioned_dim_sizes inner_sizes = array_ops.concat([ self._inner_dim_sizes[:axis_in_inner_dims], [array_ops.where(math_ops.equal(dim_size, 1), length, dim_size)], self._inner_dim_sizes[axis_in_inner_dims + 1:] ], axis=0) return RaggedTensorDynamicShape(partitioned_sizes, inner_sizes) def _broadcast_inner_dimension_to_ragged(self, axis, lengths): axis_in_inner_dims = axis - self.num_partitioned_dimensions partitioned_sizes = ( self._partitioned_dim_sizes + tuple([ self._inner_dim_sizes[i] for i in range(axis_in_inner_dims) ]) + (lengths,)) inner_sizes = self._inner_dim_sizes[axis_in_inner_dims + 1:] return RaggedTensorDynamicShape(partitioned_sizes, inner_sizes) def with_dim_size_dtype(self, dtype): if dtype not in (dtypes.int32, dtypes.int64): raise ValueError('dtype must be int32 or int64') if self.dim_size_dtype == dtype: return self return RaggedTensorDynamicShape( [math_ops.cast(p, dtype) for p in self._partitioned_dim_sizes], math_ops.cast(self._inner_dim_sizes, dtype)) def broadcast_dynamic_shape(shape_x, shape_y): """Returns the shape formed by broadcasting two shapes to be compatible. Args: shape_x: A `RaggedTensorDynamicShape` shape_y: A `RaggedTensorDynamicShape` Returns: A `RaggedTensorDynamicShape`. Raises: ValueError: If `shape_x` and `shape_y` are not broadcast-compatible. """ if not isinstance(shape_x, RaggedTensorDynamicShape): raise TypeError('shape_x must be a RaggedTensorDynamicShape') if not isinstance(shape_y, RaggedTensorDynamicShape): raise TypeError('shape_y must be a RaggedTensorDynamicShape') # Broadcast both shapes to have the same rank. if shape_x.rank is None or shape_y.rank is None: raise ValueError('Unable to broadcast: unknown rank') broadcast_rank = max(shape_x.rank, shape_y.rank) shape_x = shape_x.broadcast_to_rank(broadcast_rank) shape_y = shape_y.broadcast_to_rank(broadcast_rank) # Broadcast dimensions one at a time, starting from the outermost dimension. for axis in range(broadcast_rank): shape_x = shape_x.broadcast_dimension(axis, shape_y.dimension_size(axis)) shape_y = shape_y.broadcast_dimension(axis, shape_x.dimension_size(axis)) return shape_x def broadcast_to(rt_input, shape, broadcast_inner_dimensions=True): """Broadcasts a potentially ragged tensor to a ragged shape. Tiles `rt_input` as necessary to match the given shape. Behavior is undefined if `rt_input` is not broadcast-compatible with `shape`. Args: rt_input: The potentially ragged tensor to broadcast. shape: A `RaggedTensorDynamicShape` broadcast_inner_dimensions: If false, then inner dimensions will not be tiled. Returns: A potentially ragged tensor whose values are taken from `rt_input`, and whose shape matches `shape`. """ if not isinstance(shape, RaggedTensorDynamicShape): raise TypeError('shape must be a RaggedTensorDynamicShape') rt_input = ragged_tensor.convert_to_tensor_or_ragged_tensor(rt_input) # Broadcasting to a uniform shape. if shape.num_partitioned_dimensions == 0: return _broadcast_to_uniform_shape(rt_input, shape, broadcast_inner_dimensions) else: return _broadcast_to_ragged_shape(rt_input, shape, broadcast_inner_dimensions) def _broadcast_to_uniform_shape(rt_input, shape, broadcast_inner_dimensions): """Broadcasts rt_input to the uniform shape `shape`.""" if isinstance(rt_input, ragged_tensor.RaggedTensor): raise ValueError('Incompatible with shape: ragged rank mismatch') if broadcast_inner_dimensions: return array_ops.broadcast_to(rt_input, shape.inner_dim_sizes) else: return rt_input def _broadcast_to_ragged_shape(rt_input, dst_shape, broadcast_inner_dimensions): """Broadcasts rt_input to the ragged shape `dst_shape`.""" # Check that rt_input and dst_shape have the same row_splits dtype. if (isinstance(rt_input, ragged_tensor.RaggedTensor) and rt_input.row_splits.dtype != dst_shape.dim_size_dtype): if not ragged_config.auto_cast_partition_dtype(): raise ValueError('rt_input and dst_shape have different row_split ' 'dtypes; use RaggedTensor.with_row_splits_dtype() or ' 'RaggedTensorDynamicShape.with_dim_size_dtype() to ' 'convert to a compatible dtype.') rt_input = rt_input.with_row_splits_dtype(dtypes.int64) dst_shape = dst_shape.with_dim_size_dtype(dtypes.int64) # dst_shape's rank and ragged_rank must be greater than or equal to rt_input's if rt_input.shape.ndims is None or dst_shape.rank is None: raise ValueError('Unable to broadcast: unknown rank') if rt_input.shape.ndims > dst_shape.rank: raise ValueError('Incompatible with shape: rank mismatch') if (isinstance(rt_input, ragged_tensor.RaggedTensor) and rt_input.ragged_rank >= dst_shape.num_partitioned_dimensions): raise ValueError('Incompatible with shape: ragged rank mismatch') src_shape = RaggedTensorDynamicShape.from_tensor(rt_input) src_shape = src_shape.broadcast_to_rank(dst_shape.rank) # Add dimensions to rt_input so its rank and ragged_rank matches dst_shape. if dst_shape.rank > rt_input.shape.ndims: if rt_input.shape.ndims < dst_shape.num_inner_dimensions + 1: rt_input = array_ops.reshape( rt_input, array_ops.concat([[-1], dst_shape.inner_dim_sizes], axis=0)) for _ in range(dst_shape.rank - rt_input.shape.ndims): if ragged_tensor.is_ragged(rt_input): nrows = rt_input.nrows() else: nrows = array_ops.shape(rt_input, out_type=dst_shape.dim_size_dtype)[0] rt_input = ragged_tensor.RaggedTensor.from_row_lengths(rt_input, [nrows], validate=False) # Add ragged dimensions to match dst_shape. if ragged_tensor.is_ragged(rt_input): inner_rank_diff = ( rt_input.flat_values.shape.ndims - 1 - dst_shape.num_inner_dimensions) if inner_rank_diff > 0: rt_input = rt_input.with_flat_values( ragged_tensor.RaggedTensor.from_tensor( rt_input.flat_values, ragged_rank=inner_rank_diff, row_splits_dtype=dst_shape.dim_size_dtype)) else: rt_input = ragged_tensor.RaggedTensor.from_tensor( rt_input, ragged_rank=dst_shape.num_partitioned_dimensions - 1, row_splits_dtype=dst_shape.dim_size_dtype) # Do broadcasting for any dimensions that will remain uniform. We can do # these all at once, since they're independent of one another. multiples = [1] * dst_shape.rank for axis in range(dst_shape.num_partitioned_dimensions): if not src_shape.is_ragged(axis) and not dst_shape.is_ragged(axis): src_size = src_shape.dimension_size(axis) dst_size = dst_shape.dimension_size(axis) if ((tensor_util.constant_value(src_size) in (1, None)) and (tensor_util.constant_value(dst_size) != 1)): multiples[axis] = array_ops.where( math_ops.equal(src_size, 1), dst_size, 1) if not all(isinstance(v, int) and v == 1 for v in multiples): multiples = array_ops.stack(multiples, axis=0) rt_input = ragged_array_ops.tile(rt_input, multiples) if broadcast_inner_dimensions: new_shape = array_ops.broadcast_dynamic_shape( array_ops.shape( rt_input.flat_values, out_type=dst_shape.dim_size_dtype), array_ops.concat([[1], dst_shape.inner_dim_sizes], axis=0)) rt_input = rt_input.with_flat_values( array_ops.broadcast_to(rt_input.flat_values, new_shape)) # Do broadcasting for dimensions that become ragged. We must do these from # outermost to innermost. for axis in range(dst_shape.num_partitioned_dimensions): if not src_shape.is_ragged(axis) and dst_shape.is_ragged(axis): dst_size = dst_shape.dimension_size(axis) rt_input = _ragged_tile_axis(rt_input, axis, dst_size, dst_shape.dim_size_dtype) return rt_input def _ragged_tile_axis(rt_input, axis, repeats, row_splits_dtype): """Tile a dimension of a RaggedTensor to match a ragged shape.""" assert axis > 0 # Outermost dimension may not be ragged. if not ragged_tensor.is_ragged(rt_input): rt_input = ragged_tensor.RaggedTensor.from_tensor( rt_input, ragged_rank=1, row_splits_dtype=row_splits_dtype) if axis > 1: return rt_input.with_values( _ragged_tile_axis(rt_input.values, axis - 1, repeats, row_splits_dtype)) else: src_row_splits = rt_input.nested_row_splits src_row_lengths = rt_input.nested_row_lengths() splits = src_row_splits[0] dst_row_lengths = [repeats] for i in range(1, len(src_row_lengths)): dst_row_lengths.append( ragged_util.repeat_ranges(src_row_lengths[i], splits, repeats)) splits = array_ops.gather(src_row_splits[i], splits) dst_values = ragged_util.repeat_ranges(rt_input.flat_values, splits, repeats) return ragged_tensor.RaggedTensor.from_nested_row_lengths( dst_values, dst_row_lengths, validate=False)
apache-2.0
pyropeter/archweb
mirrors/migrations/0004_auto__add_field_mirrorprotocol_is_download.py
2
3937
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.add_column('mirrors_mirrorprotocol', 'is_download', self.gf('django.db.models.fields.BooleanField')(default=True), keep_default=False) def backwards(self, orm): db.delete_column('mirrors_mirrorprotocol', 'is_download') models = { 'mirrors.mirror': { 'Meta': {'ordering': "('country', 'name')", 'object_name': 'Mirror'}, 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'admin_email': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'blank': 'True'}), 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'isos': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}), 'public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'rsync_password': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), 'rsync_user': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), 'tier': ('django.db.models.fields.SmallIntegerField', [], {'default': '2'}), 'upstream': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mirrors.Mirror']", 'null': 'True'}) }, 'mirrors.mirrorlog': { 'Meta': {'object_name': 'MirrorLog'}, 'check_time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), 'duration': ('django.db.models.fields.FloatField', [], {'null': 'True'}), 'error': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_success': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'last_sync': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'url': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': "orm['mirrors.MirrorUrl']"}) }, 'mirrors.mirrorprotocol': { 'Meta': {'object_name': 'MirrorProtocol'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_download': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'protocol': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '10'}) }, 'mirrors.mirrorrsync': { 'Meta': {'object_name': 'MirrorRsync'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'ip': ('django.db.models.fields.CharField', [], {'max_length': '24'}), 'mirror': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'rsync_ips'", 'to': "orm['mirrors.Mirror']"}) }, 'mirrors.mirrorurl': { 'Meta': {'object_name': 'MirrorUrl'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'mirror': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'urls'", 'to': "orm['mirrors.Mirror']"}), 'protocol': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'urls'", 'to': "orm['mirrors.MirrorProtocol']"}), 'url': ('django.db.models.fields.CharField', [], {'max_length': '255'}) } } complete_apps = ['mirrors']
gpl-2.0
radiosilence/pip
tests/test_vcs_backends.py
3
5930
from tests.test_pip import (reset_env, run_pip, _create_test_package, _change_test_package_version) from tests.local_repos import local_checkout def test_install_editable_from_git_with_https(): """ Test cloning from Git with https. """ reset_env() result = run_pip('install', '-e', '%s#egg=pip-test-package' % local_checkout('git+https://github.com/pypa/pip-test-package.git'), expect_error=True) result.assert_installed('pip-test-package', with_files=['.git']) def test_git_with_sha1_revisions(): """ Git backend should be able to install from SHA1 revisions """ env = reset_env() version_pkg_path = _create_test_package(env) _change_test_package_version(env, version_pkg_path) sha1 = env.run('git', 'rev-parse', 'HEAD~1', cwd=version_pkg_path).stdout.strip() run_pip('install', '-e', '%s@%s#egg=version_pkg' % ('git+file://' + version_pkg_path.abspath.replace('\\', '/'), sha1)) version = env.run('version_pkg') assert '0.1' in version.stdout, version.stdout def test_git_with_branch_name_as_revision(): """ Git backend should be able to install from branch names """ env = reset_env() version_pkg_path = _create_test_package(env) env.run('git', 'checkout', '-b', 'test_branch', expect_stderr=True, cwd=version_pkg_path) _change_test_package_version(env, version_pkg_path) run_pip('install', '-e', '%s@test_branch#egg=version_pkg' % ('git+file://' + version_pkg_path.abspath.replace('\\', '/'))) version = env.run('version_pkg') assert 'some different version' in version.stdout def test_git_with_tag_name_as_revision(): """ Git backend should be able to install from tag names """ env = reset_env() version_pkg_path = _create_test_package(env) env.run('git', 'tag', 'test_tag', expect_stderr=True, cwd=version_pkg_path) _change_test_package_version(env, version_pkg_path) run_pip('install', '-e', '%s@test_tag#egg=version_pkg' % ('git+file://' + version_pkg_path.abspath.replace('\\', '/'))) version = env.run('version_pkg') assert '0.1' in version.stdout def test_git_with_tag_name_and_update(): """ Test cloning a git repository and updating to a different version. """ reset_env() result = run_pip('install', '-e', '%s#egg=pip-test-package' % local_checkout('git+http://github.com/pypa/pip-test-package.git'), expect_error=True) result.assert_installed('pip-test-package', with_files=['.git']) result = run_pip('install', '--global-option=--version', '-e', '%s@0.1.2#egg=pip-test-package' % local_checkout('git+http://github.com/pypa/pip-test-package.git'), expect_error=True) assert '0.1.2' in result.stdout def test_git_branch_should_not_be_changed(): """ Editable installations should not change branch related to issue #32 and #161 """ env = reset_env() run_pip('install', '-e', '%s#egg=pip-test-package' % local_checkout('git+http://github.com/pypa/pip-test-package.git'), expect_error=True) source_dir = env.venv_path/'src'/'pip-test-package' result = env.run('git', 'branch', cwd=source_dir) assert '* master' in result.stdout, result.stdout def test_git_with_non_editable_unpacking(): """ Test cloning a git repository from a non-editable URL with a given tag. """ reset_env() result = run_pip('install', '--global-option=--version', local_checkout( 'git+http://github.com/pypa/pip-test-package.git@0.1.2#egg=pip-test-package' ), expect_error=True) assert '0.1.2' in result.stdout def test_git_with_editable_where_egg_contains_dev_string(): """ Test cloning a git repository from an editable url which contains "dev" string """ reset_env() result = run_pip('install', '-e', '%s#egg=django-devserver' % local_checkout('git+git://github.com/dcramer/django-devserver.git')) result.assert_installed('django-devserver', with_files=['.git']) def test_git_with_non_editable_where_egg_contains_dev_string(): """ Test cloning a git repository from a non-editable url which contains "dev" string """ env = reset_env() result = run_pip('install', '%s#egg=django-devserver' % local_checkout('git+git://github.com/dcramer/django-devserver.git')) devserver_folder = env.site_packages/'devserver' assert devserver_folder in result.files_created, str(result) def test_git_with_ambiguous_revs(): """ Test git with two "names" (tag/branch) pointing to the same commit """ env = reset_env() version_pkg_path = _create_test_package(env) package_url = 'git+file://%s@0.1#egg=version_pkg' % (version_pkg_path.abspath.replace('\\', '/')) env.run('git', 'tag', '0.1', cwd=version_pkg_path) result = run_pip('install', '-e', package_url) assert 'Could not find a tag or branch' not in result.stdout # it is 'version-pkg' instead of 'version_pkg' because # egg-link name is version-pkg.egg-link because it is a single .py module result.assert_installed('version-pkg', with_files=['.git']) def test_git_works_with_editable_non_origin_repo(): # set up, create a git repo and install it as editable from a local directory path env = reset_env() version_pkg_path = _create_test_package(env) run_pip('install', '-e', version_pkg_path.abspath) # 'freeze'ing this should not fall over, but should result in stderr output warning result = run_pip('freeze', expect_stderr=True) assert "Error when trying to get requirement" in result.stderr assert "Could not determine repository location" in result.stdout assert "version-pkg==0.1" in result.stdout
mit
gautam1858/tensorflow
tensorflow/contrib/opt/python/training/drop_stale_gradient_optimizer_test.py
23
12407
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for DropStaleGradientOptimizer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import portpicker from tensorflow.contrib.opt.python.training import drop_stale_gradient_optimizer from tensorflow.python.client import session from tensorflow.python.framework import ops from tensorflow.python.ops import data_flow_ops from tensorflow.python.ops import variables from tensorflow.python.platform import test from tensorflow.python.training import gradient_descent from tensorflow.python.training import server_lib from tensorflow.python.training import training_util # Creates the workers and return their sessions, graphs, train_ops. def _get_workers(num_workers, staleness): worker_ports = [portpicker.pick_unused_port() for _ in range(num_workers)] cluster_dict = { 'worker': ['localhost:%s' % port for port in worker_ports], 'ps': ['localhost:%s' % portpicker.pick_unused_port()] } cs = server_lib.ClusterSpec(cluster_dict) workers = [ server_lib.Server( cs, job_name='worker', task_index=ix, start=True) for ix in range(num_workers) ] server_lib.Server(cs, job_name='ps', task_index=0, start=True) sessions = [] graphs = [] train_ops = [] # To simulate stale cases, maintaining two queues for computing and # applying gradients respectively. In the phase of computing gradients, # all workers except chief worker compute gradients together and chief worker # computes after all other worers' computing finished. In the phase of # applying gradients, chief worker will first apply gradients, then all other # workers will apply gradients one by one. Therefore, the chief worker will # always have 0 staleness, each of all other workers will have a unique # staleness value from [1, num_workers). for worker_id in range(num_workers): graph = ops.Graph() with graph.as_default(): global_step = training_util.create_global_step() var_0 = variables.VariableV1(0.0, name='v0') var_1 = variables.VariableV1(1.0, name='v1') compute_gradients_queue = data_flow_ops.FIFOQueue( -1, global_step.dtype.base_dtype, shapes=(), name='compute_gradients_queue', shared_name='compute_gradients_queue') apply_gradients_queue = data_flow_ops.FIFOQueue( -1, global_step.dtype.base_dtype, shapes=(), name='apply_gradients_queue', shared_name='apply_gradients_queue') # Gradients for loss on var_0 and var_1 will be 1.0. loss = 0 - var_0 - var_1 sgd_opt = gradient_descent.GradientDescentOptimizer(1.0) stale_check_opt = ( drop_stale_gradient_optimizer.DropStaleGradientOptimizer( sgd_opt, staleness)) # Compute gradients. if worker_id == 0: with ops.control_dependencies( [compute_gradients_queue.dequeue_many(num_workers - 1)]): grad_and_vars = stale_check_opt.compute_gradients(loss) else: grad_and_vars = stale_check_opt.compute_gradients(loss) with ops.control_dependencies([t[0] for t in grad_and_vars]): worker_enqueue_op = compute_gradients_queue.enqueue(global_step) # Apply gradients. if worker_id == 0: with ops.control_dependencies( [stale_check_opt.apply_gradients(grad_and_vars, global_step)]): train_op = apply_gradients_queue.enqueue(global_step) else: with ops.control_dependencies([worker_enqueue_op]): with ops.control_dependencies([apply_gradients_queue.dequeue()]): with ops.control_dependencies( [stale_check_opt.apply_gradients( grad_and_vars, global_step)]): train_op = apply_gradients_queue.enqueue(global_step) sess = session.Session(workers[worker_id].target) sessions.append(sess) graphs.append(graph) train_ops.append(train_op) return sessions, graphs, train_ops class DropStaleGradientOptimizerTest(test.TestCase): def _run(self, train_op, sess): sess.run(train_op) def test1Worker(self): num_workers = 1 sessions, graphs, train_ops = _get_workers(num_workers, 0) with graphs[0].as_default(): sessions[0].run(variables.global_variables_initializer()) global_step = training_util.get_global_step(graphs[0]) var_0 = graphs[0].get_tensor_by_name('v0:0') var_1 = graphs[0].get_tensor_by_name('v1:0') stale_counter = graphs[0].get_tensor_by_name('stale_counter:0') # Verify the initialized value. self.assertAllEqual(0.0, sessions[0].run(var_0)) self.assertAllEqual(1.0, sessions[0].run(var_1)) self.assertAllEqual(0.0, sessions[0].run(stale_counter)) self.assertAllEqual(0, sessions[0].run(global_step)) sessions[0].run(train_ops[0]) # Verify the updated value after 1 step. self.assertAllEqual(1, sessions[0].run(global_step)) self.assertAllEqual(0.0 + 1.0, sessions[0].run(var_0)) self.assertAllEqual(1.0 + 1.0, sessions[0].run(var_1)) self.assertAllEqual(1, sessions[0].run(global_step)) def test1WorkerNegativeStaleness(self): num_workers = 1 sessions, graphs, train_ops = _get_workers(num_workers, -1) with graphs[0].as_default(): sessions[0].run(variables.global_variables_initializer()) global_step = training_util.get_global_step(graphs[0]) var_0 = graphs[0].get_tensor_by_name('v0:0') var_1 = graphs[0].get_tensor_by_name('v1:0') stale_counter = graphs[0].get_tensor_by_name('stale_counter:0') # Verify the initialized value. self.assertAllEqual(0.0, sessions[0].run(var_0)) self.assertAllEqual(1.0, sessions[0].run(var_1)) self.assertAllEqual(0.0, sessions[0].run(stale_counter)) self.assertAllEqual(0, sessions[0].run(global_step)) sessions[0].run(train_ops[0]) # Verify no updates because max staleness is negative. self.assertAllEqual(0, sessions[0].run(global_step)) self.assertAllEqual(1.0, sessions[0].run(stale_counter)) self.assertAllEqual(0.0, sessions[0].run(var_0)) self.assertAllEqual(1.0, sessions[0].run(var_1)) def test2WorkersStaleness0(self): num_workers = 2 sessions, graphs, train_ops = _get_workers(num_workers, 0) with graphs[0].as_default(): sessions[0].run(variables.global_variables_initializer()) global_step = training_util.get_global_step(graphs[0]) var_0 = graphs[0].get_tensor_by_name('v0:0') var_1 = graphs[0].get_tensor_by_name('v1:0') stale_counter = graphs[0].get_tensor_by_name('stale_counter:0') # Verify the initialized value. self.assertAllEqual(0.0, sessions[0].run(var_0)) self.assertAllEqual(1.0, sessions[0].run(var_1)) self.assertAllEqual(0.0, sessions[0].run(stale_counter)) self.assertAllEqual(0, sessions[0].run(global_step)) thread_0 = self.checkedThread( target=self._run, args=(train_ops[0], sessions[0])) thread_1 = self.checkedThread( target=self._run, args=(train_ops[1], sessions[1])) thread_0.start() thread_1.start() thread_0.join() thread_1.join() # With 2 workers and max staleness set to 0, only chief worker will update # var_0 and var_1. self.assertAllEqual(1, sessions[0].run(global_step)) self.assertAllEqual(1.0, sessions[0].run(stale_counter)) self.assertAllEqual(0.0 + 1.0, sessions[0].run(var_0)) self.assertAllEqual(1.0 + 1.0, sessions[0].run(var_1)) def test2WorkersStaleness1(self): num_workers = 2 sessions, graphs, train_ops = _get_workers(num_workers, 1) with graphs[0].as_default(): sessions[0].run(variables.global_variables_initializer()) global_step = training_util.get_global_step(graphs[0]) var_0 = graphs[0].get_tensor_by_name('v0:0') var_1 = graphs[0].get_tensor_by_name('v1:0') stale_counter = graphs[0].get_tensor_by_name('stale_counter:0') # Verify the initialized value. self.assertAllEqual(0.0, sessions[0].run(var_0)) self.assertAllEqual(1.0, sessions[0].run(var_1)) self.assertAllEqual(0.0, sessions[0].run(stale_counter)) self.assertAllEqual(0, sessions[0].run(global_step)) thread_0 = self.checkedThread( target=self._run, args=(train_ops[0], sessions[0])) thread_1 = self.checkedThread( target=self._run, args=(train_ops[1], sessions[1])) thread_0.start() thread_1.start() thread_0.join() thread_1.join() # With 2 workers and max staleness set to 1, both workers will update # var_0 and var_1. self.assertAllEqual(2, sessions[0].run(global_step)) self.assertAllEqual(0.0, sessions[0].run(stale_counter)) self.assertAllEqual(0.0 + 2.0, sessions[0].run(var_0)) self.assertAllEqual(1.0 + 2.0, sessions[0].run(var_1)) def test3WorkersStaleness0(self): num_workers = 3 sessions, graphs, train_ops = _get_workers(num_workers, 0) with graphs[0].as_default(): sessions[0].run(variables.global_variables_initializer()) global_step = training_util.get_global_step(graphs[0]) var_0 = graphs[0].get_tensor_by_name('v0:0') var_1 = graphs[0].get_tensor_by_name('v1:0') stale_counter = graphs[0].get_tensor_by_name('stale_counter:0') # Verify the initialized value. self.assertAllEqual(0.0, sessions[0].run(var_0)) self.assertAllEqual(1.0, sessions[0].run(var_1)) self.assertAllEqual(0.0, sessions[0].run(stale_counter)) self.assertAllEqual(0, sessions[0].run(global_step)) thread_0 = self.checkedThread( target=self._run, args=(train_ops[0], sessions[0])) thread_1 = self.checkedThread( target=self._run, args=(train_ops[1], sessions[1])) thread_2 = self.checkedThread( target=self._run, args=(train_ops[2], sessions[2])) thread_0.start() thread_1.start() thread_2.start() thread_0.join() thread_1.join() thread_2.join() # With 3 workers and max staleness set to 0, only chief worker will update # var_0 and var_1. self.assertAllEqual(1, sessions[0].run(global_step)) self.assertAllEqual(2.0, sessions[0].run(stale_counter)) self.assertAllEqual(0.0 + 1.0, sessions[0].run(var_0)) self.assertAllEqual(1.0 + 1.0, sessions[0].run(var_1)) def test3WorkersStaleness1(self): num_workers = 3 sessions, graphs, train_ops = _get_workers(num_workers, 1) with graphs[0].as_default(): sessions[0].run(variables.global_variables_initializer()) global_step = training_util.get_global_step(graphs[0]) var_0 = graphs[0].get_tensor_by_name('v0:0') var_1 = graphs[0].get_tensor_by_name('v1:0') stale_counter = graphs[0].get_tensor_by_name('stale_counter:0') # Verify the initialized value. self.assertAllEqual(0.0, sessions[0].run(var_0)) self.assertAllEqual(1.0, sessions[0].run(var_1)) self.assertAllEqual(0.0, sessions[0].run(stale_counter)) self.assertAllEqual(0, sessions[0].run(global_step)) thread_0 = self.checkedThread( target=self._run, args=(train_ops[0], sessions[0])) thread_1 = self.checkedThread( target=self._run, args=(train_ops[1], sessions[1])) thread_2 = self.checkedThread( target=self._run, args=(train_ops[2], sessions[2])) thread_0.start() thread_1.start() thread_2.start() thread_0.join() thread_1.join() thread_2.join() # With 3 workers and max staleness set to 1, chief worker and only one of # the two other workers will update var_0 and var_1. self.assertAllEqual(2, sessions[0].run(global_step)) self.assertAllEqual(1.0, sessions[0].run(stale_counter)) self.assertAllEqual(0.0 + 2.0, sessions[0].run(var_0)) self.assertAllEqual(1.0 + 2.0, sessions[0].run(var_1)) if __name__ == '__main__': test.main()
apache-2.0
lexodistro/blissflixx
chls/bfch_itv_player/__init__.py
1
3870
from chanutils import get_doc, select_all, select_one from chanutils import get_attr, get_text, get_text_content from playitem import PlayItem, PlayItemList, MoreEpisodesAction _PREFIX = 'https://www.itv.com' _SEARCH_URL = _PREFIX + '/itvplayer/search/term/' _FEEDLIST = [ {'title':'Popular', 'url':'https://www.itv.com/itvplayer/categories/browse/popular'}, {'title':'Children', 'url':'https://www.itv.com/itvplayer/categories/children/popular'}, {'title':'Comedy', 'url':'https://www.itv.com/itvplayer/categories/comedy/popular'}, {'title':'Drama & Soaps', 'url':'https://www.itv.com/itvplayer/categories/drama-soaps/popular'}, {'title':'Entertainment', 'url':'https://www.itv.com/itvplayer/categories/entertainment/popular'}, {'title':'Factual', 'url':'https://www.itv.com/itvplayer/categories/factual/popular'}, {'title':'Films', 'url':'https://www.itv.com/itvplayer/categories/films/popular'}, {'title':'Lifestyle', 'url':'https://www.itv.com/itvplayer/categories/lifestyle/popular'}, {'title':'Sport', 'url':'https://www.itv.com/itvplayer/categories/sport/popular'}, ] def name(): return 'ITV Player' def image(): return 'icon.png' def description(): return "ITV Player Channel (<a target='_blank' href='https://www.itv.com/itvplayer/'>https://www.itv.com/itvplayer</a>). Geo-restricted to UK." def feedlist(): return _FEEDLIST def feed(idx): url = _FEEDLIST[idx]['url'] doc = get_doc(url) rtree = select_all(doc, 'li.programme') results = PlayItemList() for l in rtree: el = select_one(l, '.programme-title a') url = _PREFIX + get_attr(el, 'href') title = get_text(el) el = select_one(l, 'img') img = get_attr(el, 'src') subtitle = get_text(select_one(l, '.episode-info span.episode-free')) item = PlayItem(title, img, url, subtitle) if (subtitle is not None) and (not subtitle.startswith('1 ')): item.add_action(MoreEpisodesAction(url, title)) results.add(item) return results def search(q): q = q.replace(' ', '-') q = q.replace("'", '') doc = get_doc(_SEARCH_URL + q) rtree = select_all(doc, 'div.search-wrapper') results = PlayItemList() for l in rtree: el = select_one(l, 'div.remaining-time') if el is not None and get_text(el).strip() == 'unavailable': continue el = select_one(l, 'h4 a') url = get_attr(el, 'href') title = get_text(el) el = select_one(l, "div.search-result-image a img") img = get_attr(el, 'src') el = select_one(l, ".search-episode-count") matched = int(get_attr(el, 'data-matched_episodes')) episodes = get_text(el) episodes = int(episodes[0:episodes.find(' ')]) action = None if episodes > matched: action = MoreEpisodesAction(url, title) eps = select_all(l, ".episode") for e in eps: el = select_one(e, ".episode-title a") url = _PREFIX + get_attr(el, 'href') subtitle = get_text(el) el = select_one(e, ".description") synopsis = get_text_content(el) item = PlayItem(title, img, url, subtitle, synopsis) results.add(item) if action: item.add_action(action) break return results def showmore(link): doc = get_doc(link) rtree = select_all(doc, 'div.views-row') results = PlayItemList() for l in rtree: el = select_one(l, 'a') url = _PREFIX + get_attr(el, 'href') el = select_one(el, 'img') img = get_attr(el, 'src') el = select_one(l, 'span.date-display-single') subtitle = get_text(el) el = select_one(l, 'div.field-season-number') title1 = get_text_content(el) el = select_one(l, 'div.field-episode-number') title = title1 + " " + get_text_content(el) el = select_one(l, 'div.field-name-field-short-synopsis') synopsis = get_text_content(el) item = PlayItem(title, img, url, subtitle, synopsis) results.add(item) return results
gpl-2.0
karna41317/personal_blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/pastie.py
364
2473
# -*- coding: utf-8 -*- """ pygments.styles.pastie ~~~~~~~~~~~~~~~~~~~~~~ Style similar to the `pastie`_ default style. .. _pastie: http://pastie.caboo.se/ :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace class PastieStyle(Style): """ Style similar to the pastie default style. """ default_style = '' styles = { Whitespace: '#bbbbbb', Comment: '#888888', Comment.Preproc: 'bold #cc0000', Comment.Special: 'bg:#fff0f0 bold #cc0000', String: 'bg:#fff0f0 #dd2200', String.Regex: 'bg:#fff0ff #008800', String.Other: 'bg:#f0fff0 #22bb22', String.Symbol: '#aa6600', String.Interpol: '#3333bb', String.Escape: '#0044dd', Operator.Word: '#008800', Keyword: 'bold #008800', Keyword.Pseudo: 'nobold', Keyword.Type: '#888888', Name.Class: 'bold #bb0066', Name.Exception: 'bold #bb0066', Name.Function: 'bold #0066bb', Name.Property: 'bold #336699', Name.Namespace: 'bold #bb0066', Name.Builtin: '#003388', Name.Variable: '#336699', Name.Variable.Class: '#336699', Name.Variable.Instance: '#3333bb', Name.Variable.Global: '#dd7700', Name.Constant: 'bold #003366', Name.Tag: 'bold #bb0066', Name.Attribute: '#336699', Name.Decorator: '#555555', Name.Label: 'italic #336699', Number: 'bold #0000DD', Generic.Heading: '#333', Generic.Subheading: '#666', Generic.Deleted: 'bg:#ffdddd #000000', Generic.Inserted: 'bg:#ddffdd #000000', Generic.Error: '#aa0000', Generic.Emph: 'italic', Generic.Strong: 'bold', Generic.Prompt: '#555555', Generic.Output: '#888888', Generic.Traceback: '#aa0000', Error: 'bg:#e3d2d2 #a61717' }
mit
tech-team/convnet
convnet/mnist/mnist.py
1
4658
import cPickle import gzip import os import numpy as np from convnet.layers import * from convnet.layers.convolutional_layer import _ConvolutionalLayer from convnet.net import ConvNet from convnet.utils import y_1d_to_3d np.set_printoptions(precision=4, linewidth=120) def transform_X(X_train): X = [] for i in xrange(X_train.shape[0]): x = X_train[i] x = x.reshape((28, 28))[:, :, np.newaxis] X.append(x) return X def transform_Y(Y_train): Y = [] uniq = np.unique(Y_train) labels_count = uniq.size for i in xrange(Y_train.shape[0]): y = Y_train[i] y_arr = np.zeros(labels_count) index = np.where(uniq == y)[0][0] y_arr[index] = 1 Y.append(y_1d_to_3d(y_arr)) return Y def get_examples(X_train, Y_train, labels=None, count=None): if isinstance(count, int): count = [count] * len(labels) assert len(labels) == len(count) X = None Y = None for i, label in enumerate(labels): indices = np.where(Y_train == label)[0] indices = indices[:count[i]] if X is None: X = X_train[indices] else: X = np.concatenate([X, X_train[indices]]) if Y is None: Y = Y_train[indices] else: Y = np.concatenate([Y, Y_train[indices]]) return X, Y def shuffle_in_unison_inplace(a, b): assert len(a) == len(b) p = np.random.permutation(len(a)) return a[p], b[p] # noinspection PyPep8Naming def mnist(): script_path = os.path.dirname(os.path.abspath(__file__)) f = gzip.open(os.path.join(script_path, './mnist.pkl.gz'), 'rb') train_set, valid_set, test_set = cPickle.load(f) f.close() X_train, Y_train = train_set #X_train, Y_train = get_examples(X_train, Y_train, labels=np.arange(0, 10), count=200) #X_train, Y_train = shuffle_in_unison_inplace(X_train, Y_train) X_train = transform_X(X_train) Y_train = transform_Y(Y_train) print("Train set size: {}".format(len(X_train))) X_cv, Y_cv = valid_set #X_cv, Y_cv = get_examples(X_cv, Y_cv, labels=np.arange(0, 10), count=15) #X_cv, Y_cv = shuffle_in_unison_inplace(X_cv, Y_cv) X_cv = transform_X(X_cv) Y_cv = transform_Y(Y_cv) print("Cross validation set size: {}".format(len(X_cv))) X_test, Y_test = test_set #X_test, Y_test = get_examples(X_test, Y_test, labels=np.arange(0, 10), count=100) #X_test, Y_test = shuffle_in_unison_inplace(X_test, Y_test) X_test = transform_X(X_test) Y_test = transform_Y(Y_test) print("Test set size: {}".format(len(X_test))) net = ConvNet(iterations_count=1000, batch_size=200, learning_rate=0.001, momentum=0.9, weight_decay=0.001) net.setup_layers([ InputLayer(InputLayerSettings(in_shape=X_train[0].shape)), ConvolutionalLayer(ConvolutionalLayerSettings(filters_count=8, filter_size=5, stride=1, zero_padding=0)), ReluLayer(ReluLayerSettings(activation='max')), PoolingLayer(PoolingLayerSettings(filter_size=2, stride=2)), ConvolutionalLayer(ConvolutionalLayerSettings(filters_count=16, filter_size=5, stride=1, zero_padding=0)), ReluLayer(ReluLayerSettings(activation='max')), PoolingLayer(PoolingLayerSettings(filter_size=3, stride=3)), FullConnectedLayer(FullConnectedLayerSettings(neurons_count=Y_train[0].shape[-1], activation='sigmoid')), ]) # net = ConvNet.load_net(os.path.join(script_path, './convnet1.pkl')) try: net.fit(X_train, Y_train) except KeyboardInterrupt: print("Training stopped") train_matched = 0 for x, y in zip(X_train, Y_train): h = net.predict(x) h_res = h.argmax() y_res = y.argmax() # print("predicted = {}; max = {}".format(h, h.argmax())) # print("real = {}; max = {}".format(y, y.argmax())) # print("\n") train_matched += int(h_res == y_res) test_matched = 0 for x, y in zip(X_test, Y_test): h = net.predict(x) h_res = h.argmax() y_res = y.argmax() # print("predicted = {}; max = {}".format(h, h.argmax())) # print("real = {}; max = {}".format(y, y.argmax())) # print("\n") test_matched += int(h_res == y_res) print("Accuracy train {}/{}".format(train_matched, len(X_train))) print("Accuracy test {}/{}".format(test_matched, len(X_test))) path = os.path.join(script_path, "./convnet1.pkl") net.dump_net(path) print("Dumped to {}".format(path)) if __name__ == "__main__": mnist() # net = ConvNet.load_net('/home/igor/Desktop/convnet.pkl') pass
mit
nathanbjenx/cairis
cairis/bin/web_cimport.py
1
4420
#!/usr/bin/python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import json import requests import glob import imghdr import argparse import os import sys import base64 if (sys.version_info > (3,)): from urllib.parse import quote else: from urllib import quote __author__ = 'Shamal Faily' def authenticate(url,userName,passWd): credentials = 'Basic ' + base64.b64encode((userName + ':' + passWd).encode('ascii')).decode('ascii') resp = requests.post(url + '/api/session',headers={'Authorization': credentials}) if not resp.ok: raise Exception('Authentication error' + resp.text) return resp.json()['session_id'] def importModelFile(importFile,url,dbName,createDb,overwrite,mFormat,userName,passWd): session = authenticate(url,userName,passWd) data = {'session_id':session} if (createDb): newDbResp = requests.post(url + '/api/settings/database/' + quote(dbName) + '/create',data=data) if not newDbResp.ok: exceptionTxt = 'Cannot create database ' + dbName + ': ' + newDbResp.text raise Exception(exceptionTxt) openDbResp = requests.post(url + '/api/settings/database/' + quote(dbName) + '/open',data=data) if not openDbResp.ok: exceptionTxt = 'Cannot open database ' + dbName + ': ' + openDbResp.text raise Exception(exceptionTxt) buf = open(importFile,'rb').read().decode('utf-8') import_json = {'session_id' : session,'object' : {'urlenc_file_contents':buf,'overwrite':overwrite,'type':mFormat}} hdrs = {'Content-type': 'application/json'} importResp = requests.post(url + '/api/import/text',data=json.dumps(import_json),headers=hdrs); if not importResp.ok: exceptionTxt = 'Cannot import ' + importFile + ': ' + importResp.text raise Exception(exceptionTxt) def main(args=None): parser = argparse.ArgumentParser(description='Computer Aided Integration of Requirements and Information Security - Model Import using CAIRIS API') parser.add_argument('modelFile',help='model file to import') parser.add_argument('--url',dest='url',help='URL for CAIRIS server') parser.add_argument('--database',dest='dbName',default='cairis_default',help='database name') parser.add_argument('--user',dest='userName',default='test',help='Username') parser.add_argument('--password',dest='passWd',default='test',help='Password') parser.add_argument('--create',help='create flag',action="store_true") parser.add_argument('--overwrite',help='overwrite flag',action="store_true") parser.add_argument('--type',dest='modelFormat',help='model type to import. One of securitypattern, attackpattern, tvtypes, directory, requirements, riskanalysis, usability, misusability, project, domainvalues, architecturalpattern, associations, synopses, processes, assets, locations, dataflows or all') args = parser.parse_args() file_import(args.modelFile,args.url,args.dbName,args.create,args.overwrite,args.modelFormat,args.userName,args.passWd) def file_import(importFile,url,dbName,createDb,overwrite,mFormat,userName,passWd): if (os.access(importFile, os.R_OK)) == False: raise Exception("Cannot access " + importFile) if (mFormat in ['securitypattern','attackpattern','tvtypes','directory','requirements','riskanalysis','usability', 'misusability','project','domainvalues','architecturalpattern','associations','synopses','processes','assets','locations','dataflows','all']): importModelFile(importFile,url,dbName,createDb,overwrite,mFormat,userName,passWd) else: raise Exception('Input model type ' + mFormat + ' not recognised') return 0 if __name__ == '__main__': try: main() except Exception as e: print("Fatal web_cimport error: " + str(e)) sys.exit(-1)
apache-2.0
rosswhitfield/mantid
Testing/SystemTests/tests/framework/IntegrateEllipsoidsTest.py
3
1806
# Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + from numpy.testing import assert_allclose from systemtesting import MantidSystemTest from mantid.api import mtd from mantid.simpleapi import (LoadNexus, IntegrateEllipsoids) class IntegrateEllipsoidsTest(MantidSystemTest): r""" def requiredFiles(self): return ['TOPAZ_39037_bank29.nxs', # input events 'TOPAZ_39037_peaks_short.nxs'] # input peaks """ def runTest(self): r"""Calculate intensities for a set of peaks. The first and secon peaks in the table corresponds to satellite peak HKL=(1.5, 1.5,0) and main peak (1,1,0)""" LoadNexus(Filename='TOPAZ_39037_bank29.nxs', OutputWorkspace='events') LoadNexus(Filename='TOPAZ_39037_peaks_short.nxs', OutputWorkspace='peaks_input') IntegrateEllipsoids(InputWorkspace='events', PeaksWorkspace='peaks_input', OutputWorkspace='peaks_output', RegionRadius=0.14, SpecifySize=True, PeakSize=0.07, BackgroundInnerSize=0.09, BackgroundOuterSize=0.11, CutoffIsigI=5.0, AdaptiveQBackground=True, AdaptiveQMultiplier=0.001, UseOnePercentBackgroundCorrection=False) table = mtd['peaks_output'] # intensities for the first two peaks assert_allclose(table.column('Intens')[0:2], [938, 13936], atol=1.0)
gpl-3.0
mpvismer/pyqtgraph
pyqtgraph/graphicsItems/IsocurveItem.py
30
3857
from .GraphicsObject import * from .. import functions as fn from ..Qt import QtGui, QtCore class IsocurveItem(GraphicsObject): """ **Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>` Item displaying an isocurve of a 2D array.To align this item correctly with an ImageItem,call isocurve.setParentItem(image) """ def __init__(self, data=None, level=0, pen='w'): """ Create a new isocurve item. ============== =============================================================== **Arguments:** data A 2-dimensional ndarray. Can be initialized as None, and set later using :func:`setData <pyqtgraph.IsocurveItem.setData>` level The cutoff value at which to draw the isocurve. pen The color of the curve item. Can be anything valid for :func:`mkPen <pyqtgraph.mkPen>` ============== =============================================================== """ GraphicsObject.__init__(self) self.level = level self.data = None self.path = None self.setPen(pen) self.setData(data, level) def setData(self, data, level=None): """ Set the data/image to draw isocurves for. ============== ======================================================================== **Arguments:** data A 2-dimensional ndarray. level The cutoff value at which to draw the curve. If level is not specified, the previously set level is used. ============== ======================================================================== """ if level is None: level = self.level self.level = level self.data = data self.path = None self.prepareGeometryChange() self.update() def setLevel(self, level): """Set the level at which the isocurve is drawn.""" self.level = level self.path = None self.prepareGeometryChange() self.update() def setPen(self, *args, **kwargs): """Set the pen used to draw the isocurve. Arguments can be any that are valid for :func:`mkPen <pyqtgraph.mkPen>`""" self.pen = fn.mkPen(*args, **kwargs) self.update() def setBrush(self, *args, **kwargs): """Set the brush used to draw the isocurve. Arguments can be any that are valid for :func:`mkBrush <pyqtgraph.mkBrush>`""" self.brush = fn.mkBrush(*args, **kwargs) self.update() def updateLines(self, data, level): ##print "data:", data ##print "level", level #lines = fn.isocurve(data, level) ##print len(lines) #self.path = QtGui.QPainterPath() #for line in lines: #self.path.moveTo(*line[0]) #self.path.lineTo(*line[1]) #self.update() self.setData(data, level) def boundingRect(self): if self.data is None: return QtCore.QRectF() if self.path is None: self.generatePath() return self.path.boundingRect() def generatePath(self): if self.data is None: self.path = None return lines = fn.isocurve(self.data, self.level, connected=True, extendToEdge=True) self.path = QtGui.QPainterPath() for line in lines: self.path.moveTo(*line[0]) for p in line[1:]: self.path.lineTo(*p) def paint(self, p, *args): if self.data is None: return if self.path is None: self.generatePath() p.setPen(self.pen) p.drawPath(self.path)
mit
incnone/necrobot
necrobot/race/cmd_race.py
1
8686
# General cmds for any BotChannel that runs races. The BotChannel should implement: # current_race -> Race : Gets the "current" race (for Enter/Ready) # last_begun_race -> Race : Gets the race that most recently started (GO!), or None if no such # change_race_info(RaceInfo) : Changes the type of races run in the BotChannel # write(str) : Writes a message to the BotChannel # Remarks: # - change_race_info is only required for ChangeRace # - write is only required for Time import necrobot.exception from necrobot.botbase.commandtype import CommandType from necrobot.util import racetime from necrobot.util.necrodancer import level from necrobot.config import Config class Enter(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'enter', 'join', 'e', 'j') self.help_text = 'Enters (registers for) the race. After entering, use `.ready` to indicate you are ready to ' \ 'begin the race.' async def _do_execute(self, cmd): await self.bot_channel.current_race.enter_member(cmd.author) class Unenter(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'unenter', 'unjoin') self.help_text = 'Leaves the race.' async def _do_execute(self, cmd): await self.bot_channel.current_race.unenter_member(cmd.author) class Ready(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'ready', 'r') self.help_text = 'Indicates that you are ready to begin the race. The race begins when all entrants are ready.' async def _do_execute(self, cmd): await self.bot_channel.current_race.enter_and_ready_member(cmd.author) class Unready(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'unready') self.help_text = 'Undoes `.ready`.' async def _do_execute(self, cmd): await self.bot_channel.current_race.unready_member(cmd.author) class Done(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'done', 'finish', 'd') self.help_text = 'Indicates you have finished the race goal, and gets your final time. ' async def _do_execute(self, cmd): # Override: parse .d X-Y as a death if len(cmd.args) >= 1 and cmd.command == 'd': lvl = level.from_str(cmd.args[0]) if lvl != level.LEVEL_NOS: await self.reparse_as('death', cmd) return await self.bot_channel.current_race.finish_member(cmd.author) class Undone(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'undone', 'unfinish') self.help_text = 'Undoes an earlier `.done`.' async def _do_execute(self, cmd): await self.bot_channel.current_race.unfinish_member(cmd.author) class Forfeit(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'forfeit', 'quit', 'f', 'q') self.help_text = 'Forfeits from the race.' async def _do_execute(self, cmd): await self.bot_channel.current_race.forfeit_member(cmd.author) if len(cmd.args) >= 1: if self.bot_channel.last_begun_race is None: return lvl = level.from_str(cmd.args[0]) if lvl != level.LEVEL_NOS: cmd.args.pop(0) await self.bot_channel.last_begun_race.set_death_for_member(cmd.author, lvl) await self.reparse_as('comment', cmd) class Unforfeit(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'unforfeit', 'unquit') self.help_text = 'Undoes an earlier `.forfeit`.' async def _do_execute(self, cmd): await self.bot_channel.current_race.unforfeit_member(cmd.author) class Comment(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'comment', 'c') self.help_text = 'Adds text as a comment to your race.' async def _do_execute(self, cmd): if self.bot_channel.last_begun_race is None: return await self.bot_channel.last_begun_race.add_comment_for_member( cmd.author, cmd.arg_string ) class Death(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'death') self.help_text = 'Marks your race as having died at a given level, e.g., `{} 3-2`.'.format(self.mention) async def _do_execute(self, cmd): if len(cmd.args) == 0: await self.reparse_as('forfeit', cmd) else: if self.bot_channel.last_begun_race is None: return lvl = level.from_str(cmd.args[0]) await self.bot_channel.last_begun_race.set_death_for_member(cmd.author, lvl) if len(cmd.args) >= 2: cmd.args.pop(0) await self.reparse_as('comment', cmd) class Igt(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'igt') self.help_text = 'Adds an in-game-time to your race, e.g. `{} 12:34.56.`'.format(self.mention) async def _do_execute(self, cmd): if self.bot_channel.last_begun_race is None: return if len(cmd.args) == 1: igt = racetime.from_str(cmd.args[0]) await self.bot_channel.last_begun_race.set_igt_for_member(cmd.author, igt) class Time(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'time') self.help_text = 'Get the current race time.' async def _do_execute(self, cmd): if self.bot_channel.current_race.before_race: await self.bot_channel.write('The race hasn\'t started.') elif self.bot_channel.current_race.complete: await self.bot_channel.write('The race is over.') else: await self.bot_channel.write( 'The current race time is {}.'.format(self.bot_channel.last_begun_race.current_time_str)) class ForceForfeit(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'forceforfeit') self.help_text = 'Force the given racer to forfeit the race (even if they have finished).' self.admin_only = True async def _do_execute(self, cmd): if self.bot_channel.last_begun_race is None: return for name in cmd.args: for racer in self.bot_channel.last_begun_race.racers: if racer.name.lower() == name.lower(): await self.bot_channel.last_begun_race.forfeit_racer(racer) class ForceForfeitAll(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'endrace', 'forceforfeitall') self.help_text = 'Force all unfinished racers to forfeit the race and end the race.' self.admin_only = True async def _do_execute(self, cmd): if self.bot_channel.last_begun_race is None: return await self.bot_channel.last_begun_race.forfeit_all_remaining() class Reseed(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'reseed') self.help_text = 'Randomly generate a new seed for this race.' self.admin_only = True async def _do_execute(self, cmd): await self.bot_channel.current_race.reseed() class Pause(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'pause', 'p') self.help_text = 'Pause the race timer.' self.admin_only = True async def _do_execute(self, cmd): await self.bot_channel.current_race.pause() class Unpause(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'unpause') self.help_text = 'Unpause the race timer.' self.admin_only = True async def _do_execute(self, cmd): await self.bot_channel.current_race.unpause() class ChangeRules(CommandType): def __init__(self, race_room): CommandType.__init__(self, race_room, 'changerules') self.help_text = 'Change the rules for the race. Takes the same parameters as `.make`.' self.admin_only = not Config.GRUDGEDOR async def _do_execute(self, cmd): try: await self.bot_channel.change_race_info(cmd.args) except necrobot.exception.ParseException as e: await cmd.channel.send( "Couldn't parse input: `{0}`.".format(e) )
mit
paulmathews/nova
nova/virt/connection.py
7
2963
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Abstraction of the underlying virtualization API.""" import sys from nova.common import deprecated from nova import exception from nova import flags from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova import utils from nova.virt import driver LOG = logging.getLogger(__name__) FLAGS = flags.FLAGS known_drivers = { 'baremetal': 'baremetal.BareMetalDriver', 'fake': 'fake.FakeDriver', 'libvirt': 'libvirt.LibvirtDriver', 'vmwareapi': 'vmwareapi.VMWareESXDriver', 'xenapi': 'xenapi.XenAPIDriver' } def get_connection(read_only=False): """ Returns an object representing the connection to a virtualization platform, or to an on-demand bare-metal provisioning platform. This could be :mod:`nova.virt.fake.FakeConnection` in test mode, a connection to KVM, QEMU, or UML via :mod:`libvirt_conn`, or a connection to XenServer or Xen Cloud Platform via :mod:`xenapi`. Other platforms are also supported. Any object returned here must conform to the interface documented by :mod:`FakeConnection`. **Related flags** :connection_type: A string literal that falls through an if/elif structure to determine what virtualization mechanism to use. Values may be * fake * libvirt * xenapi * vmwareapi * baremetal """ deprecated.warn(_('Specifying virt driver via connection_type is ' 'deprecated. Use compute_driver=classname instead.')) driver_name = known_drivers.get(FLAGS.connection_type) if driver_name is None: raise exception.VirtDriverNotFound(name=FLAGS.connection_type) conn = importutils.import_object_ns('nova.virt', driver_name, read_only=read_only) if conn is None: LOG.error(_('Failed to open connection to underlying virt platform')) sys.exit(1) return utils.check_isinstance(conn, driver.ComputeDriver)
apache-2.0
latchset/custodia.ipa
setup.py
1
2156
#!/usr/bin/python # # Copyright (C) 2016 Custodia project Contributors, for licensee see COPYING import sys import setuptools from setuptools import setup SETUPTOOLS_VERSION = tuple(int(v) for v in setuptools.__version__.split(".")) requirements = [ 'custodia >= 0.5.0', 'ipalib >= 4.5.0', 'ipaclient >= 4.5.0', 'six', ] # test requirements test_requires = ['coverage', 'pytest'] extras_require = { 'test': test_requires, 'test_docs': ['docutils', 'markdown'], 'test_pep8': ['flake8', 'flake8-import-order', 'pep8-naming'], 'test_pylint': ['pylint'] + test_requires, } # backwards compatibility with old setuptools # unittest.mock was added in Python 3.3 if SETUPTOOLS_VERSION < (18, 0, 0) and sys.version_info < (3, 3): requirements.append('mock') else: extras_require[':python_version<"3.3"'] = ['mock'] with open('README') as f: long_description = f.read() setup( name='custodia.ipa', description='FreeIPA Vault plugin for Custodia', long_description=long_description, version='0.5.dev3', license='GPLv3+', maintainer='Custodia project Contributors', maintainer_email='cheimes@redhat.com', url='https://github.com/latchset/custodia.ipa', namespace_packages=['custodia'], package_dir={'': 'src'}, packages=[ 'custodia.ipa', ], entry_points={ 'custodia.stores': [ 'IPAVault = custodia.ipa.vault:IPAVault', 'IPACertRequest = custodia.ipa.certrequest:IPACertRequest' ], 'custodia.authenticators': [ 'IPAInterface = custodia.ipa.interface:IPAInterface', ] }, classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Intended Audience :: Developers', 'Topic :: Security', 'Topic :: Software Development :: Libraries :: Python Modules' ], install_requires=requirements, tests_require=test_requires, extras_require=extras_require, )
gpl-3.0
perimosocordiae/scipy
scipy/cluster/tests/test_disjoint_set.py
5
5425
import pytest from pytest import raises as assert_raises import numpy as np from scipy.cluster.hierarchy import DisjointSet import string def generate_random_token(): k = len(string.ascii_letters) tokens = list(np.arange(k, dtype=int)) tokens += list(np.arange(k, dtype=float)) tokens += list(string.ascii_letters) tokens += [None for i in range(k)] rng = np.random.RandomState(seed=0) while 1: size = rng.randint(1, 3) element = rng.choice(tokens, size) if size == 1: yield element[0] else: yield tuple(element) def get_elements(n): # dict is deterministic without difficulty of comparing numpy ints elements = {} for element in generate_random_token(): if element not in elements: elements[element] = len(elements) if len(elements) >= n: break return list(elements.keys()) def test_init(): n = 10 elements = get_elements(n) dis = DisjointSet(elements) assert dis.n_subsets == n assert list(dis) == elements def test_len(): n = 10 elements = get_elements(n) dis = DisjointSet(elements) assert len(dis) == n dis.add("dummy") assert len(dis) == n + 1 @pytest.mark.parametrize("n", [10, 100]) def test_contains(n): elements = get_elements(n) dis = DisjointSet(elements) for x in elements: assert x in dis assert "dummy" not in dis @pytest.mark.parametrize("n", [10, 100]) def test_add(n): elements = get_elements(n) dis1 = DisjointSet(elements) dis2 = DisjointSet() for i, x in enumerate(elements): dis2.add(x) assert len(dis2) == i + 1 # test idempotency by adding element again dis2.add(x) assert len(dis2) == i + 1 assert list(dis1) == list(dis2) def test_element_not_present(): elements = get_elements(n=10) dis = DisjointSet(elements) with assert_raises(KeyError): dis["dummy"] with assert_raises(KeyError): dis.merge(elements[0], "dummy") with assert_raises(KeyError): dis.connected(elements[0], "dummy") @pytest.mark.parametrize("direction", ["forwards", "backwards"]) @pytest.mark.parametrize("n", [10, 100]) def test_linear_union_sequence(n, direction): elements = get_elements(n) dis = DisjointSet(elements) assert elements == list(dis) indices = list(range(n - 1)) if direction == "backwards": indices = indices[::-1] for it, i in enumerate(indices): assert not dis.connected(elements[i], elements[i + 1]) assert dis.merge(elements[i], elements[i + 1]) assert dis.connected(elements[i], elements[i + 1]) assert dis.n_subsets == n - 1 - it roots = [dis[i] for i in elements] if direction == "forwards": assert all(elements[0] == r for r in roots) else: assert all(elements[-2] == r for r in roots) assert not dis.merge(elements[0], elements[-1]) @pytest.mark.parametrize("n", [10, 100]) def test_self_unions(n): elements = get_elements(n) dis = DisjointSet(elements) for x in elements: assert dis.connected(x, x) assert not dis.merge(x, x) assert dis.connected(x, x) assert dis.n_subsets == len(elements) assert elements == list(dis) roots = [dis[x] for x in elements] assert elements == roots @pytest.mark.parametrize("order", ["ab", "ba"]) @pytest.mark.parametrize("n", [10, 100]) def test_equal_size_ordering(n, order): elements = get_elements(n) dis = DisjointSet(elements) rng = np.random.RandomState(seed=0) indices = np.arange(n) rng.shuffle(indices) for i in range(0, len(indices), 2): a, b = elements[indices[i]], elements[indices[i + 1]] if order == "ab": assert dis.merge(a, b) else: assert dis.merge(b, a) expected = elements[min(indices[i], indices[i + 1])] assert dis[a] == expected assert dis[b] == expected @pytest.mark.parametrize("kmax", [5, 10]) def test_binary_tree(kmax): n = 2**kmax elements = get_elements(n) dis = DisjointSet(elements) rng = np.random.RandomState(seed=0) for k in 2**np.arange(kmax): for i in range(0, n, 2 * k): r1, r2 = rng.randint(0, k, size=2) a, b = elements[i + r1], elements[i + k + r2] assert not dis.connected(a, b) assert dis.merge(a, b) assert dis.connected(a, b) assert elements == list(dis) roots = [dis[i] for i in elements] expected_indices = np.arange(n) - np.arange(n) % (2 * k) expected = [elements[i] for i in expected_indices] assert roots == expected @pytest.mark.parametrize("n", [10, 100]) def test_subsets(n): elements = get_elements(n) dis = DisjointSet(elements) rng = np.random.RandomState(seed=0) for i, j in rng.randint(0, n, (n, 2)): x = elements[i] y = elements[j] expected = {element for element in dis if {dis[element]} == {dis[x]}} assert expected == dis.subset(x) expected = {dis[element]: set() for element in dis} for element in dis: expected[dis[element]].add(element) expected = list(expected.values()) assert expected == dis.subsets() dis.merge(x, y) assert dis.subset(x) == dis.subset(y)
bsd-3-clause
Weil0ng/gem5
src/arch/arm/ArmISA.py
7
5121
# Copyright (c) 2012-2013, 2015-2016 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality of the software # licensed hereunder. You may use the software subject to the license # terms below provided that you ensure that this notice is replicated # unmodified and in its entirety in all distributions of the software, # modified or unmodified, in source code or in binary form. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer; # redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution; # neither the name of the copyright holders nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Authors: Andreas Sandberg # Giacomo Gabrielli from m5.params import * from m5.proxy import * from m5.SimObject import SimObject from ArmPMU import ArmPMU # Enum for DecoderFlavour class DecoderFlavour(Enum): vals = ['Generic'] class ArmISA(SimObject): type = 'ArmISA' cxx_class = 'ArmISA::ISA' cxx_header = "arch/arm/isa.hh" system = Param.System(Parent.any, "System this ISA object belongs to") pmu = Param.ArmPMU(NULL, "Performance Monitoring Unit") decoderFlavour = Param.DecoderFlavour('Generic', "Decoder flavour specification") midr = Param.UInt32(0x410fc0f0, "MIDR value") # See section B4.1.89 - B4.1.92 of the ARM ARM # VMSAv7 support id_mmfr0 = Param.UInt32(0x10201103, "Memory Model Feature Register 0") id_mmfr1 = Param.UInt32(0x00000000, "Memory Model Feature Register 1") # no HW access | WFI stalling | ISB and DSB | # all TLB maintenance | no Harvard id_mmfr2 = Param.UInt32(0x01230000, "Memory Model Feature Register 2") # SuperSec | Coherent TLB | Bcast Maint | # BP Maint | Cache Maint Set/way | Cache Maint MVA id_mmfr3 = Param.UInt32(0x02102211, "Memory Model Feature Register 3") # See section B4.1.84 of ARM ARM # All values are latest for ARMv7-A profile id_isar0 = Param.UInt32(0x02101111, "Instruction Set Attribute Register 0") id_isar1 = Param.UInt32(0x02112111, "Instruction Set Attribute Register 1") id_isar2 = Param.UInt32(0x21232141, "Instruction Set Attribute Register 2") id_isar3 = Param.UInt32(0x01112131, "Instruction Set Attribute Register 3") id_isar4 = Param.UInt32(0x10010142, "Instruction Set Attribute Register 4") id_isar5 = Param.UInt32(0x00000000, "Instruction Set Attribute Register 5") fpsid = Param.UInt32(0x410430a0, "Floating-point System ID Register") # [31:0] is implementation defined id_aa64afr0_el1 = Param.UInt64(0x0000000000000000, "AArch64 Auxiliary Feature Register 0") # Reserved for future expansion id_aa64afr1_el1 = Param.UInt64(0x0000000000000000, "AArch64 Auxiliary Feature Register 1") # 1 CTX CMPs | 2 WRPs | 2 BRPs | !PMU | !Trace | Debug v8-A id_aa64dfr0_el1 = Param.UInt64(0x0000000000101006, "AArch64 Debug Feature Register 0") # Reserved for future expansion id_aa64dfr1_el1 = Param.UInt64(0x0000000000000000, "AArch64 Debug Feature Register 1") # !CRC32 | !SHA2 | !SHA1 | !AES id_aa64isar0_el1 = Param.UInt64(0x0000000000000000, "AArch64 Instruction Set Attribute Register 0") # Reserved for future expansion id_aa64isar1_el1 = Param.UInt64(0x0000000000000000, "AArch64 Instruction Set Attribute Register 1") # 4K | 64K | !16K | !BigEndEL0 | !SNSMem | !BigEnd | 8b ASID | 40b PA id_aa64mmfr0_el1 = Param.UInt64(0x0000000000f00002, "AArch64 Memory Model Feature Register 0") # Reserved for future expansion id_aa64mmfr1_el1 = Param.UInt64(0x0000000000000000, "AArch64 Memory Model Feature Register 1")
bsd-3-clause
softak/webfaction_demo
vendor-local/lib/python/celery/utils/mail.py
18
4826
# -*- coding: utf-8 -*- """ celery.utils.mail ~~~~~~~~~~~~~~~~~ How task error emails are formatted and sent. :copyright: (c) 2009 - 2011 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sys import smtplib try: from email.mime.text import MIMEText except ImportError: from email.MIMEText import MIMEText # noqa from celery.utils import get_symbol_by_name supports_timeout = sys.version_info >= (2, 6) class SendmailWarning(UserWarning): """Problem happened while sending the email message.""" class Message(object): def __init__(self, to=None, sender=None, subject=None, body=None, charset="us-ascii"): self.to = to self.sender = sender self.subject = subject self.body = body self.charset = charset if not isinstance(self.to, (list, tuple)): self.to = [self.to] def __repr__(self): return "<Email: To:%r Subject:%r>" % (self.to, self.subject) def __str__(self): msg = MIMEText(self.body, "plain", self.charset) msg["Subject"] = self.subject msg["From"] = self.sender msg["To"] = ", ".join(self.to) return msg.as_string() class Mailer(object): def __init__(self, host="localhost", port=0, user=None, password=None, timeout=2, use_ssl=False, use_tls=False): self.host = host self.port = port self.user = user self.password = password self.timeout = timeout self.use_ssl = use_ssl self.use_tls = use_tls def send(self, message): if supports_timeout: self._send(message, timeout=self.timeout) else: import socket old_timeout = socket.getdefaulttimeout() socket.setdefaulttimeout(self.timeout) try: self._send(message) finally: socket.setdefaulttimeout(old_timeout) def _send(self, message, **kwargs): if (self.use_ssl): client = smtplib.SMTP_SSL(self.host, self.port, **kwargs) else: client = smtplib.SMTP(self.host, self.port, **kwargs) if self.use_tls: client.ehlo() client.starttls() client.ehlo() if self.user and self.password: client.login(self.user, self.password) client.sendmail(message.sender, message.to, str(message)) client.quit() class ErrorMail(object): """Defines how and when task error e-mails should be sent. :param task: The task instance that raised the error. :attr:`subject` and :attr:`body` are format strings which are passed a context containing the following keys: * name Name of the task. * id UUID of the task. * exc String representation of the exception. * args Positional arguments. * kwargs Keyword arguments. * traceback String representation of the traceback. * hostname Worker hostname. """ # pep8.py borks on a inline signature separator and # says "trailing whitespace" ;) EMAIL_SIGNATURE_SEP = "-- " #: Format string used to generate error email subjects. subject = """\ [celery@%(hostname)s] Error: Task %(name)s (%(id)s): %(exc)s """ #: Format string used to generate error email content. body = """ Task %%(name)s with id %%(id)s raised exception:\n%%(exc)r Task was called with args: %%(args)s kwargs: %%(kwargs)s. The contents of the full traceback was: %%(traceback)s %(EMAIL_SIGNATURE_SEP)s Just to let you know, celeryd at %%(hostname)s. """ % {"EMAIL_SIGNATURE_SEP": EMAIL_SIGNATURE_SEP} error_whitelist = None def __init__(self, task, **kwargs): self.task = task self.email_subject = kwargs.get("subject", self.subject) self.email_body = kwargs.get("body", self.body) self.error_whitelist = getattr(task, "error_whitelist") def should_send(self, context, exc): """Returns true or false depending on if a task error mail should be sent for this type of error.""" allow_classes = tuple(map(get_symbol_by_name, self.error_whitelist)) return not self.error_whitelist or isinstance(exc, allow_classes) def format_subject(self, context): return self.subject.strip() % context def format_body(self, context): return self.body.strip() % context def send(self, context, exc, fail_silently=True): if self.should_send(context, exc): self.task.app.mail_admins(self.format_subject(context), self.format_body(context), fail_silently=fail_silently)
bsd-3-clause
pawaranand/phrerp
erpnext/hr/doctype/hr_settings/hr_settings.py
38
1282
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint from frappe.model.document import Document class HRSettings(Document): def validate(self): self.update_birthday_reminders() from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series set_by_naming_series("Employee", "employee_number", self.get("emp_created_by")=="Naming Series", hide_name_field=True) def update_birthday_reminders(self): original_stop_birthday_reminders = cint(frappe.db.get_value("HR Settings", None, "stop_birthday_reminders")) # reset birthday reminders if cint(self.stop_birthday_reminders) != original_stop_birthday_reminders: frappe.db.sql("""delete from `tabEvent` where repeat_on='Every Year' and ref_type='Employee'""") if not self.stop_birthday_reminders: for employee in frappe.db.sql_list("""select name from `tabEmployee` where status='Active' and ifnull(date_of_birth, '')!=''"""): frappe.get_doc("Employee", employee).update_dob_event() frappe.msgprint(frappe._("Updated Birthday Reminders"))
agpl-3.0
sivel/ansible-modules-extras
notification/nexmo.py
11
3981
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Matt Martz <matt@sivel.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} DOCUMENTATION = """ module: nexmo short_description: Send a SMS via nexmo description: - Send a SMS message via nexmo version_added: 1.6 author: "Matt Martz (@sivel)" options: api_key: description: - Nexmo API Key required: true api_secret: description: - Nexmo API Secret required: true src: description: - Nexmo Number to send from required: true dest: description: - Phone number(s) to send SMS message to required: true msg: description: - Message to text to send. Messages longer than 160 characters will be split into multiple messages required: true validate_certs: description: - If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. required: false default: 'yes' choices: - 'yes' - 'no' """ EXAMPLES = """ - name: Send notification message via Nexmo local_action: module: nexmo api_key: 640c8a53 api_secret: 0ce239a6 src: 12345678901 dest: - 10987654321 - 16789012345 msg: "{{ inventory_hostname }} completed" """ import urllib NEXMO_API = 'https://rest.nexmo.com/sms/json' def send_msg(module): failed = list() responses = dict() msg = { 'api_key': module.params.get('api_key'), 'api_secret': module.params.get('api_secret'), 'from': module.params.get('src'), 'text': module.params.get('msg') } for number in module.params.get('dest'): msg['to'] = number url = "%s?%s" % (NEXMO_API, urllib.urlencode(msg)) headers = dict(Accept='application/json') response, info = fetch_url(module, url, headers=headers) if info['status'] != 200: failed.append(number) responses[number] = dict(failed=True) try: responses[number] = json.load(response) except: failed.append(number) responses[number] = dict(failed=True) else: for message in responses[number]['messages']: if int(message['status']) != 0: failed.append(number) responses[number] = dict(failed=True, **responses[number]) if failed: msg = 'One or messages failed to send' else: msg = '' module.exit_json(failed=bool(failed), msg=msg, changed=False, responses=responses) def main(): argument_spec = url_argument_spec() argument_spec.update( dict( api_key=dict(required=True, no_log=True), api_secret=dict(required=True, no_log=True), src=dict(required=True, type='int'), dest=dict(required=True, type='list'), msg=dict(required=True), ), ) module = AnsibleModule( argument_spec=argument_spec ) send_msg(module) # import module snippets from ansible.module_utils.basic import * from ansible.module_utils.urls import * if __name__ == '__main__': main()
gpl-3.0
tortxof/OpenBazaar
db/migrations/migration3.py
13
1551
#!/usr/bin/env python from sqlite3 import dbapi2 from db.migrations import migrations_util from node import constants def upgrade(db_path): with dbapi2.connect(db_path) as con: cur = con.cursor() # Use PRAGMA key to encrypt / decrypt database. cur.execute("PRAGMA key = '%s';" % constants.DB_PASSPHRASE) try: cur.execute("ALTER TABLE contracts " "ADD COLUMN refund_requested INT DEFAULT 0") cur.execute("ALTER TABLE contracts " "ADD COLUMN cancelled INT DEFAULT 0") cur.execute("ALTER TABLE contracts " "ADD COLUMN refund_address TEXT") print 'Upgraded' con.commit() except dbapi2.Error as exc: print 'Exception: %s' % exc def downgrade(db_path): with dbapi2.connect(db_path) as con: cur = con.cursor() # Use PRAGMA key to encrypt / decrypt database. cur.execute("PRAGMA key = '%s';" % constants.DB_PASSPHRASE) cur.execute("ALTER TABLE contracts DROP COLUMN refund_requested") cur.execute("ALTER TABLE contracts DROP COLUMN cancelled") cur.execute("ALTER TABLE contracts DROP COLUMN refund_address") print 'Downgraded' con.commit() def main(): parser = migrations_util.make_argument_parser(constants.DB_PATH) args = parser.parse_args() if args.action == "upgrade": upgrade(args.path) else: downgrade(args.path) if __name__ == "__main__": main()
mit
pubudu538/private-paas-cartridges
wso2is/5.0.0/plugins/wso2is-500-startup-handler.py
3
23322
# ------------------------------------------------------------------------ # # Copyright 2005-2015 WSO2, Inc. (http://wso2.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License # # ------------------------------------------------------------------------ import subprocess import socket import os import time from plugins.contracts import ICartridgeAgentPlugin from modules.util.log import LogFactory from entity import * import mdsclient from config import Config class WSO2StartupHandler(ICartridgeAgentPlugin): """ Configures and starts configurator, carbon server """ log = LogFactory().get_log(__name__) # class constants CONST_PORT_MAPPINGS = "PORT_MAPPINGS" CONST_APPLICATION_ID = "APPLICATION_ID" CONST_MB_IP = "MB_IP" CONST_SERVICE_NAME = "SERVICE_NAME" CONST_CLUSTER_ID = "CLUSTER_ID" CONST_WORKER = "worker" CONST_MANAGER = "manager" CONST_MGT = "mgt" CONST_PORT_MAPPING_MGT_HTTP_TRANSPORT = "mgt-http" CONST_PORT_MAPPING_MGT_HTTPS_TRANSPORT = "mgt-https" CONST_PROTOCOL_HTTP = "http" CONST_PROTOCOL_HTTPS = "https" CONST_PPAAS_MEMBERSHIP_SCHEME = "private-paas" CONST_PRODUCT = "IS" SERVICES = ["wso2is-500-manager", "wso2is-as-km-500-manager"] # list of environment variables exported by the plugin ENV_CONFIG_PARAM_SUB_DOMAIN = 'CONFIG_PARAM_SUB_DOMAIN' ENV_CONFIG_PARAM_MB_HOST = 'CONFIG_PARAM_MB_HOST' ENV_CONFIG_PARAM_CLUSTER_IDs = 'CONFIG_PARAM_CLUSTER_IDs' ENV_CONFIG_PARAM_HTTP_PROXY_PORT = 'CONFIG_PARAM_HTTP_PROXY_PORT' ENV_CONFIG_PARAM_HTTPS_PROXY_PORT = 'CONFIG_PARAM_HTTPS_PROXY_PORT' ENV_CONFIG_PARAM_HOST_NAME = 'CONFIG_PARAM_HOST_NAME' ENV_CONFIG_PARAM_MGT_HOST_NAME = 'CONFIG_PARAM_MGT_HOST_NAME' ENV_CONFIG_PARAM_LOCAL_MEMBER_HOST = 'CONFIG_PARAM_LOCAL_MEMBER_HOST' # clustering related environment variables read from payload_parameters ENV_CONFIG_PARAM_CLUSTERING = 'CONFIG_PARAM_CLUSTERING' ENV_CONFIG_PARAM_MEMBERSHIP_SCHEME = 'CONFIG_PARAM_MEMBERSHIP_SCHEME' ENV_CONFIG_PARAM_PROFILE = 'CONFIG_PARAM_PROFILE' CONST_PROFILE_KEY_MANAGER = 'KeyManager' ENV_LB_IP = 'LB_IP' ENV_CONFIG_PARAM_KEYMANAGER_IP = 'CONFIG_PARAM_KEYMANAGER_IP' CONST_CONFIG_PARAM_KEYMANAGER_PORTS = 'CONFIG_PARAM_KEYMANAGER_PORTS' ENV_CONFIG_PARAM_GATEWAY_IP = 'CONFIG_PARAM_GATEWAY_IP' CONST_CONFIG_PARAM_GATEWAY_PORTS = 'CONFIG_PARAM_GATEWAY_PORTS' ENV_CONFIG_PARAM_GATEWAY_WORKER_IP = 'CONFIG_PARAM_GATEWAY_WORKER_IP' CONST_CONFIG_PARAM_GATEWAY_WORKER_PORTS = 'CONFIG_PARAM_GATEWAY_WORKER_PORTS' CONST_KUBERNETES = "KUBERNETES" CONST_VM = "VM" CONST_EXTERNAL_LB_FOR_KUBERNETES = "EXTERNAL_LB_FOR_KUBERNETES" CONST_GATEWAY_MANAGER_SERVICE_NAME = "wso2am-191-gw-manager" CONST_GATEWAY_WORKER_SERVICE_NAME = "wso2am-191-gw-worker" ENV_CONFIG_PARAM_GATEWAY_WORKER_PT_HTTP_PROXY_PORT = 'CONFIG_PARAM_GATEWAY_WORKER_PT_HTTP_PROXY_PORT' ENV_CONFIG_PARAM_GATEWAY_WORKER_PT_HTTPS_PROXY_PORT = 'CONFIG_PARAM_GATEWAY_WORKER_PT_HTTPS_PROXY_PORT' ENV_CONFIG_PARAM_GATEWAY_HTTPS_PROXY_PORT = 'CONFIG_PARAM_GATEWAY_HTTPS_PROXY_PORT' # This is payload parameter which enables to use an external lb when using kubernetes. Use true when using with kub. ENV_CONFIG_PARAM_USE_EXTERNAL_LB_FOR_KUBERNETES = 'CONFIG_PARAM_USE_EXTERNAL_LB_FOR_KUBERNETES' CONST_KM_SERVICE_NAME = 'KEY_MANAGER_SERVICE_NAME' def run_plugin(self, values): # read from 'values' port_mappings_str = values[self.CONST_PORT_MAPPINGS].replace("'", "") app_id = values[self.CONST_APPLICATION_ID] mb_ip = values[self.CONST_MB_IP] service_type = values[self.CONST_SERVICE_NAME] my_cluster_id = values[self.CONST_CLUSTER_ID] clustering = values.get(self.ENV_CONFIG_PARAM_CLUSTERING, 'false') membership_scheme = values.get(self.ENV_CONFIG_PARAM_MEMBERSHIP_SCHEME) profile = os.environ.get(self.ENV_CONFIG_PARAM_PROFILE) lb_ip = os.environ.get(self.ENV_LB_IP) external_lb = values.get(WSO2StartupHandler.ENV_CONFIG_PARAM_USE_EXTERNAL_LB_FOR_KUBERNETES, 'false') # read topology from PCA TopologyContext topology = TopologyContext.topology # log above values WSO2StartupHandler.log.info("Port Mappings: %s" % port_mappings_str) WSO2StartupHandler.log.info("Application ID: %s" % app_id) WSO2StartupHandler.log.info("MB IP: %s" % mb_ip) WSO2StartupHandler.log.info("Service Name: %s" % service_type) WSO2StartupHandler.log.info("Cluster ID: %s" % my_cluster_id) WSO2StartupHandler.log.info("Clustering: %s" % clustering) WSO2StartupHandler.log.info("Membership Scheme: %s" % membership_scheme) WSO2StartupHandler.log.info("Profile: %s" % profile) WSO2StartupHandler.log.info("LB IP: %s" % lb_ip) # export Proxy Ports as Env. variables - used in catalina-server.xml mgt_http_proxy_port = self.read_proxy_port(port_mappings_str, self.CONST_PORT_MAPPING_MGT_HTTP_TRANSPORT, self.CONST_PROTOCOL_HTTP) mgt_https_proxy_port = self.read_proxy_port(port_mappings_str, self.CONST_PORT_MAPPING_MGT_HTTPS_TRANSPORT, self.CONST_PROTOCOL_HTTPS) self.export_env_var(self.ENV_CONFIG_PARAM_HTTP_PROXY_PORT, mgt_http_proxy_port) self.export_env_var(self.ENV_CONFIG_PARAM_HTTPS_PROXY_PORT, mgt_https_proxy_port) if profile == self.CONST_PROFILE_KEY_MANAGER: # this is for key_manager profile to support IS for API Manager # remove previous data from metadata service # add new values to meta data service - key manager ip and mgt-console port # retrieve values from meta data service - gateway ip, gw mgt console port, pt http and https ports # check deployment is vm, if vm update /etc/hosts with values # export retrieve values as environment variables # set the start command self.remove_data_from_metadata(self.ENV_CONFIG_PARAM_KEYMANAGER_IP) self.remove_data_from_metadata(self.CONST_CONFIG_PARAM_KEYMANAGER_PORTS) self.remove_data_from_metadata(self.CONST_KM_SERVICE_NAME) self.add_data_to_meta_data_service(self.ENV_CONFIG_PARAM_KEYMANAGER_IP, lb_ip) self.add_data_to_meta_data_service(self.CONST_CONFIG_PARAM_KEYMANAGER_PORTS, "Ports:" + mgt_https_proxy_port) self.add_data_to_meta_data_service(self.CONST_KM_SERVICE_NAME, service_type) gateway_ip = self.get_data_from_meta_data_service(app_id, self.ENV_CONFIG_PARAM_GATEWAY_IP) gateway_ports = self.get_data_from_meta_data_service(app_id, self.CONST_CONFIG_PARAM_GATEWAY_PORTS) gateway_worker_ip = self.get_data_from_meta_data_service(app_id, self.ENV_CONFIG_PARAM_GATEWAY_WORKER_IP) gateway_worker_ports = self.get_data_from_meta_data_service(app_id, self.CONST_CONFIG_PARAM_GATEWAY_WORKER_PORTS) environment_type = self.find_environment_type(external_lb, service_type, app_id) if environment_type == WSO2StartupHandler.CONST_KUBERNETES: gateway_host = gateway_ip gateway_worker_host = gateway_worker_ip else: gateway_host_name = self.get_host_name_from_cluster(self.CONST_GATEWAY_MANAGER_SERVICE_NAME, app_id) gateway_worker_host_name = self.get_host_name_from_cluster(self.CONST_GATEWAY_WORKER_SERVICE_NAME, app_id) gateway_host = gateway_host_name gateway_worker_host = gateway_worker_host_name self.update_hosts_file(gateway_ip, gateway_host_name) self.update_hosts_file(gateway_worker_ip, gateway_worker_host_name) member_ip = socket.gethostbyname(socket.gethostname()) self.set_host_name(app_id, service_type, member_ip) self.export_env_var(self.ENV_CONFIG_PARAM_GATEWAY_IP, gateway_host) self.set_gateway_ports(gateway_ports) self.export_env_var(self.ENV_CONFIG_PARAM_GATEWAY_WORKER_IP, gateway_worker_host) self.set_gateway_worker_ports(gateway_worker_ports) # set sub-domain sub_domain = None if service_type.endswith(self.CONST_MANAGER): sub_domain = self.CONST_MGT elif service_type.endswith(self.CONST_WORKER): sub_domain = self.CONST_WORKER self.export_env_var(self.ENV_CONFIG_PARAM_SUB_DOMAIN, sub_domain) # if CONFIG_PARAM_MEMBERSHIP_SCHEME is not set, set the private-paas membership scheme as default one if clustering == 'true' and membership_scheme is None: membership_scheme = self.CONST_PPAAS_MEMBERSHIP_SCHEME self.export_env_var(self.ENV_CONFIG_PARAM_MEMBERSHIP_SCHEME, membership_scheme) # check if clustering is enabled if clustering == 'true': # set hostnames self.export_host_names(topology, app_id) # check if membership scheme is set to 'private-paas' if membership_scheme == self.CONST_PPAAS_MEMBERSHIP_SCHEME: # export Cluster_Ids as Env. variables - used in axis2.xml self.export_cluster_ids(topology, app_id, service_type, my_cluster_id) # export mb_ip as Env.variable - used in jndi.properties self.export_env_var(self.ENV_CONFIG_PARAM_MB_HOST, mb_ip) # set instance private ip as CONFIG_PARAM_LOCAL_MEMBER_HOST private_ip = self.get_member_private_ip(topology, Config.service_name, Config.cluster_id, Config.member_id) self.export_env_var(self.ENV_CONFIG_PARAM_LOCAL_MEMBER_HOST, private_ip) # start configurator WSO2StartupHandler.log.info("Configuring WSO2 %s..." % self.CONST_PRODUCT) config_command = "python ${CONFIGURATOR_HOME}/configurator.py" env_var = os.environ.copy() p = subprocess.Popen(config_command, env=env_var, shell=True) output, errors = p.communicate() WSO2StartupHandler.log.info("WSO2 %s configured successfully" % self.CONST_PRODUCT) # start server WSO2StartupHandler.log.info("Starting WSO2 %s ..." % self.CONST_PRODUCT) if service_type.endswith(self.CONST_WORKER): start_command = "exec ${CARBON_HOME}/bin/wso2server.sh -DworkerNode=true start" else: start_command = "exec ${CARBON_HOME}/bin/wso2server.sh -Dsetup start" env_var = os.environ.copy() p = subprocess.Popen(start_command, env=env_var, shell=True) output, errors = p.communicate() WSO2StartupHandler.log.info("WSO2 %s started successfully" % self.CONST_PRODUCT) def get_member_private_ip(self, topology, service_name, cluster_id, member_id): service = topology.get_service(service_name) if service is None: raise Exception("Service not found in topology [service] %s" % service_name) cluster = service.get_cluster(cluster_id) if cluster is None: raise Exception("Cluster id not found in topology [cluster] %s" % cluster_id) member = cluster.get_member(member_id) if member is None: raise Exception("Member id not found in topology [member] %s" % member_id) if member.member_default_private_ip and not member.member_default_private_ip.isspace(): WSO2StartupHandler.log.info( "Member private ip read from the topology: %s" % member.member_default_private_ip) return member.member_default_private_ip else: local_ip = socket.gethostbyname(socket.gethostname()) WSO2StartupHandler.log.info( "Member private ip not found in the topology. Reading from the socket interface: %s" % local_ip) return local_ip def set_gateway_worker_ports(self, gateway_worker_ports): """ Expose gateway worker ports :return: void """ gateway_pt_http_pp = None gateway_pt_https_pp = None if gateway_worker_ports is not None: gateway_wk_ports_array = gateway_worker_ports.split(":") if gateway_wk_ports_array: gateway_pt_http_pp = gateway_wk_ports_array[1] gateway_pt_https_pp = gateway_wk_ports_array[2] self.export_env_var(self.ENV_CONFIG_PARAM_GATEWAY_WORKER_PT_HTTP_PROXY_PORT, str(gateway_pt_http_pp)) self.export_env_var(self.ENV_CONFIG_PARAM_GATEWAY_WORKER_PT_HTTPS_PROXY_PORT, str(gateway_pt_https_pp)) def set_gateway_ports(self, gateway_ports): """ Expose gateway ports Input- Ports:30003 :return: void """ gateway_mgt_https_pp = None if gateway_ports is not None: gateway_ports_array = gateway_ports.split(":") if gateway_ports_array: gateway_mgt_https_pp = gateway_ports_array[1] self.export_env_var(self.ENV_CONFIG_PARAM_GATEWAY_HTTPS_PROXY_PORT, str(gateway_mgt_https_pp)) def set_host_name(self, app_id, service_name, member_ip): """ Set hostname of service read from topology for any service name export hostname and update the /etc/hosts :return: void """ host_name = self.get_host_name_from_cluster(service_name, app_id) self.export_env_var(self.ENV_CONFIG_PARAM_HOST_NAME, host_name) self.update_hosts_file(member_ip, host_name) def update_hosts_file(self, ip_address, host_name): """ Updates /etc/hosts file with clustering hostnames :return: void """ config_command = "echo %s %s >> /etc/hosts" % (ip_address, host_name) env_var = os.environ.copy() p = subprocess.Popen(config_command, env=env_var, shell=True) output, errors = p.communicate() WSO2StartupHandler.log.info( "Successfully updated [ip_address] %s & [hostname] %s in etc/hosts" % (ip_address, host_name)) def get_host_name_from_cluster(self, service_name, app_id): """ Get hostname for a service :return: hostname """ clusters = self.get_clusters_from_topology(service_name) if clusters is not None: for cluster in clusters: if cluster.app_id == app_id: hostname = cluster.hostnames[0] return hostname def find_environment_type(self, external_lb, service_name, app_id): """ Check for vm or kubernetes :return: Vm or Kubernetes """ if external_lb == 'true': return WSO2StartupHandler.CONST_EXTERNAL_LB_FOR_KUBERNETES else: isKubernetes = self.check_for_kubernetes_cluster(service_name, app_id) if isKubernetes: return WSO2StartupHandler.CONST_KUBERNETES else: return WSO2StartupHandler.CONST_VM def get_clusters_from_topology(self, service_name): """ get clusters from topology :return: clusters """ clusters = None topology = TopologyContext().get_topology() if topology is not None: if topology.service_exists(service_name): service = topology.get_service(service_name) clusters = service.get_clusters() else: WSO2StartupHandler.log.error("[Service] %s is not available in topology" % service_name) return clusters def check_for_kubernetes_cluster(self, service_name, app_id): """ Check the deployment is kubernetes :return: True """ isKubernetes = False clusters = self.get_clusters_from_topology(service_name) if clusters is not None: for cluster in clusters: if cluster.app_id == app_id: isKubernetes = cluster.is_kubernetes_cluster return isKubernetes def get_data_from_meta_data_service(self, app_id, receive_data): """ Get data from meta data service :return: received data """ mds_response = None while mds_response is None: WSO2StartupHandler.log.info( "Waiting for " + receive_data + " to be available from metadata service for app ID: %s" % app_id) time.sleep(1) mds_response = mdsclient.get(app=True) if mds_response is not None and mds_response.properties.get(receive_data) is None: mds_response = None return mds_response.properties[receive_data] def add_data_to_meta_data_service(self, key, value): """ add data to meta data service :return: void """ mdsclient.MDSPutRequest() data = {"key": key, "values": [value]} mdsclient.put(data, app=True) def remove_data_from_metadata(self, key): """ remove data from meta data service :return: void """ mds_response = mdsclient.get(app=True) if mds_response is not None and mds_response.properties.get(key) is not None: read_data = mds_response.properties[key] check_str = isinstance(read_data, (str, unicode)) if check_str == True: mdsclient.delete_property_value(key, read_data) else: check_int = isinstance(read_data, int) if check_int == True: mdsclient.delete_property_value(key, read_data) else: for entry in read_data: mdsclient.delete_property_value(key, entry) def export_host_names(self, topology, app_id): """ Set hostnames of services read from topology for worker manager instances exports MgtHostName and HostName :return: void """ mgt_host_name = None host_name = None for service_name in self.SERVICES: if service_name.endswith(self.CONST_MANAGER): mgr_cluster = self.get_cluster_of_service(topology, service_name, app_id) if mgr_cluster is not None: mgt_host_name = mgr_cluster.hostnames[0] elif service_name.endswith(self.CONST_WORKER): worker_cluster = self.get_cluster_of_service(topology, service_name, app_id) if worker_cluster is not None: host_name = worker_cluster.hostnames[0] self.export_env_var(self.ENV_CONFIG_PARAM_MGT_HOST_NAME, mgt_host_name) self.export_env_var(self.ENV_CONFIG_PARAM_HOST_NAME, host_name) def export_cluster_ids(self, topology, app_id, service_type, my_cluster_id): """ Set clusterIds of services read from topology for worker manager instances else use own clusterId :return: void """ cluster_ids = [] cluster_id_of_service = None if service_type.endswith(self.CONST_MANAGER) or service_type.endswith(self.CONST_WORKER): for service_name in self.SERVICES: cluster_of_service = self.get_cluster_of_service(topology, service_name, app_id) if cluster_of_service is not None: cluster_id_of_service = cluster_of_service.cluster_id if cluster_id_of_service is not None: cluster_ids.append(cluster_id_of_service) else: cluster_ids.append(my_cluster_id) # If clusterIds are available, export them as environment variables if cluster_ids: cluster_ids_string = ",".join(cluster_ids) self.export_env_var(self.ENV_CONFIG_PARAM_CLUSTER_IDs, cluster_ids_string) @staticmethod def get_cluster_of_service(topology, service_name, app_id): cluster_obj = None clusters = None if topology is not None: if topology.service_exists(service_name): service = topology.get_service(service_name) if service is not None: clusters = service.get_clusters() else: WSO2StartupHandler.log.warn("[Service] %s is None" % service_name) else: WSO2StartupHandler.log.warn("[Service] %s is not available in topology" % service_name) else: WSO2StartupHandler.log.warn("Topology is empty.") if clusters is not None: for cluster in clusters: if cluster.app_id == app_id: cluster_obj = cluster return cluster_obj @staticmethod def read_proxy_port(port_mappings_str, port_mapping_name, port_mapping_protocol): """ returns proxy port of the requested port mapping :return: void """ # port mappings format: NAME:mgt-http|PROTOCOL:http|PORT:30001|PROXY_PORT:0|TYPE:NodePort; # NAME:mgt-https|PROTOCOL:https|PORT:30002|PROXY_PORT:0|TYPE:NodePort; # NAME:pt-http|PROTOCOL:http|PORT:30003|PROXY_PORT:7280|TYPE:ClientIP; # NAME:pt-https|PROTOCOL:https|PORT:30004|PROXY_PORT:7243|TYPE:NodePort if port_mappings_str is not None: port_mappings_array = port_mappings_str.split(";") if port_mappings_array: for port_mapping in port_mappings_array: # WSO2StartupHandler.log.debug("port_mapping: %s" % port_mapping) name_value_array = port_mapping.split("|") name = name_value_array[0].split(":")[1] protocol = name_value_array[1].split(":")[1] proxy_port = name_value_array[3].split(":")[1] # If PROXY_PORT is not set, set PORT as the proxy port (ex:Kubernetes), if proxy_port == '0': proxy_port = name_value_array[2].split(":")[1] if name == port_mapping_name and protocol == port_mapping_protocol: return proxy_port @staticmethod def export_env_var(variable, value): """ exports key value pairs as env. variables :return: void """ if value is not None: os.environ[variable] = value WSO2StartupHandler.log.info("Exported environment variable %s: %s" % (variable, value)) else: WSO2StartupHandler.log.warn("Could not export environment variable %s " % variable)
apache-2.0
hoangt/tpzsimul.gem5
tests/configs/alpha_generic.py
48
4110
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality of the software # licensed hereunder. You may use the software subject to the license # terms below provided that you ensure that this notice is replicated # unmodified and in its entirety in all distributions of the software, # modified or unmodified, in source code or in binary form. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer; # redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution; # neither the name of the copyright holders nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Authors: Andreas Sandberg from abc import ABCMeta, abstractmethod import m5 from m5.objects import * from m5.proxy import * m5.util.addToPath('../configs/common') import FSConfig from Caches import * from base_config import * class LinuxAlphaSystemBuilder(object): """Mix-in that implements create_system. This mix-in is intended as a convenient way of adding an Alpha-specific create_system method to a class deriving from one of the generic base systems. """ def __init__(self): """ Arguments: machine_type -- String describing the platform to simulate """ pass def create_system(self): system = FSConfig.makeLinuxAlphaSystem(self.mem_mode) self.init_system(system) return system class LinuxAlphaFSSystem(LinuxAlphaSystemBuilder, BaseFSSystem): """Basic Alpha full system builder.""" def __init__(self, **kwargs): """Initialize an Alpha system that supports full system simulation. Note: Keyword arguments that are not listed below will be passed to the BaseFSSystem. Keyword Arguments: - """ BaseSystem.__init__(self, **kwargs) LinuxAlphaSystemBuilder.__init__(self) class LinuxAlphaFSSystemUniprocessor(LinuxAlphaSystemBuilder, BaseFSSystemUniprocessor): """Basic Alpha full system builder for uniprocessor systems. Note: This class is a specialization of the AlphaFSSystem and is only really needed to provide backwards compatibility for existing test cases. """ def __init__(self, **kwargs): BaseFSSystemUniprocessor.__init__(self, **kwargs) LinuxAlphaSystemBuilder.__init__(self) class LinuxAlphaFSSwitcheroo(LinuxAlphaSystemBuilder, BaseFSSwitcheroo): """Uniprocessor Alpha system prepared for CPU switching""" def __init__(self, **kwargs): BaseFSSwitcheroo.__init__(self, **kwargs) LinuxAlphaSystemBuilder.__init__(self)
bsd-3-clause
tersmitten/ansible
lib/ansible/cli/playbook.py
14
8765
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import stat from ansible import context from ansible.cli import CLI from ansible.cli.arguments import option_helpers as opt_help from ansible.errors import AnsibleError from ansible.executor.playbook_executor import PlaybookExecutor from ansible.module_utils._text import to_bytes from ansible.playbook.block import Block from ansible.utils.display import Display from ansible.utils.collection_loader import set_collection_playbook_paths from ansible.plugins.loader import add_all_plugin_dirs display = Display() class PlaybookCLI(CLI): ''' the tool to run *Ansible playbooks*, which are a configuration and multinode deployment system. See the project home page (https://docs.ansible.com) for more information. ''' def init_parser(self): # create parser for CLI options super(PlaybookCLI, self).init_parser( usage="%prog [options] playbook.yml [playbook2 ...]", desc="Runs Ansible playbooks, executing the defined tasks on the targeted hosts.") opt_help.add_connect_options(self.parser) opt_help.add_meta_options(self.parser) opt_help.add_runas_options(self.parser) opt_help.add_subset_options(self.parser) opt_help.add_check_options(self.parser) opt_help.add_inventory_options(self.parser) opt_help.add_runtask_options(self.parser) opt_help.add_vault_options(self.parser) opt_help.add_fork_options(self.parser) opt_help.add_module_options(self.parser) # ansible playbook specific opts self.parser.add_argument('--list-tasks', dest='listtasks', action='store_true', help="list all tasks that would be executed") self.parser.add_argument('--list-tags', dest='listtags', action='store_true', help="list all available tags") self.parser.add_argument('--step', dest='step', action='store_true', help="one-step-at-a-time: confirm each task before running") self.parser.add_argument('--start-at-task', dest='start_at_task', help="start the playbook at the task matching this name") self.parser.add_argument('args', help='Playbook(s)', metavar='playbook', nargs='+') def post_process_args(self, options): options = super(PlaybookCLI, self).post_process_args(options) display.verbosity = options.verbosity self.validate_conflicts(options, runas_opts=True, fork_opts=True) return options def run(self): super(PlaybookCLI, self).run() # Note: slightly wrong, this is written so that implicit localhost # manages passwords sshpass = None becomepass = None passwords = {} # initial error check, to make sure all specified playbooks are accessible # before we start running anything through the playbook executor b_playbook_dirs = [] for playbook in context.CLIARGS['args']: if not os.path.exists(playbook): raise AnsibleError("the playbook: %s could not be found" % playbook) if not (os.path.isfile(playbook) or stat.S_ISFIFO(os.stat(playbook).st_mode)): raise AnsibleError("the playbook: %s does not appear to be a file" % playbook) b_playbook_dir = os.path.dirname(os.path.abspath(to_bytes(playbook, errors='surrogate_or_strict'))) # load plugins from all playbooks in case they add callbacks/inventory/etc add_all_plugin_dirs(b_playbook_dir) b_playbook_dirs.append(b_playbook_dir) set_collection_playbook_paths(b_playbook_dirs) # don't deal with privilege escalation or passwords when we don't need to if not (context.CLIARGS['listhosts'] or context.CLIARGS['listtasks'] or context.CLIARGS['listtags'] or context.CLIARGS['syntax']): (sshpass, becomepass) = self.ask_passwords() passwords = {'conn_pass': sshpass, 'become_pass': becomepass} # create base objects loader, inventory, variable_manager = self._play_prereqs() # (which is not returned in list_hosts()) is taken into account for # warning if inventory is empty. But it can't be taken into account for # checking if limit doesn't match any hosts. Instead we don't worry about # limit if only implicit localhost was in inventory to start with. # # Fix this when we rewrite inventory by making localhost a real host (and thus show up in list_hosts()) CLI.get_host_list(inventory, context.CLIARGS['subset']) # flush fact cache if requested if context.CLIARGS['flush_cache']: self._flush_cache(inventory, variable_manager) # create the playbook executor, which manages running the plays via a task queue manager pbex = PlaybookExecutor(playbooks=context.CLIARGS['args'], inventory=inventory, variable_manager=variable_manager, loader=loader, passwords=passwords) results = pbex.run() if isinstance(results, list): for p in results: display.display('\nplaybook: %s' % p['playbook']) for idx, play in enumerate(p['plays']): if play._included_path is not None: loader.set_basedir(play._included_path) else: pb_dir = os.path.realpath(os.path.dirname(p['playbook'])) loader.set_basedir(pb_dir) msg = "\n play #%d (%s): %s" % (idx + 1, ','.join(play.hosts), play.name) mytags = set(play.tags) msg += '\tTAGS: [%s]' % (','.join(mytags)) if context.CLIARGS['listhosts']: playhosts = set(inventory.get_hosts(play.hosts)) msg += "\n pattern: %s\n hosts (%d):" % (play.hosts, len(playhosts)) for host in playhosts: msg += "\n %s" % host display.display(msg) all_tags = set() if context.CLIARGS['listtags'] or context.CLIARGS['listtasks']: taskmsg = '' if context.CLIARGS['listtasks']: taskmsg = ' tasks:\n' def _process_block(b): taskmsg = '' for task in b.block: if isinstance(task, Block): taskmsg += _process_block(task) else: if task.action == 'meta': continue all_tags.update(task.tags) if context.CLIARGS['listtasks']: cur_tags = list(mytags.union(set(task.tags))) cur_tags.sort() if task.name: taskmsg += " %s" % task.get_name() else: taskmsg += " %s" % task.action taskmsg += "\tTAGS: [%s]\n" % ', '.join(cur_tags) return taskmsg all_vars = variable_manager.get_vars(play=play) for block in play.compile(): block = block.filter_tagged_tasks(all_vars) if not block.has_tasks(): continue taskmsg += _process_block(block) if context.CLIARGS['listtags']: cur_tags = list(mytags.union(all_tags)) cur_tags.sort() taskmsg += " TASK TAGS: [%s]\n" % ', '.join(cur_tags) display.display(taskmsg) return 0 else: return results @staticmethod def _flush_cache(inventory, variable_manager): for host in inventory.list_hosts(): hostname = host.get_name() variable_manager.clear_facts(hostname)
gpl-3.0
e0ne/cinder
cinder/api/contrib/used_limits.py
16
2132
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from cinder.api import extensions from cinder.api.openstack import wsgi from cinder import quota QUOTAS = quota.QUOTAS authorize = extensions.extension_authorizer('limits', 'used_limits') class UsedLimitsController(wsgi.Controller): @wsgi.extends def index(self, req, resp_obj): context = req.environ['cinder.context'] authorize(context) quotas = QUOTAS.get_project_quotas(context, context.project_id, usages=True) quota_map = { 'totalVolumesUsed': 'volumes', 'totalGigabytesUsed': 'gigabytes', 'totalSnapshotsUsed': 'snapshots', 'totalBackupsUsed': 'backups', 'totalBackupGigabytesUsed': 'backup_gigabytes' } used_limits = {} for display_name, single_quota in quota_map.iteritems(): if single_quota in quotas: used_limits[display_name] = quotas[single_quota]['in_use'] resp_obj.obj['limits']['absolute'].update(used_limits) class Used_limits(extensions.ExtensionDescriptor): """Provide data on limited resources that are being used.""" name = "UsedLimits" alias = 'os-used-limits' namespace = "http://docs.openstack.org/volume/ext/used-limits/api/v1.1" updated = "2013-10-03T00:00:00+00:00" def get_controller_extensions(self): controller = UsedLimitsController() extension = extensions.ControllerExtension(self, 'limits', controller) return [extension]
apache-2.0
cuilishen/cuilishenMissionPlanner
Lib/codeop.py
306
5999
r"""Utilities to compile possibly incomplete Python source code. This module provides two interfaces, broadly similar to the builtin function compile(), which take program text, a filename and a 'mode' and: - Return code object if the command is complete and valid - Return None if the command is incomplete - Raise SyntaxError, ValueError or OverflowError if the command is a syntax error (OverflowError and ValueError can be produced by malformed literals). Approach: First, check if the source consists entirely of blank lines and comments; if so, replace it with 'pass', because the built-in parser doesn't always do the right thing for these. Compile three times: as is, with \n, and with \n\n appended. If it compiles as is, it's complete. If it compiles with one \n appended, we expect more. If it doesn't compile either way, we compare the error we get when compiling with \n or \n\n appended. If the errors are the same, the code is broken. But if the errors are different, we expect more. Not intuitive; not even guaranteed to hold in future releases; but this matches the compiler's behavior from Python 1.4 through 2.2, at least. Caveat: It is possible (but not likely) that the parser stops parsing with a successful outcome before reaching the end of the source; in this case, trailing symbols may be ignored instead of causing an error. For example, a backslash followed by two newlines may be followed by arbitrary garbage. This will be fixed once the API for the parser is better. The two interfaces are: compile_command(source, filename, symbol): Compiles a single command in the manner described above. CommandCompiler(): Instances of this class have __call__ methods identical in signature to compile_command; the difference is that if the instance compiles program text containing a __future__ statement, the instance 'remembers' and compiles all subsequent program texts with the statement in force. The module also provides another class: Compile(): Instances of this class act like the built-in function compile, but with 'memory' in the sense described above. """ import __future__ _features = [getattr(__future__, fname) for fname in __future__.all_feature_names] __all__ = ["compile_command", "Compile", "CommandCompiler"] PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h def _maybe_compile(compiler, source, filename, symbol): # Check for source consisting of only blank lines and comments for line in source.split("\n"): line = line.strip() if line and line[0] != '#': break # Leave it alone else: if symbol != "eval": source = "pass" # Replace it with a 'pass' statement err = err1 = err2 = None code = code1 = code2 = None try: code = compiler(source, filename, symbol) except SyntaxError, err: pass try: code1 = compiler(source + "\n", filename, symbol) except SyntaxError, err1: pass try: code2 = compiler(source + "\n\n", filename, symbol) except SyntaxError, err2: pass if code: return code if not code1 and repr(err1) == repr(err2): raise SyntaxError, err1 def _compile(source, filename, symbol): return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) def compile_command(source, filename="<input>", symbol="single"): r"""Compile a command and determine whether it is incomplete. Arguments: source -- the source string; may contain \n characters filename -- optional filename from which source was read; default "<input>" symbol -- optional grammar start symbol; "single" (default) or "eval" Return value / exceptions raised: - Return a code object if the command is complete and valid - Return None if the command is incomplete - Raise SyntaxError, ValueError or OverflowError if the command is a syntax error (OverflowError and ValueError can be produced by malformed literals). """ return _maybe_compile(_compile, source, filename, symbol) class Compile: """Instances of this class behave much like the built-in compile function, but if one is used to compile text containing a future statement, it "remembers" and compiles all subsequent program texts with the statement in force.""" def __init__(self): self.flags = PyCF_DONT_IMPLY_DEDENT def __call__(self, source, filename, symbol): codeob = compile(source, filename, symbol, self.flags, 1) for feature in _features: if codeob.co_flags & feature.compiler_flag: self.flags |= feature.compiler_flag return codeob class CommandCompiler: """Instances of this class have __call__ methods identical in signature to compile_command; the difference is that if the instance compiles program text containing a __future__ statement, the instance 'remembers' and compiles all subsequent program texts with the statement in force.""" def __init__(self,): self.compiler = Compile() def __call__(self, source, filename="<input>", symbol="single"): r"""Compile a command and determine whether it is incomplete. Arguments: source -- the source string; may contain \n characters filename -- optional filename from which source was read; default "<input>" symbol -- optional grammar start symbol; "single" (default) or "eval" Return value / exceptions raised: - Return a code object if the command is complete and valid - Return None if the command is incomplete - Raise SyntaxError, ValueError or OverflowError if the command is a syntax error (OverflowError and ValueError can be produced by malformed literals). """ return _maybe_compile(self.compiler, source, filename, symbol)
gpl-3.0
Maximilian-Reuter/SickRage
lib/hachoir_parser/network/ouid.py
186
385658
# -*- coding: utf-8 -*- """ List of registered IEEE 24-bit Organizationally Unique IDentifiers. Original data file: http://standards.ieee.org/regauth/oui/oui.txt """ REGISTERED_OUID = { 0x000000: u'XEROX CORPORATION', 0x000001: u'XEROX CORPORATION', 0x000002: u'XEROX CORPORATION', 0x000003: u'XEROX CORPORATION', 0x000004: u'XEROX CORPORATION', 0x000005: u'XEROX CORPORATION', 0x000006: u'XEROX CORPORATION', 0x000007: u'XEROX CORPORATION', 0x000008: u'XEROX CORPORATION', 0x000009: u'XEROX CORPORATION', 0x00000A: u'OMRON TATEISI ELECTRONICS CO.', 0x00000B: u'MATRIX CORPORATION', 0x00000C: u'CISCO SYSTEMS, INC.', 0x00000D: u'FIBRONICS LTD.', 0x00000E: u'FUJITSU LIMITED', 0x00000F: u'NEXT, INC.', 0x000010: u'SYTEK INC.', 0x000011: u'NORMEREL SYSTEMES', 0x000012: u'INFORMATION TECHNOLOGY LIMITED', 0x000013: u'CAMEX', 0x000014: u'NETRONIX', 0x000015: u'DATAPOINT CORPORATION', 0x000016: u'DU PONT PIXEL SYSTEMS.', 0x000017: u'TEKELEC', 0x000018: u'WEBSTER COMPUTER CORPORATION', 0x000019: u'APPLIED DYNAMICS INTERNATIONAL', 0x00001A: u'ADVANCED MICRO DEVICES', 0x00001B: u'NOVELL INC.', 0x00001C: u'BELL TECHNOLOGIES', 0x00001D: u'CABLETRON SYSTEMS, INC.', 0x00001E: u'TELSIST INDUSTRIA ELECTRONICA', 0x00001F: u'Telco Systems, Inc.', 0x000020: u'DATAINDUSTRIER DIAB AB', 0x000021: u'SUREMAN COMP. & COMMUN. CORP.', 0x000022: u'VISUAL TECHNOLOGY INC.', 0x000023: u'ABB INDUSTRIAL SYSTEMS AB', 0x000024: u'CONNECT AS', 0x000025: u'RAMTEK CORP.', 0x000026: u'SHA-KEN CO., LTD.', 0x000027: u'JAPAN RADIO COMPANY', 0x000028: u'PRODIGY SYSTEMS CORPORATION', 0x000029: u'IMC NETWORKS CORP.', 0x00002A: u'TRW - SEDD/INP', 0x00002B: u'CRISP AUTOMATION, INC', 0x00002C: u'AUTOTOTE LIMITED', 0x00002D: u'CHROMATICS INC', 0x00002E: u'SOCIETE EVIRA', 0x00002F: u'TIMEPLEX INC.', 0x000030: u'VG LABORATORY SYSTEMS LTD', 0x000031: u'QPSX COMMUNICATIONS PTY LTD', 0x000032: u'Marconi plc', 0x000033: u'EGAN MACHINERY COMPANY', 0x000034: u'NETWORK RESOURCES CORPORATION', 0x000035: u'SPECTRAGRAPHICS CORPORATION', 0x000036: u'ATARI CORPORATION', 0x000037: u'OXFORD METRICS LIMITED', 0x000038: u'CSS LABS', 0x000039: u'TOSHIBA CORPORATION', 0x00003A: u'CHYRON CORPORATION', 0x00003B: u'i Controls, Inc.', 0x00003C: u'AUSPEX SYSTEMS INC.', 0x00003D: u'UNISYS', 0x00003E: u'SIMPACT', 0x00003F: u'SYNTREX, INC.', 0x000040: u'APPLICON, INC.', 0x000041: u'ICE CORPORATION', 0x000042: u'METIER MANAGEMENT SYSTEMS LTD.', 0x000043: u'MICRO TECHNOLOGY', 0x000044: u'CASTELLE CORPORATION', 0x000045: u'FORD AEROSPACE & COMM. CORP.', 0x000046: u'OLIVETTI NORTH AMERICA', 0x000047: u'NICOLET INSTRUMENTS CORP.', 0x000048: u'SEIKO EPSON CORPORATION', 0x000049: u'APRICOT COMPUTERS, LTD', 0x00004A: u'ADC CODENOLL TECHNOLOGY CORP.', 0x00004B: u'ICL DATA OY', 0x00004C: u'NEC CORPORATION', 0x00004D: u'DCI CORPORATION', 0x00004E: u'AMPEX CORPORATION', 0x00004F: u'LOGICRAFT, INC.', 0x000050: u'RADISYS CORPORATION', 0x000051: u'HOB ELECTRONIC GMBH & CO. KG', 0x000052: u'Intrusion.com, Inc.', 0x000053: u'COMPUCORP', 0x000054: u'MODICON, INC.', 0x000055: u'COMMISSARIAT A L`ENERGIE ATOM.', 0x000056: u'DR. B. STRUCK', 0x000057: u'SCITEX CORPORATION LTD.', 0x000058: u'RACORE COMPUTER PRODUCTS INC.', 0x000059: u'HELLIGE GMBH', 0x00005A: u'SysKonnect GmbH', 0x00005B: u'ELTEC ELEKTRONIK AG', 0x00005C: u'TELEMATICS INTERNATIONAL INC.', 0x00005D: u'CS TELECOM', 0x00005E: u'USC INFORMATION SCIENCES INST', 0x00005F: u'SUMITOMO ELECTRIC IND., LTD.', 0x000060: u'KONTRON ELEKTRONIK GMBH', 0x000061: u'GATEWAY COMMUNICATIONS', 0x000062: u'BULL HN INFORMATION SYSTEMS', 0x000063: u'BARCO CONTROL ROOMS GMBH', 0x000064: u'YOKOGAWA DIGITAL COMPUTER CORP', 0x000065: u'Network General Corporation', 0x000066: u'TALARIS SYSTEMS, INC.', 0x000067: u'SOFT * RITE, INC.', 0x000068: u'ROSEMOUNT CONTROLS', 0x000069: u'CONCORD COMMUNICATIONS INC', 0x00006A: u'COMPUTER CONSOLES INC.', 0x00006B: u'SILICON GRAPHICS INC./MIPS', 0x00006C: u'PRIVATE', 0x00006D: u'CRAY COMMUNICATIONS, LTD.', 0x00006E: u'ARTISOFT, INC.', 0x00006F: u'Madge Ltd.', 0x000070: u'HCL LIMITED', 0x000071: u'ADRA SYSTEMS INC.', 0x000072: u'MINIWARE TECHNOLOGY', 0x000073: u'SIECOR CORPORATION', 0x000074: u'RICOH COMPANY LTD.', 0x000075: u'Nortel Networks', 0x000076: u'ABEKAS VIDEO SYSTEM', 0x000077: u'INTERPHASE CORPORATION', 0x000078: u'LABTAM LIMITED', 0x000079: u'NETWORTH INCORPORATED', 0x00007A: u'DANA COMPUTER INC.', 0x00007B: u'RESEARCH MACHINES', 0x00007C: u'AMPERE INCORPORATED', 0x00007D: u'SUN MICROSYSTEMS, INC.', 0x00007E: u'CLUSTRIX CORPORATION', 0x00007F: u'LINOTYPE-HELL AG', 0x000080: u'CRAY COMMUNICATIONS A/S', 0x000081: u'BAY NETWORKS', 0x000082: u'LECTRA SYSTEMES SA', 0x000083: u'TADPOLE TECHNOLOGY PLC', 0x000084: u'SUPERNET', 0x000085: u'CANON INC.', 0x000086: u'MEGAHERTZ CORPORATION', 0x000087: u'HITACHI, LTD.', 0x000088: u'COMPUTER NETWORK TECH. CORP.', 0x000089: u'CAYMAN SYSTEMS INC.', 0x00008A: u'DATAHOUSE INFORMATION SYSTEMS', 0x00008B: u'INFOTRON', 0x00008C: u'Alloy Computer Products (Australia) Pty Ltd', 0x00008D: u'VERDIX CORPORATION', 0x00008E: u'SOLBOURNE COMPUTER, INC.', 0x00008F: u'RAYTHEON COMPANY', 0x000090: u'MICROCOM', 0x000091: u'ANRITSU CORPORATION', 0x000092: u'COGENT DATA TECHNOLOGIES', 0x000093: u'PROTEON INC.', 0x000094: u'ASANTE TECHNOLOGIES', 0x000095: u'SONY TEKTRONIX CORP.', 0x000096: u'MARCONI ELECTRONICS LTD.', 0x000097: u'EPOCH SYSTEMS', 0x000098: u'CROSSCOMM CORPORATION', 0x000099: u'MTX, INC.', 0x00009A: u'RC COMPUTER A/S', 0x00009B: u'INFORMATION INTERNATIONAL, INC', 0x00009C: u'ROLM MIL-SPEC COMPUTERS', 0x00009D: u'LOCUS COMPUTING CORPORATION', 0x00009E: u'MARLI S.A.', 0x00009F: u'AMERISTAR TECHNOLOGIES INC.', 0x0000A0: u'SANYO Electric Co., Ltd.', 0x0000A1: u'MARQUETTE ELECTRIC CO.', 0x0000A2: u'BAY NETWORKS', 0x0000A3: u'NETWORK APPLICATION TECHNOLOGY', 0x0000A4: u'ACORN COMPUTERS LIMITED', 0x0000A5: u'COMPATIBLE SYSTEMS CORP.', 0x0000A6: u'NETWORK GENERAL CORPORATION', 0x0000A7: u'NETWORK COMPUTING DEVICES INC.', 0x0000A8: u'STRATUS COMPUTER INC.', 0x0000A9: u'NETWORK SYSTEMS CORP.', 0x0000AA: u'XEROX CORPORATION', 0x0000AB: u'LOGIC MODELING CORPORATION', 0x0000AC: u'CONWARE COMPUTER CONSULTING', 0x0000AD: u'BRUKER INSTRUMENTS INC.', 0x0000AE: u'DASSAULT ELECTRONIQUE', 0x0000AF: u'NUCLEAR DATA INSTRUMENTATION', 0x0000B0: u'RND-RAD NETWORK DEVICES', 0x0000B1: u'ALPHA MICROSYSTEMS INC.', 0x0000B2: u'TELEVIDEO SYSTEMS, INC.', 0x0000B3: u'CIMLINC INCORPORATED', 0x0000B4: u'EDIMAX COMPUTER COMPANY', 0x0000B5: u'DATABILITY SOFTWARE SYS. INC.', 0x0000B6: u'MICRO-MATIC RESEARCH', 0x0000B7: u'DOVE COMPUTER CORPORATION', 0x0000B8: u'SEIKOSHA CO., LTD.', 0x0000B9: u'MCDONNELL DOUGLAS COMPUTER SYS', 0x0000BA: u'SIIG, INC.', 0x0000BB: u'TRI-DATA', 0x0000BC: u'ALLEN-BRADLEY CO. INC.', 0x0000BD: u'MITSUBISHI CABLE COMPANY', 0x0000BE: u'THE NTI GROUP', 0x0000BF: u'SYMMETRIC COMPUTER SYSTEMS', 0x0000C0: u'WESTERN DIGITAL CORPORATION', 0x0000C1: u'Madge Ltd.', 0x0000C2: u'INFORMATION PRESENTATION TECH.', 0x0000C3: u'HARRIS CORP COMPUTER SYS DIV', 0x0000C4: u'WATERS DIV. OF MILLIPORE', 0x0000C5: u'FARALLON COMPUTING/NETOPIA', 0x0000C6: u'EON SYSTEMS', 0x0000C7: u'ARIX CORPORATION', 0x0000C8: u'ALTOS COMPUTER SYSTEMS', 0x0000C9: u'EMULEX CORPORATION', 0x0000CA: u'ARRIS International', 0x0000CB: u'COMPU-SHACK ELECTRONIC GMBH', 0x0000CC: u'DENSAN CO., LTD.', 0x0000CD: u'Allied Telesyn Research Ltd.', 0x0000CE: u'MEGADATA CORP.', 0x0000CF: u'HAYES MICROCOMPUTER PRODUCTS', 0x0000D0: u'DEVELCON ELECTRONICS LTD.', 0x0000D1: u'ADAPTEC INCORPORATED', 0x0000D2: u'SBE, INC.', 0x0000D3: u'WANG LABORATORIES INC.', 0x0000D4: u'PURE DATA LTD.', 0x0000D5: u'MICROGNOSIS INTERNATIONAL', 0x0000D6: u'PUNCH LINE HOLDING', 0x0000D7: u'DARTMOUTH COLLEGE', 0x0000D8: u'NOVELL, INC.', 0x0000D9: u'NIPPON TELEGRAPH & TELEPHONE', 0x0000DA: u'ATEX', 0x0000DB: u'BRITISH TELECOMMUNICATIONS PLC', 0x0000DC: u'HAYES MICROCOMPUTER PRODUCTS', 0x0000DD: u'TCL INCORPORATED', 0x0000DE: u'CETIA', 0x0000DF: u'BELL & HOWELL PUB SYS DIV', 0x0000E0: u'QUADRAM CORP.', 0x0000E1: u'GRID SYSTEMS', 0x0000E2: u'ACER TECHNOLOGIES CORP.', 0x0000E3: u'INTEGRATED MICRO PRODUCTS LTD', 0x0000E4: u'IN2 GROUPE INTERTECHNIQUE', 0x0000E5: u'SIGMEX LTD.', 0x0000E6: u'APTOR PRODUITS DE COMM INDUST', 0x0000E7: u'STAR GATE TECHNOLOGIES', 0x0000E8: u'ACCTON TECHNOLOGY CORP.', 0x0000E9: u'ISICAD, INC.', 0x0000EA: u'UPNOD AB', 0x0000EB: u'MATSUSHITA COMM. IND. CO. LTD.', 0x0000EC: u'MICROPROCESS', 0x0000ED: u'APRIL', 0x0000EE: u'NETWORK DESIGNERS, LTD.', 0x0000EF: u'KTI', 0x0000F0: u'SAMSUNG ELECTRONICS CO., LTD.', 0x0000F1: u'MAGNA COMPUTER CORPORATION', 0x0000F2: u'SPIDER COMMUNICATIONS', 0x0000F3: u'GANDALF DATA LIMITED', 0x0000F4: u'ALLIED TELESYN INTERNATIONAL', 0x0000F5: u'DIAMOND SALES LIMITED', 0x0000F6: u'APPLIED MICROSYSTEMS CORP.', 0x0000F7: u'YOUTH KEEP ENTERPRISE CO LTD', 0x0000F8: u'DIGITAL EQUIPMENT CORPORATION', 0x0000F9: u'QUOTRON SYSTEMS INC.', 0x0000FA: u'MICROSAGE COMPUTER SYSTEMS INC', 0x0000FB: u'RECHNER ZUR KOMMUNIKATION', 0x0000FC: u'MEIKO', 0x0000FD: u'HIGH LEVEL HARDWARE', 0x0000FE: u'ANNAPOLIS MICRO SYSTEMS', 0x0000FF: u'CAMTEC ELECTRONICS LTD.', 0x000100: u'EQUIP\'TRANS', 0x000101: u'PRIVATE', 0x000102: u'3COM CORPORATION', 0x000103: u'3COM CORPORATION', 0x000104: u'DVICO Co., Ltd.', 0x000105: u'BECKHOFF GmbH', 0x000106: u'Tews Datentechnik GmbH', 0x000107: u'Leiser GmbH', 0x000108: u'AVLAB Technology, Inc.', 0x000109: u'Nagano Japan Radio Co., Ltd.', 0x00010A: u'CIS TECHNOLOGY INC.', 0x00010B: u'Space CyberLink, Inc.', 0x00010C: u'System Talks Inc.', 0x00010D: u'CORECO, INC.', 0x00010E: u'Bri-Link Technologies Co., Ltd', 0x00010F: u'McDATA Corporation', 0x000110: u'Gotham Networks', 0x000111: u'iDigm Inc.', 0x000112: u'Shark Multimedia Inc.', 0x000113: u'OLYMPUS CORPORATION', 0x000114: u'KANDA TSUSHIN KOGYO CO., LTD.', 0x000115: u'EXTRATECH CORPORATION', 0x000116: u'Netspect Technologies, Inc.', 0x000117: u'CANAL +', 0x000118: u'EZ Digital Co., Ltd.', 0x000119: u'RTUnet (Australia)', 0x00011A: u'EEH DataLink GmbH', 0x00011B: u'Unizone Technologies, Inc.', 0x00011C: u'Universal Talkware Corporation', 0x00011D: u'Centillium Communications', 0x00011E: u'Precidia Technologies, Inc.', 0x00011F: u'RC Networks, Inc.', 0x000120: u'OSCILLOQUARTZ S.A.', 0x000121: u'Watchguard Technologies, Inc.', 0x000122: u'Trend Communications, Ltd.', 0x000123: u'DIGITAL ELECTRONICS CORP.', 0x000124: u'Acer Incorporated', 0x000125: u'YAESU MUSEN CO., LTD.', 0x000126: u'PAC Labs', 0x000127: u'OPEN Networks Pty Ltd', 0x000128: u'EnjoyWeb, Inc.', 0x000129: u'DFI Inc.', 0x00012A: u'Telematica Sistems Inteligente', 0x00012B: u'TELENET Co., Ltd.', 0x00012C: u'Aravox Technologies, Inc.', 0x00012D: u'Komodo Technology', 0x00012E: u'PC Partner Ltd.', 0x00012F: u'Twinhead International Corp', 0x000130: u'Extreme Networks', 0x000131: u'Detection Systems, Inc.', 0x000132: u'Dranetz - BMI', 0x000133: u'KYOWA Electronic Instruments C', 0x000134: u'SIG Positec Systems AG', 0x000135: u'KDC Corp.', 0x000136: u'CyberTAN Technology, Inc.', 0x000137: u'IT Farm Corporation', 0x000138: u'XAVi Technologies Corp.', 0x000139: u'Point Multimedia Systems', 0x00013A: u'SHELCAD COMMUNICATIONS, LTD.', 0x00013B: u'BNA SYSTEMS', 0x00013C: u'TIW SYSTEMS', 0x00013D: u'RiscStation Ltd.', 0x00013E: u'Ascom Tateco AB', 0x00013F: u'Neighbor World Co., Ltd.', 0x000140: u'Sendtek Corporation', 0x000141: u'CABLE PRINT', 0x000142: u'Cisco Systems, Inc.', 0x000143: u'Cisco Systems, Inc.', 0x000144: u'EMC Corporation', 0x000145: u'WINSYSTEMS, INC.', 0x000146: u'Tesco Controls, Inc.', 0x000147: u'Zhone Technologies', 0x000148: u'X-traWeb Inc.', 0x000149: u'T.D.T. Transfer Data Test GmbH', 0x00014A: u'Sony Corporation', 0x00014B: u'Ennovate Networks, Inc.', 0x00014C: u'Berkeley Process Control', 0x00014D: u'Shin Kin Enterprises Co., Ltd', 0x00014E: u'WIN Enterprises, Inc.', 0x00014F: u'ADTRAN INC', 0x000150: u'GILAT COMMUNICATIONS, LTD.', 0x000151: u'Ensemble Communications', 0x000152: u'CHROMATEK INC.', 0x000153: u'ARCHTEK TELECOM CORPORATION', 0x000154: u'G3M Corporation', 0x000155: u'Promise Technology, Inc.', 0x000156: u'FIREWIREDIRECT.COM, INC.', 0x000157: u'SYSWAVE CO., LTD', 0x000158: u'Electro Industries/Gauge Tech', 0x000159: u'S1 Corporation', 0x00015A: u'Digital Video Broadcasting', 0x00015B: u'ITALTEL S.p.A/RF-UP-I', 0x00015C: u'CADANT INC.', 0x00015D: u'Sun Microsystems, Inc', 0x00015E: u'BEST TECHNOLOGY CO., LTD.', 0x00015F: u'DIGITAL DESIGN GmbH', 0x000160: u'ELMEX Co., LTD.', 0x000161: u'Meta Machine Technology', 0x000162: u'Cygnet Technologies, Inc.', 0x000163: u'Cisco Systems, Inc.', 0x000164: u'Cisco Systems, Inc.', 0x000165: u'AirSwitch Corporation', 0x000166: u'TC GROUP A/S', 0x000167: u'HIOKI E.E. CORPORATION', 0x000168: u'VITANA CORPORATION', 0x000169: u'Celestix Networks Pte Ltd.', 0x00016A: u'ALITEC', 0x00016B: u'LightChip, Inc.', 0x00016C: u'FOXCONN', 0x00016D: u'CarrierComm Inc.', 0x00016E: u'Conklin Corporation', 0x00016F: u'HAITAI ELECTRONICS CO., LTD.', 0x000170: u'ESE Embedded System Engineer\'g', 0x000171: u'Allied Data Technologies', 0x000172: u'TechnoLand Co., LTD.', 0x000173: u'AMCC', 0x000174: u'CyberOptics Corporation', 0x000175: u'Radiant Communications Corp.', 0x000176: u'Orient Silver Enterprises', 0x000177: u'EDSL', 0x000178: u'MARGI Systems, Inc.', 0x000179: u'WIRELESS TECHNOLOGY, INC.', 0x00017A: u'Chengdu Maipu Electric Industrial Co., Ltd.', 0x00017B: u'Heidelberger Druckmaschinen AG', 0x00017C: u'AG-E GmbH', 0x00017D: u'ThermoQuest', 0x00017E: u'ADTEK System Science Co., Ltd.', 0x00017F: u'Experience Music Project', 0x000180: u'AOpen, Inc.', 0x000181: u'Nortel Networks', 0x000182: u'DICA TECHNOLOGIES AG', 0x000183: u'ANITE TELECOMS', 0x000184: u'SIEB & MEYER AG', 0x000185: u'Aloka Co., Ltd.', 0x000186: u'Uwe Disch', 0x000187: u'i2SE GmbH', 0x000188: u'LXCO Technologies ag', 0x000189: u'Refraction Technology, Inc.', 0x00018A: u'ROI COMPUTER AG', 0x00018B: u'NetLinks Co., Ltd.', 0x00018C: u'Mega Vision', 0x00018D: u'AudeSi Technologies', 0x00018E: u'Logitec Corporation', 0x00018F: u'Kenetec, Inc.', 0x000190: u'SMK-M', 0x000191: u'SYRED Data Systems', 0x000192: u'Texas Digital Systems', 0x000193: u'Hanbyul Telecom Co., Ltd.', 0x000194: u'Capital Equipment Corporation', 0x000195: u'Sena Technologies, Inc.', 0x000196: u'Cisco Systems, Inc.', 0x000197: u'Cisco Systems, Inc.', 0x000198: u'Darim Vision', 0x000199: u'HeiSei Electronics', 0x00019A: u'LEUNIG GmbH', 0x00019B: u'Kyoto Microcomputer Co., Ltd.', 0x00019C: u'JDS Uniphase Inc.', 0x00019D: u'E-Control Systems, Inc.', 0x00019E: u'ESS Technology, Inc.', 0x00019F: u'Phonex Broadband', 0x0001A0: u'Infinilink Corporation', 0x0001A1: u'Mag-Tek, Inc.', 0x0001A2: u'Logical Co., Ltd.', 0x0001A3: u'GENESYS LOGIC, INC.', 0x0001A4: u'Microlink Corporation', 0x0001A5: u'Nextcomm, Inc.', 0x0001A6: u'Scientific-Atlanta Arcodan A/S', 0x0001A7: u'UNEX TECHNOLOGY CORPORATION', 0x0001A8: u'Welltech Computer Co., Ltd.', 0x0001A9: u'BMW AG', 0x0001AA: u'Airspan Communications, Ltd.', 0x0001AB: u'Main Street Networks', 0x0001AC: u'Sitara Networks, Inc.', 0x0001AD: u'Coach Master International d.b.a. CMI Worldwide, Inc.', 0x0001AE: u'Trex Enterprises', 0x0001AF: u'Motorola Computer Group', 0x0001B0: u'Fulltek Technology Co., Ltd.', 0x0001B1: u'General Bandwidth', 0x0001B2: u'Digital Processing Systems, Inc.', 0x0001B3: u'Precision Electronic Manufacturing', 0x0001B4: u'Wayport, Inc.', 0x0001B5: u'Turin Networks, Inc.', 0x0001B6: u'SAEJIN T&M Co., Ltd.', 0x0001B7: u'Centos, Inc.', 0x0001B8: u'Netsensity, Inc.', 0x0001B9: u'SKF Condition Monitoring', 0x0001BA: u'IC-Net, Inc.', 0x0001BB: u'Frequentis', 0x0001BC: u'Brains Corporation', 0x0001BD: u'Peterson Electro-Musical Products, Inc.', 0x0001BE: u'Gigalink Co., Ltd.', 0x0001BF: u'Teleforce Co., Ltd.', 0x0001C0: u'CompuLab, Ltd.', 0x0001C1: u'Vitesse Semiconductor Corporation', 0x0001C2: u'ARK Research Corp.', 0x0001C3: u'Acromag, Inc.', 0x0001C4: u'NeoWave, Inc.', 0x0001C5: u'Simpler Networks', 0x0001C6: u'Quarry Technologies', 0x0001C7: u'Cisco Systems, Inc.', 0x0001C8: u'THOMAS CONRAD CORP.', 0x0001C8: u'CONRAD CORP.', 0x0001C9: u'Cisco Systems, Inc.', 0x0001CA: u'Geocast Network Systems, Inc.', 0x0001CB: u'EVR', 0x0001CC: u'Japan Total Design Communication Co., Ltd.', 0x0001CD: u'ARtem', 0x0001CE: u'Custom Micro Products, Ltd.', 0x0001CF: u'Alpha Data Parallel Systems, Ltd.', 0x0001D0: u'VitalPoint, Inc.', 0x0001D1: u'CoNet Communications, Inc.', 0x0001D2: u'MacPower Peripherals, Ltd.', 0x0001D3: u'PAXCOMM, Inc.', 0x0001D4: u'Leisure Time, Inc.', 0x0001D5: u'HAEDONG INFO & COMM CO., LTD', 0x0001D6: u'MAN Roland Druckmaschinen AG', 0x0001D7: u'F5 Networks, Inc.', 0x0001D8: u'Teltronics, Inc.', 0x0001D9: u'Sigma, Inc.', 0x0001DA: u'WINCOMM Corporation', 0x0001DB: u'Freecom Technologies GmbH', 0x0001DC: u'Activetelco', 0x0001DD: u'Avail Networks', 0x0001DE: u'Trango Systems, Inc.', 0x0001DF: u'ISDN Communications, Ltd.', 0x0001E0: u'Fast Systems, Inc.', 0x0001E1: u'Kinpo Electronics, Inc.', 0x0001E2: u'Ando Electric Corporation', 0x0001E3: u'Siemens AG', 0x0001E4: u'Sitera, Inc.', 0x0001E5: u'Supernet, Inc.', 0x0001E6: u'Hewlett-Packard Company', 0x0001E7: u'Hewlett-Packard Company', 0x0001E8: u'Force10 Networks, Inc.', 0x0001E9: u'Litton Marine Systems B.V.', 0x0001EA: u'Cirilium Corp.', 0x0001EB: u'C-COM Corporation', 0x0001EC: u'Ericsson Group', 0x0001ED: u'SETA Corp.', 0x0001EE: u'Comtrol Europe, Ltd.', 0x0001EF: u'Camtel Technology Corp.', 0x0001F0: u'Tridium, Inc.', 0x0001F1: u'Innovative Concepts, Inc.', 0x0001F2: u'Mark of the Unicorn, Inc.', 0x0001F3: u'QPS, Inc.', 0x0001F4: u'Enterasys Networks', 0x0001F5: u'ERIM S.A.', 0x0001F6: u'Association of Musical Electronics Industry', 0x0001F7: u'Image Display Systems, Inc.', 0x0001F8: u'Adherent Systems, Ltd.', 0x0001F9: u'TeraGlobal Communications Corp.', 0x0001FA: u'HOROSCAS', 0x0001FB: u'DoTop Technology, Inc.', 0x0001FC: u'Keyence Corporation', 0x0001FD: u'Digital Voice Systems, Inc.', 0x0001FE: u'DIGITAL EQUIPMENT CORPORATION', 0x0001FF: u'Data Direct Networks, Inc.', 0x000200: u'Net & Sys Co., Ltd.', 0x000201: u'IFM Electronic gmbh', 0x000202: u'Amino Communications, Ltd.', 0x000203: u'Woonsang Telecom, Inc.', 0x000204: u'Bodmann Industries Elektronik GmbH', 0x000205: u'Hitachi Denshi, Ltd.', 0x000206: u'Telital R&D Denmark A/S', 0x000207: u'VisionGlobal Network Corp.', 0x000208: u'Unify Networks, Inc.', 0x000209: u'Shenzhen SED Information Technology Co., Ltd.', 0x00020A: u'Gefran Spa', 0x00020B: u'Native Networks, Inc.', 0x00020C: u'Metro-Optix', 0x00020D: u'Micronpc.com', 0x00020E: u'Laurel Networks, Inc.', 0x00020F: u'AATR', 0x000210: u'Fenecom', 0x000211: u'Nature Worldwide Technology Corp.', 0x000212: u'SierraCom', 0x000213: u'S.D.E.L.', 0x000214: u'DTVRO', 0x000215: u'Cotas Computer Technology A/B', 0x000216: u'Cisco Systems, Inc.', 0x000217: u'Cisco Systems, Inc.', 0x000218: u'Advanced Scientific Corp', 0x000219: u'Paralon Technologies', 0x00021A: u'Zuma Networks', 0x00021B: u'Kollmorgen-Servotronix', 0x00021C: u'Network Elements, Inc.', 0x00021D: u'Data General Communication Ltd.', 0x00021E: u'SIMTEL S.R.L.', 0x00021F: u'Aculab PLC', 0x000220: u'Canon Aptex, Inc.', 0x000221: u'DSP Application, Ltd.', 0x000222: u'Chromisys, Inc.', 0x000223: u'ClickTV', 0x000224: u'C-COR', 0x000225: u'Certus Technology, Inc.', 0x000226: u'XESystems, Inc.', 0x000227: u'ESD GmbH', 0x000228: u'Necsom, Ltd.', 0x000229: u'Adtec Corporation', 0x00022A: u'Asound Electronic', 0x00022B: u'SAXA, Inc.', 0x00022C: u'ABB Bomem, Inc.', 0x00022D: u'Agere Systems', 0x00022E: u'TEAC Corp. R& D', 0x00022F: u'P-Cube, Ltd.', 0x000230: u'Intersoft Electronics', 0x000231: u'Ingersoll-Rand', 0x000232: u'Avision, Inc.', 0x000233: u'Mantra Communications, Inc.', 0x000234: u'Imperial Technology, Inc.', 0x000235: u'Paragon Networks International', 0x000236: u'INIT GmbH', 0x000237: u'Cosmo Research Corp.', 0x000238: u'Serome Technology, Inc.', 0x000239: u'Visicom', 0x00023A: u'ZSK Stickmaschinen GmbH', 0x00023B: u'Redback Networks', 0x00023C: u'Creative Technology, Ltd.', 0x00023D: u'NuSpeed, Inc.', 0x00023E: u'Selta Telematica S.p.a', 0x00023F: u'Compal Electronics, Inc.', 0x000240: u'Seedek Co., Ltd.', 0x000241: u'Amer.com', 0x000242: u'Videoframe Systems', 0x000243: u'Raysis Co., Ltd.', 0x000244: u'SURECOM Technology Co.', 0x000245: u'Lampus Co, Ltd.', 0x000246: u'All-Win Tech Co., Ltd.', 0x000247: u'Great Dragon Information Technology (Group) Co., Ltd.', 0x000248: u'Pilz GmbH & Co.', 0x000249: u'Aviv Infocom Co, Ltd.', 0x00024A: u'Cisco Systems, Inc.', 0x00024B: u'Cisco Systems, Inc.', 0x00024C: u'SiByte, Inc.', 0x00024D: u'Mannesman Dematic Colby Pty. Ltd.', 0x00024E: u'Datacard Group', 0x00024F: u'IPM Datacom S.R.L.', 0x000250: u'Geyser Networks, Inc.', 0x000251: u'Soma Networks, Inc.', 0x000252: u'Carrier Corporation', 0x000253: u'Televideo, Inc.', 0x000254: u'WorldGate', 0x000255: u'IBM Corporation', 0x000256: u'Alpha Processor, Inc.', 0x000257: u'Microcom Corp.', 0x000258: u'Flying Packets Communications', 0x000259: u'Tsann Kuen China (Shanghai)Enterprise Co., Ltd. IT Group', 0x00025A: u'Catena Networks', 0x00025B: u'Cambridge Silicon Radio', 0x00025C: u'SCI Systems (Kunshan) Co., Ltd.', 0x00025D: u'Calix Networks', 0x00025E: u'High Technology Ltd', 0x00025F: u'Nortel Networks', 0x000260: u'Accordion Networks, Inc.', 0x000261: u'Tilgin AB', 0x000262: u'Soyo Group Soyo Com Tech Co., Ltd', 0x000263: u'UPS Manufacturing SRL', 0x000264: u'AudioRamp.com', 0x000265: u'Virditech Co. Ltd.', 0x000266: u'Thermalogic Corporation', 0x000267: u'NODE RUNNER, INC.', 0x000268: u'Harris Government Communications', 0x000269: u'Nadatel Co., Ltd', 0x00026A: u'Cocess Telecom Co., Ltd.', 0x00026B: u'BCM Computers Co., Ltd.', 0x00026C: u'Philips CFT', 0x00026D: u'Adept Telecom', 0x00026E: u'NeGeN Access, Inc.', 0x00026F: u'Senao International Co., Ltd.', 0x000270: u'Crewave Co., Ltd.', 0x000271: u'Vpacket Communications', 0x000272: u'CC&C Technologies, Inc.', 0x000273: u'Coriolis Networks', 0x000274: u'Tommy Technologies Corp.', 0x000275: u'SMART Technologies, Inc.', 0x000276: u'Primax Electronics Ltd.', 0x000277: u'Cash Systemes Industrie', 0x000278: u'Samsung Electro-Mechanics Co., Ltd.', 0x000279: u'Control Applications, Ltd.', 0x00027A: u'IOI Technology Corporation', 0x00027B: u'Amplify Net, Inc.', 0x00027C: u'Trilithic, Inc.', 0x00027D: u'Cisco Systems, Inc.', 0x00027E: u'Cisco Systems, Inc.', 0x00027F: u'ask-technologies.com', 0x000280: u'Mu Net, Inc.', 0x000281: u'Madge Ltd.', 0x000282: u'ViaClix, Inc.', 0x000283: u'Spectrum Controls, Inc.', 0x000284: u'AREVA T&D', 0x000285: u'Riverstone Networks', 0x000286: u'Occam Networks', 0x000287: u'Adapcom', 0x000288: u'GLOBAL VILLAGE COMMUNICATION', 0x000289: u'DNE Technologies', 0x00028A: u'Ambit Microsystems Corporation', 0x00028B: u'VDSL Systems OY', 0x00028C: u'Micrel-Synergy Semiconductor', 0x00028D: u'Movita Technologies, Inc.', 0x00028E: u'Rapid 5 Networks, Inc.', 0x00028F: u'Globetek, Inc.', 0x000290: u'Woorigisool, Inc.', 0x000291: u'Open Network Co., Ltd.', 0x000292: u'Logic Innovations, Inc.', 0x000293: u'Solid Data Systems', 0x000294: u'Tokyo Sokushin Co., Ltd.', 0x000295: u'IP.Access Limited', 0x000296: u'Lectron Co,. Ltd.', 0x000297: u'C-COR.net', 0x000298: u'Broadframe Corporation', 0x000299: u'Apex, Inc.', 0x00029A: u'Storage Apps', 0x00029B: u'Kreatel Communications AB', 0x00029C: u'3COM', 0x00029D: u'Merix Corp.', 0x00029E: u'Information Equipment Co., Ltd.', 0x00029F: u'L-3 Communication Aviation Recorders', 0x0002A0: u'Flatstack Ltd.', 0x0002A1: u'World Wide Packets', 0x0002A2: u'Hilscher GmbH', 0x0002A3: u'ABB Power Automation', 0x0002A4: u'AddPac Technology Co., Ltd.', 0x0002A5: u'Compaq Computer Corporation', 0x0002A6: u'Effinet Systems Co., Ltd.', 0x0002A7: u'Vivace Networks', 0x0002A8: u'Air Link Technology', 0x0002A9: u'RACOM, s.r.o.', 0x0002AA: u'PLcom Co., Ltd.', 0x0002AB: u'CTC Union Technologies Co., Ltd.', 0x0002AC: u'3PAR data', 0x0002AD: u'Pentax Corpotation', 0x0002AE: u'Scannex Electronics Ltd.', 0x0002AF: u'TeleCruz Technology, Inc.', 0x0002B0: u'Hokubu Communication & Industrial Co., Ltd.', 0x0002B1: u'Anritsu, Ltd.', 0x0002B2: u'Cablevision', 0x0002B3: u'Intel Corporation', 0x0002B4: u'DAPHNE', 0x0002B5: u'Avnet, Inc.', 0x0002B6: u'Acrosser Technology Co., Ltd.', 0x0002B7: u'Watanabe Electric Industry Co., Ltd.', 0x0002B8: u'WHI KONSULT AB', 0x0002B9: u'Cisco Systems, Inc.', 0x0002BA: u'Cisco Systems, Inc.', 0x0002BB: u'Continuous Computing', 0x0002BC: u'LVL 7 Systems, Inc.', 0x0002BD: u'Bionet Co., Ltd.', 0x0002BE: u'Totsu Engineering, Inc.', 0x0002BF: u'dotRocket, Inc.', 0x0002C0: u'Bencent Tzeng Industry Co., Ltd.', 0x0002C1: u'Innovative Electronic Designs, Inc.', 0x0002C2: u'Net Vision Telecom', 0x0002C3: u'Arelnet Ltd.', 0x0002C4: u'Vector International BUBA', 0x0002C5: u'Evertz Microsystems Ltd.', 0x0002C6: u'Data Track Technology PLC', 0x0002C7: u'ALPS ELECTRIC Co., Ltd.', 0x0002C8: u'Technocom Communications Technology (pte) Ltd', 0x0002C9: u'Mellanox Technologies', 0x0002CA: u'EndPoints, Inc.', 0x0002CB: u'TriState Ltd.', 0x0002CC: u'M.C.C.I', 0x0002CD: u'TeleDream, Inc.', 0x0002CE: u'FoxJet, Inc.', 0x0002CF: u'ZyGate Communications, Inc.', 0x0002D0: u'Comdial Corporation', 0x0002D1: u'Vivotek, Inc.', 0x0002D2: u'Workstation AG', 0x0002D3: u'NetBotz, Inc.', 0x0002D4: u'PDA Peripherals, Inc.', 0x0002D5: u'ACR', 0x0002D6: u'NICE Systems', 0x0002D7: u'EMPEG Ltd', 0x0002D8: u'BRECIS Communications Corporation', 0x0002D9: u'Reliable Controls', 0x0002DA: u'ExiO Communications, Inc.', 0x0002DB: u'NETSEC', 0x0002DC: u'Fujitsu General Limited', 0x0002DD: u'Bromax Communications, Ltd.', 0x0002DE: u'Astrodesign, Inc.', 0x0002DF: u'Net Com Systems, Inc.', 0x0002E0: u'ETAS GmbH', 0x0002E1: u'Integrated Network Corporation', 0x0002E2: u'NDC Infared Engineering', 0x0002E3: u'LITE-ON Communications, Inc.', 0x0002E4: u'JC HYUN Systems, Inc.', 0x0002E5: u'Timeware Ltd.', 0x0002E6: u'Gould Instrument Systems, Inc.', 0x0002E7: u'CAB GmbH & Co KG', 0x0002E8: u'E.D.&A.', 0x0002E9: u'CS Systemes De Securite - C3S', 0x0002EA: u'Focus Enhancements', 0x0002EB: u'Pico Communications', 0x0002EC: u'Maschoff Design Engineering', 0x0002ED: u'DXO Telecom Co., Ltd.', 0x0002EE: u'Nokia Danmark A/S', 0x0002EF: u'CCC Network Systems Group Ltd.', 0x0002F0: u'AME Optimedia Technology Co., Ltd.', 0x0002F1: u'Pinetron Co., Ltd.', 0x0002F2: u'eDevice, Inc.', 0x0002F3: u'Media Serve Co., Ltd.', 0x0002F4: u'PCTEL, Inc.', 0x0002F5: u'VIVE Synergies, Inc.', 0x0002F6: u'Equipe Communications', 0x0002F7: u'ARM', 0x0002F8: u'SEAKR Engineering, Inc.', 0x0002F9: u'Mimos Semiconductor SDN BHD', 0x0002FA: u'DX Antenna Co., Ltd.', 0x0002FB: u'Baumuller Aulugen-Systemtechnik GmbH', 0x0002FC: u'Cisco Systems, Inc.', 0x0002FD: u'Cisco Systems, Inc.', 0x0002FE: u'Viditec, Inc.', 0x0002FF: u'Handan BroadInfoCom', 0x000300: u'NetContinuum, Inc.', 0x000301: u'Avantas Networks Corporation', 0x000302: u'Charles Industries, Ltd.', 0x000303: u'JAMA Electronics Co., Ltd.', 0x000304: u'Pacific Broadband Communications', 0x000305: u'Smart Network Devices GmbH', 0x000306: u'Fusion In Tech Co., Ltd.', 0x000307: u'Secure Works, Inc.', 0x000308: u'AM Communications, Inc.', 0x000309: u'Texcel Technology PLC', 0x00030A: u'Argus Technologies', 0x00030B: u'Hunter Technology, Inc.', 0x00030C: u'Telesoft Technologies Ltd.', 0x00030D: u'Uniwill Computer Corp.', 0x00030E: u'Core Communications Co., Ltd.', 0x00030F: u'Digital China (Shanghai) Networks Ltd.', 0x000310: u'Link Evolution Corp.', 0x000311: u'Micro Technology Co., Ltd.', 0x000312: u'TR-Systemtechnik GmbH', 0x000313: u'Access Media SPA', 0x000314: u'Teleware Network Systems', 0x000315: u'Cidco Incorporated', 0x000316: u'Nobell Communications, Inc.', 0x000317: u'Merlin Systems, Inc.', 0x000318: u'Cyras Systems, Inc.', 0x000319: u'Infineon AG', 0x00031A: u'Beijing Broad Telecom Ltd., China', 0x00031B: u'Cellvision Systems, Inc.', 0x00031C: u'Svenska Hardvarufabriken AB', 0x00031D: u'Taiwan Commate Computer, Inc.', 0x00031E: u'Optranet, Inc.', 0x00031F: u'Condev Ltd.', 0x000320: u'Xpeed, Inc.', 0x000321: u'Reco Research Co., Ltd.', 0x000322: u'IDIS Co., Ltd.', 0x000323: u'Cornet Technology, Inc.', 0x000324: u'SANYO Multimedia Tottori Co., Ltd.', 0x000325: u'Arima Computer Corp.', 0x000326: u'Iwasaki Information Systems Co., Ltd.', 0x000327: u'ACT\'L', 0x000328: u'Mace Group, Inc.', 0x000329: u'F3, Inc.', 0x00032A: u'UniData Communication Systems, Inc.', 0x00032B: u'GAI Datenfunksysteme GmbH', 0x00032C: u'ABB Industrie AG', 0x00032D: u'IBASE Technology, Inc.', 0x00032E: u'Scope Information Management, Ltd.', 0x00032F: u'Global Sun Technology, Inc.', 0x000330: u'Imagenics, Co., Ltd.', 0x000331: u'Cisco Systems, Inc.', 0x000332: u'Cisco Systems, Inc.', 0x000333: u'Digitel Co., Ltd.', 0x000334: u'Newport Electronics', 0x000335: u'Mirae Technology', 0x000336: u'Zetes Technologies', 0x000337: u'Vaone, Inc.', 0x000338: u'Oak Technology', 0x000339: u'Eurologic Systems, Ltd.', 0x00033A: u'Silicon Wave, Inc.', 0x00033B: u'TAMI Tech Co., Ltd.', 0x00033C: u'Daiden Co., Ltd.', 0x00033D: u'ILSHin Lab', 0x00033E: u'Tateyama System Laboratory Co., Ltd.', 0x00033F: u'BigBand Networks, Ltd.', 0x000340: u'Floware Wireless Systems, Ltd.', 0x000341: u'Axon Digital Design', 0x000342: u'Nortel Networks', 0x000343: u'Martin Professional A/S', 0x000344: u'Tietech.Co., Ltd.', 0x000345: u'Routrek Networks Corporation', 0x000346: u'Hitachi Kokusai Electric, Inc.', 0x000347: u'Intel Corporation', 0x000348: u'Norscan Instruments, Ltd.', 0x000349: u'Vidicode Datacommunicatie B.V.', 0x00034A: u'RIAS Corporation', 0x00034B: u'Nortel Networks', 0x00034C: u'Shanghai DigiVision Technology Co., Ltd.', 0x00034D: u'Chiaro Networks, Ltd.', 0x00034E: u'Pos Data Company, Ltd.', 0x00034F: u'Sur-Gard Security', 0x000350: u'BTICINO SPA', 0x000351: u'Diebold, Inc.', 0x000352: u'Colubris Networks', 0x000353: u'Mitac, Inc.', 0x000354: u'Fiber Logic Communications', 0x000355: u'TeraBeam Internet Systems', 0x000356: u'Wincor Nixdorf GmbH & Co KG', 0x000357: u'Intervoice-Brite, Inc.', 0x000358: u'Hanyang Digitech Co., Ltd.', 0x000359: u'DigitalSis', 0x00035A: u'Photron Limited', 0x00035B: u'BridgeWave Communications', 0x00035C: u'Saint Song Corp.', 0x00035D: u'Bosung Hi-Net Co., Ltd.', 0x00035E: u'Metropolitan Area Networks, Inc.', 0x00035F: u'Prueftechnik Condition Monitoring GmbH & Co. KG', 0x000360: u'PAC Interactive Technology, Inc.', 0x000361: u'Widcomm, Inc.', 0x000362: u'Vodtel Communications, Inc.', 0x000363: u'Miraesys Co., Ltd.', 0x000364: u'Scenix Semiconductor, Inc.', 0x000365: u'Kira Information & Communications, Ltd.', 0x000366: u'ASM Pacific Technology', 0x000367: u'Jasmine Networks, Inc.', 0x000368: u'Embedone Co., Ltd.', 0x000369: u'Nippon Antenna Co., Ltd.', 0x00036A: u'Mainnet, Ltd.', 0x00036B: u'Cisco Systems, Inc.', 0x00036C: u'Cisco Systems, Inc.', 0x00036D: u'Runtop, Inc.', 0x00036E: u'Nicon Systems (Pty) Limited', 0x00036F: u'Telsey SPA', 0x000370: u'NXTV, Inc.', 0x000371: u'Acomz Networks Corp.', 0x000372: u'ULAN', 0x000373: u'Aselsan A.S', 0x000374: u'Hunter Watertech', 0x000375: u'NetMedia, Inc.', 0x000376: u'Graphtec Technology, Inc.', 0x000377: u'Gigabit Wireless', 0x000378: u'HUMAX Co., Ltd.', 0x000379: u'Proscend Communications, Inc.', 0x00037A: u'Taiyo Yuden Co., Ltd.', 0x00037B: u'IDEC IZUMI Corporation', 0x00037C: u'Coax Media', 0x00037D: u'Stellcom', 0x00037E: u'PORTech Communications, Inc.', 0x00037F: u'Atheros Communications, Inc.', 0x000380: u'SSH Communications Security Corp.', 0x000381: u'Ingenico International', 0x000382: u'A-One Co., Ltd.', 0x000383: u'Metera Networks, Inc.', 0x000384: u'AETA', 0x000385: u'Actelis Networks, Inc.', 0x000386: u'Ho Net, Inc.', 0x000387: u'Blaze Network Products', 0x000388: u'Fastfame Technology Co., Ltd.', 0x000389: u'Plantronics', 0x00038A: u'America Online, Inc.', 0x00038B: u'PLUS-ONE I&T, Inc.', 0x00038C: u'Total Impact', 0x00038D: u'PCS Revenue Control Systems, Inc.', 0x00038E: u'Atoga Systems, Inc.', 0x00038F: u'Weinschel Corporation', 0x000390: u'Digital Video Communications, Inc.', 0x000391: u'Advanced Digital Broadcast, Ltd.', 0x000392: u'Hyundai Teletek Co., Ltd.', 0x000393: u'Apple Computer, Inc.', 0x000394: u'Connect One', 0x000395: u'California Amplifier', 0x000396: u'EZ Cast Co., Ltd.', 0x000397: u'Watchfront Electronics', 0x000398: u'WISI', 0x000399: u'Dongju Informations & Communications Co., Ltd.', 0x00039A: u'SiConnect', 0x00039B: u'NetChip Technology, Inc.', 0x00039C: u'OptiMight Communications, Inc.', 0x00039D: u'BENQ CORPORATION', 0x00039E: u'Tera System Co., Ltd.', 0x00039F: u'Cisco Systems, Inc.', 0x0003A0: u'Cisco Systems, Inc.', 0x0003A1: u'HIPER Information & Communication, Inc.', 0x0003A2: u'Catapult Communications', 0x0003A3: u'MAVIX, Ltd.', 0x0003A4: u'Data Storage and Information Management', 0x0003A5: u'Medea Corporation', 0x0003A6: u'Traxit Technology, Inc.', 0x0003A7: u'Unixtar Technology, Inc.', 0x0003A8: u'IDOT Computers, Inc.', 0x0003A9: u'AXCENT Media AG', 0x0003AA: u'Watlow', 0x0003AB: u'Bridge Information Systems', 0x0003AC: u'Fronius Schweissmaschinen', 0x0003AD: u'Emerson Energy Systems AB', 0x0003AE: u'Allied Advanced Manufacturing Pte, Ltd.', 0x0003AF: u'Paragea Communications', 0x0003B0: u'Xsense Technology Corp.', 0x0003B1: u'Hospira Inc.', 0x0003B2: u'Radware', 0x0003B3: u'IA Link Systems Co., Ltd.', 0x0003B4: u'Macrotek International Corp.', 0x0003B5: u'Entra Technology Co.', 0x0003B6: u'QSI Corporation', 0x0003B7: u'ZACCESS Systems', 0x0003B8: u'NetKit Solutions, LLC', 0x0003B9: u'Hualong Telecom Co., Ltd.', 0x0003BA: u'Sun Microsystems', 0x0003BB: u'Signal Communications Limited', 0x0003BC: u'COT GmbH', 0x0003BD: u'OmniCluster Technologies, Inc.', 0x0003BE: u'Netility', 0x0003BF: u'Centerpoint Broadband Technologies, Inc.', 0x0003C0: u'RFTNC Co., Ltd.', 0x0003C1: u'Packet Dynamics Ltd', 0x0003C2: u'Solphone K.K.', 0x0003C3: u'Micronik Multimedia', 0x0003C4: u'Tomra Systems ASA', 0x0003C5: u'Mobotix AG', 0x0003C6: u'ICUE Systems, Inc.', 0x0003C7: u'hopf Elektronik GmbH', 0x0003C8: u'CML Emergency Services', 0x0003C9: u'TECOM Co., Ltd.', 0x0003CA: u'MTS Systems Corp.', 0x0003CB: u'Nippon Systems Development Co., Ltd.', 0x0003CC: u'Momentum Computer, Inc.', 0x0003CD: u'Clovertech, Inc.', 0x0003CE: u'ETEN Technologies, Inc.', 0x0003CF: u'Muxcom, Inc.', 0x0003D0: u'KOANKEISO Co., Ltd.', 0x0003D1: u'Takaya Corporation', 0x0003D2: u'Crossbeam Systems, Inc.', 0x0003D3: u'Internet Energy Systems, Inc.', 0x0003D4: u'Alloptic, Inc.', 0x0003D5: u'Advanced Communications Co., Ltd.', 0x0003D6: u'RADVision, Ltd.', 0x0003D7: u'NextNet Wireless, Inc.', 0x0003D8: u'iMPath Networks, Inc.', 0x0003D9: u'Secheron SA', 0x0003DA: u'Takamisawa Cybernetics Co., Ltd.', 0x0003DB: u'Apogee Electronics Corp.', 0x0003DC: u'Lexar Media, Inc.', 0x0003DD: u'Comark Corp.', 0x0003DE: u'OTC Wireless', 0x0003DF: u'Desana Systems', 0x0003E0: u'RadioFrame Networks, Inc.', 0x0003E1: u'Winmate Communication, Inc.', 0x0003E2: u'Comspace Corporation', 0x0003E3: u'Cisco Systems, Inc.', 0x0003E4: u'Cisco Systems, Inc.', 0x0003E5: u'Hermstedt SG', 0x0003E6: u'Entone Technologies, Inc.', 0x0003E7: u'Logostek Co. Ltd.', 0x0003E8: u'Wavelength Digital Limited', 0x0003E9: u'Akara Canada, Inc.', 0x0003EA: u'Mega System Technologies, Inc.', 0x0003EB: u'Atrica', 0x0003EC: u'ICG Research, Inc.', 0x0003ED: u'Shinkawa Electric Co., Ltd.', 0x0003EE: u'MKNet Corporation', 0x0003EF: u'Oneline AG', 0x0003F0: u'Redfern Broadband Networks', 0x0003F1: u'Cicada Semiconductor, Inc.', 0x0003F2: u'Seneca Networks', 0x0003F3: u'Dazzle Multimedia, Inc.', 0x0003F4: u'NetBurner', 0x0003F5: u'Chip2Chip', 0x0003F6: u'Allegro Networks, Inc.', 0x0003F7: u'Plast-Control GmbH', 0x0003F8: u'SanCastle Technologies, Inc.', 0x0003F9: u'Pleiades Communications, Inc.', 0x0003FA: u'TiMetra Networks', 0x0003FB: u'Toko Seiki Company, Ltd.', 0x0003FC: u'Intertex Data AB', 0x0003FD: u'Cisco Systems, Inc.', 0x0003FE: u'Cisco Systems, Inc.', 0x0003FF: u'Microsoft Corporation', 0x000400: u'LEXMARK INTERNATIONAL, INC.', 0x000401: u'Osaki Electric Co., Ltd.', 0x000402: u'Nexsan Technologies, Ltd.', 0x000403: u'Nexsi Corporation', 0x000404: u'Makino Milling Machine Co., Ltd.', 0x000405: u'ACN Technologies', 0x000406: u'Fa. Metabox AG', 0x000407: u'Topcon Positioning Systems, Inc.', 0x000408: u'Sanko Electronics Co., Ltd.', 0x000409: u'Cratos Networks', 0x00040A: u'Sage Systems', 0x00040B: u'3com Europe Ltd.', 0x00040C: u'KANNO Work\'s Ltd.', 0x00040D: u'Avaya, Inc.', 0x00040E: u'AVM GmbH', 0x00040F: u'Asus Network Technologies, Inc.', 0x000410: u'Spinnaker Networks, Inc.', 0x000411: u'Inkra Networks, Inc.', 0x000412: u'WaveSmith Networks, Inc.', 0x000413: u'SNOM Technology AG', 0x000414: u'Umezawa Musen Denki Co., Ltd.', 0x000415: u'Rasteme Systems Co., Ltd.', 0x000416: u'Parks S/A Comunicacoes Digitais', 0x000417: u'ELAU AG', 0x000418: u'Teltronic S.A.U.', 0x000419: u'Fibercycle Networks, Inc.', 0x00041A: u'ines GmbH', 0x00041B: u'Digital Interfaces Ltd.', 0x00041C: u'ipDialog, Inc.', 0x00041D: u'Corega of America', 0x00041E: u'Shikoku Instrumentation Co., Ltd.', 0x00041F: u'Sony Computer Entertainment, Inc.', 0x000420: u'Slim Devices, Inc.', 0x000421: u'Ocular Networks', 0x000422: u'Gordon Kapes, Inc.', 0x000423: u'Intel Corporation', 0x000424: u'TMC s.r.l.', 0x000425: u'Atmel Corporation', 0x000426: u'Autosys', 0x000427: u'Cisco Systems, Inc.', 0x000428: u'Cisco Systems, Inc.', 0x000429: u'Pixord Corporation', 0x00042A: u'Wireless Networks, Inc.', 0x00042B: u'IT Access Co., Ltd.', 0x00042C: u'Minet, Inc.', 0x00042D: u'Sarian Systems, Ltd.', 0x00042E: u'Netous Technologies, Ltd.', 0x00042F: u'International Communications Products, Inc.', 0x000430: u'Netgem', 0x000431: u'GlobalStreams, Inc.', 0x000432: u'Voyetra Turtle Beach, Inc.', 0x000433: u'Cyberboard A/S', 0x000434: u'Accelent Systems, Inc.', 0x000435: u'Comptek International, Inc.', 0x000436: u'ELANsat Technologies, Inc.', 0x000437: u'Powin Information Technology, Inc.', 0x000438: u'Nortel Networks', 0x000439: u'Rosco Entertainment Technology, Inc.', 0x00043A: u'Intelligent Telecommunications, Inc.', 0x00043B: u'Lava Computer Mfg., Inc.', 0x00043C: u'SONOS Co., Ltd.', 0x00043D: u'INDEL AG', 0x00043E: u'Telencomm', 0x00043F: u'Electronic Systems Technology, Inc.', 0x000440: u'cyberPIXIE, Inc.', 0x000441: u'Half Dome Systems, Inc.', 0x000442: u'NACT', 0x000443: u'Agilent Technologies, Inc.', 0x000444: u'Western Multiplex Corporation', 0x000445: u'LMS Skalar Instruments GmbH', 0x000446: u'CYZENTECH Co., Ltd.', 0x000447: u'Acrowave Systems Co., Ltd.', 0x000448: u'Polaroid Professional Imaging', 0x000449: u'Mapletree Networks', 0x00044A: u'iPolicy Networks, Inc.', 0x00044B: u'NVIDIA', 0x00044C: u'JENOPTIK', 0x00044D: u'Cisco Systems, Inc.', 0x00044E: u'Cisco Systems, Inc.', 0x00044F: u'Leukhardt Systemelektronik GmbH', 0x000450: u'DMD Computers SRL', 0x000451: u'Medrad, Inc.', 0x000452: u'RocketLogix, Inc.', 0x000453: u'YottaYotta, Inc.', 0x000454: u'Quadriga UK', 0x000455: u'ANTARA.net', 0x000456: u'PipingHot Networks', 0x000457: u'Universal Access Technology, Inc.', 0x000458: u'Fusion X Co., Ltd.', 0x000459: u'Veristar Corporation', 0x00045A: u'The Linksys Group, Inc.', 0x00045B: u'Techsan Electronics Co., Ltd.', 0x00045C: u'Mobiwave Pte Ltd', 0x00045D: u'BEKA Elektronik', 0x00045E: u'PolyTrax Information Technology AG', 0x00045F: u'Evalue Technology, Inc.', 0x000460: u'Knilink Technology, Inc.', 0x000461: u'EPOX Computer Co., Ltd.', 0x000462: u'DAKOS Data & Communication Co., Ltd.', 0x000463: u'Bosch Security Systems', 0x000464: u'Fantasma Networks, Inc.', 0x000465: u'i.s.t isdn-support technik GmbH', 0x000466: u'ARMITEL Co.', 0x000467: u'Wuhan Research Institute of MII', 0x000468: u'Vivity, Inc.', 0x000469: u'Innocom, Inc.', 0x00046A: u'Navini Networks', 0x00046B: u'Palm Wireless, Inc.', 0x00046C: u'Cyber Technology Co., Ltd.', 0x00046D: u'Cisco Systems, Inc.', 0x00046E: u'Cisco Systems, Inc.', 0x00046F: u'Digitel S/A Industria Eletronica', 0x000470: u'ipUnplugged AB', 0x000471: u'IPrad', 0x000472: u'Telelynx, Inc.', 0x000473: u'Photonex Corporation', 0x000474: u'LEGRAND', 0x000475: u'3 Com Corporation', 0x000476: u'3 Com Corporation', 0x000477: u'Scalant Systems, Inc.', 0x000478: u'G. Star Technology Corporation', 0x000479: u'Radius Co., Ltd.', 0x00047A: u'AXXESSIT ASA', 0x00047B: u'Schlumberger', 0x00047C: u'Skidata AG', 0x00047D: u'Pelco', 0x00047E: u'Optelecom=NKF', 0x00047F: u'Chr. Mayr GmbH & Co. KG', 0x000480: u'Foundry Networks, Inc.', 0x000481: u'Econolite Control Products, Inc.', 0x000482: u'Medialogic Corp.', 0x000483: u'Deltron Technology, Inc.', 0x000484: u'Amann GmbH', 0x000485: u'PicoLight', 0x000486: u'ITTC, University of Kansas', 0x000487: u'Cogency Semiconductor, Inc.', 0x000488: u'Eurotherm Controls', 0x000489: u'YAFO Networks, Inc.', 0x00048A: u'Temia Vertriebs GmbH', 0x00048B: u'Poscon Corporation', 0x00048C: u'Nayna Networks, Inc.', 0x00048D: u'Tone Commander Systems, Inc.', 0x00048E: u'Ohm Tech Labs, Inc.', 0x00048F: u'TD Systems Corp.', 0x000490: u'Optical Access', 0x000491: u'Technovision, Inc.', 0x000492: u'Hive Internet, Ltd.', 0x000493: u'Tsinghua Unisplendour Co., Ltd.', 0x000494: u'Breezecom, Ltd.', 0x000495: u'Tejas Networks', 0x000496: u'Extreme Networks', 0x000497: u'MacroSystem Digital Video AG', 0x000498: u'Mahi Networks', 0x000499: u'Chino Corporation', 0x00049A: u'Cisco Systems, Inc.', 0x00049B: u'Cisco Systems, Inc.', 0x00049C: u'Surgient Networks, Inc.', 0x00049D: u'Ipanema Technologies', 0x00049E: u'Wirelink Co., Ltd.', 0x00049F: u'Freescale Semiconductor', 0x0004A0: u'Verity Instruments, Inc.', 0x0004A1: u'Pathway Connectivity', 0x0004A2: u'L.S.I. Japan Co., Ltd.', 0x0004A3: u'Microchip Technology, Inc.', 0x0004A4: u'NetEnabled, Inc.', 0x0004A5: u'Barco Projection Systems NV', 0x0004A6: u'SAF Tehnika Ltd.', 0x0004A7: u'FabiaTech Corporation', 0x0004A8: u'Broadmax Technologies, Inc.', 0x0004A9: u'SandStream Technologies, Inc.', 0x0004AA: u'Jetstream Communications', 0x0004AB: u'Comverse Network Systems, Inc.', 0x0004AC: u'IBM CORP.', 0x0004AD: u'Malibu Networks', 0x0004AE: u'Liquid Metronics', 0x0004AF: u'Digital Fountain, Inc.', 0x0004B0: u'ELESIGN Co., Ltd.', 0x0004B1: u'Signal Technology, Inc.', 0x0004B2: u'ESSEGI SRL', 0x0004B3: u'Videotek, Inc.', 0x0004B4: u'CIAC', 0x0004B5: u'Equitrac Corporation', 0x0004B6: u'Stratex Networks, Inc.', 0x0004B7: u'AMB i.t. Holding', 0x0004B8: u'Kumahira Co., Ltd.', 0x0004B9: u'S.I. Soubou, Inc.', 0x0004BA: u'KDD Media Will Corporation', 0x0004BB: u'Bardac Corporation', 0x0004BC: u'Giantec, Inc.', 0x0004BD: u'Motorola BCS', 0x0004BE: u'OptXCon, Inc.', 0x0004BF: u'VersaLogic Corp.', 0x0004C0: u'Cisco Systems, Inc.', 0x0004C1: u'Cisco Systems, Inc.', 0x0004C2: u'Magnipix, Inc.', 0x0004C3: u'CASTOR Informatique', 0x0004C4: u'Allen & Heath Limited', 0x0004C5: u'ASE Technologies, USA', 0x0004C6: u'Yamaha Motor Co., Ltd.', 0x0004C7: u'NetMount', 0x0004C8: u'LIBA Maschinenfabrik GmbH', 0x0004C9: u'Micro Electron Co., Ltd.', 0x0004CA: u'FreeMs Corp.', 0x0004CB: u'Tdsoft Communication, Ltd.', 0x0004CC: u'Peek Traffic B.V.', 0x0004CD: u'Informedia Research Group', 0x0004CE: u'Patria Ailon', 0x0004CF: u'Seagate Technology', 0x0004D0: u'Softlink s.r.o.', 0x0004D1: u'Drew Technologies, Inc.', 0x0004D2: u'Adcon Telemetry GmbH', 0x0004D3: u'Toyokeiki Co., Ltd.', 0x0004D4: u'Proview Electronics Co., Ltd.', 0x0004D5: u'Hitachi Communication Systems, Inc.', 0x0004D6: u'Takagi Industrial Co., Ltd.', 0x0004D7: u'Omitec Instrumentation Ltd.', 0x0004D8: u'IPWireless, Inc.', 0x0004D9: u'Titan Electronics, Inc.', 0x0004DA: u'Relax Technology, Inc.', 0x0004DB: u'Tellus Group Corp.', 0x0004DC: u'Nortel Networks', 0x0004DD: u'Cisco Systems, Inc.', 0x0004DE: u'Cisco Systems, Inc.', 0x0004DF: u'Teracom Telematica Ltda.', 0x0004E0: u'Procket Networks', 0x0004E1: u'Infinior Microsystems', 0x0004E2: u'SMC Networks, Inc.', 0x0004E3: u'Accton Technology Corp.', 0x0004E4: u'Daeryung Ind., Inc.', 0x0004E5: u'Glonet Systems, Inc.', 0x0004E6: u'Banyan Network Private Limited', 0x0004E7: u'Lightpointe Communications, Inc', 0x0004E8: u'IER, Inc.', 0x0004E9: u'Infiniswitch Corporation', 0x0004EA: u'Hewlett-Packard Company', 0x0004EB: u'Paxonet Communications, Inc.', 0x0004EC: u'Memobox SA', 0x0004ED: u'Billion Electric Co., Ltd.', 0x0004EE: u'Lincoln Electric Company', 0x0004EF: u'Polestar Corp.', 0x0004F0: u'International Computers, Ltd', 0x0004F1: u'WhereNet', 0x0004F2: u'Polycom', 0x0004F3: u'FS FORTH-SYSTEME GmbH', 0x0004F4: u'Infinite Electronics Inc.', 0x0004F5: u'SnowShore Networks, Inc.', 0x0004F6: u'Amphus', 0x0004F7: u'Omega Band, Inc.', 0x0004F8: u'QUALICABLE TV Industria E Com., Ltda', 0x0004F9: u'Xtera Communications, Inc.', 0x0004FA: u'NBS Technologies Inc.', 0x0004FB: u'Commtech, Inc.', 0x0004FC: u'Stratus Computer (DE), Inc.', 0x0004FD: u'Japan Control Engineering Co., Ltd.', 0x0004FE: u'Pelago Networks', 0x0004FF: u'Acronet Co., Ltd.', 0x000500: u'Cisco Systems, Inc.', 0x000501: u'Cisco Systems, Inc.', 0x000502: u'APPLE COMPUTER', 0x000503: u'ICONAG', 0x000504: u'Naray Information & Communication Enterprise', 0x000505: u'Systems Integration Solutions, Inc.', 0x000506: u'Reddo Networks AB', 0x000507: u'Fine Appliance Corp.', 0x000508: u'Inetcam, Inc.', 0x000509: u'AVOC Nishimura Ltd.', 0x00050A: u'ICS Spa', 0x00050B: u'SICOM Systems, Inc.', 0x00050C: u'Network Photonics, Inc.', 0x00050D: u'Midstream Technologies, Inc.', 0x00050E: u'3ware, Inc.', 0x00050F: u'Tanaka S/S Ltd.', 0x000510: u'Infinite Shanghai Communication Terminals Ltd.', 0x000511: u'Complementary Technologies Ltd', 0x000512: u'MeshNetworks, Inc.', 0x000513: u'VTLinx Multimedia Systems, Inc.', 0x000514: u'KDT Systems Co., Ltd.', 0x000515: u'Nuark Co., Ltd.', 0x000516: u'SMART Modular Technologies', 0x000517: u'Shellcomm, Inc.', 0x000518: u'Jupiters Technology', 0x000519: u'Siemens Building Technologies AG,', 0x00051A: u'3Com Europe Ltd.', 0x00051B: u'Magic Control Technology Corporation', 0x00051C: u'Xnet Technology Corp.', 0x00051D: u'Airocon, Inc.', 0x00051E: u'Brocade Communications Systems, Inc.', 0x00051F: u'Taijin Media Co., Ltd.', 0x000520: u'Smartronix, Inc.', 0x000521: u'Control Microsystems', 0x000522: u'LEA*D Corporation, Inc.', 0x000523: u'AVL List GmbH', 0x000524: u'BTL System (HK) Limited', 0x000525: u'Puretek Industrial Co., Ltd.', 0x000526: u'IPAS GmbH', 0x000527: u'SJ Tek Co. Ltd', 0x000528: u'New Focus, Inc.', 0x000529: u'Shanghai Broadan Communication Technology Co., Ltd', 0x00052A: u'Ikegami Tsushinki Co., Ltd.', 0x00052B: u'HORIBA, Ltd.', 0x00052C: u'Supreme Magic Corporation', 0x00052D: u'Zoltrix International Limited', 0x00052E: u'Cinta Networks', 0x00052F: u'Leviton Voice and Data', 0x000530: u'Andiamo Systems, Inc.', 0x000531: u'Cisco Systems, Inc.', 0x000532: u'Cisco Systems, Inc.', 0x000533: u'Sanera Systems, Inc.', 0x000534: u'Northstar Engineering Ltd.', 0x000535: u'Chip PC Ltd.', 0x000536: u'Danam Communications, Inc.', 0x000537: u'Nets Technology Co., Ltd.', 0x000538: u'Merilus, Inc.', 0x000539: u'A Brand New World in Sweden AB', 0x00053A: u'Willowglen Services Pte Ltd', 0x00053B: u'Harbour Networks Ltd., Co. Beijing', 0x00053C: u'Xircom', 0x00053D: u'Agere Systems', 0x00053E: u'KID Systeme GmbH', 0x00053F: u'VisionTek, Inc.', 0x000540: u'FAST Corporation', 0x000541: u'Advanced Systems Co., Ltd.', 0x000542: u'Otari, Inc.', 0x000543: u'IQ Wireless GmbH', 0x000544: u'Valley Technologies, Inc.', 0x000545: u'Internet Photonics', 0x000546: u'KDDI Network & Solultions Inc.', 0x000547: u'Starent Networks', 0x000548: u'Disco Corporation', 0x000549: u'Salira Optical Network Systems', 0x00054A: u'Ario Data Networks, Inc.', 0x00054B: u'Micro Innovation AG', 0x00054C: u'RF Innovations Pty Ltd', 0x00054D: u'Brans Technologies, Inc.', 0x00054E: u'Philips Components', 0x00054F: u'PRIVATE', 0x000550: u'Vcomms Limited', 0x000551: u'F & S Elektronik Systeme GmbH', 0x000552: u'Xycotec Computer GmbH', 0x000553: u'DVC Company, Inc.', 0x000554: u'Rangestar Wireless', 0x000555: u'Japan Cash Machine Co., Ltd.', 0x000556: u'360 Systems', 0x000557: u'Agile TV Corporation', 0x000558: u'Synchronous, Inc.', 0x000559: u'Intracom S.A.', 0x00055A: u'Power Dsine Ltd.', 0x00055B: u'Charles Industries, Ltd.', 0x00055C: u'Kowa Company, Ltd.', 0x00055D: u'D-Link Systems, Inc.', 0x00055E: u'Cisco Systems, Inc.', 0x00055F: u'Cisco Systems, Inc.', 0x000560: u'LEADER COMM.CO., LTD', 0x000561: u'nac Image Technology, Inc.', 0x000562: u'Digital View Limited', 0x000563: u'J-Works, Inc.', 0x000564: u'Tsinghua Bitway Co., Ltd.', 0x000565: u'Tailyn Communication Company Ltd.', 0x000566: u'Secui.com Corporation', 0x000567: u'Etymonic Design, Inc.', 0x000568: u'Piltofish Networks AB', 0x000569: u'VMWARE, Inc.', 0x00056A: u'Heuft Systemtechnik GmbH', 0x00056B: u'C.P. Technology Co., Ltd.', 0x00056C: u'Hung Chang Co., Ltd.', 0x00056D: u'Pacific Corporation', 0x00056E: u'National Enhance Technology, Inc.', 0x00056F: u'Innomedia Technologies Pvt. Ltd.', 0x000570: u'Baydel Ltd.', 0x000571: u'Seiwa Electronics Co.', 0x000572: u'Deonet Co., Ltd.', 0x000573: u'Cisco Systems, Inc.', 0x000574: u'Cisco Systems, Inc.', 0x000575: u'CDS-Electronics BV', 0x000576: u'NSM Technology Ltd.', 0x000577: u'SM Information & Communication', 0x000578: u'PRIVATE', 0x000579: u'Universal Control Solution Corp.', 0x00057A: u'Hatteras Networks', 0x00057B: u'Chung Nam Electronic Co., Ltd.', 0x00057C: u'RCO Security AB', 0x00057D: u'Sun Communications, Inc.', 0x00057E: u'Eckelmann Steuerungstechnik GmbH', 0x00057F: u'Acqis Technology', 0x000580: u'Fibrolan Ltd.', 0x000581: u'Snell & Wilcox Ltd.', 0x000582: u'ClearCube Technology', 0x000583: u'ImageCom Limited', 0x000584: u'AbsoluteValue Systems, Inc.', 0x000585: u'Juniper Networks, Inc.', 0x000586: u'Lucent Technologies', 0x000587: u'Locus, Incorporated', 0x000588: u'Sensoria Corp.', 0x000589: u'National Datacomputer', 0x00058A: u'Netcom Co., Ltd.', 0x00058B: u'IPmental, Inc.', 0x00058C: u'Opentech Inc.', 0x00058D: u'Lynx Photonic Networks, Inc.', 0x00058E: u'Flextronics International GmbH & Co. Nfg. KG', 0x00058F: u'CLCsoft co.', 0x000590: u'Swissvoice Ltd.', 0x000591: u'Active Silicon Ltd.', 0x000592: u'Pultek Corp.', 0x000593: u'Grammar Engine Inc.', 0x000594: u'IXXAT Automation GmbH', 0x000595: u'Alesis Corporation', 0x000596: u'Genotech Co., Ltd.', 0x000597: u'Eagle Traffic Control Systems', 0x000598: u'CRONOS S.r.l.', 0x000599: u'DRS Test and Energy Management or DRS-TEM', 0x00059A: u'Cisco Systems, Inc.', 0x00059B: u'Cisco Systems, Inc.', 0x00059C: u'Kleinknecht GmbH, Ing. Buero', 0x00059D: u'Daniel Computing Systems, Inc.', 0x00059E: u'Zinwell Corporation', 0x00059F: u'Yotta Networks, Inc.', 0x0005A0: u'MOBILINE Kft.', 0x0005A1: u'Zenocom', 0x0005A2: u'CELOX Networks', 0x0005A3: u'QEI, Inc.', 0x0005A4: u'Lucid Voice Ltd.', 0x0005A5: u'KOTT', 0x0005A6: u'Extron Electronics', 0x0005A7: u'Hyperchip, Inc.', 0x0005A8: u'WYLE ELECTRONICS', 0x0005A9: u'Princeton Networks, Inc.', 0x0005AA: u'Moore Industries International Inc.', 0x0005AB: u'Cyber Fone, Inc.', 0x0005AC: u'Northern Digital, Inc.', 0x0005AD: u'Topspin Communications, Inc.', 0x0005AE: u'Mediaport USA', 0x0005AF: u'InnoScan Computing A/S', 0x0005B0: u'Korea Computer Technology Co., Ltd.', 0x0005B1: u'ASB Technology BV', 0x0005B2: u'Medison Co., Ltd.', 0x0005B3: u'Asahi-Engineering Co., Ltd.', 0x0005B4: u'Aceex Corporation', 0x0005B5: u'Broadcom Technologies', 0x0005B6: u'INSYS Microelectronics GmbH', 0x0005B7: u'Arbor Technology Corp.', 0x0005B8: u'Electronic Design Associates, Inc.', 0x0005B9: u'Airvana, Inc.', 0x0005BA: u'Area Netwoeks, Inc.', 0x0005BB: u'Myspace AB', 0x0005BC: u'Resorsys Ltd.', 0x0005BD: u'ROAX BV', 0x0005BE: u'Kongsberg Seatex AS', 0x0005BF: u'JustEzy Technology, Inc.', 0x0005C0: u'Digital Network Alacarte Co., Ltd.', 0x0005C1: u'A-Kyung Motion, Inc.', 0x0005C2: u'Soronti, Inc.', 0x0005C3: u'Pacific Instruments, Inc.', 0x0005C4: u'Telect, Inc.', 0x0005C5: u'Flaga HF', 0x0005C6: u'Triz Communications', 0x0005C7: u'I/F-COM A/S', 0x0005C8: u'VERYTECH', 0x0005C9: u'LG Innotek', 0x0005CA: u'Hitron Technology, Inc.', 0x0005CB: u'ROIS Technologies, Inc.', 0x0005CC: u'Sumtel Communications, Inc.', 0x0005CD: u'Denon, Ltd.', 0x0005CE: u'Prolink Microsystems Corporation', 0x0005CF: u'Thunder River Technologies, Inc.', 0x0005D0: u'Solinet Systems', 0x0005D1: u'Metavector Technologies', 0x0005D2: u'DAP Technologies', 0x0005D3: u'eProduction Solutions, Inc.', 0x0005D4: u'FutureSmart Networks, Inc.', 0x0005D5: u'Speedcom Wireless', 0x0005D6: u'Titan Wireless', 0x0005D7: u'Vista Imaging, Inc.', 0x0005D8: u'Arescom, Inc.', 0x0005D9: u'Techno Valley, Inc.', 0x0005DA: u'Apex Automationstechnik', 0x0005DB: u'Nentec GmbH', 0x0005DC: u'Cisco Systems, Inc.', 0x0005DD: u'Cisco Systems, Inc.', 0x0005DE: u'Gi Fone Korea, Inc.', 0x0005DF: u'Electronic Innovation, Inc.', 0x0005E0: u'Empirix Corp.', 0x0005E1: u'Trellis Photonics, Ltd.', 0x0005E2: u'Creativ Network Technologies', 0x0005E3: u'LightSand Communications, Inc.', 0x0005E4: u'Red Lion Controls L.P.', 0x0005E5: u'Renishaw PLC', 0x0005E6: u'Egenera, Inc.', 0x0005E7: u'Netrake Corp.', 0x0005E8: u'TurboWave, Inc.', 0x0005E9: u'Unicess Network, Inc.', 0x0005EA: u'Rednix', 0x0005EB: u'Blue Ridge Networks, Inc.', 0x0005EC: u'Mosaic Systems Inc.', 0x0005ED: u'Technikum Joanneum GmbH', 0x0005EE: u'BEWATOR Group', 0x0005EF: u'ADOIR Digital Technology', 0x0005F0: u'SATEC', 0x0005F1: u'Vrcom, Inc.', 0x0005F2: u'Power R, Inc.', 0x0005F3: u'Weboyn', 0x0005F4: u'System Base Co., Ltd.', 0x0005F5: u'OYO Geospace Corp.', 0x0005F6: u'Young Chang Co. Ltd.', 0x0005F7: u'Analog Devices, Inc.', 0x0005F8: u'Real Time Access, Inc.', 0x0005F9: u'TOA Corporation', 0x0005FA: u'IPOptical, Inc.', 0x0005FB: u'ShareGate, Inc.', 0x0005FC: u'Schenck Pegasus Corp.', 0x0005FD: u'PacketLight Networks Ltd.', 0x0005FE: u'Traficon N.V.', 0x0005FF: u'SNS Solutions, Inc.', 0x000600: u'Toshiba Teli Corporation', 0x000601: u'Otanikeiki Co., Ltd.', 0x000602: u'Cirkitech Electronics Co.', 0x000603: u'Baker Hughes Inc.', 0x000604: u'@Track Communications, Inc.', 0x000605: u'Inncom International, Inc.', 0x000606: u'RapidWAN, Inc.', 0x000607: u'Omni Directional Control Technology Inc.', 0x000608: u'At-Sky SAS', 0x000609: u'Crossport Systems', 0x00060A: u'Blue2space', 0x00060B: u'Paceline Systems Corporation', 0x00060C: u'Melco Industries, Inc.', 0x00060D: u'Wave7 Optics', 0x00060E: u'IGYS Systems, Inc.', 0x00060F: u'Narad Networks Inc', 0x000610: u'Abeona Networks Inc', 0x000611: u'Zeus Wireless, Inc.', 0x000612: u'Accusys, Inc.', 0x000613: u'Kawasaki Microelectronics Incorporated', 0x000614: u'Prism Holdings', 0x000615: u'Kimoto Electric Co., Ltd.', 0x000616: u'Tel Net Co., Ltd.', 0x000617: u'Redswitch Inc.', 0x000618: u'DigiPower Manufacturing Inc.', 0x000619: u'Connection Technology Systems', 0x00061A: u'Zetari Inc.', 0x00061B: u'Portable Systems, IBM Japan Co, Ltd', 0x00061C: u'Hoshino Metal Industries, Ltd.', 0x00061D: u'MIP Telecom, Inc.', 0x00061E: u'Maxan Systems', 0x00061F: u'Vision Components GmbH', 0x000620: u'Serial System Ltd.', 0x000621: u'Hinox, Co., Ltd.', 0x000622: u'Chung Fu Chen Yeh Enterprise Corp.', 0x000623: u'MGE UPS Systems France', 0x000624: u'Gentner Communications Corp.', 0x000625: u'The Linksys Group, Inc.', 0x000626: u'MWE GmbH', 0x000627: u'Uniwide Technologies, Inc.', 0x000628: u'Cisco Systems, Inc.', 0x000629: u'IBM CORPORATION', 0x00062A: u'Cisco Systems, Inc.', 0x00062B: u'INTRASERVER TECHNOLOGY', 0x00062C: u'Network Robots, Inc.', 0x00062D: u'TouchStar Technologies, L.L.C.', 0x00062E: u'Aristos Logic Corp.', 0x00062F: u'Pivotech Systems Inc.', 0x000630: u'Adtranz Sweden', 0x000631: u'Optical Solutions, Inc.', 0x000632: u'Mesco Engineering GmbH', 0x000633: u'Smiths Heimann Biometric Systems', 0x000634: u'GTE Airfone Inc.', 0x000635: u'PacketAir Networks, Inc.', 0x000636: u'Jedai Broadband Networks', 0x000637: u'Toptrend-Meta Information (ShenZhen) Inc.', 0x000638: u'Sungjin C&C Co., Ltd.', 0x000639: u'Newtec', 0x00063A: u'Dura Micro, Inc.', 0x00063B: u'Arcturus Networks, Inc.', 0x00063C: u'NMI Electronics Ltd', 0x00063D: u'Microwave Data Systems Inc.', 0x00063E: u'Opthos Inc.', 0x00063F: u'Everex Communications Inc.', 0x000640: u'White Rock Networks', 0x000641: u'ITCN', 0x000642: u'Genetel Systems Inc.', 0x000643: u'SONO Computer Co., Ltd.', 0x000644: u'NEIX Inc.', 0x000645: u'Meisei Electric Co. Ltd.', 0x000646: u'ShenZhen XunBao Network Technology Co Ltd', 0x000647: u'Etrali S.A.', 0x000648: u'Seedsware, Inc.', 0x000649: u'Quante', 0x00064A: u'Honeywell Co., Ltd. (KOREA)', 0x00064B: u'Alexon Co., Ltd.', 0x00064C: u'Invicta Networks, Inc.', 0x00064D: u'Sencore', 0x00064E: u'Broad Net Technology Inc.', 0x00064F: u'PRO-NETS Technology Corporation', 0x000650: u'Tiburon Networks, Inc.', 0x000651: u'Aspen Networks Inc.', 0x000652: u'Cisco Systems, Inc.', 0x000653: u'Cisco Systems, Inc.', 0x000654: u'Maxxio Technologies', 0x000655: u'Yipee, Inc.', 0x000656: u'Tactel AB', 0x000657: u'Market Central, Inc.', 0x000658: u'Helmut Fischer GmbH & Co. KG', 0x000659: u'EAL (Apeldoorn) B.V.', 0x00065A: u'Strix Systems', 0x00065B: u'Dell Computer Corp.', 0x00065C: u'Malachite Technologies, Inc.', 0x00065D: u'Heidelberg Web Systems', 0x00065E: u'Photuris, Inc.', 0x00065F: u'ECI Telecom - NGTS Ltd.', 0x000660: u'NADEX Co., Ltd.', 0x000661: u'NIA Home Technologies Corp.', 0x000662: u'MBM Technology Ltd.', 0x000663: u'Human Technology Co., Ltd.', 0x000664: u'Fostex Corporation', 0x000665: u'Sunny Giken, Inc.', 0x000666: u'Roving Networks', 0x000667: u'Tripp Lite', 0x000668: u'Vicon Industries Inc.', 0x000669: u'Datasound Laboratories Ltd', 0x00066A: u'InfiniCon Systems, Inc.', 0x00066B: u'Sysmex Corporation', 0x00066C: u'Robinson Corporation', 0x00066D: u'Compuprint S.P.A.', 0x00066E: u'Delta Electronics, Inc.', 0x00066F: u'Korea Data Systems', 0x000670: u'Upponetti Oy', 0x000671: u'Softing AG', 0x000672: u'Netezza', 0x000673: u'Optelecom-nkf', 0x000674: u'Spectrum Control, Inc.', 0x000675: u'Banderacom, Inc.', 0x000676: u'Novra Technologies Inc.', 0x000677: u'SICK AG', 0x000678: u'Marantz Japan, Inc.', 0x000679: u'Konami Corporation', 0x00067A: u'JMP Systems', 0x00067B: u'Toplink C&C Corporation', 0x00067C: u'CISCO SYSTEMS, INC.', 0x00067D: u'Takasago Ltd.', 0x00067E: u'WinCom Systems, Inc.', 0x00067F: u'Rearden Steel Technologies', 0x000680: u'Card Access, Inc.', 0x000681: u'Goepel Electronic GmbH', 0x000682: u'Convedia', 0x000683: u'Bravara Communications, Inc.', 0x000684: u'Biacore AB', 0x000685: u'NetNearU Corporation', 0x000686: u'ZARDCOM Co., Ltd.', 0x000687: u'Omnitron Systems Technology, Inc.', 0x000688: u'Telways Communication Co., Ltd.', 0x000689: u'yLez Technologies Pte Ltd', 0x00068A: u'NeuronNet Co. Ltd. R&D Center', 0x00068B: u'AirRunner Technologies, Inc.', 0x00068C: u'3Com Corporation', 0x00068D: u'SEPATON, Inc.', 0x00068E: u'HID Corporation', 0x00068F: u'Telemonitor, Inc.', 0x000690: u'Euracom Communication GmbH', 0x000691: u'PT Inovacao', 0x000692: u'Intruvert Networks, Inc.', 0x000693: u'Flexus Computer Technology, Inc.', 0x000694: u'Mobillian Corporation', 0x000695: u'Ensure Technologies, Inc.', 0x000696: u'Advent Networks', 0x000697: u'R & D Center', 0x000698: u'egnite Software GmbH', 0x000699: u'Vida Design Co.', 0x00069A: u'e & Tel', 0x00069B: u'AVT Audio Video Technologies GmbH', 0x00069C: u'Transmode Systems AB', 0x00069D: u'Petards Mobile Intelligence', 0x00069E: u'UNIQA, Inc.', 0x00069F: u'Kuokoa Networks', 0x0006A0: u'Mx Imaging', 0x0006A1: u'Celsian Technologies, Inc.', 0x0006A2: u'Microtune, Inc.', 0x0006A3: u'Bitran Corporation', 0x0006A4: u'INNOWELL Corp.', 0x0006A5: u'PINON Corp.', 0x0006A6: u'Artistic Licence (UK) Ltd', 0x0006A7: u'Primarion', 0x0006A8: u'KC Technology, Inc.', 0x0006A9: u'Universal Instruments Corp.', 0x0006AA: u'Miltope Corporation', 0x0006AB: u'W-Link Systems, Inc.', 0x0006AC: u'Intersoft Co.', 0x0006AD: u'KB Electronics Ltd.', 0x0006AE: u'Himachal Futuristic Communications Ltd', 0x0006AF: u'PRIVATE', 0x0006B0: u'Comtech EF Data Corp.', 0x0006B1: u'Sonicwall', 0x0006B2: u'Linxtek Co.', 0x0006B3: u'Diagraph Corporation', 0x0006B4: u'Vorne Industries, Inc.', 0x0006B5: u'Luminent, Inc.', 0x0006B6: u'Nir-Or Israel Ltd.', 0x0006B7: u'TELEM GmbH', 0x0006B8: u'Bandspeed Pty Ltd', 0x0006B9: u'A5TEK Corp.', 0x0006BA: u'Westwave Communications', 0x0006BB: u'ATI Technologies Inc.', 0x0006BC: u'Macrolink, Inc.', 0x0006BD: u'BNTECHNOLOGY Co., Ltd.', 0x0006BE: u'Baumer Optronic GmbH', 0x0006BF: u'Accella Technologies Co., Ltd.', 0x0006C0: u'United Internetworks, Inc.', 0x0006C1: u'CISCO SYSTEMS, INC.', 0x0006C2: u'Smartmatic Corporation', 0x0006C3: u'Schindler Elevators Ltd.', 0x0006C4: u'Piolink Inc.', 0x0006C5: u'INNOVI Technologies Limited', 0x0006C6: u'lesswire AG', 0x0006C7: u'RFNET Technologies Pte Ltd (S)', 0x0006C8: u'Sumitomo Metal Micro Devices, Inc.', 0x0006C9: u'Technical Marketing Research, Inc.', 0x0006CA: u'American Computer & Digital Components, Inc. (ACDC)', 0x0006CB: u'Jotron Electronics A/S', 0x0006CC: u'JMI Electronics Co., Ltd.', 0x0006CD: u'Kodak IL Ltd.', 0x0006CE: u'DATENO', 0x0006CF: u'Thales Avionics In-Flight Systems, LLC', 0x0006D0: u'Elgar Electronics Corp.', 0x0006D1: u'Tahoe Networks, Inc.', 0x0006D2: u'Tundra Semiconductor Corp.', 0x0006D3: u'Alpha Telecom, Inc. U.S.A.', 0x0006D4: u'Interactive Objects, Inc.', 0x0006D5: u'Diamond Systems Corp.', 0x0006D6: u'Cisco Systems, Inc.', 0x0006D7: u'Cisco Systems, Inc.', 0x0006D8: u'Maple Optical Systems', 0x0006D9: u'IPM-Net S.p.A.', 0x0006DA: u'ITRAN Communications Ltd.', 0x0006DB: u'ICHIPS Co., Ltd.', 0x0006DC: u'Syabas Technology (Amquest)', 0x0006DD: u'AT & T Laboratories - Cambridge Ltd', 0x0006DE: u'Flash Technology', 0x0006DF: u'AIDONIC Corporation', 0x0006E0: u'MAT Co., Ltd.', 0x0006E1: u'Techno Trade s.a', 0x0006E2: u'Ceemax Technology Co., Ltd.', 0x0006E3: u'Quantitative Imaging Corporation', 0x0006E4: u'Citel Technologies Ltd.', 0x0006E5: u'Fujian Newland Computer Ltd. Co.', 0x0006E6: u'DongYang Telecom Co., Ltd.', 0x0006E7: u'Bit Blitz Communications Inc.', 0x0006E8: u'Optical Network Testing, Inc.', 0x0006E9: u'Intime Corp.', 0x0006EA: u'ELZET80 Mikrocomputer GmbH&Co. KG', 0x0006EB: u'Global Data', 0x0006EC: u'M/A COM Private Radio System Inc.', 0x0006ED: u'Inara Networks', 0x0006EE: u'Shenyang Neu-era Information & Technology Stock Co., Ltd', 0x0006EF: u'Maxxan Systems, Inc.', 0x0006F0: u'Digeo, Inc.', 0x0006F1: u'Optillion', 0x0006F2: u'Platys Communications', 0x0006F3: u'AcceLight Networks', 0x0006F4: u'Prime Electronics & Satellitics Inc.', 0x0006F8: u'CPU Technology, Inc.', 0x0006F9: u'Mitsui Zosen Systems Research Inc.', 0x0006FA: u'IP SQUARE Co, Ltd.', 0x0006FB: u'Hitachi Printing Solutions, Ltd.', 0x0006FC: u'Fnet Co., Ltd.', 0x0006FD: u'Comjet Information Systems Corp.', 0x0006FE: u'Celion Networks, Inc.', 0x0006FF: u'Sheba Systems Co., Ltd.', 0x000700: u'Zettamedia Korea', 0x000701: u'RACAL-DATACOM', 0x000702: u'Varian Medical Systems', 0x000703: u'CSEE Transport', 0x000705: u'Endress & Hauser GmbH & Co', 0x000706: u'Sanritz Corporation', 0x000707: u'Interalia Inc.', 0x000708: u'Bitrage Inc.', 0x000709: u'Westerstrand Urfabrik AB', 0x00070A: u'Unicom Automation Co., Ltd.', 0x00070B: u'Octal, SA', 0x00070C: u'SVA-Intrusion.com Co. Ltd.', 0x00070D: u'Cisco Systems Inc.', 0x00070E: u'Cisco Systems Inc.', 0x00070F: u'Fujant, Inc.', 0x000710: u'Adax, Inc.', 0x000711: u'Acterna', 0x000712: u'JAL Information Technology', 0x000713: u'IP One, Inc.', 0x000714: u'Brightcom', 0x000715: u'General Research of Electronics, Inc.', 0x000716: u'J & S Marine Ltd.', 0x000717: u'Wieland Electric GmbH', 0x000718: u'iCanTek Co., Ltd.', 0x000719: u'Mobiis Co., Ltd.', 0x00071A: u'Finedigital Inc.', 0x00071B: u'Position Technology Inc.', 0x00071C: u'AT&T Fixed Wireless Services', 0x00071D: u'Satelsa Sistemas Y Aplicaciones De Telecomunicaciones, S.A.', 0x00071E: u'Tri-M Engineering / Nupak Dev. Corp.', 0x00071F: u'European Systems Integration', 0x000720: u'Trutzschler GmbH & Co. KG', 0x000721: u'Formac Elektronik GmbH', 0x000722: u'Nielsen Media Research', 0x000723: u'ELCON Systemtechnik GmbH', 0x000724: u'Telemax Co., Ltd.', 0x000725: u'Bematech International Corp.', 0x000727: u'Zi Corporation (HK) Ltd.', 0x000728: u'Neo Telecom', 0x000729: u'Kistler Instrumente AG', 0x00072A: u'Innovance Networks', 0x00072B: u'Jung Myung Telecom Co., Ltd.', 0x00072C: u'Fabricom', 0x00072D: u'CNSystems', 0x00072E: u'North Node AB', 0x00072F: u'Intransa, Inc.', 0x000730: u'Hutchison OPTEL Telecom Technology Co., Ltd.', 0x000731: u'Spiricon, Inc.', 0x000732: u'AAEON Technology Inc.', 0x000733: u'DANCONTROL Engineering', 0x000734: u'ONStor, Inc.', 0x000735: u'Flarion Technologies, Inc.', 0x000736: u'Data Video Technologies Co., Ltd.', 0x000737: u'Soriya Co. Ltd.', 0x000738: u'Young Technology Co., Ltd.', 0x000739: u'Motion Media Technology Ltd.', 0x00073A: u'Inventel Systemes', 0x00073B: u'Tenovis GmbH & Co KG', 0x00073C: u'Telecom Design', 0x00073D: u'Nanjing Postel Telecommunications Co., Ltd.', 0x00073E: u'China Great-Wall Computer Shenzhen Co., Ltd.', 0x00073F: u'Woojyun Systec Co., Ltd.', 0x000740: u'Melco Inc.', 0x000741: u'Sierra Automated Systems', 0x000742: u'Current Technologies', 0x000743: u'Chelsio Communications', 0x000744: u'Unico, Inc.', 0x000745: u'Radlan Computer Communications Ltd.', 0x000746: u'TURCK, Inc.', 0x000747: u'Mecalc', 0x000748: u'The Imaging Source Europe', 0x000749: u'CENiX Inc.', 0x00074A: u'Carl Valentin GmbH', 0x00074B: u'Daihen Corporation', 0x00074C: u'Beicom Inc.', 0x00074D: u'Zebra Technologies Corp.', 0x00074E: u'Naughty boy co., Ltd.', 0x00074F: u'Cisco Systems, Inc.', 0x000750: u'Cisco Systems, Inc.', 0x000751: u'm.u.t. - GmbH', 0x000752: u'Rhythm Watch Co., Ltd.', 0x000753: u'Beijing Qxcomm Technology Co., Ltd.', 0x000754: u'Xyterra Computing, Inc.', 0x000755: u'Lafon SA', 0x000756: u'Juyoung Telecom', 0x000757: u'Topcall International AG', 0x000758: u'Dragonwave', 0x000759: u'Boris Manufacturing Corp.', 0x00075A: u'Air Products and Chemicals, Inc.', 0x00075B: u'Gibson Guitars', 0x00075C: u'Eastman Kodak Company', 0x00075D: u'Celleritas Inc.', 0x00075E: u'Ametek Power Instruments', 0x00075F: u'VCS Video Communication Systems AG', 0x000760: u'TOMIS Information & Telecom Corp.', 0x000761: u'Logitech SA', 0x000762: u'Group Sense Limited', 0x000763: u'Sunniwell Cyber Tech. Co., Ltd.', 0x000764: u'YoungWoo Telecom Co. Ltd.', 0x000765: u'Jade Quantum Technologies, Inc.', 0x000766: u'Chou Chin Industrial Co., Ltd.', 0x000767: u'Yuxing Electronics Company Limited', 0x000768: u'Danfoss A/S', 0x000769: u'Italiana Macchi SpA', 0x00076A: u'NEXTEYE Co., Ltd.', 0x00076B: u'Stralfors AB', 0x00076C: u'Daehanet, Inc.', 0x00076D: u'Flexlight Networks', 0x00076E: u'Sinetica Corporation Limited', 0x00076F: u'Synoptics Limited', 0x000770: u'Locusnetworks Corporation', 0x000771: u'Embedded System Corporation', 0x000772: u'Alcatel Shanghai Bell Co., Ltd.', 0x000773: u'Ascom Powerline Communications Ltd.', 0x000774: u'GuangZhou Thinker Technology Co. Ltd.', 0x000775: u'Valence Semiconductor, Inc.', 0x000776: u'Federal APD', 0x000777: u'Motah Ltd.', 0x000778: u'GERSTEL GmbH & Co. KG', 0x000779: u'Sungil Telecom Co., Ltd.', 0x00077A: u'Infoware System Co., Ltd.', 0x00077B: u'Millimetrix Broadband Networks', 0x00077C: u'OnTime Networks', 0x00077E: u'Elrest GmbH', 0x00077F: u'J Communications Co., Ltd.', 0x000780: u'Bluegiga Technologies OY', 0x000781: u'Itron Inc.', 0x000782: u'Nauticus Networks, Inc.', 0x000783: u'SynCom Network, Inc.', 0x000784: u'Cisco Systems Inc.', 0x000785: u'Cisco Systems Inc.', 0x000786: u'Wireless Networks Inc.', 0x000787: u'Idea System Co., Ltd.', 0x000788: u'Clipcomm, Inc.', 0x000789: u'Eastel Systems Corporation', 0x00078A: u'Mentor Data System Inc.', 0x00078B: u'Wegener Communications, Inc.', 0x00078C: u'Elektronikspecialisten i Borlange AB', 0x00078D: u'NetEngines Ltd.', 0x00078E: u'Garz & Friche GmbH', 0x00078F: u'Emkay Innovative Products', 0x000790: u'Tri-M Technologies (s) Limited', 0x000791: u'International Data Communications, Inc.', 0x000792: u'Suetron Electronic GmbH', 0x000793: u'Shin Satellite Public Company Limited', 0x000794: u'Simple Devices, Inc.', 0x000795: u'Elitegroup Computer System Co. (ECS)', 0x000796: u'LSI Systems, Inc.', 0x000797: u'Netpower Co., Ltd.', 0x000798: u'Selea SRL', 0x000799: u'Tipping Point Technologies, Inc.', 0x00079A: u'SmartSight Networks Inc.', 0x00079B: u'Aurora Networks', 0x00079C: u'Golden Electronics Technology Co., Ltd.', 0x00079D: u'Musashi Co., Ltd.', 0x00079E: u'Ilinx Co., Ltd.', 0x00079F: u'Action Digital Inc.', 0x0007A0: u'e-Watch Inc.', 0x0007A1: u'VIASYS Healthcare GmbH', 0x0007A2: u'Opteon Corporation', 0x0007A3: u'Ositis Software, Inc.', 0x0007A4: u'GN Netcom Ltd.', 0x0007A5: u'Y.D.K Co. Ltd.', 0x0007A6: u'Home Automation, Inc.', 0x0007A7: u'A-Z Inc.', 0x0007A8: u'Haier Group Technologies Ltd.', 0x0007A9: u'Novasonics', 0x0007AA: u'Quantum Data Inc.', 0x0007AC: u'Eolring', 0x0007AD: u'Pentacon GmbH Foto-und Feinwerktechnik', 0x0007AE: u'Britestream Networks, Inc.', 0x0007AF: u'N-Tron Corp.', 0x0007B0: u'Office Details, Inc.', 0x0007B1: u'Equator Technologies', 0x0007B2: u'Transaccess S.A.', 0x0007B3: u'Cisco Systems Inc.', 0x0007B4: u'Cisco Systems Inc.', 0x0007B5: u'Any One Wireless Ltd.', 0x0007B6: u'Telecom Technology Ltd.', 0x0007B7: u'Samurai Ind. Prods Eletronicos Ltda', 0x0007B8: u'American Predator Corp.', 0x0007B9: u'Ginganet Corporation', 0x0007BA: u'UTStarcom, Inc.', 0x0007BB: u'Candera Inc.', 0x0007BC: u'Identix Inc.', 0x0007BD: u'Radionet Ltd.', 0x0007BE: u'DataLogic SpA', 0x0007BF: u'Armillaire Technologies, Inc.', 0x0007C0: u'NetZerver Inc.', 0x0007C1: u'Overture Networks, Inc.', 0x0007C2: u'Netsys Telecom', 0x0007C3: u'Cirpack', 0x0007C4: u'JEAN Co. Ltd.', 0x0007C5: u'Gcom, Inc.', 0x0007C6: u'VDS Vosskuhler GmbH', 0x0007C7: u'Synectics Systems Limited', 0x0007C8: u'Brain21, Inc.', 0x0007C9: u'Technol Seven Co., Ltd.', 0x0007CA: u'Creatix Polymedia Ges Fur Kommunikaitonssysteme', 0x0007CB: u'Freebox SA', 0x0007CC: u'Kaba Benzing GmbH', 0x0007CD: u'NMTEL Co., Ltd.', 0x0007CE: u'Cabletime Limited', 0x0007CF: u'Anoto AB', 0x0007D0: u'Automat Engenharia de Automaoa Ltda.', 0x0007D1: u'Spectrum Signal Processing Inc.', 0x0007D2: u'Logopak Systeme', 0x0007D3: u'Stork Digital Imaging B.V.', 0x0007D4: u'Zhejiang Yutong Network Communication Co Ltd.', 0x0007D5: u'3e Technologies Int;., Inc.', 0x0007D6: u'Commil Ltd.', 0x0007D7: u'Caporis Networks AG', 0x0007D8: u'Hitron Systems Inc.', 0x0007D9: u'Splicecom', 0x0007DA: u'Neuro Telecom Co., Ltd.', 0x0007DB: u'Kirana Networks, Inc.', 0x0007DC: u'Atek Co, Ltd.', 0x0007DD: u'Cradle Technologies', 0x0007DE: u'eCopilt AB', 0x0007DF: u'Vbrick Systems Inc.', 0x0007E0: u'Palm Inc.', 0x0007E1: u'WIS Communications Co. Ltd.', 0x0007E2: u'Bitworks, Inc.', 0x0007E3: u'Navcom Technology, Inc.', 0x0007E4: u'SoftRadio Co., Ltd.', 0x0007E5: u'Coup Corporation', 0x0007E6: u'edgeflow Canada Inc.', 0x0007E7: u'FreeWave Technologies', 0x0007E8: u'St. Bernard Software', 0x0007E9: u'Intel Corporation', 0x0007EA: u'Massana, Inc.', 0x0007EB: u'Cisco Systems Inc.', 0x0007EC: u'Cisco Systems Inc.', 0x0007ED: u'Altera Corporation', 0x0007EE: u'telco Informationssysteme GmbH', 0x0007EF: u'Lockheed Martin Tactical Systems', 0x0007F0: u'LogiSync Corporation', 0x0007F1: u'TeraBurst Networks Inc.', 0x0007F2: u'IOA Corporation', 0x0007F3: u'Thinkengine Networks', 0x0007F4: u'Eletex Co., Ltd.', 0x0007F5: u'Bridgeco Co AG', 0x0007F6: u'Qqest Software Systems', 0x0007F7: u'Galtronics', 0x0007F8: u'ITDevices, Inc.', 0x0007F9: u'Phonetics, Inc.', 0x0007FA: u'ITT Co., Ltd.', 0x0007FB: u'Giga Stream UMTS Technologies GmbH', 0x0007FC: u'Adept Systems Inc.', 0x0007FD: u'LANergy Ltd.', 0x0007FE: u'Rigaku Corporation', 0x0007FF: u'Gluon Networks', 0x000800: u'MULTITECH SYSTEMS, INC.', 0x000801: u'HighSpeed Surfing Inc.', 0x000802: u'Compaq Computer Corporation', 0x000803: u'Cos Tron', 0x000804: u'ICA Inc.', 0x000805: u'Techno-Holon Corporation', 0x000806: u'Raonet Systems, Inc.', 0x000807: u'Access Devices Limited', 0x000808: u'PPT Vision, Inc.', 0x000809: u'Systemonic AG', 0x00080A: u'Espera-Werke GmbH', 0x00080B: u'Birka BPA Informationssystem AB', 0x00080C: u'VDA elettronica SrL', 0x00080D: u'Toshiba', 0x00080E: u'Motorola, BCS', 0x00080F: u'Proximion Fiber Optics AB', 0x000810: u'Key Technology, Inc.', 0x000811: u'VOIX Corporation', 0x000812: u'GM-2 Corporation', 0x000813: u'Diskbank, Inc.', 0x000814: u'TIL Technologies', 0x000815: u'CATS Co., Ltd.', 0x000816: u'Bluetags A/S', 0x000817: u'EmergeCore Networks LLC', 0x000818: u'Pixelworks, Inc.', 0x000819: u'Banksys', 0x00081A: u'Sanrad Intelligence Storage Communications (2000) Ltd.', 0x00081B: u'Windigo Systems', 0x00081C: u'@pos.com', 0x00081D: u'Ipsil, Incorporated', 0x00081E: u'Repeatit AB', 0x00081F: u'Pou Yuen Tech Corp. Ltd.', 0x000820: u'Cisco Systems Inc.', 0x000821: u'Cisco Systems Inc.', 0x000822: u'InPro Comm', 0x000823: u'Texa Corp.', 0x000824: u'Promatek Industries Ltd.', 0x000825: u'Acme Packet', 0x000826: u'Colorado Med Tech', 0x000827: u'Pirelli Broadband Solutions', 0x000828: u'Koei Engineering Ltd.', 0x000829: u'Aval Nagasaki Corporation', 0x00082A: u'Powerwallz Network Security', 0x00082B: u'Wooksung Electronics, Inc.', 0x00082C: u'Homag AG', 0x00082D: u'Indus Teqsite Private Limited', 0x00082E: u'Multitone Electronics PLC', 0x00084E: u'DivergeNet, Inc.', 0x00084F: u'Qualstar Corporation', 0x000850: u'Arizona Instrument Corp.', 0x000851: u'Canadian Bank Note Company, Ltd.', 0x000852: u'Davolink Co. Inc.', 0x000853: u'Schleicher GmbH & Co. Relaiswerke KG', 0x000854: u'Netronix, Inc.', 0x000855: u'NASA-Goddard Space Flight Center', 0x000856: u'Gamatronic Electronic Industries Ltd.', 0x000857: u'Polaris Networks, Inc.', 0x000858: u'Novatechnology Inc.', 0x000859: u'ShenZhen Unitone Electronics Co., Ltd.', 0x00085A: u'IntiGate Inc.', 0x00085B: u'Hanbit Electronics Co., Ltd.', 0x00085C: u'Shanghai Dare Technologies Co. Ltd.', 0x00085D: u'Aastra', 0x00085E: u'PCO AG', 0x00085F: u'Picanol N.V.', 0x000860: u'LodgeNet Entertainment Corp.', 0x000861: u'SoftEnergy Co., Ltd.', 0x000862: u'NEC Eluminant Technologies, Inc.', 0x000863: u'Entrisphere Inc.', 0x000864: u'Fasy S.p.A.', 0x000865: u'JASCOM CO., LTD', 0x000866: u'DSX Access Systems, Inc.', 0x000867: u'Uptime Devices', 0x000868: u'PurOptix', 0x000869: u'Command-e Technology Co.,Ltd.', 0x00086A: u'Industrie Technik IPS GmbH', 0x00086B: u'MIPSYS', 0x00086C: u'Plasmon LMS', 0x00086D: u'Missouri FreeNet', 0x00086E: u'Hyglo AB', 0x00086F: u'Resources Computer Network Ltd.', 0x000870: u'Rasvia Systems, Inc.', 0x000871: u'NORTHDATA Co., Ltd.', 0x000872: u'Sorenson Technologies, Inc.', 0x000873: u'DAP Design B.V.', 0x000874: u'Dell Computer Corp.', 0x000875: u'Acorp Electronics Corp.', 0x000876: u'SDSystem', 0x000877: u'Liebert HIROSS S.p.A.', 0x000878: u'Benchmark Storage Innovations', 0x000879: u'CEM Corporation', 0x00087A: u'Wipotec GmbH', 0x00087B: u'RTX Telecom A/S', 0x00087C: u'Cisco Systems, Inc.', 0x00087D: u'Cisco Systems Inc.', 0x00087E: u'Bon Electro-Telecom Inc.', 0x00087F: u'SPAUN electronic GmbH & Co. KG', 0x000880: u'BroadTel Canada Communications inc.', 0x000881: u'DIGITAL HANDS CO.,LTD.', 0x000882: u'SIGMA CORPORATION', 0x000883: u'Hewlett-Packard Company', 0x000884: u'Index Braille AB', 0x000885: u'EMS Dr. Thomas Wuensche', 0x000886: u'Hansung Teliann, Inc.', 0x000887: u'Maschinenfabrik Reinhausen GmbH', 0x000888: u'OULLIM Information Technology Inc,.', 0x000889: u'Echostar Technologies Corp', 0x00088A: u'Minds@Work', 0x00088B: u'Tropic Networks Inc.', 0x00088C: u'Quanta Network Systems Inc.', 0x00088D: u'Sigma-Links Inc.', 0x00088E: u'Nihon Computer Co., Ltd.', 0x00088F: u'ADVANCED DIGITAL TECHNOLOGY', 0x000890: u'AVILINKS SA', 0x000891: u'Lyan Inc.', 0x000892: u'EM Solutions', 0x000893: u'LE INFORMATION COMMUNICATION INC.', 0x000894: u'InnoVISION Multimedia Ltd.', 0x000895: u'DIRC Technologie GmbH & Co.KG', 0x000896: u'Printronix, Inc.', 0x000897: u'Quake Technologies', 0x000898: u'Gigabit Optics Corporation', 0x000899: u'Netbind, Inc.', 0x00089A: u'Alcatel Microelectronics', 0x00089B: u'ICP Electronics Inc.', 0x00089C: u'Elecs Industry Co., Ltd.', 0x00089D: u'UHD-Elektronik', 0x00089E: u'Beijing Enter-Net co.LTD', 0x00089F: u'EFM Networks', 0x0008A0: u'Stotz Feinmesstechnik GmbH', 0x0008A1: u'CNet Technology Inc.', 0x0008A2: u'ADI Engineering, Inc.', 0x0008A3: u'Cisco Systems', 0x0008A4: u'Cisco Systems', 0x0008A5: u'Peninsula Systems Inc.', 0x0008A6: u'Multiware & Image Co., Ltd.', 0x0008A7: u'iLogic Inc.', 0x0008A8: u'Systec Co., Ltd.', 0x0008A9: u'SangSang Technology, Inc.', 0x0008AA: u'KARAM', 0x0008AB: u'EnerLinx.com, Inc.', 0x0008AC: u'PRIVATE', 0x0008AD: u'Toyo-Linx Co., Ltd.', 0x0008AE: u'PacketFront Sweden AB', 0x0008AF: u'Novatec Corporation', 0x0008B0: u'BKtel communications GmbH', 0x0008B1: u'ProQuent Systems', 0x0008B2: u'SHENZHEN COMPASS TECHNOLOGY DEVELOPMENT CO.,LTD', 0x0008B3: u'Fastwel', 0x0008B4: u'SYSPOL', 0x0008B5: u'TAI GUEN ENTERPRISE CO., LTD', 0x0008B6: u'RouteFree, Inc.', 0x0008B7: u'HIT Incorporated', 0x0008B8: u'E.F. Johnson', 0x0008B9: u'KAON MEDIA Co., Ltd.', 0x0008BA: u'Erskine Systems Ltd', 0x0008BB: u'NetExcell', 0x0008BC: u'Ilevo AB', 0x0008BD: u'TEPG-US', 0x0008BE: u'XENPAK MSA Group', 0x0008BF: u'Aptus Elektronik AB', 0x0008C0: u'ASA SYSTEMS', 0x0008C1: u'Avistar Communications Corporation', 0x0008C2: u'Cisco Systems', 0x0008C3: u'Contex A/S', 0x0008C4: u'Hikari Co.,Ltd.', 0x0008C5: u'Liontech Co., Ltd.', 0x0008C6: u'Philips Consumer Communications', 0x0008C7: u'COMPAQ COMPUTER CORPORATION', 0x0008C8: u'Soneticom, Inc.', 0x0008C9: u'TechniSat Digital GmbH', 0x0008CA: u'TwinHan Technology Co.,Ltd', 0x0008CB: u'Zeta Broadband Inc.', 0x0008CC: u'Remotec, Inc.', 0x0008CD: u'With-Net Inc', 0x0008CE: u'IPMobileNet Inc.', 0x0008CF: u'Nippon Koei Power Systems Co., Ltd.', 0x0008D0: u'Musashi Engineering Co., LTD.', 0x0008D1: u'KAREL INC.', 0x0008D2: u'ZOOM Networks Inc.', 0x0008D3: u'Hercules Technologies S.A.', 0x0008D4: u'IneoQuest Technologies, Inc', 0x0008D5: u'Vanguard Managed Solutions', 0x0008D6: u'HASSNET Inc.', 0x0008D7: u'HOW CORPORATION', 0x0008D8: u'Dowkey Microwave', 0x0008D9: u'Mitadenshi Co.,LTD', 0x0008DA: u'SofaWare Technologies Ltd.', 0x0008DB: u'Corrigent Systems', 0x0008DC: u'Wiznet', 0x0008DD: u'Telena Communications, Inc.', 0x0008DE: u'3UP Systems', 0x0008DF: u'Alistel Inc.', 0x0008E0: u'ATO Technology Ltd.', 0x0008E1: u'Barix AG', 0x0008E2: u'Cisco Systems', 0x0008E3: u'Cisco Systems', 0x0008E4: u'Envenergy Inc', 0x0008E5: u'IDK Corporation', 0x0008E6: u'Littlefeet', 0x0008E7: u'SHI ControlSystems,Ltd.', 0x0008E8: u'Excel Master Ltd.', 0x0008E9: u'NextGig', 0x0008EA: u'Motion Control Engineering, Inc', 0x0008EB: u'ROMWin Co.,Ltd.', 0x0008EC: u'Zonu, Inc.', 0x0008ED: u'ST&T Instrument Corp.', 0x0008EE: u'Logic Product Development', 0x0008EF: u'DIBAL,S.A.', 0x0008F0: u'Next Generation Systems, Inc.', 0x0008F1: u'Voltaire', 0x0008F2: u'C&S Technology', 0x0008F3: u'WANY', 0x0008F4: u'Bluetake Technology Co., Ltd.', 0x0008F5: u'YESTECHNOLOGY Co.,Ltd.', 0x0008F6: u'SUMITOMO ELECTRIC HIGHTECHS.co.,ltd.', 0x0008F7: u'Hitachi Ltd, Semiconductor &amp; Integrated Circuits Gr', 0x0008F8: u'Guardall Ltd', 0x0008F9: u'Padcom, Inc.', 0x0008FA: u'Karl E.Brinkmann GmbH', 0x0008FB: u'SonoSite, Inc.', 0x0008FC: u'Gigaphoton Inc.', 0x0008FD: u'BlueKorea Co., Ltd.', 0x0008FE: u'UNIK C&C Co.,Ltd.', 0x0008FF: u'Trilogy Communications Ltd', 0x000900: u'TMT', 0x000901: u'Shenzhen Shixuntong Information & Technoligy Co', 0x000902: u'Redline Communications Inc.', 0x000903: u'Panasas, Inc', 0x000904: u'MONDIAL electronic', 0x000905: u'iTEC Technologies Ltd.', 0x000906: u'Esteem Networks', 0x000907: u'Chrysalis Development', 0x000908: u'VTech Technology Corp.', 0x000909: u'Telenor Connect A/S', 0x00090A: u'SnedFar Technology Co., Ltd.', 0x00090B: u'MTL Instruments PLC', 0x00090C: u'Mayekawa Mfg. Co. Ltd.', 0x00090D: u'LEADER ELECTRONICS CORP.', 0x00090E: u'Helix Technology Inc.', 0x00090F: u'Fortinet Inc.', 0x000910: u'Simple Access Inc.', 0x000911: u'Cisco Systems', 0x000912: u'Cisco Systems', 0x000913: u'SystemK Corporation', 0x000914: u'COMPUTROLS INC.', 0x000915: u'CAS Corp.', 0x000916: u'Listman Home Technologies, Inc.', 0x000917: u'WEM Technology Inc', 0x000918: u'SAMSUNG TECHWIN CO.,LTD', 0x000919: u'MDS Gateways', 0x00091A: u'Macat Optics & Electronics Co., Ltd.', 0x00091B: u'Digital Generation Inc.', 0x00091C: u'CacheVision, Inc', 0x00091D: u'Proteam Computer Corporation', 0x00091E: u'Firstech Technology Corp.', 0x00091F: u'A&amp;D Co., Ltd.', 0x000920: u'EpoX COMPUTER CO.,LTD.', 0x000921: u'Planmeca Oy', 0x000922: u'Touchless Sensor Technology AG', 0x000923: u'Heaman System Co., Ltd', 0x000924: u'Telebau GmbH', 0x000925: u'VSN Systemen BV', 0x000926: u'YODA COMMUNICATIONS, INC.', 0x000927: u'TOYOKEIKI CO.,LTD.', 0x000928: u'Telecore Inc', 0x000929: u'Sanyo Industries (UK) Limited', 0x00092A: u'MYTECS Co.,Ltd.', 0x00092B: u'iQstor Networks, Inc.', 0x00092C: u'Hitpoint Inc.', 0x00092D: u'High Tech Computer, Corp.', 0x00092E: u'B&Tech System Inc.', 0x00092F: u'Akom Technology Corporation', 0x000930: u'AeroConcierge Inc.', 0x000931: u'Future Internet, Inc.', 0x000932: u'Omnilux', 0x000933: u'OPTOVALLEY Co. Ltd.', 0x000934: u'Dream-Multimedia-Tv GmbH', 0x000935: u'Sandvine Incorporated', 0x000936: u'Ipetronik GmbH & Co.KG', 0x000937: u'Inventec Appliance Corp', 0x000938: u'Allot Communications', 0x000939: u'ShibaSoku Co.,Ltd.', 0x00093A: u'Molex Fiber Optics', 0x00093B: u'HYUNDAI NETWORKS INC.', 0x00093C: u'Jacques Technologies P/L', 0x00093D: u'Newisys,Inc.', 0x00093E: u'C&I Technologies', 0x00093F: u'Double-Win Enterpirse CO., LTD', 0x000940: u'AGFEO GmbH & Co. KG', 0x000941: u'Allied Telesis K.K.', 0x000942: u'CRESCO, LTD.', 0x000943: u'Cisco Systems', 0x000944: u'Cisco Systems', 0x000945: u'Palmmicro Communications Inc', 0x000946: u'Cluster Labs GmbH', 0x000947: u'Aztek, Inc.', 0x000948: u'Vista Control Systems, Corp.', 0x000949: u'Glyph Technologies Inc.', 0x00094A: u'Homenet Communications', 0x00094B: u'FillFactory NV', 0x00094C: u'Communication Weaver Co.,Ltd.', 0x00094D: u'Braintree Communications Pty Ltd', 0x00094E: u'BARTECH SYSTEMS INTERNATIONAL, INC', 0x00094F: u'elmegt GmbH & Co. KG', 0x000950: u'Independent Storage Corporation', 0x000951: u'Apogee Instruments, Inc', 0x000952: u'Auerswald GmbH & Co. KG', 0x000953: u'Linkage System Integration Co.Ltd.', 0x000954: u'AMiT spol. s. r. o.', 0x000955: u'Young Generation International Corp.', 0x000956: u'Network Systems Group, Ltd. (NSG)', 0x000957: u'Supercaller, Inc.', 0x000958: u'INTELNET S.A.', 0x000959: u'Sitecsoft', 0x00095A: u'RACEWOOD TECHNOLOGY', 0x00095B: u'Netgear, Inc.', 0x00095C: u'Philips Medical Systems - Cardiac and Monitoring Systems (CM', 0x00095D: u'Dialogue Technology Corp.', 0x00095E: u'Masstech Group Inc.', 0x00095F: u'Telebyte, Inc.', 0x000960: u'YOZAN Inc.', 0x000961: u'Switchgear and Instrumentation Ltd', 0x000962: u'Filetrac AS', 0x000963: u'Dominion Lasercom Inc.', 0x000964: u'Hi-Techniques', 0x000965: u'PRIVATE', 0x000966: u'Thales Navigation', 0x000967: u'Tachyon, Inc', 0x000968: u'TECHNOVENTURE, INC.', 0x000969: u'Meret Optical Communications', 0x00096A: u'Cloverleaf Communications Inc.', 0x00096B: u'IBM Corporation', 0x00096C: u'Imedia Semiconductor Corp.', 0x00096D: u'Powernet Technologies Corp.', 0x00096E: u'GIANT ELECTRONICS LTD.', 0x00096F: u'Beijing Zhongqing Elegant Tech. Corp.,Limited', 0x000970: u'Vibration Research Corporation', 0x000971: u'Time Management, Inc.', 0x000972: u'Securebase,Inc', 0x000973: u'Lenten Technology Co., Ltd.', 0x000974: u'Innopia Technologies, Inc.', 0x000975: u'fSONA Communications Corporation', 0x000976: u'Datasoft ISDN Systems GmbH', 0x000977: u'Brunner Elektronik AG', 0x000978: u'AIJI System Co., Ltd.', 0x000979: u'Advanced Television Systems Committee, Inc.', 0x00097A: u'Louis Design Labs.', 0x00097B: u'Cisco Systems', 0x00097C: u'Cisco Systems', 0x00097D: u'SecWell Networks Oy', 0x00097E: u'IMI TECHNOLOGY CO., LTD', 0x00097F: u'Vsecure 2000 LTD.', 0x000980: u'Power Zenith Inc.', 0x000981: u'Newport Networks', 0x000982: u'Loewe Opta GmbH', 0x000983: u'Gvision Incorporated', 0x000984: u'MyCasa Network Inc.', 0x000985: u'Auto Telecom Company', 0x000986: u'Metalink LTD.', 0x000987: u'NISHI NIPPON ELECTRIC WIRE & CABLE CO.,LTD.', 0x000988: u'Nudian Electron Co., Ltd.', 0x000989: u'VividLogic Inc.', 0x00098A: u'EqualLogic Inc', 0x00098B: u'Entropic Communications, Inc.', 0x00098C: u'Option Wireless Sweden', 0x00098D: u'Velocity Semiconductor', 0x00098E: u'ipcas GmbH', 0x00098F: u'Cetacean Networks', 0x000990: u'ACKSYS Communications & systems', 0x000991: u'GE Fanuc Automation Manufacturing, Inc.', 0x000992: u'InterEpoch Technology,INC.', 0x000993: u'Visteon Corporation', 0x000994: u'Cronyx Engineering', 0x000995: u'Castle Technology Ltd', 0x000996: u'RDI', 0x000997: u'Nortel Networks', 0x000998: u'Capinfo Company Limited', 0x000999: u'CP GEORGES RENAULT', 0x00099A: u'ELMO COMPANY, LIMITED', 0x00099B: u'Western Telematic Inc.', 0x00099C: u'Naval Research Laboratory', 0x00099D: u'Haliplex Communications', 0x00099E: u'Testech, Inc.', 0x00099F: u'VIDEX INC.', 0x0009A0: u'Microtechno Corporation', 0x0009A1: u'Telewise Communications, Inc.', 0x0009A2: u'Interface Co., Ltd.', 0x0009A3: u'Leadfly Techologies Corp. Ltd.', 0x0009A4: u'HARTEC Corporation', 0x0009A5: u'HANSUNG ELETRONIC INDUSTRIES DEVELOPMENT CO., LTD', 0x0009A6: u'Ignis Optics, Inc.', 0x0009A7: u'Bang & Olufsen A/S', 0x0009A8: u'Eastmode Pte Ltd', 0x0009A9: u'Ikanos Communications', 0x0009AA: u'Data Comm for Business, Inc.', 0x0009AB: u'Netcontrol Oy', 0x0009AC: u'LANVOICE', 0x0009AD: u'HYUNDAI SYSCOMM, INC.', 0x0009AE: u'OKANO ELECTRIC CO.,LTD', 0x0009AF: u'e-generis', 0x0009B0: u'Onkyo Corporation', 0x0009B1: u'Kanematsu Electronics, Ltd.', 0x0009B2: u'L&F Inc.', 0x0009B3: u'MCM Systems Ltd', 0x0009B4: u'KISAN TELECOM CO., LTD.', 0x0009B5: u'3J Tech. Co., Ltd.', 0x0009B6: u'Cisco Systems', 0x0009B7: u'Cisco Systems', 0x0009B8: u'Entise Systems', 0x0009B9: u'Action Imaging Solutions', 0x0009BA: u'MAKU Informationstechik GmbH', 0x0009BB: u'MathStar, Inc.', 0x0009BC: u'Integrian, Inc.', 0x0009BD: u'Epygi Technologies, Ltd.', 0x0009BE: u'Mamiya-OP Co.,Ltd.', 0x0009BF: u'Nintendo Co.,Ltd.', 0x0009C0: u'6WIND', 0x0009C1: u'PROCES-DATA A/S', 0x0009C2: u'PRIVATE', 0x0009C3: u'NETAS', 0x0009C4: u'Medicore Co., Ltd', 0x0009C5: u'KINGENE Technology Corporation', 0x0009C6: u'Visionics Corporation', 0x0009C7: u'Movistec', 0x0009C8: u'SINAGAWA TSUSHIN KEISOU SERVICE', 0x0009C9: u'BlueWINC Co., Ltd.', 0x0009CA: u'iMaxNetworks(Shenzhen)Limited.', 0x0009CB: u'HBrain', 0x0009CC: u'Moog GmbH', 0x0009CD: u'HUDSON SOFT CO.,LTD.', 0x0009CE: u'SpaceBridge Semiconductor Corp.', 0x0009CF: u'iAd GmbH', 0x0009D0: u'Versatel Networks', 0x0009D1: u'SERANOA NETWORKS INC', 0x0009D2: u'Mai Logic Inc.', 0x0009D3: u'Western DataCom Co., Inc.', 0x0009D4: u'Transtech Networks', 0x0009D5: u'Signal Communication, Inc.', 0x0009D6: u'KNC One GmbH', 0x0009D7: u'DC Security Products', 0x0009D8: u'PRIVATE', 0x0009D9: u'Neoscale Systems, Inc', 0x0009DA: u'Control Module Inc.', 0x0009DB: u'eSpace', 0x0009DC: u'Galaxis Technology AG', 0x0009DD: u'Mavin Technology Inc.', 0x0009DE: u'Samjin Information & Communications Co., Ltd.', 0x0009DF: u'Vestel Komunikasyon Sanayi ve Ticaret A.S.', 0x0009E0: u'XEMICS S.A.', 0x0009E1: u'Gemtek Technology Co., Ltd.', 0x0009E2: u'Sinbon Electronics Co., Ltd.', 0x0009E3: u'Angel Iglesias S.A.', 0x0009E4: u'K Tech Infosystem Inc.', 0x0009E5: u'Hottinger Baldwin Messtechnik GmbH', 0x0009E6: u'Cyber Switching Inc.', 0x0009E7: u'ADC Techonology', 0x0009E8: u'Cisco Systems', 0x0009E9: u'Cisco Systems', 0x0009EA: u'YEM Inc.', 0x0009EB: u'HuMANDATA LTD.', 0x0009EC: u'Daktronics, Inc.', 0x0009ED: u'CipherOptics', 0x0009EE: u'MEIKYO ELECTRIC CO.,LTD', 0x0009EF: u'Vocera Communications', 0x0009F0: u'Shimizu Technology Inc.', 0x0009F1: u'Yamaki Electric Corporation', 0x0009F2: u'Cohu, Inc., Electronics Division', 0x0009F3: u'WELL Communication Corp.', 0x0009F4: u'Alcon Laboratories, Inc.', 0x0009F5: u'Emerson Network Power Co.,Ltd', 0x0009F6: u'Shenzhen Eastern Digital Tech Ltd.', 0x0009F7: u'SED, a division of Calian', 0x0009F8: u'UNIMO TECHNOLOGY CO., LTD.', 0x0009F9: u'ART JAPAN CO., LTD.', 0x0009FB: u'Philips Medizinsysteme Boeblingen GmbH', 0x0009FC: u'IPFLEX Inc.', 0x0009FD: u'Ubinetics Limited', 0x0009FE: u'Daisy Technologies, Inc.', 0x0009FF: u'X.net 2000 GmbH', 0x000A00: u'Mediatek Corp.', 0x000A01: u'SOHOware, Inc.', 0x000A02: u'ANNSO CO., LTD.', 0x000A03: u'ENDESA SERVICIOS, S.L.', 0x000A04: u'3Com Europe Ltd', 0x000A05: u'Widax Corp.', 0x000A06: u'Teledex LLC', 0x000A07: u'WebWayOne Ltd', 0x000A08: u'ALPINE ELECTRONICS, INC.', 0x000A09: u'TaraCom Integrated Products, Inc.', 0x000A0A: u'SUNIX Co., Ltd.', 0x000A0B: u'Sealevel Systems, Inc.', 0x000A0C: u'Scientific Research Corporation', 0x000A0D: u'MergeOptics GmbH', 0x000A0E: u'Invivo Research Inc.', 0x000A0F: u'Ilryung Telesys, Inc', 0x000A10: u'FAST media integrations AG', 0x000A11: u'ExPet Technologies, Inc', 0x000A12: u'Azylex Technology, Inc', 0x000A13: u'Silent Witness', 0x000A14: u'TECO a.s.', 0x000A15: u'Silicon Data, Inc', 0x000A16: u'Lassen Research', 0x000A17: u'NESTAR COMMUNICATIONS, INC', 0x000A18: u'Vichel Inc.', 0x000A19: u'Valere Power, Inc.', 0x000A1A: u'Imerge Ltd', 0x000A1B: u'Stream Labs', 0x000A1C: u'Bridge Information Co., Ltd.', 0x000A1D: u'Optical Communications Products Inc.', 0x000A1E: u'Red-M Products Limited', 0x000A1F: u'ART WARE Telecommunication Co., Ltd.', 0x000A20: u'SVA Networks, Inc.', 0x000A21: u'Integra Telecom Co. Ltd', 0x000A22: u'Amperion Inc', 0x000A23: u'Parama Networks Inc', 0x000A24: u'Octave Communications', 0x000A25: u'CERAGON NETWORKS', 0x000A26: u'CEIA S.p.A.', 0x000A27: u'Apple Computer, Inc.', 0x000A28: u'Motorola', 0x000A29: u'Pan Dacom Networking AG', 0x000A2A: u'QSI Systems Inc.', 0x000A2B: u'Etherstuff', 0x000A2C: u'Active Tchnology Corporation', 0x000A2D: u'PRIVATE', 0x000A2E: u'MAPLE NETWORKS CO., LTD', 0x000A2F: u'Artnix Inc.', 0x000A30: u'Johnson Controls-ASG', 0x000A31: u'HCV Wireless', 0x000A32: u'Xsido Corporation', 0x000A33: u'Emulex Corporation', 0x000A34: u'Identicard Systems Incorporated', 0x000A35: u'Xilinx', 0x000A36: u'Synelec Telecom Multimedia', 0x000A37: u'Procera Networks, Inc.', 0x000A38: u'Netlock Technologies, Inc.', 0x000A39: u'LoPA Information Technology', 0x000A3A: u'J-THREE INTERNATIONAL Holding Co., Ltd.', 0x000A3B: u'GCT Semiconductor, Inc', 0x000A3C: u'Enerpoint Ltd.', 0x000A3D: u'Elo Sistemas Eletronicos S.A.', 0x000A3E: u'EADS Telecom', 0x000A3F: u'Data East Corporation', 0x000A40: u'Crown Audio', 0x000A41: u'Cisco Systems', 0x000A42: u'Cisco Systems', 0x000A43: u'Chunghwa Telecom Co., Ltd.', 0x000A44: u'Avery Dennison Deutschland GmbH', 0x000A45: u'Audio-Technica Corp.', 0x000A46: u'ARO Controls SAS', 0x000A47: u'Allied Vision Technologies', 0x000A48: u'Albatron Technology', 0x000A49: u'Acopia Networks', 0x000A4A: u'Targa Systems Ltd.', 0x000A4B: u'DataPower Technology, Inc.', 0x000A4C: u'Molecular Devices Corporation', 0x000A4D: u'Noritz Corporation', 0x000A4E: u'UNITEK Electronics INC.', 0x000A4F: u'Brain Boxes Limited', 0x000A50: u'REMOTEK CORPORATION', 0x000A51: u'GyroSignal Technology Co., Ltd.', 0x000A52: u'AsiaRF Ltd.', 0x000A53: u'Intronics, Incorporated', 0x000A54: u'Laguna Hills, Inc.', 0x000A55: u'MARKEM Corporation', 0x000A56: u'HITACHI Maxell Ltd.', 0x000A57: u'Hewlett-Packard Company - Standards', 0x000A58: u'Ingenieur-Buero Freyer & Siegel', 0x000A59: u'HW server', 0x000A5A: u'GreenNET Technologies Co.,Ltd.', 0x000A5B: u'Power-One as', 0x000A5C: u'Carel s.p.a.', 0x000A5D: u'PUC Founder (MSC) Berhad', 0x000A5E: u'3COM Corporation', 0x000A5F: u'almedio inc.', 0x000A60: u'Autostar Technology Pte Ltd', 0x000A61: u'Cellinx Systems Inc.', 0x000A62: u'Crinis Networks, Inc.', 0x000A63: u'DHD GmbH', 0x000A64: u'Eracom Technologies', 0x000A65: u'GentechMedia.co.,ltd.', 0x000A66: u'MITSUBISHI ELECTRIC SYSTEM & SERVICE CO.,LTD.', 0x000A67: u'OngCorp', 0x000A68: u'SolarFlare Communications, Inc.', 0x000A69: u'SUNNY bell Technology Co., Ltd.', 0x000A6A: u'SVM Microwaves s.r.o.', 0x000A6B: u'Tadiran Telecom Business Systems LTD', 0x000A6C: u'Walchem Corporation', 0x000A6D: u'EKS Elektronikservice GmbH', 0x000A6E: u'Broadcast Technology Limited', 0x000A6F: u'ZyFLEX Technologies Inc', 0x000A70: u'MPLS Forum', 0x000A71: u'Avrio Technologies, Inc', 0x000A72: u'SimpleTech, Inc.', 0x000A73: u'Scientific Atlanta', 0x000A74: u'Manticom Networks Inc.', 0x000A75: u'Cat Electronics', 0x000A76: u'Beida Jade Bird Huaguang Technology Co.,Ltd', 0x000A77: u'Bluewire Technologies LLC', 0x000A78: u'OLITEC', 0x000A79: u'corega K.K.', 0x000A7A: u'Kyoritsu Electric Co., Ltd.', 0x000A7B: u'Cornelius Consult', 0x000A7C: u'Tecton Ltd', 0x000A7D: u'Valo, Inc.', 0x000A7E: u'The Advantage Group', 0x000A7F: u'Teradon Industries, Inc', 0x000A80: u'Telkonet Inc.', 0x000A81: u'TEIMA Audiotex S.L.', 0x000A82: u'TATSUTA SYSTEM ELECTRONICS CO.,LTD.', 0x000A83: u'SALTO SYSTEMS S.L.', 0x000A84: u'Rainsun Enterprise Co., Ltd.', 0x000A85: u'PLAT\'C2,Inc', 0x000A86: u'Lenze', 0x000A87: u'Integrated Micromachines Inc.', 0x000A88: u'InCypher S.A.', 0x000A89: u'Creval Systems, Inc.', 0x000A8A: u'Cisco Systems', 0x000A8B: u'Cisco Systems', 0x000A8C: u'Guardware Systems Ltd.', 0x000A8D: u'EUROTHERM LIMITED', 0x000A8E: u'Invacom Ltd', 0x000A8F: u'Aska International Inc.', 0x000A90: u'Bayside Interactive, Inc.', 0x000A91: u'HemoCue AB', 0x000A92: u'Presonus Corporation', 0x000A93: u'W2 Networks, Inc.', 0x000A94: u'ShangHai cellink CO., LTD', 0x000A95: u'Apple Computer, Inc.', 0x000A96: u'MEWTEL TECHNOLOGY INC.', 0x000A97: u'SONICblue, Inc.', 0x000A98: u'M+F Gwinner GmbH & Co', 0x000A99: u'Dataradio Inc.', 0x000A9A: u'Aiptek International Inc', 0x000A9B: u'Towa Meccs Corporation', 0x000A9C: u'Server Technology, Inc.', 0x000A9D: u'King Young Technology Co. Ltd.', 0x000A9E: u'BroadWeb Corportation', 0x000A9F: u'Pannaway Technologies, Inc.', 0x000AA0: u'Cedar Point Communications', 0x000AA1: u'V V S Limited', 0x000AA2: u'SYSTEK INC.', 0x000AA3: u'SHIMAFUJI ELECTRIC CO.,LTD.', 0x000AA4: u'SHANGHAI SURVEILLANCE TECHNOLOGY CO,LTD', 0x000AA5: u'MAXLINK INDUSTRIES LIMITED', 0x000AA6: u'Hochiki Corporation', 0x000AA7: u'FEI Company', 0x000AA8: u'ePipe Pty. Ltd.', 0x000AA9: u'Brooks Automation GmbH', 0x000AAA: u'AltiGen Communications Inc.', 0x000AAB: u'TOYOTA MACS, INC.', 0x000AAC: u'TerraTec Electronic GmbH', 0x000AAD: u'Stargames Corporation', 0x000AAE: u'Rosemount Process Analytical', 0x000AAF: u'Pipal Systems', 0x000AB0: u'LOYTEC electronics GmbH', 0x000AB1: u'GENETEC Corporation', 0x000AB2: u'Fresnel Wireless Systems', 0x000AB3: u'Fa. GIRA', 0x000AB4: u'ETIC Telecommunications', 0x000AB5: u'Digital Electronic Network', 0x000AB6: u'COMPUNETIX, INC', 0x000AB7: u'Cisco Systems', 0x000AB8: u'Cisco Systems', 0x000AB9: u'Astera Technologies Corp.', 0x000ABA: u'Arcon Technology Limited', 0x000ABB: u'Taiwan Secom Co,. Ltd', 0x000ABC: u'Seabridge Ltd.', 0x000ABD: u'Rupprecht & Patashnick Co.', 0x000ABE: u'OPNET Technologies CO., LTD.', 0x000ABF: u'HIROTA SS', 0x000AC0: u'Fuyoh Video Industry CO., LTD.', 0x000AC1: u'Futuretel', 0x000AC2: u'FiberHome Telecommunication Technologies CO.,LTD', 0x000AC3: u'eM Technics Co., Ltd.', 0x000AC4: u'Daewoo Teletech Co., Ltd', 0x000AC5: u'Color Kinetics', 0x000AC6: u'Ceterus Networks, Inc.', 0x000AC7: u'Unication Group', 0x000AC8: u'ZPSYS CO.,LTD. (Planning&Management)', 0x000AC9: u'Zambeel Inc', 0x000ACA: u'YOKOYAMA SHOKAI CO.,Ltd.', 0x000ACB: u'XPAK MSA Group', 0x000ACC: u'Winnow Networks, Inc.', 0x000ACD: u'Sunrich Technology Limited', 0x000ACE: u'RADIANTECH, INC.', 0x000ACF: u'PROVIDEO Multimedia Co. Ltd.', 0x000AD0: u'Niigata Develoment Center, F.I.T. Co., Ltd.', 0x000AD1: u'MWS', 0x000AD2: u'JEPICO Corporation', 0x000AD3: u'INITECH Co., Ltd', 0x000AD4: u'CoreBell Systems Inc.', 0x000AD5: u'Brainchild Electronic Co., Ltd.', 0x000AD6: u'BeamReach Networks', 0x000AD7: u'Origin ELECTRIC CO.,LTD.', 0x000AD8: u'IPCserv Technology Corp.', 0x000AD9: u'Sony Ericsson Mobile Communications AB', 0x000ADA: u'PRIVATE', 0x000ADB: u'SkyPilot Network, Inc', 0x000ADC: u'RuggedCom Inc.', 0x000ADD: u'InSciTek Microsystems, Inc.', 0x000ADE: u'Happy Communication Co., Ltd.', 0x000ADF: u'Gennum Corporation', 0x000AE0: u'Fujitsu Softek', 0x000AE1: u'EG Technology', 0x000AE2: u'Binatone Electronics International, Ltd', 0x000AE3: u'YANG MEI TECHNOLOGY CO., LTD', 0x000AE4: u'Wistron Corp.', 0x000AE5: u'ScottCare Corporation', 0x000AE6: u'Elitegroup Computer System Co. (ECS)', 0x000AE7: u'ELIOP S.A.', 0x000AE8: u'Cathay Roxus Information Technology Co. LTD', 0x000AE9: u'AirVast Technology Inc.', 0x000AEA: u'ADAM ELEKTRONIK LTD.STI.', 0x000AEB: u'Shenzhen Tp-Link Technology Co; Ltd.', 0x000AEC: u'Koatsu Gas Kogyo Co., Ltd.', 0x000AED: u'HARTING Vending G.m.b.H. & CO KG', 0x000AEE: u'GCD Hard- & Software GmbH', 0x000AEF: u'OTRUM ASA', 0x000AF0: u'SHIN-OH ELECTRONICS CO., LTD. R&D', 0x000AF1: u'Clarity Design, Inc.', 0x000AF2: u'NeoAxiom Corp.', 0x000AF3: u'Cisco Systems', 0x000AF4: u'Cisco Systems', 0x000AF5: u'Airgo Networks, Inc.', 0x000AF6: u'Computer Process Controls', 0x000AF7: u'Broadcom Corp.', 0x000AF8: u'American Telecare Inc.', 0x000AF9: u'HiConnect, Inc.', 0x000AFA: u'Traverse Technologies Australia', 0x000AFB: u'Ambri Limited', 0x000AFC: u'Core Tec Communications, LLC', 0x000AFD: u'Viking Electronic Services', 0x000AFE: u'NovaPal Ltd', 0x000AFF: u'Kilchherr Elektronik AG', 0x000B00: u'FUJIAN START COMPUTER EQUIPMENT CO.,LTD', 0x000B01: u'DAIICHI ELECTRONICS CO., LTD.', 0x000B02: u'Dallmeier electronic', 0x000B03: u'Taekwang Industrial Co., Ltd', 0x000B04: u'Volktek Corporation', 0x000B05: u'Pacific Broadband Networks', 0x000B06: u'Motorola BCS', 0x000B07: u'Voxpath Networks', 0x000B08: u'Pillar Data Systems', 0x000B09: u'Ifoundry Systems Singapore', 0x000B0A: u'dBm Optics', 0x000B0B: u'Corrent Corporation', 0x000B0C: u'Agile Systems Inc.', 0x000B0D: u'Air2U, Inc.', 0x000B0E: u'Trapeze Networks', 0x000B0F: u'Nyquist Industrial Control BV', 0x000B10: u'11wave Technonlogy Co.,Ltd', 0x000B11: u'HIMEJI ABC TRADING CO.,LTD.', 0x000B12: u'NURI Telecom Co., Ltd.', 0x000B13: u'ZETRON INC', 0x000B14: u'ViewSonic Corporation', 0x000B15: u'Platypus Technology', 0x000B16: u'Communication Machinery Corporation', 0x000B17: u'MKS Instruments', 0x000B18: u'PRIVATE', 0x000B19: u'Vernier Networks, Inc.', 0x000B1A: u'Teltone Corporation', 0x000B1B: u'Systronix, Inc.', 0x000B1C: u'SIBCO bv', 0x000B1D: u'LayerZero Power Systems, Inc.', 0x000B1E: u'KAPPA opto-electronics GmbH', 0x000B1F: u'I CON Computer Co.', 0x000B20: u'Hirata corporation', 0x000B21: u'G-Star Communications Inc.', 0x000B22: u'Environmental Systems and Services', 0x000B23: u'Siemens Subscriber Networks', 0x000B24: u'AirLogic', 0x000B25: u'Aeluros', 0x000B26: u'Wetek Corporation', 0x000B27: u'Scion Corporation', 0x000B28: u'Quatech Inc.', 0x000B29: u'LG Industrial Systems Co.,Ltd.', 0x000B2A: u'HOWTEL Co., Ltd.', 0x000B2B: u'HOSTNET CORPORATION', 0x000B2C: u'Eiki Industrial Co. Ltd.', 0x000B2D: u'Danfoss Inc.', 0x000B2E: u'Cal-Comp Electronics (Thailand) Public Company Limited Taipe', 0x000B2F: u'bplan GmbH', 0x000B30: u'Beijing Gongye Science & Technology Co.,Ltd', 0x000B31: u'Yantai ZhiYang Scientific and technology industry CO., LTD', 0x000B32: u'VORMETRIC, INC.', 0x000B33: u'Vivato', 0x000B34: u'ShangHai Broadband Technologies CO.LTD', 0x000B35: u'Quad Bit System co., Ltd.', 0x000B36: u'Productivity Systems, Inc.', 0x000B37: u'MANUFACTURE DES MONTRES ROLEX SA', 0x000B38: u'Knuerr AG', 0x000B39: u'Keisoku Giken Co.,Ltd.', 0x000B3A: u'QuStream Corporation', 0x000B3B: u'devolo AG', 0x000B3C: u'Cygnal Integrated Products, Inc.', 0x000B3D: u'CONTAL OK Ltd.', 0x000B3E: u'BittWare, Inc', 0x000B3F: u'Anthology Solutions Inc.', 0x000B40: u'OpNext Inc.', 0x000B41: u'Ing. Buero Dr. Beutlhauser', 0x000B42: u'commax Co., Ltd.', 0x000B43: u'Microscan Systems, Inc.', 0x000B44: u'Concord IDea Corp.', 0x000B45: u'Cisco', 0x000B46: u'Cisco', 0x000B47: u'Advanced Energy', 0x000B48: u'sofrel', 0x000B49: u'RF-Link System Inc.', 0x000B4A: u'Visimetrics (UK) Ltd', 0x000B4B: u'VISIOWAVE SA', 0x000B4C: u'Clarion (M) Sdn Bhd', 0x000B4D: u'Emuzed', 0x000B4E: u'VertexRSI Antenna Products Division', 0x000B4F: u'Verifone, INC.', 0x000B50: u'Oxygnet', 0x000B51: u'Micetek International Inc.', 0x000B52: u'JOYMAX ELECTRONICS CORP.', 0x000B53: u'INITIUM Co., Ltd.', 0x000B54: u'BiTMICRO Networks, Inc.', 0x000B55: u'ADInstruments', 0x000B56: u'Cybernetics', 0x000B57: u'Silicon Laboratories', 0x000B58: u'Astronautics C.A LTD', 0x000B59: u'ScriptPro, LLC', 0x000B5A: u'HyperEdge', 0x000B5B: u'Rincon Research Corporation', 0x000B5C: u'Newtech Co.,Ltd', 0x000B5D: u'FUJITSU LIMITED', 0x000B5E: u'Audio Engineering Society Inc.', 0x000B5F: u'Cisco Systems', 0x000B60: u'Cisco Systems', 0x000B61: u'Friedrich Lütze GmbH &Co.', 0x000B62: u'Ingenieurbüro Ingo Mohnen', 0x000B63: u'Kaleidescape', 0x000B64: u'Kieback & Peter GmbH & Co KG', 0x000B65: u'Sy.A.C. srl', 0x000B66: u'Teralink Communications', 0x000B67: u'Topview Technology Corporation', 0x000B68: u'Addvalue Communications Pte Ltd', 0x000B69: u'Franke Finland Oy', 0x000B6A: u'Asiarock Incorporation', 0x000B6B: u'Wistron Neweb Corp.', 0x000B6C: u'Sychip Inc.', 0x000B6D: u'SOLECTRON JAPAN NAKANIIDA', 0x000B6E: u'Neff Instrument Corp.', 0x000B6F: u'Media Streaming Networks Inc', 0x000B70: u'Load Technology, Inc.', 0x000B71: u'Litchfield Communications Inc.', 0x000B72: u'Lawo AG', 0x000B73: u'Kodeos Communications', 0x000B74: u'Kingwave Technology Co., Ltd.', 0x000B75: u'Iosoft Ltd.', 0x000B76: u'ET&T Co. Ltd.', 0x000B77: u'Cogent Systems, Inc.', 0x000B78: u'TAIFATECH INC.', 0x000B79: u'X-COM, Inc.', 0x000B7A: u'Wave Science Inc.', 0x000B7B: u'Test-Um Inc.', 0x000B7C: u'Telex Communications', 0x000B7D: u'SOLOMON EXTREME INTERNATIONAL LTD.', 0x000B7E: u'SAGINOMIYA Seisakusho Inc.', 0x000B7F: u'OmniWerks', 0x000B80: u'Lycium Networks', 0x000B81: u'Kaparel Corporation', 0x000B82: u'Grandstream Networks, Inc.', 0x000B83: u'DATAWATT B.V.', 0x000B84: u'BODET', 0x000B85: u'Airespace, Inc.', 0x000B86: u'Aruba Networks', 0x000B87: u'American Reliance Inc.', 0x000B88: u'Vidisco ltd.', 0x000B89: u'Top Global Technology, Ltd.', 0x000B8A: u'MITEQ Inc.', 0x000B8B: u'KERAJET, S.A.', 0x000B8C: u'flextronics israel', 0x000B8D: u'Avvio Networks', 0x000B8E: u'Ascent Corporation', 0x000B8F: u'AKITA ELECTRONICS SYSTEMS CO.,LTD.', 0x000B90: u'Covaro Networks, Inc.', 0x000B91: u'Aglaia Gesellschaft für Bildverarbeitung und Kommunikation m', 0x000B92: u'Ascom Danmark A/S', 0x000B93: u'Barmag Electronic', 0x000B94: u'Digital Monitoring Products, Inc.', 0x000B95: u'eBet Gaming Systems Pty Ltd', 0x000B96: u'Innotrac Diagnostics Oy', 0x000B97: u'Matsushita Electric Industrial Co.,Ltd.', 0x000B98: u'NiceTechVision', 0x000B99: u'SensAble Technologies, Inc.', 0x000B9A: u'Shanghai Ulink Telecom Equipment Co. Ltd.', 0x000B9B: u'Sirius System Co, Ltd.', 0x000B9C: u'TriBeam Technologies, Inc.', 0x000B9D: u'TwinMOS Technologies Inc.', 0x000B9E: u'Yasing Technology Corp.', 0x000B9F: u'Neue ELSA GmbH', 0x000BA0: u'T&L Information Inc.', 0x000BA1: u'SYSCOM Ltd.', 0x000BA2: u'Sumitomo Electric Networks, Inc', 0x000BA3: u'Siemens AG, I&S', 0x000BA4: u'Shiron Satellite Communications Ltd. (1996)', 0x000BA5: u'Quasar Cipta Mandiri, PT', 0x000BA6: u'Miyakawa Electric Works Ltd.', 0x000BA7: u'Maranti Networks', 0x000BA8: u'HANBACK ELECTRONICS CO., LTD.', 0x000BA9: u'CloudShield Technologies, Inc.', 0x000BAA: u'Aiphone co.,Ltd', 0x000BAB: u'Advantech Technology (CHINA) Co., Ltd.', 0x000BAC: u'3Com Europe Ltd.', 0x000BAD: u'PC-PoS Inc.', 0x000BAE: u'Vitals System Inc.', 0x000BAF: u'WOOJU COMMUNICATIONS Co,.Ltd', 0x000BB0: u'Sysnet Telematica srl', 0x000BB1: u'Super Star Technology Co., Ltd.', 0x000BB2: u'SMALLBIG TECHNOLOGY', 0x000BB3: u'RiT technologies Ltd.', 0x000BB4: u'RDC Semiconductor Inc.,', 0x000BB5: u'nStor Technologies, Inc.', 0x000BB6: u'Mototech Inc.', 0x000BB7: u'Micro Systems Co.,Ltd.', 0x000BB8: u'Kihoku Electronic Co.', 0x000BB9: u'Imsys AB', 0x000BBA: u'Harmonic Broadband Access Networks', 0x000BBB: u'Etin Systems Co., Ltd', 0x000BBC: u'En Garde Systems, Inc.', 0x000BBD: u'Connexionz Limited', 0x000BBE: u'Cisco Systems', 0x000BBF: u'Cisco Systems', 0x000BC0: u'China IWNComm Co., Ltd.', 0x000BC1: u'Bay Microsystems, Inc.', 0x000BC2: u'Corinex Communication Corp.', 0x000BC3: u'Multiplex, Inc.', 0x000BC4: u'BIOTRONIK GmbH & Co', 0x000BC5: u'SMC Networks, Inc.', 0x000BC6: u'ISAC, Inc.', 0x000BC7: u'ICET S.p.A.', 0x000BC8: u'AirFlow Networks', 0x000BC9: u'Electroline Equipment', 0x000BCA: u'DATAVAN International Corporation', 0x000BCB: u'Fagor Automation , S. Coop', 0x000BCC: u'JUSAN, S.A.', 0x000BCD: u'Compaq (HP)', 0x000BCE: u'Free2move AB', 0x000BCF: u'AGFA NDT INC.', 0x000BD0: u'XiMeta Technology Americas Inc.', 0x000BD1: u'Aeronix, Inc.', 0x000BD2: u'Remopro Technology Inc.', 0x000BD3: u'cd3o', 0x000BD4: u'Beijing Wise Technology & Science Development Co.Ltd', 0x000BD5: u'Nvergence, Inc.', 0x000BD6: u'Paxton Access Ltd', 0x000BD7: u'MBB Gelma GmbH', 0x000BD8: u'Industrial Scientific Corp.', 0x000BD9: u'General Hydrogen', 0x000BDA: u'EyeCross Co.,Inc.', 0x000BDB: u'Dell ESG PCBA Test', 0x000BDC: u'AKCP', 0x000BDD: u'TOHOKU RICOH Co., LTD.', 0x000BDE: u'TELDIX GmbH', 0x000BDF: u'Shenzhen RouterD Networks Limited', 0x000BE0: u'SercoNet Ltd.', 0x000BE1: u'Nokia NET Product Operations', 0x000BE2: u'Lumenera Corporation', 0x000BE3: u'Key Stream Co., Ltd.', 0x000BE4: u'Hosiden Corporation', 0x000BE5: u'HIMS Korea Co., Ltd.', 0x000BE6: u'Datel Electronics', 0x000BE7: u'COMFLUX TECHNOLOGY INC.', 0x000BE8: u'AOIP', 0x000BE9: u'Actel Corporation', 0x000BEA: u'Zultys Technologies', 0x000BEB: u'Systegra AG', 0x000BEC: u'NIPPON ELECTRIC INSTRUMENT, INC.', 0x000BED: u'ELM Inc.', 0x000BEE: u'inc.jet, Incorporated', 0x000BEF: u'Code Corporation', 0x000BF0: u'MoTEX Products Co., Ltd.', 0x000BF1: u'LAP Laser Applikations', 0x000BF2: u'Chih-Kan Technology Co., Ltd.', 0x000BF3: u'BAE SYSTEMS', 0x000BF4: u'PRIVATE', 0x000BF5: u'Shanghai Sibo Telecom Technology Co.,Ltd', 0x000BF6: u'Nitgen Co., Ltd', 0x000BF7: u'NIDEK CO.,LTD', 0x000BF8: u'Infinera', 0x000BF9: u'Gemstone communications, Inc.', 0x000BFA: u'EXEMYS SRL', 0x000BFB: u'D-NET International Corporation', 0x000BFC: u'Cisco Systems', 0x000BFD: u'Cisco Systems', 0x000BFE: u'CASTEL Broadband Limited', 0x000BFF: u'Berkeley Camera Engineering', 0x000C00: u'BEB Industrie-Elektronik AG', 0x000C01: u'Abatron AG', 0x000C02: u'ABB Oy', 0x000C03: u'HDMI Licensing, LLC', 0x000C04: u'Tecnova', 0x000C05: u'RPA Reserch Co., Ltd.', 0x000C06: u'Nixvue Systems Pte Ltd', 0x000C07: u'Iftest AG', 0x000C08: u'HUMEX Technologies Corp.', 0x000C09: u'Hitachi IE Systems Co., Ltd', 0x000C0A: u'Guangdong Province Electronic Technology Research Institute', 0x000C0B: u'Broadbus Technologies', 0x000C0C: u'APPRO TECHNOLOGY INC.', 0x000C0D: u'Communications & Power Industries / Satcom Division', 0x000C0E: u'XtremeSpectrum, Inc.', 0x000C0F: u'Techno-One Co., Ltd', 0x000C10: u'PNI Corporation', 0x000C11: u'NIPPON DEMPA CO.,LTD.', 0x000C12: u'Micro-Optronic-Messtechnik GmbH', 0x000C13: u'MediaQ', 0x000C14: u'Diagnostic Instruments, Inc.', 0x000C15: u'CyberPower Systems, Inc.', 0x000C16: u'Concorde Microsystems Inc.', 0x000C17: u'AJA Video Systems Inc', 0x000C18: u'Zenisu Keisoku Inc.', 0x000C19: u'Telio Communications GmbH', 0x000C1A: u'Quest Technical Solutions Inc.', 0x000C1B: u'ORACOM Co, Ltd.', 0x000C1C: u'MicroWeb Co., Ltd.', 0x000C1D: u'Mettler & Fuchs AG', 0x000C1E: u'Global Cache', 0x000C1F: u'Glimmerglass Networks', 0x000C20: u'Fi WIn, Inc.', 0x000C21: u'Faculty of Science and Technology, Keio University', 0x000C22: u'Double D Electronics Ltd', 0x000C23: u'Beijing Lanchuan Tech. Co., Ltd.', 0x000C24: u'ANATOR', 0x000C25: u'Allied Telesyn Networks', 0x000C26: u'Weintek Labs. Inc.', 0x000C27: u'Sammy Corporation', 0x000C28: u'RIFATRON', 0x000C29: u'VMware, Inc.', 0x000C2A: u'OCTTEL Communication Co., Ltd.', 0x000C2B: u'ELIAS Technology, Inc.', 0x000C2C: u'Enwiser Inc.', 0x000C2D: u'FullWave Technology Co., Ltd.', 0x000C2E: u'Openet information technology(shenzhen) Co., Ltd.', 0x000C2F: u'SeorimTechnology Co.,Ltd.', 0x000C30: u'Cisco', 0x000C31: u'Cisco', 0x000C32: u'Avionic Design Development GmbH', 0x000C33: u'Compucase Enterprise Co. Ltd.', 0x000C34: u'Vixen Co., Ltd.', 0x000C35: u'KaVo Dental GmbH & Co. KG', 0x000C36: u'SHARP TAKAYA ELECTRONICS INDUSTRY CO.,LTD.', 0x000C37: u'Geomation, Inc.', 0x000C38: u'TelcoBridges Inc.', 0x000C39: u'Sentinel Wireless Inc.', 0x000C3A: u'Oxance', 0x000C3B: u'Orion Electric Co., Ltd.', 0x000C3C: u'MediaChorus, Inc.', 0x000C3D: u'Glsystech Co., Ltd.', 0x000C3E: u'Crest Audio', 0x000C3F: u'Cogent Defence & Security Networks,', 0x000C40: u'Altech Controls', 0x000C41: u'The Linksys Group, Inc.', 0x000C42: u'Routerboard.com', 0x000C43: u'Ralink Technology, Corp.', 0x000C44: u'Automated Interfaces, Inc.', 0x000C45: u'Animation Technologies Inc.', 0x000C46: u'Allied Telesyn Inc.', 0x000C47: u'SK Teletech(R&D Planning Team)', 0x000C48: u'QoStek Corporation', 0x000C49: u'Dangaard Telecom RTC Division A/S', 0x000C4A: u'Cygnus Microsystems Private Limited', 0x000C4B: u'Cheops Elektronik', 0x000C4C: u'Arcor AG&Co.', 0x000C4D: u'ACRA CONTROL', 0x000C4E: u'Winbest Technology CO,LT', 0x000C4F: u'UDTech Japan Corporation', 0x000C50: u'Seagate Technology', 0x000C51: u'Scientific Technologies Inc.', 0x000C52: u'Roll Systems Inc.', 0x000C53: u'PRIVATE', 0x000C54: u'Pedestal Networks, Inc', 0x000C55: u'Microlink Communications Inc.', 0x000C56: u'Megatel Computer (1986) Corp.', 0x000C57: u'MACKIE Engineering Services Belgium BVBA', 0x000C58: u'M&S Systems', 0x000C59: u'Indyme Electronics, Inc.', 0x000C5A: u'IBSmm Industrieelektronik Multimedia', 0x000C5B: u'HANWANG TECHNOLOGY CO.,LTD', 0x000C5C: u'GTN Systems B.V.', 0x000C5D: u'CHIC TECHNOLOGY (CHINA) CORP.', 0x000C5E: u'Calypso Medical', 0x000C5F: u'Avtec, Inc.', 0x000C60: u'ACM Systems', 0x000C61: u'AC Tech corporation DBA Advanced Digital', 0x000C62: u'ABB Automation Technology Products AB, Control', 0x000C63: u'Zenith Electronics Corporation', 0x000C64: u'X2 MSA Group', 0x000C65: u'Sunin Telecom', 0x000C66: u'Pronto Networks Inc', 0x000C67: u'OYO ELECTRIC CO.,LTD', 0x000C68: u'SigmaTel, Inc.', 0x000C69: u'National Radio Astronomy Observatory', 0x000C6A: u'MBARI', 0x000C6B: u'Kurz Industrie-Elektronik GmbH', 0x000C6C: u'Elgato Systems LLC', 0x000C6D: u'BOC Edwards', 0x000C6E: u'ASUSTEK COMPUTER INC.', 0x000C6F: u'Amtek system co.,LTD.', 0x000C70: u'ACC GmbH', 0x000C71: u'Wybron, Inc', 0x000C72: u'Tempearl Industrial Co., Ltd.', 0x000C73: u'TELSON ELECTRONICS CO., LTD', 0x000C74: u'RIVERTEC CORPORATION', 0x000C75: u'Oriental integrated electronics. LTD', 0x000C76: u'MICRO-STAR INTERNATIONAL CO., LTD.', 0x000C77: u'Life Racing Ltd', 0x000C78: u'In-Tech Electronics Limited', 0x000C79: u'Extel Communications P/L', 0x000C7A: u'DaTARIUS Technologies GmbH', 0x000C7B: u'ALPHA PROJECT Co.,Ltd.', 0x000C7C: u'Internet Information Image Inc.', 0x000C7D: u'TEIKOKU ELECTRIC MFG. CO., LTD', 0x000C7E: u'Tellium Incorporated', 0x000C7F: u'synertronixx GmbH', 0x000C80: u'Opelcomm Inc.', 0x000C81: u'Nulec Industries Pty Ltd', 0x000C82: u'NETWORK TECHNOLOGIES INC', 0x000C83: u'Logical Solutions', 0x000C84: u'Eazix, Inc.', 0x000C85: u'Cisco Systems', 0x000C86: u'Cisco Systems', 0x000C87: u'ATI', 0x000C88: u'Apache Micro Peripherals, Inc.', 0x000C89: u'AC Electric Vehicles, Ltd.', 0x000C8A: u'Bose Corporation', 0x000C8B: u'Connect Tech Inc', 0x000C8C: u'KODICOM CO.,LTD.', 0x000C8D: u'MATRIX VISION GmbH', 0x000C8E: u'Mentor Engineering Inc', 0x000C8F: u'Nergal s.r.l.', 0x000C90: u'Octasic Inc.', 0x000C91: u'Riverhead Networks Inc.', 0x000C92: u'WolfVision Gmbh', 0x000C93: u'Xeline Co., Ltd.', 0x000C94: u'United Electronic Industries, Inc.', 0x000C95: u'PrimeNet', 0x000C96: u'OQO, Inc.', 0x000C97: u'NV ADB TTV Technologies SA', 0x000C98: u'LETEK Communications Inc.', 0x000C99: u'HITEL LINK Co.,Ltd', 0x000C9A: u'Hitech Electronics Corp.', 0x000C9B: u'EE Solutions, Inc', 0x000C9C: u'Chongho information & communications', 0x000C9D: u'AirWalk Communications, Inc.', 0x000C9E: u'MemoryLink Corp.', 0x000C9F: u'NKE Corporation', 0x000CA0: u'StorCase Technology, Inc.', 0x000CA1: u'SIGMACOM Co., LTD.', 0x000CA2: u'Scopus Network Technologies Ltd', 0x000CA3: u'Rancho Technology, Inc.', 0x000CA4: u'Prompttec Product Management GmbH', 0x000CA5: u'Naman NZ LTd', 0x000CA6: u'Mintera Corporation', 0x000CA7: u'Metro (Suzhou) Technologies Co., Ltd.', 0x000CA8: u'Garuda Networks Corporation', 0x000CA9: u'Ebtron Inc.', 0x000CAA: u'Cubic Transportation Systems Inc', 0x000CAB: u'COMMEND International', 0x000CAC: u'Citizen Watch Co., Ltd.', 0x000CAD: u'BTU International', 0x000CAE: u'Ailocom Oy', 0x000CAF: u'TRI TERM CO.,LTD.', 0x000CB0: u'Star Semiconductor Corporation', 0x000CB1: u'Salland Engineering (Europe) BV', 0x000CB2: u'safei Co., Ltd.', 0x000CB3: u'ROUND Co.,Ltd.', 0x000CB4: u'AutoCell Laboratories, Inc.', 0x000CB5: u'Premier Technolgies, Inc', 0x000CB6: u'NANJING SEU MOBILE & INTERNET TECHNOLOGY CO.,LTD', 0x000CB7: u'Nanjing Huazhuo Electronics Co., Ltd.', 0x000CB8: u'MEDION AG', 0x000CB9: u'LEA', 0x000CBA: u'Jamex', 0x000CBB: u'ISKRAEMECO', 0x000CBC: u'Iscutum', 0x000CBD: u'Interface Masters, Inc', 0x000CBE: u'PRIVATE', 0x000CBF: u'Holy Stone Ent. Co., Ltd.', 0x000CC0: u'Genera Oy', 0x000CC1: u'Cooper Industries Inc.', 0x000CC2: u'PRIVATE', 0x000CC3: u'BeWAN systems', 0x000CC4: u'Tiptel AG', 0x000CC5: u'Nextlink Co., Ltd.', 0x000CC6: u'Ka-Ro electronics GmbH', 0x000CC7: u'Intelligent Computer Solutions Inc.', 0x000CC8: u'Xytronix Research & Design, Inc.', 0x000CC9: u'ILWOO DATA & TECHNOLOGY CO.,LTD', 0x000CCA: u'Hitachi Global Storage Technologies', 0x000CCB: u'Design Combus Ltd', 0x000CCC: u'Aeroscout Ltd.', 0x000CCD: u'IEC - TC57', 0x000CCE: u'Cisco Systems', 0x000CCF: u'Cisco Systems', 0x000CD0: u'Symetrix', 0x000CD1: u'SFOM Technology Corp.', 0x000CD2: u'Schaffner EMV AG', 0x000CD3: u'Prettl Elektronik Radeberg GmbH', 0x000CD4: u'Positron Public Safety Systems inc.', 0x000CD5: u'Passave Inc.', 0x000CD6: u'PARTNER TECH', 0x000CD7: u'Nallatech Ltd', 0x000CD8: u'M. K. Juchheim GmbH & Co', 0x000CD9: u'Itcare Co., Ltd', 0x000CDA: u'FreeHand Systems, Inc.', 0x000CDB: u'Foundry Networks', 0x000CDC: u'BECS Technology, Inc', 0x000CDD: u'AOS Technologies AG', 0x000CDE: u'ABB STOTZ-KONTAKT GmbH', 0x000CDF: u'PULNiX America, Inc', 0x000CE0: u'Trek Diagnostics Inc.', 0x000CE1: u'The Open Group', 0x000CE2: u'Rolls-Royce', 0x000CE3: u'Option International N.V.', 0x000CE4: u'NeuroCom International, Inc.', 0x000CE5: u'Motorola BCS', 0x000CE6: u'Meru Networks Inc', 0x000CE7: u'MediaTek Inc.', 0x000CE8: u'GuangZhou AnJuBao Co., Ltd', 0x000CE9: u'BLOOMBERG L.P.', 0x000CEA: u'aphona Kommunikationssysteme', 0x000CEB: u'CNMP Networks, Inc.', 0x000CEC: u'Spectracom Corp.', 0x000CED: u'Real Digital Media', 0x000CEE: u'jp-embedded', 0x000CEF: u'Open Networks Engineering Ltd', 0x000CF0: u'M & N GmbH', 0x000CF1: u'Intel Corporation', 0x000CF2: u'GAMESA EÓLICA', 0x000CF3: u'CALL IMAGE SA', 0x000CF4: u'AKATSUKI ELECTRIC MFG.CO.,LTD.', 0x000CF5: u'InfoExpress', 0x000CF6: u'Sitecom Europe BV', 0x000CF7: u'Nortel Networks', 0x000CF8: u'Nortel Networks', 0x000CF9: u'ITT Flygt AB', 0x000CFA: u'Digital Systems Corp', 0x000CFB: u'Korea Network Systems', 0x000CFC: u'S2io Technologies Corp', 0x000CFD: u'PRIVATE', 0x000CFE: u'Grand Electronic Co., Ltd', 0x000CFF: u'MRO-TEK LIMITED', 0x000D00: u'Seaway Networks Inc.', 0x000D01: u'P&E Microcomputer Systems, Inc.', 0x000D02: u'NEC AccessTechnica,Ltd', 0x000D03: u'Matrics, Inc.', 0x000D04: u'Foxboro Eckardt Development GmbH', 0x000D05: u'cybernet manufacturing inc.', 0x000D06: u'Compulogic Limited', 0x000D07: u'Calrec Audio Ltd', 0x000D08: u'AboveCable, Inc.', 0x000D09: u'Yuehua(Zhuhai) Electronic CO. LTD', 0x000D0A: u'Projectiondesign as', 0x000D0B: u'Buffalo Inc.', 0x000D0C: u'MDI Security Systems', 0x000D0D: u'ITSupported, LLC', 0x000D0E: u'Inqnet Systems, Inc.', 0x000D0F: u'Finlux Ltd', 0x000D10: u'Embedtronics Oy', 0x000D11: u'DENTSPLY - Gendex', 0x000D12: u'AXELL Corporation', 0x000D13: u'Wilhelm Rutenbeck GmbH&Co.', 0x000D14: u'Vtech Innovation LP dba Advanced American Telephones', 0x000D15: u'Voipac s.r.o.', 0x000D16: u'UHS Systems Pty Ltd', 0x000D17: u'Turbo Networks Co.Ltd', 0x000D18: u'Sunitec Enterprise Co., Ltd.', 0x000D19: u'ROBE Show lighting', 0x000D1A: u'Mustek System Inc.', 0x000D1B: u'Kyoto Electronics Manufacturing Co., Ltd.', 0x000D1C: u'I2E TELECOM', 0x000D1D: u'HIGH-TEK HARNESS ENT. CO., LTD.', 0x000D1E: u'Control Techniques', 0x000D1F: u'AV Digital', 0x000D20: u'ASAHIKASEI TECHNOSYSTEM CO.,LTD.', 0x000D21: u'WISCORE Inc.', 0x000D22: u'Unitronics', 0x000D23: u'Smart Solution, Inc', 0x000D24: u'SENTEC E&E CO., LTD.', 0x000D25: u'SANDEN CORPORATION', 0x000D26: u'Primagraphics Limited', 0x000D27: u'MICROPLEX Printware AG', 0x000D28: u'Cisco', 0x000D29: u'Cisco', 0x000D2A: u'Scanmatic AS', 0x000D2B: u'Racal Instruments', 0x000D2C: u'Patapsco Designs Ltd', 0x000D2D: u'NCT Deutschland GmbH', 0x000D2E: u'Matsushita Avionics Systems Corporation', 0x000D2F: u'AIN Comm.Tech.Co., LTD', 0x000D30: u'IceFyre Semiconductor', 0x000D31: u'Compellent Technologies, Inc.', 0x000D32: u'DispenseSource, Inc.', 0x000D33: u'Prediwave Corp.', 0x000D34: u'Shell International Exploration and Production, Inc.', 0x000D35: u'PAC International Ltd', 0x000D36: u'Wu Han Routon Electronic Co., Ltd', 0x000D37: u'WIPLUG', 0x000D38: u'NISSIN INC.', 0x000D39: u'Network Electronics', 0x000D3A: u'Microsoft Corp.', 0x000D3B: u'Microelectronics Technology Inc.', 0x000D3C: u'i.Tech Dynamic Ltd', 0x000D3D: u'Hammerhead Systems, Inc.', 0x000D3E: u'APLUX Communications Ltd.', 0x000D3F: u'VXI Technology', 0x000D40: u'Verint Loronix Video Solutions', 0x000D41: u'Siemens AG ICM MP UC RD IT KLF1', 0x000D42: u'Newbest Development Limited', 0x000D43: u'DRS Tactical Systems Inc.', 0x000D44: u'PRIVATE', 0x000D45: u'Tottori SANYO Electric Co., Ltd.', 0x000D46: u'SSD Drives, Inc.', 0x000D47: u'Collex', 0x000D48: u'AEWIN Technologies Co., Ltd.', 0x000D49: u'Triton Systems of Delaware, Inc.', 0x000D4A: u'Steag ETA-Optik', 0x000D4B: u'Roku, LLC', 0x000D4C: u'Outline Electronics Ltd.', 0x000D4D: u'Ninelanes', 0x000D4E: u'NDR Co.,LTD.', 0x000D4F: u'Kenwood Corporation', 0x000D50: u'Galazar Networks', 0x000D51: u'DIVR Systems, Inc.', 0x000D52: u'Comart system', 0x000D53: u'Beijing 5w Communication Corp.', 0x000D54: u'3Com Europe Ltd', 0x000D55: u'SANYCOM Technology Co.,Ltd', 0x000D56: u'Dell PCBA Test', 0x000D57: u'Fujitsu I-Network Systems Limited.', 0x000D58: u'PRIVATE', 0x000D59: u'Amity Systems, Inc.', 0x000D5A: u'Tiesse SpA', 0x000D5B: u'Smart Empire Investments Limited', 0x000D5C: u'Robert Bosch GmbH, VT-ATMO', 0x000D5D: u'Raritan Computer, Inc', 0x000D5E: u'NEC CustomTechnica, Ltd.', 0x000D5F: u'Minds Inc', 0x000D60: u'IBM Corporation', 0x000D61: u'Giga-Byte Technology Co., Ltd.', 0x000D62: u'Funkwerk Dabendorf GmbH', 0x000D63: u'DENT Instruments, Inc.', 0x000D64: u'COMAG Handels AG', 0x000D65: u'Cisco Systems', 0x000D66: u'Cisco Systems', 0x000D67: u'BelAir Networks Inc.', 0x000D68: u'Vinci Systems, Inc.', 0x000D69: u'TMT&D Corporation', 0x000D6A: u'Redwood Technologies LTD', 0x000D6B: u'Mita-Teknik A/S', 0x000D6C: u'M-Audio', 0x000D6D: u'K-Tech Devices Corp.', 0x000D6E: u'K-Patents Oy', 0x000D6F: u'Ember Corporation', 0x000D70: u'Datamax Corporation', 0x000D71: u'boca systems', 0x000D72: u'2Wire, Inc', 0x000D73: u'Technical Support, Inc.', 0x000D74: u'Sand Network Systems, Inc.', 0x000D75: u'Kobian Pte Ltd - Taiwan Branch', 0x000D76: u'Hokuto Denshi Co,. Ltd.', 0x000D77: u'FalconStor Software', 0x000D78: u'Engineering & Security', 0x000D79: u'Dynamic Solutions Co,.Ltd.', 0x000D7A: u'DiGATTO Asia Pacific Pte Ltd', 0x000D7B: u'Consensys Computers Inc.', 0x000D7C: u'Codian Ltd', 0x000D7D: u'Afco Systems', 0x000D7E: u'Axiowave Networks, Inc.', 0x000D7F: u'MIDAS COMMUNICATION TECHNOLOGIES PTE LTD ( Foreign Branch)', 0x000D80: u'Online Development Inc', 0x000D81: u'Pepperl+Fuchs GmbH', 0x000D82: u'PHS srl', 0x000D83: u'Sanmina-SCI Hungary Ltd.', 0x000D84: u'Makus Inc.', 0x000D85: u'Tapwave, Inc.', 0x000D86: u'Huber + Suhner AG', 0x000D87: u'Elitegroup Computer System Co. (ECS)', 0x000D88: u'D-Link Corporation', 0x000D89: u'Bils Technology Inc', 0x000D8A: u'Winners Electronics Co., Ltd.', 0x000D8B: u'T&D Corporation', 0x000D8C: u'Shanghai Wedone Digital Ltd. CO.', 0x000D8D: u'ProLinx Communication Gateways, Inc.', 0x000D8E: u'Koden Electronics Co., Ltd.', 0x000D8F: u'King Tsushin Kogyo Co., LTD.', 0x000D90: u'Factum Electronics AB', 0x000D91: u'Eclipse (HQ Espana) S.L.', 0x000D92: u'Arima Communication Corporation', 0x000D93: u'Apple Computer', 0x000D94: u'AFAR Communications,Inc', 0x000D95: u'Opti-cell, Inc.', 0x000D96: u'Vtera Technology Inc.', 0x000D97: u'Tropos Networks, Inc.', 0x000D98: u'S.W.A.C. Schmitt-Walter Automation Consult GmbH', 0x000D99: u'Orbital Sciences Corp.; Launch Systems Group', 0x000D9A: u'INFOTEC LTD', 0x000D9B: u'Heraeus Electro-Nite International N.V.', 0x000D9C: u'Elan GmbH & Co KG', 0x000D9D: u'Hewlett Packard', 0x000D9E: u'TOKUDEN OHIZUMI SEISAKUSYO Co.,Ltd.', 0x000D9F: u'RF Micro Devices', 0x000DA0: u'NEDAP N.V.', 0x000DA1: u'MIRAE ITS Co.,LTD.', 0x000DA2: u'Infrant Technologies, Inc.', 0x000DA3: u'Emerging Technologies Limited', 0x000DA4: u'DOSCH & AMAND SYSTEMS AG', 0x000DA5: u'Fabric7 Systems, Inc', 0x000DA6: u'Universal Switching Corporation', 0x000DA7: u'PRIVATE', 0x000DA8: u'Teletronics Technology Corporation', 0x000DA9: u'T.E.A.M. S.L.', 0x000DAA: u'S.A.Tehnology co.,Ltd.', 0x000DAB: u'Parker Hannifin GmbH Electromechanical Division Europe', 0x000DAC: u'Japan CBM Corporation', 0x000DAD: u'Dataprobe Inc', 0x000DAE: u'SAMSUNG HEAVY INDUSTRIES CO., LTD.', 0x000DAF: u'Plexus Corp (UK) Ltd', 0x000DB0: u'Olym-tech Co.,Ltd.', 0x000DB1: u'Japan Network Service Co., Ltd.', 0x000DB2: u'Ammasso, Inc.', 0x000DB3: u'SDO Communication Corperation', 0x000DB4: u'NETASQ', 0x000DB5: u'GLOBALSAT TECHNOLOGY CORPORATION', 0x000DB6: u'Teknovus, Inc.', 0x000DB7: u'SANKO ELECTRIC CO,.LTD', 0x000DB8: u'SCHILLER AG', 0x000DB9: u'PC Engines GmbH', 0x000DBA: u'Océ Document Technologies GmbH', 0x000DBB: u'Nippon Dentsu Co.,Ltd.', 0x000DBC: u'Cisco Systems', 0x000DBD: u'Cisco Systems', 0x000DBE: u'Bel Fuse Europe Ltd.,UK', 0x000DBF: u'TekTone Sound & Signal Mfg., Inc.', 0x000DC0: u'Spagat AS', 0x000DC1: u'SafeWeb Inc', 0x000DC2: u'PRIVATE', 0x000DC3: u'First Communication, Inc.', 0x000DC4: u'Emcore Corporation', 0x000DC5: u'EchoStar International Corporation', 0x000DC6: u'DigiRose Technology Co., Ltd.', 0x000DC7: u'COSMIC ENGINEERING INC.', 0x000DC8: u'AirMagnet, Inc', 0x000DC9: u'THALES Elektronik Systeme GmbH', 0x000DCA: u'Tait Electronics', 0x000DCB: u'Petcomkorea Co., Ltd.', 0x000DCC: u'NEOSMART Corp.', 0x000DCD: u'GROUPE TXCOM', 0x000DCE: u'Dynavac Technology Pte Ltd', 0x000DCF: u'Cidra Corp.', 0x000DD0: u'TetraTec Instruments GmbH', 0x000DD1: u'Stryker Corporation', 0x000DD2: u'Simrad Optronics ASA', 0x000DD3: u'SAMWOO Telecommunication Co.,Ltd.', 0x000DD4: u'Revivio Inc.', 0x000DD5: u'O\'RITE TECHNOLOGY CO.,LTD', 0x000DD6: u'ITI LTD', 0x000DD7: u'Bright', 0x000DD8: u'BBN', 0x000DD9: u'Anton Paar GmbH', 0x000DDA: u'ALLIED TELESIS K.K.', 0x000DDB: u'AIRWAVE TECHNOLOGIES INC.', 0x000DDC: u'VAC', 0x000DDD: u'PROFÝLO TELRA ELEKTRONÝK SANAYÝ VE TÝCARET A.Þ.', 0x000DDE: u'Joyteck Co., Ltd.', 0x000DDF: u'Japan Image & Network Inc.', 0x000DE0: u'ICPDAS Co.,LTD', 0x000DE1: u'Control Products, Inc.', 0x000DE2: u'CMZ Sistemi Elettronici', 0x000DE3: u'AT Sweden AB', 0x000DE4: u'DIGINICS, Inc.', 0x000DE5: u'Samsung Thales', 0x000DE6: u'YOUNGBO ENGINEERING CO.,LTD', 0x000DE7: u'Snap-on OEM Group', 0x000DE8: u'Nasaco Electronics Pte. Ltd', 0x000DE9: u'Napatech Aps', 0x000DEA: u'Kingtel Telecommunication Corp.', 0x000DEB: u'CompXs Limited', 0x000DEC: u'Cisco Systems', 0x000DED: u'Cisco Systems', 0x000DEE: u'Andrew RF Power Amplifier Group', 0x000DEF: u'Soc. Coop. Bilanciai', 0x000DF0: u'QCOM TECHNOLOGY INC.', 0x000DF1: u'IONIX INC.', 0x000DF2: u'PRIVATE', 0x000DF3: u'Asmax Solutions', 0x000DF4: u'Watertek Co.', 0x000DF5: u'Teletronics International Inc.', 0x000DF6: u'Technology Thesaurus Corp.', 0x000DF7: u'Space Dynamics Lab', 0x000DF8: u'ORGA Kartensysteme GmbH', 0x000DF9: u'NDS Limited', 0x000DFA: u'Micro Control Systems Ltd.', 0x000DFB: u'Komax AG', 0x000DFC: u'ITFOR Inc. resarch and development', 0x000DFD: u'Huges Hi-Tech Inc.,', 0x000DFE: u'Hauppauge Computer Works, Inc.', 0x000DFF: u'CHENMING MOLD INDUSTRY CORP.', 0x000E00: u'Atrie', 0x000E01: u'ASIP Technologies Inc.', 0x000E02: u'Advantech AMT Inc.', 0x000E03: u'Emulex', 0x000E04: u'CMA/Microdialysis AB', 0x000E05: u'WIRELESS MATRIX CORP.', 0x000E06: u'Team Simoco Ltd', 0x000E07: u'Sony Ericsson Mobile Communications AB', 0x000E08: u'Sipura Technology, Inc.', 0x000E09: u'Shenzhen Coship Software Co.,LTD.', 0x000E0A: u'SAKUMA DESIGN OFFICE', 0x000E0B: u'Netac Technology Co., Ltd.', 0x000E0C: u'Intel Corporation', 0x000E0D: u'HESCH Schröder GmbH', 0x000E0E: u'ESA elettronica S.P.A.', 0x000E0F: u'ERMME', 0x000E10: u'PRIVATE', 0x000E11: u'BDT Büro- und Datentechnik GmbH & Co. KG', 0x000E12: u'Adaptive Micro Systems Inc.', 0x000E13: u'Accu-Sort Systems inc.', 0x000E14: u'Visionary Solutions, Inc.', 0x000E15: u'Tadlys LTD', 0x000E16: u'SouthWing', 0x000E17: u'PRIVATE', 0x000E18: u'MyA Technology', 0x000E19: u'LogicaCMG Pty Ltd', 0x000E1A: u'JPS Communications', 0x000E1B: u'IAV GmbH', 0x000E1C: u'Hach Company', 0x000E1D: u'ARION Technology Inc.', 0x000E1E: u'PRIVATE', 0x000E1F: u'TCL Networks Equipment Co., Ltd.', 0x000E20: u'PalmSource, Inc.', 0x000E21: u'MTU Friedrichshafen GmbH', 0x000E22: u'PRIVATE', 0x000E23: u'Incipient, Inc.', 0x000E24: u'Huwell Technology Inc.', 0x000E25: u'Hannae Technology Co., Ltd', 0x000E26: u'Gincom Technology Corp.', 0x000E27: u'Crere Networks, Inc.', 0x000E28: u'Dynamic Ratings P/L', 0x000E29: u'Shester Communications Inc', 0x000E2A: u'PRIVATE', 0x000E2B: u'Safari Technologies', 0x000E2C: u'Netcodec co.', 0x000E2D: u'Hyundai Digital Technology Co.,Ltd.', 0x000E2E: u'Edimax Technology Co., Ltd.', 0x000E2F: u'Disetronic Medical Systems AG', 0x000E30: u'AERAS Networks, Inc.', 0x000E31: u'Olympus BioSystems GmbH', 0x000E32: u'Kontron Medical', 0x000E33: u'Shuko Electronics Co.,Ltd', 0x000E34: u'NexGen City, LP', 0x000E35: u'Intel Corp', 0x000E36: u'HEINESYS, Inc.', 0x000E37: u'Harms & Wende GmbH & Co.KG', 0x000E38: u'Cisco Systems', 0x000E39: u'Cisco Systems', 0x000E3A: u'Cirrus Logic', 0x000E3B: u'Hawking Technologies, Inc.', 0x000E3C: u'TransAct Technoloiges Inc.', 0x000E3D: u'Televic N.V.', 0x000E3E: u'Sun Optronics Inc', 0x000E3F: u'Soronti, Inc.', 0x000E40: u'Nortel Networks', 0x000E41: u'NIHON MECHATRONICS CO.,LTD.', 0x000E42: u'Motic Incoporation Ltd.', 0x000E43: u'G-Tek Electronics Sdn. Bhd.', 0x000E44: u'Digital 5, Inc.', 0x000E45: u'Beijing Newtry Electronic Technology Ltd', 0x000E46: u'Niigata Seimitsu Co.,Ltd.', 0x000E47: u'NCI System Co.,Ltd.', 0x000E48: u'Lipman TransAction Solutions', 0x000E49: u'Forsway Scandinavia AB', 0x000E4A: u'Changchun Huayu WEBPAD Co.,LTD', 0x000E4B: u'atrium c and i', 0x000E4C: u'Bermai Inc.', 0x000E4D: u'Numesa Inc.', 0x000E4E: u'Waveplus Technology Co., Ltd.', 0x000E4F: u'Trajet GmbH', 0x000E50: u'Thomson Telecom Belgium', 0x000E51: u'tecna elettronica srl', 0x000E52: u'Optium Corporation', 0x000E53: u'AV TECH CORPORATION', 0x000E54: u'AlphaCell Wireless Ltd.', 0x000E55: u'AUVITRAN', 0x000E56: u'4G Systems GmbH', 0x000E57: u'Iworld Networking, Inc.', 0x000E58: u'Sonos, Inc.', 0x000E59: u'SAGEM SA', 0x000E5A: u'TELEFIELD inc.', 0x000E5B: u'ParkerVision - Direct2Data', 0x000E5C: u'Motorola BCS', 0x000E5D: u'Triple Play Technologies A/S', 0x000E5E: u'Beijing Raisecom Science & Technology Development Co.,Ltd', 0x000E5F: u'activ-net GmbH & Co. KG', 0x000E60: u'360SUN Digital Broadband Corporation', 0x000E61: u'MICROTROL LIMITED', 0x000E62: u'Nortel Networks', 0x000E63: u'Lemke Diagnostics GmbH', 0x000E64: u'Elphel, Inc', 0x000E65: u'TransCore', 0x000E66: u'Hitachi Advanced Digital, Inc.', 0x000E67: u'Eltis Microelectronics Ltd.', 0x000E68: u'E-TOP Network Technology Inc.', 0x000E69: u'China Electric Power Research Institute', 0x000E6A: u'3COM EUROPE LTD', 0x000E6B: u'Janitza electronics GmbH', 0x000E6C: u'Device Drivers Limited', 0x000E6D: u'Murata Manufacturing Co., Ltd.', 0x000E6E: u'MICRELEC ELECTRONICS S.A', 0x000E6F: u'IRIS Corporation Berhad', 0x000E70: u'in2 Networks', 0x000E71: u'Gemstar Technology Development Ltd.', 0x000E72: u'CTS electronics', 0x000E73: u'Tpack A/S', 0x000E74: u'Solar Telecom. Tech', 0x000E75: u'New York Air Brake Corp.', 0x000E76: u'GEMSOC INNOVISION INC.', 0x000E77: u'Decru, Inc.', 0x000E78: u'Amtelco', 0x000E79: u'Ample Communications Inc.', 0x000E7A: u'GemWon Communications Co., Ltd.', 0x000E7B: u'Toshiba', 0x000E7C: u'Televes S.A.', 0x000E7D: u'Electronics Line 3000 Ltd.', 0x000E7E: u'Comprog Oy', 0x000E7F: u'Hewlett Packard', 0x000E80: u'Thomson Technology Inc', 0x000E81: u'Devicescape Software, Inc.', 0x000E82: u'Commtech Wireless', 0x000E83: u'Cisco Systems', 0x000E84: u'Cisco Systems', 0x000E85: u'Catalyst Enterprises, Inc.', 0x000E86: u'Alcatel North America', 0x000E87: u'adp Gauselmann GmbH', 0x000E88: u'VIDEOTRON CORP.', 0x000E89: u'CLEMATIC', 0x000E8A: u'Avara Technologies Pty. Ltd.', 0x000E8B: u'Astarte Technology Co, Ltd.', 0x000E8C: u'Siemens AG A&D ET', 0x000E8D: u'Systems in Progress Holding GmbH', 0x000E8E: u'SparkLAN Communications, Inc.', 0x000E8F: u'Sercomm Corp.', 0x000E90: u'PONICO CORP.', 0x000E91: u'Northstar Technologies', 0x000E92: u'Millinet Co., Ltd.', 0x000E93: u'Milénio 3 Sistemas Electrónicos, Lda.', 0x000E94: u'Maas International BV', 0x000E95: u'Fujiya Denki Seisakusho Co.,Ltd.', 0x000E96: u'Cubic Defense Applications, Inc.', 0x000E97: u'Ultracker Technology CO., Inc', 0x000E98: u'Vitec CC, INC.', 0x000E99: u'Spectrum Digital, Inc', 0x000E9A: u'BOE TECHNOLOGY GROUP CO.,LTD', 0x000E9B: u'Ambit Microsystems Corporation', 0x000E9C: u'Pemstar', 0x000E9D: u'Video Networks Ltd', 0x000E9E: u'Topfield Co., Ltd', 0x000E9F: u'TEMIC SDS GmbH', 0x000EA0: u'NetKlass Technology Inc.', 0x000EA1: u'Formosa Teletek Corporation', 0x000EA2: u'CyberGuard Corporation', 0x000EA3: u'CNCR-IT CO.,LTD,HangZhou P.R.CHINA', 0x000EA4: u'Certance Inc.', 0x000EA5: u'BLIP Systems', 0x000EA6: u'ASUSTEK COMPUTER INC.', 0x000EA7: u'Endace Inc Ltd.', 0x000EA8: u'United Technologists Europe Limited', 0x000EA9: u'Shanghai Xun Shi Communications Equipment Ltd. Co.', 0x000EAA: u'Scalent Systems, Inc.', 0x000EAB: u'OctigaBay Systems Corporation', 0x000EAC: u'MINTRON ENTERPRISE CO., LTD.', 0x000EAD: u'Metanoia Technologies, Inc.', 0x000EAE: u'GAWELL TECHNOLOGIES CORP.', 0x000EAF: u'CASTEL', 0x000EB0: u'Solutions Radio BV', 0x000EB1: u'Newcotech,Ltd', 0x000EB2: u'Micro-Research Finland Oy', 0x000EB3: u'LeftHand Networks', 0x000EB4: u'GUANGZHOU GAOKE COMMUNICATIONS TECHNOLOGY CO.LTD.', 0x000EB5: u'Ecastle Electronics Co., Ltd.', 0x000EB6: u'Riverbed Technology, Inc.', 0x000EB7: u'Knovative, Inc.', 0x000EB8: u'Iiga co.,Ltd', 0x000EB9: u'HASHIMOTO Electronics Industry Co.,Ltd.', 0x000EBA: u'HANMI SEMICONDUCTOR CO., LTD.', 0x000EBB: u'Everbee Networks', 0x000EBC: u'Cullmann GmbH', 0x000EBD: u'Burdick, a Quinton Compny', 0x000EBE: u'B&B Electronics Manufacturing Co.', 0x000EBF: u'Remsdaq Limited', 0x000EC0: u'Nortel Networks', 0x000EC1: u'MYNAH Technologies', 0x000EC2: u'Lowrance Electronics, Inc.', 0x000EC3: u'Logic Controls, Inc.', 0x000EC4: u'Iskra Transmission d.d.', 0x000EC5: u'Digital Multitools Inc', 0x000EC6: u'ASIX ELECTRONICS CORP.', 0x000EC7: u'Motorola Korea', 0x000EC8: u'Zoran Corporation', 0x000EC9: u'YOKO Technology Corp.', 0x000ECA: u'WTSS Inc', 0x000ECB: u'VineSys Technology', 0x000ECC: u'Tableau', 0x000ECD: u'SKOV A/S', 0x000ECE: u'S.I.T.T.I. S.p.A.', 0x000ECF: u'PROFIBUS Nutzerorganisation e.V.', 0x000ED0: u'Privaris, Inc.', 0x000ED1: u'Osaka Micro Computer.', 0x000ED2: u'Filtronic plc', 0x000ED3: u'Epicenter, Inc.', 0x000ED4: u'CRESITT INDUSTRIE', 0x000ED5: u'COPAN Systems Inc.', 0x000ED6: u'Cisco Systems', 0x000ED7: u'Cisco Systems', 0x000ED8: u'Aktino, Inc.', 0x000ED9: u'Aksys, Ltd.', 0x000EDA: u'C-TECH UNITED CORP.', 0x000EDB: u'XiNCOM Corp.', 0x000EDC: u'Tellion INC.', 0x000EDD: u'SHURE INCORPORATED', 0x000EDE: u'REMEC, Inc.', 0x000EDF: u'PLX Technology', 0x000EE0: u'Mcharge', 0x000EE1: u'ExtremeSpeed Inc.', 0x000EE2: u'Custom Engineering S.p.A.', 0x000EE3: u'Chiyu Technology Co.,Ltd', 0x000EE4: u'BOE TECHNOLOGY GROUP CO.,LTD', 0x000EE5: u'bitWallet, Inc.', 0x000EE6: u'Adimos Systems LTD', 0x000EE7: u'AAC ELECTRONICS CORP.', 0x000EE8: u'zioncom', 0x000EE9: u'WayTech Development, Inc.', 0x000EEA: u'Shadong Luneng Jicheng Electronics,Co.,Ltd', 0x000EEB: u'Sandmartin(zhong shan)Electronics Co.,Ltd', 0x000EEC: u'Orban', 0x000EED: u'Nokia Danmark A/S', 0x000EEE: u'Muco Industrie BV', 0x000EEF: u'PRIVATE', 0x000EF0: u'Festo AG & Co. KG', 0x000EF1: u'EZQUEST INC.', 0x000EF2: u'Infinico Corporation', 0x000EF3: u'Smarthome', 0x000EF4: u'Shenzhen Kasda Digital Technology Co.,Ltd', 0x000EF5: u'iPAC Technology Co., Ltd.', 0x000EF6: u'E-TEN Information Systems Co., Ltd.', 0x000EF7: u'Vulcan Portals Inc', 0x000EF8: u'SBC ASI', 0x000EF9: u'REA Elektronik GmbH', 0x000EFA: u'Optoway Technology Incorporation', 0x000EFB: u'Macey Enterprises', 0x000EFC: u'JTAG Technologies B.V.', 0x000EFD: u'FUJI PHOTO OPTICAL CO., LTD.', 0x000EFE: u'EndRun Technologies LLC', 0x000EFF: u'Megasolution,Inc.', 0x000F00: u'Legra Systems, Inc.', 0x000F01: u'DIGITALKS INC', 0x000F02: u'Digicube Technology Co., Ltd', 0x000F03: u'COM&C CO., LTD', 0x000F04: u'cim-usa inc', 0x000F05: u'3B SYSTEM INC.', 0x000F06: u'Nortel Networks', 0x000F07: u'Mangrove Systems, Inc.', 0x000F08: u'Indagon Oy', 0x000F09: u'PRIVATE', 0x000F0A: u'Clear Edge Networks', 0x000F0B: u'Kentima Technologies AB', 0x000F0C: u'SYNCHRONIC ENGINEERING', 0x000F0D: u'Hunt Electronic Co., Ltd.', 0x000F0E: u'WaveSplitter Technologies, Inc.', 0x000F0F: u'Real ID Technology Co., Ltd.', 0x000F10: u'RDM Corporation', 0x000F11: u'Prodrive B.V.', 0x000F12: u'Panasonic AVC Networks Germany GmbH', 0x000F13: u'Nisca corporation', 0x000F14: u'Mindray Co., Ltd.', 0x000F15: u'Kjaerulff1 A/S', 0x000F16: u'JAY HOW TECHNOLOGY CO.,', 0x000F17: u'Insta Elektro GmbH', 0x000F18: u'Industrial Control Systems', 0x000F19: u'Guidant Corporation', 0x000F1A: u'Gaming Support B.V.', 0x000F1B: u'Ego Systems Inc.', 0x000F1C: u'DigitAll World Co., Ltd', 0x000F1D: u'Cosmo Techs Co., Ltd.', 0x000F1E: u'Chengdu KT Electric Co.of High & New Technology', 0x000F1F: u'WW PCBA Test', 0x000F20: u'Hewlett Packard', 0x000F21: u'Scientific Atlanta, Inc', 0x000F22: u'Helius, Inc.', 0x000F23: u'Cisco Systems', 0x000F24: u'Cisco Systems', 0x000F25: u'AimValley B.V.', 0x000F26: u'WorldAccxx LLC', 0x000F27: u'TEAL Electronics, Inc.', 0x000F28: u'Itronix Corporation', 0x000F29: u'Augmentix Corporation', 0x000F2A: u'Cableware Electronics', 0x000F2B: u'GREENBELL SYSTEMS', 0x000F2C: u'Uplogix, Inc.', 0x000F2D: u'CHUNG-HSIN ELECTRIC & MACHINERY MFG.CORP.', 0x000F2E: u'Megapower International Corp.', 0x000F2F: u'W-LINX TECHNOLOGY CO., LTD.', 0x000F30: u'Raza Microelectronics Inc', 0x000F31: u'Prosilica', 0x000F32: u'LuTong Electronic Technology Co.,Ltd', 0x000F33: u'DUALi Inc.', 0x000F34: u'Cisco Systems', 0x000F35: u'Cisco Systems', 0x000F36: u'Accurate Techhnologies, Inc.', 0x000F37: u'Xambala Incorporated', 0x000F38: u'Netstar', 0x000F39: u'IRIS SENSORS', 0x000F3A: u'HISHARP', 0x000F3B: u'Fuji System Machines Co., Ltd.', 0x000F3C: u'Endeleo Limited', 0x000F3D: u'D-Link Corporation', 0x000F3E: u'CardioNet, Inc', 0x000F3F: u'Big Bear Networks', 0x000F40: u'Optical Internetworking Forum', 0x000F41: u'Zipher Ltd', 0x000F42: u'Xalyo Systems', 0x000F43: u'Wasabi Systems Inc.', 0x000F44: u'Tivella Inc.', 0x000F45: u'Stretch, Inc.', 0x000F46: u'SINAR AG', 0x000F47: u'ROBOX SPA', 0x000F48: u'Polypix Inc.', 0x000F49: u'Northover Solutions Limited', 0x000F4A: u'Kyushu-kyohan co.,ltd', 0x000F4B: u'Katana Technology', 0x000F4C: u'Elextech INC', 0x000F4D: u'Centrepoint Technologies Inc.', 0x000F4E: u'Cellink', 0x000F4F: u'Cadmus Technology Ltd', 0x000F50: u'Baxall Limited', 0x000F51: u'Azul Systems, Inc.', 0x000F52: u'YORK Refrigeration, Marine & Controls', 0x000F53: u'Solarflare Communications Inc', 0x000F54: u'Entrelogic Corporation', 0x000F55: u'Datawire Communication Networks Inc.', 0x000F56: u'Continuum Photonics Inc', 0x000F57: u'CABLELOGIC Co., Ltd.', 0x000F58: u'Adder Technology Limited', 0x000F59: u'Phonak Communications AG', 0x000F5A: u'Peribit Networks', 0x000F5B: u'Delta Information Systems, Inc.', 0x000F5C: u'Day One Digital Media Limited', 0x000F5D: u'42Networks AB', 0x000F5E: u'Veo', 0x000F5F: u'Nicety Technologies Inc. (NTS)', 0x000F60: u'Lifetron Co.,Ltd', 0x000F61: u'Kiwi Networks', 0x000F62: u'Alcatel Bell Space N.V.', 0x000F63: u'Obzerv Technologies', 0x000F64: u'D&R Electronica Weesp BV', 0x000F65: u'icube Corp.', 0x000F66: u'Cisco-Linksys', 0x000F67: u'West Instruments', 0x000F68: u'Vavic Network Technology, Inc.', 0x000F69: u'SEW Eurodrive GmbH & Co. KG', 0x000F6A: u'Nortel Networks', 0x000F6B: u'GateWare Communications GmbH', 0x000F6C: u'ADDI-DATA GmbH', 0x000F6D: u'Midas Engineering', 0x000F6E: u'BBox', 0x000F6F: u'FTA Communication Technologies', 0x000F70: u'Wintec Industries, inc.', 0x000F71: u'Sanmei Electronics Co.,Ltd', 0x000F72: u'Sandburst', 0x000F73: u'Rockwell Samsung Automation', 0x000F74: u'Qamcom Technology AB', 0x000F75: u'First Silicon Solutions', 0x000F76: u'Digital Keystone, Inc.', 0x000F77: u'DENTUM CO.,LTD', 0x000F78: u'Datacap Systems Inc', 0x000F79: u'Bluetooth Interest Group Inc.', 0x000F7A: u'BeiJing NuQX Technology CO.,LTD', 0x000F7B: u'Arce Sistemas, S.A.', 0x000F7C: u'ACTi Corporation', 0x000F7D: u'Xirrus', 0x000F7E: u'Ablerex Electronics Co., LTD', 0x000F7F: u'UBSTORAGE Co.,Ltd.', 0x000F80: u'Trinity Security Systems,Inc.', 0x000F81: u'Secure Info Imaging', 0x000F82: u'Mortara Instrument, Inc.', 0x000F83: u'Brainium Technologies Inc.', 0x000F84: u'Astute Networks, Inc.', 0x000F85: u'ADDO-Japan Corporation', 0x000F86: u'Research In Motion Limited', 0x000F87: u'Maxcess International', 0x000F88: u'AMETEK, Inc.', 0x000F89: u'Winnertec System Co., Ltd.', 0x000F8A: u'WideView', 0x000F8B: u'Orion MultiSystems Inc', 0x000F8C: u'Gigawavetech Pte Ltd', 0x000F8D: u'FAST TV-Server AG', 0x000F8E: u'DONGYANG TELECOM CO.,LTD.', 0x000F8F: u'Cisco Systems', 0x000F90: u'Cisco Systems', 0x000F91: u'Aerotelecom Co.,Ltd.', 0x000F92: u'Microhard Systems Inc.', 0x000F93: u'Landis+Gyr Ltd.', 0x000F94: u'Genexis', 0x000F95: u'ELECOM Co.,LTD Laneed Division', 0x000F96: u'Critical Telecom Corp.', 0x000F97: u'Avanex Corporation', 0x000F98: u'Avamax Co. Ltd.', 0x000F99: u'APAC opto Electronics Inc.', 0x000F9A: u'Synchrony, Inc.', 0x000F9B: u'Ross Video Limited', 0x000F9C: u'Panduit Corp', 0x000F9D: u'Newnham Research Ltd', 0x000F9E: u'Murrelektronik GmbH', 0x000F9F: u'Motorola BCS', 0x000FA0: u'CANON KOREA BUSINESS SOLUTIONS INC.', 0x000FA1: u'Gigabit Systems Inc.', 0x000FA2: u'Digital Path Networks', 0x000FA3: u'Alpha Networks Inc.', 0x000FA4: u'Sprecher Automation GmbH', 0x000FA5: u'SMP / BWA Technology GmbH', 0x000FA6: u'S2 Security Corporation', 0x000FA7: u'Raptor Networks Technology', 0x000FA8: u'Photometrics, Inc.', 0x000FA9: u'PC Fabrik', 0x000FAA: u'Nexus Technologies', 0x000FAB: u'Kyushu Electronics Systems Inc.', 0x000FAC: u'IEEE 802.11', 0x000FAD: u'FMN communications GmbH', 0x000FAE: u'E2O Communications', 0x000FAF: u'Dialog Inc.', 0x000FB0: u'Compal Electronics,INC.', 0x000FB1: u'Cognio Inc.', 0x000FB2: u'Broadband Pacenet (India) Pvt. Ltd.', 0x000FB3: u'Actiontec Electronics, Inc', 0x000FB4: u'Timespace Technology', 0x000FB5: u'NETGEAR Inc', 0x000FB6: u'Europlex Technologies', 0x000FB7: u'Cavium Networks', 0x000FB8: u'CallURL Inc.', 0x000FB9: u'Adaptive Instruments', 0x000FBA: u'Tevebox AB', 0x000FBB: u'Siemens Networks GmbH & Co. KG', 0x000FBC: u'Onkey Technologies, Inc.', 0x000FBD: u'MRV Communications (Networks) LTD', 0x000FBE: u'e-w/you Inc.', 0x000FBF: u'DGT Sp. z o.o.', 0x000FC0: u'DELCOMp', 0x000FC1: u'WAVE Corporation', 0x000FC2: u'Uniwell Corporation', 0x000FC3: u'PalmPalm Technology, Inc.', 0x000FC4: u'NST co.,LTD.', 0x000FC5: u'KeyMed Ltd', 0x000FC6: u'Eurocom Industries A/S', 0x000FC7: u'Dionica R&D Ltd.', 0x000FC8: u'Chantry Networks', 0x000FC9: u'Allnet GmbH', 0x000FCA: u'A-JIN TECHLINE CO, LTD', 0x000FCB: u'3COM EUROPE LTD', 0x000FCC: u'Netopia, Inc.', 0x000FCD: u'Nortel Networks', 0x000FCE: u'Kikusui Electronics Corp.', 0x000FCF: u'Datawind Research', 0x000FD0: u'ASTRI', 0x000FD1: u'Applied Wireless Identifications Group, Inc.', 0x000FD2: u'EWA Technologies, Inc.', 0x000FD3: u'Digium', 0x000FD4: u'Soundcraft', 0x000FD5: u'Schwechat - RISE', 0x000FD6: u'Sarotech Co., Ltd', 0x000FD7: u'Harman Music Group', 0x000FD8: u'Force, Inc.', 0x000FD9: u'FlexDSL Telecommunications AG', 0x000FDA: u'YAZAKI CORPORATION', 0x000FDB: u'Westell Technologies', 0x000FDC: u'Ueda Japan Radio Co., Ltd.', 0x000FDD: u'SORDIN AB', 0x000FDE: u'Sony Ericsson Mobile Communications AB', 0x000FDF: u'SOLOMON Technology Corp.', 0x000FE0: u'NComputing Co.,Ltd.', 0x000FE1: u'ID DIGITAL CORPORATION', 0x000FE2: u'Hangzhou Huawei-3Com Tech. Co., Ltd.', 0x000FE3: u'Damm Cellular Systems A/S', 0x000FE4: u'Pantech Co.,Ltd', 0x000FE5: u'MERCURY SECURITY CORPORATION', 0x000FE6: u'MBTech Systems, Inc.', 0x000FE7: u'Lutron Electronics Co., Inc.', 0x000FE8: u'Lobos, Inc.', 0x000FE9: u'GW TECHNOLOGIES CO.,LTD.', 0x000FEA: u'Giga-Byte Technology Co.,LTD.', 0x000FEB: u'Cylon Controls', 0x000FEC: u'Arkus Inc.', 0x000FED: u'Anam Electronics Co., Ltd', 0x000FEE: u'XTec, Incorporated', 0x000FEF: u'Thales e-Transactions GmbH', 0x000FF0: u'Sunray Enterprise', 0x000FF1: u'nex-G Systems Pte.Ltd', 0x000FF2: u'Loud Technologies Inc.', 0x000FF3: u'Jung Myoung Communications&Technology', 0x000FF4: u'Guntermann & Drunck GmbH', 0x000FF5: u'GN&S company', 0x000FF6: u'Darfon Electronics Corp.', 0x000FF7: u'Cisco Systems', 0x000FF8: u'Cisco Systems', 0x000FF9: u'Valcretec, Inc.', 0x000FFA: u'Optinel Systems, Inc.', 0x000FFB: u'Nippon Denso Industry Co., Ltd.', 0x000FFC: u'Merit Li-Lin Ent.', 0x000FFD: u'Glorytek Network Inc.', 0x000FFE: u'G-PRO COMPUTER', 0x000FFF: u'Control4', 0x001000: u'CABLE TELEVISION LABORATORIES, INC.', 0x001001: u'MCK COMMUNICATIONS', 0x001002: u'ACTIA', 0x001003: u'IMATRON, INC.', 0x001004: u'THE BRANTLEY COILE COMPANY,INC', 0x001005: u'UEC COMMERCIAL', 0x001006: u'Thales Contact Solutions Ltd.', 0x001007: u'CISCO SYSTEMS, INC.', 0x001008: u'VIENNA SYSTEMS CORPORATION', 0x001009: u'HORO QUARTZ', 0x00100A: u'WILLIAMS COMMUNICATIONS GROUP', 0x00100B: u'CISCO SYSTEMS, INC.', 0x00100C: u'ITO CO., LTD.', 0x00100D: u'CISCO SYSTEMS, INC.', 0x00100E: u'MICRO LINEAR COPORATION', 0x00100F: u'INDUSTRIAL CPU SYSTEMS', 0x001010: u'INITIO CORPORATION', 0x001011: u'CISCO SYSTEMS, INC.', 0x001012: u'PROCESSOR SYSTEMS (I) PVT LTD', 0x001013: u'Kontron', 0x001014: u'CISCO SYSTEMS, INC.', 0x001015: u'OOmon Inc.', 0x001016: u'T.SQWARE', 0x001017: u'MICOS GmbH', 0x001018: u'BROADCOM CORPORATION', 0x001019: u'SIRONA DENTAL SYSTEMS GmbH & Co. KG', 0x00101A: u'PictureTel Corp.', 0x00101B: u'CORNET TECHNOLOGY, INC.', 0x00101C: u'OHM TECHNOLOGIES INTL, LLC', 0x00101D: u'WINBOND ELECTRONICS CORP.', 0x00101E: u'MATSUSHITA ELECTRONIC INSTRUMENTS CORP.', 0x00101F: u'CISCO SYSTEMS, INC.', 0x001020: u'WELCH ALLYN, DATA COLLECTION', 0x001021: u'ENCANTO NETWORKS, INC.', 0x001022: u'SatCom Media Corporation', 0x001023: u'FLOWWISE NETWORKS, INC.', 0x001024: u'NAGOYA ELECTRIC WORKS CO., LTD', 0x001025: u'GRAYHILL INC.', 0x001026: u'ACCELERATED NETWORKS, INC.', 0x001027: u'L-3 COMMUNICATIONS EAST', 0x001028: u'COMPUTER TECHNICA, INC.', 0x001029: u'CISCO SYSTEMS, INC.', 0x00102A: u'ZF MICROSYSTEMS, INC.', 0x00102B: u'UMAX DATA SYSTEMS, INC.', 0x00102C: u'Lasat Networks A/S', 0x00102D: u'HITACHI SOFTWARE ENGINEERING', 0x00102E: u'NETWORK SYSTEMS & TECHNOLOGIES PVT. LTD.', 0x00102F: u'CISCO SYSTEMS, INC.', 0x001030: u'EION Inc.', 0x001031: u'OBJECTIVE COMMUNICATIONS, INC.', 0x001032: u'ALTA TECHNOLOGY', 0x001033: u'ACCESSLAN COMMUNICATIONS, INC.', 0x001034: u'GNP Computers', 0x001035: u'ELITEGROUP COMPUTER SYSTEMS CO., LTD', 0x001036: u'INTER-TEL INTEGRATED SYSTEMS', 0x001037: u'CYQ\'ve Technology Co., Ltd.', 0x001038: u'MICRO RESEARCH INSTITUTE, INC.', 0x001039: u'Vectron Systems AG', 0x00103A: u'DIAMOND NETWORK TECH', 0x00103B: u'HIPPI NETWORKING FORUM', 0x00103C: u'IC ENSEMBLE, INC.', 0x00103D: u'PHASECOM, LTD.', 0x00103E: u'NETSCHOOLS CORPORATION', 0x00103F: u'TOLLGRADE COMMUNICATIONS, INC.', 0x001040: u'INTERMEC CORPORATION', 0x001041: u'BRISTOL BABCOCK, INC.', 0x001042: u'AlacriTech', 0x001043: u'A2 CORPORATION', 0x001044: u'InnoLabs Corporation', 0x001045: u'Nortel Networks', 0x001046: u'ALCORN MCBRIDE INC.', 0x001047: u'ECHO ELETRIC CO. LTD.', 0x001048: u'HTRC AUTOMATION, INC.', 0x001049: u'SHORELINE TELEWORKS, INC.', 0x00104A: u'THE PARVUC CORPORATION', 0x00104B: u'3COM CORPORATION', 0x00104C: u'COMPUTER ACCESS TECHNOLOGY', 0x00104D: u'SURTEC INDUSTRIES, INC.', 0x00104E: u'CEOLOGIC', 0x00104F: u'STORAGE TECHNOLOGY CORPORATION', 0x001050: u'RION CO., LTD.', 0x001051: u'CMICRO CORPORATION', 0x001052: u'METTLER-TOLEDO (ALBSTADT) GMBH', 0x001053: u'COMPUTER TECHNOLOGY CORP.', 0x001054: u'CISCO SYSTEMS, INC.', 0x001055: u'FUJITSU MICROELECTRONICS, INC.', 0x001056: u'SODICK CO., LTD.', 0x001057: u'Rebel.com, Inc.', 0x001058: u'ArrowPoint Communications', 0x001059: u'DIABLO RESEARCH CO. LLC', 0x00105A: u'3COM CORPORATION', 0x00105B: u'NET INSIGHT AB', 0x00105C: u'QUANTUM DESIGNS (H.K.) LTD.', 0x00105D: u'Draeger Medical', 0x00105E: u'HEKIMIAN LABORATORIES, INC.', 0x00105F: u'IN-SNEC', 0x001060: u'BILLIONTON SYSTEMS, INC.', 0x001061: u'HOSTLINK CORP.', 0x001062: u'NX SERVER, ILNC.', 0x001063: u'STARGUIDE DIGITAL NETWORKS', 0x001064: u'DNPG, LLC', 0x001065: u'RADYNE CORPORATION', 0x001066: u'ADVANCED CONTROL SYSTEMS, INC.', 0x001067: u'REDBACK NETWORKS, INC.', 0x001068: u'COMOS TELECOM', 0x001069: u'HELIOSS COMMUNICATIONS, INC.', 0x00106A: u'DIGITAL MICROWAVE CORPORATION', 0x00106B: u'SONUS NETWORKS, INC.', 0x00106C: u'INFRATEC PLUS GmbH', 0x00106D: u'Axxcelera Broadband Wireless', 0x00106E: u'TADIRAN COM. LTD.', 0x00106F: u'TRENTON TECHNOLOGY INC.', 0x001070: u'CARADON TREND LTD.', 0x001071: u'ADVANET INC.', 0x001072: u'GVN TECHNOLOGIES, INC.', 0x001073: u'TECHNOBOX, INC.', 0x001074: u'ATEN INTERNATIONAL CO., LTD.', 0x001075: u'Maxtor Corporation', 0x001076: u'EUREM GmbH', 0x001077: u'SAF DRIVE SYSTEMS, LTD.', 0x001078: u'NUERA COMMUNICATIONS, INC.', 0x001079: u'CISCO SYSTEMS, INC.', 0x00107A: u'AmbiCom, Inc.', 0x00107B: u'CISCO SYSTEMS, INC.', 0x00107C: u'P-COM, INC.', 0x00107D: u'AURORA COMMUNICATIONS, LTD.', 0x00107E: u'BACHMANN ELECTRONIC GmbH', 0x00107F: u'CRESTRON ELECTRONICS, INC.', 0x001080: u'METAWAVE COMMUNICATIONS', 0x001081: u'DPS, INC.', 0x001082: u'JNA TELECOMMUNICATIONS LIMITED', 0x001083: u'HEWLETT-PACKARD COMPANY', 0x001084: u'K-BOT COMMUNICATIONS', 0x001085: u'POLARIS COMMUNICATIONS, INC.', 0x001086: u'ATTO TECHNOLOGY, INC.', 0x001087: u'Xstreamis PLC', 0x001088: u'AMERICAN NETWORKS INC.', 0x001089: u'WebSonic', 0x00108A: u'TeraLogic, Inc.', 0x00108B: u'LASERANIMATION SOLLINGER GmbH', 0x00108C: u'FUJITSU TELECOMMUNICATIONS EUROPE, LTD.', 0x00108D: u'JOHNSON CONTROLS, INC.', 0x00108E: u'HUGH SYMONS CONCEPT Technologies Ltd.', 0x00108F: u'RAPTOR SYSTEMS', 0x001090: u'CIMETRICS, INC.', 0x001091: u'NO WIRES NEEDED BV', 0x001092: u'NETCORE INC.', 0x001093: u'CMS COMPUTERS, LTD.', 0x001094: u'Performance Analysis Broadband, Spirent plc', 0x001095: u'Thomson Inc.', 0x001096: u'TRACEWELL SYSTEMS, INC.', 0x001097: u'WinNet Metropolitan Communications Systems, Inc.', 0x001098: u'STARNET TECHNOLOGIES, INC.', 0x001099: u'InnoMedia, Inc.', 0x00109A: u'NETLINE', 0x00109B: u'Emulex Corporation', 0x00109C: u'M-SYSTEM CO., LTD.', 0x00109D: u'CLARINET SYSTEMS, INC.', 0x00109E: u'AWARE, INC.', 0x00109F: u'PAVO, INC.', 0x0010A0: u'INNOVEX TECHNOLOGIES, INC.', 0x0010A1: u'KENDIN SEMICONDUCTOR, INC.', 0x0010A2: u'TNS', 0x0010A3: u'OMNITRONIX, INC.', 0x0010A4: u'XIRCOM', 0x0010A5: u'OXFORD INSTRUMENTS', 0x0010A6: u'CISCO SYSTEMS, INC.', 0x0010A7: u'UNEX TECHNOLOGY CORPORATION', 0x0010A8: u'RELIANCE COMPUTER CORP.', 0x0010A9: u'ADHOC TECHNOLOGIES', 0x0010AA: u'MEDIA4, INC.', 0x0010AB: u'KOITO INDUSTRIES, LTD.', 0x0010AC: u'IMCI TECHNOLOGIES', 0x0010AD: u'SOFTRONICS USB, INC.', 0x0010AE: u'SHINKO ELECTRIC INDUSTRIES CO.', 0x0010AF: u'TAC SYSTEMS, INC.', 0x0010B0: u'MERIDIAN TECHNOLOGY CORP.', 0x0010B1: u'FOR-A CO., LTD.', 0x0010B2: u'COACTIVE AESTHETICS', 0x0010B3: u'NOKIA MULTIMEDIA TERMINALS', 0x0010B4: u'ATMOSPHERE NETWORKS', 0x0010B5: u'ACCTON TECHNOLOGY CORPORATION', 0x0010B6: u'ENTRATA COMMUNICATIONS CORP.', 0x0010B7: u'COYOTE TECHNOLOGIES, LLC', 0x0010B8: u'ISHIGAKI COMPUTER SYSTEM CO.', 0x0010B9: u'MAXTOR CORP.', 0x0010BA: u'MARTINHO-DAVIS SYSTEMS, INC.', 0x0010BB: u'DATA & INFORMATION TECHNOLOGY', 0x0010BC: u'Aastra Telecom', 0x0010BD: u'THE TELECOMMUNICATION TECHNOLOGY COMMITTEE', 0x0010BE: u'TELEXIS CORP.', 0x0010BF: u'InterAir Wireless', 0x0010C0: u'ARMA, INC.', 0x0010C1: u'OI ELECTRIC CO., LTD.', 0x0010C2: u'WILLNET, INC.', 0x0010C3: u'CSI-CONTROL SYSTEMS', 0x0010C4: u'MEDIA LINKS CO., LTD.', 0x0010C5: u'PROTOCOL TECHNOLOGIES, INC.', 0x0010C6: u'USI', 0x0010C7: u'DATA TRANSMISSION NETWORK', 0x0010C8: u'COMMUNICATIONS ELECTRONICS SECURITY GROUP', 0x0010C9: u'MITSUBISHI ELECTRONICS LOGISTIC SUPPORT CO.', 0x0010CA: u'INTEGRAL ACCESS', 0x0010CB: u'FACIT K.K.', 0x0010CC: u'CLP COMPUTER LOGISTIK PLANUNG GmbH', 0x0010CD: u'INTERFACE CONCEPT', 0x0010CE: u'VOLAMP, LTD.', 0x0010CF: u'FIBERLANE COMMUNICATIONS', 0x0010D0: u'WITCOM, LTD.', 0x0010D1: u'Top Layer Networks, Inc.', 0x0010D2: u'NITTO TSUSHINKI CO., LTD', 0x0010D3: u'GRIPS ELECTRONIC GMBH', 0x0010D4: u'STORAGE COMPUTER CORPORATION', 0x0010D5: u'IMASDE CANARIAS, S.A.', 0x0010D6: u'ITT - A/CD', 0x0010D7: u'ARGOSY RESEARCH INC.', 0x0010D8: u'CALISTA', 0x0010D9: u'IBM JAPAN, FUJISAWA MT+D', 0x0010DA: u'MOTION ENGINEERING, INC.', 0x0010DB: u'Juniper Networks, Inc.', 0x0010DC: u'MICRO-STAR INTERNATIONAL CO., LTD.', 0x0010DD: u'ENABLE SEMICONDUCTOR, INC.', 0x0010DE: u'INTERNATIONAL DATACASTING CORPORATION', 0x0010DF: u'RISE COMPUTER INC.', 0x0010E0: u'COBALT MICROSERVER, INC.', 0x0010E1: u'S.I. TECH, INC.', 0x0010E2: u'ArrayComm, Inc.', 0x0010E3: u'COMPAQ COMPUTER CORPORATION', 0x0010E4: u'NSI CORPORATION', 0x0010E5: u'SOLECTRON TEXAS', 0x0010E6: u'APPLIED INTELLIGENT SYSTEMS, INC.', 0x0010E7: u'BreezeCom', 0x0010E8: u'TELOCITY, INCORPORATED', 0x0010E9: u'RAIDTEC LTD.', 0x0010EA: u'ADEPT TECHNOLOGY', 0x0010EB: u'SELSIUS SYSTEMS, INC.', 0x0010EC: u'RPCG, LLC', 0x0010ED: u'SUNDANCE TECHNOLOGY, INC.', 0x0010EE: u'CTI PRODUCTS, INC.', 0x0010EF: u'DBTEL INCORPORATED', 0x0010F1: u'I-O CORPORATION', 0x0010F2: u'ANTEC', 0x0010F3: u'Nexcom International Co., Ltd.', 0x0010F4: u'VERTICAL NETWORKS, INC.', 0x0010F5: u'AMHERST SYSTEMS, INC.', 0x0010F6: u'CISCO SYSTEMS, INC.', 0x0010F7: u'IRIICHI TECHNOLOGIES Inc.', 0x0010F8: u'TEXIO CORPORATION', 0x0010F9: u'UNIQUE SYSTEMS, INC.', 0x0010FA: u'ZAYANTE, INC.', 0x0010FB: u'ZIDA TECHNOLOGIES LIMITED', 0x0010FC: u'BROADBAND NETWORKS, INC.', 0x0010FD: u'COCOM A/S', 0x0010FE: u'DIGITAL EQUIPMENT CORPORATION', 0x0010FF: u'CISCO SYSTEMS, INC.', 0x001100: u'RAM Industries, LLC', 0x001101: u'CET Technologies Pte Ltd', 0x001102: u'Aurora Multimedia Corp.', 0x001103: u'kawamura electric inc.', 0x001104: u'TELEXY', 0x001105: u'Sunplus Technology Co., Ltd.', 0x001106: u'Siemens NV (Belgium)', 0x001107: u'RGB Networks Inc.', 0x001108: u'Orbital Data Corporation', 0x001109: u'Micro-Star International', 0x00110A: u'Hewlett Packard', 0x00110B: u'Franklin Technology Systems', 0x00110C: u'Atmark Techno, Inc.', 0x00110D: u'SANBlaze Technology, Inc.', 0x00110E: u'Tsurusaki Sealand Transportation Co. Ltd.', 0x00110F: u'netplat,Inc.', 0x001110: u'Maxanna Technology Co., Ltd.', 0x001111: u'Intel Corporation', 0x001112: u'Honeywell CMSS', 0x001113: u'Fraunhofer FOKUS', 0x001114: u'EverFocus Electronics Corp.', 0x001115: u'EPIN Technologies, Inc.', 0x001116: u'COTEAU VERT CO., LTD.', 0x001117: u'CESNET', 0x001118: u'BLX IC Design Corp., Ltd.', 0x001119: u'Solteras, Inc.', 0x00111A: u'Motorola BCS', 0x00111B: u'Targa Systems Div L-3 Communications Canada', 0x00111C: u'Pleora Technologies Inc.', 0x00111D: u'Hectrix Limited', 0x00111E: u'EPSG (Ethernet Powerlink Standardization Group)', 0x00111F: u'Doremi Labs, Inc.', 0x001120: u'Cisco Systems', 0x001121: u'Cisco Systems', 0x001122: u'CIMSYS Inc', 0x001123: u'Appointech, Inc.', 0x001124: u'Apple Computer', 0x001125: u'IBM Corporation', 0x001126: u'Venstar Inc.', 0x001127: u'TASI, Inc', 0x001128: u'Streamit', 0x001129: u'Paradise Datacom Ltd.', 0x00112A: u'Niko NV', 0x00112B: u'NetModule', 0x00112C: u'IZT GmbH', 0x00112D: u'Guys Without Ties', 0x00112E: u'CEICOM', 0x00112F: u'ASUSTek Computer Inc.', 0x001130: u'Allied Telesis (Hong Kong) Ltd.', 0x001131: u'UNATECH. CO.,LTD', 0x001132: u'Synology Incorporated', 0x001133: u'Siemens Austria SIMEA', 0x001134: u'MediaCell, Inc.', 0x001135: u'Grandeye Ltd', 0x001136: u'Goodrich Sensor Systems', 0x001137: u'AICHI ELECTRIC CO., LTD.', 0x001138: u'TAISHIN CO., LTD.', 0x001139: u'STOEBER ANTRIEBSTECHNIK GmbH + Co. KG.', 0x00113A: u'SHINBORAM', 0x00113B: u'Micronet Communications Inc.', 0x00113C: u'Micronas GmbH', 0x00113D: u'KN SOLTEC CO.,LTD.', 0x00113E: u'JL Corporation', 0x00113F: u'Alcatel DI', 0x001140: u'Nanometrics Inc.', 0x001141: u'GoodMan Corporation', 0x001142: u'e-SMARTCOM INC.', 0x001143: u'DELL INC.', 0x001144: u'Assurance Technology Corp', 0x001145: u'ValuePoint Networks', 0x001146: u'Telecard-Pribor Ltd', 0x001147: u'Secom-Industry co.LTD.', 0x001148: u'Prolon Control Systems', 0x001149: u'Proliphix LLC', 0x00114A: u'KAYABA INDUSTRY Co,.Ltd.', 0x00114B: u'Francotyp-Postalia AG & Co. KG', 0x00114C: u'caffeina applied research ltd.', 0x00114D: u'Atsumi Electric Co.,LTD.', 0x00114E: u'690885 Ontario Inc.', 0x00114F: u'US Digital Television, Inc', 0x001150: u'Belkin Corporation', 0x001151: u'Mykotronx', 0x001152: u'Eidsvoll Electronics AS', 0x001153: u'Trident Tek, Inc.', 0x001154: u'Webpro Technologies Inc.', 0x001155: u'Sevis Systems', 0x001156: u'Pharos Systems NZ', 0x001157: u'OF Networks Co., Ltd.', 0x001158: u'Nortel Networks', 0x001159: u'MATISSE NETWORKS INC', 0x00115A: u'Ivoclar Vivadent AG', 0x00115B: u'Elitegroup Computer System Co. (ECS)', 0x00115C: u'Cisco', 0x00115D: u'Cisco', 0x00115E: u'ProMinent Dosiertechnik GmbH', 0x00115F: u'Intellix Co., Ltd.', 0x001160: u'ARTDIO Company Co., LTD', 0x001161: u'NetStreams, LLC', 0x001162: u'STAR MICRONICS CO.,LTD.', 0x001163: u'SYSTEM SPA DEPT. ELECTRONICS', 0x001164: u'ACARD Technology Corp.', 0x001165: u'Znyx Networks', 0x001166: u'Taelim Electronics Co., Ltd.', 0x001167: u'Integrated System Solution Corp.', 0x001168: u'HomeLogic LLC', 0x001169: u'EMS Satcom', 0x00116A: u'Domo Ltd', 0x00116B: u'Digital Data Communications Asia Co.,Ltd', 0x00116C: u'Nanwang Multimedia Inc.,Ltd', 0x00116D: u'American Time and Signal', 0x00116E: u'PePLink Ltd.', 0x00116F: u'Netforyou Co., LTD.', 0x001170: u'GSC SRL', 0x001171: u'DEXTER Communications, Inc.', 0x001172: u'COTRON CORPORATION', 0x001173: u'Adtron Corporation', 0x001174: u'Wibhu Technologies, Inc.', 0x001175: u'PathScale, Inc.', 0x001176: u'Intellambda Systems, Inc.', 0x001177: u'COAXIAL NETWORKS, INC.', 0x001178: u'Chiron Technology Ltd', 0x001179: u'Singular Technology Co. Ltd.', 0x00117A: u'Singim International Corp.', 0x00117B: u'Büchi Labortechnik AG', 0x00117C: u'e-zy.net', 0x00117D: u'ZMD America, Inc.', 0x00117E: u'Progeny Inc.', 0x00117F: u'Neotune Information Technology Corporation,.LTD', 0x001180: u'Motorola BCS', 0x001181: u'InterEnergy Co.Ltd,', 0x001182: u'IMI Norgren Ltd', 0x001183: u'PSC Scanning, Inc', 0x001184: u'Humo Laboratory,Ltd.', 0x001185: u'Hewlett Packard', 0x001186: u'Prime Systems, Inc.', 0x001187: u'Category Solutions, Inc', 0x001188: u'Enterasys', 0x001189: u'Aerotech Inc', 0x00118A: u'Viewtran Technology Limited', 0x00118B: u'NetDevices Inc.', 0x00118C: u'Missouri Department of Transportation', 0x00118D: u'Hanchang System Corp.', 0x00118E: u'Halytech Mace', 0x00118F: u'EUTECH INSTRUMENTS PTE. LTD.', 0x001190: u'Digital Design Corporation', 0x001191: u'CTS-Clima Temperatur Systeme GmbH', 0x001192: u'Cisco Systems', 0x001193: u'Cisco Systems', 0x001194: u'Chi Mei Communication Systems, Inc.', 0x001195: u'D-Link Corporation', 0x001196: u'Actuality Systems, Inc.', 0x001197: u'Monitoring Technologies Limited', 0x001198: u'Prism Media Products Limited', 0x001199: u'2wcom GmbH', 0x00119A: u'Alkeria srl', 0x00119B: u'Telesynergy Research Inc.', 0x00119C: u'EP&T Energy', 0x00119D: u'Diginfo Technology Corporation', 0x00119E: u'Solectron Brazil', 0x00119F: u'Nokia Danmark A/S', 0x0011A0: u'Vtech Engineering Canada Ltd', 0x0011A1: u'VISION NETWARE CO.,LTD', 0x0011A2: u'Manufacturing Technology Inc', 0x0011A3: u'LanReady Technologies Inc.', 0x0011A4: u'JStream Technologies Inc.', 0x0011A5: u'Fortuna Electronic Corp.', 0x0011A6: u'Sypixx Networks', 0x0011A7: u'Infilco Degremont Inc.', 0x0011A8: u'Quest Technologies', 0x0011A9: u'MOIMSTONE Co., LTD', 0x0011AA: u'Uniclass Technology, Co., LTD', 0x0011AB: u'TRUSTABLE TECHNOLOGY CO.,LTD.', 0x0011AC: u'Simtec Electronics', 0x0011AD: u'Shanghai Ruijie Technology', 0x0011AE: u'Motorola BCS', 0x0011AF: u'Medialink-i,Inc', 0x0011B0: u'Fortelink Inc.', 0x0011B1: u'BlueExpert Technology Corp.', 0x0011B2: u'2001 Technology Inc.', 0x0011B3: u'YOSHIMIYA CO.,LTD.', 0x0011B4: u'Westermo Teleindustri AB', 0x0011B5: u'Shenzhen Powercom Co.,Ltd', 0x0011B6: u'Open Systems International', 0x0011B7: u'Melexis Nederland B.V.', 0x0011B8: u'Liebherr - Elektronik GmbH', 0x0011B9: u'Inner Range Pty. Ltd.', 0x0011BA: u'Elexol Pty Ltd', 0x0011BB: u'Cisco Systems', 0x0011BC: u'Cisco Systems', 0x0011BD: u'Bombardier Transportation', 0x0011BE: u'AGP Telecom Co. Ltd', 0x0011BF: u'AESYS S.p.A.', 0x0011C0: u'Aday Technology Inc', 0x0011C1: u'4P MOBILE DATA PROCESSING', 0x0011C2: u'United Fiber Optic Communication', 0x0011C3: u'Transceiving System Technology Corporation', 0x0011C4: u'Terminales de Telecomunicacion Terrestre, S.L.', 0x0011C5: u'TEN Technology', 0x0011C6: u'Seagate Technology LLC', 0x0011C7: u'RAYMARINE Group Ltd.', 0x0011C8: u'Powercom Co., Ltd.', 0x0011C9: u'MTT Corporation', 0x0011CA: u'Long Range Systems, Inc.', 0x0011CB: u'Jacobsons RKH AB', 0x0011CC: u'Guangzhou Jinpeng Group Co.,Ltd.', 0x0011CD: u'Axsun Technologies', 0x0011CE: u'Ubisense Limited', 0x0011CF: u'Thrane & Thrane A/S', 0x0011D0: u'Tandberg Data ASA', 0x0011D1: u'Soft Imaging System GmbH', 0x0011D2: u'Perception Digital Ltd', 0x0011D3: u'NextGenTel Holding ASA', 0x0011D4: u'NetEnrich, Inc', 0x0011D5: u'Hangzhou Sunyard System Engineering Co.,Ltd.', 0x0011D6: u'HandEra, Inc.', 0x0011D7: u'eWerks Inc', 0x0011D8: u'ASUSTek Computer Inc.', 0x0011D9: u'TiVo', 0x0011DA: u'Vivaas Technology Inc.', 0x0011DB: u'Land-Cellular Corporation', 0x0011DC: u'Glunz & Jensen', 0x0011DD: u'FROMUS TEC. Co., Ltd.', 0x0011DE: u'EURILOGIC', 0x0011DF: u'Arecont Systems', 0x0011E0: u'U-MEDIA Communications, Inc.', 0x0011E1: u'BEKO Electronics Co.', 0x0011E2: u'Hua Jung Components Co., Ltd.', 0x0011E3: u'Thomson, Inc.', 0x0011E4: u'Danelec Electronics A/S', 0x0011E5: u'KCodes Corporation', 0x0011E6: u'Scientific Atlanta', 0x0011E7: u'WORLDSAT - Texas de France', 0x0011E8: u'Tixi.Com', 0x0011E9: u'STARNEX CO., LTD.', 0x0011EA: u'IWICS Inc.', 0x0011EB: u'Innovative Integration', 0x0011EC: u'AVIX INC.', 0x0011ED: u'802 Global', 0x0011EE: u'Estari, Inc.', 0x0011EF: u'Conitec Datensysteme GmbH', 0x0011F0: u'Wideful Limited', 0x0011F1: u'QinetiQ Ltd', 0x0011F2: u'Institute of Network Technologies', 0x0011F3: u'Gavitec AG- mobile digit', 0x0011F4: u'woori-net', 0x0011F5: u'ASKEY COMPUTER CORP.', 0x0011F6: u'Asia Pacific Microsystems , Inc.', 0x0011F7: u'Shenzhen Forward Industry Co., Ltd', 0x0011F8: u'AIRAYA Corp', 0x0011F9: u'Nortel Networks', 0x0011FA: u'Rane Corporation', 0x0011FB: u'Heidelberg Engineering GmbH', 0x0011FC: u'HARTING Electric Gmbh & Co.KG', 0x0011FD: u'KORG INC.', 0x0011FE: u'Keiyo System Research, Inc.', 0x0011FF: u'Digitro Tecnologia Ltda', 0x001200: u'Cisco', 0x001201: u'Cisco', 0x001202: u'Audio International Inc.', 0x001203: u'Activ Networks', 0x001204: u'u10 Networks, Inc.', 0x001205: u'Terrasat Communications, Inc.', 0x001206: u'iQuest (NZ) Ltd', 0x001207: u'Head Strong International Limited', 0x001208: u'Gantner Electronic GmbH', 0x001209: u'Fastrax Ltd', 0x00120A: u'Emerson Electric GmbH & Co. OHG', 0x00120B: u'Chinasys Technologies Limited', 0x00120C: u'CE-Infosys Pte Ltd', 0x00120D: u'Advanced Telecommunication Technologies, Inc.', 0x00120E: u'AboCom', 0x00120F: u'IEEE 802.3', 0x001210: u'WideRay Corp', 0x001211: u'Protechna Herbst GmbH & Co. KG', 0x001212: u'PLUS Vision Corporation', 0x001213: u'Metrohm AG', 0x001214: u'Koenig & Bauer AG', 0x001215: u'iStor Networks, Inc.', 0x001216: u'ICP Internet Communication Payment AG', 0x001217: u'Cisco-Linksys, LLC', 0x001218: u'ARUZE Corporation', 0x001219: u'Ahead Communication Systems Inc', 0x00121A: u'Techno Soft Systemnics Inc.', 0x00121B: u'Sound Devices, LLC', 0x00121C: u'PARROT S.A.', 0x00121D: u'Netfabric Corporation', 0x00121E: u'Juniper Networks, Inc.', 0x00121F: u'Harding Intruments', 0x001220: u'Cadco Systems', 0x001221: u'B.Braun Melsungen AG', 0x001222: u'Skardin (UK) Ltd', 0x001223: u'Pixim', 0x001224: u'NexQL Corporation', 0x001225: u'Motorola BCS', 0x001226: u'Japan Direx Corporation', 0x001227: u'Franklin Electric Co., Inc.', 0x001228: u'Data Ltd.', 0x001229: u'BroadEasy Technologies Co.,Ltd', 0x00122A: u'VTech Telecommunications Ltd.', 0x00122B: u'Virbiage Pty Ltd', 0x00122C: u'Soenen Controls N.V.', 0x00122D: u'SiNett Corporation', 0x00122E: u'Signal Technology - AISD', 0x00122F: u'Sanei Electric Inc.', 0x001230: u'Picaso Infocommunication CO., LTD.', 0x001231: u'Motion Control Systems, Inc.', 0x001232: u'LeWiz Communications Inc.', 0x001233: u'JRC TOKKI Co.,Ltd.', 0x001234: u'Camille Bauer', 0x001235: u'Andrew Corporation', 0x001236: u'ConSentry Networks', 0x001237: u'Texas Instruments', 0x001238: u'SetaBox Technology Co., Ltd.', 0x001239: u'S Net Systems Inc.', 0x00123A: u'Posystech Inc., Co.', 0x00123B: u'KeRo Systems ApS', 0x00123C: u'IP3 Networks, Inc.', 0x00123D: u'GES', 0x00123E: u'ERUNE technology Co., Ltd.', 0x00123F: u'Dell Inc', 0x001240: u'AMOI ELECTRONICS CO.,LTD', 0x001241: u'a2i marketing center', 0x001242: u'Millennial Net', 0x001243: u'Cisco', 0x001244: u'Cisco', 0x001245: u'Zellweger Analytics, Inc.', 0x001246: u'T.O.M TECHNOLOGY INC..', 0x001247: u'Samsung Electronics Co., Ltd.', 0x001248: u'Kashya Inc.', 0x001249: u'Delta Elettronica S.p.A.', 0x00124A: u'Dedicated Devices, Inc.', 0x00124B: u'Chipcon AS', 0x00124C: u'BBWM Corporation', 0x00124D: u'Inducon BV', 0x00124E: u'XAC AUTOMATION CORP.', 0x00124F: u'Tyco Thermal Controls LLC.', 0x001250: u'Tokyo Aircaft Instrument Co., Ltd.', 0x001251: u'SILINK', 0x001252: u'Citronix, LLC', 0x001253: u'AudioDev AB', 0x001254: u'Spectra Technologies Holdings Company Ltd', 0x001255: u'NetEffect Incorporated', 0x001256: u'LG INFORMATION & COMM.', 0x001257: u'LeapComm Communication Technologies Inc.', 0x001258: u'Activis Polska', 0x001259: u'THERMO ELECTRON KARLSRUHE', 0x00125A: u'Microsoft Corporation', 0x00125B: u'KAIMEI ELECTRONI', 0x00125C: u'Green Hills Software, Inc.', 0x00125D: u'CyberNet Inc.', 0x00125E: u'CAEN', 0x00125F: u'AWIND Inc.', 0x001260: u'Stanton Magnetics,inc.', 0x001261: u'Adaptix, Inc', 0x001262: u'Nokia Danmark A/S', 0x001263: u'Data Voice Technologies GmbH', 0x001264: u'daum electronic gmbh', 0x001265: u'Enerdyne Technologies, Inc.', 0x001266: u'PRIVATE', 0x001267: u'Matsushita Electronic Components Co., Ltd.', 0x001268: u'IPS d.o.o.', 0x001269: u'Value Electronics', 0x00126A: u'OPTOELECTRONICS Co., Ltd.', 0x00126B: u'Ascalade Communications Limited', 0x00126C: u'Visonic Ltd.', 0x00126D: u'University of California, Berkeley', 0x00126E: u'Seidel Elektronik GmbH Nfg.KG', 0x00126F: u'Rayson Technology Co., Ltd.', 0x001270: u'NGES Denro Systems', 0x001271: u'Measurement Computing Corp', 0x001272: u'Redux Communications Ltd.', 0x001273: u'Stoke Inc', 0x001274: u'NIT lab', 0x001275: u'Moteiv Corporation', 0x001276: u'Microsol Holdings Ltd.', 0x001277: u'Korenix Technologies Co., Ltd.', 0x001278: u'International Bar Code', 0x001279: u'Hewlett Packard', 0x00127A: u'Sanyu Industry Co.,Ltd.', 0x00127B: u'VIA Networking Technologies, Inc.', 0x00127C: u'SWEGON AB', 0x00127D: u'MobileAria', 0x00127E: u'Digital Lifestyles Group, Inc.', 0x00127F: u'Cisco', 0x001280: u'Cisco', 0x001281: u'CIEFFE srl', 0x001282: u'Qovia', 0x001283: u'Nortel Networks', 0x001284: u'Lab33 Srl', 0x001285: u'Gizmondo Europe Ltd', 0x001286: u'ENDEVCO CORP', 0x001287: u'Digital Everywhere Unterhaltungselektronik GmbH', 0x001288: u'2Wire, Inc', 0x001289: u'Advance Sterilization Products', 0x00128A: u'Motorola PCS', 0x00128B: u'Sensory Networks Inc', 0x00128C: u'Woodward Governor', 0x00128D: u'STB Datenservice GmbH', 0x00128E: u'Q-Free ASA', 0x00128F: u'Montilio', 0x001290: u'KYOWA Electric & Machinery Corp.', 0x001291: u'KWS Computersysteme GmbH', 0x001292: u'Griffin Technology', 0x001293: u'GE Energy', 0x001294: u'Eudyna Devices Inc.', 0x001295: u'Aiware Inc.', 0x001296: u'Addlogix', 0x001297: u'O2Micro, Inc.', 0x001298: u'MICO ELECTRIC(SHENZHEN) LIMITED', 0x001299: u'Ktech Telecommunications Inc', 0x00129A: u'IRT Electronics Pty Ltd', 0x00129B: u'E2S Electronic Engineering Solutions, S.L.', 0x00129C: u'Yulinet', 0x00129D: u'FIRST INTERNATIONAL COMPUTER DO BRASIL LTDA', 0x00129E: u'Surf Communications Inc.', 0x00129F: u'RAE Systems, Inc.', 0x0012A0: u'NeoMeridian Sdn Bhd', 0x0012A1: u'BluePacket Communications Co., Ltd.', 0x0012A2: u'VITA', 0x0012A3: u'Trust International B.V.', 0x0012A4: u'ThingMagic, LLC', 0x0012A5: u'Stargen, Inc.', 0x0012A6: u'Lake Technology Ltd', 0x0012A7: u'ISR TECHNOLOGIES Inc', 0x0012A8: u'intec GmbH', 0x0012A9: u'3COM EUROPE LTD', 0x0012AA: u'IEE, Inc.', 0x0012AB: u'WiLife, Inc.', 0x0012AC: u'ONTIMETEK INC.', 0x0012AD: u'IDS GmbH', 0x0012AE: u'HLS HARD-LINE Solutions Inc.', 0x0012AF: u'ELPRO Technologies', 0x0012B0: u'Efore Oyj (Plc)', 0x0012B1: u'Dai Nippon Printing Co., Ltd', 0x0012B2: u'AVOLITES LTD.', 0x0012B3: u'Advance Wireless Technology Corp.', 0x0012B4: u'Work GmbH', 0x0012B5: u'Vialta, Inc.', 0x0012B6: u'Santa Barbara Infrared, Inc.', 0x0012B7: u'PTW Freiburg', 0x0012B8: u'G2 Microsystems', 0x0012B9: u'Fusion Digital Technology', 0x0012BA: u'FSI Systems, Inc.', 0x0012BB: u'Telecommunications Industry Association TR-41 Committee', 0x0012BC: u'Echolab LLC', 0x0012BD: u'Avantec Manufacturing Limited', 0x0012BE: u'Astek Corporation', 0x0012BF: u'Arcadyan Technology Corporation', 0x0012C0: u'HotLava Systems, Inc.', 0x0012C1: u'Check Point Software Technologies', 0x0012C2: u'Apex Electronics Factory', 0x0012C3: u'WIT S.A.', 0x0012C4: u'Viseon, Inc.', 0x0012C5: u'V-Show Technology Co.Ltd', 0x0012C6: u'TGC America, Inc', 0x0012C7: u'SECURAY Technologies Ltd.Co.', 0x0012C8: u'Perfect tech', 0x0012C9: u'Motorola BCS', 0x0012CA: u'Hansen Telecom', 0x0012CB: u'CSS Inc.', 0x0012CC: u'Bitatek CO., LTD', 0x0012CD: u'ASEM SpA', 0x0012CE: u'Advanced Cybernetics Group', 0x0012CF: u'Accton Technology Corporation', 0x0012D0: u'Gossen-Metrawatt-GmbH', 0x0012D1: u'Texas Instruments Inc', 0x0012D2: u'Texas Instruments', 0x0012D3: u'Zetta Systems, Inc.', 0x0012D4: u'Princeton Technology, Ltd', 0x0012D5: u'Motion Reality Inc.', 0x0012D6: u'Jiangsu Yitong High-Tech Co.,Ltd', 0x0012D7: u'Invento Networks, Inc.', 0x0012D8: u'International Games System Co., Ltd.', 0x0012D9: u'Cisco Systems', 0x0012DA: u'Cisco Systems', 0x0012DB: u'ZIEHL industrie-elektronik GmbH + Co KG', 0x0012DC: u'SunCorp Industrial Limited', 0x0012DD: u'Shengqu Information Technology (Shanghai) Co., Ltd.', 0x0012DE: u'Radio Components Sweden AB', 0x0012DF: u'Novomatic AG', 0x0012E0: u'Codan Limited', 0x0012E1: u'Alliant Networks, Inc', 0x0012E2: u'ALAXALA Networks Corporation', 0x0012E3: u'Agat-RT, Ltd.', 0x0012E4: u'ZIEHL industrie-electronik GmbH + Co KG', 0x0012E5: u'Time America, Inc.', 0x0012E6: u'SPECTEC COMPUTER CO., LTD.', 0x0012E7: u'Projectek Networking Electronics Corp.', 0x0012E8: u'Fraunhofer IMS', 0x0012E9: u'Abbey Systems Ltd', 0x0012EA: u'Trane', 0x0012EB: u'R2DI, LLC', 0x0012EC: u'Movacolor b.v.', 0x0012ED: u'AVG Advanced Technologies', 0x0012EE: u'Sony Ericsson Mobile Communications AB', 0x0012EF: u'OneAccess SA', 0x0012F0: u'Intel Corporate', 0x0012F1: u'IFOTEC', 0x0012F2: u'Foundry Networks', 0x0012F3: u'connectBlue AB', 0x0012F4: u'Belco International Co.,Ltd.', 0x0012F5: u'Prolificx Ltd', 0x0012F6: u'MDK CO.,LTD.', 0x0012F7: u'Xiamen Xinglian Electronics Co., Ltd.', 0x0012F8: u'WNI Resources, LLC', 0x0012F9: u'URYU SEISAKU, LTD.', 0x0012FA: u'THX LTD', 0x0012FB: u'Samsung Electronics', 0x0012FC: u'PLANET System Co.,LTD', 0x0012FD: u'OPTIMUS IC S.A.', 0x0012FE: u'Lenovo Mobile Communication Technology Ltd.', 0x0012FF: u'Lely Industries N.V.', 0x001300: u'IT-FACTORY, INC.', 0x001301: u'IronGate S.L.', 0x001302: u'Intel Corporate', 0x001303: u'GateConnect Technologies GmbH', 0x001304: u'Flaircomm Technologies Co. LTD', 0x001305: u'Epicom, Inc.', 0x001306: u'Always On Wireless', 0x001307: u'Paravirtual Corporation', 0x001308: u'Nuvera Fuel Cells', 0x001309: u'Ocean Broadband Networks', 0x00130A: u'Nortel', 0x00130B: u'Mextal B.V.', 0x00130C: u'HF System Corporation', 0x00130D: u'GALILEO AVIONICA', 0x00130E: u'Focusrite Audio Engineering Limited', 0x00130F: u'EGEMEN Bilgisayar Muh San ve Tic LTD STI', 0x001310: u'Cisco-Linksys, LLC', 0x001311: u'ARRIS International', 0x001312: u'Amedia Networks Inc.', 0x001313: u'GuangZhou Post & Telecom Equipment ltd', 0x001314: u'Asiamajor Inc.', 0x001315: u'SONY Computer Entertainment inc,', 0x001316: u'L-S-B GmbH', 0x001317: u'GN Netcom as', 0x001318: u'DGSTATION Co., Ltd.', 0x001319: u'Cisco Systems', 0x00131A: u'Cisco Systems', 0x00131B: u'BeCell Innovations Corp.', 0x00131C: u'LiteTouch, Inc.', 0x00131D: u'Scanvaegt International A/S', 0x00131E: u'Peiker acustic GmbH & Co. KG', 0x00131F: u'NxtPhase T&D, Corp.', 0x001320: u'Intel Corporate', 0x001321: u'Hewlett Packard', 0x001322: u'DAQ Electronics, Inc.', 0x001323: u'Cap Co., Ltd.', 0x001324: u'Schneider Electric Ultra Terminal', 0x001325: u'ImmenStar Inc.', 0x001326: u'ECM Systems Ltd', 0x001327: u'Data Acquisitions limited', 0x001328: u'Westech Korea Inc.,', 0x001329: u'VSST Co., LTD', 0x00132A: u'STROM telecom, s. r. o.', 0x00132B: u'Phoenix Digital', 0x00132C: u'MAZ Brandenburg GmbH', 0x00132D: u'iWise Communications Pty Ltd', 0x00132E: u'ITian Coporation', 0x00132F: u'Interactek', 0x001330: u'EURO PROTECTION SURVEILLANCE', 0x001331: u'CellPoint Connect', 0x001332: u'Beijing Topsec Network Security Technology Co., Ltd.', 0x001333: u'Baud Technology Inc.', 0x001334: u'Arkados, Inc.', 0x001335: u'VS Industry Berhad', 0x001336: u'Tianjin 712 Communication Broadcasting co., ltd.', 0x001337: u'Orient Power Home Network Ltd.', 0x001338: u'FRESENIUS-VIAL', 0x001339: u'EL-ME AG', 0x00133A: u'VadaTech Inc.', 0x00133B: u'Speed Dragon Multimedia Limited', 0x00133C: u'QUINTRON SYSTEMS INC.', 0x00133D: u'Micro Memory LLC', 0x00133E: u'MetaSwitch', 0x00133F: u'Eppendorf Instrumente GmbH', 0x001340: u'AD.EL s.r.l.', 0x001341: u'Shandong New Beiyang Information Technology Co.,Ltd', 0x001342: u'Vision Research, Inc.', 0x001343: u'Matsushita Electronic Components (Europe) GmbH', 0x001344: u'Fargo Electronics Inc.', 0x001345: u'Eaton Corporation', 0x001346: u'D-Link Corporation', 0x001347: u'BlueTree Wireless Data Inc.', 0x001348: u'Artila Electronics Co., Ltd.', 0x001349: u'ZyXEL Communications Corporation', 0x00134A: u'Engim, Inc.', 0x00134B: u'ToGoldenNet Technology Inc.', 0x00134C: u'YDT Technology International', 0x00134D: u'IPC systems', 0x00134E: u'Valox Systems, Inc.', 0x00134F: u'Tranzeo Wireless Technologies Inc.', 0x001350: u'Silver Spring Networks, Inc', 0x001351: u'Niles Audio Corporation', 0x001352: u'Naztec, Inc.', 0x001353: u'HYDAC Filtertechnik GMBH', 0x001354: u'Zcomax Technologies, Inc.', 0x001355: u'TOMEN Cyber-business Solutions, Inc.', 0x001356: u'target systemelectronic gmbh', 0x001357: u'Soyal Technology Co., Ltd.', 0x001358: u'Realm Systems, Inc.', 0x001359: u'ProTelevision Technologies A/S', 0x00135A: u'Project T&E Limited', 0x00135B: u'PanelLink Cinema, LLC', 0x00135C: u'OnSite Systems, Inc.', 0x00135D: u'NTTPC Communications, Inc.', 0x00135E: u'EAB/RWI/K', 0x00135F: u'Cisco Systems', 0x001360: u'Cisco Systems', 0x001361: u'Biospace Co., Ltd.', 0x001362: u'ShinHeung Precision Co., Ltd.', 0x001363: u'Verascape, Inc.', 0x001364: u'Paradigm Technology Inc..', 0x001365: u'Nortel', 0x001366: u'Neturity Technologies Inc.', 0x001367: u'Narayon. Co., Ltd.', 0x001368: u'Maersk Data Defence', 0x001369: u'Honda Electron Co., LED.', 0x00136A: u'Hach Ultra Analytics', 0x00136B: u'E-TEC', 0x00136C: u'PRIVATE', 0x00136D: u'Tentaculus AB', 0x00136E: u'Techmetro Corp.', 0x00136F: u'PacketMotion, Inc.', 0x001370: u'Nokia Danmark A/S', 0x001371: u'Motorola CHS', 0x001372: u'Dell Inc.', 0x001373: u'BLwave Electronics Co., Ltd', 0x001374: u'Attansic Technology Corp.', 0x001375: u'American Security Products Co.', 0x001376: u'Tabor Electronics Ltd.', 0x001377: u'Samsung Electronics CO., LTD', 0x001378: u'QSAN Technology, Inc.', 0x001379: u'PONDER INFORMATION INDUSTRIES LTD.', 0x00137A: u'Netvox Technology Co., Ltd.', 0x00137B: u'Movon Corporation', 0x00137C: u'Kaicom co., Ltd.', 0x00137D: u'Dynalab, Inc.', 0x00137E: u'CorEdge Networks, Inc.', 0x00137F: u'Cisco Systems', 0x001380: u'Cisco Systems', 0x001381: u'CHIPS & Systems, Inc.', 0x001382: u'Cetacea Networks Corporation', 0x001383: u'Application Technologies and Engineering Research Laboratory', 0x001384: u'Advanced Motion Controls', 0x001385: u'Add-On Technology Co., LTD.', 0x001386: u'ABB Inc./Totalflow', 0x001387: u'27M Technologies AB', 0x001388: u'WiMedia Alliance', 0x001389: u'Redes de Telefonía Móvil S.A.', 0x00138A: u'QINGDAO GOERTEK ELECTRONICS CO.,LTD.', 0x00138B: u'Phantom Technologies LLC', 0x00138C: u'Kumyoung.Co.Ltd', 0x00138D: u'Kinghold', 0x00138E: u'FOAB Elektronik AB', 0x00138F: u'Asiarock Incorporation', 0x001390: u'Termtek Computer Co., Ltd', 0x001391: u'OUEN CO.,LTD.', 0x001392: u'Ruckus Wireless', 0x001393: u'Panta Systems, Inc.', 0x001394: u'Infohand Co.,Ltd', 0x001395: u'congatec AG', 0x001396: u'Acbel Polytech Inc.', 0x001397: u'Xsigo Systems, Inc.', 0x001398: u'TrafficSim Co.,Ltd', 0x001399: u'STAC Corporation.', 0x00139A: u'K-ubique ID Corp.', 0x00139B: u'ioIMAGE Ltd.', 0x00139C: u'Exavera Technologies, Inc.', 0x00139D: u'Design of Systems on Silicon S.A.', 0x00139E: u'Ciara Technologies Inc.', 0x00139F: u'Electronics Design Services, Co., Ltd.', 0x0013A0: u'ALGOSYSTEM Co., Ltd.', 0x0013A1: u'Crow Electronic Engeneering', 0x0013A2: u'MaxStream, Inc', 0x0013A3: u'Siemens Com CPE Devices', 0x0013A4: u'KeyEye Communications', 0x0013A5: u'General Solutions, LTD.', 0x0013A6: u'Extricom Ltd', 0x0013A7: u'BATTELLE MEMORIAL INSTITUTE', 0x0013A8: u'Tanisys Technology', 0x0013A9: u'Sony Corporation', 0x0013AA: u'ALS & TEC Ltd.', 0x0013AB: u'Telemotive AG', 0x0013AC: u'Sunmyung Electronics Co., LTD', 0x0013AD: u'Sendo Ltd', 0x0013AE: u'Radiance Technologies', 0x0013AF: u'NUMA Technology,Inc.', 0x0013B0: u'Jablotron', 0x0013B1: u'Intelligent Control Systems (Asia) Pte Ltd', 0x0013B2: u'Carallon Limited', 0x0013B3: u'Beijing Ecom Communications Technology Co., Ltd.', 0x0013B4: u'Appear TV', 0x0013B5: u'Wavesat', 0x0013B6: u'Sling Media, Inc.', 0x0013B7: u'Scantech ID', 0x0013B8: u'RyCo Electronic Systems Limited', 0x0013B9: u'BM SPA', 0x0013BA: u'ReadyLinks Inc', 0x0013BB: u'PRIVATE', 0x0013BC: u'Artimi Ltd', 0x0013BD: u'HYMATOM SA', 0x0013BE: u'Virtual Conexions', 0x0013BF: u'Media System Planning Corp.', 0x0013C0: u'Trix Tecnologia Ltda.', 0x0013C1: u'Asoka USA Corporation', 0x0013C2: u'WACOM Co.,Ltd', 0x0013C3: u'Cisco Systems', 0x0013C4: u'Cisco Systems', 0x0013C5: u'LIGHTRON FIBER-OPTIC DEVICES INC.', 0x0013C6: u'OpenGear, Inc', 0x0013C7: u'IONOS Co.,Ltd.', 0x0013C8: u'PIRELLI BROADBAND SOLUTIONS S.P.A.', 0x0013C9: u'Beyond Achieve Enterprises Ltd.', 0x0013CA: u'X-Digital Systems, Inc.', 0x0013CB: u'Zenitel Norway AS', 0x0013CC: u'Tall Maple Systems', 0x0013CD: u'MTI co. LTD', 0x0013CE: u'Intel Corporate', 0x0013CF: u'4Access Communications', 0x0013D0: u'e-San Limited', 0x0013D1: u'KIRK telecom A/S', 0x0013D2: u'PAGE IBERICA, S.A.', 0x0013D3: u'MICRO-STAR INTERNATIONAL CO., LTD.', 0x0013D4: u'ASUSTek COMPUTER INC.', 0x0013D5: u'WiNetworks LTD', 0x0013D6: u'TII NETWORK TECHNOLOGIES, INC.', 0x0013D7: u'SPIDCOM Technologies SA', 0x0013D8: u'Princeton Instruments', 0x0013D9: u'Matrix Product Development, Inc.', 0x0013DA: u'Diskware Co., Ltd', 0x0013DB: u'SHOEI Electric Co.,Ltd', 0x0013DC: u'IBTEK INC.', 0x0013DD: u'Abbott Diagnostics', 0x0013DE: u'Adapt4', 0x0013DF: u'Ryvor Corp.', 0x0013E0: u'Murata Manufacturing Co., Ltd.', 0x0013E1: u'Iprobe', 0x0013E2: u'GeoVision Inc.', 0x0013E3: u'CoVi Technologies, Inc.', 0x0013E4: u'YANGJAE SYSTEMS CORP.', 0x0013E5: u'TENOSYS, INC.', 0x0013E6: u'Technolution', 0x0013E7: u'Minelab Electronics Pty Limited', 0x0013E8: u'Intel Corporate', 0x0013E9: u'VeriWave, Inc.', 0x0013EA: u'Kamstrup A/S', 0x0013EB: u'Sysmaster Corporation', 0x0013EC: u'Sunbay Software AG', 0x0013ED: u'PSIA', 0x0013EE: u'JBX Designs Inc.', 0x0013EF: u'Kingjon Digital Technology Co.,Ltd', 0x0013F0: u'Wavefront Semiconductor', 0x0013F1: u'AMOD Technology Co., Ltd.', 0x0013F2: u'Klas Ltd', 0x0013F3: u'Giga-byte Communications Inc.', 0x0013F4: u'Psitek (Pty) Ltd', 0x0013F5: u'Akimbi Systems', 0x0013F6: u'Cintech', 0x0013F7: u'SMC Networks, Inc.', 0x0013F8: u'Dex Security Solutions', 0x0013F9: u'Cavera Systems', 0x0013FA: u'LifeSize Communications, Inc', 0x0013FB: u'RKC INSTRUMENT INC.', 0x0013FC: u'SiCortex, Inc', 0x0013FD: u'Nokia Danmark A/S', 0x0013FE: u'GRANDTEC ELECTRONIC CORP.', 0x0013FF: u'Dage-MTI of MC, Inc.', 0x001400: u'MINERVA KOREA CO., LTD', 0x001401: u'Rivertree Networks Corp.', 0x001402: u'kk-electronic a/s', 0x001403: u'Renasis, LLC', 0x001404: u'Motorola CHS', 0x001405: u'OpenIB, Inc.', 0x001406: u'Go Networks', 0x001407: u'Biosystems', 0x001408: u'Eka Systems Inc.', 0x001409: u'MAGNETI MARELLI S.E. S.p.A.', 0x00140A: u'WEPIO Co., Ltd.', 0x00140B: u'FIRST INTERNATIONAL COMPUTER, INC.', 0x00140C: u'GKB CCTV CO., LTD.', 0x00140D: u'Nortel', 0x00140E: u'Nortel', 0x00140F: u'Federal State Unitary Enterprise Leningrad R&D Institute of', 0x001410: u'Suzhou Keda Technology CO.,Ltd', 0x001411: u'Deutschmann Automation GmbH & Co. KG', 0x001412: u'S-TEC electronics AG', 0x001413: u'Trebing & Himstedt Prozessautomation GmbH & Co. KG', 0x001414: u'Jumpnode Systems LLC.', 0x001415: u'Intec Automation Inc.', 0x001416: u'Scosche Industries, Inc.', 0x001417: u'RSE Informations Technologie GmbH', 0x001418: u'C4Line', 0x001419: u'SIDSA', 0x00141A: u'DEICY CORPORATION', 0x00141B: u'Cisco Systems', 0x00141C: u'Cisco Systems', 0x00141D: u'Lust Antriebstechnik GmbH', 0x00141E: u'P.A. Semi, Inc.', 0x00141F: u'SunKwang Electronics Co., Ltd', 0x001420: u'G-Links networking company', 0x001421: u'Total Wireless Technologies Pte. Ltd.', 0x001422: u'Dell Inc.', 0x001423: u'J-S Co. NEUROCOM', 0x001424: u'Merry Electrics CO., LTD.', 0x001425: u'Galactic Computing Corp.', 0x001426: u'NL Technology', 0x001427: u'JazzMutant', 0x001428: u'Vocollect, Inc', 0x001429: u'V Center Technologies Co., Ltd.', 0x00142A: u'Elitegroup Computer System Co., Ltd', 0x00142B: u'Edata Technologies Inc.', 0x00142C: u'Koncept International, Inc.', 0x00142D: u'Toradex AG', 0x00142E: u'77 Elektronika Kft.', 0x00142F: u'WildPackets', 0x001430: u'ViPowER, Inc', 0x001431: u'PDL Electronics Ltd', 0x001432: u'Tarallax Wireless, Inc.', 0x001433: u'Empower Technologies(Canada) Inc.', 0x001434: u'Keri Systems, Inc', 0x001435: u'CityCom Corp.', 0x001436: u'Qwerty Elektronik AB', 0x001437: u'GSTeletech Co.,Ltd.', 0x001438: u'Hewlett Packard', 0x001439: u'Blonder Tongue Laboratories, Inc.', 0x00143A: u'RAYTALK INTERNATIONAL SRL', 0x00143B: u'Sensovation AG', 0x00143C: u'Oerlikon Contraves Inc.', 0x00143D: u'Aevoe Inc.', 0x00143E: u'AirLink Communications, Inc.', 0x00143F: u'Hotway Technology Corporation', 0x001440: u'ATOMIC Corporation', 0x001441: u'Innovation Sound Technology Co., LTD.', 0x001442: u'ATTO CORPORATION', 0x001443: u'Consultronics Europe Ltd', 0x001444: u'Grundfos Electronics', 0x001445: u'Telefon-Gradnja d.o.o.', 0x001446: u'KidMapper, Inc.', 0x001447: u'BOAZ Inc.', 0x001448: u'Inventec Multimedia & Telecom Corporation', 0x001449: u'Sichuan Changhong Electric Ltd.', 0x00144A: u'Taiwan Thick-Film Ind. Corp.', 0x00144B: u'Hifn, Inc.', 0x00144C: u'General Meters Corp.', 0x00144D: u'Intelligent Systems', 0x00144E: u'SRISA', 0x00144F: u'Sun Microsystems, Inc.', 0x001450: u'Heim Systems GmbH', 0x001451: u'Apple Computer Inc.', 0x001452: u'CALCULEX,INC.', 0x001453: u'ADVANTECH TECHNOLOGIES CO.,LTD', 0x001454: u'Symwave', 0x001455: u'Coder Electronics Corporation', 0x001456: u'Edge Products', 0x001457: u'T-VIPS AS', 0x001458: u'HS Automatic ApS', 0x001459: u'Moram Co., Ltd.', 0x00145A: u'Elektrobit AG', 0x00145B: u'SeekerNet Inc.', 0x00145C: u'Intronics B.V.', 0x00145D: u'WJ Communications, Inc.', 0x00145E: u'IBM', 0x00145F: u'ADITEC CO. LTD', 0x001460: u'Kyocera Wireless Corp.', 0x001461: u'CORONA CORPORATION', 0x001462: u'Digiwell Technology, inc', 0x001463: u'IDCS N.V.', 0x001464: u'Cryptosoft', 0x001465: u'Novo Nordisk A/S', 0x001466: u'Kleinhenz Elektronik GmbH', 0x001467: u'ArrowSpan Inc.', 0x001468: u'CelPlan International, Inc.', 0x001469: u'Cisco Systems', 0x00146A: u'Cisco Systems', 0x00146B: u'Anagran, Inc.', 0x00146C: u'Netgear Inc.', 0x00146D: u'RF Technologies', 0x00146E: u'H. Stoll GmbH & Co. KG', 0x00146F: u'Kohler Co', 0x001470: u'Prokom Software SA', 0x001471: u'Eastern Asia Technology Limited', 0x001472: u'China Broadband Wireless IP Standard Group', 0x001473: u'Bookham Inc', 0x001474: u'K40 Electronics', 0x001475: u'Wiline Networks, Inc.', 0x001476: u'MultiCom Industries Limited', 0x001477: u'Nertec Inc.', 0x001478: u'ShenZhen TP-LINK Technologies Co., Ltd.', 0x001479: u'NEC Magnus Communications,Ltd.', 0x00147A: u'Eubus GmbH', 0x00147B: u'Iteris, Inc.', 0x00147C: u'3Com Europe Ltd', 0x00147D: u'Aeon Digital International', 0x00147E: u'PanGo Networks, Inc.', 0x00147F: u'Thomson Telecom Belgium', 0x001480: u'Hitachi-LG Data Storage Korea, Inc', 0x001481: u'Multilink Inc', 0x001482: u'GoBackTV, Inc', 0x001483: u'eXS Inc.', 0x001484: u'CERMATE TECHNOLOGIES INC', 0x001485: u'Giga-Byte', 0x001486: u'Echo Digital Audio Corporation', 0x001487: u'American Technology Integrators', 0x001488: u'Akorri Networks', 0x001489: u'B15402100 - JANDEI, S.L.', 0x00148A: u'Elin Ebg Traction Gmbh', 0x00148B: u'Globo Electronic GmbH & Co. KG', 0x00148C: u'Fortress Technologies', 0x00148D: u'Cubic Defense Simulation Systems', 0x00148E: u'Tele Power Inc.', 0x00148F: u'Protronic (Far East) Ltd.', 0x001490: u'ASP Corporation', 0x001491: u'Daniels Electronics Ltd.', 0x001492: u'Liteon, Mobile Media Solution SBU', 0x001493: u'Systimax Solutions', 0x001494: u'ESU AG', 0x001495: u'2Wire, Inc.', 0x001496: u'Phonic Corp.', 0x001497: u'ZHIYUAN Eletronics co.,ltd.', 0x001498: u'Viking Design Technology', 0x001499: u'Helicomm Inc', 0x00149A: u'Motorola Mobile Devices Business', 0x00149B: u'Nokota Communications, LLC', 0x00149C: u'HF Company', 0x00149D: u'Sound ID Inc.', 0x00149E: u'UbONE Co., Ltd', 0x00149F: u'System and Chips, Inc.', 0x0014A0: u'RFID Asset Track, Inc.', 0x0014A1: u'Synchronous Communication Corp', 0x0014A2: u'Core Micro Systems Inc.', 0x0014A3: u'Vitelec BV', 0x0014A4: u'Hon Hai Precision Ind. Co., Ltd.', 0x0014A5: u'Gemtek Technology Co., Ltd.', 0x0014A6: u'Teranetics, Inc.', 0x0014A7: u'Nokia Danmark A/S', 0x0014A8: u'Cisco Systems', 0x0014A9: u'Cisco Systems', 0x0014AA: u'Ashly Audio, Inc.', 0x0014AB: u'Senhai Electronic Technology Co., Ltd.', 0x0014AC: u'Bountiful WiFi', 0x0014AD: u'Gassner Wiege- u. Meßtechnik GmbH', 0x0014AE: u'Wizlogics Co., Ltd.', 0x0014AF: u'Datasym Inc.', 0x0014B0: u'Naeil Community', 0x0014B1: u'Avitec AB', 0x0014B2: u'mCubelogics Corporation', 0x0014B3: u'CoreStar International Corp', 0x0014B4: u'General Dynamics United Kingdom Ltd', 0x0014B5: u'PRIVATE', 0x0014B6: u'Enswer Technology Inc.', 0x0014B7: u'AR Infotek Inc.', 0x0014B8: u'Hill-Rom', 0x0014B9: u'STEPMIND', 0x0014BA: u'Carvers SA de CV', 0x0014BB: u'Open Interface North America', 0x0014BC: u'SYNECTIC TELECOM EXPORTS PVT. LTD.', 0x0014BD: u'incNETWORKS, Inc', 0x0014BE: u'Wink communication technology CO.LTD', 0x0014BF: u'Cisco-Linksys LLC', 0x0014C0: u'Symstream Technology Group Ltd', 0x0014C1: u'U.S. Robotics Corporation', 0x0014C2: u'Hewlett Packard', 0x0014C3: u'Seagate Technology LLC', 0x0014C4: u'Vitelcom Mobile Technology', 0x0014C5: u'Alive Technologies Pty Ltd', 0x0014C6: u'Quixant Ltd', 0x0014C7: u'Nortel', 0x0014C8: u'Contemporary Research Corp', 0x0014C9: u'Silverback Systems, Inc.', 0x0014CA: u'Key Radio Systems Limited', 0x0014CB: u'LifeSync Corporation', 0x0014CC: u'Zetec, Inc.', 0x0014CD: u'DigitalZone Co., Ltd.', 0x0014CE: u'NF CORPORATION', 0x0014CF: u'Nextlink.to A/S', 0x0014D0: u'BTI Photonics', 0x0014D1: u'TRENDware International, Inc.', 0x0014D2: u'KYUKI CORPORATION', 0x0014D3: u'SEPSA', 0x0014D4: u'K Technology Corporation', 0x0014D5: u'Datang Telecom Technology CO. , LCD,Optical Communication Br', 0x0014D6: u'Jeongmin Electronics Co.,Ltd.', 0x0014D7: u'DataStor Technology Inc.', 0x0014D8: u'bio-logic SA', 0x0014D9: u'IP Fabrics, Inc.', 0x0014DA: u'Huntleigh Healthcare', 0x0014DB: u'Elma Trenew Electronic GmbH', 0x0014DC: u'Communication System Design & Manufacturing (CSDM)', 0x0014DD: u'Covergence Inc.', 0x0014DE: u'Sage Instruments Inc.', 0x0014DF: u'HI-P Tech Corporation', 0x0014E0: u'LET\'S Corporation', 0x0014E1: u'Data Display AG', 0x0014E2: u'datacom systems inc.', 0x0014E3: u'mm-lab GmbH', 0x0014E4: u'Integral Technologies', 0x0014E5: u'Alticast', 0x0014E6: u'AIM Infrarotmodule GmbH', 0x0014E7: u'Stolinx,. Inc', 0x0014E8: u'Motorola CHS', 0x0014E9: u'Nortech International', 0x0014EA: u'S Digm Inc. (Safe Paradigm Inc.)', 0x0014EB: u'AwarePoint Corporation', 0x0014EC: u'Acro Telecom', 0x0014ED: u'Airak, Inc.', 0x0014EE: u'Western Digital Technologies, Inc.', 0x0014EF: u'TZero Technologies, Inc.', 0x0014F0: u'Business Security OL AB', 0x0014F1: u'Cisco Systems', 0x0014F2: u'Cisco Systems', 0x0014F3: u'ViXS Systems Inc', 0x0014F4: u'DekTec Digital Video B.V.', 0x0014F5: u'OSI Security Devices', 0x0014F6: u'Juniper Networks, Inc.', 0x0014F7: u'Crevis', 0x0014F8: u'Scientific Atlanta', 0x0014F9: u'Vantage Controls', 0x0014FA: u'AsGa S.A.', 0x0014FB: u'Technical Solutions Inc.', 0x0014FC: u'Extandon, Inc.', 0x0014FD: u'Thecus Technology Corp.', 0x0014FE: u'Artech Electronics', 0x0014FF: u'Precise Automation, LLC', 0x001500: u'Intel Corporate', 0x001501: u'LexBox', 0x001502: u'BETA tech', 0x001503: u'PROFIcomms s.r.o.', 0x001504: u'GAME PLUS CO., LTD.', 0x001505: u'Actiontec Electronics, Inc', 0x001506: u'BeamExpress, Inc', 0x001507: u'Renaissance Learning Inc', 0x001508: u'Global Target Enterprise Inc', 0x001509: u'Plus Technology Co., Ltd', 0x00150A: u'Sonoa Systems, Inc', 0x00150B: u'SAGE INFOTECH LTD.', 0x00150C: u'AVM GmbH', 0x00150D: u'Hoana Medical, Inc.', 0x00150E: u'OPENBRAIN TECHNOLOGIES CO., LTD.', 0x00150F: u'mingjong', 0x001510: u'Techsphere Co., Ltd', 0x001511: u'Data Center Systems', 0x001512: u'Zurich University of Applied Sciences', 0x001513: u'EFS sas', 0x001514: u'Hu Zhou NAVA Networks&Electronics Ltd.', 0x001515: u'Leipold+Co.GmbH', 0x001516: u'URIEL SYSTEMS INC.', 0x001517: u'Intel Corporate', 0x001518: u'Shenzhen 10MOONS Technology Development CO.,Ltd', 0x001519: u'StoreAge Networking Technologies', 0x00151A: u'Hunter Engineering Company', 0x00151B: u'Isilon Systems Inc.', 0x00151C: u'LENECO', 0x00151D: u'M2I CORPORATION', 0x00151E: u'Metaware Co., Ltd.', 0x00151F: u'Multivision Intelligent Surveillance (Hong Kong) Ltd', 0x001520: u'Radiocrafts AS', 0x001521: u'Horoquartz', 0x001522: u'Dea Security', 0x001523: u'Meteor Communications Corporation', 0x001524: u'Numatics, Inc.', 0x001525: u'PTI Integrated Systems, Inc.', 0x001526: u'Remote Technologies Inc', 0x001527: u'Balboa Instruments', 0x001528: u'Beacon Medical Products LLC d.b.a. BeaconMedaes', 0x001529: u'N3 Corporation', 0x00152A: u'Nokia GmbH', 0x00152B: u'Cisco Systems', 0x00152C: u'Cisco Systems', 0x00152D: u'TenX Networks, LLC', 0x00152E: u'PacketHop, Inc.', 0x00152F: u'Motorola CHS', 0x001530: u'Bus-Tech, Inc.', 0x001531: u'KOCOM', 0x001532: u'Consumer Technologies Group, LLC', 0x001533: u'NADAM.CO.,LTD', 0x001534: u'A BELTRÓNICA, Companhia de Comunicações, Lda', 0x001535: u'OTE Spa', 0x001536: u'Powertech co.,Ltd', 0x001537: u'Ventus Networks', 0x001538: u'RFID, Inc.', 0x001539: u'Technodrive SRL', 0x00153A: u'Shenzhen Syscan Technology Co.,Ltd.', 0x00153B: u'EMH Elektrizitätszähler GmbH & CoKG', 0x00153C: u'Kprotech Co., Ltd.', 0x00153D: u'ELIM PRODUCT CO.', 0x00153E: u'Q-Matic Sweden AB', 0x00153F: u'Alcatel Alenia Space Italia', 0x001540: u'Nortel', 0x001541: u'StrataLight Communications, Inc.', 0x001542: u'MICROHARD S.R.L.', 0x001543: u'Aberdeen Test Center', 0x001544: u'coM.s.a.t. AG', 0x001545: u'SEECODE Co., Ltd.', 0x001546: u'ITG Worldwide Sdn Bhd', 0x001547: u'AiZen Solutions Inc.', 0x001548: u'CUBE TECHNOLOGIES', 0x001549: u'Dixtal Biomedica Ind. Com. Ltda', 0x00154A: u'WANSHIH ELECTRONIC CO., LTD', 0x00154B: u'Wonde Proud Technology Co., Ltd', 0x00154C: u'Saunders Electronics', 0x00154D: u'Netronome Systems, Inc.', 0x00154E: u'Hirschmann Automation and Control GmbH', 0x00154F: u'one RF Technology', 0x001550: u'Nits Technology Inc', 0x001551: u'RadioPulse Inc.', 0x001552: u'Wi-Gear Inc.', 0x001553: u'Cytyc Corporation', 0x001554: u'Atalum Wireless S.A.', 0x001555: u'DFM GmbH', 0x001556: u'SAGEM SA', 0x001557: u'Olivetti', 0x001558: u'FOXCONN', 0x001559: u'Securaplane Technologies, Inc.', 0x00155A: u'DAINIPPON PHARMACEUTICAL CO., LTD.', 0x00155B: u'Sampo Corporation', 0x00155C: u'Dresser Wayne', 0x00155D: u'Microsoft Corporation', 0x00155E: u'Morgan Stanley', 0x00155F: u'Ubiwave', 0x001560: u'Hewlett Packard', 0x001561: u'JJPlus Corporation', 0x001562: u'Cisco Systems', 0x001563: u'Cisco Systems', 0x001564: u'BEHRINGER Spezielle Studiotechnik GmbH', 0x001565: u'XIAMEN YEALINK NETWORK TECHNOLOGY CO.,LTD', 0x001566: u'A-First Technology Co., Ltd.', 0x001567: u'RADWIN Inc.', 0x001568: u'Dilithium Networks', 0x001569: u'PECO II, Inc.', 0x00156A: u'DG2L Technologies Pvt. Ltd.', 0x00156B: u'Perfisans Networks Corp.', 0x00156C: u'SANE SYSTEM CO., LTD', 0x00156D: u'Ubiquiti Networks', 0x00156E: u'A. W. Communication Systems Ltd', 0x00156F: u'Xiranet Communications GmbH', 0x001570: u'Symbol Technologies', 0x001571: u'Nolan Systems', 0x001572: u'Red-Lemon', 0x001573: u'NewSoft Technology Corporation', 0x001574: u'Horizon Semiconductors Ltd.', 0x001575: u'Nevis Networks Inc.', 0x001576: u'scil animal care company GmbH', 0x001577: u'Allied Telesyn, Inc.', 0x001578: u'Audio / Video Innovations', 0x001579: u'Lunatone Industrielle Elektronik GmbH', 0x00157A: u'Telefin S.p.A.', 0x00157B: u'Leuze electronic GmbH + Co. KG', 0x00157C: u'Dave Networks, Inc.', 0x00157D: u'POSDATA CO., LTD.', 0x00157E: u'HEYFRA ELECTRONIC gmbH', 0x00157F: u'ChuanG International Holding CO.,LTD.', 0x001580: u'U-WAY CORPORATION', 0x001581: u'MAKUS Inc.', 0x001582: u'TVonics Ltd', 0x001583: u'IVT corporation', 0x001584: u'Schenck Process GmbH', 0x001585: u'Aonvision Technolopy Corp.', 0x001586: u'Xiamen Overseas Chinese Electronic Co., Ltd.', 0x001587: u'Takenaka Seisakusho Co.,Ltd', 0x001588: u'Balda-Thong Fook Solutions Sdn. Bhd.', 0x001589: u'D-MAX Technology Co.,Ltd', 0x00158A: u'SURECOM Technology Corp.', 0x00158B: u'Park Air Systems Ltd', 0x00158C: u'Liab ApS', 0x00158D: u'Jennic Ltd', 0x00158E: u'Plustek.INC', 0x00158F: u'NTT Advanced Technology Corporation', 0x001590: u'Hectronic GmbH', 0x001591: u'RLW Inc.', 0x001592: u'Facom UK Ltd (Melksham)', 0x001593: u'U4EA Technologies Inc.', 0x001594: u'BIXOLON CO.,LTD', 0x001595: u'Quester Tangent Corporation', 0x001596: u'ARRIS International', 0x001597: u'AETA AUDIO SYSTEMS', 0x001598: u'Kolektor group', 0x001599: u'Samsung Electronics Co., LTD', 0x00159A: u'Motorola CHS', 0x00159B: u'Nortel', 0x00159C: u'B-KYUNG SYSTEM Co.,Ltd.', 0x00159D: u'Minicom Advanced Systems ltd', 0x00159E: u'Saitek plc', 0x00159F: u'Terascala, Inc.', 0x0015A0: u'Nokia Danmark A/S', 0x0015A1: u'SINTERS SAS', 0x0015A2: u'ARRIS International', 0x0015A3: u'ARRIS International', 0x0015A4: u'ARRIS International', 0x0015A5: u'DCI Co., Ltd.', 0x0015A6: u'Digital Electronics Products Ltd.', 0x0015A7: u'Robatech AG', 0x0015A8: u'Motorola Mobile Devices', 0x0015A9: u'KWANG WOO I&C CO.,LTD', 0x0015AA: u'Rextechnik International Co.,', 0x0015AB: u'PRO CO SOUND INC', 0x0015AC: u'Capelon AB', 0x0015AD: u'Accedian Networks', 0x0015AE: u'kyung il', 0x0015AF: u'AzureWave Technologies, Inc.', 0x0015B0: u'AUTOTELENET CO.,LTD', 0x0015B1: u'Ambient Corporation', 0x0015B2: u'Advanced Industrial Computer, Inc.', 0x0015B3: u'Caretech AB', 0x0015B4: u'Polymap Wireless LLC', 0x0015B5: u'CI Network Corp.', 0x0015B6: u'ShinMaywa Industries, Ltd.', 0x0015B7: u'Toshiba', 0x0015B8: u'Tahoe', 0x0015B9: u'Samsung Electronics Co., Ltd.', 0x0015BA: u'iba AG', 0x0015BB: u'SMA Technologie AG', 0x0015BC: u'Develco', 0x0015BD: u'Group 4 Technology Ltd', 0x0015BE: u'Iqua Ltd.', 0x0015BF: u'technicob', 0x0015C0: u'DIGITAL TELEMEDIA CO.,LTD.', 0x0015C1: u'SONY Computer Entertainment inc,', 0x0015C2: u'3M Germany', 0x0015C3: u'Ruf Telematik AG', 0x0015C4: u'FLOVEL CO., LTD.', 0x0015C5: u'Dell Inc', 0x0015C6: u'Cisco Systems', 0x0015C7: u'Cisco Systems', 0x0015C8: u'FlexiPanel Ltd', 0x0015C9: u'Gumstix, Inc', 0x0015CA: u'TeraRecon, Inc.', 0x0015CB: u'Surf Communication Solutions Ltd.', 0x0015CC: u'TEPCO UQUEST, LTD.', 0x0015CD: u'Exartech International Corp.', 0x0015CE: u'ARRIS International', 0x0015CF: u'ARRIS International', 0x0015D0: u'ARRIS International', 0x0015D1: u'ARRIS International', 0x0015D2: u'Xantech Corporation', 0x0015D3: u'Pantech&Curitel Communications, Inc.', 0x0015D4: u'Emitor AB', 0x0015D5: u'NICEVT', 0x0015D6: u'OSLiNK Sp. z o.o.', 0x0015D7: u'Reti Corporation', 0x0015D8: u'Interlink Electronics', 0x0015D9: u'PKC Electronics Oy', 0x0015DA: u'IRITEL A.D.', 0x0015DB: u'Canesta Inc.', 0x0015DC: u'KT&C Co., Ltd.', 0x0015DD: u'IP Control Systems Ltd.', 0x0015DE: u'Nokia Danmark A/S', 0x0015DF: u'Clivet S.p.A.', 0x0015E0: u'Ericsson Mobile Platforms', 0x0015E1: u'picoChip Designs Ltd', 0x0015E2: u'Wissenschaftliche Geraetebau Dr. Ing. H. Knauer GmbH', 0x0015E3: u'Dream Technologies Corporation', 0x0015E4: u'Zimmer Elektromedizin', 0x0015E5: u'Cheertek Inc.', 0x0015E6: u'MOBILE TECHNIKA Inc.', 0x0015E7: u'Quantec ProAudio', 0x0015E8: u'Nortel', 0x0015E9: u'D-Link Corporation', 0x0015EA: u'Tellumat (Pty) Ltd', 0x0015EB: u'ZTE CORPORATION', 0x0015EC: u'Boca Devices LLC', 0x0015ED: u'Fulcrum Microsystems, Inc.', 0x0015EE: u'Omnex Control Systems', 0x0015EF: u'NEC TOKIN Corporation', 0x0015F0: u'EGO BV', 0x0015F1: u'KYLINK Communications Corp.', 0x0015F2: u'ASUSTek COMPUTER INC.', 0x0015F3: u'PELTOR AB', 0x0015F4: u'Eventide', 0x0015F5: u'Sustainable Energy Systems', 0x0015F6: u'SCIENCE AND ENGINEERING SERVICES, INC.', 0x0015F7: u'Wintecronics Ltd.', 0x0015F8: u'Kingtronics Industrial Co. Ltd.', 0x0015F9: u'Cisco Systems', 0x0015FA: u'Cisco Systems', 0x0015FB: u'setex schermuly textile computer gmbh', 0x0015FC: u'Startco Engineering Ltd.', 0x0015FD: u'Complete Media Systems', 0x0015FE: u'SCHILLING ROBOTICS LLC', 0x0015FF: u'Novatel Wireless, Inc.', 0x001600: u'CelleBrite Mobile Synchronization', 0x001601: u'Buffalo Inc.', 0x001602: u'CEYON TECHNOLOGY CO.,LTD.', 0x001603: u'PRIVATE', 0x001604: u'Sigpro', 0x001605: u'YORKVILLE SOUND INC.', 0x001606: u'Ideal Industries', 0x001607: u'Curves International Inc.', 0x001608: u'Sequans Communications', 0x001609: u'Unitech electronics co., ltd.', 0x00160A: u'SWEEX Europe BV', 0x00160B: u'TVWorks LLC', 0x00160C: u'LPL DEVELOPMENT S.A. DE C.V', 0x00160D: u'Be Here Corporation', 0x00160E: u'Optica Technologies Inc.', 0x00160F: u'BADGER METER INC', 0x001610: u'Carina Technology', 0x001611: u'Altecon Srl', 0x001612: u'Otsuka Electronics Co., Ltd.', 0x001613: u'LibreStream Technologies Inc.', 0x001614: u'Picosecond Pulse Labs', 0x001615: u'Nittan Company, Limited', 0x001616: u'BROWAN COMMUNICATION INC.', 0x001617: u'MSI', 0x001618: u'HIVION Co., Ltd.', 0x001619: u'La Factoría de Comunicaciones Aplicadas,S.L.', 0x00161A: u'Dametric AB', 0x00161B: u'Micronet Corporation', 0x00161C: u'e:cue', 0x00161D: u'Innovative Wireless Technologies, Inc.', 0x00161E: u'Woojinnet', 0x00161F: u'SUNWAVETEC Co., Ltd.', 0x001620: u'Sony Ericsson Mobile Communications AB', 0x001621: u'Colorado Vnet', 0x001622: u'BBH SYSTEMS GMBH', 0x001623: u'Interval Media', 0x001624: u'PRIVATE', 0x001625: u'Impinj, Inc.', 0x001626: u'Motorola CHS', 0x001627: u'embedded-logic DESIGN AND MORE GmbH', 0x001628: u'Ultra Electronics Manufacturing and Card Systems', 0x001629: u'Nivus GmbH', 0x00162A: u'Antik computers & communications s.r.o.', 0x00162B: u'Togami Electric Mfg.co.,Ltd.', 0x00162C: u'Xanboo', 0x00162D: u'STNet Co., Ltd.', 0x00162E: u'Space Shuttle Hi-Tech Co., Ltd.', 0x00162F: u'Geutebrück GmbH', 0x001630: u'Vativ Technologies', 0x001631: u'Xteam', 0x001632: u'SAMSUNG ELECTRONICS CO., LTD.', 0x001633: u'Oxford Diagnostics Ltd.', 0x001634: u'Mathtech, Inc.', 0x001635: u'Hewlett Packard', 0x001636: u'Quanta Computer Inc.', 0x001637: u'Citel Srl', 0x001638: u'TECOM Co., Ltd.', 0x001639: u'UBIQUAM Co.,Ltd', 0x00163A: u'YVES TECHNOLOGY CO., LTD.', 0x00163B: u'VertexRSI/General Dynamics', 0x00163C: u'Rebox B.V.', 0x00163D: u'Tsinghua Tongfang Legend Silicon Tech. Co., Ltd.', 0x00163E: u'Xensource, Inc.', 0x00163F: u'CReTE SYSTEMS Inc.', 0x001640: u'Asmobile Communication Inc.', 0x001641: u'USI', 0x001642: u'Pangolin', 0x001643: u'Sunhillo Corproation', 0x001644: u'LITE-ON Technology Corp.', 0x001645: u'Power Distribution, Inc.', 0x001646: u'Cisco Systems', 0x001647: u'Cisco Systems', 0x001648: u'SSD Company Limited', 0x001649: u'SetOne GmbH', 0x00164A: u'Vibration Technology Limited', 0x00164B: u'Quorion Data Systems GmbH', 0x00164C: u'PLANET INT Co., Ltd', 0x00164D: u'Alcatel North America IP Division', 0x00164E: u'Nokia Danmark A/S', 0x00164F: u'World Ethnic Broadcastin Inc.', 0x001650: u'EYAL MICROWAVE', 0x001651: u'PRIVATE', 0x001652: u'Hoatech Technologies, Inc.', 0x001653: u'LEGO System A/S IE Electronics Division', 0x001654: u'Flex-P Industries Sdn. Bhd.', 0x001655: u'FUHO TECHNOLOGY Co., LTD', 0x001656: u'Nintendo Co., Ltd.', 0x001657: u'Aegate Ltd', 0x001658: u'Fusiontech Technologies Inc.', 0x001659: u'Z.M.P. RADWAG', 0x00165A: u'Harman Specialty Group', 0x00165B: u'Grip Audio', 0x00165C: u'Trackflow Ltd', 0x00165D: u'AirDefense, Inc.', 0x00165E: u'Precision I/O', 0x00165F: u'Fairmount Automation', 0x001660: u'Nortel', 0x001661: u'Novatium Solutions (P) Ltd', 0x001662: u'Liyuh Technology Ltd.', 0x001663: u'KBT Mobile', 0x001664: u'Prod-El SpA', 0x001665: u'Cellon France', 0x001666: u'Quantier Communication Inc.', 0x001667: u'A-TEC Subsystem INC.', 0x001668: u'Eishin Electronics', 0x001669: u'MRV Communication (Networks) LTD', 0x00166A: u'TPS', 0x00166B: u'Samsung Electronics', 0x00166C: u'Samsung Electonics Digital Video System Division', 0x00166D: u'Yulong Computer Telecommunication Scientific(shenzhen)Co.,Lt', 0x00166E: u'Arbitron Inc.', 0x00166F: u'Intel Corporation', 0x001670: u'SKNET Corporation', 0x001671: u'Symphox Information Co.', 0x001672: u'Zenway enterprise ltd', 0x001673: u'PRIVATE', 0x001674: u'EuroCB (Phils.), Inc.', 0x001675: u'Motorola MDb', 0x001676: u'Intel Corporation', 0x001677: u'Bihl+Wiedemann GmbH', 0x001678: u'SHENZHEN BAOAN GAOKE ELECTRONICS CO., LTD', 0x001679: u'eOn Communications', 0x00167A: u'Skyworth Overseas Dvelopment Ltd.', 0x00167B: u'Haver&Boecker', 0x00167C: u'iRex Technologies BV', 0x00167D: u'Sky-Line', 0x00167E: u'DIBOSS.CO.,LTD', 0x00167F: u'Bluebird Soft Inc.', 0x001680: u'Bally Gaming + Systems', 0x001681: u'Vector Informatik GmbH', 0x001682: u'Pro Dex, Inc', 0x001683: u'WEBIO International Co.,.Ltd.', 0x001684: u'Donjin Co.,Ltd.', 0x001685: u'FRWD Technologies Ltd.', 0x001686: u'Karl Storz Imaging', 0x001687: u'Chubb CSC-Vendor AP', 0x001688: u'ServerEngines LLC', 0x001689: u'Pilkor Electronics Co., Ltd', 0x00168A: u'id-Confirm Inc', 0x00168B: u'Paralan Corporation', 0x00168C: u'DSL Partner AS', 0x00168D: u'KORWIN CO., Ltd.', 0x00168E: u'Vimicro corporation', 0x00168F: u'GN Netcom as', 0x001690: u'J-TEK INCORPORATION', 0x001691: u'Moser-Baer AG', 0x001692: u'Scientific-Atlanta, Inc.', 0x001693: u'PowerLink Technology Inc.', 0x001694: u'Sennheiser Communications A/S', 0x001695: u'AVC Technology Limited', 0x001696: u'QDI Technology (H.K.) Limited', 0x001697: u'NEC Corporation', 0x001698: u'T&A Mobile Phones SAS', 0x001699: u'PRIVATE', 0x00169A: u'Quadrics Ltd', 0x00169B: u'Alstom Transport', 0x00169C: u'Cisco Systems', 0x00169D: u'Cisco Systems', 0x00169E: u'TV One Ltd', 0x00169F: u'Vimtron Electronics Co., Ltd.', 0x0016A0: u'Auto-Maskin', 0x0016A1: u'3Leaf Networks', 0x0016A2: u'CentraLite Systems, Inc.', 0x0016A3: u'TEAM ARTECHE, S.A.', 0x0016A4: u'Ezurio Ltd', 0x0016A5: u'Tandberg Storage ASA', 0x0016A6: u'Dovado FZ-LLC', 0x0016A7: u'AWETA G&P', 0x0016A8: u'CWT CO., LTD.', 0x0016A9: u'2EI', 0x0016AA: u'Kei Communication Technology Inc.', 0x0016AB: u'PBI-Dansensor A/S', 0x0016AC: u'Toho Technology Corp.', 0x0016AD: u'BT-Links Company Limited', 0x0016AE: u'INVENTEL', 0x0016AF: u'Shenzhen Union Networks Equipment Co.,Ltd.', 0x0016B0: u'VK Corporation', 0x0016B1: u'KBS', 0x0016B2: u'DriveCam Inc', 0x0016B3: u'Photonicbridges (China) Co., Ltd.', 0x0016B4: u'PRIVATE', 0x0016B5: u'Motorola CHS', 0x0016B6: u'Cisco-Linksys', 0x0016B7: u'Seoul Commtech', 0x0016B8: u'Sony Ericsson Mobile Communications', 0x0016B9: u'ProCurve Networking', 0x0016BA: u'WEATHERNEWS INC.', 0x0016BB: u'Law-Chain Computer Technology Co Ltd', 0x0016BC: u'Nokia Danmark A/S', 0x0016BD: u'ATI Industrial Automation', 0x0016BE: u'INFRANET, Inc.', 0x0016BF: u'PaloDEx Group Oy', 0x0016C0: u'Semtech Corporation', 0x0016C1: u'Eleksen Ltd', 0x0016C2: u'Avtec Systems Inc', 0x0016C3: u'BA Systems Inc', 0x0016C4: u'SiRF Technology, Inc.', 0x0016C5: u'Shenzhen Xing Feng Industry Co.,Ltd', 0x0016C6: u'North Atlantic Industries', 0x0016C7: u'Cisco Systems', 0x0016C8: u'Cisco Systems', 0x0016C9: u'NAT Seattle, Inc.', 0x0016CA: u'Nortel', 0x0016CB: u'Apple Computer', 0x0016CC: u'Xcute Mobile Corp.', 0x0016CD: u'HIJI HIGH-TECH CO., LTD.', 0x0016CE: u'Hon Hai Precision Ind. Co., Ltd.', 0x0016CF: u'Hon Hai Precision Ind. Co., Ltd.', 0x0016D0: u'ATech elektronika d.o.o.', 0x0016D1: u'ZAT a.s.', 0x0016D2: u'Caspian', 0x0016D3: u'Wistron Corporation', 0x0016D4: u'Compal Communications, Inc.', 0x0016D5: u'Synccom Co., Ltd', 0x0016D6: u'TDA Tech Pty Ltd', 0x0016D7: u'Sunways AG', 0x0016D8: u'Senea AB', 0x0016D9: u'NINGBO BIRD CO.,LTD.', 0x0016DA: u'Futronic Technology Co. Ltd.', 0x0016DB: u'Samsung Electronics Co., Ltd.', 0x0016DC: u'ARCHOS', 0x0016DD: u'Gigabeam Corporation', 0x0016DE: u'FAST Inc', 0x0016DF: u'Lundinova AB', 0x0016E0: u'3Com Europe Ltd', 0x0016E1: u'SiliconStor, Inc.', 0x0016E2: u'American Fibertek, Inc.', 0x0016E3: u'ASKEY COMPUTER CORP.', 0x0016E4: u'VANGUARD SECURITY ENGINEERING CORP.', 0x0016E5: u'FORDLEY DEVELOPMENT LIMITED', 0x0016E6: u'GIGA-BYTE TECHNOLOGY CO.,LTD.', 0x0016E7: u'Dynamix Promotions Limited', 0x0016E8: u'Sigma Designs, Inc.', 0x0016E9: u'Tiba Medical Inc', 0x0016EA: u'Intel Corporation', 0x0016EB: u'Intel Corporation', 0x0016EC: u'Elitegroup Computer Systems Co., Ltd.', 0x0016ED: u'Integrian, Inc.', 0x0016EE: u'RoyalDigital Inc.', 0x0016EF: u'Koko Fitness, Inc.', 0x0016F0: u'Zermatt Systems, Inc', 0x0016F1: u'OmniSense, LLC', 0x0016F2: u'Dmobile System Co., Ltd.', 0x0016F3: u'CAST Information Co., Ltd', 0x0016F4: u'Eidicom Co., Ltd.', 0x0016F5: u'Dalian Golden Hualu Digital Technology Co.,Ltd', 0x0016F6: u'Video Products Group', 0x0016F7: u'L-3 Communications, Electrodynamics, Inc.', 0x0016F8: u'AVIQTECH TECHNOLOGY CO., LTD.', 0x0016F9: u'CETRTA POT, d.o.o., Kranj', 0x0016FA: u'ECI Telecom Ltd.', 0x0016FB: u'SHENZHEN MTC CO.,LTD.', 0x0016FC: u'TOHKEN CO.,LTD.', 0x0016FD: u'Jaty Electronics', 0x0016FE: u'Alps Electric Co., Ltd', 0x0016FF: u'Wamin Optocomm Mfg Corp', 0x001700: u'Motorola MDb', 0x001701: u'KDE, Inc.', 0x001702: u'Osung Midicom Co., Ltd', 0x001703: u'MOSDAN Internation Co.,Ltd', 0x001704: u'Shinco Electronics Group Co.,Ltd', 0x001705: u'Methode Electronics', 0x001706: u'Techfaith Wireless Communication Technology Limited.', 0x001707: u'InGrid, Inc', 0x001708: u'Hewlett Packard', 0x001709: u'Exalt Communications', 0x00170A: u'INEW DIGITAL COMPANY', 0x00170B: u'Contela, Inc.', 0x00170C: u'Benefon Oyj', 0x00170D: u'Dust Networks Inc.', 0x00170E: u'Cisco Systems', 0x00170F: u'Cisco Systems', 0x001710: u'Casa Systems Inc.', 0x001711: u'GE Healthcare Bio-Sciences AB', 0x001712: u'ISCO International', 0x001713: u'Tiger NetCom', 0x001714: u'BR Controls Nederland bv', 0x001715: u'Qstik', 0x001716: u'Qno Technology Inc.', 0x001717: u'Leica Geosystems AG', 0x001718: u'Vansco Electronics Oy', 0x001719: u'AudioCodes USA, Inc', 0x00171A: u'Winegard Company', 0x00171B: u'Innovation Lab Corp.', 0x00171C: u'NT MicroSystems, Inc.', 0x00171D: u'DIGIT', 0x00171E: u'Theo Benning GmbH & Co. KG', 0x00171F: u'IMV Corporation', 0x001720: u'Image Sensing Systems, Inc.', 0x001721: u'FITRE S.p.A.', 0x001722: u'Hanazeder Electronic GmbH', 0x001723: u'Summit Data Communications', 0x001724: u'Studer Professional Audio GmbH', 0x001725: u'Liquid Computing', 0x001726: u'm2c Electronic Technology Ltd.', 0x001727: u'Thermo Ramsey Italia s.r.l.', 0x001728: u'Selex Communications', 0x001729: u'Ubicod Co.LTD', 0x00172A: u'Proware Technology Corp.', 0x00172B: u'Global Technologies Inc.', 0x00172C: u'TAEJIN INFOTECH', 0x00172D: u'Axcen Photonics Corporation', 0x00172E: u'FXC Inc.', 0x00172F: u'NeuLion Incorporated', 0x001730: u'Automation Electronics', 0x001731: u'ASUSTek COMPUTER INC.', 0x001732: u'Science-Technical Center "RISSA"', 0x001733: u'neuf cegetel', 0x001734: u'LGC Wireless Inc.', 0x001735: u'PRIVATE', 0x001736: u'iiTron Inc.', 0x001737: u'Industrie Dial Face S.p.A.', 0x001738: u'XIV', 0x001739: u'Bright Headphone Electronics Company', 0x00173A: u'Edge Integration Systems Inc.', 0x00173B: u'Arched Rock Corporation', 0x00173C: u'Extreme Engineering Solutions', 0x00173D: u'Neology', 0x00173E: u'LeucotronEquipamentos Ltda.', 0x00173F: u'Belkin Corporation', 0x001740: u'Technologies Labtronix', 0x001741: u'DEFIDEV', 0x001742: u'FUJITSU LIMITED', 0x001743: u'Deck Srl', 0x001744: u'Araneo Ltd.', 0x001745: u'INNOTZ CO., Ltd', 0x001746: u'Freedom9 Inc.', 0x001747: u'Trimble', 0x001748: u'Neokoros Brasil Ltda', 0x001749: u'HYUNDAE YONG-O-SA CO.,LTD', 0x00174A: u'SOCOMEC', 0x00174B: u'Nokia Danmark A/S', 0x00174C: u'Millipore', 0x00174D: u'DYNAMIC NETWORK FACTORY, INC.', 0x00174E: u'Parama-tech Co.,Ltd.', 0x00174F: u'iCatch Inc.', 0x001750: u'GSI Group, MicroE Systems', 0x001751: u'Online Corporation', 0x001752: u'DAGS, Inc', 0x001753: u'nFore Technology Inc.', 0x001754: u'Arkino Corporation., Ltd', 0x001755: u'GE Security', 0x001756: u'Vinci Labs Oy', 0x001757: u'RIX TECHNOLOGY LIMITED', 0x001758: u'ThruVision Ltd', 0x001759: u'Cisco Systems', 0x00175A: u'Cisco Systems', 0x00175B: u'ACS Solutions Switzerland Ltd.', 0x00175C: u'SHARP CORPORATION', 0x00175D: u'Dongseo system.', 0x00175E: u'Anta Systems, Inc.', 0x00175F: u'XENOLINK Communications Co., Ltd.', 0x001760: u'Naito Densei Machida MFG.CO.,LTD', 0x001761: u'ZKSoftware Inc.', 0x001762: u'Solar Technology, Inc.', 0x001763: u'Essentia S.p.A.', 0x001764: u'ATMedia GmbH', 0x001765: u'Nortel', 0x001766: u'Accense Technology, Inc.', 0x001767: u'Earforce AS', 0x001768: u'Zinwave Ltd', 0x001769: u'Cymphonix Corp', 0x00176A: u'Avago Technologies', 0x00176B: u'Kiyon, Inc.', 0x00176C: u'Pivot3, Inc.', 0x00176D: u'CORE CORPORATION', 0x00176E: u'DUCATI SISTEMI', 0x00176F: u'PAX Computer Technology(Shenzhen) Ltd.', 0x001770: u'Arti Industrial Electronics Ltd.', 0x001771: u'APD Communications Ltd', 0x001772: u'ASTRO Strobel Kommunikationssysteme GmbH', 0x001773: u'Laketune Technologies Co. Ltd', 0x001774: u'Elesta GmbH', 0x001775: u'TTE Germany GmbH', 0x001776: u'Meso Scale Diagnostics, LLC', 0x001777: u'Obsidian Research Corporation', 0x001778: u'Central Music Co.', 0x001779: u'QuickTel', 0x00177A: u'ASSA ABLOY AB', 0x00177B: u'Azalea Networks inc', 0x00177C: u'D-Link India Ltd', 0x00177D: u'IDT International Limited', 0x00177E: u'Meshcom Technologies Inc.', 0x00177F: u'Worldsmart Retech', 0x001780: u'Applera Holding B.V. Singapore Operations', 0x001781: u'Greystone Data System, Inc.', 0x001782: u'LoBenn Inc.', 0x001783: u'Texas Instruments', 0x001784: u'Motorola Mobile Devices', 0x001785: u'Sparr Electronics Ltd', 0x001786: u'wisembed', 0x001787: u'Brother, Brother & Sons ApS', 0x001788: u'Philips Lighting BV', 0x001789: u'Zenitron Corporation', 0x00178A: u'DARTS TECHNOLOGIES CORP.', 0x00178B: u'Teledyne Technologies Incorporated', 0x00178C: u'Independent Witness, Inc', 0x00178D: u'Checkpoint Systems, Inc.', 0x00178E: u'Gunnebo Cash Automation AB', 0x00178F: u'NINGBO YIDONG ELECTRONIC CO.,LTD.', 0x001790: u'HYUNDAI DIGITECH Co, Ltd.', 0x001791: u'LinTech GmbH', 0x001792: u'Falcom Wireless Comunications Gmbh', 0x001793: u'Tigi Corporation', 0x001794: u'Cisco Systems', 0x001795: u'Cisco Systems', 0x001796: u'Rittmeyer AG', 0x001797: u'Telsy Elettronica S.p.A.', 0x001798: u'Azonic Technology Co., LTD', 0x001799: u'SmarTire Systems Inc.', 0x00179A: u'D-Link Corporation', 0x00179B: u'Chant Sincere CO., LTD.', 0x00179C: u'DEPRAG SCHULZ GMBH u. CO.', 0x00179D: u'Kelman Limited', 0x00179E: u'Sirit Inc', 0x00179F: u'Apricorn', 0x0017A0: u'RoboTech srl', 0x0017A1: u'3soft inc.', 0x0017A2: u'Camrivox Ltd.', 0x0017A3: u'MIX s.r.l.', 0x0017A4: u'Global Data Services', 0x0017A5: u'TrendChip Technologies Corp.', 0x0017A6: u'YOSIN ELECTRONICS CO., LTD.', 0x0017A7: u'Mobile Computing Promotion Consortium', 0x0017A8: u'EDM Corporation', 0x0017A9: u'Sentivision', 0x0017AA: u'elab-experience inc.', 0x0017AB: u'Nintendo Co., Ltd.', 0x0017AC: u'O\'Neil Product Development Inc.', 0x0017AD: u'AceNet Corporation', 0x0017AE: u'GAI-Tronics', 0x0017AF: u'Enermet', 0x0017B0: u'Nokia Danmark A/S', 0x0017B1: u'ACIST Medical Systems, Inc.', 0x0017B2: u'SK Telesys', 0x0017B3: u'Aftek Infosys Limited', 0x0017B4: u'Remote Security Systems, LLC', 0x0017B5: u'Peerless Systems Corporation', 0x0017B6: u'Aquantia', 0x0017B7: u'Tonze Technology Co.', 0x0017B8: u'NOVATRON CO., LTD.', 0x0017B9: u'Gambro Lundia AB', 0x0017BA: u'SEDO CO., LTD.', 0x0017BB: u'Syrinx Industrial Electronics', 0x0017BC: u'Touchtunes Music Corporation', 0x0017BD: u'Tibetsystem', 0x0017BE: u'Tratec Telecom B.V.', 0x0017BF: u'Coherent Research Limited', 0x0017C0: u'PureTech Systems, Inc.', 0x0017C1: u'CM Precision Technology LTD.', 0x0017C2: u'Pirelli Broadband Solutions', 0x0017C3: u'KTF Technologies Inc.', 0x0017C4: u'Quanta Microsystems, INC.', 0x0017C5: u'SonicWALL', 0x0017C6: u'Labcal Technologies', 0x0017C7: u'MARA Systems Consulting AB', 0x0017C8: u'Kyocera Mita Corporation', 0x0017C9: u'Samsung Electronics Co., Ltd.', 0x0017CA: u'BenQ Corporation', 0x0017CB: u'Juniper Networks', 0x0017CC: u'Alcatel USA Sourcing LP', 0x0017CD: u'CEC Wireless R&D Ltd.', 0x0017CE: u'MB International Telecom Labs srl', 0x0017CF: u'iMCA-GmbH', 0x0017D0: u'Opticom Communications, LLC', 0x0017D1: u'Nortel', 0x0017D2: u'THINLINX PTY LTD', 0x0017D3: u'Etymotic Research, Inc.', 0x0017D4: u'Monsoon Multimedia, Inc', 0x0017D5: u'Samsung Electronics Co., Ltd.', 0x0017D6: u'Bluechips Microhouse Co.,Ltd.', 0x0017D7: u'Input/Output Inc.', 0x0017D8: u'Magnum Semiconductor, Inc.', 0x0017D9: u'AAI Corporation', 0x0017DA: u'Spans Logic', 0x0017DB: u'PRIVATE', 0x0017DC: u'DAEMYUNG ZERO1', 0x0017DD: u'Clipsal Australia', 0x0017DE: u'Advantage Six Ltd', 0x0017DF: u'Cisco Systems', 0x0017E0: u'Cisco Systems', 0x0017E1: u'DACOS Technologies Co., Ltd.', 0x0017E2: u'Motorola Mobile Devices', 0x0017E3: u'Texas Instruments', 0x0017E4: u'Texas Instruments', 0x0017E5: u'Texas Instruments', 0x0017E6: u'Texas Instruments', 0x0017E7: u'Texas Instruments', 0x0017E8: u'Texas Instruments', 0x0017E9: u'Texas Instruments', 0x0017EA: u'Texas Instruments', 0x0017EB: u'Texas Instruments', 0x0017EC: u'Texas Instruments', 0x0017ED: u'WooJooIT Ltd.', 0x0017EE: u'Motorola CHS', 0x0017EF: u'Blade Network Technologies, Inc.', 0x0017F0: u'SZCOM Broadband Network Technology Co.,Ltd', 0x0017F1: u'Renu Electronics Pvt Ltd', 0x0017F2: u'Apple Computer', 0x0017F3: u'M/A-COM Wireless Systems', 0x0017F4: u'ZERON ALLIANCE', 0x0017F5: u'NEOPTEK', 0x0017F6: u'Pyramid Meriden Inc.', 0x0017F7: u'CEM Solutions Pvt Ltd', 0x0017F8: u'Motech Industries Inc.', 0x0017F9: u'Forcom Sp. z o.o.', 0x0017FA: u'Microsoft Corporation', 0x0017FB: u'FA', 0x0017FC: u'Suprema Inc.', 0x0017FD: u'Amulet Hotkey', 0x0017FE: u'TALOS SYSTEM INC.', 0x0017FF: u'PLAYLINE Co.,Ltd.', 0x001800: u'UNIGRAND LTD', 0x001801: u'Actiontec Electronics, Inc', 0x001802: u'Alpha Networks Inc.', 0x001803: u'ArcSoft Shanghai Co. LTD', 0x001804: u'E-TEK DIGITAL TECHNOLOGY LIMITED', 0x001805: u'Beijing InHand Networking', 0x001806: u'Hokkei Industries Co., Ltd.', 0x001807: u'Fanstel Corp.', 0x001808: u'SightLogix, Inc.', 0x001809: u'CRESYN', 0x00180A: u'Meraki Networks, Inc.', 0x00180B: u'Brilliant Telecommunications', 0x00180C: u'Optelian Access Networks Corporation', 0x00180D: u'Terabytes Server Storage Tech Corp', 0x00180E: u'Avega Systems', 0x00180F: u'Nokia Danmark A/S', 0x001810: u'IPTrade S.A.', 0x001811: u'Neuros Technology International, LLC.', 0x001812: u'Beijing Xinwei Telecom Technology Co., Ltd.', 0x001813: u'Sony Ericsson Mobile Communications', 0x001814: u'Mitutoyo Corporation', 0x001815: u'GZ Technologies, Inc.', 0x001816: u'Ubixon Co., Ltd.', 0x001817: u'D. E. Shaw Research, LLC', 0x001818: u'Cisco Systems', 0x001819: u'Cisco Systems', 0x00181A: u'AVerMedia Technologies Inc.', 0x00181B: u'TaiJin Metal Co., Ltd.', 0x00181C: u'Exterity Limited', 0x00181D: u'ASIA ELECTRONICS CO.,LTD', 0x00181E: u'GDX Technologies Ltd.', 0x00181F: u'Palmmicro Communications', 0x001820: u'w5networks', 0x001821: u'SINDORICOH', 0x001822: u'CEC TELECOM CO.,LTD.', 0x001823: u'Delta Electronics, Inc.', 0x001824: u'Kimaldi Electronics, S.L.', 0x001825: u'Wavion LTD', 0x001826: u'Cale Access AB', 0x001827: u'NEC PHILIPS UNIFIED SOLUTIONS NEDERLAND BV', 0x001828: u'e2v technologies (UK) ltd.', 0x001829: u'Gatsometer', 0x00182A: u'Taiwan Video & Monitor', 0x00182B: u'Softier', 0x00182C: u'Ascend Networks, Inc.', 0x00182D: u'Artec Group OÜ', 0x00182E: u'Wireless Ventures USA', 0x00182F: u'Texas Instruments', 0x001830: u'Texas Instruments', 0x001831: u'Texas Instruments', 0x001832: u'Texas Instruments', 0x001833: u'Texas Instruments', 0x001834: u'Texas Instruments', 0x001835: u'ITC', 0x001836: u'Reliance Electric Limited', 0x001837: u'Universal ABIT Co., Ltd.', 0x001838: u'PanAccess Communications,Inc.', 0x001839: u'Cisco-Linksys LLC', 0x00183A: u'Westell Technologies', 0x00183B: u'CENITS Co., Ltd.', 0x00183C: u'Encore Software Limited', 0x00183D: u'Vertex Link Corporation', 0x00183E: u'Digilent, Inc', 0x00183F: u'2Wire, Inc', 0x001840: u'3 Phoenix, Inc.', 0x001841: u'High Tech Computer Corp', 0x001842: u'Nokia Danmark A/S', 0x001843: u'Dawevision Ltd', 0x001844: u'Heads Up Technologies, Inc.', 0x001845: u'NPL Pulsar Ltd.', 0x001846: u'Crypto S.A.', 0x001847: u'AceNet Technology Inc.', 0x001848: u'Vecima Networks Inc.', 0x001849: u'Pigeon Point Systems', 0x00184A: u'Catcher, Inc.', 0x00184B: u'Las Vegas Gaming, Inc.', 0x00184C: u'Bogen Communications', 0x00184D: u'Netgear Inc.', 0x00184E: u'Lianhe Technologies, Inc.', 0x00184F: u'8 Ways Technology Corp.', 0x001850: u'Secfone Kft', 0x001851: u'SWsoft', 0x001852: u'StorLink Semiconductors, Inc.', 0x001853: u'Atera Networks LTD.', 0x001854: u'Argard Co., Ltd', 0x001855: u'Aeromaritime Systembau GmbH', 0x001856: u'EyeFi, Inc', 0x001857: u'Unilever R&D', 0x001858: u'TagMaster AB', 0x001859: u'Strawberry Linux Co.,Ltd.', 0x00185A: u'uControl, Inc.', 0x00185B: u'Network Chemistry, Inc', 0x00185C: u'EDS Lab Pte Ltd', 0x00185D: u'TAIGUEN TECHNOLOGY (SHEN-ZHEN) CO., LTD.', 0x00185E: u'Nexterm Inc.', 0x00185F: u'TAC Inc.', 0x001860: u'SIM Technology Group Shanghai Simcom Ltd.,', 0x001861: u'Ooma, Inc.', 0x001862: u'Seagate Technology', 0x001863: u'Veritech Electronics Limited', 0x001864: u'Cybectec Inc.', 0x001865: u'Bayer Diagnostics Sudbury Ltd', 0x001866: u'Leutron Vision', 0x001867: u'Evolution Robotics Retail', 0x001868: u'Scientific Atlanta, A Cisco Company', 0x001869: u'KINGJIM', 0x00186A: u'Global Link Digital Technology Co,.LTD', 0x00186B: u'Sambu Communics CO., LTD.', 0x00186C: u'Neonode AB', 0x00186D: u'Zhenjiang Sapphire Electronic Industry CO.', 0x00186E: u'3COM Europe Ltd', 0x00186F: u'Setha Industria Eletronica LTDA', 0x001870: u'E28 Shanghai Limited', 0x001871: u'Global Data Services', 0x001872: u'Expertise Engineering', 0x001873: u'Cisco Systems', 0x001874: u'Cisco Systems', 0x001875: u'AnaCise Testnology Pte Ltd', 0x001876: u'WowWee Ltd.', 0x001877: u'Amplex A/S', 0x001878: u'Mackware GmbH', 0x001879: u'dSys', 0x00187A: u'Wiremold', 0x00187B: u'4NSYS Co. Ltd.', 0x00187C: u'INTERCROSS, LLC', 0x00187D: u'Armorlink shanghai Co. Ltd', 0x00187E: u'RGB Spectrum', 0x00187F: u'ZODIANET', 0x001880: u'Mobilygen', 0x001881: u'Buyang Electronics Industrial Co., Ltd', 0x001882: u'Huawei Technologies Co., Ltd.', 0x001883: u'FORMOSA21 INC.', 0x001884: u'FON', 0x001885: u'Avigilon Corporation', 0x001886: u'EL-TECH, INC.', 0x001887: u'Metasystem SpA', 0x001888: u'GOTIVE a.s.', 0x001889: u'WinNet Solutions Limited', 0x00188A: u'Infinova LLC', 0x00188B: u'Dell', 0x00188C: u'Mobile Action Technology Inc.', 0x00188D: u'Nokia Danmark A/S', 0x00188E: u'Ekahau, Inc.', 0x00188F: u'Montgomery Technology, Inc.', 0x001890: u'RadioCOM, s.r.o.', 0x001891: u'Zhongshan General K-mate Electronics Co., Ltd', 0x001892: u'ads-tec GmbH', 0x001893: u'SHENZHEN PHOTON BROADBAND TECHNOLOGY CO.,LTD', 0x001894: u'zimocom', 0x001895: u'Hansun Technologies Inc.', 0x001896: u'Great Well Electronic LTD', 0x001897: u'JESS-LINK PRODUCTS Co., LTD', 0x001898: u'KINGSTATE ELECTRONICS CORPORATION', 0x001899: u'ShenZhen jieshun Science&Technology Industry CO,LTD.', 0x00189A: u'HANA Micron Inc.', 0x00189B: u'Thomson Inc.', 0x00189C: u'Weldex Corporation', 0x00189D: u'Navcast Inc.', 0x00189E: u'OMNIKEY GmbH.', 0x00189F: u'Lenntek Corporation', 0x0018A0: u'Cierma Ascenseurs', 0x0018A1: u'Tiqit Computers, Inc.', 0x0018A2: u'XIP Technology AB', 0x0018A3: u'ZIPPY TECHNOLOGY CORP.', 0x0018A4: u'Motorola Mobile Devices', 0x0018A5: u'ADigit Technologies Corp.', 0x0018A6: u'Persistent Systems, LLC', 0x0018A7: u'Yoggie Security Systems LTD.', 0x0018A8: u'AnNeal Technology Inc.', 0x0018A9: u'Ethernet Direct Corporation', 0x0018AA: u'PRIVATE', 0x0018AB: u'BEIJING LHWT MICROELECTRONICS INC.', 0x0018AC: u'Shanghai Jiao Da HISYS Technology Co. Ltd.', 0x0018AD: u'NIDEC SANKYO CORPORATION', 0x0018AE: u'Tongwei Video Technology CO.,LTD', 0x0018AF: u'Samsung Electronics Co., Ltd.', 0x0018B0: u'Nortel', 0x0018B1: u'Blade Network Technologies', 0x0018B2: u'ADEUNIS RF', 0x0018B3: u'TEC WizHome Co., Ltd.', 0x0018B4: u'Dawon Media Inc.', 0x0018B5: u'Magna Carta', 0x0018B6: u'S3C, Inc.', 0x0018B7: u'D3 LED, LLC', 0x0018B8: u'New Voice International AG', 0x0018B9: u'Cisco Systems', 0x0018BA: u'Cisco Systems', 0x0018BB: u'Eliwell Controls srl', 0x0018BC: u'ZAO NVP Bolid', 0x0018BD: u'SHENZHEN DVBWORLD TECHNOLOGY CO., LTD.', 0x0018BE: u'ANSA Corporation', 0x0018BF: u'Essence Technology Solution, Inc.', 0x0018C0: u'Motorola CHS', 0x0018C1: u'Almitec Informática e Comércio Ltda.', 0x0018C2: u'Firetide, Inc', 0x0018C3: u'C&S Microwave', 0x0018C4: u'Raba Technologies LLC', 0x0018C5: u'Nokia Danmark A/S', 0x0018C6: u'OPW Fuel Management Systems', 0x0018C7: u'Real Time Automation', 0x0018C8: u'ISONAS Inc.', 0x0018C9: u'EOps Technology Limited', 0x0018CA: u'Viprinet GmbH', 0x0018CB: u'Tecobest Technology Limited', 0x0018CC: u'AXIOHM SAS', 0x0018CD: u'Erae Electronics Industry Co., Ltd', 0x0018CE: u'Dreamtech Co., Ltd', 0x0018CF: u'Baldor Electric Company', 0x0018D0: u'@ROAD Inc', 0x0018D1: u'Siemens Home & Office Comm. Devices', 0x0018D2: u'High-Gain Antennas LLC', 0x0018D3: u'TEAMCAST', 0x0018D4: u'Unified Display Interface SIG', 0x0018D5: u'REIGNCOM', 0x0018D6: u'Swirlnet A/S', 0x0018D7: u'Javad Navigation Systems Inc.', 0x0018D8: u'ARCH METER Corporation', 0x0018D9: u'Santosha Internatonal, Inc', 0x0018DA: u'AMBER wireless GmbH', 0x0018DB: u'EPL Technology Ltd', 0x0018DC: u'Prostar Co., Ltd.', 0x0018DD: u'Silicondust Engineering Ltd', 0x0018DE: u'Intel Corporation', 0x0018DF: u'The Morey Corporation', 0x0018E0: u'ANAVEO', 0x0018E1: u'Verkerk Service Systemen', 0x0018E2: u'Topdata Sistemas de Automacao Ltda', 0x0018E3: u'Visualgate Systems, Inc.', 0x0018E4: u'YIGUANG', 0x0018E5: u'Adhoco AG', 0x0018E6: u'Computer Hardware Design SIA', 0x0018E7: u'Cameo Communications, INC.', 0x0018E8: u'Hacetron Corporation', 0x0018E9: u'Numata Corporation', 0x0018EA: u'Alltec GmbH', 0x0018EB: u'BroVis Wireless Networks', 0x0018EC: u'Welding Technology Corporation', 0x0018ED: u'ACCUTECH INTERNATIONAL CO., LTD.', 0x0018EE: u'Videology Imaging Solutions, Inc.', 0x0018EF: u'Escape Communications, Inc.', 0x0018F0: u'JOYTOTO Co., Ltd.', 0x0018F1: u'Chunichi Denshi Co.,LTD.', 0x0018F2: u'Beijing Tianyu Communication Equipment Co., Ltd', 0x0018F3: u'ASUSTek COMPUTER INC.', 0x0018F4: u'EO TECHNICS Co., Ltd.', 0x0018F5: u'Shenzhen Streaming Video Technology Company Limited', 0x0018F6: u'Thomson Telecom Belgium', 0x0018F7: u'Kameleon Technologies', 0x0018F8: u'Cisco-Linksys LLC', 0x0018F9: u'VVOND, Inc.', 0x0018FA: u'Yushin Precision Equipment Co.,Ltd.', 0x0018FB: u'Compro Technology', 0x0018FC: u'Altec Electronic AG', 0x0018FD: u'Optimal Technologies International Inc.', 0x0018FE: u'Hewlett Packard', 0x0018FF: u'PowerQuattro Co.', 0x001900: u'Intelliverese - DBA Voicecom', 0x001901: u'F1MEDIA', 0x001902: u'Cambridge Consultants Ltd', 0x001903: u'Bigfoot Networks Inc', 0x001904: u'WB Electronics Sp. z o.o.', 0x001905: u'SCHRACK Seconet AG', 0x001906: u'Cisco Systems', 0x001907: u'Cisco Systems', 0x001908: u'Duaxes Corporation', 0x001909: u'Devi A/S', 0x00190A: u'HASWARE INC.', 0x00190B: u'Southern Vision Systems, Inc.', 0x00190C: u'Encore Electronics, Inc.', 0x00190D: u'IEEE 1394c', 0x00190E: u'Atech Technology Co., Ltd.', 0x00190F: u'Advansus Corp.', 0x001910: u'Knick Elektronische Messgeraete GmbH & Co. KG', 0x001911: u'Just In Mobile Information Technologies (Shanghai) Co., Ltd.', 0x001912: u'Welcat Inc', 0x001913: u'Chuang-Yi Network Equipment Co.Ltd.', 0x001914: u'Winix Co., Ltd', 0x001915: u'TECOM Co., Ltd.', 0x001916: u'PayTec AG', 0x001917: u'Posiflex Inc.', 0x001918: u'Interactive Wear AG', 0x001919: u'ASTEL Inc.', 0x00191A: u'IRLINK', 0x00191B: u'Sputnik Engineering AG', 0x00191C: u'Sensicast Systems', 0x00191D: u'Nintendo Co.,Ltd.', 0x00191E: u'Beyondwiz Co., Ltd.', 0x00191F: u'Microlink communications Inc.', 0x001920: u'KUME electric Co.,Ltd.', 0x001921: u'Elitegroup Computer System Co.', 0x001922: u'CM Comandos Lineares', 0x001923: u'Phonex Korea Co., LTD.', 0x001924: u'LBNL Engineering', 0x001925: u'Intelicis Corporation', 0x001926: u'BitsGen Co., Ltd.', 0x001927: u'ImCoSys Ltd', 0x001928: u'Siemens AG, Transportation Systems', 0x001929: u'2M2B Montadora de Maquinas Bahia Brasil LTDA', 0x00192A: u'Antiope Associates', 0x00192B: u'Hexagram, Inc.', 0x00192C: u'Motorola Mobile Devices', 0x00192D: u'Nokia Corporation', 0x00192E: u'Spectral Instruments, Inc.', 0x00192F: u'Cisco Systems', 0x001930: u'Cisco Systems', 0x001931: u'Balluff GmbH', 0x001932: u'Gude Analog- und Digialsysteme GmbH', 0x001933: u'Strix Systems, Inc.', 0x001934: u'TRENDON TOUCH TECHNOLOGY CORP.', 0x001935: u'Duerr Dental GmbH & Co. KG', 0x001936: u'STERLITE OPTICAL TECHNOLOGIES LIMITED', 0x001937: u'CommerceGuard AB', 0x001938: u'UMB Communications Co., Ltd.', 0x001939: u'Gigamips', 0x00193A: u'OESOLUTIONS', 0x00193B: u'Deliberant LLC', 0x00193C: u'HighPoint Technologies Incorporated', 0x00193D: u'GMC Guardian Mobility Corp.', 0x00193E: u'PIRELLI BROADBAND SOLUTIONS', 0x00193F: u'RDI technology(Shenzhen) Co.,LTD', 0x001940: u'Rackable Systems', 0x001941: u'Pitney Bowes, Inc', 0x001942: u'ON SOFTWARE INTERNATIONAL LIMITED', 0x001943: u'Belden', 0x001944: u'Fossil Partners, L.P.', 0x001945: u'Ten-Tec Inc.', 0x001946: u'Cianet Industria e Comercio S/A', 0x001947: u'Scientific Atlanta, A Cisco Company', 0x001948: u'AireSpider Networks', 0x001949: u'TENTEL COMTECH CO., LTD.', 0x00194A: u'TESTO AG', 0x00194B: u'SAGEM COMMUNICATION', 0x00194C: u'Fujian Stelcom information & Technology CO.,Ltd', 0x00194D: u'Avago Technologies Sdn Bhd', 0x00194E: u'Ultra Electronics - TCS (Tactical Communication Systems)', 0x00194F: u'Nokia Danmark A/S', 0x001950: u'Harman Multimedia', 0x001951: u'NETCONS, s.r.o.', 0x001952: u'ACOGITO Co., Ltd', 0x001953: u'Chainleader Communications Corp.', 0x001954: u'Leaf Corporation.', 0x001955: u'Cisco Systems', 0x001956: u'Cisco Systems', 0x001957: u'Saafnet Canada Inc.', 0x001958: u'Bluetooth SIG, Inc.', 0x001959: u'Staccato Communications Inc.', 0x00195A: u'Jenaer Antriebstechnik GmbH', 0x00195B: u'D-Link Corporation', 0x00195C: u'Innotech Corporation', 0x00195D: u'ShenZhen XinHuaTong Opto Electronics Co.,Ltd', 0x00195E: u'Motorola CHS', 0x00195F: u'Valemount Networks Corporation', 0x001960: u'DoCoMo Systems, Inc.', 0x001961: u'Blaupunkt GmbH', 0x001962: u'Commerciant, LP', 0x001963: u'Sony Ericsson Mobile Communications AB', 0x001964: u'Doorking Inc.', 0x001965: u'YuHua TelTech (ShangHai) Co., Ltd.', 0x001966: u'Asiarock Technology Limited', 0x001967: u'TELDAT Sp.J.', 0x001968: u'Digital Video Networks(Shanghai) CO. LTD.', 0x001969: u'Nortel', 0x00196A: u'MikroM GmbH', 0x00196B: u'Danpex Corporation', 0x00196C: u'ETROVISION TECHNOLOGY', 0x00196D: u'Raybit Systems Korea, Inc', 0x00196E: u'Metacom (Pty) Ltd.', 0x00196F: u'SensoPart GmbH', 0x001970: u'Z-Com, Inc.', 0x001971: u'Guangzhou Unicomp Technology Co.,Ltd', 0x001972: u'Plexus (Xiamen) Co.,ltd', 0x001973: u'Zeugma Systems', 0x001974: u'AboCom Systems, Inc.', 0x001975: u'Beijing Huisen networks technology Inc', 0x001976: u'Xipher Technologies, LLC', 0x001977: u'Aerohive Networks, Inc.', 0x001978: u'Datum Systems, Inc.', 0x001979: u'Nokia Danmark A/S', 0x00197A: u'MAZeT GmbH', 0x00197B: u'Picotest Corp.', 0x00197C: u'Riedel Communications GmbH', 0x00197D: u'Hon Hai Precision Ind. Co., Ltd', 0x00197E: u'Hon Hai Precision Ind. Co., Ltd', 0x00197F: u'PLANTRONICS, INC.', 0x001980: u'Gridpoint Systems', 0x001981: u'Vivox Inc', 0x001982: u'SmarDTV', 0x001983: u'CCT R&D Limited', 0x001984: u'ESTIC Corporation', 0x001985: u'IT Watchdogs, Inc', 0x001986: u'Cheng Hongjian', 0x001987: u'Panasonic Mobile Communications Co., Ltd.', 0x001988: u'Wi2Wi, Inc', 0x001989: u'Sonitrol Corporation', 0x00198A: u'Northrop Grumman Systems Corp.', 0x00198B: u'Novera Optics Korea, Inc.', 0x00198C: u'iXSea', 0x00198D: u'Ocean Optics, Inc.', 0x00198E: u'Oticon A/S', 0x00198F: u'Alcatel Bell N.V.', 0x001990: u'ELM DATA Co., Ltd.', 0x001991: u'avinfo', 0x001992: u'Bluesocket, Inc', 0x001993: u'Changshu Switchgear MFG. Co.,Ltd. (Former Changshu Switchgea', 0x001994: u'Jorjin technologies inc.', 0x001995: u'Jurong Hi-Tech (Suzhou)Co.ltd', 0x001996: u'TurboChef Technologies Inc.', 0x001997: u'Soft Device Sdn Bhd', 0x001998: u'SATO CORPORATION', 0x001999: u'Fujitsu Siemens Computers', 0x00199A: u'EDO-EVI', 0x00199B: u'Diversified Technical Systems, Inc.', 0x00199C: u'CTRING', 0x00199D: u'V, Inc.', 0x00199E: u'SHOWADENSHI ELECTRONICS,INC.', 0x00199F: u'DKT A/S', 0x0019A0: u'NIHON DATA SYSTENS, INC.', 0x0019A1: u'LG INFORMATION & COMM.', 0x0019A2: u'ORION TELE-EQUIPMENTS PVT LTD', 0x0019A3: u'asteel electronique atlantique', 0x0019A4: u'Austar Technology (hang zhou) Co.,Ltd', 0x0019A5: u'RadarFind Corporation', 0x0019A6: u'Motorola CHS', 0x0019A7: u'ITU-T', 0x0019A8: u'WiQuest Communications, Inc', 0x0019A9: u'Cisco Systems', 0x0019AA: u'Cisco Systems', 0x0019AB: u'Raycom CO ., LTD', 0x0019AC: u'GSP SYSTEMS Inc.', 0x0019AD: u'BOBST SA', 0x0019AE: u'Hopling Technologies b.v.', 0x0019AF: u'Rigol Technologies, Inc.', 0x0019B0: u'HanYang System', 0x0019B1: u'Arrow7 Corporation', 0x0019B2: u'XYnetsoft Co.,Ltd', 0x0019B3: u'Stanford Research Systems', 0x0019B4: u'VideoCast Ltd.', 0x0019B5: u'Famar Fueguina S.A.', 0x0019B6: u'Euro Emme s.r.l.', 0x0019B7: u'Nokia Danmark A/S', 0x0019B8: u'Boundary Devices', 0x0019B9: u'Dell Inc.', 0x0019BA: u'Paradox Security Systems Ltd', 0x0019BB: u'Hewlett Packard', 0x0019BC: u'ELECTRO CHANCE SRL', 0x0019BD: u'New Media Life', 0x0019BE: u'Altai Technologies Limited', 0x0019BF: u'Citiway technology Co.,ltd', 0x0019C0: u'Motorola Mobile Devices', 0x0019C1: u'Alps Electric Co., Ltd', 0x0019C2: u'Equustek Solutions, Inc.', 0x0019C3: u'Qualitrol', 0x0019C4: u'Infocrypt Inc.', 0x0019C5: u'SONY Computer Entertainment inc,', 0x0019C6: u'ZTE Corporation', 0x0019C7: u'Cambridge Industries(Group) Co.,Ltd.', 0x0019C8: u'AnyDATA Corporation', 0x0019C9: u'S&C ELECTRIC COMPANY', 0x0019CA: u'Broadata Communications, Inc', 0x0019CB: u'ZyXEL Communications Corporation', 0x0019CC: u'RCG (HK) Ltd', 0x0019CD: u'Chengdu ethercom information technology Ltd.', 0x0019CE: u'Progressive Gaming International', 0x0019CF: u'SALICRU, S.A.', 0x0019D0: u'Cathexis', 0x0019D1: u'Intel Corporation', 0x0019D2: u'Intel Corporation', 0x0019D3: u'TRAK Microwave', 0x0019D4: u'ICX Technologies', 0x0019D5: u'IP Innovations, Inc.', 0x0019D6: u'LS Cable Ltd.', 0x0019D7: u'FORTUNETEK CO., LTD', 0x0019D8: u'MAXFOR', 0x0019D9: u'Zeutschel GmbH', 0x0019DA: u'Welltrans O&E Technology Co. , Ltd.', 0x0019DB: u'MICRO-STAR INTERNATIONAL CO., LTD.', 0x0019DC: u'ENENSYS Technologies', 0x0019DD: u'FEI-Zyfer, Inc.', 0x0019DE: u'MOBITEK', 0x0019DF: u'THOMSON APDG', 0x0019E0: u'TP-LINK Technologies Co., Ltd.', 0x0019E1: u'Nortel', 0x0019E2: u'Juniper Networks', 0x0019E3: u'Apple Computers', 0x0019E4: u'2Wire, Inc', 0x0019E5: u'Lynx Studio Technology, Inc.', 0x0019E6: u'TOYO MEDIC CO.,LTD.', 0x0019E7: u'Cisco Systems', 0x0019E8: u'Cisco Systems', 0x0019E9: u'S-Information Technolgy, Co., Ltd.', 0x0019EA: u'TeraMage Technologies Co., Ltd.', 0x0019EB: u'Pyronix Ltd', 0x0019EC: u'Sagamore Systems, Inc.', 0x0019ED: u'Axesstel Inc.', 0x0019EE: u'CARLO GAVAZZI CONTROLS SPA-Controls Division', 0x0019EF: u'SHENZHEN LINNKING ELECTRONICS CO.,LTD', 0x0019F0: u'UNIONMAN TECHNOLOGY CO.,LTD', 0x0019F1: u'Star Communication Network Technology Co.,Ltd', 0x0019F2: u'Teradyne K.K.', 0x0019F3: u'Telematrix, Inc', 0x0019F4: u'Convergens Oy Ltd', 0x0019F5: u'Imagination Technologies Ltd', 0x0019F6: u'Acconet (PTE) Ltd', 0x0019F7: u'Onset Computer Corporation', 0x0019F8: u'Embedded Systems Design, Inc.', 0x0019F9: u'Lambda', 0x0019FA: u'Cable Vision Electronics CO., LTD.', 0x0019FB: u'AMSTRAD PLC', 0x0019FC: u'PT. Ufoakses Sukses Luarbiasa', 0x0019FD: u'Nintendo Co., Ltd.', 0x0019FE: u'SHENZHEN SEECOMM TECHNOLOGY CO.,LTD.', 0x0019FF: u'Finnzymes', 0x001A00: u'MATRIX INC.', 0x001A01: u'Smiths Medical', 0x001A02: u'SECURE CARE PRODUCTS, INC', 0x001A03: u'Angel Electronics Co., Ltd.', 0x001A04: u'Interay Solutions BV', 0x001A05: u'OPTIBASE LTD', 0x001A06: u'OpVista, Inc.', 0x001A07: u'Arecont Vision', 0x001A08: u'Dalman Technical Services', 0x001A09: u'Wayfarer Transit Systems Ltd', 0x001A0A: u'Adaptive Micro-Ware Inc.', 0x001A0B: u'BONA TECHNOLOGY INC.', 0x001A0C: u'Swe-Dish Satellite Systems AB', 0x001A0D: u'HandHeld entertainment, Inc.', 0x001A0E: u'Cheng Uei Precision Industry Co.,Ltd', 0x001A0F: u'Sistemas Avanzados de Control, S.A.', 0x001A10: u'LUCENT TRANS ELECTRONICS CO.,LTD', 0x001A11: u'Google Inc.', 0x001A12: u'PRIVATE', 0x001A13: u'Wanlida Group Co., LTD', 0x001A14: u'Xin Hua Control Engineering Co.,Ltd.', 0x001A15: u'gemalto e-Payment', 0x001A16: u'Nokia Danmark A/S', 0x001A17: u'Teak Technologies, Inc.', 0x001A18: u'Advanced Simulation Technology inc.', 0x001A19: u'Computer Engineering Limited', 0x001A1A: u'Gentex Corporation/Electro-Acoustic Products', 0x001A1B: u'Motorola Mobile Devices', 0x001A1C: u'GT&T Engineering Pte Ltd', 0x001A1D: u'PChome Online Inc.', 0x001A1E: u'Aruba Networks', 0x001A1F: u'Coastal Environmental Systems', 0x001A20: u'CMOTECH Co. Ltd.', 0x001A21: u'Indac B.V.', 0x001A22: u'eq-3 GmbH', 0x001A23: u'Ice Qube, Inc', 0x001A24: u'Galaxy Telecom Technologies Ltd', 0x001A25: u'DELTA DORE', 0x001A26: u'Deltanode Solutions AB', 0x001A27: u'Ubistar', 0x001A28: u'ASWT Co., LTD. Taiwan Branch H.K.', 0x001A29: u'Techsonic Industries d/b/a Humminbird', 0x001A2A: u'Arcadyan Technology Corporation', 0x001A2B: u'Ayecom Technology Co., Ltd.', 0x001A2C: u'SATEC Co.,LTD', 0x001A2D: u'The Navvo Group', 0x001A2E: u'Ziova Coporation', 0x001A2F: u'Cisco Systems', 0x001A30: u'Cisco Systems', 0x001A31: u'SCAN COIN Industries AB', 0x001A32: u'ACTIVA MULTIMEDIA', 0x001A33: u'ASI Communications, Inc.', 0x001A34: u'Konka Group Co., Ltd.', 0x001A35: u'BARTEC GmbH', 0x001A36: u'Actimon GmbH & Co. KG', 0x001A37: u'Lear Corporation', 0x001A38: u'SCI Technology', 0x001A39: u'Merten GmbH&CoKG', 0x001A3A: u'Dongahelecomm', 0x001A3B: u'Doah Elecom Inc.', 0x001A3C: u'Technowave Ltd.', 0x001A3D: u'Ajin Vision Co.,Ltd', 0x001A3E: u'Faster Technology LLC', 0x001A3F: u'intelbras', 0x001A40: u'A-FOUR TECH CO., LTD.', 0x001A41: u'INOCOVA Co.,Ltd', 0x001A42: u'Techcity Technology co., Ltd.', 0x001A43: u'Logical Link Communications', 0x001A44: u'JWTrading Co., Ltd', 0x001A45: u'GN Netcom as', 0x001A46: u'Digital Multimedia Technology Co., Ltd', 0x001A47: u'Agami Systems, Inc.', 0x001A48: u'Takacom Corporation', 0x001A49: u'Micro Vision Co.,LTD', 0x001A4A: u'Qumranet Inc.', 0x001A4B: u'Hewlett Packard', 0x001A4C: u'Crossbow Technology, Inc', 0x001A4D: u'GIGABYTE TECHNOLOGY CO.,LTD.', 0x001A4E: u'NTI AG / LinMot', 0x001A4F: u'AVM GmbH', 0x001A50: u'PheeNet Technology Corp.', 0x001A51: u'Alfred Mann Foundation', 0x001A52: u'Meshlinx Wireless Inc.', 0x001A53: u'Zylaya', 0x001A54: u'Hip Shing Electronics Ltd.', 0x001A55: u'ACA-Digital Corporation', 0x001A56: u'ViewTel Co,. Ltd.', 0x001A57: u'Matrix Design Group, LLC', 0x001A58: u'Celectronic GmbH', 0x001A59: u'Ircona', 0x001A5A: u'Korea Electric Power Data Network (KDN) Co., Ltd', 0x001A5B: u'NetCare Service Co., Ltd.', 0x001A5C: u'Euchner GmbH+Co. KG', 0x001A5D: u'Mobinnova Corp.', 0x001A5E: u'Thincom Technology Co.,Ltd', 0x001A5F: u'KitWorks.fi Ltd.', 0x001A60: u'Wave Electronics Co.,Ltd.', 0x001A61: u'PacStar Corp.', 0x001A62: u'trusted data', 0x001A63: u'Elster Electricity, LLC', 0x001A64: u'IBM Corp.', 0x001A65: u'Seluxit', 0x001A66: u'Motorola CHS', 0x001A67: u'Infinite QL Sdn Bhd', 0x001A68: u'Weltec Enterprise Co., Ltd.', 0x001A69: u'Wuhan Yangtze Optical Technology CO.,Ltd.', 0x001A6A: u'Tranzas, Inc.', 0x001A6B: u'USI', 0x001A6C: u'Cisco Systems', 0x001A6D: u'Cisco Systems', 0x001A6E: u'Impro Technologies', 0x001A6F: u'MI.TEL s.r.l.', 0x001A70: u'Cisco-Linksys, LLC', 0x001A71: u'Diostech Co., Ltd.', 0x001A72: u'Mosart Semiconductor Corp.', 0x001A73: u'Gemtek Technology Co., Ltd.', 0x001A74: u'Procare International Co', 0x001A75: u'Sony Ericsson Mobile Communications', 0x001A76: u'SDT information Technology Co.,LTD.', 0x001A77: u'Motorola Mobile Devices', 0x001A78: u'ubtos', 0x001A79: u'TELECOMUNICATION TECHNOLOGIES LTD.', 0x001A7A: u'Lismore Instruments Limited', 0x001A7B: u'Teleco, Inc.', 0x001A7C: u'Hirschmann Automation and Control B.V.', 0x001A7D: u'cyber-blue(HK)Ltd', 0x001A7E: u'LN Srithai Comm Ltd.', 0x001A7F: u'GCI Science&Technology Co.,Ltd.', 0x001A80: u'Sony Corporation', 0x001A81: u'Zelax', 0x001A82: u'PROBA Building Automation Co.,LTD', 0x001A83: u'Pegasus Technologies Inc.', 0x001A84: u'V One Multimedia Pte Ltd', 0x001A85: u'NV Michel Van de Wiele', 0x001A86: u'AdvancedIO Systems Inc', 0x001A87: u'Canhold International Limited', 0x001A88: u'Venergy,Co,Ltd', 0x001A89: u'Nokia Danmark A/S', 0x001A8A: u'Samsung Electronics Co., Ltd.', 0x001A8B: u'CHUNIL ELECTRIC IND., CO.', 0x001A8C: u'Astaro AG', 0x001A8D: u'AVECS Bergen GmbH', 0x001A8E: u'3Way Networks Ltd', 0x001A8F: u'Nortel', 0x001A90: u'Trópico Sistemas e Telecomunicações da Amazônia LTDA.', 0x001A91: u'FusionDynamic Ltd.', 0x001A92: u'ASUSTek COMPUTER INC.', 0x001A93: u'ERCO Leuchten GmbH', 0x001A94: u'Votronic GmbH', 0x001A95: u'Hisense Mobile Communications Technoligy Co.,Ltd.', 0x001A96: u'ECLER S.A.', 0x001A97: u'fitivision technology Inc.', 0x001A98: u'Asotel Communication Limited Taiwan Branch', 0x001A99: u'Smarty (HZ) Information Electronics Co., Ltd', 0x001A9A: u'Skyworth Digital technology(shenzhen)co.ltd.', 0x001A9B: u'ADEC & Parter AG', 0x001A9C: u'RightHand Technologies, Inc.', 0x001A9D: u'Skipper Wireless, Inc.', 0x001A9E: u'ICON Digital International Limited', 0x001A9F: u'A-Link Europe Ltd', 0x001AA0: u'Dell Inc', 0x001AA1: u'Cisco Systems', 0x001AA2: u'Cisco Systems', 0x001AA3: u'DELORME', 0x001AA4: u'Future University-Hakodate', 0x001AA5: u'BRN Phoenix', 0x001AA6: u'Telefunken Radio Communication Systems GmbH &CO.KG', 0x001AA7: u'Torian Wireless', 0x001AA8: u'Mamiya Digital Imaging Co., Ltd.', 0x001AA9: u'FUJIAN STAR-NET COMMUNICATION CO.,LTD', 0x001AAA: u'Analogic Corp.', 0x001AAB: u'eWings s.r.l.', 0x001AAC: u'Corelatus AB', 0x001AAD: u'Motorola CHS', 0x001AAE: u'Savant Systems LLC', 0x001AAF: u'BLUSENS TECHNOLOGY', 0x001AB0: u'Signal Networks Pvt. Ltd.,', 0x001AB1: u'Asia Pacific Satellite Industries Co., Ltd.', 0x001AB2: u'Cyber Solutions Inc.', 0x001AB3: u'VISIONITE INC.', 0x001AB4: u'FFEI Ltd.', 0x001AB5: u'Home Network System', 0x001AB6: u'Luminary Micro Inc', 0x001AB7: u'Ethos Networks LTD.', 0x001AB8: u'Anseri Corporation', 0x001AB9: u'PMC', 0x001ABA: u'Caton Overseas Limited', 0x001ABB: u'Fontal Technology Incorporation', 0x001ABC: u'U4EA Technologies Ltd', 0x001ABD: u'Impatica Inc.', 0x001ABE: u'COMPUTER HI-TECH INC.', 0x001ABF: u'TRUMPF Laser Marking Systems AG', 0x001AC0: u'JOYBIEN TECHNOLOGIES CO., LTD.', 0x001AC1: u'3COM EUROPE', 0x001AC2: u'YEC Co.,Ltd.', 0x001AC3: u'Scientific-Atlanta, Inc', 0x001AC4: u'2Wire, Inc', 0x001AC5: u'BreakingPoint Systems, Inc.', 0x001AC6: u'Micro Control Designs', 0x001AC7: u'UNIPOINT', 0x001AC8: u'ISL (Instrumentation Scientifique de Laboratoire)', 0x001AC9: u'SUZUKEN CO.,LTD', 0x001ACA: u'Tilera Corporation', 0x001ACB: u'Autocom Products Ltd', 0x001ACC: u'Celestial Semiconductor, Ltd', 0x001ACD: u'Tidel Engineering LP', 0x001ACE: u'YUPITERU INDUSTRIES CO., LTD.', 0x001ACF: u'C.T. ELETTRONICA', 0x001AD0: u'Siemens Schweiz AG', 0x001AD1: u'FARGO CO., LTD.', 0x001AD2: u'Eletronica Nitron Ltda', 0x001AD3: u'Vamp Ltd.', 0x001AD4: u'iPOX Technology Co., Ltd.', 0x001AD5: u'KMC CHAIN INDUSTRIAL CO., LTD.', 0x001AD6: u'JIAGNSU AETNA ELECTRIC CO.,LTD', 0x001AD7: u'Christie Digital Systems, Inc.', 0x001AD8: u'AlsterAero GmbH', 0x001AD9: u'International Broadband Electric Communications, Inc.', 0x001ADA: u'Biz-2-Me Inc.', 0x001ADB: u'Motorola Mobile Devices', 0x001ADC: u'Nokia Danmark A/S', 0x001ADD: u'PePWave Ltd', 0x001ADE: u'Motorola CHS', 0x001ADF: u'Interactivetv Pty Limited', 0x001AE0: u'Mythology Tech Express Inc.', 0x001AE1: u'EDGE ACCESS INC', 0x001AE2: u'Cisco Systems', 0x001AE3: u'Cisco Systems', 0x001AE4: u'Liposonix Inc,', 0x001AE5: u'Mvox Technologies Inc.', 0x001AE6: u'Atlanta Advanced Communications Holdings Limited', 0x001AE7: u'Aztek Networks, Inc.', 0x001AE8: u'Siemens Enterprise Communications GmbH & Co. KG', 0x001AE9: u'Nintendo Co., Ltd.', 0x001AEA: u'Radio Terminal Systems Pty Ltd', 0x001AEB: u'Allied Telesis K.K.', 0x001AEC: u'Keumbee Electronics Co.,Ltd.', 0x001AED: u'INCOTEC GmbH', 0x001AEE: u'Shenztech Ltd', 0x001AEF: u'Loopcomm Technology, Inc.', 0x001AF0: u'Alcatel - IPD', 0x001AF1: u'Embedded Artists AB', 0x001AF2: u'Dynavisions GmbH', 0x001AF3: u'Samyoung Electronics', 0x001AF4: u'Handreamnet', 0x001AF5: u'PENTAONE. CO., LTD.', 0x001AF6: u'Woven Systems, Inc.', 0x001AF7: u'dataschalt e+a GmbH', 0x001AF8: u'Copley Controls Corporation', 0x001AF9: u'AeroVIronment (AV Inc)', 0x001AFA: u'Welch Allyn, Inc.', 0x001AFB: u'Joby Inc.', 0x001AFC: u'ModusLink Corporation', 0x001AFD: u'EVOLIS', 0x001AFE: u'SOFACREAL', 0x001AFF: u'Wizyoung Tech.', 0x001B00: u'Neopost Technologies', 0x001B01: u'Applied Radio Technologies', 0x001B02: u'ED Co.Ltd', 0x001B03: u'Action Technology (SZ) Co., Ltd', 0x001B04: u'Affinity International S.p.a', 0x001B05: u'Young Media Concepts GmbH', 0x001B06: u'Ateliers R. LAUMONIER', 0x001B07: u'Mendocino Software', 0x001B08: u'Danfoss Drives A/S', 0x001B09: u'Matrix Telecom Pvt. Ltd.', 0x001B0A: u'Intelligent Distributed Controls Ltd', 0x001B0B: u'Phidgets Inc.', 0x001B0C: u'Cisco Systems', 0x001B0D: u'Cisco Systems', 0x001B0E: u'InoTec GmbH Organisationssysteme', 0x001B0F: u'Petratec', 0x001B10: u'ShenZhen Kang Hui Technology Co.,ltd', 0x001B11: u'D-Link Corporation', 0x001B12: u'Apprion', 0x001B13: u'Icron Technologies Corporation', 0x001B14: u'Carex Lighting Equipment Factory', 0x001B15: u'Voxtel, Inc.', 0x001B16: u'Celtro Ltd.', 0x001B17: u'Palo Alto Networks', 0x001B18: u'Tsuken Electric Ind. Co.,Ltd', 0x001B19: u'IEEE 1588 Standard', 0x001B1A: u'e-trees Japan, Inc.', 0x001B1B: u'Siemens AG, A&D AS EWK PU1', 0x001B1C: u'Coherent', 0x001B1D: u'Phoenix International Co., Ltd', 0x001B1E: u'HART Communication Foundation', 0x001B1F: u'DELTA - Danish Electronics, Light & Acoustics', 0x001B20: u'TPine Technology', 0x001B21: u'Intel Corporate', 0x001B22: u'Palit Microsystems ( H.K.) Ltd.', 0x001B23: u'SimpleComTools', 0x001B24: u'Quanta Computer Inc.', 0x001B25: u'Nortel', 0x001B26: u'RON-Telecom ZAO', 0x001B27: u'Merlin CSI', 0x001B28: u'POLYGON, JSC', 0x001B29: u'Avantis.Co.,Ltd', 0x001B2A: u'Cisco Systems', 0x001B2B: u'Cisco Systems', 0x001B2C: u'ATRON electronic GmbH', 0x001B2D: u'PRIVATE', 0x001B2E: u'Sinkyo Electron Inc', 0x001B2F: u'NETGEAR Inc.', 0x001B30: u'Solitech Inc.', 0x001B31: u'Neural Image. Co. Ltd.', 0x001B32: u'QLogic Corporation', 0x001B33: u'Nokia Danmark A/S', 0x001B34: u'Focus System Inc.', 0x001B35: u'ChongQing JINOU Science & Technology Development CO.,Ltd', 0x001B36: u'Tsubata Engineering Co.,Ltd. (Head Office)', 0x001B37: u'Computec Oy', 0x001B38: u'COMPAL ELECTRONICS TECHNOLOGIC CO., LTD.', 0x001B39: u'Proxicast', 0x001B3A: u'SIMS Corp.', 0x001B3B: u'Yi-Qing CO., LTD', 0x001B3C: u'Software Technologies Group,Inc.', 0x001B3D: u'EuroTel Spa', 0x001B3E: u'Curtis, Inc.', 0x001B3F: u'ProCurve Networking by HP', 0x001B40: u'Network Automation mxc AB', 0x001B41: u'General Infinity Co.,Ltd.', 0x001B42: u'Wise & Blue', 0x001B43: u'Beijing DG Telecommunications equipment Co.,Ltd', 0x001B44: u'SanDisk Corporation', 0x001B45: u'ABB AS, Division Automation Products', 0x001B46: u'Blueone Technology Co.,Ltd', 0x001B47: u'Futarque A/S', 0x001B48: u'Shenzhen Lantech Electronics Co., Ltd.', 0x001B49: u'Roberts Radio limited', 0x001B4A: u'W&W Communications, Inc.', 0x001B4B: u'SANION Co., Ltd.', 0x001B4C: u'Signtech', 0x001B4D: u'Areca Technology Corporation', 0x001B4E: u'Navman New Zealand', 0x001B4F: u'Avaya Inc.', 0x001B50: u'Nizhny Novgorod Factory named after M.Frunze, FSUE (NZiF)', 0x001B51: u'Vector Technology Corp.', 0x001B52: u'Motorola Mobile Devices', 0x001B53: u'Cisco Systems', 0x001B54: u'Cisco Systems', 0x001B55: u'Hurco Automation Ltd.', 0x001B56: u'Tehuti Networks Ltd.', 0x001B57: u'SEMINDIA SYSTEMS PRIVATE LIMITED', 0x001B58: u'PRIVATE', 0x001B59: u'Sony Ericsson Mobile Communications AB', 0x001B5A: u'Apollo Imaging Technologies, Inc.', 0x001B5B: u'2Wire, Inc.', 0x001B5C: u'Azuretec Co., Ltd.', 0x001B5D: u'Vololink Pty Ltd', 0x001B5E: u'BPL Limited', 0x001B5F: u'Alien Technology', 0x001B60: u'NAVIGON AG', 0x001B61: u'Digital Acoustics, LLC', 0x001B62: u'JHT Optoelectronics Co.,Ltd.', 0x001B63: u'Apple Inc.', 0x001B64: u'IsaacLandKorea', 0x001B65: u'China Gridcom Co., Ltd', 0x001B66: u'Sennheiser electronic GmbH & Co. KG', 0x001B67: u'Ubiquisys Ltd', 0x001B68: u'Modnnet Co., Ltd', 0x001B69: u'Equaline Corporation', 0x001B6A: u'Powerwave UK Ltd', 0x001B6B: u'Swyx Solutions AG', 0x001B6C: u'LookX Digital Media BV', 0x001B6D: u'Midtronics, Inc.', 0x001B6E: u'Anue Systems, Inc.', 0x001B6F: u'Teletrak Ltd', 0x001B70: u'IRI Ubiteq, INC.', 0x001B71: u'Telular Corp.', 0x001B72: u'Sicep s.p.a.', 0x001B73: u'DTL Broadcast Ltd', 0x001B74: u'MiraLink Corporation', 0x001B75: u'Hypermedia Systems', 0x001B76: u'Ripcode, Inc.', 0x001B77: u'Intel Corporate', 0x001B78: u'Hewlett Packard', 0x001B79: u'FAIVELEY TRANSPORT', 0x001B7A: u'Nintendo Co., Ltd.', 0x001B7B: u'The Tintometer Ltd', 0x001B7C: u'A & R Cambridge', 0x001B7D: u'CXR Anderson Jacobson', 0x001B7E: u'Beckmann GmbH', 0x001B7F: u'TMN Technologies Telecomunicacoes Ltda', 0x001B80: u'LORD Corporation', 0x001B81: u'DATAQ Instruments, Inc.', 0x001B82: u'Taiwan Semiconductor Co., Ltd.', 0x001B83: u'Finsoft Ltd', 0x001B84: u'Scan Engineering Telecom', 0x001B85: u'MAN Diesel A/S', 0x001B86: u'Bosch Access Systems GmbH', 0x001B87: u'Deepsound Tech. Co., Ltd', 0x001B88: u'Divinet Access Technologies Ltd', 0x001B89: u'EMZA Visual Sense Ltd.', 0x001B8A: u'2M Electronic A/S', 0x001B8B: u'NEC AccessTechnica,Ltd.', 0x001B8C: u'JMicron Technology Corp.', 0x001B8D: u'Electronic Computer Systems, Inc.', 0x001B8E: u'Hulu Sweden AB', 0x001B8F: u'Cisco Systems', 0x001B90: u'Cisco Systems', 0x001B91: u'EFKON AG', 0x001B92: u'l-acoustics', 0x001B93: u'JC Decaux SA DNT', 0x001B94: u'T.E.M.A. S.p.A.', 0x001B95: u'VIDEO SYSTEMS SRL', 0x001B96: u'Snif Labs, Inc.', 0x001B97: u'Violin Technologies', 0x001B98: u'Samsung Electronics Co., Ltd.', 0x001B99: u'KS System GmbH', 0x001B9A: u'Apollo Fire Detectors Ltd', 0x001B9B: u'Hose-McCann Communications', 0x001B9C: u'SATEL sp. z o.o.', 0x001B9D: u'Novus Security Sp. z o.o.', 0x001B9E: u'ASKEY COMPUTER CORP', 0x001B9F: u'Calyptech Pty Ltd', 0x001BA0: u'Awox', 0x001BA1: u'Åmic AB', 0x001BA2: u'IDS Imaging Development Systems GmbH', 0x001BA3: u'Flexit Group GmbH', 0x001BA4: u'S.A.E Afikim', 0x001BA5: u'MyungMin Systems, Inc.', 0x001BA6: u'intotech inc.', 0x001BA7: u'Lorica Solutions', 0x001BA8: u'UBI&MOBI,.Inc', 0x001BA9: u'BROTHER INDUSTRIES, LTD. Printing & Solutions Company', 0x001BAA: u'XenICs nv', 0x001BAB: u'Telchemy, Incorporated', 0x001BAC: u'Curtiss Wright Controls Embedded Computing', 0x001BAD: u'iControl Incorporated', 0x001BAE: u'Micro Control Systems, Inc', 0x001BAF: u'Nokia Danmark A/S', 0x001BB0: u'BHARAT ELECTRONICS', 0x001BB1: u'Wistron Neweb Corp.', 0x001BB2: u'Intellect International NV', 0x001BB3: u'Condalo GmbH', 0x001BB4: u'Airvod Limited', 0x001BB5: u'Cherry GmbH', 0x001BB6: u'Bird Electronic Corp.', 0x001BB7: u'Alta Heights Technology Corp.', 0x001BB8: u'BLUEWAY ELECTRONIC CO;LTD', 0x001BB9: u'Elitegroup Computer System Co.', 0x001C7C: u'PERQ SYSTEMS CORPORATION', 0x002000: u'LEXMARK INTERNATIONAL, INC.', 0x002001: u'DSP SOLUTIONS, INC.', 0x002002: u'SERITECH ENTERPRISE CO., LTD.', 0x002003: u'PIXEL POWER LTD.', 0x002004: u'YAMATAKE-HONEYWELL CO., LTD.', 0x002005: u'SIMPLE TECHNOLOGY', 0x002006: u'GARRETT COMMUNICATIONS, INC.', 0x002007: u'SFA, INC.', 0x002008: u'CABLE & COMPUTER TECHNOLOGY', 0x002009: u'PACKARD BELL ELEC., INC.', 0x00200A: u'SOURCE-COMM CORP.', 0x00200B: u'OCTAGON SYSTEMS CORP.', 0x00200C: u'ADASTRA SYSTEMS CORP.', 0x00200D: u'CARL ZEISS', 0x00200E: u'SATELLITE TECHNOLOGY MGMT, INC', 0x00200F: u'TANBAC CO., LTD.', 0x002010: u'JEOL SYSTEM TECHNOLOGY CO. LTD', 0x002011: u'CANOPUS CO., LTD.', 0x002012: u'CAMTRONICS MEDICAL SYSTEMS', 0x002013: u'DIVERSIFIED TECHNOLOGY, INC.', 0x002014: u'GLOBAL VIEW CO., LTD.', 0x002015: u'ACTIS COMPUTER SA', 0x002016: u'SHOWA ELECTRIC WIRE & CABLE CO', 0x002017: u'ORBOTECH', 0x002018: u'CIS TECHNOLOGY INC.', 0x002019: u'OHLER GmbH', 0x00201A: u'MRV Communications, Inc.', 0x00201B: u'NORTHERN TELECOM/NETWORK', 0x00201C: u'EXCEL, INC.', 0x00201D: u'KATANA PRODUCTS', 0x00201E: u'NETQUEST CORPORATION', 0x00201F: u'BEST POWER TECHNOLOGY, INC.', 0x002020: u'MEGATRON COMPUTER INDUSTRIES PTY, LTD.', 0x002021: u'ALGORITHMS SOFTWARE PVT. LTD.', 0x002022: u'NMS Communications', 0x002023: u'T.C. TECHNOLOGIES PTY. LTD', 0x002024: u'PACIFIC COMMUNICATION SCIENCES', 0x002025: u'CONTROL TECHNOLOGY, INC.', 0x002026: u'AMKLY SYSTEMS, INC.', 0x002027: u'MING FORTUNE INDUSTRY CO., LTD', 0x002028: u'WEST EGG SYSTEMS, INC.', 0x002029: u'TELEPROCESSING PRODUCTS, INC.', 0x00202A: u'N.V. DZINE', 0x00202B: u'ADVANCED TELECOMMUNICATIONS MODULES, LTD.', 0x00202C: u'WELLTRONIX CO., LTD.', 0x00202D: u'TAIYO CORPORATION', 0x00202E: u'DAYSTAR DIGITAL', 0x00202F: u'ZETA COMMUNICATIONS, LTD.', 0x002030: u'ANALOG & DIGITAL SYSTEMS', 0x002031: u'ERTEC GmbH', 0x002032: u'ALCATEL TAISEL', 0x002033: u'SYNAPSE TECHNOLOGIES, INC.', 0x002034: u'ROTEC INDUSTRIEAUTOMATION GMBH', 0x002035: u'IBM CORPORATION', 0x002036: u'BMC SOFTWARE', 0x002037: u'SEAGATE TECHNOLOGY', 0x002038: u'VME MICROSYSTEMS INTERNATIONAL CORPORATION', 0x002039: u'SCINETS', 0x00203A: u'DIGITAL BI0METRICS INC.', 0x00203B: u'WISDM LTD.', 0x00203C: u'EUROTIME AB', 0x00203D: u'NOVAR ELECTRONICS CORPORATION', 0x00203E: u'LogiCan Technologies, Inc.', 0x00203F: u'JUKI CORPORATION', 0x002040: u'Motorola Broadband Communications Sector', 0x002041: u'DATA NET', 0x002042: u'DATAMETRICS CORP.', 0x002043: u'NEURON COMPANY LIMITED', 0x002044: u'GENITECH PTY LTD', 0x002045: u'ION Networks, Inc.', 0x002046: u'CIPRICO, INC.', 0x002047: u'STEINBRECHER CORP.', 0x002048: u'Marconi Communications', 0x002049: u'COMTRON, INC.', 0x00204A: u'PRONET GMBH', 0x00204B: u'AUTOCOMPUTER CO., LTD.', 0x00204C: u'MITRON COMPUTER PTE LTD.', 0x00204D: u'INOVIS GMBH', 0x00204E: u'NETWORK SECURITY SYSTEMS, INC.', 0x00204F: u'DEUTSCHE AEROSPACE AG', 0x002050: u'KOREA COMPUTER INC.', 0x002051: u'Verilink Corporation', 0x002052: u'RAGULA SYSTEMS', 0x002053: u'HUNTSVILLE MICROSYSTEMS, INC.', 0x002054: u'EASTERN RESEARCH, INC.', 0x002055: u'ALTECH CO., LTD.', 0x002056: u'NEOPRODUCTS', 0x002057: u'TITZE DATENTECHNIK GmbH', 0x002058: u'ALLIED SIGNAL INC.', 0x002059: u'MIRO COMPUTER PRODUCTS AG', 0x00205A: u'COMPUTER IDENTICS', 0x00205B: u'Kentrox, LLC', 0x00205C: u'InterNet Systems of Florida, Inc.', 0x00205D: u'NANOMATIC OY', 0x00205E: u'CASTLE ROCK, INC.', 0x00205F: u'GAMMADATA COMPUTER GMBH', 0x002060: u'ALCATEL ITALIA S.p.A.', 0x002061: u'DYNATECH COMMUNICATIONS, INC.', 0x002062: u'SCORPION LOGIC, LTD.', 0x002063: u'WIPRO INFOTECH LTD.', 0x002064: u'PROTEC MICROSYSTEMS, INC.', 0x002065: u'SUPERNET NETWORKING INC.', 0x002066: u'GENERAL MAGIC, INC.', 0x002067: u'PRIVATE', 0x002068: u'ISDYNE', 0x002069: u'ISDN SYSTEMS CORPORATION', 0x00206A: u'OSAKA COMPUTER CORP.', 0x00206B: u'KONICA MINOLTA HOLDINGS, INC.', 0x00206C: u'EVERGREEN TECHNOLOGY CORP.', 0x00206D: u'DATA RACE, INC.', 0x00206E: u'XACT, INC.', 0x00206F: u'FLOWPOINT CORPORATION', 0x002070: u'HYNET, LTD.', 0x002071: u'IBR GMBH', 0x002072: u'WORKLINK INNOVATIONS', 0x002073: u'FUSION SYSTEMS CORPORATION', 0x002074: u'SUNGWOON SYSTEMS', 0x002075: u'MOTOROLA COMMUNICATION ISRAEL', 0x002076: u'REUDO CORPORATION', 0x002077: u'KARDIOS SYSTEMS CORP.', 0x002078: u'RUNTOP, INC.', 0x002079: u'MIKRON GMBH', 0x00207A: u'WiSE Communications, Inc.', 0x00207B: u'Intel Corporation', 0x00207C: u'AUTEC GmbH', 0x00207D: u'ADVANCED COMPUTER APPLICATIONS', 0x00207E: u'FINECOM Co., Ltd.', 0x00207F: u'KYOEI SANGYO CO., LTD.', 0x002080: u'SYNERGY (UK) LTD.', 0x002081: u'TITAN ELECTRONICS', 0x002082: u'ONEAC CORPORATION', 0x002083: u'PRESTICOM INCORPORATED', 0x002084: u'OCE PRINTING SYSTEMS, GMBH', 0x002085: u'EXIDE ELECTRONICS', 0x002086: u'MICROTECH ELECTRONICS LIMITED', 0x002087: u'MEMOTEC COMMUNICATIONS CORP.', 0x002088: u'GLOBAL VILLAGE COMMUNICATION', 0x002089: u'T3PLUS NETWORKING, INC.', 0x00208A: u'SONIX COMMUNICATIONS, LTD.', 0x00208B: u'LAPIS TECHNOLOGIES, INC.', 0x00208C: u'GALAXY NETWORKS, INC.', 0x00208D: u'CMD TECHNOLOGY', 0x00208E: u'CHEVIN SOFTWARE ENG. LTD.', 0x00208F: u'ECI TELECOM LTD.', 0x002090: u'ADVANCED COMPRESSION TECHNOLOGY, INC.', 0x002091: u'J125, NATIONAL SECURITY AGENCY', 0x002092: u'CHESS ENGINEERING B.V.', 0x002093: u'LANDINGS TECHNOLOGY CORP.', 0x002094: u'CUBIX CORPORATION', 0x002095: u'RIVA ELECTRONICS', 0x002096: u'Invensys', 0x002097: u'APPLIED SIGNAL TECHNOLOGY', 0x002098: u'HECTRONIC AB', 0x002099: u'BON ELECTRIC CO., LTD.', 0x00209A: u'THE 3DO COMPANY', 0x00209B: u'ERSAT ELECTRONIC GMBH', 0x00209C: u'PRIMARY ACCESS CORP.', 0x00209D: u'LIPPERT AUTOMATIONSTECHNIK', 0x00209E: u'BROWN\'S OPERATING SYSTEM SERVICES, LTD.', 0x00209F: u'MERCURY COMPUTER SYSTEMS, INC.', 0x0020A0: u'OA LABORATORY CO., LTD.', 0x0020A1: u'DOVATRON', 0x0020A2: u'GALCOM NETWORKING LTD.', 0x0020A3: u'DIVICOM INC.', 0x0020A4: u'MULTIPOINT NETWORKS', 0x0020A5: u'API ENGINEERING', 0x0020A6: u'PROXIM, INC.', 0x0020A7: u'PAIRGAIN TECHNOLOGIES, INC.', 0x0020A8: u'SAST TECHNOLOGY CORP.', 0x0020A9: u'WHITE HORSE INDUSTRIAL', 0x0020AA: u'DIGIMEDIA VISION LTD.', 0x0020AB: u'MICRO INDUSTRIES CORP.', 0x0020AC: u'INTERFLEX DATENSYSTEME GMBH', 0x0020AD: u'LINQ SYSTEMS', 0x0020AE: u'ORNET DATA COMMUNICATION TECH.', 0x0020AF: u'3COM CORPORATION', 0x0020B0: u'GATEWAY DEVICES, INC.', 0x0020B1: u'COMTECH RESEARCH INC.', 0x0020B2: u'GKD Gesellschaft Fur Kommunikation Und Datentechnik', 0x0020B3: u'SCLTEC COMMUNICATIONS SYSTEMS', 0x0020B4: u'TERMA ELEKTRONIK AS', 0x0020B5: u'YASKAWA ELECTRIC CORPORATION', 0x0020B6: u'AGILE NETWORKS, INC.', 0x0020B7: u'NAMAQUA COMPUTERWARE', 0x0020B8: u'PRIME OPTION, INC.', 0x0020B9: u'METRICOM, INC.', 0x0020BA: u'CENTER FOR HIGH PERFORMANCE', 0x0020BB: u'ZAX CORPORATION', 0x0020BC: u'Long Reach Networks Pty Ltd', 0x0020BD: u'NIOBRARA R & D CORPORATION', 0x0020BE: u'LAN ACCESS CORP.', 0x0020BF: u'AEHR TEST SYSTEMS', 0x0020C0: u'PULSE ELECTRONICS, INC.', 0x0020C1: u'SAXA, Inc.', 0x0020C2: u'TEXAS MEMORY SYSTEMS, INC.', 0x0020C3: u'COUNTER SOLUTIONS LTD.', 0x0020C4: u'INET,INC.', 0x0020C5: u'EAGLE TECHNOLOGY', 0x0020C6: u'NECTEC', 0x0020C7: u'AKAI Professional M.I. Corp.', 0x0020C8: u'LARSCOM INCORPORATED', 0x0020C9: u'VICTRON BV', 0x0020CA: u'DIGITAL OCEAN', 0x0020CB: u'PRETEC ELECTRONICS CORP.', 0x0020CC: u'DIGITAL SERVICES, LTD.', 0x0020CD: u'HYBRID NETWORKS, INC.', 0x0020CE: u'LOGICAL DESIGN GROUP, INC.', 0x0020CF: u'TEST & MEASUREMENT SYSTEMS INC', 0x0020D0: u'VERSALYNX CORPORATION', 0x0020D1: u'MICROCOMPUTER SYSTEMS (M) SDN.', 0x0020D2: u'RAD DATA COMMUNICATIONS, LTD.', 0x0020D3: u'OST (OUEST STANDARD TELEMATIQU', 0x0020D4: u'CABLETRON - ZEITTNET INC.', 0x0020D5: u'VIPA GMBH', 0x0020D6: u'BREEZECOM', 0x0020D7: u'JAPAN MINICOMPUTER SYSTEMS CO., Ltd.', 0x0020D8: u'Nortel Networks', 0x0020D9: u'PANASONIC TECHNOLOGIES, INC./MIECO-US', 0x0020DA: u'Alcatel North America ESD', 0x0020DB: u'XNET TECHNOLOGY, INC.', 0x0020DC: u'DENSITRON TAIWAN LTD.', 0x0020DD: u'Cybertec Pty Ltd', 0x0020DE: u'JAPAN DIGITAL LABORAT\'Y CO.LTD', 0x0020DF: u'KYOSAN ELECTRIC MFG. CO., LTD.', 0x0020E0: u'Actiontec Electronics, Inc.', 0x0020E1: u'ALAMAR ELECTRONICS', 0x0020E2: u'INFORMATION RESOURCE ENGINEERING', 0x0020E3: u'MCD KENCOM CORPORATION', 0x0020E4: u'HSING TECH ENTERPRISE CO., LTD', 0x0020E5: u'APEX DATA, INC.', 0x0020E6: u'LIDKOPING MACHINE TOOLS AB', 0x0020E7: u'B&W NUCLEAR SERVICE COMPANY', 0x0020E8: u'DATATREK CORPORATION', 0x0020E9: u'DANTEL', 0x0020EA: u'EFFICIENT NETWORKS, INC.', 0x0020EB: u'CINCINNATI MICROWAVE, INC.', 0x0020EC: u'TECHWARE SYSTEMS CORP.', 0x0020ED: u'GIGA-BYTE TECHNOLOGY CO., LTD.', 0x0020EE: u'GTECH CORPORATION', 0x0020EF: u'USC CORPORATION', 0x0020F0: u'UNIVERSAL MICROELECTRONICS CO.', 0x0020F1: u'ALTOS INDIA LIMITED', 0x0020F2: u'SUN MICROSYSTEMS, INC.', 0x0020F3: u'RAYNET CORPORATION', 0x0020F4: u'SPECTRIX CORPORATION', 0x0020F5: u'PANDATEL AG', 0x0020F6: u'NET TEK AND KARLNET, INC.', 0x0020F7: u'CYBERDATA', 0x0020F8: u'CARRERA COMPUTERS, INC.', 0x0020F9: u'PARALINK NETWORKS, INC.', 0x0020FA: u'GDE SYSTEMS, INC.', 0x0020FB: u'OCTEL COMMUNICATIONS CORP.', 0x0020FC: u'MATROX', 0x0020FD: u'ITV TECHNOLOGIES, INC.', 0x0020FE: u'TOPWARE INC. / GRAND COMPUTER', 0x0020FF: u'SYMMETRICAL TECHNOLOGIES', 0x002654: u'3Com Corporation', 0x003000: u'ALLWELL TECHNOLOGY CORP.', 0x003001: u'SMP', 0x003002: u'Expand Networks', 0x003003: u'Phasys Ltd.', 0x003004: u'LEADTEK RESEARCH INC.', 0x003005: u'Fujitsu Siemens Computers', 0x003006: u'SUPERPOWER COMPUTER', 0x003007: u'OPTI, INC.', 0x003008: u'AVIO DIGITAL, INC.', 0x003009: u'Tachion Networks, Inc.', 0x00300A: u'AZTECH SYSTEMS LTD.', 0x00300B: u'mPHASE Technologies, Inc.', 0x00300C: u'CONGRUENCY, LTD.', 0x00300D: u'MMC Technology, Inc.', 0x00300E: u'Klotz Digital AG', 0x00300F: u'IMT - Information Management T', 0x003010: u'VISIONETICS INTERNATIONAL', 0x003011: u'HMS FIELDBUS SYSTEMS AB', 0x003012: u'DIGITAL ENGINEERING LTD.', 0x003013: u'NEC Corporation', 0x003014: u'DIVIO, INC.', 0x003015: u'CP CLARE CORP.', 0x003016: u'ISHIDA CO., LTD.', 0x003017: u'BlueArc UK Ltd', 0x003018: u'Jetway Information Co., Ltd.', 0x003019: u'CISCO SYSTEMS, INC.', 0x00301A: u'SMARTBRIDGES PTE. LTD.', 0x00301B: u'SHUTTLE, INC.', 0x00301C: u'ALTVATER AIRDATA SYSTEMS', 0x00301D: u'SKYSTREAM, INC.', 0x00301E: u'3COM Europe Ltd.', 0x00301F: u'OPTICAL NETWORKS, INC.', 0x003020: u'TSI, Inc..', 0x003021: u'HSING TECH. ENTERPRISE CO.,LTD', 0x003022: u'Fong Kai Industrial Co., Ltd.', 0x003023: u'COGENT COMPUTER SYSTEMS, INC.', 0x003024: u'CISCO SYSTEMS, INC.', 0x003025: u'CHECKOUT COMPUTER SYSTEMS, LTD', 0x003026: u'HeiTel Digital Video GmbH', 0x003027: u'KERBANGO, INC.', 0x003028: u'FASE Saldatura srl', 0x003029: u'OPICOM', 0x00302A: u'SOUTHERN INFORMATION', 0x00302B: u'INALP NETWORKS, INC.', 0x00302C: u'SYLANTRO SYSTEMS CORPORATION', 0x00302D: u'QUANTUM BRIDGE COMMUNICATIONS', 0x00302E: u'Hoft & Wessel AG', 0x00302F: u'Smiths Industries', 0x003030: u'HARMONIX CORPORATION', 0x003031: u'LIGHTWAVE COMMUNICATIONS, INC.', 0x003032: u'MagicRam, Inc.', 0x003033: u'ORIENT TELECOM CO., LTD.', 0x003034: u'SET ENGINEERING', 0x003035: u'Corning Incorporated', 0x003036: u'RMP ELEKTRONIKSYSTEME GMBH', 0x003037: u'Packard Bell Nec Services', 0x003038: u'XCP, INC.', 0x003039: u'SOFTBOOK PRESS', 0x00303A: u'MAATEL', 0x00303B: u'PowerCom Technology', 0x00303C: u'ONNTO CORP.', 0x00303D: u'IVA CORPORATION', 0x00303E: u'Radcom Ltd.', 0x00303F: u'TurboComm Tech Inc.', 0x003040: u'CISCO SYSTEMS, INC.', 0x003041: u'SAEJIN T & M CO., LTD.', 0x003042: u'DeTeWe-Deutsche Telephonwerke', 0x003043: u'IDREAM TECHNOLOGIES, PTE. LTD.', 0x003044: u'Portsmith LLC', 0x003045: u'Village Networks, Inc. (VNI)', 0x003046: u'Controlled Electronic Manageme', 0x003047: u'NISSEI ELECTRIC CO., LTD.', 0x003048: u'Supermicro Computer, Inc.', 0x003049: u'BRYANT TECHNOLOGY, LTD.', 0x00304A: u'Fraunhofer IPMS', 0x00304B: u'ORBACOM SYSTEMS, INC.', 0x00304C: u'APPIAN COMMUNICATIONS, INC.', 0x00304D: u'ESI', 0x00304E: u'BUSTEC PRODUCTION LTD.', 0x00304F: u'PLANET Technology Corporation', 0x003050: u'Versa Technology', 0x003051: u'ORBIT AVIONIC & COMMUNICATION', 0x003052: u'ELASTIC NETWORKS', 0x003053: u'Basler AG', 0x003054: u'CASTLENET TECHNOLOGY, INC.', 0x003055: u'Hitachi Semiconductor America,', 0x003056: u'Beck IPC GmbH', 0x003057: u'QTelNet, Inc.', 0x003058: u'API MOTION', 0x003059: u'DIGITAL-LOGIC AG', 0x00305A: u'TELGEN CORPORATION', 0x00305B: u'MODULE DEPARTMENT', 0x00305C: u'SMAR Laboratories Corp.', 0x00305D: u'DIGITRA SYSTEMS, INC.', 0x00305E: u'Abelko Innovation', 0x00305F: u'IMACON APS', 0x003060: u'Powerfile, Inc.', 0x003061: u'MobyTEL', 0x003062: u'PATH 1 NETWORK TECHNOL\'S INC.', 0x003063: u'SANTERA SYSTEMS, INC.', 0x003064: u'ADLINK TECHNOLOGY, INC.', 0x003065: u'APPLE COMPUTER, INC.', 0x003066: u'DIGITAL WIRELESS CORPORATION', 0x003067: u'BIOSTAR MICROTECH INT\'L CORP.', 0x003068: u'CYBERNETICS TECH. CO., LTD.', 0x003069: u'IMPACCT TECHNOLOGY CORP.', 0x00306A: u'PENTA MEDIA CO., LTD.', 0x00306B: u'CMOS SYSTEMS, INC.', 0x00306C: u'Hitex Holding GmbH', 0x00306D: u'LUCENT TECHNOLOGIES', 0x00306E: u'HEWLETT PACKARD', 0x00306F: u'SEYEON TECH. CO., LTD.', 0x003070: u'1Net Corporation', 0x003071: u'Cisco Systems, Inc.', 0x003072: u'INTELLIBYTE INC.', 0x003073: u'International Microsystems, In', 0x003074: u'EQUIINET LTD.', 0x003075: u'ADTECH', 0x003076: u'Akamba Corporation', 0x003077: u'ONPREM NETWORKS', 0x003078: u'Cisco Systems, Inc.', 0x003079: u'CQOS, INC.', 0x00307A: u'Advanced Technology & Systems', 0x00307B: u'Cisco Systems, Inc.', 0x00307C: u'ADID SA', 0x00307D: u'GRE AMERICA, INC.', 0x00307E: u'Redflex Communication Systems', 0x00307F: u'IRLAN LTD.', 0x003080: u'CISCO SYSTEMS, INC.', 0x003081: u'ALTOS C&C', 0x003082: u'TAIHAN ELECTRIC WIRE CO., LTD.', 0x003083: u'Ivron Systems', 0x003084: u'ALLIED TELESYN INTERNAIONAL', 0x003085: u'CISCO SYSTEMS, INC.', 0x003086: u'Transistor Devices, Inc.', 0x003087: u'VEGA GRIESHABER KG', 0x003088: u'Siara Systems, Inc.', 0x003089: u'Spectrapoint Wireless, LLC', 0x00308A: u'NICOTRA SISTEMI S.P.A', 0x00308B: u'Brix Networks', 0x00308C: u'ADVANCED DIGITAL INFORMATION', 0x00308D: u'PINNACLE SYSTEMS, INC.', 0x00308E: u'CROSS MATCH TECHNOLOGIES, INC.', 0x00308F: u'MICRILOR, Inc.', 0x003090: u'CYRA TECHNOLOGIES, INC.', 0x003091: u'TAIWAN FIRST LINE ELEC. CORP.', 0x003092: u'ModuNORM GmbH', 0x003093: u'SONNET TECHNOLOGIES, INC.', 0x003094: u'Cisco Systems, Inc.', 0x003095: u'Procomp Informatics, Ltd.', 0x003096: u'CISCO SYSTEMS, INC.', 0x003097: u'EXOMATIC AB', 0x003098: u'Global Converging Technologies', 0x003099: u'BOENIG UND KALLENBACH OHG', 0x00309A: u'ASTRO TERRA CORP.', 0x00309B: u'Smartware', 0x00309C: u'Timing Applications, Inc.', 0x00309D: u'Nimble Microsystems, Inc.', 0x00309E: u'WORKBIT CORPORATION.', 0x00309F: u'AMBER NETWORKS', 0x0030A0: u'TYCO SUBMARINE SYSTEMS, LTD.', 0x0030A1: u'WEBGATE Inc.', 0x0030A2: u'Lightner Engineering', 0x0030A3: u'CISCO SYSTEMS, INC.', 0x0030A4: u'Woodwind Communications System', 0x0030A5: u'ACTIVE POWER', 0x0030A6: u'VIANET TECHNOLOGIES, LTD.', 0x0030A7: u'SCHWEITZER ENGINEERING', 0x0030A8: u'OL\'E COMMUNICATIONS, INC.', 0x0030A9: u'Netiverse, Inc.', 0x0030AA: u'AXUS MICROSYSTEMS, INC.', 0x0030AB: u'DELTA NETWORKS, INC.', 0x0030AC: u'Systeme Lauer GmbH & Co., Ltd.', 0x0030AD: u'SHANGHAI COMMUNICATION', 0x0030AE: u'Times N System, Inc.', 0x0030AF: u'Honeywell GmbH', 0x0030B0: u'Convergenet Technologies', 0x0030B1: u'aXess-pro networks GmbH', 0x0030B2: u'L-3 Sonoma EO', 0x0030B3: u'San Valley Systems, Inc.', 0x0030B4: u'INTERSIL CORP.', 0x0030B5: u'Tadiran Microwave Networks', 0x0030B6: u'CISCO SYSTEMS, INC.', 0x0030B7: u'Teletrol Systems, Inc.', 0x0030B8: u'RiverDelta Networks', 0x0030B9: u'ECTEL', 0x0030BA: u'AC&T SYSTEM CO., LTD.', 0x0030BB: u'CacheFlow, Inc.', 0x0030BC: u'Optronic AG', 0x0030BD: u'BELKIN COMPONENTS', 0x0030BE: u'City-Net Technology, Inc.', 0x0030BF: u'MULTIDATA GMBH', 0x0030C0: u'Lara Technology, Inc.', 0x0030C1: u'HEWLETT-PACKARD', 0x0030C2: u'COMONE', 0x0030C3: u'FLUECKIGER ELEKTRONIK AG', 0x0030C4: u'Canon Imaging System Technologies, Inc.', 0x0030C5: u'CADENCE DESIGN SYSTEMS', 0x0030C6: u'CONTROL SOLUTIONS, INC.', 0x0030C7: u'MACROMATE CORP.', 0x0030C8: u'GAD LINE, LTD.', 0x0030C9: u'LuxN, N', 0x0030CA: u'Discovery Com', 0x0030CB: u'OMNI FLOW COMPUTERS, INC.', 0x0030CC: u'Tenor Networks, Inc.', 0x0030CD: u'CONEXANT SYSTEMS, INC.', 0x0030CE: u'Zaffire', 0x0030CF: u'TWO TECHNOLOGIES, INC.', 0x0030D0: u'Tellabs', 0x0030D1: u'INOVA CORPORATION', 0x0030D2: u'WIN TECHNOLOGIES, CO., LTD.', 0x0030D3: u'Agilent Technologies', 0x0030D4: u'AAE Systems, Inc', 0x0030D5: u'DResearch GmbH', 0x0030D6: u'MSC VERTRIEBS GMBH', 0x0030D7: u'Innovative Systems, L.L.C.', 0x0030D8: u'SITEK', 0x0030D9: u'DATACORE SOFTWARE CORP.', 0x0030DA: u'COMTREND CO.', 0x0030DB: u'Mindready Solutions, Inc.', 0x0030DC: u'RIGHTECH CORPORATION', 0x0030DD: u'INDIGITA CORPORATION', 0x0030DE: u'WAGO Kontakttechnik GmbH', 0x0030DF: u'KB/TEL TELECOMUNICACIONES', 0x0030E0: u'OXFORD SEMICONDUCTOR LTD.', 0x0030E1: u'ACROTRON SYSTEMS, INC.', 0x0030E2: u'GARNET SYSTEMS CO., LTD.', 0x0030E3: u'SEDONA NETWORKS CORP.', 0x0030E4: u'CHIYODA SYSTEM RIKEN', 0x0030E5: u'Amper Datos S.A.', 0x0030E6: u'Draeger Medical Systems, Inc.', 0x0030E7: u'CNF MOBILE SOLUTIONS, INC.', 0x0030E8: u'ENSIM CORP.', 0x0030E9: u'GMA COMMUNICATION MANUFACT\'G', 0x0030EA: u'TeraForce Technology Corporation', 0x0030EB: u'TURBONET COMMUNICATIONS, INC.', 0x0030EC: u'BORGARDT', 0x0030ED: u'Expert Magnetics Corp.', 0x0030EE: u'DSG Technology, Inc.', 0x0030EF: u'NEON TECHNOLOGY, INC.', 0x0030F0: u'Uniform Industrial Corp.', 0x0030F1: u'Accton Technology Corp.', 0x0030F2: u'CISCO SYSTEMS, INC.', 0x0030F3: u'At Work Computers', 0x0030F4: u'STARDOT TECHNOLOGIES', 0x0030F5: u'Wild Lab. Ltd.', 0x0030F6: u'SECURELOGIX CORPORATION', 0x0030F7: u'RAMIX INC.', 0x0030F8: u'Dynapro Systems, Inc.', 0x0030F9: u'Sollae Systems Co., Ltd.', 0x0030FA: u'TELICA, INC.', 0x0030FB: u'AZS Technology AG', 0x0030FC: u'Terawave Communications, Inc.', 0x0030FD: u'INTEGRATED SYSTEMS DESIGN', 0x0030FE: u'DSA GmbH', 0x0030FF: u'DATAFAB SYSTEMS, INC.', 0x004000: u'PCI COMPONENTES DA AMZONIA LTD', 0x004001: u'ZYXEL COMMUNICATIONS, INC.', 0x004002: u'PERLE SYSTEMS LIMITED', 0x004003: u'Emerson Process Management Power & Water Solutions, Inc.', 0x004004: u'ICM CO. LTD.', 0x004005: u'ANI COMMUNICATIONS INC.', 0x004006: u'SAMPO TECHNOLOGY CORPORATION', 0x004007: u'TELMAT INFORMATIQUE', 0x004008: u'A PLUS INFO CORPORATION', 0x004009: u'TACHIBANA TECTRON CO., LTD.', 0x00400A: u'PIVOTAL TECHNOLOGIES, INC.', 0x00400B: u'CISCO SYSTEMS, INC.', 0x00400C: u'GENERAL MICRO SYSTEMS, INC.', 0x00400D: u'LANNET DATA COMMUNICATIONS,LTD', 0x00400E: u'MEMOTEC COMMUNICATIONS, INC.', 0x00400F: u'DATACOM TECHNOLOGIES', 0x004010: u'SONIC SYSTEMS, INC.', 0x004011: u'ANDOVER CONTROLS CORPORATION', 0x004012: u'WINDATA, INC.', 0x004013: u'NTT DATA COMM. SYSTEMS CORP.', 0x004014: u'COMSOFT GMBH', 0x004015: u'ASCOM INFRASYS AG', 0x004016: u'HADAX ELECTRONICS, INC.', 0x004017: u'Silex Technology America', 0x004018: u'ADOBE SYSTEMS, INC.', 0x004019: u'AEON SYSTEMS, INC.', 0x00401A: u'FUJI ELECTRIC CO., LTD.', 0x00401B: u'PRINTER SYSTEMS CORP.', 0x00401C: u'AST RESEARCH, INC.', 0x00401D: u'INVISIBLE SOFTWARE, INC.', 0x00401E: u'ICC', 0x00401F: u'COLORGRAPH LTD', 0x004020: u'PINACL COMMUNICATION', 0x004021: u'RASTER GRAPHICS', 0x004022: u'KLEVER COMPUTERS, INC.', 0x004023: u'LOGIC CORPORATION', 0x004024: u'COMPAC INC.', 0x004025: u'MOLECULAR DYNAMICS', 0x004026: u'MELCO, INC.', 0x004027: u'SMC MASSACHUSETTS, INC.', 0x004028: u'NETCOMM LIMITED', 0x004029: u'COMPEX', 0x00402A: u'CANOGA-PERKINS', 0x00402B: u'TRIGEM COMPUTER, INC.', 0x00402C: u'ISIS DISTRIBUTED SYSTEMS, INC.', 0x00402D: u'HARRIS ADACOM CORPORATION', 0x00402E: u'PRECISION SOFTWARE, INC.', 0x00402F: u'XLNT DESIGNS INC.', 0x004030: u'GK COMPUTER', 0x004031: u'KOKUSAI ELECTRIC CO., LTD', 0x004032: u'DIGITAL COMMUNICATIONS', 0x004033: u'ADDTRON TECHNOLOGY CO., LTD.', 0x004034: u'BUSTEK CORPORATION', 0x004035: u'OPCOM', 0x004036: u'TRIBE COMPUTER WORKS, INC.', 0x004037: u'SEA-ILAN, INC.', 0x004038: u'TALENT ELECTRIC INCORPORATED', 0x004039: u'OPTEC DAIICHI DENKO CO., LTD.', 0x00403A: u'IMPACT TECHNOLOGIES', 0x00403B: u'SYNERJET INTERNATIONAL CORP.', 0x00403C: u'FORKS, INC.', 0x00403D: u'TERADATA', 0x00403E: u'RASTER OPS CORPORATION', 0x00403F: u'SSANGYONG COMPUTER SYSTEMS', 0x004040: u'RING ACCESS, INC.', 0x004041: u'FUJIKURA LTD.', 0x004042: u'N.A.T. GMBH', 0x004043: u'NOKIA TELECOMMUNICATIONS', 0x004044: u'QNIX COMPUTER CO., LTD.', 0x004045: u'TWINHEAD CORPORATION', 0x004046: u'UDC RESEARCH LIMITED', 0x004047: u'WIND RIVER SYSTEMS', 0x004048: u'SMD INFORMATICA S.A.', 0x004049: u'TEGIMENTA AG', 0x00404A: u'WEST AUSTRALIAN DEPARTMENT', 0x00404B: u'MAPLE COMPUTER SYSTEMS', 0x00404C: u'HYPERTEC PTY LTD.', 0x00404D: u'TELECOMMUNICATIONS TECHNIQUES', 0x00404E: u'FLUENT, INC.', 0x00404F: u'SPACE & NAVAL WARFARE SYSTEMS', 0x004050: u'IRONICS, INCORPORATED', 0x004051: u'GRACILIS, INC.', 0x004052: u'STAR TECHNOLOGIES, INC.', 0x004053: u'AMPRO COMPUTERS', 0x004054: u'CONNECTION MACHINES SERVICES', 0x004055: u'METRONIX GMBH', 0x004056: u'MCM JAPAN LTD.', 0x004057: u'LOCKHEED - SANDERS', 0x004058: u'KRONOS, INC.', 0x004059: u'YOSHIDA KOGYO K. K.', 0x00405A: u'GOLDSTAR INFORMATION & COMM.', 0x00405B: u'FUNASSET LIMITED', 0x00405C: u'FUTURE SYSTEMS, INC.', 0x00405D: u'STAR-TEK, INC.', 0x00405E: u'NORTH HILLS ISRAEL', 0x00405F: u'AFE COMPUTERS LTD.', 0x004060: u'COMENDEC LTD', 0x004061: u'DATATECH ENTERPRISES CO., LTD.', 0x004062: u'E-SYSTEMS, INC./GARLAND DIV.', 0x004063: u'VIA TECHNOLOGIES, INC.', 0x004064: u'KLA INSTRUMENTS CORPORATION', 0x004065: u'GTE SPACENET', 0x004066: u'HITACHI CABLE, LTD.', 0x004067: u'OMNIBYTE CORPORATION', 0x004068: u'EXTENDED SYSTEMS', 0x004069: u'LEMCOM SYSTEMS, INC.', 0x00406A: u'KENTEK INFORMATION SYSTEMS,INC', 0x00406B: u'SYSGEN', 0x00406C: u'COPERNIQUE', 0x00406D: u'LANCO, INC.', 0x00406E: u'COROLLARY, INC.', 0x00406F: u'SYNC RESEARCH INC.', 0x004070: u'INTERWARE CO., LTD.', 0x004071: u'ATM COMPUTER GMBH', 0x004072: u'Applied Innovation Inc.', 0x004073: u'BASS ASSOCIATES', 0x004074: u'CABLE AND WIRELESS', 0x004075: u'M-TRADE (UK) LTD', 0x004076: u'Sun Conversion Technologies', 0x004077: u'MAXTON TECHNOLOGY CORPORATION', 0x004078: u'WEARNES AUTOMATION PTE LTD', 0x004079: u'JUKO MANUFACTURE COMPANY, LTD.', 0x00407A: u'SOCIETE D\'EXPLOITATION DU CNIT', 0x00407B: u'SCIENTIFIC ATLANTA', 0x00407C: u'QUME CORPORATION', 0x00407D: u'EXTENSION TECHNOLOGY CORP.', 0x00407E: u'EVERGREEN SYSTEMS, INC.', 0x00407F: u'FLIR Systems', 0x004080: u'ATHENIX CORPORATION', 0x004081: u'MANNESMANN SCANGRAPHIC GMBH', 0x004082: u'LABORATORY EQUIPMENT CORP.', 0x004083: u'TDA INDUSTRIA DE PRODUTOS', 0x004084: u'HONEYWELL INC.', 0x004085: u'SAAB INSTRUMENTS AB', 0x004086: u'MICHELS & KLEBERHOFF COMPUTER', 0x004087: u'UBITREX CORPORATION', 0x004088: u'MOBIUS TECHNOLOGIES, INC.', 0x004089: u'MEIDENSHA CORPORATION', 0x00408A: u'TPS TELEPROCESSING SYS. GMBH', 0x00408B: u'RAYLAN CORPORATION', 0x00408C: u'AXIS COMMUNICATIONS AB', 0x00408D: u'THE GOODYEAR TIRE & RUBBER CO.', 0x00408E: u'DIGILOG, INC.', 0x00408F: u'WM-DATA MINFO AB', 0x004090: u'ANSEL COMMUNICATIONS', 0x004091: u'PROCOMP INDUSTRIA ELETRONICA', 0x004092: u'ASP COMPUTER PRODUCTS, INC.', 0x004093: u'PAXDATA NETWORKS LTD.', 0x004094: u'SHOGRAPHICS, INC.', 0x004095: u'R.P.T. INTERGROUPS INT\'L LTD.', 0x004096: u'Cisco Systems, Inc.', 0x004097: u'DATEX DIVISION OF', 0x004098: u'DRESSLER GMBH & CO.', 0x004099: u'NEWGEN SYSTEMS CORP.', 0x00409A: u'NETWORK EXPRESS, INC.', 0x00409B: u'HAL COMPUTER SYSTEMS INC.', 0x00409C: u'TRANSWARE', 0x00409D: u'DIGIBOARD, INC.', 0x00409E: u'CONCURRENT TECHNOLOGIES LTD.', 0x00409F: u'LANCAST/CASAT TECHNOLOGY, INC.', 0x0040A0: u'GOLDSTAR CO., LTD.', 0x0040A1: u'ERGO COMPUTING', 0x0040A2: u'KINGSTAR TECHNOLOGY INC.', 0x0040A3: u'MICROUNITY SYSTEMS ENGINEERING', 0x0040A4: u'ROSE ELECTRONICS', 0x0040A5: u'CLINICOMP INTL.', 0x0040A6: u'Cray, Inc.', 0x0040A7: u'ITAUTEC PHILCO S.A.', 0x0040A8: u'IMF INTERNATIONAL LTD.', 0x0040A9: u'DATACOM INC.', 0x0040AA: u'VALMET AUTOMATION INC.', 0x0040AB: u'ROLAND DG CORPORATION', 0x0040AC: u'SUPER WORKSTATION, INC.', 0x0040AD: u'SMA REGELSYSTEME GMBH', 0x0040AE: u'DELTA CONTROLS, INC.', 0x0040AF: u'DIGITAL PRODUCTS, INC.', 0x0040B0: u'BYTEX CORPORATION, ENGINEERING', 0x0040B1: u'CODONICS INC.', 0x0040B2: u'SYSTEMFORSCHUNG', 0x0040B3: u'PAR MICROSYSTEMS CORPORATION', 0x0040B4: u'NEXTCOM K.K.', 0x0040B5: u'VIDEO TECHNOLOGY COMPUTERS LTD', 0x0040B6: u'COMPUTERM CORPORATION', 0x0040B7: u'STEALTH COMPUTER SYSTEMS', 0x0040B8: u'IDEA ASSOCIATES', 0x0040B9: u'MACQ ELECTRONIQUE SA', 0x0040BA: u'ALLIANT COMPUTER SYSTEMS CORP.', 0x0040BB: u'GOLDSTAR CABLE CO., LTD.', 0x0040BC: u'ALGORITHMICS LTD.', 0x0040BD: u'STARLIGHT NETWORKS, INC.', 0x0040BE: u'BOEING DEFENSE & SPACE', 0x0040BF: u'CHANNEL SYSTEMS INTERN\'L INC.', 0x0040C0: u'VISTA CONTROLS CORPORATION', 0x0040C1: u'BIZERBA-WERKE WILHEIM KRAUT', 0x0040C2: u'APPLIED COMPUTING DEVICES', 0x0040C3: u'FISCHER AND PORTER CO.', 0x0040C4: u'KINKEI SYSTEM CORPORATION', 0x0040C5: u'MICOM COMMUNICATIONS INC.', 0x0040C6: u'FIBERNET RESEARCH, INC.', 0x0040C7: u'RUBY TECH CORPORATION', 0x0040C8: u'MILAN TECHNOLOGY CORPORATION', 0x0040C9: u'NCUBE', 0x0040CA: u'FIRST INTERNAT\'L COMPUTER, INC', 0x0040CB: u'LANWAN TECHNOLOGIES', 0x0040CC: u'SILCOM MANUF\'G TECHNOLOGY INC.', 0x0040CD: u'TERA MICROSYSTEMS, INC.', 0x0040CE: u'NET-SOURCE, INC.', 0x0040CF: u'STRAWBERRY TREE, INC.', 0x0040D0: u'MITAC INTERNATIONAL CORP.', 0x0040D1: u'FUKUDA DENSHI CO., LTD.', 0x0040D2: u'PAGINE CORPORATION', 0x0040D3: u'KIMPSION INTERNATIONAL CORP.', 0x0040D4: u'GAGE TALKER CORP.', 0x0040D5: u'SARTORIUS AG', 0x0040D6: u'LOCAMATION B.V.', 0x0040D7: u'STUDIO GEN INC.', 0x0040D8: u'OCEAN OFFICE AUTOMATION LTD.', 0x0040D9: u'AMERICAN MEGATRENDS INC.', 0x0040DA: u'TELSPEC LTD', 0x0040DB: u'ADVANCED TECHNICAL SOLUTIONS', 0x0040DC: u'TRITEC ELECTRONIC GMBH', 0x0040DD: u'HONG TECHNOLOGIES', 0x0040DE: u'ELETTRONICA SAN GIORGIO', 0x0040DF: u'DIGALOG SYSTEMS, INC.', 0x0040E0: u'ATOMWIDE LTD.', 0x0040E1: u'MARNER INTERNATIONAL, INC.', 0x0040E2: u'MESA RIDGE TECHNOLOGIES, INC.', 0x0040E3: u'QUIN SYSTEMS LTD', 0x0040E4: u'E-M TECHNOLOGY, INC.', 0x0040E5: u'SYBUS CORPORATION', 0x0040E6: u'C.A.E.N.', 0x0040E7: u'ARNOS INSTRUMENTS & COMPUTER', 0x0040E8: u'CHARLES RIVER DATA SYSTEMS,INC', 0x0040E9: u'ACCORD SYSTEMS, INC.', 0x0040EA: u'PLAIN TREE SYSTEMS INC', 0x0040EB: u'MARTIN MARIETTA CORPORATION', 0x0040EC: u'MIKASA SYSTEM ENGINEERING', 0x0040ED: u'NETWORK CONTROLS INT\'NATL INC.', 0x0040EE: u'OPTIMEM', 0x0040EF: u'HYPERCOM, INC.', 0x0040F0: u'MICRO SYSTEMS, INC.', 0x0040F1: u'CHUO ELECTRONICS CO., LTD.', 0x0040F2: u'JANICH & KLASS COMPUTERTECHNIK', 0x0040F3: u'NETCOR', 0x0040F4: u'CAMEO COMMUNICATIONS, INC.', 0x0040F5: u'OEM ENGINES', 0x0040F6: u'KATRON COMPUTERS INC.', 0x0040F7: u'POLAROID MEDICAL IMAGING SYS.', 0x0040F8: u'SYSTEMHAUS DISCOM', 0x0040F9: u'COMBINET', 0x0040FA: u'MICROBOARDS, INC.', 0x0040FB: u'CASCADE COMMUNICATIONS CORP.', 0x0040FC: u'IBR COMPUTER TECHNIK GMBH', 0x0040FD: u'LXE', 0x0040FE: u'SYMPLEX COMMUNICATIONS', 0x0040FF: u'TELEBIT CORPORATION', 0x004252: u'RLX Technologies', 0x004501: u'Versus Technology, Inc.', 0x005000: u'NEXO COMMUNICATIONS, INC.', 0x005001: u'YAMASHITA SYSTEMS CORP.', 0x005002: u'OMNISEC AG', 0x005003: u'GRETAG MACBETH AG', 0x005004: u'3COM CORPORATION', 0x005006: u'TAC AB', 0x005007: u'SIEMENS TELECOMMUNICATION SYSTEMS LIMITED', 0x005008: u'TIVA MICROCOMPUTER CORP. (TMC)', 0x005009: u'PHILIPS BROADBAND NETWORKS', 0x00500A: u'IRIS TECHNOLOGIES, INC.', 0x00500B: u'CISCO SYSTEMS, INC.', 0x00500C: u'e-Tek Labs, Inc.', 0x00500D: u'SATORI ELECTORIC CO., LTD.', 0x00500E: u'CHROMATIS NETWORKS, INC.', 0x00500F: u'CISCO SYSTEMS, INC.', 0x005010: u'NovaNET Learning, Inc.', 0x005012: u'CBL - GMBH', 0x005013: u'Chaparral Network Storage', 0x005014: u'CISCO SYSTEMS, INC.', 0x005015: u'BRIGHT STAR ENGINEERING', 0x005016: u'SST/WOODHEAD INDUSTRIES', 0x005017: u'RSR S.R.L.', 0x005018: u'AMIT, Inc.', 0x005019: u'SPRING TIDE NETWORKS, INC.', 0x00501A: u'UISIQN', 0x00501B: u'ABL CANADA, INC.', 0x00501C: u'JATOM SYSTEMS, INC.', 0x00501E: u'Miranda Technologies, Inc.', 0x00501F: u'MRG SYSTEMS, LTD.', 0x005020: u'MEDIASTAR CO., LTD.', 0x005021: u'EIS INTERNATIONAL, INC.', 0x005022: u'ZONET TECHNOLOGY, INC.', 0x005023: u'PG DESIGN ELECTRONICS, INC.', 0x005024: u'NAVIC SYSTEMS, INC.', 0x005026: u'COSYSTEMS, INC.', 0x005027: u'GENICOM CORPORATION', 0x005028: u'AVAL COMMUNICATIONS', 0x005029: u'1394 PRINTER WORKING GROUP', 0x00502A: u'CISCO SYSTEMS, INC.', 0x00502B: u'GENRAD LTD.', 0x00502C: u'SOYO COMPUTER, INC.', 0x00502D: u'ACCEL, INC.', 0x00502E: u'CAMBEX CORPORATION', 0x00502F: u'TollBridge Technologies, Inc.', 0x005030: u'FUTURE PLUS SYSTEMS', 0x005031: u'AEROFLEX LABORATORIES, INC.', 0x005032: u'PICAZO COMMUNICATIONS, INC.', 0x005033: u'MAYAN NETWORKS', 0x005036: u'NETCAM, LTD.', 0x005037: u'KOGA ELECTRONICS CO.', 0x005038: u'DAIN TELECOM CO., LTD.', 0x005039: u'MARINER NETWORKS', 0x00503A: u'DATONG ELECTRONICS LTD.', 0x00503B: u'MEDIAFIRE CORPORATION', 0x00503C: u'TSINGHUA NOVEL ELECTRONICS', 0x00503E: u'CISCO SYSTEMS, INC.', 0x00503F: u'ANCHOR GAMES', 0x005040: u'Matsushita Electric Works, Ltd.', 0x005041: u'Coretronic Corporation', 0x005042: u'SCI MANUFACTURING SINGAPORE PTE, LTD.', 0x005043: u'MARVELL SEMICONDUCTOR, INC.', 0x005044: u'ASACA CORPORATION', 0x005045: u'RIOWORKS SOLUTIONS, INC.', 0x005046: u'MENICX INTERNATIONAL CO., LTD.', 0x005047: u'PRIVATE', 0x005048: u'INFOLIBRIA', 0x005049: u'ELLACOYA NETWORKS, INC.', 0x00504A: u'ELTECO A.S.', 0x00504B: u'BARCONET N.V.', 0x00504C: u'GALIL MOTION CONTROL, INC.', 0x00504D: u'TOKYO ELECTRON DEVICE LTD.', 0x00504E: u'SIERRA MONITOR CORP.', 0x00504F: u'OLENCOM ELECTRONICS', 0x005050: u'CISCO SYSTEMS, INC.', 0x005051: u'IWATSU ELECTRIC CO., LTD.', 0x005052: u'TIARA NETWORKS, INC.', 0x005053: u'CISCO SYSTEMS, INC.', 0x005054: u'CISCO SYSTEMS, INC.', 0x005055: u'DOMS A/S', 0x005056: u'VMWare, Inc.', 0x005057: u'BROADBAND ACCESS SYSTEMS', 0x005058: u'VegaStream Limted', 0x005059: u'iBAHN', 0x00505A: u'NETWORK ALCHEMY, INC.', 0x00505B: u'KAWASAKI LSI U.S.A., INC.', 0x00505C: u'TUNDO CORPORATION', 0x00505E: u'DIGITEK MICROLOGIC S.A.', 0x00505F: u'BRAND INNOVATORS', 0x005060: u'TANDBERG TELECOM AS', 0x005062: u'KOUWELL ELECTRONICS CORP. **', 0x005063: u'OY COMSEL SYSTEM AB', 0x005064: u'CAE ELECTRONICS', 0x005065: u'DENSEI-LAMBAD Co., Ltd.', 0x005066: u'AtecoM GmbH advanced telecomunication modules', 0x005067: u'AEROCOMM, INC.', 0x005068: u'ELECTRONIC INDUSTRIES ASSOCIATION', 0x005069: u'PixStream Incorporated', 0x00506A: u'EDEVA, INC.', 0x00506B: u'SPX-ATEG', 0x00506C: u'G & L BEIJER ELECTRONICS AB', 0x00506D: u'VIDEOJET SYSTEMS', 0x00506E: u'CORDER ENGINEERING CORPORATION', 0x00506F: u'G-CONNECT', 0x005070: u'CHAINTECH COMPUTER CO., LTD.', 0x005071: u'AIWA CO., LTD.', 0x005072: u'CORVIS CORPORATION', 0x005073: u'CISCO SYSTEMS, INC.', 0x005074: u'ADVANCED HI-TECH CORP.', 0x005075: u'KESTREL SOLUTIONS', 0x005076: u'IBM', 0x005077: u'PROLIFIC TECHNOLOGY, INC.', 0x005078: u'MEGATON HOUSE, LTD.', 0x005079: u'PRIVATE', 0x00507A: u'XPEED, INC.', 0x00507B: u'MERLOT COMMUNICATIONS', 0x00507C: u'VIDEOCON AG', 0x00507D: u'IFP', 0x00507E: u'NEWER TECHNOLOGY', 0x00507F: u'DrayTek Corp.', 0x005080: u'CISCO SYSTEMS, INC.', 0x005081: u'MURATA MACHINERY, LTD.', 0x005082: u'FORESSON CORPORATION', 0x005083: u'GILBARCO, INC.', 0x005084: u'ATL PRODUCTS', 0x005086: u'TELKOM SA, LTD.', 0x005087: u'TERASAKI ELECTRIC CO., LTD.', 0x005088: u'AMANO CORPORATION', 0x005089: u'SAFETY MANAGEMENT SYSTEMS', 0x00508B: u'COMPAQ COMPUTER CORPORATION', 0x00508C: u'RSI SYSTEMS', 0x00508D: u'ABIT COMPUTER CORPORATION', 0x00508E: u'OPTIMATION, INC.', 0x00508F: u'ASITA TECHNOLOGIES INT\'L LTD.', 0x005090: u'DCTRI', 0x005091: u'NETACCESS, INC.', 0x005092: u'RIGAKU INDUSTRIAL CORPORATION', 0x005093: u'BOEING', 0x005094: u'PACE MICRO TECHNOLOGY PLC', 0x005095: u'PERACOM NETWORKS', 0x005096: u'SALIX TECHNOLOGIES, INC.', 0x005097: u'MMC-EMBEDDED COMPUTERTECHNIK GmbH', 0x005098: u'GLOBALOOP, LTD.', 0x005099: u'3COM EUROPE, LTD.', 0x00509A: u'TAG ELECTRONIC SYSTEMS', 0x00509B: u'SWITCHCORE AB', 0x00509C: u'BETA RESEARCH', 0x00509D: u'THE INDUSTREE B.V.', 0x00509E: u'Les Technologies SoftAcoustik Inc.', 0x00509F: u'HORIZON COMPUTER', 0x0050A0: u'DELTA COMPUTER SYSTEMS, INC.', 0x0050A1: u'CARLO GAVAZZI, INC.', 0x0050A2: u'CISCO SYSTEMS, INC.', 0x0050A3: u'TransMedia Communications, Inc.', 0x0050A4: u'IO TECH, INC.', 0x0050A5: u'CAPITOL BUSINESS SYSTEMS, LTD.', 0x0050A6: u'OPTRONICS', 0x0050A7: u'CISCO SYSTEMS, INC.', 0x0050A8: u'OpenCon Systems, Inc.', 0x0050A9: u'MOLDAT WIRELESS TECHNOLGIES', 0x0050AA: u'KONICA MINOLTA HOLDINGS, INC.', 0x0050AB: u'NALTEC, INC.', 0x0050AC: u'MAPLE COMPUTER CORPORATION', 0x0050AD: u'CommUnique Wireless Corp.', 0x0050AE: u'IWAKI ELECTRONICS CO., LTD.', 0x0050AF: u'INTERGON, INC.', 0x0050B0: u'TECHNOLOGY ATLANTA CORPORATION', 0x0050B1: u'GIDDINGS & LEWIS', 0x0050B2: u'BRODEL AUTOMATION', 0x0050B3: u'VOICEBOARD CORPORATION', 0x0050B4: u'SATCHWELL CONTROL SYSTEMS, LTD', 0x0050B5: u'FICHET-BAUCHE', 0x0050B6: u'GOOD WAY IND. CO., LTD.', 0x0050B7: u'BOSER TECHNOLOGY CO., LTD.', 0x0050B8: u'INOVA COMPUTERS GMBH & CO. KG', 0x0050B9: u'XITRON TECHNOLOGIES, INC.', 0x0050BA: u'D-LINK', 0x0050BB: u'CMS TECHNOLOGIES', 0x0050BC: u'HAMMER STORAGE SOLUTIONS', 0x0050BD: u'CISCO SYSTEMS, INC.', 0x0050BE: u'FAST MULTIMEDIA AG', 0x0050BF: u'MOTOTECH INC.', 0x0050C0: u'GATAN, INC.', 0x0050C1: u'GEMFLEX NETWORKS, LTD.', 0x0050C2: u'IEEE REGISTRATION AUTHORITY', 0x0050C4: u'IMD', 0x0050C5: u'ADS TECHNOLOGIES, INC.', 0x0050C6: u'LOOP TELECOMMUNICATION INTERNATIONAL, INC.', 0x0050C8: u'ADDONICS COMMUNICATIONS, INC.', 0x0050C9: u'MASPRO DENKOH CORP.', 0x0050CA: u'NET TO NET TECHNOLOGIES', 0x0050CB: u'JETTER', 0x0050CC: u'XYRATEX', 0x0050CD: u'DIGIANSWER A/S', 0x0050CE: u'LG INTERNATIONAL CORP.', 0x0050CF: u'VANLINK COMMUNICATION TECHNOLOGY RESEARCH INSTITUTE', 0x0050D0: u'MINERVA SYSTEMS', 0x0050D1: u'CISCO SYSTEMS, INC.', 0x0050D2: u'CMC Electronics Inc', 0x0050D3: u'DIGITAL AUDIO PROCESSING PTY. LTD.', 0x0050D4: u'JOOHONG INFORMATION &', 0x0050D5: u'AD SYSTEMS CORP.', 0x0050D6: u'ATLAS COPCO TOOLS AB', 0x0050D7: u'TELSTRAT', 0x0050D8: u'UNICORN COMPUTER CORP.', 0x0050D9: u'ENGETRON-ENGENHARIA ELETRONICA IND. e COM. LTDA', 0x0050DA: u'3COM CORPORATION', 0x0050DB: u'CONTEMPORARY CONTROL', 0x0050DC: u'TAS TELEFONBAU A. SCHWABE GMBH & CO. KG', 0x0050DD: u'SERRA SOLDADURA, S.A.', 0x0050DE: u'SIGNUM SYSTEMS CORP.', 0x0050DF: u'AirFiber, Inc.', 0x0050E1: u'NS TECH ELECTRONICS SDN BHD', 0x0050E2: u'CISCO SYSTEMS, INC.', 0x0050E3: u'Terayon Communications Systems', 0x0050E4: u'APPLE COMPUTER, INC.', 0x0050E6: u'HAKUSAN CORPORATION', 0x0050E7: u'PARADISE INNOVATIONS (ASIA)', 0x0050E8: u'NOMADIX INC.', 0x0050EA: u'XEL COMMUNICATIONS, INC.', 0x0050EB: u'ALPHA-TOP CORPORATION', 0x0050EC: u'OLICOM A/S', 0x0050ED: u'ANDA NETWORKS', 0x0050EE: u'TEK DIGITEL CORPORATION', 0x0050EF: u'SPE Systemhaus GmbH', 0x0050F0: u'CISCO SYSTEMS, INC.', 0x0050F1: u'LIBIT SIGNAL PROCESSING, LTD.', 0x0050F2: u'MICROSOFT CORP.', 0x0050F3: u'GLOBAL NET INFORMATION CO., Ltd.', 0x0050F4: u'SIGMATEK GMBH & CO. KG', 0x0050F6: u'PAN-INTERNATIONAL INDUSTRIAL CORP.', 0x0050F7: u'VENTURE MANUFACTURING (SINGAPORE) LTD.', 0x0050F8: u'ENTREGA TECHNOLOGIES, INC.', 0x0050F9: u'SENSORMATIC ACD', 0x0050FA: u'OXTEL, LTD.', 0x0050FB: u'VSK ELECTRONICS', 0x0050FC: u'EDIMAX TECHNOLOGY CO., LTD.', 0x0050FD: u'VISIONCOMM CO., LTD.', 0x0050FE: u'PCTVnet ASA', 0x0050FF: u'HAKKO ELECTRONICS CO., LTD.', 0x006000: u'XYCOM INC.', 0x006001: u'InnoSys, Inc.', 0x006002: u'SCREEN SUBTITLING SYSTEMS, LTD', 0x006003: u'TERAOKA WEIGH SYSTEM PTE, LTD.', 0x006004: u'COMPUTADORES MODULARES SA', 0x006005: u'FEEDBACK DATA LTD.', 0x006006: u'SOTEC CO., LTD', 0x006007: u'ACRES GAMING, INC.', 0x006008: u'3COM CORPORATION', 0x006009: u'CISCO SYSTEMS, INC.', 0x00600A: u'SORD COMPUTER CORPORATION', 0x00600B: u'LOGWARE GmbH', 0x00600C: u'APPLIED DATA SYSTEMS, INC.', 0x00600D: u'Digital Logic GmbH', 0x00600E: u'WAVENET INTERNATIONAL, INC.', 0x00600F: u'WESTELL, INC.', 0x006010: u'NETWORK MACHINES, INC.', 0x006011: u'CRYSTAL SEMICONDUCTOR CORP.', 0x006012: u'POWER COMPUTING CORPORATION', 0x006013: u'NETSTAL MASCHINEN AG', 0x006014: u'EDEC CO., LTD.', 0x006015: u'NET2NET CORPORATION', 0x006016: u'CLARIION', 0x006017: u'TOKIMEC INC.', 0x006018: u'STELLAR ONE CORPORATION', 0x006019: u'Roche Diagnostics', 0x00601A: u'KEITHLEY INSTRUMENTS', 0x00601B: u'MESA ELECTRONICS', 0x00601C: u'TELXON CORPORATION', 0x00601D: u'LUCENT TECHNOLOGIES', 0x00601E: u'SOFTLAB, INC.', 0x00601F: u'STALLION TECHNOLOGIES', 0x006020: u'PIVOTAL NETWORKING, INC.', 0x006021: u'DSC CORPORATION', 0x006022: u'VICOM SYSTEMS, INC.', 0x006023: u'PERICOM SEMICONDUCTOR CORP.', 0x006024: u'GRADIENT TECHNOLOGIES, INC.', 0x006025: u'ACTIVE IMAGING PLC', 0x006026: u'VIKING COMPONENTS, INC.', 0x006027: u'Superior Modular Products', 0x006028: u'MACROVISION CORPORATION', 0x006029: u'CARY PERIPHERALS INC.', 0x00602A: u'SYMICRON COMPUTER COMMUNICATIONS, LTD.', 0x00602B: u'PEAK AUDIO', 0x00602C: u'LINX Data Terminals, Inc.', 0x00602D: u'ALERTON TECHNOLOGIES, INC.', 0x00602E: u'CYCLADES CORPORATION', 0x00602F: u'CISCO SYSTEMS, INC.', 0x006030: u'VILLAGE TRONIC ENTWICKLUNG', 0x006031: u'HRK SYSTEMS', 0x006032: u'I-CUBE, INC.', 0x006033: u'ACUITY IMAGING, INC.', 0x006034: u'ROBERT BOSCH GmbH', 0x006035: u'DALLAS SEMICONDUCTOR, INC.', 0x006036: u'AUSTRIAN RESEARCH CENTER SEIBERSDORF', 0x006037: u'NXP Semiconductors', 0x006038: u'Nortel Networks', 0x006039: u'SanCom Technology, Inc.', 0x00603A: u'QUICK CONTROLS LTD.', 0x00603B: u'AMTEC spa', 0x00603C: u'HAGIWARA SYS-COM CO., LTD.', 0x00603D: u'3CX', 0x00603E: u'CISCO SYSTEMS, INC.', 0x00603F: u'PATAPSCO DESIGNS', 0x006040: u'NETRO CORP.', 0x006041: u'Yokogawa Electric Corporation', 0x006042: u'TKS (USA), INC.', 0x006043: u'ComSoft Systems, Inc.', 0x006044: u'LITTON/POLY-SCIENTIFIC', 0x006045: u'PATHLIGHT TECHNOLOGIES', 0x006046: u'VMETRO, INC.', 0x006047: u'CISCO SYSTEMS, INC.', 0x006048: u'EMC CORPORATION', 0x006049: u'VINA TECHNOLOGIES', 0x00604A: u'SAIC IDEAS GROUP', 0x00604B: u'Safe-com GmbH & Co. KG', 0x00604C: u'SAGEM SA', 0x00604D: u'MMC NETWORKS, INC.', 0x00604E: u'CYCLE COMPUTER CORPORATION, INC.', 0x00604F: u'SUZUKI MFG. CO., LTD.', 0x006050: u'INTERNIX INC.', 0x006051: u'QUALITY SEMICONDUCTOR', 0x006052: u'PERIPHERALS ENTERPRISE CO., Ltd.', 0x006053: u'TOYODA MACHINE WORKS, LTD.', 0x006054: u'CONTROLWARE GMBH', 0x006055: u'CORNELL UNIVERSITY', 0x006056: u'NETWORK TOOLS, INC.', 0x006057: u'MURATA MANUFACTURING CO., LTD.', 0x006058: u'COPPER MOUNTAIN COMMUNICATIONS, INC.', 0x006059: u'TECHNICAL COMMUNICATIONS CORP.', 0x00605A: u'CELCORE, INC.', 0x00605B: u'IntraServer Technology, Inc.', 0x00605C: u'CISCO SYSTEMS, INC.', 0x00605D: u'SCANIVALVE CORP.', 0x00605E: u'LIBERTY TECHNOLOGY NETWORKING', 0x00605F: u'NIPPON UNISOFT CORPORATION', 0x006060: u'DAWNING TECHNOLOGIES, INC.', 0x006061: u'WHISTLE COMMUNICATIONS CORP.', 0x006062: u'TELESYNC, INC.', 0x006063: u'PSION DACOM PLC.', 0x006064: u'NETCOMM LIMITED', 0x006065: u'BERNECKER & RAINER INDUSTRIE-ELEKTRONIC GmbH', 0x006066: u'LACROIX TECHNOLGIE', 0x006067: u'ACER NETXUS INC.', 0x006068: u'EICON TECHNOLOGY CORPORATION', 0x006069: u'BROCADE COMMUNICATIONS SYSTEMS, Inc.', 0x00606A: u'MITSUBISHI WIRELESS COMMUNICATIONS. INC.', 0x00606B: u'Synclayer Inc.', 0x00606C: u'ARESCOM', 0x00606D: u'DIGITAL EQUIPMENT CORP.', 0x00606E: u'DAVICOM SEMICONDUCTOR, INC.', 0x00606F: u'CLARION CORPORATION OF AMERICA', 0x006070: u'CISCO SYSTEMS, INC.', 0x006071: u'MIDAS LAB, INC.', 0x006072: u'VXL INSTRUMENTS, LIMITED', 0x006073: u'REDCREEK COMMUNICATIONS, INC.', 0x006074: u'QSC AUDIO PRODUCTS', 0x006075: u'PENTEK, INC.', 0x006076: u'SCHLUMBERGER TECHNOLOGIES RETAIL PETROLEUM SYSTEMS', 0x006077: u'PRISA NETWORKS', 0x006078: u'POWER MEASUREMENT LTD.', 0x006079: u'Mainstream Data, Inc.', 0x00607A: u'DVS GmbH', 0x00607B: u'FORE SYSTEMS, INC.', 0x00607C: u'WaveAccess, Ltd.', 0x00607D: u'SENTIENT NETWORKS INC.', 0x00607E: u'GIGALABS, INC.', 0x00607F: u'AURORA TECHNOLOGIES, INC.', 0x006080: u'MICROTRONIX DATACOM LTD.', 0x006081: u'TV/COM INTERNATIONAL', 0x006082: u'NOVALINK TECHNOLOGIES, INC.', 0x006083: u'CISCO SYSTEMS, INC.', 0x006084: u'DIGITAL VIDEO', 0x006085: u'Storage Concepts', 0x006086: u'LOGIC REPLACEMENT TECH. LTD.', 0x006087: u'KANSAI ELECTRIC CO., LTD.', 0x006088: u'WHITE MOUNTAIN DSP, INC.', 0x006089: u'XATA', 0x00608A: u'CITADEL COMPUTER', 0x00608B: u'ConferTech International', 0x00608C: u'3COM CORPORATION', 0x00608D: u'UNIPULSE CORP.', 0x00608E: u'HE ELECTRONICS, TECHNOLOGIE & SYSTEMTECHNIK GmbH', 0x00608F: u'TEKRAM TECHNOLOGY CO., LTD.', 0x006090: u'ABLE COMMUNICATIONS, INC.', 0x006091: u'FIRST PACIFIC NETWORKS, INC.', 0x006092: u'MICRO/SYS, INC.', 0x006093: u'VARIAN', 0x006094: u'IBM CORP.', 0x006095: u'ACCU-TIME SYSTEMS, INC.', 0x006096: u'T.S. MICROTECH INC.', 0x006097: u'3COM CORPORATION', 0x006098: u'HT COMMUNICATIONS', 0x006099: u'SBE, Inc.', 0x00609A: u'NJK TECHNO CO.', 0x00609B: u'ASTRO-MED, INC.', 0x00609C: u'Perkin-Elmer Incorporated', 0x00609D: u'PMI FOOD EQUIPMENT GROUP', 0x00609E: u'ASC X3 - INFORMATION TECHNOLOGY STANDARDS SECRETARIATS', 0x00609F: u'PHAST CORPORATION', 0x0060A0: u'SWITCHED NETWORK TECHNOLOGIES, INC.', 0x0060A1: u'VPNet, Inc.', 0x0060A2: u'NIHON UNISYS LIMITED CO.', 0x0060A3: u'CONTINUUM TECHNOLOGY CORP.', 0x0060A4: u'GRINAKER SYSTEM TECHNOLOGIES', 0x0060A5: u'PERFORMANCE TELECOM CORP.', 0x0060A6: u'PARTICLE MEASURING SYSTEMS', 0x0060A7: u'MICROSENS GmbH & CO. KG', 0x0060A8: u'TIDOMAT AB', 0x0060A9: u'GESYTEC MbH', 0x0060AA: u'INTELLIGENT DEVICES INC. (IDI)', 0x0060AB: u'LARSCOM INCORPORATED', 0x0060AC: u'RESILIENCE CORPORATION', 0x0060AD: u'MegaChips Corporation', 0x0060AE: u'TRIO INFORMATION SYSTEMS AB', 0x0060AF: u'PACIFIC MICRO DATA, INC.', 0x0060B0: u'HEWLETT-PACKARD CO.', 0x0060B1: u'INPUT/OUTPUT, INC.', 0x0060B2: u'PROCESS CONTROL CORP.', 0x0060B3: u'Z-COM, INC.', 0x0060B4: u'GLENAYRE R&D INC.', 0x0060B5: u'KEBA GmbH', 0x0060B6: u'LAND COMPUTER CO., LTD.', 0x0060B7: u'CHANNELMATIC, INC.', 0x0060B8: u'CORELIS INC.', 0x0060B9: u'NITSUKO CORPORATION', 0x0060BA: u'SAHARA NETWORKS, INC.', 0x0060BB: u'CABLETRON - NETLINK, INC.', 0x0060BC: u'KeunYoung Electronics & Communication Co., Ltd.', 0x0060BD: u'HUBBELL-PULSECOM', 0x0060BE: u'WEBTRONICS', 0x0060BF: u'MACRAIGOR SYSTEMS, INC.', 0x0060C0: u'NERA AS', 0x0060C1: u'WaveSpan Corporation', 0x0060C2: u'MPL AG', 0x0060C3: u'NETVISION CORPORATION', 0x0060C4: u'SOLITON SYSTEMS K.K.', 0x0060C5: u'ANCOT CORP.', 0x0060C6: u'DCS AG', 0x0060C7: u'AMATI COMMUNICATIONS CORP.', 0x0060C8: u'KUKA WELDING SYSTEMS & ROBOTS', 0x0060C9: u'ControlNet, Inc.', 0x0060CA: u'HARMONIC SYSTEMS INCORPORATED', 0x0060CB: u'HITACHI ZOSEN CORPORATION', 0x0060CC: u'EMTRAK, INCORPORATED', 0x0060CD: u'VideoServer, Inc.', 0x0060CE: u'ACCLAIM COMMUNICATIONS', 0x0060CF: u'ALTEON NETWORKS, INC.', 0x0060D0: u'SNMP RESEARCH INCORPORATED', 0x0060D1: u'CASCADE COMMUNICATIONS', 0x0060D2: u'LUCENT TECHNOLOGIES TAIWAN TELECOMMUNICATIONS CO., LTD.', 0x0060D3: u'AT&T', 0x0060D4: u'ELDAT COMMUNICATION LTD.', 0x0060D5: u'MIYACHI TECHNOS CORP.', 0x0060D6: u'NovAtel Wireless Technologies Ltd.', 0x0060D7: u'ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE (EPFL)', 0x0060D8: u'ELMIC SYSTEMS, INC.', 0x0060D9: u'TRANSYS NETWORKS INC.', 0x0060DA: u'JBM ELECTRONICS CO.', 0x0060DB: u'NTP ELEKTRONIK A/S', 0x0060DC: u'Toyo Network Systems Co, Ltd.', 0x0060DD: u'MYRICOM, INC.', 0x0060DE: u'KAYSER-THREDE GmbH', 0x0060DF: u'CNT Corporation', 0x0060E0: u'AXIOM TECHNOLOGY CO., LTD.', 0x0060E1: u'ORCKIT COMMUNICATIONS LTD.', 0x0060E2: u'QUEST ENGINEERING & DEVELOPMENT', 0x0060E3: u'ARBIN INSTRUMENTS', 0x0060E4: u'COMPUSERVE, INC.', 0x0060E5: u'FUJI AUTOMATION CO., LTD.', 0x0060E6: u'SHOMITI SYSTEMS INCORPORATED', 0x0060E7: u'RANDATA', 0x0060E8: u'HITACHI COMPUTER PRODUCTS (AMERICA), INC.', 0x0060E9: u'ATOP TECHNOLOGIES, INC.', 0x0060EA: u'StreamLogic', 0x0060EB: u'FOURTHTRACK SYSTEMS', 0x0060EC: u'HERMARY OPTO ELECTRONICS INC.', 0x0060ED: u'RICARDO TEST AUTOMATION LTD.', 0x0060EE: u'APOLLO', 0x0060EF: u'FLYTECH TECHNOLOGY CO., LTD.', 0x0060F0: u'JOHNSON & JOHNSON MEDICAL, INC', 0x0060F1: u'EXP COMPUTER, INC.', 0x0060F2: u'LASERGRAPHICS, INC.', 0x0060F3: u'Performance Analysis Broadband, Spirent plc', 0x0060F4: u'ADVANCED COMPUTER SOLUTIONS, Inc.', 0x0060F5: u'ICON WEST, INC.', 0x0060F6: u'NEXTEST COMMUNICATIONS PRODUCTS, INC.', 0x0060F7: u'DATAFUSION SYSTEMS', 0x0060F8: u'Loran International Technologies Inc.', 0x0060F9: u'DIAMOND LANE COMMUNICATIONS', 0x0060FA: u'EDUCATIONAL TECHNOLOGY RESOURCES, INC.', 0x0060FB: u'PACKETEER, INC.', 0x0060FC: u'CONSERVATION THROUGH INNOVATION LTD.', 0x0060FD: u'NetICs, Inc.', 0x0060FE: u'LYNX SYSTEM DEVELOPERS, INC.', 0x0060FF: u'QuVis, Inc.', 0x0070B0: u'M/A-COM INC. COMPANIES', 0x0070B3: u'DATA RECALL LTD.', 0x008000: u'MULTITECH SYSTEMS, INC.', 0x008001: u'PERIPHONICS CORPORATION', 0x008002: u'SATELCOM (UK) LTD', 0x008003: u'HYTEC ELECTRONICS LTD.', 0x008004: u'ANTLOW COMMUNICATIONS, LTD.', 0x008005: u'CACTUS COMPUTER INC.', 0x008006: u'COMPUADD CORPORATION', 0x008007: u'DLOG NC-SYSTEME', 0x008008: u'DYNATECH COMPUTER SYSTEMS', 0x008009: u'JUPITER SYSTEMS, INC.', 0x00800A: u'JAPAN COMPUTER CORP.', 0x00800B: u'CSK CORPORATION', 0x00800C: u'VIDECOM LIMITED', 0x00800D: u'VOSSWINKEL F.U.', 0x00800E: u'ATLANTIX CORPORATION', 0x00800F: u'STANDARD MICROSYSTEMS', 0x008010: u'COMMODORE INTERNATIONAL', 0x008011: u'DIGITAL SYSTEMS INT\'L. INC.', 0x008012: u'INTEGRATED MEASUREMENT SYSTEMS', 0x008013: u'THOMAS-CONRAD CORPORATION', 0x008014: u'ESPRIT SYSTEMS', 0x008015: u'SEIKO SYSTEMS, INC.', 0x008016: u'WANDEL AND GOLTERMANN', 0x008017: u'PFU LIMITED', 0x008018: u'KOBE STEEL, LTD.', 0x008019: u'DAYNA COMMUNICATIONS, INC.', 0x00801A: u'BELL ATLANTIC', 0x00801B: u'KODIAK TECHNOLOGY', 0x00801C: u'NEWPORT SYSTEMS SOLUTIONS', 0x00801D: u'INTEGRATED INFERENCE MACHINES', 0x00801E: u'XINETRON, INC.', 0x00801F: u'KRUPP ATLAS ELECTRONIK GMBH', 0x008020: u'NETWORK PRODUCTS', 0x008021: u'Alcatel Canada Inc.', 0x008022: u'SCAN-OPTICS', 0x008023: u'INTEGRATED BUSINESS NETWORKS', 0x008024: u'KALPANA, INC.', 0x008025: u'STOLLMANN GMBH', 0x008026: u'NETWORK PRODUCTS CORPORATION', 0x008027: u'ADAPTIVE SYSTEMS, INC.', 0x008028: u'TRADPOST (HK) LTD', 0x008029: u'EAGLE TECHNOLOGY, INC.', 0x00802A: u'TEST SYSTEMS & SIMULATIONS INC', 0x00802B: u'INTEGRATED MARKETING CO', 0x00802C: u'THE SAGE GROUP PLC', 0x00802D: u'XYLOGICS INC', 0x00802E: u'CASTLE ROCK COMPUTING', 0x00802F: u'NATIONAL INSTRUMENTS CORP.', 0x008030: u'NEXUS ELECTRONICS', 0x008031: u'BASYS, CORP.', 0x008032: u'ACCESS CO., LTD.', 0x008033: u'FORMATION, INC.', 0x008034: u'SMT GOUPIL', 0x008035: u'TECHNOLOGY WORKS, INC.', 0x008036: u'REFLEX MANUFACTURING SYSTEMS', 0x008037: u'Ericsson Group', 0x008038: u'DATA RESEARCH & APPLICATIONS', 0x008039: u'ALCATEL STC AUSTRALIA', 0x00803A: u'VARITYPER, INC.', 0x00803B: u'APT COMMUNICATIONS, INC.', 0x00803C: u'TVS ELECTRONICS LTD', 0x00803D: u'SURIGIKEN CO., LTD.', 0x00803E: u'SYNERNETICS', 0x00803F: u'TATUNG COMPANY', 0x008040: u'JOHN FLUKE MANUFACTURING CO.', 0x008041: u'VEB KOMBINAT ROBOTRON', 0x008042: u'FORCE COMPUTERS', 0x008043: u'NETWORLD, INC.', 0x008044: u'SYSTECH COMPUTER CORP.', 0x008045: u'MATSUSHITA ELECTRIC IND. CO', 0x008046: u'UNIVERSITY OF TORONTO', 0x008047: u'IN-NET CORP.', 0x008048: u'COMPEX INCORPORATED', 0x008049: u'NISSIN ELECTRIC CO., LTD.', 0x00804A: u'PRO-LOG', 0x00804B: u'EAGLE TECHNOLOGIES PTY.LTD.', 0x00804C: u'CONTEC CO., LTD.', 0x00804D: u'CYCLONE MICROSYSTEMS, INC.', 0x00804E: u'APEX COMPUTER COMPANY', 0x00804F: u'DAIKIN INDUSTRIES, LTD.', 0x008050: u'ZIATECH CORPORATION', 0x008051: u'FIBERMUX', 0x008052: u'TECHNICALLY ELITE CONCEPTS', 0x008053: u'INTELLICOM, INC.', 0x008054: u'FRONTIER TECHNOLOGIES CORP.', 0x008055: u'FERMILAB', 0x008056: u'SPHINX ELEKTRONIK GMBH', 0x008057: u'ADSOFT, LTD.', 0x008058: u'PRINTER SYSTEMS CORPORATION', 0x008059: u'STANLEY ELECTRIC CO., LTD', 0x00805A: u'TULIP COMPUTERS INTERNAT\'L B.V', 0x00805B: u'CONDOR SYSTEMS, INC.', 0x00805C: u'AGILIS CORPORATION', 0x00805D: u'CANSTAR', 0x00805E: u'LSI LOGIC CORPORATION', 0x00805F: u'COMPAQ COMPUTER CORPORATION', 0x008060: u'NETWORK INTERFACE CORPORATION', 0x008061: u'LITTON SYSTEMS, INC.', 0x008062: u'INTERFACE CO.', 0x008063: u'RICHARD HIRSCHMANN GMBH & CO.', 0x008064: u'WYSE TECHNOLOGY', 0x008065: u'CYBERGRAPHIC SYSTEMS PTY LTD.', 0x008066: u'ARCOM CONTROL SYSTEMS, LTD.', 0x008067: u'SQUARE D COMPANY', 0x008068: u'YAMATECH SCIENTIFIC LTD.', 0x008069: u'COMPUTONE SYSTEMS', 0x00806A: u'ERI (EMPAC RESEARCH INC.)', 0x00806B: u'SCHMID TELECOMMUNICATION', 0x00806C: u'CEGELEC PROJECTS LTD', 0x00806D: u'CENTURY SYSTEMS CORP.', 0x00806E: u'NIPPON STEEL CORPORATION', 0x00806F: u'ONELAN LTD.', 0x008070: u'COMPUTADORAS MICRON', 0x008071: u'SAI TECHNOLOGY', 0x008072: u'MICROPLEX SYSTEMS LTD.', 0x008073: u'DWB ASSOCIATES', 0x008074: u'FISHER CONTROLS', 0x008075: u'PARSYTEC GMBH', 0x008076: u'MCNC', 0x008077: u'BROTHER INDUSTRIES, LTD.', 0x008078: u'PRACTICAL PERIPHERALS, INC.', 0x008079: u'MICROBUS DESIGNS LTD.', 0x00807A: u'AITECH SYSTEMS LTD.', 0x00807B: u'ARTEL COMMUNICATIONS CORP.', 0x00807C: u'FIBERCOM, INC.', 0x00807D: u'EQUINOX SYSTEMS INC.', 0x00807E: u'SOUTHERN PACIFIC LTD.', 0x00807F: u'DY-4 INCORPORATED', 0x008080: u'DATAMEDIA CORPORATION', 0x008081: u'KENDALL SQUARE RESEARCH CORP.', 0x008082: u'PEP MODULAR COMPUTERS GMBH', 0x008083: u'AMDAHL', 0x008084: u'THE CLOUD INC.', 0x008085: u'H-THREE SYSTEMS CORPORATION', 0x008086: u'COMPUTER GENERATION INC.', 0x008087: u'OKI ELECTRIC INDUSTRY CO., LTD', 0x008088: u'VICTOR COMPANY OF JAPAN, LTD.', 0x008089: u'TECNETICS (PTY) LTD.', 0x00808A: u'SUMMIT MICROSYSTEMS CORP.', 0x00808B: u'DACOLL LIMITED', 0x00808C: u'NetScout Systems, Inc.', 0x00808D: u'WESTCOAST TECHNOLOGY B.V.', 0x00808E: u'RADSTONE TECHNOLOGY', 0x00808F: u'C. ITOH ELECTRONICS, INC.', 0x008090: u'MICROTEK INTERNATIONAL, INC.', 0x008091: u'TOKYO ELECTRIC CO.,LTD', 0x008092: u'JAPAN COMPUTER INDUSTRY, INC.', 0x008093: u'XYRON CORPORATION', 0x008094: u'ALFA LAVAL AUTOMATION AB', 0x008095: u'BASIC MERTON HANDELSGES.M.B.H.', 0x008096: u'HUMAN DESIGNED SYSTEMS, INC.', 0x008097: u'CENTRALP AUTOMATISMES', 0x008098: u'TDK CORPORATION', 0x008099: u'KLOCKNER MOELLER IPC', 0x00809A: u'NOVUS NETWORKS LTD', 0x00809B: u'JUSTSYSTEM CORPORATION', 0x00809C: u'LUXCOM, INC.', 0x00809D: u'Commscraft Ltd.', 0x00809E: u'DATUS GMBH', 0x00809F: u'ALCATEL BUSINESS SYSTEMS', 0x0080A0: u'EDISA HEWLETT PACKARD S/A', 0x0080A1: u'MICROTEST, INC.', 0x0080A2: u'CREATIVE ELECTRONIC SYSTEMS', 0x0080A3: u'LANTRONIX', 0x0080A4: u'LIBERTY ELECTRONICS', 0x0080A5: u'SPEED INTERNATIONAL', 0x0080A6: u'REPUBLIC TECHNOLOGY, INC.', 0x0080A7: u'MEASUREX CORP.', 0x0080A8: u'VITACOM CORPORATION', 0x0080A9: u'CLEARPOINT RESEARCH', 0x0080AA: u'MAXPEED', 0x0080AB: u'DUKANE NETWORK INTEGRATION', 0x0080AC: u'IMLOGIX, DIVISION OF GENESYS', 0x0080AD: u'CNET TECHNOLOGY, INC.', 0x0080AE: u'HUGHES NETWORK SYSTEMS', 0x0080AF: u'ALLUMER CO., LTD.', 0x0080B0: u'ADVANCED INFORMATION', 0x0080B1: u'SOFTCOM A/S', 0x0080B2: u'NETWORK EQUIPMENT TECHNOLOGIES', 0x0080B3: u'AVAL DATA CORPORATION', 0x0080B4: u'SOPHIA SYSTEMS', 0x0080B5: u'UNITED NETWORKS INC.', 0x0080B6: u'THEMIS COMPUTER', 0x0080B7: u'STELLAR COMPUTER', 0x0080B8: u'BUG, INCORPORATED', 0x0080B9: u'ARCHE TECHNOLIGIES INC.', 0x0080BA: u'SPECIALIX (ASIA) PTE, LTD', 0x0080BB: u'HUGHES LAN SYSTEMS', 0x0080BC: u'HITACHI ENGINEERING CO., LTD', 0x0080BD: u'THE FURUKAWA ELECTRIC CO., LTD', 0x0080BE: u'ARIES RESEARCH', 0x0080BF: u'TAKAOKA ELECTRIC MFG. CO. LTD.', 0x0080C0: u'PENRIL DATACOMM', 0x0080C1: u'LANEX CORPORATION', 0x0080C2: u'IEEE 802.1 COMMITTEE', 0x0080C3: u'BICC INFORMATION SYSTEMS & SVC', 0x0080C4: u'DOCUMENT TECHNOLOGIES, INC.', 0x0080C5: u'NOVELLCO DE MEXICO', 0x0080C6: u'NATIONAL DATACOMM CORPORATION', 0x0080C7: u'XIRCOM', 0x0080C8: u'D-LINK SYSTEMS, INC.', 0x0080C9: u'ALBERTA MICROELECTRONIC CENTRE', 0x0080CA: u'NETCOM RESEARCH INCORPORATED', 0x0080CB: u'FALCO DATA PRODUCTS', 0x0080CC: u'MICROWAVE BYPASS SYSTEMS', 0x0080CD: u'MICRONICS COMPUTER, INC.', 0x0080CE: u'BROADCAST TELEVISION SYSTEMS', 0x0080CF: u'EMBEDDED PERFORMANCE INC.', 0x0080D0: u'COMPUTER PERIPHERALS, INC.', 0x0080D1: u'KIMTRON CORPORATION', 0x0080D2: u'SHINNIHONDENKO CO., LTD.', 0x0080D3: u'SHIVA CORP.', 0x0080D4: u'CHASE RESEARCH LTD.', 0x0080D5: u'CADRE TECHNOLOGIES', 0x0080D6: u'NUVOTECH, INC.', 0x0080D7: u'Fantum Engineering', 0x0080D8: u'NETWORK PERIPHERALS INC.', 0x0080D9: u'EMK ELEKTRONIK', 0x0080DA: u'BRUEL & KJAER', 0x0080DB: u'GRAPHON CORPORATION', 0x0080DC: u'PICKER INTERNATIONAL', 0x0080DD: u'GMX INC/GIMIX', 0x0080DE: u'GIPSI S.A.', 0x0080DF: u'ADC CODENOLL TECHNOLOGY CORP.', 0x0080E0: u'XTP SYSTEMS, INC.', 0x0080E1: u'STMICROELECTRONICS', 0x0080E2: u'T.D.I. CO., LTD.', 0x0080E3: u'CORAL NETWORK CORPORATION', 0x0080E4: u'NORTHWEST DIGITAL SYSTEMS, INC', 0x0080E5: u'LSI Logic Corporation', 0x0080E6: u'PEER NETWORKS, INC.', 0x0080E7: u'LYNWOOD SCIENTIFIC DEV. LTD.', 0x0080E8: u'CUMULUS CORPORATIION', 0x0080E9: u'Madge Ltd.', 0x0080EA: u'ADVA Optical Networking Ltd.', 0x0080EB: u'COMPCONTROL B.V.', 0x0080EC: u'SUPERCOMPUTING SOLUTIONS, INC.', 0x0080ED: u'IQ TECHNOLOGIES, INC.', 0x0080EE: u'THOMSON CSF', 0x0080EF: u'RATIONAL', 0x0080F0: u'Panasonic Communications Co., Ltd.', 0x0080F1: u'OPUS SYSTEMS', 0x0080F2: u'RAYCOM SYSTEMS INC', 0x0080F3: u'SUN ELECTRONICS CORP.', 0x0080F4: u'TELEMECANIQUE ELECTRIQUE', 0x0080F5: u'QUANTEL LTD', 0x0080F6: u'SYNERGY MICROSYSTEMS', 0x0080F7: u'ZENITH ELECTRONICS', 0x0080F8: u'MIZAR, INC.', 0x0080F9: u'HEURIKON CORPORATION', 0x0080FA: u'RWT GMBH', 0x0080FB: u'BVM LIMITED', 0x0080FC: u'AVATAR CORPORATION', 0x0080FD: u'EXSCEED CORPRATION', 0x0080FE: u'AZURE TECHNOLOGIES, INC.', 0x0080FF: u'SOC. DE TELEINFORMATIQUE RTC', 0x009000: u'DIAMOND MULTIMEDIA', 0x009001: u'NISHIMU ELECTRONICS INDUSTRIES CO., LTD.', 0x009002: u'ALLGON AB', 0x009003: u'APLIO', 0x009004: u'3COM EUROPE LTD.', 0x009005: u'PROTECH SYSTEMS CO., LTD.', 0x009006: u'HAMAMATSU PHOTONICS K.K.', 0x009007: u'DOMEX TECHNOLOGY CORP.', 0x009008: u'HanA Systems Inc.', 0x009009: u'i Controls, Inc.', 0x00900A: u'PROTON ELECTRONIC INDUSTRIAL CO., LTD.', 0x00900B: u'LANNER ELECTRONICS, INC.', 0x00900C: u'CISCO SYSTEMS, INC.', 0x00900D: u'Overland Storage Inc.', 0x00900E: u'HANDLINK TECHNOLOGIES, INC.', 0x00900F: u'KAWASAKI HEAVY INDUSTRIES, LTD', 0x009010: u'SIMULATION LABORATORIES, INC.', 0x009011: u'WAVTrace, Inc.', 0x009012: u'GLOBESPAN SEMICONDUCTOR, INC.', 0x009013: u'SAMSAN CORP.', 0x009014: u'ROTORK INSTRUMENTS, LTD.', 0x009015: u'CENTIGRAM COMMUNICATIONS CORP.', 0x009016: u'ZAC', 0x009017: u'ZYPCOM, INC.', 0x009018: u'ITO ELECTRIC INDUSTRY CO, LTD.', 0x009019: u'HERMES ELECTRONICS CO., LTD.', 0x00901A: u'UNISPHERE SOLUTIONS', 0x00901B: u'DIGITAL CONTROLS', 0x00901C: u'mps Software Gmbh', 0x00901D: u'PEC (NZ) LTD.', 0x00901E: u'SELESTA INGEGNE RIA S.P.A.', 0x00901F: u'ADTEC PRODUCTIONS, INC.', 0x009020: u'PHILIPS ANALYTICAL X-RAY B.V.', 0x009021: u'CISCO SYSTEMS, INC.', 0x009022: u'IVEX', 0x009023: u'ZILOG INC.', 0x009024: u'PIPELINKS, INC.', 0x009025: u'VISION SYSTEMS LTD. PTY', 0x009026: u'ADVANCED SWITCHING COMMUNICATIONS, INC.', 0x009027: u'INTEL CORPORATION', 0x009028: u'NIPPON SIGNAL CO., LTD.', 0x009029: u'CRYPTO AG', 0x00902A: u'COMMUNICATION DEVICES, INC.', 0x00902B: u'CISCO SYSTEMS, INC.', 0x00902C: u'DATA & CONTROL EQUIPMENT LTD.', 0x00902D: u'DATA ELECTRONICS (AUST.) PTY, LTD.', 0x00902E: u'NAMCO LIMITED', 0x00902F: u'NETCORE SYSTEMS, INC.', 0x009030: u'HONEYWELL-DATING', 0x009031: u'MYSTICOM, LTD.', 0x009032: u'PELCOMBE GROUP LTD.', 0x009033: u'INNOVAPHONE AG', 0x009034: u'IMAGIC, INC.', 0x009035: u'ALPHA TELECOM, INC.', 0x009036: u'ens, inc.', 0x009037: u'ACUCOMM, INC.', 0x009038: u'FOUNTAIN TECHNOLOGIES, INC.', 0x009039: u'SHASTA NETWORKS', 0x00903A: u'NIHON MEDIA TOOL INC.', 0x00903B: u'TriEMS Research Lab, Inc.', 0x00903C: u'ATLANTIC NETWORK SYSTEMS', 0x00903D: u'BIOPAC SYSTEMS, INC.', 0x00903E: u'N.V. PHILIPS INDUSTRIAL ACTIVITIES', 0x00903F: u'AZTEC RADIOMEDIA', 0x009040: u'Siemens Network Convergence LLC', 0x009041: u'APPLIED DIGITAL ACCESS', 0x009042: u'ECCS, Inc.', 0x009043: u'NICHIBEI DENSHI CO., LTD.', 0x009044: u'ASSURED DIGITAL, INC.', 0x009045: u'Marconi Communications', 0x009046: u'DEXDYNE, LTD.', 0x009047: u'GIGA FAST E. LTD.', 0x009048: u'ZEAL CORPORATION', 0x009049: u'ENTRIDIA CORPORATION', 0x00904A: u'CONCUR SYSTEM TECHNOLOGIES', 0x00904B: u'GemTek Technology Co., Ltd.', 0x00904C: u'EPIGRAM, INC.', 0x00904D: u'SPEC S.A.', 0x00904E: u'DELEM BV', 0x00904F: u'ABB POWER T&D COMPANY, INC.', 0x009050: u'TELESTE OY', 0x009051: u'ULTIMATE TECHNOLOGY CORP.', 0x009052: u'SELCOM ELETTRONICA S.R.L.', 0x009053: u'DAEWOO ELECTRONICS CO., LTD.', 0x009054: u'INNOVATIVE SEMICONDUCTORS, INC', 0x009055: u'PARKER HANNIFIN CORPORATION COMPUMOTOR DIVISION', 0x009056: u'TELESTREAM, INC.', 0x009057: u'AANetcom, Inc.', 0x009058: u'Ultra Electronics Ltd., Command and Control Systems', 0x009059: u'TELECOM DEVICE K.K.', 0x00905A: u'DEARBORN GROUP, INC.', 0x00905B: u'RAYMOND AND LAE ENGINEERING', 0x00905C: u'EDMI', 0x00905D: u'NETCOM SICHERHEITSTECHNIK GmbH', 0x00905E: u'RAULAND-BORG CORPORATION', 0x00905F: u'CISCO SYSTEMS, INC.', 0x009060: u'SYSTEM CREATE CORP.', 0x009061: u'PACIFIC RESEARCH & ENGINEERING CORPORATION', 0x009062: u'ICP VORTEX COMPUTERSYSTEME GmbH', 0x009063: u'COHERENT COMMUNICATIONS SYSTEMS CORPORATION', 0x009064: u'THOMSON BROADCAST SYSTEMS', 0x009065: u'FINISAR CORPORATION', 0x009066: u'Troika Networks, Inc.', 0x009067: u'WalkAbout Computers, Inc.', 0x009068: u'DVT CORP.', 0x009069: u'JUNIPER NETWORKS, INC.', 0x00906A: u'TURNSTONE SYSTEMS, INC.', 0x00906B: u'APPLIED RESOURCES, INC.', 0x00906C: u'Sartorius Hamburg GmbH', 0x00906D: u'CISCO SYSTEMS, INC.', 0x00906E: u'PRAXON, INC.', 0x00906F: u'CISCO SYSTEMS, INC.', 0x009070: u'NEO NETWORKS, INC.', 0x009071: u'Applied Innovation Inc.', 0x009072: u'SIMRAD AS', 0x009073: u'GAIO TECHNOLOGY', 0x009074: u'ARGON NETWORKS, INC.', 0x009075: u'NEC DO BRASIL S.A.', 0x009076: u'FMT AIRCRAFT GATE SUPPORT SYSTEMS AB', 0x009077: u'ADVANCED FIBRE COMMUNICATIONS', 0x009078: u'MER TELEMANAGEMENT SOLUTIONS, LTD.', 0x009079: u'ClearOne, Inc.', 0x00907A: u'SPECTRALINK CORP.', 0x00907B: u'E-TECH, INC.', 0x00907C: u'DIGITALCAST, INC.', 0x00907D: u'Lake Communications', 0x00907E: u'VETRONIX CORP.', 0x00907F: u'WatchGuard Technologies, Inc.', 0x009080: u'NOT LIMITED, INC.', 0x009081: u'ALOHA NETWORKS, INC.', 0x009082: u'FORCE INSTITUTE', 0x009083: u'TURBO COMMUNICATION, INC.', 0x009084: u'ATECH SYSTEM', 0x009085: u'GOLDEN ENTERPRISES, INC.', 0x009086: u'CISCO SYSTEMS, INC.', 0x009087: u'ITIS', 0x009088: u'BAXALL SECURITY LTD.', 0x009089: u'SOFTCOM MICROSYSTEMS, INC.', 0x00908A: u'BAYLY COMMUNICATIONS, INC.', 0x00908B: u'PFU Systems, Inc.', 0x00908C: u'ETREND ELECTRONICS, INC.', 0x00908D: u'VICKERS ELECTRONICS SYSTEMS', 0x00908E: u'Nortel Networks Broadband Access', 0x00908F: u'AUDIO CODES LTD.', 0x009090: u'I-BUS', 0x009091: u'DigitalScape, Inc.', 0x009092: u'CISCO SYSTEMS, INC.', 0x009093: u'NANAO CORPORATION', 0x009094: u'OSPREY TECHNOLOGIES, INC.', 0x009095: u'UNIVERSAL AVIONICS', 0x009096: u'ASKEY COMPUTER CORP.', 0x009097: u'SYCAMORE NETWORKS', 0x009098: u'SBC DESIGNS, INC.', 0x009099: u'ALLIED TELESIS, K.K.', 0x00909A: u'ONE WORLD SYSTEMS, INC.', 0x00909B: u'MARKPOINT AB', 0x00909C: u'Terayon Communications Systems', 0x00909D: u'NovaTech Process Solutions, LLC', 0x00909E: u'Critical IO, LLC', 0x00909F: u'DIGI-DATA CORPORATION', 0x0090A0: u'8X8 INC.', 0x0090A1: u'FLYING PIG SYSTEMS, LTD.', 0x0090A2: u'CYBERTAN TECHNOLOGY, INC.', 0x0090A3: u'Corecess Inc.', 0x0090A4: u'ALTIGA NETWORKS', 0x0090A5: u'SPECTRA LOGIC', 0x0090A6: u'CISCO SYSTEMS, INC.', 0x0090A7: u'CLIENTEC CORPORATION', 0x0090A8: u'NineTiles Networks, Ltd.', 0x0090A9: u'WESTERN DIGITAL', 0x0090AA: u'INDIGO ACTIVE VISION SYSTEMS LIMITED', 0x0090AB: u'CISCO SYSTEMS, INC.', 0x0090AC: u'OPTIVISION, INC.', 0x0090AD: u'ASPECT ELECTRONICS, INC.', 0x0090AE: u'ITALTEL S.p.A.', 0x0090AF: u'J. MORITA MFG. CORP.', 0x0090B0: u'VADEM', 0x0090B1: u'CISCO SYSTEMS, INC.', 0x0090B2: u'AVICI SYSTEMS INC.', 0x0090B3: u'AGRANAT SYSTEMS', 0x0090B4: u'WILLOWBROOK TECHNOLOGIES', 0x0090B5: u'NIKON CORPORATION', 0x0090B6: u'FIBEX SYSTEMS', 0x0090B7: u'DIGITAL LIGHTWAVE, INC.', 0x0090B8: u'ROHDE & SCHWARZ GMBH & CO. KG', 0x0090B9: u'BERAN INSTRUMENTS LTD.', 0x0090BA: u'VALID NETWORKS, INC.', 0x0090BB: u'TAINET COMMUNICATION SYSTEM Corp.', 0x0090BC: u'TELEMANN CO., LTD.', 0x0090BD: u'OMNIA COMMUNICATIONS, INC.', 0x0090BE: u'IBC/INTEGRATED BUSINESS COMPUTERS', 0x0090BF: u'CISCO SYSTEMS, INC.', 0x0090C0: u'K.J. LAW ENGINEERS, INC.', 0x0090C1: u'Peco II, Inc.', 0x0090C2: u'JK microsystems, Inc.', 0x0090C3: u'TOPIC SEMICONDUCTOR CORP.', 0x0090C4: u'JAVELIN SYSTEMS, INC.', 0x0090C5: u'INTERNET MAGIC, INC.', 0x0090C6: u'OPTIM SYSTEMS, INC.', 0x0090C7: u'ICOM INC.', 0x0090C8: u'WAVERIDER COMMUNICATIONS (CANADA) INC.', 0x0090C9: u'DPAC Technologies', 0x0090CA: u'ACCORD VIDEO TELECOMMUNICATIONS, LTD.', 0x0090CB: u'Wireless OnLine, Inc.', 0x0090CC: u'PLANET COMMUNICATIONS, INC.', 0x0090CD: u'ENT-EMPRESA NACIONAL DE TELECOMMUNICACOES, S.A.', 0x0090CE: u'TETRA GmbH', 0x0090CF: u'NORTEL', 0x0090D0: u'Thomson Telecom Belgium', 0x0090D1: u'LEICHU ENTERPRISE CO., LTD.', 0x0090D2: u'ARTEL VIDEO SYSTEMS', 0x0090D3: u'GIESECKE & DEVRIENT GmbH', 0x0090D4: u'BindView Development Corp.', 0x0090D5: u'EUPHONIX, INC.', 0x0090D6: u'CRYSTAL GROUP', 0x0090D7: u'NetBoost Corp.', 0x0090D8: u'WHITECROSS SYSTEMS', 0x0090D9: u'CISCO SYSTEMS, INC.', 0x0090DA: u'DYNARC, INC.', 0x0090DB: u'NEXT LEVEL COMMUNICATIONS', 0x0090DC: u'TECO INFORMATION SYSTEMS', 0x0090DD: u'THE MIHARU COMMUNICATIONS CO., LTD.', 0x0090DE: u'CARDKEY SYSTEMS, INC.', 0x0090DF: u'MITSUBISHI CHEMICAL AMERICA, INC.', 0x0090E0: u'SYSTRAN CORP.', 0x0090E1: u'TELENA S.P.A.', 0x0090E2: u'DISTRIBUTED PROCESSING TECHNOLOGY', 0x0090E3: u'AVEX ELECTRONICS INC.', 0x0090E4: u'NEC AMERICA, INC.', 0x0090E5: u'TEKNEMA, INC.', 0x0090E6: u'ACER LABORATORIES, INC.', 0x0090E7: u'HORSCH ELEKTRONIK AG', 0x0090E8: u'MOXA TECHNOLOGIES CORP., LTD.', 0x0090E9: u'JANZ COMPUTER AG', 0x0090EA: u'ALPHA TECHNOLOGIES, INC.', 0x0090EB: u'SENTRY TELECOM SYSTEMS', 0x0090EC: u'PYRESCOM', 0x0090ED: u'CENTRAL SYSTEM RESEARCH CO., LTD.', 0x0090EE: u'PERSONAL COMMUNICATIONS TECHNOLOGIES', 0x0090EF: u'INTEGRIX, INC.', 0x0090F0: u'Harmonic Video Systems Ltd.', 0x0090F1: u'DOT HILL SYSTEMS CORPORATION', 0x0090F2: u'CISCO SYSTEMS, INC.', 0x0090F3: u'ASPECT COMMUNICATIONS', 0x0090F4: u'LIGHTNING INSTRUMENTATION', 0x0090F5: u'CLEVO CO.', 0x0090F6: u'ESCALATE NETWORKS, INC.', 0x0090F7: u'NBASE COMMUNICATIONS LTD.', 0x0090F8: u'MEDIATRIX TELECOM', 0x0090F9: u'LEITCH', 0x0090FA: u'EMULEX Corp', 0x0090FB: u'PORTWELL, INC.', 0x0090FC: u'NETWORK COMPUTING DEVICES', 0x0090FD: u'CopperCom, Inc.', 0x0090FE: u'ELECOM CO., LTD. (LANEED DIV.)', 0x0090FF: u'TELLUS TECHNOLOGY INC.', 0x0091D6: u'Crystal Group, Inc.', 0x009D8E: u'CARDIAC RECORDERS, INC.', 0x00A000: u'CENTILLION NETWORKS, INC.', 0x00A001: u'DRS Signal Solutions', 0x00A002: u'LEEDS & NORTHRUP AUSTRALIA PTY LTD', 0x00A003: u'STAEFA CONTROL SYSTEM', 0x00A004: u'NETPOWER, INC.', 0x00A005: u'DANIEL INSTRUMENTS, LTD.', 0x00A006: u'IMAGE DATA PROCESSING SYSTEM GROUP', 0x00A007: u'APEXX TECHNOLOGY, INC.', 0x00A008: u'NETCORP', 0x00A009: u'WHITETREE NETWORK', 0x00A00A: u'Airspan', 0x00A00B: u'COMPUTEX CO., LTD.', 0x00A00C: u'KINGMAX TECHNOLOGY, INC.', 0x00A00D: u'THE PANDA PROJECT', 0x00A00E: u'VISUAL NETWORKS, INC.', 0x00A00F: u'Broadband Technologies', 0x00A010: u'SYSLOGIC DATENTECHNIK AG', 0x00A011: u'MUTOH INDUSTRIES LTD.', 0x00A012: u'B.A.T.M. ADVANCED TECHNOLOGIES', 0x00A013: u'TELTREND LTD.', 0x00A014: u'CSIR', 0x00A015: u'WYLE', 0x00A016: u'MICROPOLIS CORP.', 0x00A017: u'J B M CORPORATION', 0x00A018: u'CREATIVE CONTROLLERS, INC.', 0x00A019: u'NEBULA CONSULTANTS, INC.', 0x00A01A: u'BINAR ELEKTRONIK AB', 0x00A01B: u'PREMISYS COMMUNICATIONS, INC.', 0x00A01C: u'NASCENT NETWORKS CORPORATION', 0x00A01D: u'SIXNET', 0x00A01E: u'EST CORPORATION', 0x00A01F: u'TRICORD SYSTEMS, INC.', 0x00A020: u'CITICORP/TTI', 0x00A021: u'General Dynamics', 0x00A022: u'CENTRE FOR DEVELOPMENT OF ADVANCED COMPUTING', 0x00A023: u'APPLIED CREATIVE TECHNOLOGY, INC.', 0x00A024: u'3COM CORPORATION', 0x00A025: u'REDCOM LABS INC.', 0x00A026: u'TELDAT, S.A.', 0x00A027: u'FIREPOWER SYSTEMS, INC.', 0x00A028: u'CONNER PERIPHERALS', 0x00A029: u'COULTER CORPORATION', 0x00A02A: u'TRANCELL SYSTEMS', 0x00A02B: u'TRANSITIONS RESEARCH CORP.', 0x00A02C: u'interWAVE Communications', 0x00A02D: u'1394 Trade Association', 0x00A02E: u'BRAND COMMUNICATIONS, LTD.', 0x00A02F: u'PIRELLI CAVI', 0x00A030: u'CAPTOR NV/SA', 0x00A031: u'HAZELTINE CORPORATION, MS 1-17', 0x00A032: u'GES SINGAPORE PTE. LTD.', 0x00A033: u'imc MeBsysteme GmbH', 0x00A034: u'AXEL', 0x00A035: u'CYLINK CORPORATION', 0x00A036: u'APPLIED NETWORK TECHNOLOGY', 0x00A037: u'DATASCOPE CORPORATION', 0x00A038: u'EMAIL ELECTRONICS', 0x00A039: u'ROSS TECHNOLOGY, INC.', 0x00A03A: u'KUBOTEK CORPORATION', 0x00A03B: u'TOSHIN ELECTRIC CO., LTD.', 0x00A03C: u'EG&G NUCLEAR INSTRUMENTS', 0x00A03D: u'OPTO-22', 0x00A03E: u'ATM FORUM', 0x00A03F: u'COMPUTER SOCIETY MICROPROCESSOR & MICROPROCESSOR STANDARDS C', 0x00A040: u'APPLE COMPUTER', 0x00A041: u'INFICON', 0x00A042: u'SPUR PRODUCTS CORP.', 0x00A043: u'AMERICAN TECHNOLOGY LABS, INC.', 0x00A044: u'NTT IT CO., LTD.', 0x00A045: u'PHOENIX CONTACT GMBH & CO.', 0x00A046: u'SCITEX CORP. LTD.', 0x00A047: u'INTEGRATED FITNESS CORP.', 0x00A048: u'QUESTECH, LTD.', 0x00A049: u'DIGITECH INDUSTRIES, INC.', 0x00A04A: u'NISSHIN ELECTRIC CO., LTD.', 0x00A04B: u'TFL LAN INC.', 0x00A04C: u'INNOVATIVE SYSTEMS & TECHNOLOGIES, INC.', 0x00A04D: u'EDA INSTRUMENTS, INC.', 0x00A04E: u'VOELKER TECHNOLOGIES, INC.', 0x00A04F: u'AMERITEC CORP.', 0x00A050: u'CYPRESS SEMICONDUCTOR', 0x00A051: u'ANGIA COMMUNICATIONS. INC.', 0x00A052: u'STANILITE ELECTRONICS PTY. LTD', 0x00A053: u'COMPACT DEVICES, INC.', 0x00A054: u'PRIVATE', 0x00A055: u'Data Device Corporation', 0x00A056: u'MICROPROSS', 0x00A057: u'LANCOM Systems GmbH', 0x00A058: u'GLORY, LTD.', 0x00A059: u'HAMILTON HALLMARK', 0x00A05A: u'KOFAX IMAGE PRODUCTS', 0x00A05B: u'MARQUIP, INC.', 0x00A05C: u'INVENTORY CONVERSION, INC./', 0x00A05D: u'CS COMPUTER SYSTEME GmbH', 0x00A05E: u'MYRIAD LOGIC INC.', 0x00A05F: u'BTG ENGINEERING BV', 0x00A060: u'ACER PERIPHERALS, INC.', 0x00A061: u'PURITAN BENNETT', 0x00A062: u'AES PRODATA', 0x00A063: u'JRL SYSTEMS, INC.', 0x00A064: u'KVB/ANALECT', 0x00A065: u'Symantec Corporation', 0x00A066: u'ISA CO., LTD.', 0x00A067: u'NETWORK SERVICES GROUP', 0x00A068: u'BHP LIMITED', 0x00A069: u'Symmetricom, Inc.', 0x00A06A: u'Verilink Corporation', 0x00A06B: u'DMS DORSCH MIKROSYSTEM GMBH', 0x00A06C: u'SHINDENGEN ELECTRIC MFG. CO., LTD.', 0x00A06D: u'MANNESMANN TALLY CORPORATION', 0x00A06E: u'AUSTRON, INC.', 0x00A06F: u'THE APPCON GROUP, INC.', 0x00A070: u'COASTCOM', 0x00A071: u'VIDEO LOTTERY TECHNOLOGIES,INC', 0x00A072: u'OVATION SYSTEMS LTD.', 0x00A073: u'COM21, INC.', 0x00A074: u'PERCEPTION TECHNOLOGY', 0x00A075: u'MICRON TECHNOLOGY, INC.', 0x00A076: u'CARDWARE LAB, INC.', 0x00A077: u'FUJITSU NEXION, INC.', 0x00A078: u'Marconi Communications', 0x00A079: u'ALPS ELECTRIC (USA), INC.', 0x00A07A: u'ADVANCED PERIPHERALS TECHNOLOGIES, INC.', 0x00A07B: u'DAWN COMPUTER INCORPORATION', 0x00A07C: u'TONYANG NYLON CO., LTD.', 0x00A07D: u'SEEQ TECHNOLOGY, INC.', 0x00A07E: u'AVID TECHNOLOGY, INC.', 0x00A07F: u'GSM-SYNTEL, LTD.', 0x00A080: u'SBE, Inc.', 0x00A081: u'ALCATEL DATA NETWORKS', 0x00A082: u'NKT ELEKTRONIK A/S', 0x00A083: u'ASIMMPHONY TURKEY', 0x00A084: u'DATAPLEX PTY. LTD.', 0x00A085: u'PRIVATE', 0x00A086: u'AMBER WAVE SYSTEMS, INC.', 0x00A087: u'Zarlink Semiconductor Ltd.', 0x00A088: u'ESSENTIAL COMMUNICATIONS', 0x00A089: u'XPOINT TECHNOLOGIES, INC.', 0x00A08A: u'BROOKTROUT TECHNOLOGY, INC.', 0x00A08B: u'ASTON ELECTRONIC DESIGNS LTD.', 0x00A08C: u'MultiMedia LANs, Inc.', 0x00A08D: u'JACOMO CORPORATION', 0x00A08E: u'Nokia Internet Communications', 0x00A08F: u'DESKNET SYSTEMS, INC.', 0x00A090: u'TimeStep Corporation', 0x00A091: u'APPLICOM INTERNATIONAL', 0x00A092: u'H. BOLLMANN MANUFACTURERS, LTD', 0x00A093: u'B/E AEROSPACE, Inc.', 0x00A094: u'COMSAT CORPORATION', 0x00A095: u'ACACIA NETWORKS, INC.', 0x00A096: u'MITUMI ELECTRIC CO., LTD.', 0x00A097: u'JC INFORMATION SYSTEMS', 0x00A098: u'NETWORK APPLIANCE CORP.', 0x00A099: u'K-NET LTD.', 0x00A09A: u'NIHON KOHDEN AMERICA', 0x00A09B: u'QPSX COMMUNICATIONS, LTD.', 0x00A09C: u'Xyplex, Inc.', 0x00A09D: u'JOHNATHON FREEMAN TECHNOLOGIES', 0x00A09E: u'ICTV', 0x00A09F: u'COMMVISION CORP.', 0x00A0A0: u'COMPACT DATA, LTD.', 0x00A0A1: u'EPIC DATA INC.', 0x00A0A2: u'DIGICOM S.P.A.', 0x00A0A3: u'RELIABLE POWER METERS', 0x00A0A4: u'MICROS SYSTEMS, INC.', 0x00A0A5: u'TEKNOR MICROSYSTEME, INC.', 0x00A0A6: u'M.I. SYSTEMS, K.K.', 0x00A0A7: u'VORAX CORPORATION', 0x00A0A8: u'RENEX CORPORATION', 0x00A0A9: u'NAVTEL COMMUNICATIONS INC.', 0x00A0AA: u'SPACELABS MEDICAL', 0x00A0AB: u'NETCS INFORMATIONSTECHNIK GMBH', 0x00A0AC: u'GILAT SATELLITE NETWORKS, LTD.', 0x00A0AD: u'MARCONI SPA', 0x00A0AE: u'NUCOM SYSTEMS, INC.', 0x00A0AF: u'WMS INDUSTRIES', 0x00A0B0: u'I-O DATA DEVICE, INC.', 0x00A0B1: u'FIRST VIRTUAL CORPORATION', 0x00A0B2: u'SHIMA SEIKI', 0x00A0B3: u'ZYKRONIX', 0x00A0B4: u'TEXAS MICROSYSTEMS, INC.', 0x00A0B5: u'3H TECHNOLOGY', 0x00A0B6: u'SANRITZ AUTOMATION CO., LTD.', 0x00A0B7: u'CORDANT, INC.', 0x00A0B8: u'SYMBIOS LOGIC INC.', 0x00A0B9: u'EAGLE TECHNOLOGY, INC.', 0x00A0BA: u'PATTON ELECTRONICS CO.', 0x00A0BB: u'HILAN GMBH', 0x00A0BC: u'VIASAT, INCORPORATED', 0x00A0BD: u'I-TECH CORP.', 0x00A0BE: u'INTEGRATED CIRCUIT SYSTEMS, INC. COMMUNICATIONS GROUP', 0x00A0BF: u'WIRELESS DATA GROUP MOTOROLA', 0x00A0C0: u'DIGITAL LINK CORP.', 0x00A0C1: u'ORTIVUS MEDICAL AB', 0x00A0C2: u'R.A. SYSTEMS CO., LTD.', 0x00A0C3: u'UNICOMPUTER GMBH', 0x00A0C4: u'CRISTIE ELECTRONICS LTD.', 0x00A0C5: u'ZYXEL COMMUNICATION', 0x00A0C6: u'QUALCOMM INCORPORATED', 0x00A0C7: u'TADIRAN TELECOMMUNICATIONS', 0x00A0C8: u'ADTRAN INC.', 0x00A0C9: u'INTEL CORPORATION - HF1-06', 0x00A0CA: u'FUJITSU DENSO LTD.', 0x00A0CB: u'ARK TELECOMMUNICATIONS, INC.', 0x00A0CC: u'LITE-ON COMMUNICATIONS, INC.', 0x00A0CD: u'DR. JOHANNES HEIDENHAIN GmbH', 0x00A0CE: u'ASTROCOM CORPORATION', 0x00A0CF: u'SOTAS, INC.', 0x00A0D0: u'TEN X TECHNOLOGY, INC.', 0x00A0D1: u'INVENTEC CORPORATION', 0x00A0D2: u'ALLIED TELESIS INTERNATIONAL CORPORATION', 0x00A0D3: u'INSTEM COMPUTER SYSTEMS, LTD.', 0x00A0D4: u'RADIOLAN, INC.', 0x00A0D5: u'SIERRA WIRELESS INC.', 0x00A0D6: u'SBE, INC.', 0x00A0D7: u'KASTEN CHASE APPLIED RESEARCH', 0x00A0D8: u'SPECTRA - TEK', 0x00A0D9: u'CONVEX COMPUTER CORPORATION', 0x00A0DA: u'INTEGRATED SYSTEMS Technology, Inc.', 0x00A0DB: u'FISHER & PAYKEL PRODUCTION', 0x00A0DC: u'O.N. ELECTRONIC CO., LTD.', 0x00A0DD: u'AZONIX CORPORATION', 0x00A0DE: u'YAMAHA CORPORATION', 0x00A0DF: u'STS TECHNOLOGIES, INC.', 0x00A0E0: u'TENNYSON TECHNOLOGIES PTY LTD', 0x00A0E1: u'WESTPORT RESEARCH ASSOCIATES, INC.', 0x00A0E2: u'KEISOKU GIKEN CORP.', 0x00A0E3: u'XKL SYSTEMS CORP.', 0x00A0E4: u'OPTIQUEST', 0x00A0E5: u'NHC COMMUNICATIONS', 0x00A0E6: u'DIALOGIC CORPORATION', 0x00A0E7: u'CENTRAL DATA CORPORATION', 0x00A0E8: u'REUTERS HOLDINGS PLC', 0x00A0E9: u'ELECTRONIC RETAILING SYSTEMS INTERNATIONAL', 0x00A0EA: u'ETHERCOM CORP.', 0x00A0EB: u'Encore Networks', 0x00A0EC: u'TRANSMITTON LTD.', 0x00A0ED: u'Brooks Automation, Inc.', 0x00A0EE: u'NASHOBA NETWORKS', 0x00A0EF: u'LUCIDATA LTD.', 0x00A0F0: u'TORONTO MICROELECTRONICS INC.', 0x00A0F1: u'MTI', 0x00A0F2: u'INFOTEK COMMUNICATIONS, INC.', 0x00A0F3: u'STAUBLI', 0x00A0F4: u'GE', 0x00A0F5: u'RADGUARD LTD.', 0x00A0F6: u'AutoGas Systems Inc.', 0x00A0F7: u'V.I COMPUTER CORP.', 0x00A0F8: u'SYMBOL TECHNOLOGIES, INC.', 0x00A0F9: u'BINTEC COMMUNICATIONS GMBH', 0x00A0FA: u'Marconi Communication GmbH', 0x00A0FB: u'TORAY ENGINEERING CO., LTD.', 0x00A0FC: u'IMAGE SCIENCES, INC.', 0x00A0FD: u'SCITEX DIGITAL PRINTING, INC.', 0x00A0FE: u'BOSTON TECHNOLOGY, INC.', 0x00A0FF: u'TELLABS OPERATIONS, INC.', 0x00AA00: u'INTEL CORPORATION', 0x00AA01: u'INTEL CORPORATION', 0x00AA02: u'INTEL CORPORATION', 0x00AA3C: u'OLIVETTI TELECOM SPA (OLTECO)', 0x00B009: u'Grass Valley Group', 0x00B017: u'InfoGear Technology Corp.', 0x00B019: u'Casi-Rusco', 0x00B01C: u'Westport Technologies', 0x00B01E: u'Rantic Labs, Inc.', 0x00B02A: u'ORSYS GmbH', 0x00B02D: u'ViaGate Technologies, Inc.', 0x00B03B: u'HiQ Networks', 0x00B048: u'Marconi Communications Inc.', 0x00B04A: u'Cisco Systems, Inc.', 0x00B052: u'Intellon Corporation', 0x00B064: u'Cisco Systems, Inc.', 0x00B069: u'Honewell Oy', 0x00B06D: u'Jones Futurex Inc.', 0x00B080: u'Mannesmann Ipulsys B.V.', 0x00B086: u'LocSoft Limited', 0x00B08E: u'Cisco Systems, Inc.', 0x00B091: u'Transmeta Corp.', 0x00B094: u'Alaris, Inc.', 0x00B09A: u'Morrow Technologies Corp.', 0x00B09D: u'Point Grey Research Inc.', 0x00B0AC: u'SIAE-Microelettronica S.p.A.', 0x00B0AE: u'Symmetricom', 0x00B0B3: u'Xstreamis PLC', 0x00B0C2: u'Cisco Systems, Inc.', 0x00B0C7: u'Tellabs Operations, Inc.', 0x00B0CE: u'TECHNOLOGY RESCUE', 0x00B0D0: u'Dell Computer Corp.', 0x00B0DB: u'Nextcell, Inc.', 0x00B0DF: u'Reliable Data Technology, Inc.', 0x00B0E7: u'British Federal Ltd.', 0x00B0EC: u'EACEM', 0x00B0EE: u'Ajile Systems, Inc.', 0x00B0F0: u'CALY NETWORKS', 0x00B0F5: u'NetWorth Technologies, Inc.', 0x00BAC0: u'Biometric Access Company', 0x00BB01: u'OCTOTHORPE CORP.', 0x00BBF0: u'UNGERMANN-BASS INC.', 0x00C000: u'LANOPTICS, LTD.', 0x00C001: u'DIATEK PATIENT MANAGMENT', 0x00C002: u'SERCOMM CORPORATION', 0x00C003: u'GLOBALNET COMMUNICATIONS', 0x00C004: u'JAPAN BUSINESS COMPUTER CO.LTD', 0x00C005: u'LIVINGSTON ENTERPRISES, INC.', 0x00C006: u'NIPPON AVIONICS CO., LTD.', 0x00C007: u'PINNACLE DATA SYSTEMS, INC.', 0x00C008: u'SECO SRL', 0x00C009: u'KT TECHNOLOGY (S) PTE LTD', 0x00C00A: u'MICRO CRAFT', 0x00C00B: u'NORCONTROL A.S.', 0x00C00C: u'RELIA TECHNOLGIES', 0x00C00D: u'ADVANCED LOGIC RESEARCH, INC.', 0x00C00E: u'PSITECH, INC.', 0x00C00F: u'QUANTUM SOFTWARE SYSTEMS LTD.', 0x00C010: u'HIRAKAWA HEWTECH CORP.', 0x00C011: u'INTERACTIVE COMPUTING DEVICES', 0x00C012: u'NETSPAN CORPORATION', 0x00C013: u'NETRIX', 0x00C014: u'TELEMATICS CALABASAS INT\'L,INC', 0x00C015: u'NEW MEDIA CORPORATION', 0x00C016: u'ELECTRONIC THEATRE CONTROLS', 0x00C017: u'FORTE NETWORKS', 0x00C018: u'LANART CORPORATION', 0x00C019: u'LEAP TECHNOLOGY, INC.', 0x00C01A: u'COROMETRICS MEDICAL SYSTEMS', 0x00C01B: u'SOCKET COMMUNICATIONS, INC.', 0x00C01C: u'INTERLINK COMMUNICATIONS LTD.', 0x00C01D: u'GRAND JUNCTION NETWORKS, INC.', 0x00C01E: u'LA FRANCAISE DES JEUX', 0x00C01F: u'S.E.R.C.E.L.', 0x00C020: u'ARCO ELECTRONIC, CONTROL LTD.', 0x00C021: u'NETEXPRESS', 0x00C022: u'LASERMASTER TECHNOLOGIES, INC.', 0x00C023: u'TUTANKHAMON ELECTRONICS', 0x00C024: u'EDEN SISTEMAS DE COMPUTACAO SA', 0x00C025: u'DATAPRODUCTS CORPORATION', 0x00C026: u'LANS TECHNOLOGY CO., LTD.', 0x00C027: u'CIPHER SYSTEMS, INC.', 0x00C028: u'JASCO CORPORATION', 0x00C029: u'Nexans Deutschland AG - ANS', 0x00C02A: u'OHKURA ELECTRIC CO., LTD.', 0x00C02B: u'GERLOFF GESELLSCHAFT FUR', 0x00C02C: u'CENTRUM COMMUNICATIONS, INC.', 0x00C02D: u'FUJI PHOTO FILM CO., LTD.', 0x00C02E: u'NETWIZ', 0x00C02F: u'OKUMA CORPORATION', 0x00C030: u'INTEGRATED ENGINEERING B. V.', 0x00C031: u'DESIGN RESEARCH SYSTEMS, INC.', 0x00C032: u'I-CUBED LIMITED', 0x00C033: u'TELEBIT COMMUNICATIONS APS', 0x00C034: u'TRANSACTION NETWORK', 0x00C035: u'QUINTAR COMPANY', 0x00C036: u'RAYTECH ELECTRONIC CORP.', 0x00C037: u'DYNATEM', 0x00C038: u'RASTER IMAGE PROCESSING SYSTEM', 0x00C039: u'Teridian Semiconductor Corporation', 0x00C03A: u'MEN-MIKRO ELEKTRONIK GMBH', 0x00C03B: u'MULTIACCESS COMPUTING CORP.', 0x00C03C: u'TOWER TECH S.R.L.', 0x00C03D: u'WIESEMANN & THEIS GMBH', 0x00C03E: u'FA. GEBR. HELLER GMBH', 0x00C03F: u'STORES AUTOMATED SYSTEMS, INC.', 0x00C040: u'ECCI', 0x00C041: u'DIGITAL TRANSMISSION SYSTEMS', 0x00C042: u'DATALUX CORP.', 0x00C043: u'STRATACOM', 0x00C044: u'EMCOM CORPORATION', 0x00C045: u'ISOLATION SYSTEMS, LTD.', 0x00C046: u'KEMITRON LTD.', 0x00C047: u'UNIMICRO SYSTEMS, INC.', 0x00C048: u'BAY TECHNICAL ASSOCIATES', 0x00C049: u'U.S. ROBOTICS, INC.', 0x00C04A: u'GROUP 2000 AG', 0x00C04B: u'CREATIVE MICROSYSTEMS', 0x00C04C: u'DEPARTMENT OF FOREIGN AFFAIRS', 0x00C04D: u'MITEC, INC.', 0x00C04E: u'COMTROL CORPORATION', 0x00C04F: u'DELL COMPUTER CORPORATION', 0x00C050: u'TOYO DENKI SEIZO K.K.', 0x00C051: u'ADVANCED INTEGRATION RESEARCH', 0x00C052: u'BURR-BROWN', 0x00C053: u'Concerto Software', 0x00C054: u'NETWORK PERIPHERALS, LTD.', 0x00C055: u'MODULAR COMPUTING TECHNOLOGIES', 0x00C056: u'SOMELEC', 0x00C057: u'MYCO ELECTRONICS', 0x00C058: u'DATAEXPERT CORP.', 0x00C059: u'NIPPON DENSO CO., LTD.', 0x00C05A: u'SEMAPHORE COMMUNICATIONS CORP.', 0x00C05B: u'NETWORKS NORTHWEST, INC.', 0x00C05C: u'ELONEX PLC', 0x00C05D: u'L&N TECHNOLOGIES', 0x00C05E: u'VARI-LITE, INC.', 0x00C05F: u'FINE-PAL COMPANY LIMITED', 0x00C060: u'ID SCANDINAVIA AS', 0x00C061: u'SOLECTEK CORPORATION', 0x00C062: u'IMPULSE TECHNOLOGY', 0x00C063: u'MORNING STAR TECHNOLOGIES, INC', 0x00C064: u'GENERAL DATACOMM IND. INC.', 0x00C065: u'SCOPE COMMUNICATIONS, INC.', 0x00C066: u'DOCUPOINT, INC.', 0x00C067: u'UNITED BARCODE INDUSTRIES', 0x00C068: u'PHILIP DRAKE ELECTRONICS LTD.', 0x00C069: u'Axxcelera Broadband Wireless', 0x00C06A: u'ZAHNER-ELEKTRIK GMBH & CO. KG', 0x00C06B: u'OSI PLUS CORPORATION', 0x00C06C: u'SVEC COMPUTER CORP.', 0x00C06D: u'BOCA RESEARCH, INC.', 0x00C06E: u'HAFT TECHNOLOGY, INC.', 0x00C06F: u'KOMATSU LTD.', 0x00C070: u'SECTRA SECURE-TRANSMISSION AB', 0x00C071: u'AREANEX COMMUNICATIONS, INC.', 0x00C072: u'KNX LTD.', 0x00C073: u'XEDIA CORPORATION', 0x00C074: u'TOYODA AUTOMATIC LOOM', 0x00C075: u'XANTE CORPORATION', 0x00C076: u'I-DATA INTERNATIONAL A-S', 0x00C077: u'DAEWOO TELECOM LTD.', 0x00C078: u'COMPUTER SYSTEMS ENGINEERING', 0x00C079: u'FONSYS CO.,LTD.', 0x00C07A: u'PRIVA B.V.', 0x00C07B: u'ASCEND COMMUNICATIONS, INC.', 0x00C07C: u'HIGHTECH INFORMATION', 0x00C07D: u'RISC DEVELOPMENTS LTD.', 0x00C07E: u'KUBOTA CORPORATION ELECTRONIC', 0x00C07F: u'NUPON COMPUTING CORP.', 0x00C080: u'NETSTAR, INC.', 0x00C081: u'METRODATA LTD.', 0x00C082: u'MOORE PRODUCTS CO.', 0x00C083: u'TRACE MOUNTAIN PRODUCTS, INC.', 0x00C084: u'DATA LINK CORP. LTD.', 0x00C085: u'ELECTRONICS FOR IMAGING, INC.', 0x00C086: u'THE LYNK CORPORATION', 0x00C087: u'UUNET TECHNOLOGIES, INC.', 0x00C088: u'EKF ELEKTRONIK GMBH', 0x00C089: u'TELINDUS DISTRIBUTION', 0x00C08A: u'LAUTERBACH DATENTECHNIK GMBH', 0x00C08B: u'RISQ MODULAR SYSTEMS, INC.', 0x00C08C: u'PERFORMANCE TECHNOLOGIES, INC.', 0x00C08D: u'TRONIX PRODUCT DEVELOPMENT', 0x00C08E: u'NETWORK INFORMATION TECHNOLOGY', 0x00C08F: u'Matsushita Electric Works, Ltd.', 0x00C090: u'PRAIM S.R.L.', 0x00C091: u'JABIL CIRCUIT, INC.', 0x00C092: u'MENNEN MEDICAL INC.', 0x00C093: u'ALTA RESEARCH CORP.', 0x00C094: u'VMX INC.', 0x00C095: u'ZNYX', 0x00C096: u'TAMURA CORPORATION', 0x00C097: u'ARCHIPEL SA', 0x00C098: u'CHUNTEX ELECTRONIC CO., LTD.', 0x00C099: u'YOSHIKI INDUSTRIAL CO.,LTD.', 0x00C09A: u'PHOTONICS CORPORATION', 0x00C09B: u'RELIANCE COMM/TEC, R-TEC', 0x00C09C: u'TOA ELECTRONIC LTD.', 0x00C09D: u'DISTRIBUTED SYSTEMS INT\'L, INC', 0x00C09E: u'CACHE COMPUTERS, INC.', 0x00C09F: u'QUANTA COMPUTER, INC.', 0x00C0A0: u'ADVANCE MICRO RESEARCH, INC.', 0x00C0A1: u'TOKYO DENSHI SEKEI CO.', 0x00C0A2: u'INTERMEDIUM A/S', 0x00C0A3: u'DUAL ENTERPRISES CORPORATION', 0x00C0A4: u'UNIGRAF OY', 0x00C0A5: u'DICKENS DATA SYSTEMS', 0x00C0A6: u'EXICOM AUSTRALIA PTY. LTD', 0x00C0A7: u'SEEL LTD.', 0x00C0A8: u'GVC CORPORATION', 0x00C0A9: u'BARRON MCCANN LTD.', 0x00C0AA: u'SILICON VALLEY COMPUTER', 0x00C0AB: u'Telco Systems, Inc.', 0x00C0AC: u'GAMBIT COMPUTER COMMUNICATIONS', 0x00C0AD: u'MARBEN COMMUNICATION SYSTEMS', 0x00C0AE: u'TOWERCOM CO. INC. DBA PC HOUSE', 0x00C0AF: u'TEKLOGIX INC.', 0x00C0B0: u'GCC TECHNOLOGIES,INC.', 0x00C0B1: u'GENIUS NET CO.', 0x00C0B2: u'NORAND CORPORATION', 0x00C0B3: u'COMSTAT DATACOMM CORPORATION', 0x00C0B4: u'MYSON TECHNOLOGY, INC.', 0x00C0B5: u'CORPORATE NETWORK SYSTEMS,INC.', 0x00C0B6: u'Adaptec, Inc.', 0x00C0B7: u'AMERICAN POWER CONVERSION CORP', 0x00C0B8: u'FRASER\'S HILL LTD.', 0x00C0B9: u'FUNK SOFTWARE, INC.', 0x00C0BA: u'NETVANTAGE', 0x00C0BB: u'FORVAL CREATIVE, INC.', 0x00C0BC: u'TELECOM AUSTRALIA/CSSC', 0x00C0BD: u'INEX TECHNOLOGIES, INC.', 0x00C0BE: u'ALCATEL - SEL', 0x00C0BF: u'TECHNOLOGY CONCEPTS, LTD.', 0x00C0C0: u'SHORE MICROSYSTEMS, INC.', 0x00C0C1: u'QUAD/GRAPHICS, INC.', 0x00C0C2: u'INFINITE NETWORKS LTD.', 0x00C0C3: u'ACUSON COMPUTED SONOGRAPHY', 0x00C0C4: u'COMPUTER OPERATIONAL', 0x00C0C5: u'SID INFORMATICA', 0x00C0C6: u'PERSONAL MEDIA CORP.', 0x00C0C7: u'SPARKTRUM MICROSYSTEMS, INC.', 0x00C0C8: u'MICRO BYTE PTY. LTD.', 0x00C0C9: u'ELSAG BAILEY PROCESS', 0x00C0CA: u'ALFA, INC.', 0x00C0CB: u'CONTROL TECHNOLOGY CORPORATION', 0x00C0CC: u'TELESCIENCES CO SYSTEMS, INC.', 0x00C0CD: u'COMELTA, S.A.', 0x00C0CE: u'CEI SYSTEMS & ENGINEERING PTE', 0x00C0CF: u'IMATRAN VOIMA OY', 0x00C0D0: u'RATOC SYSTEM INC.', 0x00C0D1: u'COMTREE TECHNOLOGY CORPORATION', 0x00C0D2: u'SYNTELLECT, INC.', 0x00C0D3: u'OLYMPUS IMAGE SYSTEMS, INC.', 0x00C0D4: u'AXON NETWORKS, INC.', 0x00C0D5: u'QUANCOM ELECTRONIC GMBH', 0x00C0D6: u'J1 SYSTEMS, INC.', 0x00C0D7: u'TAIWAN TRADING CENTER DBA', 0x00C0D8: u'UNIVERSAL DATA SYSTEMS', 0x00C0D9: u'QUINTE NETWORK CONFIDENTIALITY', 0x00C0DA: u'NICE SYSTEMS LTD.', 0x00C0DB: u'IPC CORPORATION (PTE) LTD.', 0x00C0DC: u'EOS TECHNOLOGIES, INC.', 0x00C0DD: u'QLogic Corporation', 0x00C0DE: u'ZCOMM, INC.', 0x00C0DF: u'KYE Systems Corp.', 0x00C0E0: u'DSC COMMUNICATION CORP.', 0x00C0E1: u'SONIC SOLUTIONS', 0x00C0E2: u'CALCOMP, INC.', 0x00C0E3: u'OSITECH COMMUNICATIONS, INC.', 0x00C0E4: u'SIEMENS BUILDING', 0x00C0E5: u'GESPAC, S.A.', 0x00C0E6: u'Verilink Corporation', 0x00C0E7: u'FIBERDATA AB', 0x00C0E8: u'PLEXCOM, INC.', 0x00C0E9: u'OAK SOLUTIONS, LTD.', 0x00C0EA: u'ARRAY TECHNOLOGY LTD.', 0x00C0EB: u'SEH COMPUTERTECHNIK GMBH', 0x00C0EC: u'DAUPHIN TECHNOLOGY', 0x00C0ED: u'US ARMY ELECTRONIC', 0x00C0EE: u'KYOCERA CORPORATION', 0x00C0EF: u'ABIT CORPORATION', 0x00C0F0: u'KINGSTON TECHNOLOGY CORP.', 0x00C0F1: u'SHINKO ELECTRIC CO., LTD.', 0x00C0F2: u'TRANSITION NETWORKS', 0x00C0F3: u'NETWORK COMMUNICATIONS CORP.', 0x00C0F4: u'INTERLINK SYSTEM CO., LTD.', 0x00C0F5: u'METACOMP, INC.', 0x00C0F6: u'CELAN TECHNOLOGY INC.', 0x00C0F7: u'ENGAGE COMMUNICATION, INC.', 0x00C0F8: u'ABOUT COMPUTING INC.', 0x00C0F9: u'Motorola Embedded Computing Group', 0x00C0FA: u'CANARY COMMUNICATIONS, INC.', 0x00C0FB: u'ADVANCED TECHNOLOGY LABS', 0x00C0FC: u'ELASTIC REALITY, INC.', 0x00C0FD: u'PROSUM', 0x00C0FE: u'APTEC COMPUTER SYSTEMS, INC.', 0x00C0FF: u'DOT HILL SYSTEMS CORPORATION', 0x00CBBD: u'Cambridge Broadband Ltd.', 0x00CF1C: u'COMMUNICATION MACHINERY CORP.', 0x00D000: u'FERRAN SCIENTIFIC, INC.', 0x00D001: u'VST TECHNOLOGIES, INC.', 0x00D002: u'DITECH CORPORATION', 0x00D003: u'COMDA ENTERPRISES CORP.', 0x00D004: u'PENTACOM LTD.', 0x00D005: u'ZHS ZEITMANAGEMENTSYSTEME', 0x00D006: u'CISCO SYSTEMS, INC.', 0x00D007: u'MIC ASSOCIATES, INC.', 0x00D008: u'MACTELL CORPORATION', 0x00D009: u'HSING TECH. ENTERPRISE CO. LTD', 0x00D00A: u'LANACCESS TELECOM S.A.', 0x00D00B: u'RHK TECHNOLOGY, INC.', 0x00D00C: u'SNIJDER MICRO SYSTEMS', 0x00D00D: u'MICROMERITICS INSTRUMENT', 0x00D00E: u'PLURIS, INC.', 0x00D00F: u'SPEECH DESIGN GMBH', 0x00D010: u'CONVERGENT NETWORKS, INC.', 0x00D011: u'PRISM VIDEO, INC.', 0x00D012: u'GATEWORKS CORP.', 0x00D013: u'PRIMEX AEROSPACE COMPANY', 0x00D014: u'ROOT, INC.', 0x00D015: u'UNIVEX MICROTECHNOLOGY CORP.', 0x00D016: u'SCM MICROSYSTEMS, INC.', 0x00D017: u'SYNTECH INFORMATION CO., LTD.', 0x00D018: u'QWES. COM, INC.', 0x00D019: u'DAINIPPON SCREEN CORPORATE', 0x00D01A: u'URMET TLC S.P.A.', 0x00D01B: u'MIMAKI ENGINEERING CO., LTD.', 0x00D01C: u'SBS TECHNOLOGIES,', 0x00D01D: u'FURUNO ELECTRIC CO., LTD.', 0x00D01E: u'PINGTEL CORP.', 0x00D01F: u'CTAM PTY. LTD.', 0x00D020: u'AIM SYSTEM, INC.', 0x00D021: u'REGENT ELECTRONICS CORP.', 0x00D022: u'INCREDIBLE TECHNOLOGIES, INC.', 0x00D023: u'INFORTREND TECHNOLOGY, INC.', 0x00D024: u'Cognex Corporation', 0x00D025: u'XROSSTECH, INC.', 0x00D026: u'HIRSCHMANN AUSTRIA GMBH', 0x00D027: u'APPLIED AUTOMATION, INC.', 0x00D028: u'OMNEON VIDEO NETWORKS', 0x00D029: u'WAKEFERN FOOD CORPORATION', 0x00D02A: u'Voxent Systems Ltd.', 0x00D02B: u'JETCELL, INC.', 0x00D02C: u'CAMPBELL SCIENTIFIC, INC.', 0x00D02D: u'ADEMCO', 0x00D02E: u'COMMUNICATION AUTOMATION CORP.', 0x00D02F: u'VLSI TECHNOLOGY INC.', 0x00D030: u'SAFETRAN SYSTEMS CORP.', 0x00D031: u'INDUSTRIAL LOGIC CORPORATION', 0x00D032: u'YANO ELECTRIC CO., LTD.', 0x00D033: u'DALIAN DAXIAN NETWORK', 0x00D034: u'ORMEC SYSTEMS CORP.', 0x00D035: u'BEHAVIOR TECH. COMPUTER CORP.', 0x00D036: u'TECHNOLOGY ATLANTA CORP.', 0x00D037: u'PHILIPS-DVS-LO BDR', 0x00D038: u'FIVEMERE, LTD.', 0x00D039: u'UTILICOM, INC.', 0x00D03A: u'ZONEWORX, INC.', 0x00D03B: u'VISION PRODUCTS PTY. LTD.', 0x00D03C: u'Vieo, Inc.', 0x00D03D: u'GALILEO TECHNOLOGY, LTD.', 0x00D03E: u'ROCKETCHIPS, INC.', 0x00D03F: u'AMERICAN COMMUNICATION', 0x00D040: u'SYSMATE CO., LTD.', 0x00D041: u'AMIGO TECHNOLOGY CO., LTD.', 0x00D042: u'MAHLO GMBH & CO. UG', 0x00D043: u'ZONAL RETAIL DATA SYSTEMS', 0x00D044: u'ALIDIAN NETWORKS, INC.', 0x00D045: u'KVASER AB', 0x00D046: u'DOLBY LABORATORIES, INC.', 0x00D047: u'XN TECHNOLOGIES', 0x00D048: u'ECTON, INC.', 0x00D049: u'IMPRESSTEK CO., LTD.', 0x00D04A: u'PRESENCE TECHNOLOGY GMBH', 0x00D04B: u'LA CIE GROUP S.A.', 0x00D04C: u'EUROTEL TELECOM LTD.', 0x00D04D: u'DIV OF RESEARCH & STATISTICS', 0x00D04E: u'LOGIBAG', 0x00D04F: u'BITRONICS, INC.', 0x00D050: u'ISKRATEL', 0x00D051: u'O2 MICRO, INC.', 0x00D052: u'ASCEND COMMUNICATIONS, INC.', 0x00D053: u'CONNECTED SYSTEMS', 0x00D054: u'SAS INSTITUTE INC.', 0x00D055: u'KATHREIN-WERKE KG', 0x00D056: u'SOMAT CORPORATION', 0x00D057: u'ULTRAK, INC.', 0x00D058: u'CISCO SYSTEMS, INC.', 0x00D059: u'AMBIT MICROSYSTEMS CORP.', 0x00D05A: u'SYMBIONICS, LTD.', 0x00D05B: u'ACROLOOP MOTION CONTROL', 0x00D05C: u'TECHNOTREND SYSTEMTECHNIK GMBH', 0x00D05D: u'INTELLIWORXX, INC.', 0x00D05E: u'STRATABEAM TECHNOLOGY, INC.', 0x00D05F: u'VALCOM, INC.', 0x00D060: u'PANASONIC EUROPEAN', 0x00D061: u'TREMON ENTERPRISES CO., LTD.', 0x00D062: u'DIGIGRAM', 0x00D063: u'CISCO SYSTEMS, INC.', 0x00D064: u'MULTITEL', 0x00D065: u'TOKO ELECTRIC', 0x00D066: u'WINTRISS ENGINEERING CORP.', 0x00D067: u'CAMPIO COMMUNICATIONS', 0x00D068: u'IWILL CORPORATION', 0x00D069: u'TECHNOLOGIC SYSTEMS', 0x00D06A: u'LINKUP SYSTEMS CORPORATION', 0x00D06B: u'SR TELECOM INC.', 0x00D06C: u'SHAREWAVE, INC.', 0x00D06D: u'ACRISON, INC.', 0x00D06E: u'TRENDVIEW RECORDERS LTD.', 0x00D06F: u'KMC CONTROLS', 0x00D070: u'LONG WELL ELECTRONICS CORP.', 0x00D071: u'ECHELON CORP.', 0x00D072: u'BROADLOGIC', 0x00D073: u'ACN ADVANCED COMMUNICATIONS', 0x00D074: u'TAQUA SYSTEMS, INC.', 0x00D075: u'ALARIS MEDICAL SYSTEMS, INC.', 0x00D076: u'Merrill Lynch & Co., Inc.', 0x00D077: u'LUCENT TECHNOLOGIES', 0x00D078: u'ELTEX OF SWEDEN AB', 0x00D079: u'CISCO SYSTEMS, INC.', 0x00D07A: u'AMAQUEST COMPUTER CORP.', 0x00D07B: u'COMCAM INTERNATIONAL LTD.', 0x00D07C: u'KOYO ELECTRONICS INC. CO.,LTD.', 0x00D07D: u'COSINE COMMUNICATIONS', 0x00D07E: u'KEYCORP LTD.', 0x00D07F: u'STRATEGY & TECHNOLOGY, LIMITED', 0x00D080: u'EXABYTE CORPORATION', 0x00D081: u'REAL TIME DEVICES USA, INC.', 0x00D082: u'IOWAVE INC.', 0x00D083: u'INVERTEX, INC.', 0x00D084: u'NEXCOMM SYSTEMS, INC.', 0x00D085: u'OTIS ELEVATOR COMPANY', 0x00D086: u'FOVEON, INC.', 0x00D087: u'MICROFIRST INC.', 0x00D088: u'Terayon Communications Systems', 0x00D089: u'DYNACOLOR, INC.', 0x00D08A: u'PHOTRON USA', 0x00D08B: u'ADVA Limited', 0x00D08C: u'GENOA TECHNOLOGY, INC.', 0x00D08D: u'PHOENIX GROUP, INC.', 0x00D08E: u'NVISION INC.', 0x00D08F: u'ARDENT TECHNOLOGIES, INC.', 0x00D090: u'CISCO SYSTEMS, INC.', 0x00D091: u'SMARTSAN SYSTEMS, INC.', 0x00D092: u'GLENAYRE WESTERN MULTIPLEX', 0x00D093: u'TQ - COMPONENTS GMBH', 0x00D094: u'TIMELINE VISTA, INC.', 0x00D095: u'Alcatel North America ESD', 0x00D096: u'3COM EUROPE LTD.', 0x00D097: u'CISCO SYSTEMS, INC.', 0x00D098: u'Photon Dynamics Canada Inc.', 0x00D099: u'ELCARD OY', 0x00D09A: u'FILANET CORPORATION', 0x00D09B: u'SPECTEL LTD.', 0x00D09C: u'KAPADIA COMMUNICATIONS', 0x00D09D: u'VERIS INDUSTRIES', 0x00D09E: u'2WIRE, INC.', 0x00D09F: u'NOVTEK TEST SYSTEMS', 0x00D0A0: u'MIPS DENMARK', 0x00D0A1: u'OSKAR VIERLING GMBH + CO. KG', 0x00D0A2: u'INTEGRATED DEVICE', 0x00D0A3: u'VOCAL DATA, INC.', 0x00D0A4: u'ALANTRO COMMUNICATIONS', 0x00D0A5: u'AMERICAN ARIUM', 0x00D0A6: u'LANBIRD TECHNOLOGY CO., LTD.', 0x00D0A7: u'TOKYO SOKKI KENKYUJO CO., LTD.', 0x00D0A8: u'NETWORK ENGINES, INC.', 0x00D0A9: u'SHINANO KENSHI CO., LTD.', 0x00D0AA: u'CHASE COMMUNICATIONS', 0x00D0AB: u'DELTAKABEL TELECOM CV', 0x00D0AC: u'GRAYSON WIRELESS', 0x00D0AD: u'TL INDUSTRIES', 0x00D0AE: u'ORESIS COMMUNICATIONS, INC.', 0x00D0AF: u'CUTLER-HAMMER, INC.', 0x00D0B0: u'BITSWITCH LTD.', 0x00D0B1: u'OMEGA ELECTRONICS SA', 0x00D0B2: u'XIOTECH CORPORATION', 0x00D0B3: u'DRS FLIGHT SAFETY AND', 0x00D0B4: u'KATSUJIMA CO., LTD.', 0x00D0B5: u'IPricot formerly DotCom', 0x00D0B6: u'CRESCENT NETWORKS, INC.', 0x00D0B7: u'INTEL CORPORATION', 0x00D0B8: u'Iomega Corporation', 0x00D0B9: u'MICROTEK INTERNATIONAL, INC.', 0x00D0BA: u'CISCO SYSTEMS, INC.', 0x00D0BB: u'CISCO SYSTEMS, INC.', 0x00D0BC: u'CISCO SYSTEMS, INC.', 0x00D0BD: u'SICAN GMBH', 0x00D0BE: u'EMUTEC INC.', 0x00D0BF: u'PIVOTAL TECHNOLOGIES', 0x00D0C0: u'CISCO SYSTEMS, INC.', 0x00D0C1: u'HARMONIC DATA SYSTEMS, LTD.', 0x00D0C2: u'BALTHAZAR TECHNOLOGY AB', 0x00D0C3: u'VIVID TECHNOLOGY PTE, LTD.', 0x00D0C4: u'TERATECH CORPORATION', 0x00D0C5: u'COMPUTATIONAL SYSTEMS, INC.', 0x00D0C6: u'THOMAS & BETTS CORP.', 0x00D0C7: u'PATHWAY, INC.', 0x00D0C8: u'I/O CONSULTING A/S', 0x00D0C9: u'ADVANTECH CO., LTD.', 0x00D0CA: u'INTRINSYC SOFTWARE INC.', 0x00D0CB: u'DASAN CO., LTD.', 0x00D0CC: u'TECHNOLOGIES LYRE INC.', 0x00D0CD: u'ATAN TECHNOLOGY INC.', 0x00D0CE: u'ASYST ELECTRONIC', 0x00D0CF: u'MORETON BAY', 0x00D0D0: u'ZHONGXING TELECOM LTD.', 0x00D0D1: u'SIROCCO SYSTEMS, INC.', 0x00D0D2: u'EPILOG CORPORATION', 0x00D0D3: u'CISCO SYSTEMS, INC.', 0x00D0D4: u'V-BITS, INC.', 0x00D0D5: u'GRUNDIG AG', 0x00D0D6: u'AETHRA TELECOMUNICAZIONI', 0x00D0D7: u'B2C2, INC.', 0x00D0D8: u'3Com Corporation', 0x00D0D9: u'DEDICATED MICROCOMPUTERS', 0x00D0DA: u'TAICOM DATA SYSTEMS CO., LTD.', 0x00D0DB: u'MCQUAY INTERNATIONAL', 0x00D0DC: u'MODULAR MINING SYSTEMS, INC.', 0x00D0DD: u'SUNRISE TELECOM, INC.', 0x00D0DE: u'PHILIPS MULTIMEDIA NETWORK', 0x00D0DF: u'KUZUMI ELECTRONICS, INC.', 0x00D0E0: u'DOOIN ELECTRONICS CO.', 0x00D0E1: u'AVIONITEK ISRAEL INC.', 0x00D0E2: u'MRT MICRO, INC.', 0x00D0E3: u'ELE-CHEM ENGINEERING CO., LTD.', 0x00D0E4: u'CISCO SYSTEMS, INC.', 0x00D0E5: u'SOLIDUM SYSTEMS CORP.', 0x00D0E6: u'IBOND INC.', 0x00D0E7: u'VCON TELECOMMUNICATION LTD.', 0x00D0E8: u'MAC SYSTEM CO., LTD.', 0x00D0E9: u'ADVANTAGE CENTURY', 0x00D0EA: u'NEXTONE COMMUNICATIONS, INC.', 0x00D0EB: u'LIGHTERA NETWORKS, INC.', 0x00D0EC: u'NAKAYO TELECOMMUNICATIONS, INC', 0x00D0ED: u'XIOX', 0x00D0EE: u'DICTAPHONE CORPORATION', 0x00D0EF: u'IGT', 0x00D0F0: u'CONVISION TECHNOLOGY GMBH', 0x00D0F1: u'SEGA ENTERPRISES, LTD.', 0x00D0F2: u'MONTEREY NETWORKS', 0x00D0F3: u'SOLARI DI UDINE SPA', 0x00D0F4: u'CARINTHIAN TECH INSTITUTE', 0x00D0F5: u'ORANGE MICRO, INC.', 0x00D0F6: u'Alcatel Canada', 0x00D0F7: u'NEXT NETS CORPORATION', 0x00D0F8: u'FUJIAN STAR TERMINAL', 0x00D0F9: u'ACUTE COMMUNICATIONS CORP.', 0x00D0FA: u'RACAL GUARDATA', 0x00D0FB: u'TEK MICROSYSTEMS, INCORPORATED', 0x00D0FC: u'GRANITE MICROSYSTEMS', 0x00D0FD: u'OPTIMA TELE.COM, INC.', 0x00D0FE: u'ASTRAL POINT', 0x00D0FF: u'CISCO SYSTEMS, INC.', 0x00DD00: u'UNGERMANN-BASS INC.', 0x00DD01: u'UNGERMANN-BASS INC.', 0x00DD02: u'UNGERMANN-BASS INC.', 0x00DD03: u'UNGERMANN-BASS INC.', 0x00DD04: u'UNGERMANN-BASS INC.', 0x00DD05: u'UNGERMANN-BASS INC.', 0x00DD06: u'UNGERMANN-BASS INC.', 0x00DD07: u'UNGERMANN-BASS INC.', 0x00DD08: u'UNGERMANN-BASS INC.', 0x00DD09: u'UNGERMANN-BASS INC.', 0x00DD0A: u'UNGERMANN-BASS INC.', 0x00DD0B: u'UNGERMANN-BASS INC.', 0x00DD0C: u'UNGERMANN-BASS INC.', 0x00DD0D: u'UNGERMANN-BASS INC.', 0x00DD0E: u'UNGERMANN-BASS INC.', 0x00DD0F: u'UNGERMANN-BASS INC.', 0x00E000: u'FUJITSU, LTD', 0x00E001: u'STRAND LIGHTING LIMITED', 0x00E002: u'CROSSROADS SYSTEMS, INC.', 0x00E003: u'NOKIA WIRELESS BUSINESS COMMUN', 0x00E004: u'PMC-SIERRA, INC.', 0x00E005: u'TECHNICAL CORP.', 0x00E006: u'SILICON INTEGRATED SYS. CORP.', 0x00E007: u'NETWORK ALCHEMY LTD.', 0x00E008: u'AMAZING CONTROLS! INC.', 0x00E009: u'MARATHON TECHNOLOGIES CORP.', 0x00E00A: u'DIBA, INC.', 0x00E00B: u'ROOFTOP COMMUNICATIONS CORP.', 0x00E00C: u'MOTOROLA', 0x00E00D: u'RADIANT SYSTEMS', 0x00E00E: u'AVALON IMAGING SYSTEMS, INC.', 0x00E00F: u'SHANGHAI BAUD DATA', 0x00E010: u'HESS SB-AUTOMATENBAU GmbH', 0x00E011: u'UNIDEN SAN DIEGO R&D CENTER, INC.', 0x00E012: u'PLUTO TECHNOLOGIES INTERNATIONAL INC.', 0x00E013: u'EASTERN ELECTRONIC CO., LTD.', 0x00E014: u'CISCO SYSTEMS, INC.', 0x00E015: u'HEIWA CORPORATION', 0x00E016: u'RAPID CITY COMMUNICATIONS', 0x00E017: u'EXXACT GmbH', 0x00E018: u'ASUSTEK COMPUTER INC.', 0x00E019: u'ING. GIORDANO ELETTRONICA', 0x00E01A: u'COMTEC SYSTEMS. CO., LTD.', 0x00E01B: u'SPHERE COMMUNICATIONS, INC.', 0x00E01C: u'MOBILITY ELECTRONICSY', 0x00E01D: u'WebTV NETWORKS, INC.', 0x00E01E: u'CISCO SYSTEMS, INC.', 0x00E01F: u'AVIDIA Systems, Inc.', 0x00E020: u'TECNOMEN OY', 0x00E021: u'FREEGATE CORP.', 0x00E022: u'Analog Devices Inc.', 0x00E023: u'TELRAD', 0x00E024: u'GADZOOX NETWORKS', 0x00E025: u'dit CO., LTD.', 0x00E026: u'Redlake MASD LLC', 0x00E027: u'DUX, INC.', 0x00E028: u'APTIX CORPORATION', 0x00E029: u'STANDARD MICROSYSTEMS CORP.', 0x00E02A: u'TANDBERG TELEVISION AS', 0x00E02B: u'EXTREME NETWORKS', 0x00E02C: u'AST COMPUTER', 0x00E02D: u'InnoMediaLogic, Inc.', 0x00E02E: u'SPC ELECTRONICS CORPORATION', 0x00E02F: u'MCNS HOLDINGS, L.P.', 0x00E030: u'MELITA INTERNATIONAL CORP.', 0x00E031: u'HAGIWARA ELECTRIC CO., LTD.', 0x00E032: u'MISYS FINANCIAL SYSTEMS, LTD.', 0x00E033: u'E.E.P.D. GmbH', 0x00E034: u'CISCO SYSTEMS, INC.', 0x00E035: u'LOUGHBOROUGH SOUND IMAGES, PLC', 0x00E036: u'PIONEER CORPORATION', 0x00E037: u'CENTURY CORPORATION', 0x00E038: u'PROXIMA CORPORATION', 0x00E039: u'PARADYNE CORP.', 0x00E03A: u'CABLETRON SYSTEMS, INC.', 0x00E03B: u'PROMINET CORPORATION', 0x00E03C: u'AdvanSys', 0x00E03D: u'FOCON ELECTRONIC SYSTEMS A/S', 0x00E03E: u'ALFATECH, INC.', 0x00E03F: u'JATON CORPORATION', 0x00E040: u'DeskStation Technology, Inc.', 0x00E041: u'CSPI', 0x00E042: u'Pacom Systems Ltd.', 0x00E043: u'VitalCom', 0x00E044: u'LSICS CORPORATION', 0x00E045: u'TOUCHWAVE, INC.', 0x00E046: u'BENTLY NEVADA CORP.', 0x00E047: u'INFOCUS SYSTEMS', 0x00E048: u'SDL COMMUNICATIONS, INC.', 0x00E049: u'MICROWI ELECTRONIC GmbH', 0x00E04A: u'ENHANCED MESSAGING SYSTEMS, INC', 0x00E04B: u'JUMP INDUSTRIELLE COMPUTERTECHNIK GmbH', 0x00E04C: u'REALTEK SEMICONDUCTOR CORP.', 0x00E04D: u'INTERNET INITIATIVE JAPAN, INC', 0x00E04E: u'SANYO DENKI CO., LTD.', 0x00E04F: u'CISCO SYSTEMS, INC.', 0x00E050: u'EXECUTONE INFORMATION SYSTEMS, INC.', 0x00E051: u'TALX CORPORATION', 0x00E052: u'FOUNDRY NETWORKS, INC.', 0x00E053: u'CELLPORT LABS, INC.', 0x00E054: u'KODAI HITEC CO., LTD.', 0x00E055: u'INGENIERIA ELECTRONICA COMERCIAL INELCOM S.A.', 0x00E056: u'HOLONTECH CORPORATION', 0x00E057: u'HAN MICROTELECOM. CO., LTD.', 0x00E058: u'PHASE ONE DENMARK A/S', 0x00E059: u'CONTROLLED ENVIRONMENTS, LTD.', 0x00E05A: u'GALEA NETWORK SECURITY', 0x00E05B: u'WEST END SYSTEMS CORP.', 0x00E05C: u'MATSUSHITA KOTOBUKI ELECTRONICS INDUSTRIES, LTD.', 0x00E05D: u'UNITEC CO., LTD.', 0x00E05E: u'JAPAN AVIATION ELECTRONICS INDUSTRY, LTD.', 0x00E05F: u'e-Net, Inc.', 0x00E060: u'SHERWOOD', 0x00E061: u'EdgePoint Networks, Inc.', 0x00E062: u'HOST ENGINEERING', 0x00E063: u'CABLETRON - YAGO SYSTEMS, INC.', 0x00E064: u'SAMSUNG ELECTRONICS', 0x00E065: u'OPTICAL ACCESS INTERNATIONAL', 0x00E066: u'ProMax Systems, Inc.', 0x00E067: u'eac AUTOMATION-CONSULTING GmbH', 0x00E068: u'MERRIMAC SYSTEMS INC.', 0x00E069: u'JAYCOR', 0x00E06A: u'KAPSCH AG', 0x00E06B: u'W&G SPECIAL PRODUCTS', 0x00E06C: u'AEP Systems International Ltd', 0x00E06D: u'COMPUWARE CORPORATION', 0x00E06E: u'FAR SYSTEMS S.p.A.', 0x00E06F: u'Terayon Communications Systems', 0x00E070: u'DH TECHNOLOGY', 0x00E071: u'EPIS MICROCOMPUTER', 0x00E072: u'LYNK', 0x00E073: u'NATIONAL AMUSEMENT NETWORK, INC.', 0x00E074: u'TIERNAN COMMUNICATIONS, INC.', 0x00E075: u'Verilink Corporation', 0x00E076: u'DEVELOPMENT CONCEPTS, INC.', 0x00E077: u'WEBGEAR, INC.', 0x00E078: u'BERKELEY NETWORKS', 0x00E079: u'A.T.N.R.', 0x00E07A: u'MIKRODIDAKT AB', 0x00E07B: u'BAY NETWORKS', 0x00E07C: u'METTLER-TOLEDO, INC.', 0x00E07D: u'NETRONIX, INC.', 0x00E07E: u'WALT DISNEY IMAGINEERING', 0x00E07F: u'LOGISTISTEM s.r.l.', 0x00E080: u'CONTROL RESOURCES CORPORATION', 0x00E081: u'TYAN COMPUTER CORP.', 0x00E082: u'ANERMA', 0x00E083: u'JATO TECHNOLOGIES, INC.', 0x00E084: u'COMPULITE R&D', 0x00E085: u'GLOBAL MAINTECH, INC.', 0x00E086: u'CYBEX COMPUTER PRODUCTS', 0x00E087: u'LeCroy - Networking Productions Division', 0x00E088: u'LTX CORPORATION', 0x00E089: u'ION Networks, Inc.', 0x00E08A: u'GEC AVERY, LTD.', 0x00E08B: u'QLogic Corp.', 0x00E08C: u'NEOPARADIGM LABS, INC.', 0x00E08D: u'PRESSURE SYSTEMS, INC.', 0x00E08E: u'UTSTARCOM', 0x00E08F: u'CISCO SYSTEMS, INC.', 0x00E090: u'BECKMAN LAB. AUTOMATION DIV.', 0x00E091: u'LG ELECTRONICS, INC.', 0x00E092: u'ADMTEK INCORPORATED', 0x00E093: u'ACKFIN NETWORKS', 0x00E094: u'OSAI SRL', 0x00E095: u'ADVANCED-VISION TECHNOLGIES CORP.', 0x00E096: u'SHIMADZU CORPORATION', 0x00E097: u'CARRIER ACCESS CORPORATION', 0x00E098: u'AboCom Systems, Inc.', 0x00E099: u'SAMSON AG', 0x00E09A: u'POSITRON INDUSTRIES, INC.', 0x00E09B: u'ENGAGE NETWORKS, INC.', 0x00E09C: u'MII', 0x00E09D: u'SARNOFF CORPORATION', 0x00E09E: u'QUANTUM CORPORATION', 0x00E09F: u'PIXEL VISION', 0x00E0A0: u'WILTRON CO.', 0x00E0A1: u'HIMA PAUL HILDEBRANDT GmbH Co. KG', 0x00E0A2: u'MICROSLATE INC.', 0x00E0A3: u'CISCO SYSTEMS, INC.', 0x00E0A4: u'ESAOTE S.p.A.', 0x00E0A5: u'ComCore Semiconductor, Inc.', 0x00E0A6: u'TELOGY NETWORKS, INC.', 0x00E0A7: u'IPC INFORMATION SYSTEMS, INC.', 0x00E0A8: u'SAT GmbH & Co.', 0x00E0A9: u'FUNAI ELECTRIC CO., LTD.', 0x00E0AA: u'ELECTROSONIC LTD.', 0x00E0AB: u'DIMAT S.A.', 0x00E0AC: u'MIDSCO, INC.', 0x00E0AD: u'EES TECHNOLOGY, LTD.', 0x00E0AE: u'XAQTI CORPORATION', 0x00E0AF: u'GENERAL DYNAMICS INFORMATION SYSTEMS', 0x00E0B0: u'CISCO SYSTEMS, INC.', 0x00E0B1: u'Alcatel North America ESD', 0x00E0B2: u'TELMAX COMMUNICATIONS CORP.', 0x00E0B3: u'EtherWAN Systems, Inc.', 0x00E0B4: u'TECHNO SCOPE CO., LTD.', 0x00E0B5: u'ARDENT COMMUNICATIONS CORP.', 0x00E0B6: u'Entrada Networks', 0x00E0B7: u'PI GROUP, LTD.', 0x00E0B8: u'GATEWAY 2000', 0x00E0B9: u'BYAS SYSTEMS', 0x00E0BA: u'BERGHOF AUTOMATIONSTECHNIK GmbH', 0x00E0BB: u'NBX CORPORATION', 0x00E0BC: u'SYMON COMMUNICATIONS, INC.', 0x00E0BD: u'INTERFACE SYSTEMS, INC.', 0x00E0BE: u'GENROCO INTERNATIONAL, INC.', 0x00E0BF: u'TORRENT NETWORKING TECHNOLOGIES CORP.', 0x00E0C0: u'SEIWA ELECTRIC MFG. CO., LTD.', 0x00E0C1: u'MEMOREX TELEX JAPAN, LTD.', 0x00E0C2: u'NECSY S.p.A.', 0x00E0C3: u'SAKAI SYSTEM DEVELOPMENT CORP.', 0x00E0C4: u'HORNER ELECTRIC, INC.', 0x00E0C5: u'BCOM ELECTRONICS INC.', 0x00E0C6: u'LINK2IT, L.L.C.', 0x00E0C7: u'EUROTECH SRL', 0x00E0C8: u'VIRTUAL ACCESS, LTD.', 0x00E0C9: u'AutomatedLogic Corporation', 0x00E0CA: u'BEST DATA PRODUCTS', 0x00E0CB: u'RESON, INC.', 0x00E0CC: u'HERO SYSTEMS, LTD.', 0x00E0CD: u'SENSIS CORPORATION', 0x00E0CE: u'ARN', 0x00E0CF: u'INTEGRATED DEVICE TECHNOLOGY, INC.', 0x00E0D0: u'NETSPEED, INC.', 0x00E0D1: u'TELSIS LIMITED', 0x00E0D2: u'VERSANET COMMUNICATIONS, INC.', 0x00E0D3: u'DATENTECHNIK GmbH', 0x00E0D4: u'EXCELLENT COMPUTER', 0x00E0D5: u'ARCXEL TECHNOLOGIES, INC.', 0x00E0D6: u'COMPUTER & COMMUNICATION RESEARCH LAB.', 0x00E0D7: u'SUNSHINE ELECTRONICS, INC.', 0x00E0D8: u'LANBit Computer, Inc.', 0x00E0D9: u'TAZMO CO., LTD.', 0x00E0DA: u'Alcatel North America ESD', 0x00E0DB: u'ViaVideo Communications, Inc.', 0x00E0DC: u'NEXWARE CORP.', 0x00E0DD: u'ZENITH ELECTRONICS CORPORATION', 0x00E0DE: u'DATAX NV', 0x00E0DF: u'KE KOMMUNIKATIONS-ELECTRONIK', 0x00E0E0: u'SI ELECTRONICS, LTD.', 0x00E0E1: u'G2 NETWORKS, INC.', 0x00E0E2: u'INNOVA CORP.', 0x00E0E3: u'SK-ELEKTRONIK GmbH', 0x00E0E4: u'FANUC ROBOTICS NORTH AMERICA, Inc.', 0x00E0E5: u'CINCO NETWORKS, INC.', 0x00E0E6: u'INCAA DATACOM B.V.', 0x00E0E7: u'RAYTHEON E-SYSTEMS, INC.', 0x00E0E8: u'GRETACODER Data Systems AG', 0x00E0E9: u'DATA LABS, INC.', 0x00E0EA: u'INNOVAT COMMUNICATIONS, INC.', 0x00E0EB: u'DIGICOM SYSTEMS, INCORPORATED', 0x00E0EC: u'CELESTICA INC.', 0x00E0ED: u'SILICOM, LTD.', 0x00E0EE: u'MAREL HF', 0x00E0EF: u'DIONEX', 0x00E0F0: u'ABLER TECHNOLOGY, INC.', 0x00E0F1: u'THAT CORPORATION', 0x00E0F2: u'ARLOTTO COMNET, INC.', 0x00E0F3: u'WebSprint Communications, Inc.', 0x00E0F4: u'INSIDE Technology A/S', 0x00E0F5: u'TELES AG', 0x00E0F6: u'DECISION EUROPE', 0x00E0F7: u'CISCO SYSTEMS, INC.', 0x00E0F8: u'DICNA CONTROL AB', 0x00E0F9: u'CISCO SYSTEMS, INC.', 0x00E0FA: u'TRL TECHNOLOGY, LTD.', 0x00E0FB: u'LEIGHTRONIX, INC.', 0x00E0FC: u'HUAWEI TECHNOLOGIES CO., LTD.', 0x00E0FD: u'A-TREND TECHNOLOGY CO., LTD.', 0x00E0FE: u'CISCO SYSTEMS, INC.', 0x00E0FF: u'SECURITY DYNAMICS TECHNOLOGIES, Inc.', 0x00E6D3: u'NIXDORF COMPUTER CORP.', 0x020701: u'RACAL-DATACOM', 0x021C7C: u'PERQ SYSTEMS CORPORATION', 0x026086: u'LOGIC REPLACEMENT TECH. LTD.', 0x02608C: u'3COM CORPORATION', 0x027001: u'RACAL-DATACOM', 0x0270B0: u'M/A-COM INC. COMPANIES', 0x0270B3: u'DATA RECALL LTD', 0x029D8E: u'CARDIAC RECORDERS INC.', 0x02AA3C: u'OLIVETTI TELECOMM SPA (OLTECO)', 0x02BB01: u'OCTOTHORPE CORP.', 0x02C08C: u'3COM CORPORATION', 0x02CF1C: u'COMMUNICATION MACHINERY CORP.', 0x02E6D3: u'NIXDORF COMPUTER CORPORATION', 0x040AE0: u'XMIT AG COMPUTER NETWORKS', 0x04E0C4: u'TRIUMPH-ADLER AG', 0x080001: u'COMPUTERVISION CORPORATION', 0x080002: u'BRIDGE COMMUNICATIONS INC.', 0x080003: u'ADVANCED COMPUTER COMM.', 0x080004: u'CROMEMCO INCORPORATED', 0x080005: u'SYMBOLICS INC.', 0x080006: u'SIEMENS AG', 0x080007: u'APPLE COMPUTER INC.', 0x080008: u'BOLT BERANEK AND NEWMAN INC.', 0x080009: u'HEWLETT PACKARD', 0x08000A: u'NESTAR SYSTEMS INCORPORATED', 0x08000B: u'UNISYS CORPORATION', 0x08000C: u'MIKLYN DEVELOPMENT CO.', 0x08000D: u'INTERNATIONAL COMPUTERS LTD.', 0x08000E: u'NCR CORPORATION', 0x08000F: u'MITEL CORPORATION', 0x080011: u'TEKTRONIX INC.', 0x080012: u'BELL ATLANTIC INTEGRATED SYST.', 0x080013: u'EXXON', 0x080014: u'EXCELAN', 0x080015: u'STC BUSINESS SYSTEMS', 0x080016: u'BARRISTER INFO SYS CORP', 0x080017: u'NATIONAL SEMICONDUCTOR', 0x080018: u'PIRELLI FOCOM NETWORKS', 0x080019: u'GENERAL ELECTRIC CORPORATION', 0x08001A: u'TIARA/ 10NET', 0x08001B: u'DATA GENERAL', 0x08001C: u'KDD-KOKUSAI DEBNSIN DENWA CO.', 0x08001D: u'ABLE COMMUNICATIONS INC.', 0x08001E: u'APOLLO COMPUTER INC.', 0x08001F: u'SHARP CORPORATION', 0x080020: u'SUN MICROSYSTEMS INC.', 0x080021: u'3M COMPANY', 0x080022: u'NBI INC.', 0x080023: u'Panasonic Communications Co., Ltd.', 0x080024: u'10NET COMMUNICATIONS/DCA', 0x080025: u'CONTROL DATA', 0x080026: u'NORSK DATA A.S.', 0x080027: u'CADMUS COMPUTER SYSTEMS', 0x080028: u'Texas Instruments', 0x080029: u'MEGATEK CORPORATION', 0x08002A: u'MOSAIC TECHNOLOGIES INC.', 0x08002B: u'DIGITAL EQUIPMENT CORPORATION', 0x08002C: u'BRITTON LEE INC.', 0x08002D: u'LAN-TEC INC.', 0x08002E: u'METAPHOR COMPUTER SYSTEMS', 0x08002F: u'PRIME COMPUTER INC.', 0x080030: u'NETWORK RESEARCH CORPORATION', 0x080030: u'CERN', 0x080030: u'ROYAL MELBOURNE INST OF TECH', 0x080031: u'LITTLE MACHINES INC.', 0x080032: u'TIGAN INCORPORATED', 0x080033: u'BAUSCH & LOMB', 0x080034: u'FILENET CORPORATION', 0x080035: u'MICROFIVE CORPORATION', 0x080036: u'INTERGRAPH CORPORATION', 0x080037: u'FUJI-XEROX CO. LTD.', 0x080038: u'CII HONEYWELL BULL', 0x080039: u'SPIDER SYSTEMS LIMITED', 0x08003A: u'ORCATECH INC.', 0x08003B: u'TORUS SYSTEMS LIMITED', 0x08003C: u'SCHLUMBERGER WELL SERVICES', 0x08003D: u'CADNETIX CORPORATIONS', 0x08003E: u'CODEX CORPORATION', 0x08003F: u'FRED KOSCHARA ENTERPRISES', 0x080040: u'FERRANTI COMPUTER SYS. LIMITED', 0x080041: u'RACAL-MILGO INFORMATION SYS..', 0x080042: u'JAPAN MACNICS CORP.', 0x080043: u'PIXEL COMPUTER INC.', 0x080044: u'DAVID SYSTEMS INC.', 0x080045: u'CONCURRENT COMPUTER CORP.', 0x080046: u'SONY CORPORATION LTD.', 0x080047: u'SEQUENT COMPUTER SYSTEMS INC.', 0x080048: u'EUROTHERM GAUGING SYSTEMS', 0x080049: u'UNIVATION', 0x08004A: u'BANYAN SYSTEMS INC.', 0x08004B: u'PLANNING RESEARCH CORP.', 0x08004C: u'HYDRA COMPUTER SYSTEMS INC.', 0x08004D: u'CORVUS SYSTEMS INC.', 0x08004E: u'3COM EUROPE LTD.', 0x08004F: u'CYGNET SYSTEMS', 0x080050: u'DAISY SYSTEMS CORP.', 0x080051: u'EXPERDATA', 0x080052: u'INSYSTEC', 0x080053: u'MIDDLE EAST TECH. UNIVERSITY', 0x080055: u'STANFORD TELECOMM. INC.', 0x080056: u'STANFORD LINEAR ACCEL. CENTER', 0x080057: u'EVANS & SUTHERLAND', 0x080058: u'SYSTEMS CONCEPTS', 0x080059: u'A/S MYCRON', 0x08005A: u'IBM CORPORATION', 0x08005B: u'VTA TECHNOLOGIES INC.', 0x08005C: u'FOUR PHASE SYSTEMS', 0x08005D: u'GOULD INC.', 0x08005E: u'COUNTERPOINT COMPUTER INC.', 0x08005F: u'SABER TECHNOLOGY CORP.', 0x080060: u'INDUSTRIAL NETWORKING INC.', 0x080061: u'JAROGATE LTD.', 0x080062: u'GENERAL DYNAMICS', 0x080063: u'PLESSEY', 0x080064: u'AUTOPHON AG', 0x080065: u'GENRAD INC.', 0x080066: u'AGFA CORPORATION', 0x080067: u'COMDESIGN', 0x080068: u'RIDGE COMPUTERS', 0x080069: u'SILICON GRAPHICS INC.', 0x08006A: u'ATT BELL LABORATORIES', 0x08006B: u'ACCEL TECHNOLOGIES INC.', 0x08006C: u'SUNTEK TECHNOLOGY INT\'L', 0x08006D: u'WHITECHAPEL COMPUTER WORKS', 0x08006E: u'MASSCOMP', 0x08006F: u'PHILIPS APELDOORN B.V.', 0x080070: u'MITSUBISHI ELECTRIC CORP.', 0x080071: u'MATRA (DSIE)', 0x080072: u'XEROX CORP UNIV GRANT PROGRAM', 0x080073: u'TECMAR INC.', 0x080074: u'CASIO COMPUTER CO. LTD.', 0x080075: u'DANSK DATA ELECTRONIK', 0x080076: u'PC LAN TECHNOLOGIES', 0x080077: u'TSL COMMUNICATIONS LTD.', 0x080078: u'ACCELL CORPORATION', 0x080079: u'THE DROID WORKS', 0x08007A: u'INDATA', 0x08007B: u'SANYO ELECTRIC CO. LTD.', 0x08007C: u'VITALINK COMMUNICATIONS CORP.', 0x08007E: u'AMALGAMATED WIRELESS(AUS) LTD', 0x08007F: u'CARNEGIE-MELLON UNIVERSITY', 0x080080: u'AES DATA INC.', 0x080081: u'ASTECH INC.', 0x080082: u'VERITAS SOFTWARE', 0x080083: u'Seiko Instruments Inc.', 0x080084: u'TOMEN ELECTRONICS CORP.', 0x080085: u'ELXSI', 0x080086: u'KONICA MINOLTA HOLDINGS, INC.', 0x080087: u'XYPLEX', 0x080088: u'MCDATA CORPORATION', 0x080089: u'KINETICS', 0x08008A: u'PERFORMANCE TECHNOLOGY', 0x08008B: u'PYRAMID TECHNOLOGY CORP.', 0x08008C: u'NETWORK RESEARCH CORPORATION', 0x08008D: u'XYVISION INC.', 0x08008E: u'TANDEM COMPUTERS', 0x08008F: u'CHIPCOM CORPORATION', 0x080090: u'SONOMA SYSTEMS', 0x081443: u'UNIBRAIN S.A.', 0x08BBCC: u'AK-NORD EDV VERTRIEBSGES. mbH', 0x100000: u'PRIVATE', 0x10005A: u'IBM CORPORATION', 0x1000E8: u'NATIONAL SEMICONDUCTOR', 0x1100AA: u'PRIVATE', 0x800010: u'ATT BELL LABORATORIES', 0xA06A00: u'Verilink Corporation', 0xAA0000: u'DIGITAL EQUIPMENT CORPORATION', 0xAA0001: u'DIGITAL EQUIPMENT CORPORATION', 0xAA0002: u'DIGITAL EQUIPMENT CORPORATION', 0xAA0003: u'DIGITAL EQUIPMENT CORPORATION', 0xAA0004: u'DIGITAL EQUIPMENT CORPORATION', 0xACDE48: u'PRIVATE', }
gpl-3.0
1986ks/chainer
examples/modelzoo/download_model.py
28
1047
#!/usr/bin/env python from __future__ import print_function import argparse import six parser = argparse.ArgumentParser( description='Download a Caffe reference model') parser.add_argument('model_type', choices=('alexnet', 'caffenet', 'googlenet'), help='Model type (alexnet, caffenet, googlenet)') args = parser.parse_args() if args.model_type == 'alexnet': url = 'http://dl.caffe.berkeleyvision.org/bvlc_alexnet.caffemodel' name = 'bvlc_alexnet.caffemodel' elif args.model_type == 'caffenet': url = 'http://dl.caffe.berkeleyvision.org/' \ 'bvlc_reference_caffenet.caffemodel' name = 'bvlc_reference_caffenet.caffemodel' elif args.model_type == 'googlenet': url = 'http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel' name = 'bvlc_googlenet.caffemodel' else: raise RuntimeError('Invalid model type. Choose from ' 'alexnet, caffenet, and googlenet.') print('Downloading model file...') six.moves.urllib.request.urlretrieve(url, name) print('Done')
mit
Onirik79/aaritmud
src/behaviour.py
1
101537
# -*- coding: utf-8 -*- """ Modulo riguardante i behaviour dei Mob e degli Item, ovvero dei comportamenti automatici inviati di tanto in tanto. """ #= IMPORT ====================================================================== import datetime import numbers import random from src.config import config from src.element import Flags from src.engine import engine from src.enums import CONTAINER, DIR, DOOR, ENTITYPE, FLAG, RACE, ROOM, SECTOR from src.database import database from src.interpret import interpret_or_echo from src.log import log from src.loop import UnstoppableLoop from src.miml import MIML_SEPARATOR from src.utility import (copy_existing_attributes, to_capitalized_words, multiple_arguments) from src.web_resource import create_tooltip from src.commands.command_north import command_north from src.commands.command_northeast import command_northeast from src.commands.command_east import command_east from src.commands.command_southeast import command_southeast from src.commands.command_south import command_south from src.commands.command_southwest import command_southwest from src.commands.command_west import command_west from src.commands.command_northwest import command_northwest from src.commands.command_up import command_up from src.commands.command_down import command_down from src.commands.command_open import command_open from src.commands.command_close import command_close from src.commands.command_enter import command_enter from src.commands.command_exit import command_exit #= COSTANTI ==================================================================== DIR_COMMANDS = {DIR.NORTH : command_north, DIR.NORTHEAST : command_northeast, DIR.EAST : command_east, DIR.SOUTHEAST : command_southeast, DIR.SOUTH : command_south, DIR.SOUTHWEST : command_southwest, DIR.WEST : command_west, DIR.NORTHWEST : command_northwest, DIR.UP : command_up, DIR.DOWN : command_down} #= VARIABILI =================================================================== # Variabili che tengono traccia dell'utilizzo dei behaviour, tali informazioni # vengono stampate allo shutdown del Mud item_behaviour_tracker = {} mob_behaviour_tracker = {} room_behaviour_tracker = {} room_item_behaviour_tracker = {} room_mob_behaviour_tracker = {} #= CLASSI ====================================================================== class _BehaviourHandler(object): """ I metodi di questa classe sono un po' boiler plate, è per via di una questione prestazionale. """ PRIMARY_KEY = "" VOLATILES = [] MULTILINES = [] SCHEMA = {"random_do_inputs" : ("", "str")} REFERENCES = {} WEAKREFS = {} def __repr__(self): look_total = get_total_percent(self, "look") listen_total = get_total_percent(self, "listen") smell_total = get_total_percent(self, "smell") touch_total = get_total_percent(self, "touch") taste_total = get_total_percent(self, "taste") intuition_total = get_total_percent(self, "intuition") wander_total = get_total_percent(self, "wander") random_total = get_total_percent(self, "random") return "%s: look=%d listen=%d smell=%d touch=%d taste=%d intuition=%d wander=%d random=%d" % ( super(_BehaviourHandler, self).__repr__, look_total, listen_total, smell_total, touch_total, taste_total, intuition_total, wander_total, random_total) #- Fine Metodo - def get_error_message(self): if self.look < 0 or self.look > config.max_behaviour_probability: return "look dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look) if self.look_player < 0 or self.look_player > config.max_behaviour_probability: return "look_player dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_player) elif self.look_mob < 0 or self.look_mob > config.max_behaviour_probability: return "look_mob dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_mob) elif self.look_item < 0 or self.look_item > config.max_behaviour_probability: return "look_item dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_item) elif self.look_self < 0 or self.look_self > config.max_behaviour_probability: return "look_self dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_self) elif self.look_at_races < 0 or self.look_at_races > config.max_behaviour_probability: return "look_at_races dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_at_races) elif self.look_at_races > 0 and not self.look_at_races_flags: return "look_at_races_flags deve avere impostata almeno una poiché flag look_at_races è %d" % self.look_at_races elif self.look_at_races_flags.get_error_message(RACE, "look_at_races_flags") != "": return self.look_at_races_flags.get_error_message(RACE, "look_at_races_flags") elif self.look_at_entitypes < 0 or self.look_at_entitypes > config.max_behaviour_probability: return "look_at_entitypes dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_at_entitypes) elif self.look_at_entitypes > 0 and not self.look_at_entitypes_flags: return "look_at_entitypes_flags deve avere impostata almeno una poiché flag look_at_entitypes è %d" % self.look_at_entitypes elif self.look_at_entitypes_flags.get_error_message(ENTITYPE, "look_at_entitypes_flags") != "": return self.look_at_entitypes_flags.get_error_message(ENTITYPE, "look_at_entitypes_flags") elif self.look_direction < 0 or self.look_direction > config.max_behaviour_probability: return "look_direction dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_direction) elif self.look_exit < 0 or self.look_exit > config.max_behaviour_probability: return "look_exit dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_exit) elif self.look_wall < 0 or self.look_wall > config.max_behaviour_probability: return "look_wall dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_wall) elif self.look_closed_door < 0 or self.look_closed_door > config.max_behaviour_probability: return "look_closed_door dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_closed_door) elif self.look_extra < 0 or self.look_extra > config.max_behaviour_probability: return "look_extra dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_extra) elif self.look_equipment < 0 or self.look_equipment > config.max_behaviour_probability: return "look_equipment dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_equipment) elif self.look_inventory < 0 or self.look_inventory > config.max_behaviour_probability: return "look_inventory dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.look_inventory) elif self.listen < 0 or self.listen > config.max_behaviour_probability: return "listen dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen) elif self.listen_player < 0 or self.listen_player > config.max_behaviour_probability: return "listen_player dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_player) elif self.listen_mob < 0 or self.listen_mob > config.max_behaviour_probability: return "listen_mob dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_mob) elif self.listen_item < 0 or self.listen_item > config.max_behaviour_probability: return "listen_item dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_item) elif self.listen_self < 0 or self.listen_self > config.max_behaviour_probability: return "listen_self dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_self) elif self.listen_at_races < 0 or self.listen_at_races > config.max_behaviour_probability: return "listen_at_races dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_at_races) elif self.listen_at_races > 0 and not self.listen_at_races_flags: return "listen_at_races_flags deve avere impostata almeno una poiché flag listen_at_races è %d" % self.listen_at_races elif self.listen_at_races_flags.get_error_message(RACE, "listen_at_races_flags") != "": return self.listen_at_races_flags.get_error_message(RACE, "listen_at_races_flags") elif self.listen_at_entitypes < 0 or self.listen_at_entitypes > config.max_behaviour_probability: return "listen_at_entitypes dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_at_entitypes) elif self.listen_at_entitypes > 0 and not self.listen_at_entitypes_flags: return "listen_at_entitypes_flags deve avere impostata almeno una poiché flag listen_at_entitypes è %d" % self.listen_at_entitypes elif self.listen_at_entitypes_flags.get_error_message(ENTITYPE, "listen_at_entitypes_flags") != "": return self.listen_at_entitypes_flags.get_error_message(ENTITYPE, "listen_at_entitypes_flags") elif self.listen_direction < 0 or self.listen_direction > config.max_behaviour_probability: return "listen_direction dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_direction) elif self.listen_exit < 0 or self.listen_exit > config.max_behaviour_probability: return "listen_exit dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_exit) elif self.listen_wall < 0 or self.listen_wall > config.max_behaviour_probability: return "listen_wall dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_wall) elif self.listen_closed_door < 0 or self.listen_closed_door > config.max_behaviour_probability: return "listen_closed_door dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_closed_door) elif self.listen_extra < 0 or self.listen_extra > config.max_behaviour_probability: return "listen_extra dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_extra) elif self.listen_equipment < 0 or self.listen_equipment > config.max_behaviour_probability: return "listen_equipment dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_equipment) elif self.listen_inventory < 0 or self.listen_inventory > config.max_behaviour_probability: return "listen_inventory dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.listen_inventory) elif self.smell < 0 or self.smell > config.max_behaviour_probability: return "smell dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell) elif self.smell_player < 0 or self.smell_player > config.max_behaviour_probability: return "smell_player dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_player) elif self.smell_mob < 0 or self.smell_mob > config.max_behaviour_probability: return "smell_mob dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_mob) elif self.smell_item < 0 or self.smell_item > config.max_behaviour_probability: return "smell_item dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_item) elif self.smell_self < 0 or self.smell_self > config.max_behaviour_probability: return "smell_self dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_self) elif self.smell_at_races < 0 or self.smell_at_races > config.max_behaviour_probability: return "smell_at_races dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_at_races) elif self.smell_at_races > 0 and not self.smell_at_races_flags: return "smell_at_races_flags deve avere impostata almeno una poiché flag smell_at_races è %d" % self.smell_at_races elif self.smell_at_races_flags.get_error_message(RACE, "smell_at_races_flags") != "": return self.smell_at_races_flags.get_error_message(RACE, "smell_at_races_flags") elif self.smell_at_entitypes < 0 or self.smell_at_entitypes > config.max_behaviour_probability: return "smell_at_entitypes dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_at_entitypes) elif self.smell_at_entitypes > 0 and not self.smell_at_entitypes_flags: return "smell_at_entitypes_flags deve avere impostata almeno una poiché flag smell_at_entitypes è %d" % self.smell_at_entitypes elif self.smell_at_entitypes_flags.get_error_message(ENTITYPE, "smell_at_entitypes_flags") != "": return self.smell_at_entitypes_flags.get_error_message(ENTITYPE, "smell_at_entitypes_flags") elif self.smell_direction < 0 or self.smell_direction > config.max_behaviour_probability: return "smell_direction dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_direction) elif self.smell_exit < 0 or self.smell_exit > config.max_behaviour_probability: return "smell_exit dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_exit) elif self.smell_wall < 0 or self.smell_wall > config.max_behaviour_probability: return "smell_wall dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_wall) elif self.smell_closed_door < 0 or self.smell_closed_door > config.max_behaviour_probability: return "smell_closed_door dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_closed_door) elif self.smell_extra < 0 or self.smell_extra > config.max_behaviour_probability: return "smell_extra dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_extra) elif self.smell_equipment < 0 or self.smell_equipment > config.max_behaviour_probability: return "smell_equipment dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_equipment) elif self.smell_inventory < 0 or self.smell_inventory > config.max_behaviour_probability: return "smell_inventory dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.smell_inventory) elif self.touch < 0 or self.touch > config.max_behaviour_probability: return "touch dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch) elif self.touch_player < 0 or self.touch_player > config.max_behaviour_probability: return "touch_player dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_player) elif self.touch_mob < 0 or self.touch_mob > config.max_behaviour_probability: return "touch_mob dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_mob) elif self.touch_item < 0 or self.touch_item > config.max_behaviour_probability: return "touch_item dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_item) elif self.touch_self < 0 or self.touch_self > config.max_behaviour_probability: return "touch_self dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_self) elif self.touch_at_races < 0 or self.touch_at_races > config.max_behaviour_probability: return "touch_at_races dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_at_races) elif self.touch_at_races > 0 and not self.touch_at_races_flags: return "touch_at_races_flags deve avere impostata almeno una poiché flag touch_at_races è %d" % self.touch_at_races elif self.touch_at_races_flags.get_error_message(RACE, "touch_at_races_flags") != "": return self.touch_at_races_flags.get_error_message(RACE, "touch_at_races_flags") elif self.touch_at_entitypes < 0 or self.touch_at_entitypes > config.max_behaviour_probability: return "touch_at_entitypes dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_at_entitypes) elif self.touch_at_entitypes > 0 and not self.touch_at_entitypes_flags: return "touch_at_entitypes_flags deve avere impostata almeno una poiché flag touch_at_entitypes è %d" % self.touch_at_entitypes elif self.touch_at_entitypes_flags.get_error_message(ENTITYPE, "touch_at_entitypes_flags") != "": return self.touch_at_entitypes_flags.get_error_message(ENTITYPE, "touch_at_entitypes_flags") elif self.touch_direction < 0 or self.touch_direction > config.max_behaviour_probability: return "touch_direction dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_direction) elif self.touch_exit < 0 or self.touch_exit > config.max_behaviour_probability: return "touch_exit dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_exit) elif self.touch_wall < 0 or self.touch_wall > config.max_behaviour_probability: return "touch_wall dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_wall) elif self.touch_closed_door < 0 or self.touch_closed_door > config.max_behaviour_probability: return "touch_closed_door dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_closed_door) elif self.touch_extra < 0 or self.touch_extra > config.max_behaviour_probability: return "touch_extra dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_extra) elif self.touch_equipment < 0 or self.touch_equipment > config.max_behaviour_probability: return "touch_equipment dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_equipment) elif self.touch_inventory < 0 or self.touch_inventory > config.max_behaviour_probability: return "touch_inventory dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.touch_inventory) elif self.taste < 0 or self.taste > config.max_behaviour_probability: return "taste dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste) elif self.taste_player < 0 or self.taste_player > config.max_behaviour_probability: return "taste_player dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_player) elif self.taste_mob < 0 or self.taste_mob > config.max_behaviour_probability: return "taste_mob dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_mob) elif self.taste_item < 0 or self.taste_item > config.max_behaviour_probability: return "taste_item dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_item) elif self.taste_self < 0 or self.taste_self > config.max_behaviour_probability: return "taste_self dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_self) elif self.taste_at_races < 0 or self.taste_at_races > config.max_behaviour_probability: return "taste_at_races dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_at_races) elif self.taste_at_races > 0 and not self.taste_at_races_flags: return "taste_at_races_flags deve avere impostata almeno una poiché flag taste_at_races è %d" % self.taste_at_races elif self.taste_at_races_flags.get_error_message(RACE, "taste_at_races_flags") != "": return self.taste_at_races_flags.get_error_message(RACE, "taste_at_races_flags") elif self.taste_at_entitypes < 0 or self.taste_at_entitypes > config.max_behaviour_probability: return "taste_at_entitypes dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_at_entitypes) elif self.taste_at_entitypes > 0 and not self.taste_at_entitypes_flags: return "taste_at_entitypes_flags deve avere impostata almeno una poiché flag taste_at_entitypes è %d" % self.taste_at_entitypes elif self.taste_at_entitypes_flags.get_error_message(ENTITYPE, "taste_at_entitypes_flags") != "": return self.taste_at_entitypes_flags.get_error_message(ENTITYPE, "taste_at_entitypes_flags") elif self.taste_direction < 0 or self.taste_direction > config.max_behaviour_probability: return "taste_direction dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_direction) elif self.taste_exit < 0 or self.taste_exit > config.max_behaviour_probability: return "taste_exit dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_exit) elif self.taste_wall < 0 or self.taste_wall > config.max_behaviour_probability: return "taste_wall dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_wall) elif self.taste_closed_door < 0 or self.taste_closed_door > config.max_behaviour_probability: return "taste_closed_door dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_closed_door) elif self.taste_extra < 0 or self.taste_extra > config.max_behaviour_probability: return "taste_extra dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_extra) elif self.taste_equipment < 0 or self.taste_equipment > config.max_behaviour_probability: return "taste_equipment dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_equipment) elif self.taste_inventory < 0 or self.taste_inventory > config.max_behaviour_probability: return "taste_inventory dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.taste_inventory) elif self.intuition < 0 or self.intuition > config.max_behaviour_probability: return "intuition dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition) elif self.intuition_player < 0 or self.intuition_player > config.max_behaviour_probability: return "intuition_player dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_player) elif self.intuition_mob < 0 or self.intuition_mob > config.max_behaviour_probability: return "intuition_mob dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_mob) elif self.intuition_item < 0 or self.intuition_item > config.max_behaviour_probability: return "intuition_item dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_item) elif self.intuition_self < 0 or self.intuition_self > config.max_behaviour_probability: return "intuition_self dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_self) elif self.intuition_at_races < 0 or self.intuition_at_races > config.max_behaviour_probability: return "intuition_at_races dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_at_races) elif self.intuition_at_races > 0 and not self.intuition_at_races_flags: return "intuition_at_races_flags deve avere impostata almeno una poiché flag intuition_at_races è %d" % self.intuition_at_races elif self.intuition_at_races_flags.get_error_message(RACE, "intuition_at_races_flags") != "": return self.intuition_at_races_flags.get_error_message(RACE, "intuition_at_races_flags") elif self.intuition_at_entitypes < 0 or self.intuition_at_entitypes > config.max_behaviour_probability: return "intuition_at_entitypes dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_at_entitypes) elif self.intuition_at_entitypes > 0 and not self.intuition_at_entitypes_flags: return "intuition_at_entitypes_flags deve avere impostata almeno una poiché flag intuition_at_entitypes è %d" % self.intuition_at_entitypes elif self.intuition_at_entitypes_flags.get_error_message(ENTITYPE, "intuition_at_entitypes_flags") != "": return self.intuition_at_entitypes_flags.get_error_message(ENTITYPE, "intuition_at_entitypes_flags") elif self.intuition_direction < 0 or self.intuition_direction > config.max_behaviour_probability: return "intuition_direction dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_direction) elif self.intuition_exit < 0 or self.intuition_exit > config.max_behaviour_probability: return "intuition_exit dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_exit) elif self.intuition_wall < 0 or self.intuition_wall > config.max_behaviour_probability: return "intuition_wall dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_wall) elif self.intuition_closed_door < 0 or self.intuition_closed_door > config.max_behaviour_probability: return "intuition_closed_door dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_closed_door) elif self.intuition_extra < 0 or self.intuition_extra > config.max_behaviour_probability: return "intuition_extra dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_extra) elif self.intuition_equipment < 0 or self.intuition_equipment > config.max_behaviour_probability: return "intuition_equipment dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_equipment) elif self.intuition_inventory < 0 or self.intuition_inventory > config.max_behaviour_probability: return "intuition_inventory dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.intuition_inventory) elif self.wander_direction < 0 or self.wander_direction > config.max_behaviour_probability: return "wander_direction dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_direction) elif self.wander_exit < 0 or self.wander_exit > config.max_behaviour_probability: return "wander_exit dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_exit) elif self.wander_wall < 0 or self.wander_wall > config.max_behaviour_probability: return "wander_wall dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_wall) elif self.wander_closed_door < 0 or self.wander_closed_door > config.max_behaviour_probability: return "wander_closed_door dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_closed_door) elif self.wander_area < 0 or self.wander_area > config.max_behaviour_probability: return "wander_area dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_area) elif self.wander_at_exits < 0 or self.wander_at_exits > config.max_behaviour_probability: return "wander_at_exits dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_at_exits) elif self.wander_at_exits > 0 and not self.wander_at_exits_flags: return "wander_at_exits_flags deve avere impostata almeno una poiché flag wander_at_exits è %d" % self.wander_at_exits elif self.wander_at_exits_flags.get_error_message(DIR, "wander_at_exits_flags") != "": return self.wander_at_exits_flags.get_error_message(DIR, "wander_at_exits_flags") elif self.wander_at_sectors.get_error_message(SECTOR, "wander_at_sectors") != "": return self.wander_at_sectors.get_error_message(SECTOR, "wander_at_sectors") elif self.wander_portal < 0 or self.wander_portal > config.max_behaviour_probability: return "wander_portal dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_portal) elif self.wander_enter_container < 0 or self.wander_enter_container > config.max_behaviour_probability: return "wander_enter_container dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_enter_container) elif self.wander_exit_container < 0 or self.wander_exit_container > config.max_behaviour_probability: return "wander_exit_container dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_exit_container) elif self.wander_self < 0 or self.wander_self > config.max_behaviour_probability: return "wander_self dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.wander_self) elif self.random_do < 0 or self.random_do > config.max_behaviour_probability: return "random_do dev'essere un numero tra 0 e %d, invece è: %d" % (config.max_behaviour_probability, self.random_do) elif self.random_do > 0 and not self.random_do_inputs: return "random_do_inputs vuoto con random_do a %d: %r" % (self.random_do, self.random_do_inputs) elif self.get_error_message_random_do_inputs() != "": return self.get_error_message_random_do_inputs() return "" #- Fine Metodo - def get_error_message_random_do_inputs(self): for random_do_input in self.random_do_inputs: if len(random_do_input) > config.max_google_translate: return "random_do_input %r più lungo di %d caratteri." % (random_do_input, config.max_google_translate) return "" #- Fine Metodo - def copy(self, to_obj=None, avoid_volatiles=False): """ Il metodo viene implementato nelle classi specializzate. """ raise NotImplementedError #- Fine Metodo - def equals(self, behaviour2): if not behaviour2: return False items1 = self.__dict__.items() items2 = behaviour2.__dict__.items() if len(items1) != len(items2): return False for attr_name, value in items1: if attr_name == "random_do_inputs": continue if not hasattr(behaviour2, attr_name): return False if value != getattr(behaviour2, attr_name): return False if len(self.random_do_inputs) != len(behaviour2.random_do_inputs): return False for input in self.random_do_inputs: for input2 in behaviour2.random_do_inputs: if input == input2: break else: return False return True #- Fine Metodo - # - Behaviour relativi ai 6 sensi ------------------------------------------ def update_sense(self, entity, input_name, command_function): """ Comportamento che fa eseguire un senso nella locazione corrente. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name): execution = command_function(entity, "", behavioured=True) return execution return False #- Fine Metodo - def update_sense_player(self, entity, input_name, command_function): """ Comportamento che fa eseguire un senso sui giocatori nella locazione corrente. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_player"): # Tramite list viene eseguita una copia della lista, questo serve # perché il metodo _update_sense_to_target esegue dei remove agli # elementi entities = list(getattr(entity.location, "players")) # Se è una porta ed è anche dall'altra parte allora potrebbe # invece ricavare le entità dall'altra parte original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() entities = list(getattr(destination_room, "players")) execution = self._update_sense_to_target(entity, entities, input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def update_sense_mob(self, entity, input_name, command_function): """ Comportamento che fa eseguire un senso sui mob nella locazione corrente. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_mob"): entities = list(getattr(entity.location, "mobs")) original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() entities = list(getattr(destination_room, "mobs")) execution = self._update_sense_to_target(entity, entities, input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def update_sense_item(self, entity, input_name, command_function): """ Comportamento che fa eseguire un senso sugli oggetti nella locazione corrente. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_item"): entities = list(getattr(entity.location, "items")) original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() entities = list(getattr(destination_room, "items")) execution = self._update_sense_to_target(entity, entities, input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def update_sense_self(self, entity, input_name, command_function): """ Comportamento che fa eseguire un senso su sé stessi. """ # La flag NO_LOOK_LIST è intesa da utilizzare per rendere non visibili # subitamente le entità, ma comunque interagibili se uno cerca un po' # quindi il check viene eseguito per tutti i sensi, altrimenti un mob, # annusando un'entità, potrebbe involontariamente far scoprirne # l'esistenza if (FLAG.NO_LOOK_LIST not in entity.flags and entity.incognito and random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_self")): original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() execution = self._update_sense_to_target(entity, [entity, ], input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def update_sense_at_races(self, entity, input_name, command_function): """ Comportamento che fa eseguire un senso alle entità di una determinata razza nella locazione corrente. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_at_races"): sensable_actors = [] sense_at_races_flags = getattr(self, input_name + "_at_races_flags") original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() for actor in entity.location.iter_contains(("mobs", "players")): if actor.race in sense_at_races_flags: if entity.can_see(actor): sensable_actors.append(actor) execution = self._update_sense_to_target(entity, sensable_actors, input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def update_sense_an_entitypes(self, entity, input_name, command_function): if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_at_entitypes"): sensable_actors = [] sense_an_entitypes_flags = getattr(self, input_name + "_at_entitypes_flags") original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() for item in entity.location.items: if item.entitype in sense_an_entitypes_flags: if entity.can_see(item): sensable_actors.append(item) execution = self._update_sense_to_target(entity, sensable_actors, input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def update_sense_direction(self, entity, input_name, command_function): if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if entity.location.IS_ROOM and random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_direction"): original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() choised_direction = random.choice(DIR.elements) execution = self._update_sense_at_direction(entity, choised_direction, input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def update_sense_exit(self, entity, input_name, command_function): if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if (entity.location.IS_ROOM and entity.location.exits and random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_exit")): original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() directions = [] for direction in entity.location.exits: door = entity.location.get_door(direction) if door and DOOR.CLOSED not in door.door_type.flags: directions.append(direction) if directions: choised_direction = random.choice(directions) execution = self._update_sense_at_direction(entity, choised_direction, input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def update_sense_wall(self, entity, input_name, command_function): if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if (entity.location.IS_ROOM and entity.location.walls and random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_wall")): original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() choised_direction = random.choice(entity.location.walls.keys()) execution = self._update_sense_at_direction(entity, choised_direction, input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def update_sense_closed_door(self, entity, input_name, command_function): if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if (entity.location.IS_ROOM and entity.location.exits and random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_closed_door")): original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() directions = [] for direction in entity.location.exits: door = entity.location.get_door(direction) if door and DOOR.CLOSED in door.door_type.flags: directions.append(direction) if directions: choised_direction = random.choice(directions) execution = self._update_sense_at_direction(entity, choised_direction, input_name, command_function) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return execution return False #- Fine Metodo - def _update_sense_to_target(self, entity, entities, input_name, command_function): # Rimuove l'entità dalla lista perché il comportamento di guardare sé # stessi viene gestito separatamente if entity in entities: entities.remove(entity) if not entities: return False for target in reversed(entities): if not entity.can_see(target): entities.remove(target) # C'è un commento sopra relativo alla flag NO_LOOK_LIST che # potrebbe chiarire come mai viene utilizzata per tutti i sensi if FLAG.NO_LOOK_LIST in target.flags: entities.remove(target) if entities: target = random.choice(entities) equipment_targets = [] inventory_targets = [] search_in_inventory = False if not target.location: log.bug("target %s non è contenuto da nessuna parte" % target.code) return if not target.location.IS_ROOM and target.location.container_type and CONTAINER.CLOSED not in target.location.container_type.flags: search_in_inventory = True for en in target.iter_contains(): if len(en.wear_mode) > 0: equipment_targets.append(en) elif FLAG.INGESTED not in en.flags and FLAG.BURIED not in en.flags: inventory_targets.append(en) numbered_keyword = target.get_numbered_keyword(looker=entity) if target.extras and hasattr(self, input_name + "_extra") and random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_extra"): extra = random.choice(target.extras) command_function(entity, "%s %s" % (extra.keywords.split()[0], numbered_keyword), behavioured=True) elif equipment_targets and hasattr(self, input_name + "_equipment") and random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_equipment"): equipped = random.choice(equipment_targets) command_function(entity, "%s %s" % (equipped.get_numbered_keyword(looker=entity), numbered_keyword), behavioured=True) elif inventory_targets and hasattr(self, input_name + "_inventory") and random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_inventory"): inventory = random.choice(equipment_targets) command_function(entity, "%s %s" % (inventory.get_numbered_keyword(looker=entity), numbered_keyword), behavioured=True) else: command_function(entity, numbered_keyword, behavioured=True) return True return False #- Fine Metodo - def _update_sense_at_direction(self, entity, direction, input_name, command_function): extras = None if direction in entity.location.exits and entity.location.exits[direction].extras: extras = entity.location.exits[direction].extras elif direction in entity.location.walls and entity.location.walls[direction].extras: extras = entity.location.walls[direction].extras if extras and random.randint(1, config.max_behaviour_probability) <= getattr(self, input_name + "_extra"): extra = random.choice(extras) command_function(entity, "%s %s" % (direction.english_nocolor, extra.keywords.split()[0]), behavioured=True) else: command_function(entity, direction.english_nocolor, behavioured=True) return True #- Fine Metodo - # - Behaviour relativi al movimento ---------------------------------------- def update_wander_direction(self, entity): """ Azione di movimento in una direzione qualsiasi. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if entity.location.IS_ROOM and random.randint(1, config.max_behaviour_probability) <= self.wander_direction: direction = random.choice(DIR.elements) door = entity.location.get_door(direction) # Da finire il sistema delle closed door # if BEHAVIOUR.WANDER_DIRECTION_CLOSED_DOOR: # if not door or (DOOR.CLOSED in door.door_type.flags and DOOR.SECRET not in door.door_type.flags): # return self._update_wander_at_direction(entity, direction) # else: if not door or (DOOR.CLOSED not in door.door_type.flags): return self._update_wander_at_direction(entity, direction) return False #- Fine Metodo - def update_wander_exit(self, entity): """ Azione di movimento tra uscite reali. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if (entity.location.IS_ROOM and entity.location.exits and random.randint(1, config.max_behaviour_probability) <= self.wander_exit): directions = [] for direction in entity.location.exits: door = entity.location.get_door(direction) if not door or (DOOR.CLOSED not in door.door_type.flags): directions.append(direction) if directions: choised_direction = random.choice(directions) return self._update_wander_at_direction(entity, choised_direction) return False #- Fine Metodo - def update_wander_wall(self, entity): # Azione di movimento tra le mura if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if (entity.location.IS_ROOM and entity.location.walls and random.randint(1, config.max_behaviour_probability) <= self.wander_wall): direction = random.choice(entity.location.walls.keys()) return self._update_wander_at_direction(entity, direction) return False #- Fine Metodo - def update_wander_closed_door(self, entity): """ Azione di movimento tra le sole porte chiuse """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if (entity.location.IS_ROOM and entity.location.exits and random.randint(1, config.max_behaviour_probability) <= self.wander_closed_door): directions = [] for direction in entity.location.exits: door = entity.location.get_door(direction) if door and DOOR.CLOSED in door.door_type.flags and DOOR.SECRET not in door.door_type.flags: directions.append(direction) if directions: choised_direction = random.choice(directions) return self._update_wander_at_direction(entity, choised_direction) return False #- Fine Metodo - def update_wander_at_exits(self, entity): """ Azione di movimento ad una determinata direzione. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) if (entity.location.IS_ROOM and self.wander_at_exits_flags and random.randint(1, config.max_behaviour_probability) <= self.wander_at_exits): directions = [] for direction in entity.location.exits: door = entity.location.get_door(direction) if not door or (DOOR.CLOSED in door.door_type.flags and DOOR.SECRET not in door.door_type.flags): directions.append(direction) if directions: direction = random.choice(directions) return self._update_wander_at_direction(entity, direction) return False #- Fine Metodo - def update_wander_portal(self, entity): """ Azione di movimento nei portali. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) # È voluto che il wander_portal non esegua un check sul wander_area if random.randint(1, config.max_behaviour_probability) <= self.wander_portal: portals = [] for target in entity.location.iter_contains(): if not entity.can_see(target): continue if target.entitype == ENTITYPE.PORTAL: portals.append(target) if not portals: return False portal = random.choice(portals) if entity == portal and random.randint(1, config.max_behaviour_probability) > self.wander_self: return False portal_keyword = portal.get_numbered_keyword(looker=entity) command_enter(entity, portal_keyword) return True return False #- Fine Metodo - def update_wander_enter_container(self, entity): """ Azione di movimento di entrare nei contenitori. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) # È voluto che il wander_enter_container non esegua un check sul wander_area if random.randint(1, config.max_behaviour_probability) <= self.wander_enter_container: containers = [] for target in entity.location.iter_contains(): if not entity.can_see(target): continue if target.entitype == ENTITYPE.CONTAINER: containers.append(target) if not containers: return False container = random.choice(containers) if entity == container and random.randint(1, config.max_behaviour_probability) > self.wander_self: return False container_keyword = container.get_numbered_keyword(looker=entity) command_enter(entity, container_keyword) return True return False #- Fine Metodo - def update_wander_exit_container(self, entity): """ Azione di movimento di entrare dai contenitori. """ if not entity.location: log.bug("location non è valida per %r: %r" % (entity, entity.location)) # È voluto che il wander_exit_container non esegua un check sul wander_area if random.randint(1, config.max_behaviour_probability) <= self.wander_exit_container: containers = [] for target in entity.location.iter_contains(): if not entity.can_see(target): continue if target.entitype == ENTITYPE.CONTAINER: containers.append(target) if not containers: return False container = random.choice(containers) if entity == container and random.randint(1, config.max_behaviour_probability) > self.wander_self: return False container_keyword = container.get_numbered_keyword(looker=entity) command_exit(entity, container_keyword) return True return False #- Fine Metodo - def _update_wander_at_direction(self, entity, direction): if not direction or direction == DIR.NONE: log.bug("direction è un parametro non valido: %r" % direction) return False # --------------------------------------------------------------------- # Evita di far uscire l'entità dall'area se è il caso destination_room = entity.location.get_destination_room(direction) if destination_room: if destination_room.area != entity.location.area: if random.randint(1, config.max_behaviour_probability) > self.wander_area: return False # Evita di andare in settori non voluti; questa parte di codice sballa # un po' la probabilità che entri un wander in direzioni valide, # tuttavia poiché già i behaviour sono pesantucci lato CPU è preferibile # che il controllo sia centralizzato qui piuttosto che calcolare # se le varie direzioni da cui pescare la casuale sia adatta o meno if self.wander_at_sectors and destination_room.sector not in self.wander_at_sectors: return False command_function = DIR_COMMANDS[direction] door = entity.location.get_door(direction) if door and DOOR.CLOSED in door.door_type.flags: # (TD) in futuro evitare di eseguire i comandi in rapida successione # e magari aspettare il codice di ritorno di ognuno per vedere se # eseguire quello successivo if DOOR.NO_USE_DIR in door.door_type.flags: argument = door.get_numbered_keyword(looker=entity) command_open(entity, argument) command_function(entity, "", behavioured=True) # (TD) (BB) Qui però se l'altro lato della porta ha una keyword # differente allora argument non è corretto e il comando non funziona command_close(entity, argument) else: command_open(entity, direction.english_nocolor) command_function(entity, "", behavioured=True) # (TT) (bb) qui però mi sa che con uscite con Destination il # reverse non serva ad un tubino.. però... da provare command_close(entity, direction.reverse_dir.english_nocolor) else: command_function(entity, "", behavioured=True) return True #- Fine Metodo - # - Altre tipologie di behaviour ------------------------------------------- def update_random_do(self, entity): if self.random_do <= 0 or not self.random_do_inputs: return False if random.randint(1, config.max_behaviour_probability) > self.random_do: return False original_location = None if entity.door_type and random.randint(0, 1) == 1: destination_room, direction = entity.to_reverse_hinges() if destination_room: original_location = entity.previous_location() # Se l'input scelto a caso è un comando vero e proprio allora lo invia # come comando, altrimenti come messaggio di echo. argument = random.choice(self.random_do_inputs) interpret_or_echo(entity, argument, behavioured=True) if original_location and original_location == entity.previous_location() and not entity.is_extracted(): entity.to_reverse_hinges() return True #- Fine Metodo - class MobBehaviour(_BehaviourHandler): def __init__(self): super(MobBehaviour, self).__init__() self.look = 1 # Percentuale di look nella locazione self.look_player = 1 # Percentuale di look sui pg self.look_mob = 1 # Percentuale di look sui mob self.look_item = 1 # Percentuale di look sugli oggetti self.look_self = 1 # Percentuale di look su sé stessi self.look_at_races = 0 # Percentuale relativa al look sulle razze self.look_at_races_flags = Flags(RACE.NONE) # Tipi di razze guardabili, se NONE tutte self.look_at_entitypes = 0 # Percentuale relativa al look sulle entitype self.look_at_entitypes_flags = Flags(ENTITYPE.NONE) # Tipi di entità guardabili, se NONE tutte self.look_direction = 1 # Percentuale di look su tutte le direzioni self.look_exit = 0 # Percentuale di look sulle uscite reali e aperte self.look_wall = 0 # Percentuale di look sui wall esistenti self.look_closed_door = 0 # Percentuale di look sulle porte chiuse # (TD) attenzione alle exit con flag in cui non si può utilizzare la direction self.look_extra = 1 # Percentuale di look sulle extra di uno dei look di cui sopra self.look_equipment = 0 # Percentuale di look sui pezzi di equipaggiamento dell'entità guardata self.look_inventory = 0 # Percentuale di look sui pezzi in inventario per i contenitori aperti self.listen = 1 self.listen_player = 1 self.listen_mob = 1 self.listen_item = 1 self.listen_self = 1 self.listen_at_races = 0 self.listen_at_races_flags = Flags(RACE.NONE) self.listen_at_entitypes = 0 self.listen_at_entitypes_flags = Flags(ENTITYPE.NONE) self.listen_direction = 1 self.listen_exit = 0 self.listen_wall = 0 self.listen_closed_door = 0 self.listen_extra = 1 self.listen_equipment = 0 self.listen_inventory = 0 self.smell = 1 self.smell_player = 1 self.smell_mob = 1 self.smell_item = 1 self.smell_self = 1 self.smell_at_races = 0 self.smell_at_races_flags = Flags(RACE.NONE) self.smell_at_entitypes = 0 self.smell_at_entitypes_flags = Flags(ENTITYPE.NONE) self.smell_direction = 1 self.smell_exit = 0 self.smell_wall = 0 self.smell_closed_door = 0 self.smell_extra = 1 self.smell_equipment = 0 self.smell_inventory = 0 self.touch = 1 self.touch_player = 1 self.touch_mob = 1 self.touch_item = 1 self.touch_self = 0 self.touch_at_races = 0 self.touch_at_races_flags = Flags(RACE.NONE) self.touch_at_entitypes = 0 self.touch_at_entitypes_flags = Flags(ENTITYPE.NONE) self.touch_direction = 1 self.touch_exit = 0 self.touch_wall = 0 self.touch_closed_door = 0 self.touch_extra = 1 self.touch_equipment = 0 self.touch_inventory = 0 self.taste = 1 self.taste_player = 1 self.taste_mob = 1 self.taste_item = 1 self.taste_self = 1 self.taste_at_races = 0 self.taste_at_races_flags = Flags(RACE.NONE) self.taste_at_entitypes = 0 self.taste_at_entitypes_flags = Flags(ENTITYPE.NONE) self.taste_direction = 1 self.taste_exit = 0 self.taste_wall = 0 self.taste_closed_door = 0 self.taste_extra = 1 self.taste_equipment = 0 self.taste_inventory = 0 self.intuition = 1 self.intuition_player = 1 self.intuition_mob = 1 self.intuition_item = 1 self.intuition_self = 1 self.intuition_at_races = 0 self.intuition_at_races_flags = Flags(RACE.NONE) self.intuition_at_entitypes = 0 self.intuition_at_entitypes_flags = Flags(ENTITYPE.NONE) self.intuition_direction = 1 self.intuition_exit = 0 self.intuition_wall = 0 self.intuition_closed_door = 0 self.intuition_extra = 1 self.intuition_equipment = 0 self.intuition_inventory = 0 self.wander_direction = 1 # Percentuale di movimento in una direzione qualsiasi self.wander_exit = 0 # Percentuale di movimento in un'uscita reale self.wander_wall = 0 # Percentuale di movimento sui wall esistenti self.wander_closed_door = 0 # Percentuale di movimento tra le porte chiuse e apribili self.wander_area = 0 # Percentuale di movimento tra aree self.wander_at_exits = 0 # Percentuale di movimento sulle direzioni impostate self.wander_at_exits_flags = Flags(DIR.NONE) # Direzione in cui andrà con più probabilità self.wander_at_sectors = Flags(SECTOR.NONE) # Settori in cui può muoversi self.wander_portal = 0 # Percentuale di movimento nei portali self.wander_enter_container = 0 # Percentuale di movimento di entrata nei contenitori self.wander_exit_container = 0 # Percentuale di movimento di uscita dai contenitori self.wander_self = 0 # Percentuale di enter/exit su sé stessi se si è un portale o un contenitore self.random_do = 0 # Percentuale di utilizzo di uno tra i comandi impostati in random_do_inputs self.random_do_inputs = [] # Attributo che fa coppia con random_do #- Fine Inizializzazione - def copy(self, to_obj=None, avoid_volatiles=False): if not to_obj: to_obj = MobBehaviour() copy_existing_attributes(self, to_obj, avoid_volatiles=avoid_volatiles) return to_obj #- Fine Metodo - class ItemBehaviour(_BehaviourHandler): def __init__(self): super(ItemBehaviour, self).__init__() self.look = 0 self.look_player = 0 self.look_mob = 0 self.look_item = 0 self.look_self = 0 self.look_at_races = 0 self.look_at_races_flags = Flags(RACE.NONE) self.look_at_entitypes = 0 self.look_at_entitypes_flags = Flags(ENTITYPE.NONE) self.look_direction = 0 self.look_exit = 0 self.look_wall = 0 self.look_closed_door = 0 self.look_extra = 0 self.look_equipment = 0 self.look_inventory = 0 self.listen = 0 self.listen_player = 0 self.listen_mob = 0 self.listen_item = 0 self.listen_self = 0 self.listen_at_races = 0 self.listen_at_races_flags = Flags(RACE.NONE) self.listen_at_entitypes = 0 self.listen_at_entitypes_flags = Flags(ENTITYPE.NONE) self.listen_direction = 0 self.listen_exit = 0 self.listen_wall = 0 self.listen_closed_door = 0 self.listen_extra = 0 self.listen_equipment = 0 self.listen_inventory = 0 self.smell = 0 self.smell_player = 0 self.smell_mob = 0 self.smell_item = 0 self.smell_self = 0 self.smell_at_races = 0 self.smell_at_races_flags = Flags(RACE.NONE) self.smell_at_entitypes = 0 self.smell_at_entitypes_flags = Flags(ENTITYPE.NONE) self.smell_direction = 0 self.smell_exit = 0 self.smell_wall = 0 self.smell_closed_door = 0 self.smell_extra = 0 self.smell_equipment = 0 self.smell_inventory = 0 self.touch = 0 self.touch_player = 0 self.touch_mob = 0 self.touch_item = 0 self.touch_self = 0 self.touch_at_races = 0 self.touch_at_races_flags = Flags(RACE.NONE) self.touch_at_entitypes = 0 self.touch_at_entitypes_flags = Flags(ENTITYPE.NONE) self.touch_direction = 0 self.touch_exit = 0 self.touch_wall = 0 self.touch_closed_door = 0 self.touch_extra = 0 self.touch_equipment = 0 self.touch_inventory = 0 self.taste = 0 self.taste_player = 0 self.taste_mob = 0 self.taste_item = 0 self.taste_self = 0 self.taste_at_races = 0 self.taste_at_races_flags = Flags(RACE.NONE) self.taste_at_entitypes = 0 self.taste_at_entitypes_flags = Flags(ENTITYPE.NONE) self.taste_direction = 0 self.taste_exit = 0 self.taste_wall = 0 self.taste_closed_door = 0 self.taste_extra = 0 self.taste_equipment = 0 self.taste_inventory = 0 self.intuition = 0 self.intuition_player = 0 self.intuition_mob = 0 self.intuition_item = 0 self.intuition_self = 0 self.intuition_at_races = 0 self.intuition_at_races_flags = Flags(RACE.NONE) self.intuition_at_entitypes = 0 self.intuition_at_entitypes_flags = Flags(ENTITYPE.NONE) self.intuition_direction = 0 self.intuition_exit = 0 self.intuition_wall = 0 self.intuition_closed_door = 0 self.intuition_extra = 0 self.intuition_equipment = 0 self.intuition_inventory = 0 self.wander_direction = 0 self.wander_exit = 0 self.wander_wall = 0 self.wander_closed_door = 0 self.wander_area = 0 self.wander_at_exits = 0 self.wander_at_exits_flags = Flags(DIR.NONE) self.wander_at_sectors = Flags(SECTOR.NONE) self.wander_portal = 0 self.wander_enter_container = 0 self.wander_exit_container = 0 self.wander_self = 0 self.random_do = 0 self.random_do_inputs = [] #- Fine Inizializzazione - def copy(self, to_obj=None, avoid_volatiles=False): if not to_obj: to_obj = ItemBehaviour() copy_existing_attributes(self, to_obj, avoid_volatiles=avoid_volatiles) return to_obj #- Fine Metodo - # (TD) fare anche gli altri behaviour con l'attributo # _cached_behaviour_draw_attrs al loro interno class RoomBehaviour(object): PRIMARY_KEY = "" VOLATILES = ["_cached_behaviour_draw_attrs"] MULTILINES = [] SCHEMA = {"random_echo_texts" : ("", "str")} REFERENCES = {} WEAKREFS = {} BEHAVIOUR_DRAW = {"random_echo" : "update_random_echo"} def __init__(self): self.random_echo = 0 self.random_echo_texts = [] # Attributi volatili self._cached_behaviour_draw_attrs = [] #- Fine Metodo - def __repr__(self): random_total = get_total_percent(self, "random") return "%s: random=%d" % (super(_BehaviourHandler, self).__repr__, random_total) #- Fine Metodo - def get_error_message(self): if self.get_error_message_random_echo_texts() != "": return self.get_error_message_random_echo_texts() return "" #- Fine Metodo - def get_error_message_random_echo_texts(self): for random_echo_text in self.random_echo_texts: if len(random_echo_text) > config.max_google_translate: return "random_echo_text %r più lungo di %d caratteri." % (random_echo_text, config.max_google_translate) return "" #- Fine Metodo - def copy(self, to_obj=None, avoid_volatiles=False): if not to_obj: to_obj = RoomBehaviour() copy_existing_attributes(self, to_obj, avoid_volatiles=avoid_volatiles) return to_obj #- Fine Metodo - def equals(self, room_behaviour2): if not room_behaviour2: return False if self.random_echo != room_behaviour2.random_echo: return False if len(self.random_echo_texts) != len(behaviour2.random_echo_texts): return False for text in self.random_echo_texts: for text2 in room_behaviour2.random_echo_texts: if text == text2: break else: return False if len(self._cached_behaviour_draw_attrs) != len(behaviour2._cached_behaviour_draw_attrs): return False for draw_attr in self._cached_behaviour_draw_attrs: for draw_attr2 in room_behaviour2._cached_behaviour_draw_attrs: if draw_attr == draw_attr2: break else: return False return True #- Fine Metodo - # ------------------------------------------------------------------------- def cache(self, room): # Prepara la lista di liste con coppie [nome attributo, valore] dei # comportamenti for attr_name in self.BEHAVIOUR_DRAW.keys(): value = getattr(self, attr_name) if value > 0: self._cached_behaviour_draw_attrs.append([attr_name, value]) # Ordina dal valore più piccolo a quello più grande, poi al posto # dei valori calcola in ordine il totale accumulato, l'ultimo elemento # è quello con il totale di tutti i valori dei comportamenti self._cached_behaviour_draw_attrs = sorted(self._cached_behaviour_draw_attrs, key=lambda cached: cached[1]) values = [] for cached in self._cached_behaviour_draw_attrs: values.append(cached[1]) cached[1] = sum(values) # Aggiunge la stanza alla lista del ciclo di loop apposito room_behaviour_loop.behavioured_rooms.append(room) #- Fine Metodo - def update(self, room): # Ricava il totale di tutti i valori di comportamento impostati che si # trova come ultimo valore della struttura total = self._cached_behaviour_draw_attrs[-1][1] if total <= 0: log.bug("Il totale dei behaviour dell'entità %s non è un valore valido: %d" % (self.code, total)) return # Con il meccanismo seguente si può pescare a caso in maniera # proporzionale al valore impostato al behaviour # (TD) provare ad inlinizzare il ciclo for per migliorare le prestazioni choiced_attr = "" casual_number = random.randint(0, total) for cached in self._cached_behaviour_draw_attrs: if cached[1] >= casual_number: choiced_attr = cached[0] break if not choiced_attr: log.bug("Non è stato scelto nessun attributo valido con casual_number %d e total %d all'entità %s" % ( casual_number, total, room.code)) return # Esegue infine il comportamento scelto casualmente behaviour_draw_value = self.BEHAVIOUR_DRAW[choiced_attr] action_executed = getattr(self, behaviour_draw_value)(room) # Tiene traccia su file delle statistiche d'esecuzione dei comportamenti if config.track_behaviours: key = "%s()" % (behaviour_draw_value) if key not in room_behaviour_tracker: room_behaviour_tracker[key] = [0, 0] if action_executed: room_behaviour_tracker[key][0] += 1 room_behaviour_tracker[key][1] += 1 #- Fine Metodo - # ------------------------------------------------------------------------- def update_random_echo(self, room): if self.random_echo <= 0 or not self.random_echo_texts: return False if random.randint(1, config.max_behaviour_probability) > self.random_echo: return False # Sceglie a caso l'echo e lo invia text = random.choice(self.random_echo_texts) if MIML_SEPARATOR in text: text = room.parse_miml(text) if text: room.echo(text) return True #- Fine Metodo - # (TD) classe sbagliata, farla come la RoomBehaviour class BehaviourUpdaterSuperclass(object): """ Classe contenente il metodo generico che sarà ereditato in ultima istanza dalle classi Mob, Item e simili per eseguire un update dei comportamenti di quelle entità. Questa classe alla fin fine viene Mixinata con Mob o con Item. """ BEHAVIOUR_DRAW = {"look" : ["update_sense", "look", "command_look"], "look_player" : ["update_sense_player", "look", "command_look"], "look_mob" : ["update_sense_mob", "look", "command_look"], "look_item" : ["update_sense_item", "look", "command_look"], "look_self" : ["update_sense_self", "look", "command_look"], "look_at_races" : ["update_sense_at_races", "look", "command_look"], "look_at_entitypes" : ["update_sense_an_entitypes", "look", "command_look"], "look_direction" : ["update_sense_direction", "look", "command_look"], "look_exit" : ["update_sense_exit", "look", "command_look"], "look_wall" : ["update_sense_wall", "look", "command_look"], "look_closed_door" : ["update_sense_closed_door", "look", "command_look"], "listen" : ["update_sense", "listen", "command_listen"], "listen_player" : ["update_sense_player", "listen", "command_listen"], "listen_mob" : ["update_sense_mob", "listen", "command_listen"], "listen_item" : ["update_sense_item", "listen", "command_listen"], "listen_self" : ["update_sense_self", "listen", "command_listen"], "listen_at_races" : ["update_sense_at_races", "listen", "command_listen"], "listen_at_entitypes" : ["update_sense_an_entitypes", "listen", "command_listen"], "listen_direction" : ["update_sense_direction", "listen", "command_listen"], "listen_exit" : ["update_sense_exit", "listen", "command_listen"], "listen_wall" : ["update_sense_wall", "listen", "command_listen"], "listen_closed_door" : ["update_sense_closed_door", "listen", "command_listen"], "smell" : ["update_sense", "smell", "command_smell"], "smell_player" : ["update_sense_player", "smell", "command_smell"], "smell_mob" : ["update_sense_mob", "smell", "command_smell"], "smell_item" : ["update_sense_item", "smell", "command_smell"], "smell_self" : ["update_sense_self", "smell", "command_smell"], "smell_at_races" : ["update_sense_at_races", "smell", "command_smell"], "smell_at_entitypes" : ["update_sense_an_entitypes", "smell", "command_smell"], "smell_direction" : ["update_sense_direction", "smell", "command_smell"], "smell_exit" : ["update_sense_exit", "smell", "command_smell"], "smell_wall" : ["update_sense_wall", "smell", "command_smell"], "smell_closed_door" : ["update_sense_closed_door", "smell", "command_smell"], "touch" : ["update_sense", "touch", "command_touch"], "touch_player" : ["update_sense_player", "touch", "command_touch"], "touch_mob" : ["update_sense_mob", "touch", "command_touch"], "touch_item" : ["update_sense_item", "touch", "command_touch"], "touch_self" : ["update_sense_self", "touch", "command_touch"], "touch_at_races" : ["update_sense_at_races", "touch", "command_touch"], "touch_at_entitypes" : ["update_sense_an_entitypes", "touch", "command_touch"], "touch_direction" : ["update_sense_direction", "touch", "command_touch"], "touch_exit" : ["update_sense_exit", "touch", "command_touch"], "touch_wall" : ["update_sense_wall", "touch", "command_touch"], "touch_closed_door" : ["update_sense_closed_door", "touch", "command_touch"], "taste" : ["update_sense", "taste", "command_taste"], "taste_player" : ["update_sense_player", "taste", "command_taste"], "taste_mob" : ["update_sense_mob", "taste", "command_taste"], "taste_item" : ["update_sense_item", "taste", "command_taste"], "taste_self" : ["update_sense_self", "taste", "command_taste"], "taste_at_races" : ["update_sense_at_races", "taste", "command_taste"], "taste_at_entitypes" : ["update_sense_an_entitypes", "taste", "command_taste"], "taste_direction" : ["update_sense_direction", "taste", "command_taste"], "taste_exit" : ["update_sense_exit", "taste", "command_taste"], "taste_wall" : ["update_sense_wall", "taste", "command_taste"], "taste_closed_door" : ["update_sense_closed_door", "taste", "command_taste"], "intuition" : ["update_sense", "intuition", "command_intuition"], "intuition_player" : ["update_sense_player", "intuition", "command_intuition"], "intuition_mob" : ["update_sense_mob", "intuition", "command_intuition"], "intuition_item" : ["update_sense_item", "intuition", "command_intuition"], "intuition_self" : ["update_sense_self", "intuition", "command_intuition"], "intuition_at_races" : ["update_sense_at_races", "intuition", "command_intuition"], "intuition_at_entitypes" : ["update_sense_an_entitypes", "intuition", "command_intuition"], "intuition_direction" : ["update_sense_direction", "intuition", "command_intuition"], "intuition_exit" : ["update_sense_exit", "intuition", "command_intuition"], "intuition_wall" : ["update_sense_wall", "intuition", "command_intuition"], "intuition_closed_door" : ["update_sense_closed_door", "intuition", "command_intuition"], "wander_direction" : ["update_wander_direction", "", None], "wander_exit" : ["update_wander_exit", "", None], "wander_wall" : ["update_wander_wall", "", None], "wander_closed_door" : ["update_wander_closed_door", "", None], "wander_at_exits" : ["update_wander_at_exits", "", None], "wander_portal" : ["update_wander_portal", "", None], "wander_enter_container" : ["update_wander_enter_container", "", None], "wander_exit_container" : ["update_wander_exit_container", "", None], "random_do" : ["update_random_do", "", None]} def cache_behaviour(self, behaviour_attr_name): """ Prepara la lista da cui scegliere a caso uno tra i comportamenti che hanno un valore maggiore di zero. Questo sistema di cache esiste perché altrimenti la getattr utilizzata su migliaia di entità ogni qualche secondi è CPU intesiva. """ behaviour = getattr(self, behaviour_attr_name) if not behaviour: log.bug("Inatteso passaggio nel codice con behaviour non valido: %r" % behaviour) return # Prepara la lista di liste con coppie [nome attributo, valore] dei # comportamenti cached_behaviour_draw_attrs = [] for attr_name, draw_value in self.BEHAVIOUR_DRAW.iteritems(): value = getattr(behaviour, attr_name) if value > 0: cached_behaviour_draw_attrs.append([attr_name, value]) # Per evitare casini di import vengono importati solo # successivamente i comandi if isinstance(draw_value[2], basestring): command_module = __import__("src.commands.%s" % draw_value[2], globals(), locals(), [""]) draw_value[2] = getattr(command_module, draw_value[2]) # Ordina dal valore più piccolo a quello più grande, poi al posto # dei valori calcola in ordine il totale accumulato, l'ultimo elemento # è quello con il totale di tutti i valori dei comportamenti cached_behaviour_draw_attrs = sorted(cached_behaviour_draw_attrs, key=lambda cached: cached[1]) values = [] for cached in cached_behaviour_draw_attrs: values.append(cached[1]) cached[1] = sum(values) # È normale quando il builder ha definito tutti i behaviour a zero, # questo serve ad esplicitare che non si vogliono eventuali valori di # default superiori a zero definiti nelle classi di MobBehaviour e # ItemBehaviour if not cached_behaviour_draw_attrs: setattr(self, behaviour_attr_name, None) else: # L'Attributo per cachare viene creato solo se necessario; iniziando # con un underscore è automaticamente visto come volatile dalla fwrite # e quindi l'etichetta relativa non viene salvata nella persistenza if "_" in behaviour_attr_name: cached_attr_name = "_cached_behaviour_draw_attrs_" + behaviour_attr_name.split("_")[0] else: cached_attr_name = "_cached_behaviour_draw_attrs" setattr(self, cached_attr_name, cached_behaviour_draw_attrs) #- Fine Metodo - def update_behaviour(self): access_attr_singular = self.ACCESS_ATTR[:-1] behaviour_of_room = None if self.location.IS_ROOM: if FLAG.NO_ROOM_BEHAVIOUR in self.flags: return behaviour_of_room = getattr(self.location, access_attr_singular + "_behaviour") if not behaviour_of_room and not self.behaviour: log.bug("Inatteso passaggio nel codice con behaviour_of_room %r e behaviour %r per l'entità %s" % ( behaviour_of_room, self.code)) return if behaviour_of_room: behaviour = behaviour_of_room cached_behaviour_draw_attr_name = "_cached_behaviour_draw_attrs_" + access_attr_singular cached_behaviour_draw_attrs = getattr(self.location, cached_behaviour_draw_attr_name) behaviour_tracker = globals()["room_" + access_attr_singular + "_behaviour_tracker"] else: behaviour = self.behaviour cached_behaviour_draw_attr_name = "_cached_behaviour_draw_attrs" cached_behaviour_draw_attrs = self._cached_behaviour_draw_attrs behaviour_tracker = globals()[access_attr_singular + "_behaviour_tracker"] # Se self è una porta chiusa e segreta allora esce e non produce # behaviour altrimenti verrebbe scoperta if (self.door_type and self.is_hinged() and DOOR.CLOSED in self.door_type.flags and DOOR.SECRET in self.door_type.flags): return # Se c'è qualcuno da combattere nella stanza allora non esegue # il behaviour if self.IS_ACTOR and self.is_fighting(): return # Se la porta è aperta allora esce e non produce behaviours perché # è "pacifico" che porte aperte passino in secondo piano a favore # delle uscite if self.is_hinged() and DOOR.CLOSED not in self.door_type.flags: return # Ricava il totale di tutti i valori di comportamento impostati che si # trova come ultimo valore della struttura try: total = cached_behaviour_draw_attrs[-1][1] except AttributeError: if self.location: details = "contenuto in %s " % self.location.code else: details = "non è dentro nulla " if self.door_type: details += "ed è una porta " if self.is_hinged(): details += "sui cardini " else: details += "ma non sui cardini " else: details += "e non è una porta " details += "il %d %d %d %s %d" % (calendar.minute, caledar.hour, calendar.day, calendar.month, calendar.year) log.bug("%s (%s) non possiede l'attributo %s" % (self.code, details, cached_behaviour_draw_attr_name)) return if total == 0: log.bug("Il totale dei behaviour è uguale a 0 nonostante sia definita l'etichetta per l'entità %s e il cached attr %s" % ( self.code, cached_behaviour_draw_attr_name)) return # Con il meccanismo seguente si può pescare a caso in maniera # proporzionale al valore impostato al behaviour # (TD) provare ad inlinizzare il ciclo for per prestazioni maggiori choiced_attr = "" casual_number = random.randint(0, total) for cached in cached_behaviour_draw_attrs: if cached[1] >= casual_number: choiced_attr = cached[0] break if not choiced_attr: log.bug("Non è stato scelto nessun attributo valido con casual_number %d e total %d all'entità %s" % ( casual_number, total, self.code)) return # Poiché vengono eseguiti dei comandi senza passare per la interpret # (dove c'è lo stesso controllo) si assicura che chi esegue l'azione # sia un'entità sola e non un mucchio fisico splitted = self.split_entity(1) # Esegue infine il comportamento scelto casualmente behaviour_draw_value = splitted.BEHAVIOUR_DRAW[choiced_attr] if behaviour_draw_value[1]: action_executed = getattr(behaviour, behaviour_draw_value[0])(splitted, behaviour_draw_value[1], behaviour_draw_value[2]) else: action_executed = getattr(behaviour, behaviour_draw_value[0])(splitted) # Tiene traccia su file delle statistiche d'esecuzione dei comportamenti if config.track_behaviours: if behaviour_draw_value[1]: key = "%s(%s)" % (behaviour_draw_value[0], behaviour_draw_value[1]) else: key = "%s()" % (behaviour_draw_value[0]) if key not in behaviour_tracker: behaviour_tracker[key] = [0, 0] if action_executed: behaviour_tracker[key][0] += 1 behaviour_tracker[key][1] += 1 # Poiché i comandi di behaviour non vengono inviati tramite la send_input # allora bisogna effettuare il controllo che c'è anche nella interpreter if config.check_references and not database.reference_error_found: database.check_all_references() #- Fine Metodo - # (TD) fare il loop separato anche per le altre tipologie di behaviour class RoomBehaviourLoop(UnstoppableLoop): def __init__(self): super(RoomBehaviourLoop, self).__init__() self.paused = False # Indica se questo ciclo è stato messo in pausa dal comando loop # Contiene la lista di tutte le entità che hanno dei RoomBehaviour, # serve a velocizzare il loop self.behavioured_rooms = [] #- Fine Inizializzazione - def start(self, seconds=0): if seconds == 0: seconds = config.room_behaviour_loop_seconds super(RoomBehaviourLoop, self).start(seconds) #- Fine Metodo - def stop(self): if self.running: super(RoomBehaviourLoop, self).stop() else: log.bug("Il RoomBehaviourLoop non è stato trovato attivo.") #- Fine Metodo - def cycle(self): if self.paused: return for behavioured_room in self.behavioured_rooms: if ROOM.EXTRACTED in behavioured_room.flags: log.bug("È stata trovata una room estratta nella lista delle behavioured_rooms del RoomBehaviourLoop: %s" % behavioured_room.code) continue if not behavioured_room.area: log.bug("È stata trovata una room senza area nella lista delle behavioured_rooms del RoomBehaviourLoop: %s" % behavioured_room.code) continue if behavioured_room.code not in database["rooms"]: log.bug("È stata trovata una room che non si trova nel database nella lista delle behavioured_rooms del RoomBehaviourLoop: %s" % behavioured_room.code) continue behavioured_room.room_behaviour.update(behavioured_room) #- Fine Metodo - #= FUNZIONI ==================================================================== def write_behaviour_tracker(): global mob_behaviour_tracker global item_behaviour_tracker global room_behaviour_tracker global room_mob_behaviour_tracker global room_item_behaviour_tracker file_path = "log/behaviours.txt" try: behaviour_file = open(file_path, "w") except IOError: log.bug("Impossibile aprire il file %s in scrittura" % file_path) return now = datetime.datetime.now() date = "%dy_%dm_%dd_%dh_%dm_%ds" % ( now.year, now.month, now.day, now.hour, now.minute, now.second) behaviour_file.write("MOB BEHAVIOURS %s\n" % date) for key in sorted(mob_behaviour_tracker): value = mob_behaviour_tracker[key] behaviour_file.write("%s: %d/%d\n" % (key, value[0], value[1])) behaviour_file.write("\nITEM BEHAVIOURS %s\n" % date) for key in sorted(item_behaviour_tracker): value = item_behaviour_tracker[key] behaviour_file.write("%s: %d/%d\n" % (key, value[0], value[1])) behaviour_file.write("\nROOM BEHAVIOURS %s\n" % date) for key in sorted(room_behaviour_tracker): value = room_behaviour_tracker[key] behaviour_file.write("%s: %d/%d\n" % (key, value[0], value[1])) behaviour_file.write("\nROOM MOB BEHAVIOURS %s\n" % date) for key in sorted(room_mob_behaviour_tracker): value = room_mob_behaviour_tracker[key] behaviour_file.write("%s: %d/%d\n" % (key, value[0], value[1])) behaviour_file.write("\nROOM ITEM BEHAVIOURS %s\n" % date) for key in sorted(room_item_behaviour_tracker): value = room_item_behaviour_tracker[key] behaviour_file.write("%s: %d/%d\n" % (key, value[0], value[1])) behaviour_file.write("\n") behaviour_file.close() #- Fine Funzione - def create_tooltip_behaviour(conn, behaviour, title, symbol): if not conn: if not engine.test_inputs_mode: log.bug("conn non è un parametro valido: %r" % conn) return "" if not behaviour: log.bug("behaviour non è un parametro valido: %r" % behaviour) return "" if not title: log.bug("title non è un parametro valido: %r" % title) return "" if not symbol: log.bug("symbol non è un parametro valido: %r" % symbol) return "" # ------------------------------------------------------------------------- at_least_one_behaviour = False lines = [] lines.append("[royalblue]%s[close]" % title) for attr in sorted(behaviour.__dict__): if attr[0] == "_": continue value = getattr(behaviour, attr) if value and str(value) and str(value) != "0": lines.append("[limegreen]%s[close]: %s" % (to_capitalized_words(attr), value)) at_least_one_behaviour = True if at_least_one_behaviour: return create_tooltip(conn, "<br>".join(lines), symbol) else: return "" #- Fine Funzione - def get_total_percent(behaviour, prefix): total = 0 for attr_name in behaviour.__dict__: if attr_name[0 : len(prefix)] != prefix: continue attr = getattr(behaviour, attr_name) if isinstance(attr, numbers.Number): total += attr return total #- Fine Metodo - #= SINGLETON =================================================================== room_behaviour_loop = RoomBehaviourLoop()
gpl-2.0
abhishekgahlot/inbox
migrations/versions/026_add_audit_timestamps_to_all_objects.py
2
2943
"""add audit timestamps to all objects Revision ID: 146b1817e4a8 Revises: 59b42d0ac749 Create Date: 2014-05-09 22:16:00.387937 """ # revision identifiers, used by Alembic. revision = '146b1817e4a8' down_revision = '59b42d0ac749' from alembic import op import sqlalchemy as sa from sqlalchemy.sql import table, column from sqlalchemy.ext.declarative import declarative_base from datetime import datetime table_names = {'account', 'block', 'contact', 'folder', 'folderitem', 'foldersync', 'imapuid', 'internaltag', 'lens', 'message', 'messagecontactassociation', 'namespace', 'searchsignal', 'searchtoken', 'thread', 'transaction', 'uidvalidity', 'webhook'} def add_eas_tables(): from inbox.ignition import engine Base = declarative_base() Base.metadata.reflect(engine) for table_name in ['easuid', 'easfoldersync']: if table_name in Base.metadata.tables: table_names.add(table_name) def upgrade(): add_eas_tables() # mysql 5.5 / sqlalchemy interactions necessitate doing this in steps for table_name in sorted(table_names): if table_name != 'contact': op.add_column(table_name, sa.Column('created_at', sa.DateTime(), nullable=True)) op.add_column(table_name, sa.Column('updated_at', sa.DateTime(), nullable=True)) op.add_column(table_name, sa.Column('deleted_at', sa.DateTime(), nullable=True)) t = table(table_name, column('created_at', sa.DateTime()), column('updated_at', sa.DateTime()), ) op.execute( t.update().values( {'created_at': datetime.utcnow(), 'updated_at': datetime.utcnow()})) op.alter_column(table_name, 'created_at', existing_type=sa.DateTime(), nullable=False) op.alter_column(table_name, 'updated_at', existing_type=sa.DateTime(), nullable=False) # missing from a prev revision op.create_index('imapaccount_id_folder_id', 'imapuid', ['imapaccount_id', 'folder_id'], unique=False) op.drop_index('imapuid_imapaccount_id_folder_name', table_name='imapuid') def downgrade(): add_eas_tables() for table_name in sorted(table_names): if table_name != 'contact': op.drop_column(table_name, 'updated_at') op.drop_column(table_name, 'created_at') op.drop_column(table_name, 'deleted_at') op.create_index('imapuid_imapaccount_id_folder_name', 'imapuid', [u'imapaccount_id', u'folder_id'], unique=False) op.drop_index('imapaccount_id_folder_id', table_name='imapuid')
agpl-3.0
pedrobaeza/odoo
openerp/service/server.py
32
35650
#----------------------------------------------------------- # Threaded, Gevent and Prefork Servers #----------------------------------------------------------- import datetime import errno import logging import os import os.path import platform import psutil import random if os.name == 'posix': import resource else: resource = None import select import signal import socket import subprocess import sys import threading import time import unittest2 import werkzeug.serving try: import fcntl except ImportError: pass try: from setproctitle import setproctitle except ImportError: setproctitle = lambda x: None import openerp from openerp.modules.registry import RegistryManager from openerp.release import nt_service_name import openerp.tools.config as config from openerp.tools.misc import stripped_sys_argv, dumpstacks _logger = logging.getLogger(__name__) SLEEP_INTERVAL = 60 # 1 min #---------------------------------------------------------- # Werkzeug WSGI servers patched #---------------------------------------------------------- class BaseWSGIServerNoBind(werkzeug.serving.BaseWSGIServer): """ werkzeug Base WSGI Server patched to skip socket binding. PreforkServer use this class, sets the socket and calls the process_request() manually """ def __init__(self, app): werkzeug.serving.BaseWSGIServer.__init__(self, "1", "1", app) def server_bind(self): # we dont bind beause we use the listen socket of PreforkServer#socket # instead we close the socket if self.socket: self.socket.close() def server_activate(self): # dont listen as we use PreforkServer#socket pass class RequestHandler(werkzeug.serving.WSGIRequestHandler): def setup(self): # flag the current thread as handling a http request super(RequestHandler, self).setup() me = threading.currentThread() me.name = 'openerp.service.http.request.%s' % (me.ident,) # _reexec() should set LISTEN_* to avoid connection refused during reload time. It # should also work with systemd socket activation. This is currently untested # and not yet used. class ThreadedWSGIServerReloadable(werkzeug.serving.ThreadedWSGIServer): """ werkzeug Threaded WSGI Server patched to allow reusing a listen socket given by the environement, this is used by autoreload to keep the listen socket open when a reload happens. """ def __init__(self, host, port, app): super(ThreadedWSGIServerReloadable, self).__init__(host, port, app, handler=RequestHandler) def server_bind(self): envfd = os.environ.get('LISTEN_FDS') if envfd and os.environ.get('LISTEN_PID') == str(os.getpid()): self.reload_socket = True self.socket = socket.fromfd(int(envfd), socket.AF_INET, socket.SOCK_STREAM) # should we os.close(int(envfd)) ? it seem python duplicate the fd. else: self.reload_socket = False super(ThreadedWSGIServerReloadable, self).server_bind() def server_activate(self): if not self.reload_socket: super(ThreadedWSGIServerReloadable, self).server_activate() #---------------------------------------------------------- # AutoReload watcher #---------------------------------------------------------- class AutoReload(object): def __init__(self, server): self.server = server self.files = {} self.modules = {} import pyinotify class EventHandler(pyinotify.ProcessEvent): def __init__(self, autoreload): self.autoreload = autoreload def process_IN_CREATE(self, event): _logger.debug('File created: %s', event.pathname) self.autoreload.files[event.pathname] = 1 def process_IN_MODIFY(self, event): _logger.debug('File modified: %s', event.pathname) self.autoreload.files[event.pathname] = 1 self.wm = pyinotify.WatchManager() self.handler = EventHandler(self) self.notifier = pyinotify.Notifier(self.wm, self.handler, timeout=0) mask = pyinotify.IN_MODIFY | pyinotify.IN_CREATE # IN_MOVED_FROM, IN_MOVED_TO ? for path in openerp.modules.modules.ad_paths: _logger.info('Watching addons folder %s', path) self.wm.add_watch(path, mask, rec=True) def process_data(self, files): xml_files = [i for i in files if i.endswith('.xml')] for i in xml_files: for path in openerp.modules.modules.ad_paths: if i.startswith(path): # find out wich addons path the file belongs to # and extract it's module name right = i[len(path) + 1:].split('/') if len(right) < 2: continue module = right[0] self.modules[module] = 1 if self.modules: _logger.info('autoreload: xml change detected, autoreload activated') restart() def process_python(self, files): # process python changes py_files = [i for i in files if i.endswith('.py')] py_errors = [] # TODO keep python errors until they are ok if py_files: for i in py_files: try: source = open(i, 'rb').read() + '\n' compile(source, i, 'exec') except SyntaxError: py_errors.append(i) if py_errors: _logger.info('autoreload: python code change detected, errors found') for i in py_errors: _logger.info('autoreload: SyntaxError %s', i) else: _logger.info('autoreload: python code updated, autoreload activated') restart() def check_thread(self): # Check if some files have been touched in the addons path. # If true, check if the touched file belongs to an installed module # in any of the database used in the registry manager. while 1: while self.notifier.check_events(1000): self.notifier.read_events() self.notifier.process_events() l = self.files.keys() self.files.clear() self.process_data(l) self.process_python(l) def run(self): t = threading.Thread(target=self.check_thread) t.setDaemon(True) t.start() _logger.info('AutoReload watcher running') #---------------------------------------------------------- # Servers: Threaded, Gevented and Prefork #---------------------------------------------------------- class CommonServer(object): def __init__(self, app): # TODO Change the xmlrpc_* options to http_* self.app = app # config self.interface = config['xmlrpc_interface'] or '0.0.0.0' self.port = config['xmlrpc_port'] # runtime self.pid = os.getpid() def close_socket(self, sock): """ Closes a socket instance cleanly :param sock: the network socket to close :type sock: socket.socket """ try: sock.shutdown(socket.SHUT_RDWR) except socket.error, e: # On OSX, socket shutdowns both sides if any side closes it # causing an error 57 'Socket is not connected' on shutdown # of the other side (or something), see # http://bugs.python.org/issue4397 # note: stdlib fixed test, not behavior if e.errno != errno.ENOTCONN or platform.system() not in ['Darwin', 'Windows']: raise sock.close() class ThreadedServer(CommonServer): def __init__(self, app): super(ThreadedServer, self).__init__(app) self.main_thread_id = threading.currentThread().ident # Variable keeping track of the number of calls to the signal handler defined # below. This variable is monitored by ``quit_on_signals()``. self.quit_signals_received = 0 #self.socket = None self.httpd = None def signal_handler(self, sig, frame): if sig in [signal.SIGINT, signal.SIGTERM]: # shutdown on kill -INT or -TERM self.quit_signals_received += 1 if self.quit_signals_received > 1: # logging.shutdown was already called at this point. sys.stderr.write("Forced shutdown.\n") os._exit(0) elif sig == signal.SIGHUP: # restart on kill -HUP openerp.phoenix = True self.quit_signals_received += 1 def cron_thread(self, number): while True: time.sleep(SLEEP_INTERVAL + number) # Steve Reich timing style registries = openerp.modules.registry.RegistryManager.registries _logger.debug('cron%d polling for jobs', number) for db_name, registry in registries.items(): while True and registry.ready: acquired = openerp.addons.base.ir.ir_cron.ir_cron._acquire_job(db_name) if not acquired: break def cron_spawn(self): """ Start the above runner function in a daemon thread. The thread is a typical daemon thread: it will never quit and must be terminated when the main process exits - with no consequence (the processing threads it spawns are not marked daemon). """ # Force call to strptime just before starting the cron thread # to prevent time.strptime AttributeError within the thread. # See: http://bugs.python.org/issue7980 datetime.datetime.strptime('2012-01-01', '%Y-%m-%d') for i in range(openerp.tools.config['max_cron_threads']): def target(): self.cron_thread(i) t = threading.Thread(target=target, name="openerp.service.cron.cron%d" % i) t.setDaemon(True) t.start() _logger.debug("cron%d started!" % i) def http_thread(self): def app(e, s): return self.app(e, s) self.httpd = ThreadedWSGIServerReloadable(self.interface, self.port, app) self.httpd.serve_forever() def http_spawn(self): t = threading.Thread(target=self.http_thread, name="openerp.service.httpd") t.setDaemon(True) t.start() _logger.info('HTTP service (werkzeug) running on %s:%s', self.interface, self.port) def start(self, stop=False): _logger.debug("Setting signal handlers") if os.name == 'posix': signal.signal(signal.SIGINT, self.signal_handler) signal.signal(signal.SIGTERM, self.signal_handler) signal.signal(signal.SIGCHLD, self.signal_handler) signal.signal(signal.SIGHUP, self.signal_handler) signal.signal(signal.SIGQUIT, dumpstacks) elif os.name == 'nt': import win32api win32api.SetConsoleCtrlHandler(lambda sig: self.signal_handler(sig, None), 1) test_mode = config['test_enable'] or config['test_file'] if not stop or test_mode: # some tests need the http deamon to be available... self.http_spawn() if not stop: # only relevant if we are not in "--stop-after-init" mode self.cron_spawn() def stop(self): """ Shutdown the WSGI server. Wait for non deamon threads. """ _logger.info("Initiating shutdown") _logger.info("Hit CTRL-C again or send a second signal to force the shutdown.") if self.httpd: self.httpd.shutdown() self.close_socket(self.httpd.socket) # Manually join() all threads before calling sys.exit() to allow a second signal # to trigger _force_quit() in case some non-daemon threads won't exit cleanly. # threading.Thread.join() should not mask signals (at least in python 2.5). me = threading.currentThread() _logger.debug('current thread: %r', me) for thread in threading.enumerate(): _logger.debug('process %r (%r)', thread, thread.isDaemon()) if thread != me and not thread.isDaemon() and thread.ident != self.main_thread_id: while thread.isAlive(): _logger.debug('join and sleep') # Need a busyloop here as thread.join() masks signals # and would prevent the forced shutdown. thread.join(0.05) time.sleep(0.05) _logger.debug('--') openerp.modules.registry.RegistryManager.delete_all() logging.shutdown() def run(self, preload=None, stop=False): """ Start the http server and the cron thread then wait for a signal. The first SIGINT or SIGTERM signal will initiate a graceful shutdown while a second one if any will force an immediate exit. """ self.start(stop=stop) rc = preload_registries(preload) if stop: self.stop() return rc # Wait for a first signal to be handled. (time.sleep will be interrupted # by the signal handler.) The try/except is for the win32 case. try: while self.quit_signals_received == 0: time.sleep(60) except KeyboardInterrupt: pass self.stop() def reload(self): os.kill(self.pid, signal.SIGHUP) class GeventServer(CommonServer): def __init__(self, app): super(GeventServer, self).__init__(app) self.port = config['longpolling_port'] self.httpd = None def watch_parent(self, beat=4): import gevent ppid = os.getppid() while True: if ppid != os.getppid(): pid = os.getpid() _logger.info("LongPolling (%s) Parent changed", pid) # suicide !! os.kill(pid, signal.SIGTERM) return gevent.sleep(beat) def start(self): import gevent from gevent.wsgi import WSGIServer if os.name == 'posix': signal.signal(signal.SIGQUIT, dumpstacks) gevent.spawn(self.watch_parent) self.httpd = WSGIServer((self.interface, self.port), self.app) _logger.info('Evented Service (longpolling) running on %s:%s', self.interface, self.port) self.httpd.serve_forever() def stop(self): import gevent self.httpd.stop() gevent.shutdown() def run(self, preload, stop): self.start() self.stop() class PreforkServer(CommonServer): """ Multiprocessing inspired by (g)unicorn. PreforkServer (aka Multicorn) currently uses accept(2) as dispatching method between workers but we plan to replace it by a more intelligent dispatcher to will parse the first HTTP request line. """ def __init__(self, app): # config self.address = (config['xmlrpc_interface'] or '0.0.0.0', config['xmlrpc_port']) self.population = config['workers'] self.timeout = config['limit_time_real'] self.limit_request = config['limit_request'] # working vars self.beat = 4 self.app = app self.pid = os.getpid() self.socket = None self.workers_http = {} self.workers_cron = {} self.workers = {} self.generation = 0 self.queue = [] self.long_polling_pid = None def pipe_new(self): pipe = os.pipe() for fd in pipe: # non_blocking flags = fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK fcntl.fcntl(fd, fcntl.F_SETFL, flags) # close_on_exec flags = fcntl.fcntl(fd, fcntl.F_GETFD) | fcntl.FD_CLOEXEC fcntl.fcntl(fd, fcntl.F_SETFD, flags) return pipe def pipe_ping(self, pipe): try: os.write(pipe[1], '.') except IOError, e: if e.errno not in [errno.EAGAIN, errno.EINTR]: raise def signal_handler(self, sig, frame): if len(self.queue) < 5 or sig == signal.SIGCHLD: self.queue.append(sig) self.pipe_ping(self.pipe) else: _logger.warn("Dropping signal: %s", sig) def worker_spawn(self, klass, workers_registry): self.generation += 1 worker = klass(self) pid = os.fork() if pid != 0: worker.pid = pid self.workers[pid] = worker workers_registry[pid] = worker return worker else: worker.run() sys.exit(0) def long_polling_spawn(self): nargs = stripped_sys_argv() cmd = nargs[0] cmd = os.path.join(os.path.dirname(cmd), "openerp-gevent") nargs[0] = cmd popen = subprocess.Popen(nargs) self.long_polling_pid = popen.pid def worker_pop(self, pid): if pid in self.workers: _logger.debug("Worker (%s) unregistered", pid) try: self.workers_http.pop(pid, None) self.workers_cron.pop(pid, None) u = self.workers.pop(pid) u.close() except OSError: return def worker_kill(self, pid, sig): try: os.kill(pid, sig) except OSError, e: if e.errno == errno.ESRCH: self.worker_pop(pid) def process_signals(self): while len(self.queue): sig = self.queue.pop(0) if sig in [signal.SIGINT, signal.SIGTERM]: raise KeyboardInterrupt elif sig == signal.SIGHUP: # restart on kill -HUP openerp.phoenix = True raise KeyboardInterrupt elif sig == signal.SIGQUIT: # dump stacks on kill -3 self.dumpstacks() elif sig == signal.SIGTTIN: # increase number of workers self.population += 1 elif sig == signal.SIGTTOU: # decrease number of workers self.population -= 1 def process_zombie(self): # reap dead workers while 1: try: wpid, status = os.waitpid(-1, os.WNOHANG) if not wpid: break if (status >> 8) == 3: msg = "Critial worker error (%s)" _logger.critical(msg, wpid) raise Exception(msg % wpid) self.worker_pop(wpid) except OSError, e: if e.errno == errno.ECHILD: break raise def process_timeout(self): now = time.time() for (pid, worker) in self.workers.items(): if worker.watchdog_timeout is not None and \ (now - worker.watchdog_time) >= worker.watchdog_timeout: _logger.error("Worker (%s) timeout", pid) self.worker_kill(pid, signal.SIGKILL) def process_spawn(self): while len(self.workers_http) < self.population: self.worker_spawn(WorkerHTTP, self.workers_http) while len(self.workers_cron) < config['max_cron_threads']: self.worker_spawn(WorkerCron, self.workers_cron) if not self.long_polling_pid: self.long_polling_spawn() def sleep(self): try: # map of fd -> worker fds = dict([(w.watchdog_pipe[0], w) for k, w in self.workers.items()]) fd_in = fds.keys() + [self.pipe[0]] # check for ping or internal wakeups ready = select.select(fd_in, [], [], self.beat) # update worker watchdogs for fd in ready[0]: if fd in fds: fds[fd].watchdog_time = time.time() try: # empty pipe while os.read(fd, 1): pass except OSError, e: if e.errno not in [errno.EAGAIN]: raise except select.error, e: if e[0] not in [errno.EINTR]: raise def start(self): # wakeup pipe, python doesnt throw EINTR when a syscall is interrupted # by a signal simulating a pseudo SA_RESTART. We write to a pipe in the # signal handler to overcome this behaviour self.pipe = self.pipe_new() # set signal handlers signal.signal(signal.SIGINT, self.signal_handler) signal.signal(signal.SIGTERM, self.signal_handler) signal.signal(signal.SIGHUP, self.signal_handler) signal.signal(signal.SIGCHLD, self.signal_handler) signal.signal(signal.SIGTTIN, self.signal_handler) signal.signal(signal.SIGTTOU, self.signal_handler) signal.signal(signal.SIGQUIT, dumpstacks) # listen to socket self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.setblocking(0) self.socket.bind(self.address) self.socket.listen(8 * self.population) def stop(self, graceful=True): if self.long_polling_pid is not None: # FIXME make longpolling process handle SIGTERM correctly self.worker_kill(self.long_polling_pid, signal.SIGKILL) self.long_polling_pid = None if graceful: _logger.info("Stopping gracefully") limit = time.time() + self.timeout for pid in self.workers.keys(): self.worker_kill(pid, signal.SIGTERM) while self.workers and time.time() < limit: self.process_zombie() time.sleep(0.1) else: _logger.info("Stopping forcefully") for pid in self.workers.keys(): self.worker_kill(pid, signal.SIGTERM) self.socket.close() def run(self, preload, stop): self.start() rc = preload_registries(preload) if stop: self.stop() return rc # Empty the cursor pool, we dont want them to be shared among forked workers. openerp.sql_db.close_all() _logger.debug("Multiprocess starting") while 1: try: #_logger.debug("Multiprocess beat (%s)",time.time()) self.process_signals() self.process_zombie() self.process_timeout() self.process_spawn() self.sleep() except KeyboardInterrupt: _logger.debug("Multiprocess clean stop") self.stop() break except Exception, e: _logger.exception(e) self.stop(False) return -1 class Worker(object): """ Workers """ def __init__(self, multi): self.multi = multi self.watchdog_time = time.time() self.watchdog_pipe = multi.pipe_new() # Can be set to None if no watchdog is desired. self.watchdog_timeout = multi.timeout self.ppid = os.getpid() self.pid = None self.alive = True # should we rename into lifetime ? self.request_max = multi.limit_request self.request_count = 0 def setproctitle(self, title=""): setproctitle('openerp: %s %s %s' % (self.__class__.__name__, self.pid, title)) def close(self): os.close(self.watchdog_pipe[0]) os.close(self.watchdog_pipe[1]) def signal_handler(self, sig, frame): self.alive = False def sleep(self): try: select.select([self.multi.socket], [], [], self.multi.beat) except select.error, e: if e[0] not in [errno.EINTR]: raise def process_limit(self): if resource is None: return # If our parent changed sucide if self.ppid != os.getppid(): _logger.info("Worker (%s) Parent changed", self.pid) self.alive = False # check for lifetime if self.request_count >= self.request_max: _logger.info("Worker (%d) max request (%s) reached.", self.pid, self.request_count) self.alive = False # Reset the worker if it consumes too much memory (e.g. caused by a memory leak). rss, vms = psutil.Process(os.getpid()).get_memory_info() if vms > config['limit_memory_soft']: _logger.info('Worker (%d) virtual memory limit (%s) reached.', self.pid, vms) self.alive = False # Commit suicide after the request. # VMS and RLIMIT_AS are the same thing: virtual memory, a.k.a. address space soft, hard = resource.getrlimit(resource.RLIMIT_AS) resource.setrlimit(resource.RLIMIT_AS, (config['limit_memory_hard'], hard)) # SIGXCPU (exceeded CPU time) signal handler will raise an exception. r = resource.getrusage(resource.RUSAGE_SELF) cpu_time = r.ru_utime + r.ru_stime def time_expired(n, stack): _logger.info('Worker (%d) CPU time limit (%s) reached.', config['limit_time_cpu']) # We dont suicide in such case raise Exception('CPU time limit exceeded.') signal.signal(signal.SIGXCPU, time_expired) soft, hard = resource.getrlimit(resource.RLIMIT_CPU) resource.setrlimit(resource.RLIMIT_CPU, (cpu_time + config['limit_time_cpu'], hard)) def process_work(self): pass def start(self): self.pid = os.getpid() self.setproctitle() _logger.info("Worker %s (%s) alive", self.__class__.__name__, self.pid) # Reseed the random number generator random.seed() # Prevent fd inherientence close_on_exec flags = fcntl.fcntl(self.multi.socket, fcntl.F_GETFD) | fcntl.FD_CLOEXEC fcntl.fcntl(self.multi.socket, fcntl.F_SETFD, flags) # reset blocking status self.multi.socket.setblocking(0) signal.signal(signal.SIGINT, self.signal_handler) signal.signal(signal.SIGTERM, signal.SIG_DFL) signal.signal(signal.SIGCHLD, signal.SIG_DFL) def stop(self): pass def run(self): try: self.start() while self.alive: self.process_limit() self.multi.pipe_ping(self.watchdog_pipe) self.sleep() self.process_work() _logger.info("Worker (%s) exiting. request_count: %s.", self.pid, self.request_count) self.stop() except Exception: _logger.exception("Worker (%s) Exception occured, exiting..." % self.pid) # should we use 3 to abort everything ? sys.exit(1) class WorkerHTTP(Worker): """ HTTP Request workers """ def process_request(self, client, addr): client.setblocking(1) client.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) # Prevent fd inherientence close_on_exec flags = fcntl.fcntl(client, fcntl.F_GETFD) | fcntl.FD_CLOEXEC fcntl.fcntl(client, fcntl.F_SETFD, flags) # do request using BaseWSGIServerNoBind monkey patched with socket self.server.socket = client # tolerate broken pipe when the http client closes the socket before # receiving the full reply try: self.server.process_request(client, addr) except IOError, e: if e.errno != errno.EPIPE: raise self.request_count += 1 def process_work(self): try: client, addr = self.multi.socket.accept() self.process_request(client, addr) except socket.error, e: if e[0] not in (errno.EAGAIN, errno.ECONNABORTED): raise def start(self): Worker.start(self) self.server = BaseWSGIServerNoBind(self.multi.app) class WorkerCron(Worker): """ Cron workers """ def __init__(self, multi): super(WorkerCron, self).__init__(multi) # process_work() below process a single database per call. # The variable db_index is keeping track of the next database to # process. self.db_index = 0 def sleep(self): # Really sleep once all the databases have been processed. if self.db_index == 0: interval = SLEEP_INTERVAL + self.pid % 10 # chorus effect time.sleep(interval) def _db_list(self): if config['db_name']: db_names = config['db_name'].split(',') else: db_names = openerp.service.db.exp_list(True) return db_names def process_work(self): rpc_request = logging.getLogger('openerp.netsvc.rpc.request') rpc_request_flag = rpc_request.isEnabledFor(logging.DEBUG) _logger.debug("WorkerCron (%s) polling for jobs", self.pid) db_names = self._db_list() if len(db_names): self.db_index = (self.db_index + 1) % len(db_names) db_name = db_names[self.db_index] self.setproctitle(db_name) if rpc_request_flag: start_time = time.time() start_rss, start_vms = psutil.Process(os.getpid()).get_memory_info() import openerp.addons.base as base base.ir.ir_cron.ir_cron._acquire_job(db_name) openerp.modules.registry.RegistryManager.delete(db_name) # dont keep cursors in multi database mode if len(db_names) > 1: openerp.sql_db.close_db(db_name) if rpc_request_flag: run_time = time.time() - start_time end_rss, end_vms = psutil.Process(os.getpid()).get_memory_info() vms_diff = (end_vms - start_vms) / 1024 logline = '%s time:%.3fs mem: %sk -> %sk (diff: %sk)' % \ (db_name, run_time, start_vms / 1024, end_vms / 1024, vms_diff) _logger.debug("WorkerCron (%s) %s", self.pid, logline) self.request_count += 1 if self.request_count >= self.request_max and self.request_max < len(db_names): _logger.error("There are more dabatases to process than allowed " "by the `limit_request` configuration variable: %s more.", len(db_names) - self.request_max) else: self.db_index = 0 def start(self): os.nice(10) # mommy always told me to be nice with others... Worker.start(self) self.multi.socket.close() #---------------------------------------------------------- # start/stop public api #---------------------------------------------------------- server = None def load_server_wide_modules(): for m in openerp.conf.server_wide_modules: try: openerp.modules.module.load_openerp_module(m) except Exception: msg = '' if m == 'web': msg = """ The `web` module is provided by the addons found in the `openerp-web` project. Maybe you forgot to add those addons in your addons_path configuration.""" _logger.exception('Failed to load server-wide module `%s`.%s', m, msg) def _reexec(updated_modules=None): """reexecute openerp-server process with (nearly) the same arguments""" if openerp.tools.osutil.is_running_as_nt_service(): subprocess.call('net stop {0} && net start {0}'.format(nt_service_name), shell=True) exe = os.path.basename(sys.executable) args = stripped_sys_argv() args += ["-u", ','.join(updated_modules)] if not args or args[0] != exe: args.insert(0, exe) os.execv(sys.executable, args) def load_test_file_yml(registry, test_file): with registry.cursor() as cr: openerp.tools.convert_yaml_import(cr, 'base', file(test_file), 'test', {}, 'init') if config['test_commit']: _logger.info('test %s has been commited', test_file) cr.commit() else: _logger.info('test %s has been rollbacked', test_file) cr.rollback() def load_test_file_py(registry, test_file): # Locate python module based on its filename and run the tests test_path, _ = os.path.splitext(os.path.abspath(test_file)) for mod_name, mod_mod in sys.modules.items(): if mod_mod: mod_path, _ = os.path.splitext(getattr(mod_mod, '__file__', '')) if test_path == mod_path: suite = unittest2.TestSuite() for t in unittest2.TestLoader().loadTestsFromModule(mod_mod): suite.addTest(t) _logger.log(logging.INFO, 'running tests %s.', mod_mod.__name__) stream = openerp.modules.module.TestStream() result = unittest2.TextTestRunner(verbosity=2, stream=stream).run(suite) success = result.wasSuccessful() if hasattr(registry._assertion_report,'report_result'): registry._assertion_report.report_result(success) if not success: _logger.error('%s: at least one error occurred in a test', test_file) def preload_registries(dbnames): """ Preload a registries, possibly run a test file.""" # TODO: move all config checks to args dont check tools.config here config = openerp.tools.config test_file = config['test_file'] dbnames = dbnames or [] rc = 0 for dbname in dbnames: try: update_module = config['init'] or config['update'] registry = RegistryManager.new(dbname, update_module=update_module) # run test_file if provided if test_file: _logger.info('loading test file %s', test_file) if test_file.endswith('yml'): load_test_file_yml(registry, test_file) elif test_file.endswith('py'): load_test_file_py(registry, test_file) if registry._assertion_report.failures: rc += 1 except Exception: _logger.critical('Failed to initialize database `%s`.', dbname, exc_info=True) return -1 return rc def start(preload=None, stop=False): """ Start the openerp http server and cron processor. """ global server load_server_wide_modules() if openerp.evented: server = GeventServer(openerp.service.wsgi_server.application) elif config['workers']: server = PreforkServer(openerp.service.wsgi_server.application) else: server = ThreadedServer(openerp.service.wsgi_server.application) if config['auto_reload']: autoreload = AutoReload(server) autoreload.run() rc = server.run(preload, stop) # like the legend of the phoenix, all ends with beginnings if getattr(openerp, 'phoenix', False): modules = [] if config['auto_reload']: modules = autoreload.modules.keys() _reexec(modules) return rc if rc else 0 def restart(): """ Restart the server """ if os.name == 'nt': # run in a thread to let the current thread return response to the caller. threading.Thread(target=_reexec).start() else: os.kill(server.pid, signal.SIGHUP) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
agpl-3.0
Maspear/odoo
openerp/tools/safe_eval.py
250
12368
# -*- coding: utf-8 -*- ############################################################################## # Copyright (C) 2004-2014 OpenERP s.a. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## """ safe_eval module - methods intended to provide more restricted alternatives to evaluate simple and/or untrusted code. Methods in this module are typically used as alternatives to eval() to parse OpenERP domain strings, conditions and expressions, mostly based on locals condition/math builtins. """ # Module partially ripped from/inspired by several different sources: # - http://code.activestate.com/recipes/286134/ # - safe_eval in lp:~xrg/openobject-server/optimize-5.0 # - safe_eval in tryton http://hg.tryton.org/hgwebdir.cgi/trytond/rev/bbb5f73319ad from opcode import HAVE_ARGUMENT, opmap, opname from psycopg2 import OperationalError from types import CodeType import logging from .misc import ustr import openerp __all__ = ['test_expr', 'safe_eval', 'const_eval'] # The time module is usually already provided in the safe_eval environment # but some code, e.g. datetime.datetime.now() (Windows/Python 2.5.2, bug # lp:703841), does import time. _ALLOWED_MODULES = ['_strptime', 'math', 'time'] _UNSAFE_ATTRIBUTES = ['f_builtins', 'f_globals', 'f_locals', 'gi_frame', 'co_code', 'func_globals'] _CONST_OPCODES = set(opmap[x] for x in [ 'POP_TOP', 'ROT_TWO', 'ROT_THREE', 'ROT_FOUR', 'DUP_TOP', 'DUP_TOPX', 'POP_BLOCK','SETUP_LOOP', 'BUILD_LIST', 'BUILD_MAP', 'BUILD_TUPLE', 'LOAD_CONST', 'RETURN_VALUE', 'STORE_SUBSCR', 'STORE_MAP'] if x in opmap) _EXPR_OPCODES = _CONST_OPCODES.union(set(opmap[x] for x in [ 'UNARY_POSITIVE', 'UNARY_NEGATIVE', 'UNARY_NOT', 'UNARY_INVERT', 'BINARY_POWER', 'BINARY_MULTIPLY', 'BINARY_DIVIDE', 'BINARY_FLOOR_DIVIDE', 'BINARY_TRUE_DIVIDE', 'BINARY_MODULO', 'BINARY_ADD', 'BINARY_SUBTRACT', 'BINARY_SUBSCR', 'BINARY_LSHIFT', 'BINARY_RSHIFT', 'BINARY_AND', 'BINARY_XOR', 'BINARY_OR', 'INPLACE_ADD', 'INPLACE_SUBTRACT', 'INPLACE_MULTIPLY', 'INPLACE_DIVIDE', 'INPLACE_REMAINDER', 'INPLACE_POWER', 'INPLACE_LEFTSHIFT', 'INPLACE_RIGHTSHIFT', 'INPLACE_AND', 'INPLACE_XOR','INPLACE_OR' ] if x in opmap)) _SAFE_OPCODES = _EXPR_OPCODES.union(set(opmap[x] for x in [ 'LOAD_NAME', 'CALL_FUNCTION', 'COMPARE_OP', 'LOAD_ATTR', 'STORE_NAME', 'GET_ITER', 'FOR_ITER', 'LIST_APPEND', 'DELETE_NAME', 'JUMP_FORWARD', 'JUMP_IF_TRUE', 'JUMP_IF_FALSE', 'JUMP_ABSOLUTE', 'MAKE_FUNCTION', 'SLICE+0', 'SLICE+1', 'SLICE+2', 'SLICE+3', 'BREAK_LOOP', 'CONTINUE_LOOP', 'RAISE_VARARGS', 'YIELD_VALUE', # New in Python 2.7 - http://bugs.python.org/issue4715 : 'JUMP_IF_FALSE_OR_POP', 'JUMP_IF_TRUE_OR_POP', 'POP_JUMP_IF_FALSE', 'POP_JUMP_IF_TRUE', 'SETUP_EXCEPT', 'END_FINALLY', 'LOAD_FAST', 'STORE_FAST', 'DELETE_FAST', 'UNPACK_SEQUENCE', 'LOAD_GLOBAL', # Only allows access to restricted globals ] if x in opmap)) _logger = logging.getLogger(__name__) def _get_opcodes(codeobj): """_get_opcodes(codeobj) -> [opcodes] Extract the actual opcodes as a list from a code object >>> c = compile("[1 + 2, (1,2)]", "", "eval") >>> _get_opcodes(c) [100, 100, 23, 100, 100, 102, 103, 83] """ i = 0 byte_codes = codeobj.co_code while i < len(byte_codes): code = ord(byte_codes[i]) yield code if code >= HAVE_ARGUMENT: i += 3 else: i += 1 def assert_no_dunder_name(code_obj, expr): """ assert_no_dunder_name(code_obj, expr) -> None Asserts that the code object does not refer to any "dunder name" (__$name__), so that safe_eval prevents access to any internal-ish Python attribute or method (both are loaded via LOAD_ATTR which uses a name, not a const or a var). Checks that no such name exists in the provided code object (co_names). :param code_obj: code object to name-validate :type code_obj: CodeType :param str expr: expression corresponding to the code object, for debugging purposes :raises NameError: in case a forbidden name (containing two underscores) is found in ``code_obj`` .. note:: actually forbids every name containing 2 underscores """ for name in code_obj.co_names: if "__" in name or name in _UNSAFE_ATTRIBUTES: raise NameError('Access to forbidden name %r (%r)' % (name, expr)) def assert_valid_codeobj(allowed_codes, code_obj, expr): """ Asserts that the provided code object validates against the bytecode and name constraints. Recursively validates the code objects stored in its co_consts in case lambdas are being created/used (lambdas generate their own separated code objects and don't live in the root one) :param allowed_codes: list of permissible bytecode instructions :type allowed_codes: set(int) :param code_obj: code object to name-validate :type code_obj: CodeType :param str expr: expression corresponding to the code object, for debugging purposes :raises ValueError: in case of forbidden bytecode in ``code_obj`` :raises NameError: in case a forbidden name (containing two underscores) is found in ``code_obj`` """ assert_no_dunder_name(code_obj, expr) for opcode in _get_opcodes(code_obj): if opcode not in allowed_codes: raise ValueError( "opcode %s not allowed (%r)" % (opname[opcode], expr)) for const in code_obj.co_consts: if isinstance(const, CodeType): assert_valid_codeobj(allowed_codes, const, 'lambda') def test_expr(expr, allowed_codes, mode="eval"): """test_expr(expression, allowed_codes[, mode]) -> code_object Test that the expression contains only the allowed opcodes. If the expression is valid and contains only allowed codes, return the compiled code object. Otherwise raise a ValueError, a Syntax Error or TypeError accordingly. """ try: if mode == 'eval': # eval() does not like leading/trailing whitespace expr = expr.strip() code_obj = compile(expr, "", mode) except (SyntaxError, TypeError, ValueError): raise except Exception, e: import sys exc_info = sys.exc_info() raise ValueError, '"%s" while compiling\n%r' % (ustr(e), expr), exc_info[2] assert_valid_codeobj(allowed_codes, code_obj, expr) return code_obj def const_eval(expr): """const_eval(expression) -> value Safe Python constant evaluation Evaluates a string that contains an expression describing a Python constant. Strings that are not valid Python expressions or that contain other code besides the constant raise ValueError. >>> const_eval("10") 10 >>> const_eval("[1,2, (3,4), {'foo':'bar'}]") [1, 2, (3, 4), {'foo': 'bar'}] >>> const_eval("1+2") Traceback (most recent call last): ... ValueError: opcode BINARY_ADD not allowed """ c = test_expr(expr, _CONST_OPCODES) return eval(c) def expr_eval(expr): """expr_eval(expression) -> value Restricted Python expression evaluation Evaluates a string that contains an expression that only uses Python constants. This can be used to e.g. evaluate a numerical expression from an untrusted source. >>> expr_eval("1+2") 3 >>> expr_eval("[1,2]*2") [1, 2, 1, 2] >>> expr_eval("__import__('sys').modules") Traceback (most recent call last): ... ValueError: opcode LOAD_NAME not allowed """ c = test_expr(expr, _EXPR_OPCODES) return eval(c) def _import(name, globals=None, locals=None, fromlist=None, level=-1): if globals is None: globals = {} if locals is None: locals = {} if fromlist is None: fromlist = [] if name in _ALLOWED_MODULES: return __import__(name, globals, locals, level) raise ImportError(name) def safe_eval(expr, globals_dict=None, locals_dict=None, mode="eval", nocopy=False, locals_builtins=False): """safe_eval(expression[, globals[, locals[, mode[, nocopy]]]]) -> result System-restricted Python expression evaluation Evaluates a string that contains an expression that mostly uses Python constants, arithmetic expressions and the objects directly provided in context. This can be used to e.g. evaluate an OpenERP domain expression from an untrusted source. :throws TypeError: If the expression provided is a code object :throws SyntaxError: If the expression provided is not valid Python :throws NameError: If the expression provided accesses forbidden names :throws ValueError: If the expression provided uses forbidden bytecode """ if isinstance(expr, CodeType): raise TypeError("safe_eval does not allow direct evaluation of code objects.") if globals_dict is None: globals_dict = {} # prevent altering the globals/locals from within the sandbox # by taking a copy. if not nocopy: # isinstance() does not work below, we want *exactly* the dict class if (globals_dict is not None and type(globals_dict) is not dict) \ or (locals_dict is not None and type(locals_dict) is not dict): _logger.warning( "Looks like you are trying to pass a dynamic environment, " "you should probably pass nocopy=True to safe_eval().") globals_dict = dict(globals_dict) if locals_dict is not None: locals_dict = dict(locals_dict) globals_dict.update( __builtins__={ '__import__': _import, 'True': True, 'False': False, 'None': None, 'str': str, 'unicode': unicode, 'bool': bool, 'int': int, 'float': float, 'long': long, 'enumerate': enumerate, 'dict': dict, 'list': list, 'tuple': tuple, 'map': map, 'abs': abs, 'min': min, 'max': max, 'sum': sum, 'reduce': reduce, 'filter': filter, 'round': round, 'len': len, 'repr': repr, 'set': set, 'all': all, 'any': any, 'ord': ord, 'chr': chr, 'cmp': cmp, 'divmod': divmod, 'isinstance': isinstance, 'range': range, 'xrange': xrange, 'zip': zip, 'Exception': Exception, } ) if locals_builtins: if locals_dict is None: locals_dict = {} locals_dict.update(globals_dict.get('__builtins__')) c = test_expr(expr, _SAFE_OPCODES, mode=mode) try: return eval(c, globals_dict, locals_dict) except openerp.osv.orm.except_orm: raise except openerp.exceptions.Warning: raise except openerp.exceptions.RedirectWarning: raise except openerp.exceptions.AccessDenied: raise except openerp.exceptions.AccessError: raise except OperationalError: # Do not hide PostgreSQL low-level exceptions, to let the auto-replay # of serialized transactions work its magic raise except Exception, e: import sys exc_info = sys.exc_info() raise ValueError, '"%s" while evaluating\n%r' % (ustr(e), expr), exc_info[2] # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
agpl-3.0
beezee/GAE-Django-base-app
django/db/backends/oracle/introspection.py
210
5106
from django.db.backends import BaseDatabaseIntrospection import cx_Oracle import re foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)") class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type objects to Django Field types. data_types_reverse = { cx_Oracle.CLOB: 'TextField', cx_Oracle.DATETIME: 'DateField', cx_Oracle.FIXED_CHAR: 'CharField', cx_Oracle.NCLOB: 'TextField', cx_Oracle.NUMBER: 'DecimalField', cx_Oracle.STRING: 'CharField', cx_Oracle.TIMESTAMP: 'DateTimeField', } try: data_types_reverse[cx_Oracle.NATIVE_FLOAT] = 'FloatField' except AttributeError: pass try: data_types_reverse[cx_Oracle.UNICODE] = 'CharField' except AttributeError: pass def get_field_type(self, data_type, description): # If it's a NUMBER with scale == 0, consider it an IntegerField if data_type == cx_Oracle.NUMBER and description[5] == 0: if description[4] > 11: return 'BigIntegerField' else: return 'IntegerField' else: return super(DatabaseIntrospection, self).get_field_type( data_type, description) def get_table_list(self, cursor): "Returns a list of table names in the current database." cursor.execute("SELECT TABLE_NAME FROM USER_TABLES") return [row[0].lower() for row in cursor.fetchall()] def get_table_description(self, cursor, table_name): "Returns a description of the table, with the DB-API cursor.description interface." cursor.execute("SELECT * FROM %s WHERE ROWNUM < 2" % self.connection.ops.quote_name(table_name)) description = [] for desc in cursor.description: description.append((desc[0].lower(),) + desc[1:]) return description def table_name_converter(self, name): "Table name comparison is case insensitive under Oracle" return name.lower() def _name_to_index(self, cursor, table_name): """ Returns a dictionary of {field_name: field_index} for the given table. Indexes are 0-based. """ return dict([(d[0], i) for i, d in enumerate(self.get_table_description(cursor, table_name))]) def get_relations(self, cursor, table_name): """ Returns a dictionary of {field_index: (field_index_other_table, other_table)} representing all relationships to the given table. Indexes are 0-based. """ table_name = table_name.upper() cursor.execute(""" SELECT ta.column_id - 1, tb.table_name, tb.column_id - 1 FROM user_constraints, USER_CONS_COLUMNS ca, USER_CONS_COLUMNS cb, user_tab_cols ta, user_tab_cols tb WHERE user_constraints.table_name = %s AND ta.table_name = %s AND ta.column_name = ca.column_name AND ca.table_name = %s AND user_constraints.constraint_name = ca.constraint_name AND user_constraints.r_constraint_name = cb.constraint_name AND cb.table_name = tb.table_name AND cb.column_name = tb.column_name AND ca.position = cb.position""", [table_name, table_name, table_name]) relations = {} for row in cursor.fetchall(): relations[row[0]] = (row[2], row[1].lower()) return relations def get_indexes(self, cursor, table_name): """ Returns a dictionary of fieldname -> infodict for the given table, where each infodict is in the format: {'primary_key': boolean representing whether it's the primary key, 'unique': boolean representing whether it's a unique index} """ # This query retrieves each index on the given table, including the # first associated field name # "We were in the nick of time; you were in great peril!" sql = """\ SELECT LOWER(all_tab_cols.column_name) AS column_name, CASE user_constraints.constraint_type WHEN 'P' THEN 1 ELSE 0 END AS is_primary_key, CASE user_indexes.uniqueness WHEN 'UNIQUE' THEN 1 ELSE 0 END AS is_unique FROM all_tab_cols, user_cons_columns, user_constraints, user_ind_columns, user_indexes WHERE all_tab_cols.column_name = user_cons_columns.column_name (+) AND all_tab_cols.table_name = user_cons_columns.table_name (+) AND user_cons_columns.constraint_name = user_constraints.constraint_name (+) AND user_constraints.constraint_type (+) = 'P' AND user_ind_columns.column_name (+) = all_tab_cols.column_name AND user_ind_columns.table_name (+) = all_tab_cols.table_name AND user_indexes.uniqueness (+) = 'UNIQUE' AND user_indexes.index_name (+) = user_ind_columns.index_name AND all_tab_cols.table_name = UPPER(%s) """ cursor.execute(sql, [table_name]) indexes = {} for row in cursor.fetchall(): indexes[row[0]] = {'primary_key': row[1], 'unique': row[2]} return indexes
bsd-3-clause
Freeseer/freeseer
src/freeseer/framework/util.py
1
5638
#!/usr/bin/python # -*- coding: utf-8 -*- # freeseer - vga/presentation capture software # # Copyright (C) 2013, 2014 Free and Open Source Software Learning Centre # http://fosslc.org # # 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 distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # For support, questions, suggestions or any other inquiries, visit: # http://wiki.github.com/Freeseer/freeseer/ import ctypes import os import shutil import sys import unicodedata def format_size(num): for x in ['bytes', 'KB', 'MB', 'GB', 'TB']: if num < 1024.0: return "%3.1f %s" % (num, x) num /= 1024.0 def get_free_space(directory): """ Return directory free space (in human readable form) """ if sys.platform in ["win32", "cygwin"]: free_bytes = ctypes.c_ulonglong(0) ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(directory), None, None, ctypes.pointer(free_bytes)) space = free_bytes.value else: space = os.statvfs(directory).f_bfree * os.statvfs(directory).f_frsize return format_size(space) ### ### Filename related functions ### def get_record_name(extension, presentation=None, filename=None, path="."): """Returns the filename to use when recording. If a record name with a .None extension is returned, the record name will just be ignored by the output plugin (e.g. Video Preview plugin). Function will return None if neither presentation nor filename is passed. """ if presentation is not None: recordname = make_record_name(presentation) elif filename is not None: recordname = filename else: return None count = 0 tempname = recordname # Add a number to the end of a duplicate record name so we don't # overwrite existing files while(os.path.exists(os.path.join(path, "%s.%s" % (tempname, extension)))): tempname = "{0}-{1}".format(recordname, count) count += 1 recordname = "%s.%s" % (tempname, extension) return recordname def make_record_name(presentation): """Create an 'EVENT-ROOM-SPEAKER-TITLE' record name using presentation metadata.""" tags = [ make_shortname(presentation.event), make_shortname(presentation.room), make_shortname(presentation.speaker), make_shortname(presentation.title), ] record_name = unicode('-'.join(tag for tag in tags if tag)) # Convert unicode filenames to their equivalent ascii so that # we don't run into issues with gstreamer or filesystems. safe_record_name = unicodedata.normalize('NFKD', record_name).encode('ascii', 'ignore') return safe_record_name or 'default' def make_shortname(string): """Returns the first 6 characters of a string in uppercase. Strip out non alpha-numeric characters, spaces, and most punctuation. """ bad_chars = set("!@#$%^&*()+=|:;{}[]',? <>~`/\\") string = "".join(ch for ch in string if ch not in bad_chars) return string[0:6].upper() ### ### Handy functions for reseting Freeseer configuration ### def reset(configdir): """Deletes the Freeseer configuration directory""" if validate_configdir(configdir): print('This will wipe out your freeseer configuration directory.') if confirm_yes() is True: shutil.rmtree(configdir) else: print("%s is not a invalid configuration directory." % configdir) def reset_configuration(configdir, profile='default'): """Deletes the Freeseer configuration files freeseer.conf and plugin.conf""" if profile is None: profile = 'default' if validate_configdir(configdir): freeseer_conf = os.path.join(configdir, 'profiles', profile, 'freeseer.conf') plugin_conf = os.path.join(configdir, 'profiles', profile, 'plugin.conf') if os.path.exists(freeseer_conf): os.remove(freeseer_conf) if os.path.exists(plugin_conf): os.remove(plugin_conf) else: print("%s is not a invalid configuration directory." % configdir) def reset_database(configdir, profile='default'): """Deletes the Freeseer database file""" if profile is None: profile = 'default' if validate_configdir(configdir): dbfile = os.path.join(configdir, 'profiles', profile, 'presentations.db') if os.path.exists(dbfile): os.remove(dbfile) else: print("%s is not a invalid configuration directory." % configdir) def validate_configdir(configdir): """Validate that the configdir is not one of the blacklisted directories""" if (configdir and configdir != '/' and configdir != '~' and configdir != os.path.abspath(os.path.expanduser('~'))): return True return False def confirm_yes(): """Prompts the user to confirm by typing 'yes' in response""" confirm = raw_input("Enter 'yes' to confirm: ") if confirm == 'yes': return True return False
gpl-3.0
acsone/odoo
addons/stock/report/report_stock.py
376
2486
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero 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 distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## from openerp.osv import fields, osv from openerp.tools.sql import drop_view_if_exists class report_stock_lines_date(osv.osv): _name = "report.stock.lines.date" _description = "Dates of Inventories and latest Moves" _auto = False _order = "date" _columns = { 'id': fields.integer('Product Id', readonly=True), 'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True), 'date': fields.datetime('Date of latest Inventory', readonly=True), 'move_date': fields.datetime('Date of latest Stock Move', readonly=True), "active": fields.boolean("Active", readonly=True), } def init(self, cr): drop_view_if_exists(cr, 'report_stock_lines_date') cr.execute(""" create or replace view report_stock_lines_date as ( select p.id as id, p.id as product_id, max(s.date) as date, max(m.date) as move_date, p.active as active from product_product p left join ( stock_inventory_line l inner join stock_inventory s on (l.inventory_id=s.id and s.state = 'done') ) on (p.id=l.product_id) left join stock_move m on (m.product_id=p.id and m.state = 'done') group by p.id )""") # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
agpl-3.0
kennho/oppia
core/domain/collection_services.py
1
46617
# coding: utf-8 # # Copyright 2015 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS-IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Commands that can be used to operate on collections. All functions here should be agnostic of how CollectionModel objects are stored in the database. In particular, the various query methods should delegate to the Collection model class. This will enable the collection storage model to be changed without affecting this module and others above it. """ import collections import copy import datetime import logging import os from core.domain import collection_domain from core.domain import exp_services from core.domain import rights_manager from core.domain import summary_services from core.domain import user_services from core.platform import models import feconf import utils (collection_models, user_models) = models.Registry.import_models([ models.NAMES.collection, models.NAMES.user]) memcache_services = models.Registry.import_memcache_services() search_services = models.Registry.import_search_services() # This takes additional 'title' and 'category' parameters. CMD_CREATE_NEW = 'create_new' # Name for the collection search index. SEARCH_INDEX_COLLECTIONS = 'collections' # The maximum number of iterations allowed for populating the results of a # search query. MAX_ITERATIONS = 10 # TODO(bhenning): Improve the ranking calculation. Some possible suggestions # for a better ranking include using an average of the search ranks of each # exploration referenced in the collection and/or demoting collections # for any validation errors from explorations referenced in the collection. _STATUS_PUBLICIZED_BONUS = 30 # This is done to prevent the rank hitting 0 too easily. Note that # negative ranks are disallowed in the Search API. _DEFAULT_RANK = 20 _MS_IN_ONE_DAY = 24 * 60 * 60 * 1000 def _migrate_collection_to_latest_schema(versioned_collection): """Holds the responsibility of performing a step-by-step, sequential update of the collection structure based on the schema version of the input collection dictionary. This is very similar to the exploration migration process seen in exp_services. If any of the current collection schemas change, a new conversion function must be added and some code appended to this function to account for that new version. Args: versioned_collection: A dict with two keys: - schema_version: the schema version for the collection. - nodes: the list of collection nodes comprising the collection. """ collection_schema_version = versioned_collection['schema_version'] if not (1 <= collection_schema_version <= feconf.CURRENT_COLLECTION_SCHEMA_VERSION): raise Exception( 'Sorry, we can only process v1-v%d collection schemas at ' 'present.' % feconf.CURRENT_COLLECTION_SCHEMA_VERSION) # This is where conversion functions will be placed once updates to the # collection schemas happen. # TODO(sll): Ensure that there is a test similar to # exp_domain_test.SchemaMigrationMethodsUnitTests to ensure that the # appropriate migration functions are declared. # Repository GET methods. def _get_collection_memcache_key(collection_id, version=None): """Returns a memcache key for an collection.""" if version: return 'collection-version:%s:%s' % (collection_id, version) else: return 'collection:%s' % collection_id def get_collection_from_model(collection_model, run_conversion=True): """Returns a Collection domain object given a collection model loaded from the datastore. If run_conversion is True, then the collection's schema version will be checked against the current schema version. If they do not match, the collection will be automatically updated to the latest schema version. IMPORTANT NOTE TO DEVELOPERS: In general, run_conversion should never be False. This option is only used for testing that the schema version migration works correctly, and it should never be changed otherwise. """ # Ensure the original collection model does not get altered. versioned_collection = { 'schema_version': collection_model.schema_version, 'nodes': copy.deepcopy(collection_model.nodes) } # Migrate the collection if it is not using the latest schema version. if (run_conversion and collection_model.schema_version != feconf.CURRENT_COLLECTION_SCHEMA_VERSION): _migrate_collection_to_latest_schema(versioned_collection) return collection_domain.Collection( collection_model.id, collection_model.title, collection_model.category, collection_model.objective, versioned_collection['schema_version'], [ collection_domain.CollectionNode.from_dict(collection_node_dict) for collection_node_dict in versioned_collection['nodes'] ], collection_model.version, collection_model.created_on, collection_model.last_updated) def get_collection_summary_from_model(collection_summary_model): return collection_domain.CollectionSummary( collection_summary_model.id, collection_summary_model.title, collection_summary_model.category, collection_summary_model.objective, collection_summary_model.status, collection_summary_model.community_owned, collection_summary_model.owner_ids, collection_summary_model.editor_ids, collection_summary_model.viewer_ids, collection_summary_model.contributor_ids, collection_summary_model.contributors_summary, collection_summary_model.version, collection_summary_model.collection_model_created_on, collection_summary_model.collection_model_last_updated ) def get_collection_by_id(collection_id, strict=True, version=None): """Returns a domain object representing a collection.""" collection_memcache_key = _get_collection_memcache_key( collection_id, version=version) memcached_collection = memcache_services.get_multi( [collection_memcache_key]).get(collection_memcache_key) if memcached_collection is not None: return memcached_collection else: collection_model = collection_models.CollectionModel.get( collection_id, strict=strict, version=version) if collection_model: collection = get_collection_from_model(collection_model) memcache_services.set_multi({collection_memcache_key: collection}) return collection else: return None def get_collection_summary_by_id(collection_id): """Returns a domain object representing a collection summary.""" # TODO(msl): Maybe use memcache similarly to get_collection_by_id. collection_summary_model = collection_models.CollectionSummaryModel.get( collection_id) if collection_summary_model: collection_summary = get_collection_summary_from_model( collection_summary_model) return collection_summary else: return None def get_multiple_collections_by_id(collection_ids, strict=True): """Returns a dict of domain objects representing collections with the given ids as keys. If a collection_id is not present it is not included in the return dict. """ collection_ids = set(collection_ids) result = {} uncached = [] memcache_keys = [_get_collection_memcache_key(i) for i in collection_ids] cache_result = memcache_services.get_multi(memcache_keys) for collection_obj in cache_result.itervalues(): result[collection_obj.id] = collection_obj for _id in collection_ids: if _id not in result: uncached.append(_id) db_collection_models = collection_models.CollectionModel.get_multi( uncached) db_results_dict = {} not_found = [] for index, cid in enumerate(uncached): model = db_collection_models[index] if model: collection = get_collection_from_model(model) db_results_dict[cid] = collection else: logging.info('Tried to fetch collection with id %s, but no such ' 'collection exists in the datastore' % cid) not_found.append(cid) if strict and not_found: raise ValueError( 'Couldn\'t find collections with the following ids:\n%s' % '\n'.join(not_found)) cache_update = { cid: db_results_dict[cid] for cid in db_results_dict.iterkeys() if db_results_dict[cid] is not None } if cache_update: memcache_services.set_multi(cache_update) result.update(db_results_dict) return result def get_new_collection_id(): """Returns a new collection id.""" return collection_models.CollectionModel.get_new_id('') def is_collection_summary_editable(collection_summary, user_id=None): """Checks if a given user may edit an collection by checking the given domain object. """ return user_id is not None and ( user_id in collection_summary.editor_ids or user_id in collection_summary.owner_ids or collection_summary.community_owned) def get_learner_collection_dict_by_id( collection_id, user_id, strict=True, allow_invalid_explorations=False, version=None): """Creates and returns a dictionary representation of a collection given by the provided collection ID. This dictionary contains extra information along with the dict returned by collection_domain.Collection.to_dict() which includes useful data for the collection learner view. The information includes progress in the collection, information about explorations referenced within the collection, and a slightly nicer data structure for frontend work. This raises a ValidationError if the collection retrieved using the given ID references non-existent explorations. """ collection = get_collection_by_id( collection_id, strict=strict, version=version) exp_ids = collection.exploration_ids exp_summary_dicts = ( summary_services.get_displayable_exp_summary_dicts_matching_ids( exp_ids, editor_user_id=user_id)) exp_summaries_dict_map = { exp_summary_dict['id']: exp_summary_dict for exp_summary_dict in exp_summary_dicts } # TODO(bhenning): Users should not be recommended explorations they have # completed outside the context of a collection (see #1461). next_exploration_ids = None completed_exploration_ids = None if user_id: completed_exploration_ids = _get_valid_completed_exploration_ids( user_id, collection_id, collection) next_exploration_ids = collection.get_next_exploration_ids( completed_exploration_ids) else: # If the user is not logged in or they have not completed any of # the explorations yet within the context of this collection, # recommend the initial explorations. next_exploration_ids = collection.init_exploration_ids completed_exploration_ids = [] collection_dict = collection.to_dict() collection_dict['skills'] = collection.skills collection_dict['playthrough_dict'] = { 'next_exploration_ids': next_exploration_ids, 'completed_exploration_ids': completed_exploration_ids } collection_dict['version'] = collection.version collection_is_public = rights_manager.is_collection_public(collection_id) # Insert an 'exploration' dict into each collection node, where the # dict includes meta information about the exploration (ID and title). for collection_node in collection_dict['nodes']: exploration_id = collection_node['exploration_id'] summary_dict = exp_summaries_dict_map.get(exploration_id) if not allow_invalid_explorations: if not summary_dict: raise utils.ValidationError( 'Expected collection to only reference valid ' 'explorations, but found an exploration with ID: %s (was ' 'the exploration deleted or is it a private exploration ' 'that you do not have edit access to?)' % exploration_id) if collection_is_public and rights_manager.is_exploration_private( exploration_id): raise utils.ValidationError( 'Cannot reference a private exploration within a public ' 'collection, exploration ID: %s' % exploration_id) if summary_dict: collection_node['exploration_summary'] = summary_dict else: collection_node['exploration_summary'] = None return collection_dict # Query methods. def get_collection_titles_and_categories(collection_ids): """Returns collection titles and categories for the given ids. The result is a dict with collection ids as keys. The corresponding values are dicts with the keys 'title' and 'category'. Any invalid collection_ids will not be included in the return dict. No error will be raised. """ collection_list = [ (get_collection_from_model(e) if e else None) for e in collection_models.CollectionModel.get_multi(collection_ids)] result = {} for collection in collection_list: if collection is None: logging.error('Could not find collection corresponding to id') else: result[collection.id] = { 'title': collection.title, 'category': collection.category, } return result def get_completed_exploration_ids(user_id, collection_id): """Returns a list of explorations the user has completed within the context of the provided collection. Returns an empty list if the user has not yet completed any explorations within the collection. Note that this function will also return an empty list if either the collection and/or user do not exist. A progress model isn't added until the first exploration of a collection is completed, so, if a model is missing, there isn't enough information to infer whether that means the collection doesn't exist, the user doesn't exist, or if they just haven't mdae any progress in that collection yet. Thus, we just assume the user and collection exist for the sake of this call, so it returns an empty list, indicating that no progress has yet been made. """ progress_model = user_models.CollectionProgressModel.get( user_id, collection_id) return progress_model.completed_explorations if progress_model else [] def _get_valid_completed_exploration_ids(user_id, collection_id, collection): """Returns a filtered version of the return value of get_completed_exploration_ids, where explorations not also found within the collection are removed from the returned list. """ completed_exploration_ids = get_completed_exploration_ids( user_id, collection_id) return [ exp_id for exp_id in completed_exploration_ids if collection.get_node(exp_id) ] def get_next_exploration_ids_to_complete_by_user(user_id, collection_id): """Returns a list of exploration IDs in the specified collection that the given user has not yet attempted and has the prerequisite skills to play. Returns the collection's initial explorations if the user has yet to complete any explorations within the collection. Returns an empty list if the user has completed all of the explorations within the collection. See collection_domain.Collection.get_next_exploration_ids for more information. """ completed_exploration_ids = get_completed_exploration_ids( user_id, collection_id) collection = get_collection_by_id(collection_id) if completed_exploration_ids: return collection.get_next_exploration_ids(completed_exploration_ids) else: # The user has yet to complete any explorations inside the collection. return collection.init_exploration_ids def record_played_exploration_in_collection_context( user_id, collection_id, exploration_id): progress_model = user_models.CollectionProgressModel.get_or_create( user_id, collection_id) if exploration_id not in progress_model.completed_explorations: progress_model.completed_explorations.append(exploration_id) progress_model.put() def _get_collection_summary_dicts_from_models(collection_summary_models): """Given an iterable of CollectionSummaryModel instances, create a dict containing corresponding collection summary domain objects, keyed by id. """ collection_summaries = [ get_collection_summary_from_model(collection_summary_model) for collection_summary_model in collection_summary_models] result = {} for collection_summary in collection_summaries: result[collection_summary.id] = collection_summary return result def get_collection_summaries_matching_ids(collection_ids): """Given a list of collection ids, return a list with the corresponding summary domain objects (or None if the corresponding summary does not exist). """ return [ (get_collection_summary_from_model(model) if model else None) for model in collection_models.CollectionSummaryModel.get_multi( collection_ids)] # TODO(bhenning): Update this function to support also matching the query to # explorations contained within this collection. Introduce tests to verify this # behavior. def get_collection_summaries_matching_query(query_string, cursor=None): """Returns a list with all collection summary domain objects matching the given search query string, as well as a search cursor for future fetches. This method returns exactly feconf.GALLERY_PAGE_SIZE results if there are at least that many, otherwise it returns all remaining results. (If this behaviour does not occur, an error will be logged.) The method also returns a search cursor. """ summary_models = [] search_cursor = cursor for _ in range(MAX_ITERATIONS): remaining_to_fetch = feconf.GALLERY_PAGE_SIZE - len(summary_models) collection_ids, search_cursor = search_collections( query_string, remaining_to_fetch, cursor=search_cursor) invalid_collection_ids = [] for ind, model in enumerate( collection_models.CollectionSummaryModel.get_multi( collection_ids)): if model is not None: summary_models.append(model) else: invalid_collection_ids.append(collection_ids[ind]) if len(summary_models) == feconf.GALLERY_PAGE_SIZE or ( search_cursor is None): break else: logging.error( 'Search index contains stale collection ids: %s' % ', '.join(invalid_collection_ids)) if (len(summary_models) < feconf.GALLERY_PAGE_SIZE and search_cursor is not None): logging.error( 'Could not fulfill search request for query string %s; at least ' '%s retries were needed.' % (query_string, MAX_ITERATIONS)) return ([ get_collection_summary_from_model(summary_model) for summary_model in summary_models ], search_cursor) # Repository SAVE and DELETE methods. def apply_change_list(collection_id, change_list): """Applies a changelist to a pristine collection and returns the result. Each entry in change_list is a dict that represents an CollectionChange object. Returns: the resulting collection domain object. """ collection = get_collection_by_id(collection_id) try: changes = [collection_domain.CollectionChange(change_dict) for change_dict in change_list] for change in changes: if change.cmd == collection_domain.CMD_ADD_COLLECTION_NODE: collection.add_node(change.exploration_id) elif change.cmd == collection_domain.CMD_DELETE_COLLECTION_NODE: collection.delete_node(change.exploration_id) elif ( change.cmd == collection_domain.CMD_EDIT_COLLECTION_NODE_PROPERTY): collection_node = collection.get_node(change.exploration_id) if (change.property_name == collection_domain.COLLECTION_NODE_PROPERTY_PREREQUISITE_SKILLS): # pylint: disable=line-too-long collection_node.update_prerequisite_skills( change.new_value) elif (change.property_name == collection_domain.COLLECTION_NODE_PROPERTY_ACQUIRED_SKILLS): # pylint: disable=line-too-long collection_node.update_acquired_skills(change.new_value) elif change.cmd == collection_domain.CMD_EDIT_COLLECTION_PROPERTY: if (change.property_name == collection_domain.COLLECTION_PROPERTY_TITLE): collection.update_title(change.new_value) elif (change.property_name == collection_domain.COLLECTION_PROPERTY_CATEGORY): collection.update_category(change.new_value) elif (change.property_name == collection_domain.COLLECTION_PROPERTY_OBJECTIVE): collection.update_objective(change.new_value) elif ( change.cmd == collection_domain.CMD_MIGRATE_SCHEMA_TO_LATEST_VERSION): # Loading the collection model from the datastore into an # Collection domain object automatically converts it to use the # latest schema version. As a result, simply resaving the # collection is sufficient to apply the schema migration. continue return collection except Exception as e: logging.error( '%s %s %s %s' % ( e.__class__.__name__, e, collection_id, change_list) ) raise def validate_exps_in_collection_are_public(collection): for exploration_id in collection.exploration_ids: if rights_manager.is_exploration_private(exploration_id): raise utils.ValidationError( 'Cannot reference a private exploration within a public ' 'collection, exploration ID: %s' % exploration_id) def _save_collection(committer_id, collection, commit_message, change_list): """Validates an collection and commits it to persistent storage. If successful, increments the version number of the incoming collection domain object by 1. """ if not change_list: raise Exception( 'Unexpected error: received an invalid change list when trying to ' 'save collection %s: %s' % (collection.id, change_list)) collection_rights = rights_manager.get_collection_rights(collection.id) if collection_rights.status != rights_manager.ACTIVITY_STATUS_PRIVATE: collection.validate(strict=True) else: collection.validate(strict=False) # Validate that all explorations referenced by the collection exist. exp_ids = collection.exploration_ids exp_summaries = ( exp_services.get_exploration_summaries_matching_ids(exp_ids)) exp_summaries_dict = { exp_id: exp_summaries[ind] for (ind, exp_id) in enumerate(exp_ids) } for collection_node in collection.nodes: if not exp_summaries_dict[collection_node.exploration_id]: raise utils.ValidationError( 'Expected collection to only reference valid explorations, ' 'but found an exploration with ID: %s (was it deleted?)' % collection_node.exploration_id) # Ensure no explorations are being added that are 'below' the public status # of this collection. If the collection is private, it can have both # private and public explorations. If it's public, it can only have public # explorations. # TODO(bhenning): Ensure the latter is enforced above when trying to # publish a collection. if rights_manager.is_collection_public(collection.id): validate_exps_in_collection_are_public(collection) collection_model = collection_models.CollectionModel.get( collection.id, strict=False) if collection_model is None: collection_model = collection_models.CollectionModel(id=collection.id) else: if collection.version > collection_model.version: raise Exception( 'Unexpected error: trying to update version %s of collection ' 'from version %s. Please reload the page and try again.' % (collection_model.version, collection.version)) elif collection.version < collection_model.version: raise Exception( 'Trying to update version %s of collection from version %s, ' 'which is too old. Please reload the page and try again.' % (collection_model.version, collection.version)) collection_model.category = collection.category collection_model.title = collection.title collection_model.objective = collection.objective collection_model.schema_version = collection.schema_version collection_model.nodes = [ collection_node.to_dict() for collection_node in collection.nodes ] collection_model.commit(committer_id, commit_message, change_list) memcache_services.delete(_get_collection_memcache_key(collection.id)) index_collections_given_ids([collection.id]) collection.version += 1 def _create_collection(committer_id, collection, commit_message, commit_cmds): """Ensures that rights for a new collection are saved first. This is because _save_collection() depends on the rights object being present to tell it whether to do strict validation or not. """ # This line is needed because otherwise a rights object will be created, # but the creation of an collection object will fail. collection.validate(strict=False) rights_manager.create_new_collection_rights(collection.id, committer_id) model = collection_models.CollectionModel( id=collection.id, category=collection.category, title=collection.title, objective=collection.objective, schema_version=collection.schema_version, nodes=[ collection_node.to_dict() for collection_node in collection.nodes ], ) model.commit(committer_id, commit_message, commit_cmds) collection.version += 1 create_collection_summary(collection.id, committer_id) def save_new_collection(committer_id, collection): commit_message = ( 'New collection created with title \'%s\'.' % collection.title) _create_collection(committer_id, collection, commit_message, [{ 'cmd': CMD_CREATE_NEW, 'title': collection.title, 'category': collection.category, }]) def delete_collection(committer_id, collection_id, force_deletion=False): """Deletes the collection with the given collection_id. IMPORTANT: Callers of this function should ensure that committer_id has permissions to delete this collection, prior to calling this function. If force_deletion is True the collection and its history are fully deleted and are unrecoverable. Otherwise, the collection and all its history are marked as deleted, but the corresponding models are still retained in the datastore. This last option is the preferred one. """ collection_rights_model = collection_models.CollectionRightsModel.get( collection_id) collection_rights_model.delete( committer_id, '', force_deletion=force_deletion) collection_model = collection_models.CollectionModel.get(collection_id) collection_model.delete( committer_id, feconf.COMMIT_MESSAGE_COLLECTION_DELETED, force_deletion=force_deletion) # This must come after the collection is retrieved. Otherwise the memcache # key will be reinstated. collection_memcache_key = _get_collection_memcache_key(collection_id) memcache_services.delete(collection_memcache_key) # Delete the collection from search. delete_documents_from_search_index([collection_id]) # Delete the summary of the collection (regardless of whether # force_deletion is True or not). delete_collection_summary(collection_id) def get_collection_snapshots_metadata(collection_id): """Returns the snapshots for this collection, as dicts. Args: collection_id: str. The id of the collection in question. Returns: list of dicts, each representing a recent snapshot. Each dict has the following keys: committer_id, commit_message, commit_cmds, commit_type, created_on_ms, version_number. The version numbers are consecutive and in ascending order. There are collection.version_number items in the returned list. """ collection = get_collection_by_id(collection_id) current_version = collection.version version_nums = range(1, current_version + 1) return collection_models.CollectionModel.get_snapshots_metadata( collection_id, version_nums) def publish_collection_and_update_user_profiles(committer_id, col_id): """Publishes the collection with publish_collection() function in rights_manager.py, as well as updates first_contribution_msec. It is the responsibility of the caller to check that the collection is valid prior to publication. """ rights_manager.publish_collection(committer_id, col_id) contribution_time_msec = utils.get_current_time_in_millisecs() collection_summary = get_collection_summary_by_id(col_id) contributor_ids = collection_summary.contributor_ids for contributor in contributor_ids: user_services.update_first_contribution_msec_if_not_set( contributor, contribution_time_msec) def update_collection( committer_id, collection_id, change_list, commit_message): """Update an collection. Commits changes. Args: - committer_id: str. The id of the user who is performing the update action. - collection_id: str. The collection id. - change_list: list of dicts, each representing a CollectionChange object. These changes are applied in sequence to produce the resulting collection. - commit_message: str or None. A description of changes made to the collection. For published collections, this must be present; for unpublished collections, it may be equal to None. """ is_public = rights_manager.is_collection_public(collection_id) if is_public and not commit_message: raise ValueError( 'Collection is public so expected a commit message but ' 'received none.') collection = apply_change_list(collection_id, change_list) _save_collection(committer_id, collection, commit_message, change_list) update_collection_summary(collection.id, committer_id) if not rights_manager.is_collection_private(collection.id): user_services.update_first_contribution_msec_if_not_set( committer_id, utils.get_current_time_in_millisecs()) def create_collection_summary(collection_id, contributor_id_to_add): """Create summary of a collection and store in datastore.""" collection = get_collection_by_id(collection_id) collection_summary = compute_summary_of_collection( collection, contributor_id_to_add) save_collection_summary(collection_summary) def update_collection_summary(collection_id, contributor_id_to_add): """Update the summary of an collection.""" create_collection_summary(collection_id, contributor_id_to_add) def compute_summary_of_collection(collection, contributor_id_to_add): """Create a CollectionSummary domain object for a given Collection domain object and return it. """ collection_rights = collection_models.CollectionRightsModel.get_by_id( collection.id) collection_summary_model = ( collection_models.CollectionSummaryModel.get_by_id(collection.id)) # Update the contributor id list if necessary (contributors # defined as humans who have made a positive (i.e. not just # a revert) change to an collection's content). if collection_summary_model: contributor_ids = collection_summary_model.contributor_ids contributors_summary = collection_summary_model.contributors_summary else: contributor_ids = [] contributors_summary = {} if (contributor_id_to_add is not None and contributor_id_to_add not in feconf.SYSTEM_USER_IDS and contributor_id_to_add not in contributor_ids): contributor_ids.append(contributor_id_to_add) if contributor_id_to_add not in feconf.SYSTEM_USER_IDS: if contributor_id_to_add is None: # Revert commit or other non-positive commit contributors_summary = compute_collection_contributors_summary( collection.id) else: if contributor_id_to_add in contributors_summary: contributors_summary[contributor_id_to_add] += 1 else: contributors_summary[contributor_id_to_add] = 1 collection_model_last_updated = collection.last_updated collection_model_created_on = collection.created_on collection_summary = collection_domain.CollectionSummary( collection.id, collection.title, collection.category, collection.objective, collection_rights.status, collection_rights.community_owned, collection_rights.owner_ids, collection_rights.editor_ids, collection_rights.viewer_ids, contributor_ids, contributors_summary, collection.version, collection_model_created_on, collection_model_last_updated ) return collection_summary def compute_collection_contributors_summary(collection_id): """Returns a dict whose keys are user_ids and whose values are the number of (non-revert) commits made to the given collection by that user_id. This does not count commits which have since been reverted. """ snapshots_metadata = get_collection_snapshots_metadata(collection_id) current_version = len(snapshots_metadata) contributors_summary = collections.defaultdict(int) while True: snapshot_metadata = snapshots_metadata[current_version - 1] committer_id = snapshot_metadata['committer_id'] is_revert = (snapshot_metadata['commit_type'] == 'revert') if not is_revert and committer_id not in feconf.SYSTEM_USER_IDS: contributors_summary[committer_id] += 1 if current_version == 1: break if is_revert: current_version = snapshot_metadata['commit_cmds'][0][ 'version_number'] else: current_version -= 1 return contributors_summary def save_collection_summary(collection_summary): """Save a collection summary domain object as a CollectionSummaryModel entity in the datastore. """ collection_summary_model = collection_models.CollectionSummaryModel( id=collection_summary.id, title=collection_summary.title, category=collection_summary.category, objective=collection_summary.objective, status=collection_summary.status, community_owned=collection_summary.community_owned, owner_ids=collection_summary.owner_ids, editor_ids=collection_summary.editor_ids, viewer_ids=collection_summary.viewer_ids, contributor_ids=collection_summary.contributor_ids, contributors_summary=collection_summary.contributors_summary, version=collection_summary.version, collection_model_last_updated=( collection_summary.collection_model_last_updated), collection_model_created_on=( collection_summary.collection_model_created_on) ) collection_summary_model.put() def delete_collection_summary(collection_id): """Delete a collection summary model.""" collection_models.CollectionSummaryModel.get(collection_id).delete() def save_new_collection_from_yaml(committer_id, yaml_content, collection_id): collection = collection_domain.Collection.from_yaml( collection_id, yaml_content) commit_message = ( 'New collection created from YAML file with title \'%s\'.' % collection.title) _create_collection(committer_id, collection, commit_message, [{ 'cmd': CMD_CREATE_NEW, 'title': collection.title, 'category': collection.category, }]) return collection def delete_demo(collection_id): """Deletes a single demo collection.""" if not collection_domain.Collection.is_demo_collection_id(collection_id): raise Exception('Invalid demo collection id %s' % collection_id) collection = get_collection_by_id(collection_id, strict=False) if not collection: logging.info('Collection with id %s was not deleted, because it ' 'does not exist.' % collection_id) else: delete_collection( feconf.SYSTEM_COMMITTER_ID, collection_id, force_deletion=True) def load_demo(collection_id): """Loads a demo collection. The resulting collection will have version 2 (one for its initial creation and one for its subsequent modification.) """ delete_demo(collection_id) if not collection_domain.Collection.is_demo_collection_id(collection_id): raise Exception('Invalid demo collection id %s' % collection_id) demo_filepath = os.path.join( feconf.SAMPLE_COLLECTIONS_DIR, feconf.DEMO_COLLECTIONS[collection_id]) if demo_filepath.endswith('yaml'): yaml_content = utils.get_file_contents(demo_filepath) else: raise Exception('Unrecognized file path: %s' % demo_filepath) collection = save_new_collection_from_yaml( feconf.SYSTEM_COMMITTER_ID, yaml_content, collection_id) publish_collection_and_update_user_profiles( feconf.SYSTEM_COMMITTER_ID, collection_id) index_collections_given_ids([collection_id]) # Now, load all of the demo explorations that are part of the collection. for collection_node in collection.nodes: exp_id = collection_node.exploration_id # Only load the demo exploration if it is not yet loaded. if exp_services.get_exploration_by_id(exp_id, strict=False) is None: exp_services.load_demo(exp_id) logging.info('Collection with id %s was loaded.' % collection_id) # TODO(bhenning): Cleanup search logic and abstract it between explorations and # collections to avoid code duplication. def get_next_page_of_all_commits( page_size=feconf.COMMIT_LIST_PAGE_SIZE, urlsafe_start_cursor=None): """Returns a page of commits to all collections in reverse time order. The return value is a triple (results, cursor, more) as described in fetch_page() at: https://developers.google.com/appengine/docs/python/ndb/queryclass """ results, new_urlsafe_start_cursor, more = ( collection_models.CollectionCommitLogEntryModel.get_all_commits( page_size, urlsafe_start_cursor)) return ([collection_domain.CollectionCommitLogEntry( entry.created_on, entry.last_updated, entry.user_id, entry.username, entry.collection_id, entry.commit_type, entry.commit_message, entry.commit_cmds, entry.version, entry.post_commit_status, entry.post_commit_community_owned, entry.post_commit_is_private ) for entry in results], new_urlsafe_start_cursor, more) def get_next_page_of_all_non_private_commits( page_size=feconf.COMMIT_LIST_PAGE_SIZE, urlsafe_start_cursor=None, max_age=None): """Returns a page of non-private commits in reverse time order. If max_age is given, it should be a datetime.timedelta instance. The return value is a triple (results, cursor, more) as described in fetch_page() at: https://developers.google.com/appengine/docs/python/ndb/queryclass """ if max_age is not None and not isinstance(max_age, datetime.timedelta): raise ValueError( "max_age must be a datetime.timedelta instance. or None.") results, new_urlsafe_start_cursor, more = ( collection_models.CollectionCommitLogEntryModel.get_all_non_private_commits( # pylint: disable=line-too-long page_size, urlsafe_start_cursor, max_age=max_age)) return ([collection_domain.CollectionCommitLogEntry( entry.created_on, entry.last_updated, entry.user_id, entry.username, entry.collection_id, entry.commit_type, entry.commit_message, entry.commit_cmds, entry.version, entry.post_commit_status, entry.post_commit_community_owned, entry.post_commit_is_private ) for entry in results], new_urlsafe_start_cursor, more) def _collection_rights_to_search_dict(rights): # Allow searches like "is:featured". doc = {} if rights.status == rights_manager.ACTIVITY_STATUS_PUBLICIZED: doc['is'] = 'featured' return doc def _should_index(collection): rights = rights_manager.get_collection_rights(collection.id) return rights.status != rights_manager.ACTIVITY_STATUS_PRIVATE def _get_search_rank(collection_id): """Returns an integer determining the document's rank in search. Featured collections get a ranking bump, and so do collections that have been more recently updated. """ rights = rights_manager.get_collection_rights(collection_id) rank = _DEFAULT_RANK + ( _STATUS_PUBLICIZED_BONUS if rights.status == rights_manager.ACTIVITY_STATUS_PUBLICIZED else 0) # Iterate backwards through the collection history metadata until we find # the most recent snapshot that was committed by a human. last_human_update_ms = 0 snapshots_metadata = get_collection_snapshots_metadata(collection_id) for snapshot_metadata in reversed(snapshots_metadata): if snapshot_metadata['committer_id'] != feconf.MIGRATION_BOT_USER_ID: last_human_update_ms = snapshot_metadata['created_on_ms'] break _time_now_ms = utils.get_current_time_in_millisecs() time_delta_days = int( (_time_now_ms - last_human_update_ms) / _MS_IN_ONE_DAY) if time_delta_days == 0: rank += 80 elif time_delta_days == 1: rank += 50 elif 2 <= time_delta_days <= 7: rank += 35 # Ranks must be non-negative. return max(rank, 0) def _collection_to_search_dict(collection): rights = rights_manager.get_collection_rights(collection.id) doc = { 'id': collection.id, 'title': collection.title, 'category': collection.category, 'objective': collection.objective, 'rank': _get_search_rank(collection.id), } doc.update(_collection_rights_to_search_dict(rights)) return doc def clear_search_index(): """WARNING: This runs in-request, and may therefore fail if there are too many entries in the index. """ search_services.clear_index(SEARCH_INDEX_COLLECTIONS) def index_collections_given_ids(collection_ids): # We pass 'strict=False' so as not to index deleted collections. collection_list = get_multiple_collections_by_id( collection_ids, strict=False).values() search_services.add_documents_to_index([ _collection_to_search_dict(collection) for collection in collection_list if _should_index(collection) ], SEARCH_INDEX_COLLECTIONS) def patch_collection_search_document(collection_id, update): """Patches an collection's current search document, with the values from the 'update' dictionary. """ doc = search_services.get_document_from_index( collection_id, SEARCH_INDEX_COLLECTIONS) doc.update(update) search_services.add_documents_to_index([doc], SEARCH_INDEX_COLLECTIONS) def update_collection_status_in_search(collection_id): rights = rights_manager.get_collection_rights(collection_id) if rights.status == rights_manager.ACTIVITY_STATUS_PRIVATE: delete_documents_from_search_index([collection_id]) else: patch_collection_search_document( rights.id, _collection_rights_to_search_dict(rights)) def delete_documents_from_search_index(collection_ids): search_services.delete_documents_from_index( collection_ids, SEARCH_INDEX_COLLECTIONS) def search_collections(query, limit, sort=None, cursor=None): """Searches through the available collections. args: - query_string: the query string to search for. - sort: a string indicating how to sort results. This should be a string of space separated values. Each value should start with a '+' or a '-' character indicating whether to sort in ascending or descending order respectively. This character should be followed by a field name to sort on. When this is None, results are based on 'rank'. See _get_search_rank to see how rank is determined. - limit: the maximum number of results to return. - cursor: A cursor, used to get the next page of results. If there are more documents that match the query than 'limit', this function will return a cursor to get the next page. returns: a tuple: - a list of collection ids that match the query. - a cursor if there are more matching collections to fetch, None otherwise. If a cursor is returned, it will be a web-safe string that can be used in URLs. """ return search_services.search( query, SEARCH_INDEX_COLLECTIONS, cursor, limit, sort, ids_only=True)
apache-2.0
ClovisIRex/Snake-django
env/lib/python3.6/site-packages/pylint/checkers/typecheck.py
3
52807
# -*- coding: utf-8 -*- # Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2013-2014, 2016 Google, Inc. # Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2014 Holger Peters <email@holger-peters.de> # Copyright (c) 2014 David Shea <dshea@redhat.com> # Copyright (c) 2015 Radu Ciorba <radu@devrandom.ro> # Copyright (c) 2015 Rene Zhang <rz99@cornell.edu> # Copyright (c) 2015 Dmitry Pribysh <dmand@yandex.ru> # Copyright (c) 2016 Jakub Wilk <jwilk@jwilk.net> # Copyright (c) 2016 Jürgen Hermann <jh@web.de> # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """try to find more bugs in the code using astroid inference capabilities """ import collections import fnmatch import heapq import itertools import operator import re import shlex import sys import six import astroid import astroid.context import astroid.arguments import astroid.nodes from astroid import exceptions from astroid.interpreter import dunder_lookup from astroid import objects from astroid import bases from pylint.interfaces import IAstroidChecker, INFERENCE from pylint.checkers import BaseChecker from pylint.checkers.utils import ( is_super, check_messages, decorated_with_property, decorated_with, node_ignores_exception, is_iterable, is_mapping, supports_membership_test, is_comprehension, is_inside_abstract_class, supports_getitem, supports_setitem, supports_delitem, safe_infer, has_known_bases, is_builtin_object, singledispatch) BUILTINS = six.moves.builtins.__name__ STR_FORMAT = "%s.str.format" % BUILTINS def _unflatten(iterable): for index, elem in enumerate(iterable): if (isinstance(elem, collections.Sequence) and not isinstance(elem, six.string_types)): for single_elem in _unflatten(elem): yield single_elem elif elem and not index: # We're interested only in the first element. yield elem def _is_owner_ignored(owner, name, ignored_classes, ignored_modules): """Check if the given owner should be ignored This will verify if the owner's module is in *ignored_modules* or the owner's module fully qualified name is in *ignored_modules* or if the *ignored_modules* contains a pattern which catches the fully qualified name of the module. Also, similar checks are done for the owner itself, if its name matches any name from the *ignored_classes* or if its qualified name can be found in *ignored_classes*. """ ignored_modules = set(ignored_modules) module_name = owner.root().name module_qname = owner.root().qname() if any(module_name in ignored_modules or module_qname in ignored_modules or fnmatch.fnmatch(module_qname, ignore) for ignore in ignored_modules): return True ignored_classes = set(ignored_classes) if hasattr(owner, 'qname'): qname = owner.qname() else: qname = '' return any(name == ignore or qname == ignore for ignore in ignored_classes) @singledispatch def _node_names(node): # TODO: maybe we need an ABC for checking if an object is a scoped node # or not? if not hasattr(node, 'locals'): return [] return node.locals.keys() @_node_names.register(astroid.ClassDef) @_node_names.register(astroid.Instance) def _(node): values = itertools.chain(node.instance_attrs.keys(), node.locals.keys()) try: mro = node.mro()[1:] except (NotImplementedError, TypeError): mro = node.ancestors() other_values = [value for cls in mro for value in _node_names(cls)] return itertools.chain(values, other_values) def _string_distance(seq1, seq2): seq2_length = len(seq2) row = list(range(1, seq2_length + 1)) + [0] for seq1_index, seq1_char in enumerate(seq1): last_row = row row = [0] * seq2_length + [seq1_index + 1] for seq2_index, seq2_char in enumerate(seq2): row[seq2_index] = min( last_row[seq2_index] + 1, row[seq2_index - 1] + 1, last_row[seq2_index - 1] + (seq1_char != seq2_char) ) return row[seq2_length - 1] def _similar_names(owner, attrname, distance_threshold, max_choices): """Given an owner and a name, try to find similar names The similar names are searched given a distance metric and only a given number of choices will be returned. """ possible_names = [] names = _node_names(owner) for name in names: if name == attrname: continue distance = _string_distance(attrname, name) if distance <= distance_threshold: possible_names.append((name, distance)) # Now get back the values with a minimum, up to the given # limit or choices. picked = [name for (name, _) in heapq.nsmallest(max_choices, possible_names, key=operator.itemgetter(1))] return sorted(picked) def _missing_member_hint(owner, attrname, distance_threshold, max_choices): names = _similar_names(owner, attrname, distance_threshold, max_choices) if not names: # No similar name. return "" names = list(map(repr, names)) if len(names) == 1: names = ", ".join(names) else: names = "one of {} or {}".format(", ".join(names[:-1]), names[-1]) return "; maybe {}?".format(names) MSGS = { 'E1101': ('%s %r has no %r member%s', 'no-member', 'Used when a variable is accessed for an unexistent member.', {'old_names': [('E1103', 'maybe-no-member')]}), 'E1102': ('%s is not callable', 'not-callable', 'Used when an object being called has been inferred to a non \ callable object'), 'E1111': ('Assigning to function call which doesn\'t return', 'assignment-from-no-return', 'Used when an assignment is done on a function call but the \ inferred function doesn\'t return anything.'), 'E1120': ('No value for argument %s in %s call', 'no-value-for-parameter', 'Used when a function call passes too few arguments.'), 'E1121': ('Too many positional arguments for %s call', 'too-many-function-args', 'Used when a function call passes too many positional \ arguments.'), 'E1123': ('Unexpected keyword argument %r in %s call', 'unexpected-keyword-arg', 'Used when a function call passes a keyword argument that \ doesn\'t correspond to one of the function\'s parameter names.'), 'E1124': ('Argument %r passed by position and keyword in %s call', 'redundant-keyword-arg', 'Used when a function call would result in assigning multiple \ values to a function parameter, one value from a positional \ argument and one from a keyword argument.'), 'E1125': ('Missing mandatory keyword argument %r in %s call', 'missing-kwoa', ('Used when a function call does not pass a mandatory' ' keyword-only argument.'), {'minversion': (3, 0)}), 'E1126': ('Sequence index is not an int, slice, or instance with __index__', 'invalid-sequence-index', 'Used when a sequence type is indexed with an invalid type. ' 'Valid types are ints, slices, and objects with an __index__ ' 'method.'), 'E1127': ('Slice index is not an int, None, or instance with __index__', 'invalid-slice-index', 'Used when a slice index is not an integer, None, or an object \ with an __index__ method.'), 'E1128': ('Assigning to function call which only returns None', 'assignment-from-none', 'Used when an assignment is done on a function call but the ' 'inferred function returns nothing but None.', {'old_names': [('W1111', 'assignment-from-none')]}), 'E1129': ("Context manager '%s' doesn't implement __enter__ and __exit__.", 'not-context-manager', 'Used when an instance in a with statement doesn\'t implement ' 'the context manager protocol(__enter__/__exit__).'), 'E1130': ('%s', 'invalid-unary-operand-type', 'Emitted when a unary operand is used on an object which does not ' 'support this type of operation'), 'E1131': ('%s', 'unsupported-binary-operation', 'Emitted when a binary arithmetic operation between two ' 'operands is not supported.'), 'E1132': ('Got multiple values for keyword argument %r in function call', 'repeated-keyword', 'Emitted when a function call got multiple values for a keyword.'), 'E1135': ("Value '%s' doesn't support membership test", 'unsupported-membership-test', 'Emitted when an instance in membership test expression doesn\'t ' 'implement membership protocol (__contains__/__iter__/__getitem__)'), 'E1136': ("Value '%s' is unsubscriptable", 'unsubscriptable-object', "Emitted when a subscripted value doesn't support subscription" "(i.e. doesn't define __getitem__ method)"), 'E1137': ("%r does not support item assignment", 'unsupported-assignment-operation', "Emitted when an object does not support item assignment " "(i.e. doesn't define __setitem__ method)"), 'E1138': ("%r does not support item deletion", 'unsupported-delete-operation', "Emitted when an object does not support item deletion " "(i.e. doesn't define __delitem__ method)"), 'E1139': ('Invalid metaclass %r used', 'invalid-metaclass', 'Emitted whenever we can detect that a class is using, ' 'as a metaclass, something which might be invalid for using as ' 'a metaclass.'), } # builtin sequence types in Python 2 and 3. SEQUENCE_TYPES = set(['str', 'unicode', 'list', 'tuple', 'bytearray', 'xrange', 'range', 'bytes', 'memoryview']) def _emit_no_member(node, owner, owner_name, ignored_mixins): """Try to see if no-member should be emitted for the given owner. The following cases are ignored: * the owner is a function and it has decorators. * the owner is an instance and it has __getattr__, __getattribute__ implemented * the module is explicitly ignored from no-member checks * the owner is a class and the name can be found in its metaclass. * The access node is protected by an except handler, which handles AttributeError, Exception or bare except. """ if node_ignores_exception(node, AttributeError): return False # skip None anyway if isinstance(owner, astroid.Const) and owner.value is None: return False if is_super(owner) or getattr(owner, 'type', None) == 'metaclass': return False if ignored_mixins and owner_name[-5:].lower() == 'mixin': return False if isinstance(owner, astroid.FunctionDef) and owner.decorators: return False if isinstance(owner, (astroid.Instance, astroid.ClassDef)): if owner.has_dynamic_getattr() or not has_known_bases(owner): return False if isinstance(owner, objects.Super): # Verify if we are dealing with an invalid Super object. # If it is invalid, then there's no point in checking that # it has the required attribute. Also, don't fail if the # MRO is invalid. try: owner.super_mro() except (exceptions.MroError, exceptions.SuperError): return False if not all(map(has_known_bases, owner.type.mro())): return False return True def _determine_callable(callable_obj): # Ordering is important, since BoundMethod is a subclass of UnboundMethod, # and Function inherits Lambda. if isinstance(callable_obj, astroid.BoundMethod): # Bound methods have an extra implicit 'self' argument. return callable_obj, 1, callable_obj.type elif isinstance(callable_obj, astroid.UnboundMethod): return callable_obj, 0, 'unbound method' elif isinstance(callable_obj, astroid.FunctionDef): return callable_obj, 0, callable_obj.type elif isinstance(callable_obj, astroid.Lambda): return callable_obj, 0, 'lambda' elif isinstance(callable_obj, astroid.ClassDef): # Class instantiation, lookup __new__ instead. # If we only find object.__new__, we can safely check __init__ # instead. If __new__ belongs to builtins, then we look # again for __init__ in the locals, since we won't have # argument information for the builtin __new__ function. try: # Use the last definition of __new__. new = callable_obj.local_attr('__new__')[-1] except exceptions.NotFoundError: new = None from_object = new and new.parent.scope().name == 'object' from_builtins = new and new.root().name in sys.builtin_module_names if not new or from_object or from_builtins: try: # Use the last definition of __init__. callable_obj = callable_obj.local_attr('__init__')[-1] except exceptions.NotFoundError: # do nothing, covered by no-init. raise ValueError else: callable_obj = new if not isinstance(callable_obj, astroid.FunctionDef): raise ValueError # both have an extra implicit 'cls'/'self' argument. return callable_obj, 1, 'constructor' else: raise ValueError def _has_parent_of_type(node, node_type, statement): """Check if the given node has a parent of the given type.""" parent = node.parent while not isinstance(parent, node_type) and statement.parent_of(parent): parent = parent.parent return isinstance(parent, node_type) def _is_name_used_as_variadic(name, variadics): """Check if the given name is used as a variadic argument.""" return any(variadic.value == name or variadic.value.parent_of(name) for variadic in variadics) def _no_context_variadic_keywords(node): statement = node.statement() scope = node.scope() variadics = () if not isinstance(scope, astroid.FunctionDef): return False if isinstance(statement, astroid.Expr) and isinstance(statement.value, astroid.Call): call = statement.value variadics = call.keywords or () return _no_context_variadic(node, scope.args.kwarg, astroid.Keyword, variadics) def _no_context_variadic_positional(node): statement = node.statement() scope = node.scope() variadics = () if not isinstance(scope, astroid.FunctionDef): return False if isinstance(statement, astroid.Expr) and isinstance(statement.value, astroid.Call): call = statement.value variadics = call.starargs return _no_context_variadic(node, scope.args.vararg, astroid.Starred, variadics) def _no_context_variadic(node, variadic_name, variadic_type, variadics): """Verify if the given call node has variadic nodes without context This is a workaround for handling cases of nested call functions which don't have the specific call context at hand. Variadic arguments (variable positional arguments and variable keyword arguments) are inferred, inherently wrong, by astroid as a Tuple, respectively a Dict with empty elements. This can lead pylint to believe that a function call receives too few arguments. """ statement = node.statement() for name in statement.nodes_of_class(astroid.Name): if name.name != variadic_name: continue inferred = safe_infer(name) if isinstance(inferred, (astroid.List, astroid.Tuple)): length = len(inferred.elts) elif isinstance(inferred, astroid.Dict): length = len(inferred.items) else: continue inferred_statement = inferred.statement() if not length and isinstance(inferred_statement, astroid.FunctionDef): is_in_starred_context = _has_parent_of_type(node, variadic_type, statement) used_as_starred_argument = _is_name_used_as_variadic(name, variadics) if is_in_starred_context or used_as_starred_argument: return True return False def _is_invalid_metaclass(metaclass): try: mro = metaclass.mro() except NotImplementedError: # Cannot have a metaclass which is not a newstyle class. return True else: if not any(is_builtin_object(cls) and cls.name == 'type' for cls in mro): return True return False def _infer_from_metaclass_constructor(cls, func): """Try to infer what the given *func* constructor is building :param astroid.FunctionDef func: A metaclass constructor. Metaclass definitions can be functions, which should accept three arguments, the name of the class, the bases of the class and the attributes. The function could return anything, but usually it should be a proper metaclass. :param astroid.ClassDef cls: The class for which the *func* parameter should generate a metaclass. :returns: The class generated by the function or None, if we couldn't infer it. :rtype: astroid.ClassDef """ context = astroid.context.InferenceContext() class_bases = astroid.List() class_bases.postinit(elts=cls.bases) attrs = astroid.Dict() local_names = [(name, values[-1]) for name, values in cls.locals.items()] attrs.postinit(local_names) builder_args = astroid.Tuple() builder_args.postinit([cls.name, class_bases, attrs]) context.callcontext = astroid.context.CallContext(builder_args) try: inferred = next(func.infer_call_result(func, context), None) except astroid.InferenceError: return None return inferred or None class TypeChecker(BaseChecker): """try to find bugs in the code using type inference """ __implements__ = (IAstroidChecker,) # configuration section name name = 'typecheck' # messages msgs = MSGS priority = -1 # configuration options options = (('ignore-on-opaque-inference', {'default': True, 'type': 'yn', 'metavar': '<y_or_n>', 'help': 'This flag controls whether pylint should warn about ' 'no-member and similar checks whenever an opaque object ' 'is returned when inferring. The inference can return ' 'multiple potential results while evaluating a Python object, ' 'but some branches might not be evaluated, which results in ' 'partial inference. In that case, it might be useful to still emit ' 'no-member and other checks for the rest of the inferred objects.'} ), ('ignore-mixin-members', {'default' : True, 'type' : 'yn', 'metavar': '<y_or_n>', 'help' : 'Tells whether missing members accessed in mixin \ class should be ignored. A mixin class is detected if its name ends with \ "mixin" (case insensitive).'} ), ('ignored-modules', {'default': (), 'type': 'csv', 'metavar': '<module names>', 'help': 'List of module names for which member attributes ' 'should not be checked (useful for modules/projects ' 'where namespaces are manipulated during runtime and ' 'thus existing member attributes cannot be ' 'deduced by static analysis. It supports qualified ' 'module names, as well as Unix pattern matching.'} ), # the defaults here are *stdlib* names that (almost) always # lead to false positives, since their idiomatic use is # 'too dynamic' for pylint to grok. ('ignored-classes', {'default' : ('optparse.Values', 'thread._local', '_thread._local'), 'type' : 'csv', 'metavar' : '<members names>', 'help' : 'List of class names for which member attributes ' 'should not be checked (useful for classes with ' 'dynamically set attributes). This supports ' 'the use of qualified names.'} ), ('generated-members', {'default' : (), 'type' : 'string', 'metavar' : '<members names>', 'help' : 'List of members which are set dynamically and \ missed by pylint inference system, and so shouldn\'t trigger E1101 when \ accessed. Python regular expressions are accepted.'} ), ('contextmanager-decorators', {'default': ['contextlib.contextmanager'], 'type': 'csv', 'metavar': '<decorator names>', 'help': 'List of decorators that produce context managers, ' 'such as contextlib.contextmanager. Add to this list ' 'to register other decorators that produce valid ' 'context managers.'} ), ('missing-member-hint-distance', {'default': 1, 'type': 'int', 'metavar': '<member hint edit distance>', 'help': 'The minimum edit distance a name should have in order ' 'to be considered a similar match for a missing member name.' } ), ('missing-member-max-choices', {'default': 1, 'type': "int", 'metavar': '<member hint max choices>', 'help': 'The total number of similar names that should be taken in ' 'consideration when showing a hint for a missing member.' } ), ('missing-member-hint', {'default': True, 'type': "yn", 'metavar': '<missing member hint>', 'help': 'Show a hint with possible names when a member name was not ' 'found. The aspect of finding the hint is based on edit distance.' } ), ) def open(self): # do this in open since config not fully initialized in __init__ # generated_members may contain regular expressions # (surrounded by quote `"` and followed by a comma `,`) # REQUEST,aq_parent,"[a-zA-Z]+_set{1,2}"' => # ('REQUEST', 'aq_parent', '[a-zA-Z]+_set{1,2}') if isinstance(self.config.generated_members, six.string_types): gen = shlex.shlex(self.config.generated_members) gen.whitespace += ',' gen.wordchars += r'[]-+\.*?()|' self.config.generated_members = tuple(tok.strip('"') for tok in gen) @check_messages('invalid-metaclass') def visit_classdef(self, node): def _metaclass_name(metaclass): if isinstance(metaclass, (astroid.ClassDef, astroid.FunctionDef)): return metaclass.name return metaclass.as_string() metaclass = node.declared_metaclass() if not metaclass: return if isinstance(metaclass, astroid.FunctionDef): # Try to infer the result. metaclass = _infer_from_metaclass_constructor(node, metaclass) if not metaclass: # Don't do anything if we cannot infer the result. return if isinstance(metaclass, astroid.ClassDef): if _is_invalid_metaclass(metaclass): self.add_message('invalid-metaclass', node=node, args=(_metaclass_name(metaclass), )) else: self.add_message('invalid-metaclass', node=node, args=(_metaclass_name(metaclass), )) def visit_assignattr(self, node): if isinstance(node.assign_type(), astroid.AugAssign): self.visit_attribute(node) def visit_delattr(self, node): self.visit_attribute(node) @check_messages('no-member') def visit_attribute(self, node): """check that the accessed attribute exists to avoid too much false positives for now, we'll consider the code as correct if a single of the inferred nodes has the accessed attribute. function/method, super call and metaclasses are ignored """ for pattern in self.config.generated_members: # attribute is marked as generated, stop here if re.match(pattern, node.attrname): return if re.match(pattern, node.as_string()): return try: inferred = list(node.expr.infer()) except exceptions.InferenceError: return # list of (node, nodename) which are missing the attribute missingattr = set() non_opaque_inference_results = [ owner for owner in inferred if owner is not astroid.Uninferable and not isinstance(owner, astroid.nodes.Unknown) ] if (len(non_opaque_inference_results) != len(inferred) and self.config.ignore_on_opaque_inference): # There is an ambiguity in the inference. Since we can't # make sure that we won't emit a false positive, we just stop # whenever the inference returns an opaque inference object. return for owner in non_opaque_inference_results: name = getattr(owner, 'name', None) if _is_owner_ignored(owner, name, self.config.ignored_classes, self.config.ignored_modules): continue try: if not [n for n in owner.getattr(node.attrname) if not isinstance(n.statement(), astroid.AugAssign)]: missingattr.add((owner, name)) continue except AttributeError: # XXX method / function continue except exceptions.NotFoundError: # This can't be moved before the actual .getattr call, # because there can be more values inferred and we are # stopping after the first one which has the attribute in question. # The problem is that if the first one has the attribute, # but we continue to the next values which doesn't have the # attribute, then we'll have a false positive. # So call this only after the call has been made. if not _emit_no_member(node, owner, name, self.config.ignore_mixin_members): continue missingattr.add((owner, name)) continue # stop on the first found break else: # we have not found any node with the attributes, display the # message for infered nodes done = set() for owner, name in missingattr: if isinstance(owner, astroid.Instance): actual = owner._proxied else: actual = owner if actual in done: continue done.add(actual) if self.config.missing_member_hint: hint = _missing_member_hint(owner, node.attrname, self.config.missing_member_hint_distance, self.config.missing_member_max_choices) else: hint = "" self.add_message('no-member', node=node, args=(owner.display_type(), name, node.attrname, hint), confidence=INFERENCE) @check_messages('assignment-from-no-return', 'assignment-from-none') def visit_assign(self, node): """check that if assigning to a function call, the function is possibly returning something valuable """ if not isinstance(node.value, astroid.Call): return function_node = safe_infer(node.value.func) # skip class, generator and incomplete function definition if not (isinstance(function_node, astroid.FunctionDef) and function_node.root().fully_defined()): return if function_node.is_generator() \ or function_node.is_abstract(pass_is_abstract=False): return returns = list(function_node.nodes_of_class(astroid.Return, skip_klass=astroid.FunctionDef)) if not returns: self.add_message('assignment-from-no-return', node=node) else: for rnode in returns: if not (isinstance(rnode.value, astroid.Const) and rnode.value.value is None or rnode.value is None): break else: self.add_message('assignment-from-none', node=node) def _check_uninferable_callfunc(self, node): """ Check that the given uninferable CallFunc node does not call an actual function. """ if not isinstance(node.func, astroid.Attribute): return # Look for properties. First, obtain # the lhs of the Getattr node and search the attribute # there. If that attribute is a property or a subclass of properties, # then most likely it's not callable. # TODO: since astroid doesn't understand descriptors very well # we will not handle them here, right now. expr = node.func.expr klass = safe_infer(expr) if (klass is None or klass is astroid.YES or not isinstance(klass, astroid.Instance)): return try: attrs = klass._proxied.getattr(node.func.attrname) except exceptions.NotFoundError: return for attr in attrs: if attr is astroid.YES: continue if not isinstance(attr, astroid.FunctionDef): continue # Decorated, see if it is decorated with a property. # Also, check the returns and see if they are callable. if decorated_with_property(attr): if all(return_node.callable() for return_node in attr.infer_call_result(node)): continue else: self.add_message('not-callable', node=node, args=node.func.as_string()) break @check_messages(*(list(MSGS.keys()))) def visit_call(self, node): """check that called functions/methods are inferred to callable objects, and that the arguments passed to the function match the parameters in the inferred function's definition """ # Build the set of keyword arguments, checking for duplicate keywords, # and count the positional arguments. call_site = astroid.arguments.CallSite.from_call(node) num_positional_args = len(call_site.positional_arguments) keyword_args = list(call_site.keyword_arguments.keys()) # Determine if we don't have a context for our call and we use variadics. if isinstance(node.scope(), astroid.FunctionDef): has_no_context_positional_variadic = _no_context_variadic_positional(node) has_no_context_keywords_variadic = _no_context_variadic_keywords(node) else: has_no_context_positional_variadic = has_no_context_keywords_variadic = False called = safe_infer(node.func) # only function, generator and object defining __call__ are allowed if called and not called.callable(): if isinstance(called, astroid.Instance) and not has_known_bases(called): # Don't emit if we can't make sure this object is callable. pass else: self.add_message('not-callable', node=node, args=node.func.as_string()) self._check_uninferable_callfunc(node) try: called, implicit_args, callable_name = _determine_callable(called) except ValueError: # Any error occurred during determining the function type, most of # those errors are handled by different warnings. return num_positional_args += implicit_args if called.args.args is None: # Built-in functions have no argument information. return if len(called.argnames()) != len(set(called.argnames())): # Duplicate parameter name (see duplicate-argument). We can't really # make sense of the function call in this case, so just return. return # Warn about duplicated keyword arguments, such as `f=24, **{'f': 24}` for keyword in call_site.duplicated_keywords: self.add_message('repeated-keyword', node=node, args=(keyword, )) if call_site.has_invalid_arguments() or call_site.has_invalid_keywords(): # Can't make sense of this. return # Analyze the list of formal parameters. num_mandatory_parameters = len(called.args.args) - len(called.args.defaults) parameters = [] parameter_name_to_index = {} for i, arg in enumerate(called.args.args): if isinstance(arg, astroid.Tuple): name = None # Don't store any parameter names within the tuple, since those # are not assignable from keyword arguments. else: assert isinstance(arg, astroid.AssignName) # This occurs with: # def f( (a), (b) ): pass name = arg.name parameter_name_to_index[name] = i if i >= num_mandatory_parameters: defval = called.args.defaults[i - num_mandatory_parameters] else: defval = None parameters.append([(name, defval), False]) kwparams = {} for i, arg in enumerate(called.args.kwonlyargs): if isinstance(arg, astroid.Keyword): name = arg.arg else: assert isinstance(arg, astroid.AssignName) name = arg.name kwparams[name] = [called.args.kw_defaults[i], False] # Match the supplied arguments against the function parameters. # 1. Match the positional arguments. for i in range(num_positional_args): if i < len(parameters): parameters[i][1] = True elif called.args.vararg is not None: # The remaining positional arguments get assigned to the *args # parameter. break else: # Too many positional arguments. self.add_message('too-many-function-args', node=node, args=(callable_name,)) break # 2. Match the keyword arguments. for keyword in keyword_args: if keyword in parameter_name_to_index: i = parameter_name_to_index[keyword] if parameters[i][1]: # Duplicate definition of function parameter. # Might be too hardcoded, but this can actually # happen when using str.format and `self` is passed # by keyword argument, as in `.format(self=self)`. # It's perfectly valid to so, so we're just skipping # it if that's the case. if not (keyword == 'self' and called.qname() == STR_FORMAT): self.add_message('redundant-keyword-arg', node=node, args=(keyword, callable_name)) else: parameters[i][1] = True elif keyword in kwparams: if kwparams[keyword][1]: # XXX is that even possible? # Duplicate definition of function parameter. self.add_message('redundant-keyword-arg', node=node, args=(keyword, callable_name)) else: kwparams[keyword][1] = True elif called.args.kwarg is not None: # The keyword argument gets assigned to the **kwargs parameter. pass else: # Unexpected keyword argument. self.add_message('unexpected-keyword-arg', node=node, args=(keyword, callable_name)) # 3. Match the **kwargs, if any. if node.kwargs: for i, [(name, defval), assigned] in enumerate(parameters): # Assume that *kwargs provides values for all remaining # unassigned named parameters. if name is not None: parameters[i][1] = True else: # **kwargs can't assign to tuples. pass # Check that any parameters without a default have been assigned # values. for [(name, defval), assigned] in parameters: if (defval is None) and not assigned: if name is None: display_name = '<tuple>' else: display_name = repr(name) # TODO(cpopa): this should be removed after PyCQA/astroid/issues/177 if not has_no_context_positional_variadic: self.add_message('no-value-for-parameter', node=node, args=(display_name, callable_name)) for name in kwparams: defval, assigned = kwparams[name] if defval is None and not assigned and not has_no_context_keywords_variadic: self.add_message('missing-kwoa', node=node, args=(name, callable_name)) @check_messages('invalid-sequence-index') def visit_extslice(self, node): # Check extended slice objects as if they were used as a sequence # index to check if the object being sliced can support them return self.visit_index(node) @check_messages('invalid-sequence-index') def visit_index(self, node): if not node.parent or not hasattr(node.parent, "value"): return # Look for index operations where the parent is a sequence type. # If the types can be determined, only allow indices to be int, # slice or instances with __index__. parent_type = safe_infer(node.parent.value) if not isinstance(parent_type, (astroid.ClassDef, astroid.Instance)): return if not has_known_bases(parent_type): return # Determine what method on the parent this index will use # The parent of this node will be a Subscript, and the parent of that # node determines if the Subscript is a get, set, or delete operation. if node.parent.ctx is astroid.Store: methodname = '__setitem__' elif node.parent.ctx is astroid.Del: methodname = '__delitem__' else: methodname = '__getitem__' # Check if this instance's __getitem__, __setitem__, or __delitem__, as # appropriate to the statement, is implemented in a builtin sequence # type. This way we catch subclasses of sequence types but skip classes # that override __getitem__ and which may allow non-integer indices. try: methods = dunder_lookup.lookup(parent_type, methodname) if methods is astroid.YES: return itemmethod = methods[0] except (exceptions.NotFoundError, exceptions.AttributeInferenceError, IndexError): return if not isinstance(itemmethod, astroid.FunctionDef): return if itemmethod.root().name != BUILTINS: return if not itemmethod.parent: return if itemmethod.parent.name not in SEQUENCE_TYPES: return # For ExtSlice objects coming from visit_extslice, no further # inference is necessary, since if we got this far the ExtSlice # is an error. if isinstance(node, astroid.ExtSlice): index_type = node else: index_type = safe_infer(node) if index_type is None or index_type is astroid.YES: return # Constants must be of type int if isinstance(index_type, astroid.Const): if isinstance(index_type.value, int): return # Instance values must be int, slice, or have an __index__ method elif isinstance(index_type, astroid.Instance): if index_type.pytype() in (BUILTINS + '.int', BUILTINS + '.slice'): return try: index_type.getattr('__index__') return except exceptions.NotFoundError: pass elif isinstance(index_type, astroid.Slice): # Delegate to visit_slice. A slice can be present # here after inferring the index node, which could # be a `slice(...)` call for instance. return self.visit_slice(index_type) # Anything else is an error self.add_message('invalid-sequence-index', node=node) @check_messages('invalid-slice-index') def visit_slice(self, node): # Check the type of each part of the slice for index in (node.lower, node.upper, node.step): if index is None: continue index_type = safe_infer(index) if index_type is None or index_type is astroid.YES: continue # Constants must of type int or None if isinstance(index_type, astroid.Const): if isinstance(index_type.value, (int, type(None))): continue # Instance values must be of type int, None or an object # with __index__ elif isinstance(index_type, astroid.Instance): if index_type.pytype() in (BUILTINS + '.int', BUILTINS + '.NoneType'): continue try: index_type.getattr('__index__') return except exceptions.NotFoundError: pass # Anything else is an error self.add_message('invalid-slice-index', node=node) @check_messages('not-context-manager') def visit_with(self, node): for ctx_mgr, _ in node.items: context = astroid.context.InferenceContext() infered = safe_infer(ctx_mgr, context=context) if infered is None or infered is astroid.YES: continue if isinstance(infered, bases.Generator): # Check if we are dealing with a function decorated # with contextlib.contextmanager. if decorated_with(infered.parent, self.config.contextmanager_decorators): continue # If the parent of the generator is not the context manager itself, # that means that it could have been returned from another # function which was the real context manager. # The following approach is more of a hack rather than a real # solution: walk all the inferred statements for the # given *ctx_mgr* and if you find one function scope # which is decorated, consider it to be the real # manager and give up, otherwise emit not-context-manager. # See the test file for not_context_manager for a couple # of self explaining tests. for path in six.moves.filter(None, _unflatten(context.path)): scope = path.scope() if not isinstance(scope, astroid.FunctionDef): continue if decorated_with(scope, self.config.contextmanager_decorators): break else: self.add_message('not-context-manager', node=node, args=(infered.name, )) else: try: infered.getattr('__enter__') infered.getattr('__exit__') except exceptions.NotFoundError: if isinstance(infered, astroid.Instance): # If we do not know the bases of this class, # just skip it. if not has_known_bases(infered): continue # Just ignore mixin classes. if self.config.ignore_mixin_members: if infered.name[-5:].lower() == 'mixin': continue self.add_message('not-context-manager', node=node, args=(infered.name, )) @check_messages('invalid-unary-operand-type') def visit_unaryop(self, node): """Detect TypeErrors for unary operands.""" for error in node.type_errors(): # Let the error customize its output. self.add_message('invalid-unary-operand-type', args=str(error), node=node) @check_messages('unsupported-binary-operation') def _visit_binop(self, node): """Detect TypeErrors for binary arithmetic operands.""" self._check_binop_errors(node) @check_messages('unsupported-binary-operation') def _visit_augassign(self, node): """Detect TypeErrors for augmented binary arithmetic operands.""" self._check_binop_errors(node) def _check_binop_errors(self, node): for error in node.type_errors(): # Let the error customize its output. if any(isinstance(obj, astroid.ClassDef) and not has_known_bases(obj) for obj in (error.left_type, error.right_type)): continue self.add_message('unsupported-binary-operation', args=str(error), node=node) def _check_membership_test(self, node): if is_inside_abstract_class(node): return if is_comprehension(node): return infered = safe_infer(node) if infered is None or infered is astroid.YES: return if not supports_membership_test(infered): self.add_message('unsupported-membership-test', args=node.as_string(), node=node) @check_messages('unsupported-membership-test') def visit_compare(self, node): if len(node.ops) != 1: return op, right = node.ops[0] if op in ['in', 'not in']: self._check_membership_test(right) @check_messages('unsubscriptable-object', 'unsupported-assignment-operation', 'unsupported-delete-operation') def visit_subscript(self, node): supported_protocol = None if isinstance(node.value, (astroid.ListComp, astroid.DictComp)): return if node.ctx == astroid.Load: supported_protocol = supports_getitem msg = 'unsubscriptable-object' elif node.ctx == astroid.Store: supported_protocol = supports_setitem msg = 'unsupported-assignment-operation' elif node.ctx == astroid.Del: supported_protocol = supports_delitem msg = 'unsupported-delete-operation' if isinstance(node.value, astroid.SetComp): self.add_message(msg, args=node.value.as_string(), node=node.value) return if is_inside_abstract_class(node): return inferred = safe_infer(node.value) if inferred is None or inferred is astroid.YES: return if not supported_protocol(inferred): self.add_message(msg, args=node.value.as_string(), node=node.value) class IterableChecker(BaseChecker): """ Checks for non-iterables used in an iterable context. Contexts include: - for-statement - starargs in function call - `yield from`-statement - list, dict and set comprehensions - generator expressions Also checks for non-mappings in function call kwargs. """ __implements__ = (IAstroidChecker,) name = 'iterable_check' msgs = {'E1133': ('Non-iterable value %s is used in an iterating context', 'not-an-iterable', 'Used when a non-iterable value is used in place where ' 'iterable is expected'), 'E1134': ('Non-mapping value %s is used in a mapping context', 'not-a-mapping', 'Used when a non-mapping value is used in place where ' 'mapping is expected'), } def _check_iterable(self, node): if is_inside_abstract_class(node): return if is_comprehension(node): return infered = safe_infer(node) if infered is None or infered is astroid.YES: return if not is_iterable(infered): self.add_message('not-an-iterable', args=node.as_string(), node=node) def _check_mapping(self, node): if is_inside_abstract_class(node): return if isinstance(node, astroid.DictComp): return infered = safe_infer(node) if infered is None or infered is astroid.YES: return if not is_mapping(infered): self.add_message('not-a-mapping', args=node.as_string(), node=node) @check_messages('not-an-iterable') def visit_for(self, node): self._check_iterable(node.iter) @check_messages('not-an-iterable') def visit_yieldfrom(self, node): self._check_iterable(node.value) @check_messages('not-an-iterable', 'not-a-mapping') def visit_call(self, node): for stararg in node.starargs: self._check_iterable(stararg.value) for kwarg in node.kwargs: self._check_mapping(kwarg.value) @check_messages('not-an-iterable') def visit_listcomp(self, node): for gen in node.generators: self._check_iterable(gen.iter) @check_messages('not-an-iterable') def visit_dictcomp(self, node): for gen in node.generators: self._check_iterable(gen.iter) @check_messages('not-an-iterable') def visit_setcomp(self, node): for gen in node.generators: self._check_iterable(gen.iter) @check_messages('not-an-iterable') def visit_generatorexp(self, node): for gen in node.generators: self._check_iterable(gen.iter) def register(linter): """required method to auto register this checker """ linter.register_checker(TypeChecker(linter)) linter.register_checker(IterableChecker(linter))
mit
marcelobelli/PyNFSe
tests/base/test_certificate.py
1
3010
from tempfile import _TemporaryFileWrapper import pytest from pynfse.base.certificate import _create_temp_file, get_certificate @pytest.fixture def certificate_chain(): return b"""-----BEGIN CERTIFICATE----- MIIDhDCCAmygAwIBAgIKZCXL8wAAAAAStTANBgkqhkiG9w0BAQUFADAcMRowGAYD VQQDExFQSUxPVE9JU1NDVVJJVElCQTAeFw0xNjExMTUwMjQ0MzVaFw0xNzExMTUw MjU0MzVaMFExCzAJBgNVBAYTAkFBMQowCAYDVQQIEwFhMQowCAYDVQQHEwFhMQow CAYDVQQLEwFhMQowCAYDVQQDEwFhMRIwEAYJKoZIhvcNAQkBFgNhQGEwgZ8wDQYJ KoZIhvcNAQEBBQADgY0AMIGJAoGBAKWXY7Ed+tNB08Gk9XDs64ySfebqUj8GPSkN 5v0JbGoKsU28PZKJmdZGI32PzSRimpqJ8TtF+mlIYzPGOWaPQfQ0RIul22TLEBFV /MTf9NtQ+XtrI3P+41Z1b7NUfvZAeJX37td4yzD6tytLDG+OsqBoEFE1fcvEFm6S SXjnqg4JAgMBAAGjggEVMIIBETAOBgNVHQ8BAf8EBAMCBPAwEwYDVR0lBAwwCgYI KwYBBQUHAwIwHQYDVR0OBBYEFKjFwEt26SdfbwOm5dfhVTwwpsLqMB8GA1UdIwQY MBaAFMfsVZWz6ktjZvG/o306I++LnBhLMEcGA1UdHwRAMD4wPKA6oDiGNmZpbGU6 Ly9XRUJBUFBJU1NDV0IwNC9DZXJ0RW5yb2xsL1BJTE9UT0lTU0NVUklUSUJBLmNy bDBhBggrBgEFBQcBAQRVMFMwUQYIKwYBBQUHMAKGRWZpbGU6Ly9XRUJBUFBJU1ND V0IwNC9DZXJ0RW5yb2xsL1dFQkFQUElTU0NXQjA0X1BJTE9UT0lTU0NVUklUSUJB LmNydDANBgkqhkiG9w0BAQUFAAOCAQEAcN1v1u/jyWoz54Py80QKc82ZfoYO12Ak vw4hIc28BszeBO/cv1Idizu2jdqD0fG9mFrKqUd0LctOaumvr3tzSIEhH+oT3+8h DBb4uhHBNAia1gcCYUZp+VMh/gsH5DKeziMCVEpb3NMu9GZ6rLdeTy4P7pymg1IC Lud52TreMS6CXFZX7wD+uHJeLPEqQja1bT/1UDxq4h6fgI+y2N2h77vyt0NJkejV DfKus4bPCxAVxnp4DREA+ZKlTuHFCrSQd21MDydE3sRgj9VDiJxFMoTWCTiYM63d 0SDKDuvm7gT9lhbDUFES8RCPOL3Pagr9bmpjALK0IBUISRXHRX9R0Q== -----END CERTIFICATE----- """ @pytest.fixture def certificate_key(): return b"""-----BEGIN PRIVATE KEY----- MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAKWXY7Ed+tNB08Gk 9XDs64ySfebqUj8GPSkN5v0JbGoKsU28PZKJmdZGI32PzSRimpqJ8TtF+mlIYzPG OWaPQfQ0RIul22TLEBFV/MTf9NtQ+XtrI3P+41Z1b7NUfvZAeJX37td4yzD6tytL DG+OsqBoEFE1fcvEFm6SSXjnqg4JAgMBAAECgYAJIy9Vu9QmUeq10+zUykgNsdw3 cKzw7B7WG/2n7xwPxm8F/XoO0t+9rJFjCXs+E6BZIH1ConAI3P0XY2vxsjxG/veC hnYVU9NOk49Fa1mzWLH82zsDzSLkrewjcxC56kXfZ7c6kpc2/U6D/UQkOIS+TWhO HmRlnhSMkrgKT1n+MQJBAObqfx+p+17jVzPyDsnpdzlFZlcOYj26XgT0RHuSlRyY YPZGtF1FwK9mIFUNhqpL0EYRJ/o7hgkdzzrublFre1kCQQC3lEqOIaQK21FUjUP9 8zPbcDEhgYZecI9mwLEHlCIjTEfUgqkSLKeR9HTMGNZRAOXxX+tJL36wz1v1IvTl zsIxAkBd7KnyljBxwyT4MxAC3tyoxeq/pFEfbIvLlhO488GFFRHzeoTon3OlpHOo RM0uvZGkvlu1c7qsQJzHCq6CnaZZAkBvzt51oGGTxy3KrFsr0TLVRIh32rZm0HFW aKepcPw1uWDKOmYUzqOkjlmQcNQe88gYcY4Qvd+QekqMi6TSTlIRAkA/suD5u5vF NbqnpyPnDulvgtXE2B1UHl0wZJbLfDH+BFckz7B557Cz507YthsWWJmjVPVqJXLM HFZwimKs65R9 -----END PRIVATE KEY----- """ def test_get_certificate(certificate_chain, certificate_key, certificate_file_path, certificate_password): cert, cert_file, key, key_file = get_certificate(certificate_file_path, certificate_password) assert cert == certificate_chain assert cert_file.read() == certificate_chain assert key == certificate_key assert key_file.read() == certificate_key def test_create_temp_file(certificate_key): result = _create_temp_file(certificate_key) assert isinstance(result, _TemporaryFileWrapper) assert result.read() == certificate_key
lgpl-3.0
mtagle/airflow
tests/runtime/kubernetes/test_kubernetes_pod_operator.py
2
27919
# 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 file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import json import os import shutil import unittest from unittest import mock from unittest.mock import ANY import kubernetes.client.models as k8s import pytest from kubernetes.client.api_client import ApiClient from kubernetes.client.rest import ApiException from airflow import AirflowException from airflow.kubernetes.pod import Port from airflow.kubernetes.pod_generator import PodDefaults from airflow.kubernetes.pod_launcher import PodLauncher from airflow.kubernetes.secret import Secret from airflow.kubernetes.volume import Volume from airflow.kubernetes.volume_mount import VolumeMount from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import KubernetesPodOperator from airflow.version import version as airflow_version @pytest.mark.runtime("kubernetes") class TestKubernetesPodOperator(unittest.TestCase): def setUp(self): self.maxDiff = None # pylint: disable=invalid-name self.api_client = ApiClient() self.expected_pod = { 'apiVersion': 'v1', 'kind': 'Pod', 'metadata': { 'namespace': 'default', 'name': ANY, 'annotations': {}, 'labels': { 'foo': 'bar', 'kubernetes_pod_operator': 'True', 'airflow_version': airflow_version.replace('+', '-') } }, 'spec': { 'affinity': {}, 'containers': [{ 'image': 'ubuntu:16.04', 'args': ["echo 10"], 'command': ["bash", "-cx"], 'env': [], 'imagePullPolicy': 'IfNotPresent', 'envFrom': [], 'name': 'base', 'ports': [], 'volumeMounts': [], }], 'hostNetwork': False, 'imagePullSecrets': [], 'initContainers': [], 'nodeSelector': {}, 'restartPolicy': 'Never', 'securityContext': {}, 'serviceAccountName': 'default', 'tolerations': [], 'volumes': [], } } def test_do_xcom_push_defaults_false(self): new_config_path = '/tmp/kube_config' old_config_path = os.path.expanduser('~/.kube/config') shutil.copy(old_config_path, new_config_path) k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, config_file=new_config_path, ) self.assertFalse(k.do_xcom_push) def test_config_path_move(self): new_config_path = '/tmp/kube_config' old_config_path = os.path.expanduser('~/.kube/config') shutil.copy(old_config_path, new_config_path) k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, config_file=new_config_path, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.assertEqual(self.expected_pod, actual_pod) @mock.patch("airflow.kubernetes.pod_launcher.PodLauncher.run_pod") @mock.patch("airflow.kubernetes.kube_client.get_kube_client") def test_config_path(self, client_mock, launcher_mock): from airflow.utils.state import State file_path = "/tmp/fake_file" k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, config_file=file_path, cluster_context='default', ) launcher_mock.return_value = (State.SUCCESS, None) k.execute(None) client_mock.assert_called_once_with( in_cluster=False, cluster_context='default', config_file=file_path, ) @mock.patch("airflow.kubernetes.pod_launcher.PodLauncher.run_pod") @mock.patch("airflow.kubernetes.kube_client.get_kube_client") def test_image_pull_secrets_correctly_set(self, mock_client, launcher_mock): from airflow.utils.state import State fake_pull_secrets = "fakeSecret" k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, image_pull_secrets=fake_pull_secrets, cluster_context='default', ) launcher_mock.return_value = (State.SUCCESS, None) k.execute(None) self.assertEqual( launcher_mock.call_args[0][0].spec.image_pull_secrets, [k8s.V1LocalObjectReference(name=fake_pull_secrets)] ) @mock.patch("airflow.kubernetes.pod_launcher.PodLauncher.run_pod") @mock.patch("airflow.kubernetes.pod_launcher.PodLauncher.delete_pod") @mock.patch("airflow.kubernetes.kube_client.get_kube_client") def test_pod_delete_even_on_launcher_error(self, mock_client, delete_pod_mock, run_pod_mock): k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, cluster_context='default', is_delete_operator_pod=True, ) run_pod_mock.side_effect = AirflowException('fake failure') with self.assertRaises(AirflowException): k.execute(None) assert delete_pod_mock.called def test_working_pod(self): k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.assertEqual(self.expected_pod, actual_pod) def test_delete_operator_pod(self): k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, is_delete_operator_pod=True, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.assertEqual(self.expected_pod, actual_pod) def test_pod_hostnetwork(self): k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, hostnetwork=True, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['hostNetwork'] = True self.assertEqual(self.expected_pod, actual_pod) def test_pod_dnspolicy(self): dns_policy = "ClusterFirstWithHostNet" k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, hostnetwork=True, dnspolicy=dns_policy ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['hostNetwork'] = True self.expected_pod['spec']['dnsPolicy'] = dns_policy self.assertEqual(self.expected_pod, actual_pod) def test_pod_schedulername(self): scheduler_name = "default-scheduler" k = KubernetesPodOperator( namespace="default", image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, schedulername=scheduler_name ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['schedulerName'] = scheduler_name self.assertEqual(self.expected_pod, actual_pod) def test_pod_node_selectors(self): node_selectors = { 'beta.kubernetes.io/os': 'linux' } k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, node_selectors=node_selectors, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['nodeSelector'] = node_selectors self.assertEqual(self.expected_pod, actual_pod) def test_pod_resources(self): resources = { 'limit_cpu': 0.25, 'limit_memory': '64Mi', 'request_cpu': '250m', 'request_memory': '64Mi', } k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, resources=resources, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['containers'][0]['resources'] = { 'requests': { 'memory': '64Mi', 'cpu': '250m' }, 'limits': { 'memory': '64Mi', 'cpu': 0.25, 'nvidia.com/gpu': None } } self.assertEqual(self.expected_pod, actual_pod) def test_pod_affinity(self): affinity = { 'nodeAffinity': { 'requiredDuringSchedulingIgnoredDuringExecution': { 'nodeSelectorTerms': [ { 'matchExpressions': [ { 'key': 'beta.kubernetes.io/os', 'operator': 'In', 'values': ['linux'] } ] } ] } } } k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, affinity=affinity, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['affinity'] = affinity self.assertEqual(self.expected_pod, actual_pod) def test_port(self): port = Port('http', 80) k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, ports=[port], ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['containers'][0]['ports'] = [{ 'name': 'http', 'containerPort': 80 }] self.assertEqual(self.expected_pod, actual_pod) def test_volume_mount(self): with mock.patch.object(PodLauncher, 'log') as mock_logger: volume_mount = VolumeMount('test-volume', mount_path='/root/mount_file', sub_path=None, read_only=True) volume_config = { 'persistentVolumeClaim': { 'claimName': 'test-volume' } } volume = Volume(name='test-volume', configs=volume_config) args = ["cat /root/mount_file/test.txt"] k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=args, labels={"foo": "bar"}, volume_mounts=[volume_mount], volumes=[volume], name="test", task_id="task", in_cluster=False, do_xcom_push=False, ) k.execute(None) mock_logger.info.assert_any_call(b"retrieved from mount\n") actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['containers'][0]['args'] = args self.expected_pod['spec']['containers'][0]['volumeMounts'] = [{ 'name': 'test-volume', 'mountPath': '/root/mount_file', 'readOnly': True }] self.expected_pod['spec']['volumes'] = [{ 'name': 'test-volume', 'persistentVolumeClaim': { 'claimName': 'test-volume' } }] self.assertEqual(self.expected_pod, actual_pod) def test_run_as_user_root(self): security_context = { 'securityContext': { 'runAsUser': 0, } } k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, security_context=security_context, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['securityContext'] = security_context self.assertEqual(self.expected_pod, actual_pod) def test_run_as_user_non_root(self): security_context = { 'securityContext': { 'runAsUser': 1000, } } k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, security_context=security_context, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['securityContext'] = security_context self.assertEqual(self.expected_pod, actual_pod) def test_fs_group(self): security_context = { 'securityContext': { 'fsGroup': 1000, } } k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, security_context=security_context, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['securityContext'] = security_context self.assertEqual(self.expected_pod, actual_pod) def test_faulty_image(self): bad_image_name = "foobar" k = KubernetesPodOperator( namespace='default', image=bad_image_name, cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, startup_timeout_seconds=5, ) with self.assertRaises(AirflowException): k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['containers'][0]['image'] = bad_image_name self.assertEqual(self.expected_pod, actual_pod) def test_faulty_service_account(self): bad_service_account_name = "foobar" k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, startup_timeout_seconds=5, service_account_name=bad_service_account_name, ) with self.assertRaises(ApiException): k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['serviceAccountName'] = bad_service_account_name self.assertEqual(self.expected_pod, actual_pod) def test_pod_failure(self): """ Tests that the task fails when a pod reports a failure """ bad_internal_command = ["foobar 10 "] k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=bad_internal_command, labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, ) with self.assertRaises(AirflowException): k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['containers'][0]['args'] = bad_internal_command self.assertEqual(self.expected_pod, actual_pod) def test_xcom_push(self): return_value = '{"foo": "bar"\n, "buzz": 2}' args = ['echo \'{}\' > /airflow/xcom/return.json'.format(return_value)] k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=args, labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=True, ) self.assertEqual(k.execute(None), json.loads(return_value)) actual_pod = self.api_client.sanitize_for_serialization(k.pod) volume = self.api_client.sanitize_for_serialization(PodDefaults.VOLUME) volume_mount = self.api_client.sanitize_for_serialization(PodDefaults.VOLUME_MOUNT) container = self.api_client.sanitize_for_serialization(PodDefaults.SIDECAR_CONTAINER) self.expected_pod['spec']['containers'][0]['args'] = args self.expected_pod['spec']['containers'][0]['volumeMounts'].insert(0, volume_mount) self.expected_pod['spec']['volumes'].insert(0, volume) self.expected_pod['spec']['containers'].append(container) self.assertEqual(self.expected_pod, actual_pod) @mock.patch("airflow.kubernetes.pod_launcher.PodLauncher.run_pod") @mock.patch("airflow.kubernetes.kube_client.get_kube_client") def test_envs_from_configmaps(self, mock_client, mock_launcher): # GIVEN from airflow.utils.state import State configmap = 'test-configmap' # WHEN k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, configmaps=[configmap], ) # THEN mock_launcher.return_value = (State.SUCCESS, None) k.execute(None) self.assertEqual( mock_launcher.call_args[0][0].spec.containers[0].env_from, [k8s.V1EnvFromSource(config_map_ref=k8s.V1ConfigMapEnvSource( name=configmap ))] ) @mock.patch("airflow.kubernetes.pod_launcher.PodLauncher.run_pod") @mock.patch("airflow.kubernetes.kube_client.get_kube_client") def test_envs_from_secrets(self, mock_client, launcher_mock): # GIVEN from airflow.utils.state import State secret_ref = 'secret_name' secrets = [Secret('env', None, secret_ref)] # WHEN k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], secrets=secrets, labels={"foo": "bar"}, name="test", task_id="task", in_cluster=False, do_xcom_push=False, ) # THEN launcher_mock.return_value = (State.SUCCESS, None) k.execute(None) self.assertEqual( launcher_mock.call_args[0][0].spec.containers[0].env_from, [k8s.V1EnvFromSource(secret_ref=k8s.V1SecretEnvSource( name=secret_ref ))] ) def test_init_container(self): # GIVEN volume_mounts = [k8s.V1VolumeMount( mount_path='/etc/foo', name='test-volume', sub_path=None, read_only=True )] init_environments = [k8s.V1EnvVar( name='key1', value='value1' ), k8s.V1EnvVar( name='key2', value='value2' )] init_container = k8s.V1Container( name="init-container", image="ubuntu:16.04", env=init_environments, volume_mounts=volume_mounts, command=["bash", "-cx"], args=["echo 10"] ) volume_config = { 'persistentVolumeClaim': { 'claimName': 'test-volume' } } volume = Volume(name='test-volume', configs=volume_config) expected_init_container = { 'name': 'init-container', 'image': 'ubuntu:16.04', 'command': ['bash', '-cx'], 'args': ['echo 10'], 'env': [{ 'name': 'key1', 'value': 'value1' }, { 'name': 'key2', 'value': 'value2' }], 'volumeMounts': [{ 'mountPath': '/etc/foo', 'name': 'test-volume', 'readOnly': True }], } k = KubernetesPodOperator( namespace='default', image="ubuntu:16.04", cmds=["bash", "-cx"], arguments=["echo 10"], labels={"foo": "bar"}, name="test", task_id="task", volumes=[volume], init_containers=[init_container], in_cluster=False, do_xcom_push=False, ) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.expected_pod['spec']['initContainers'] = [expected_init_container] self.expected_pod['spec']['volumes'] = [{ 'name': 'test-volume', 'persistentVolumeClaim': { 'claimName': 'test-volume' } }] self.assertEqual(self.expected_pod, actual_pod) @mock.patch("airflow.kubernetes.pod_launcher.PodLauncher.run_pod") @mock.patch("airflow.kubernetes.kube_client.get_kube_client") def test_pod_template_file(self, mock_client, launcher_mock): from airflow.utils.state import State k = KubernetesPodOperator( task_id='task', pod_template_file='tests/kubernetes/pod.yaml', do_xcom_push=True ) launcher_mock.return_value = (State.SUCCESS, None) k.execute(None) actual_pod = self.api_client.sanitize_for_serialization(k.pod) self.assertEqual({ 'apiVersion': 'v1', 'kind': 'Pod', 'metadata': {'name': ANY, 'namespace': 'mem-example'}, 'spec': { 'volumes': [{'name': 'xcom', 'emptyDir': {}}], 'containers': [{ 'args': ['--vm', '1', '--vm-bytes', '150M', '--vm-hang', '1'], 'command': ['stress'], 'image': 'polinux/stress', 'name': 'memory-demo-ctr', 'resources': { 'limits': {'memory': '200Mi'}, 'requests': {'memory': '100Mi'} }, 'volumeMounts': [{ 'name': 'xcom', 'mountPath': '/airflow/xcom' }] }, { 'name': 'airflow-xcom-sidecar', 'image': "alpine", 'command': ['sh', '-c', PodDefaults.XCOM_CMD], 'volumeMounts': [ { 'name': 'xcom', 'mountPath': '/airflow/xcom' } ], 'resources': {'requests': {'cpu': '1m'}}, }], } }, actual_pod) # pylint: enable=unused-argument if __name__ == '__main__': unittest.main()
apache-2.0
aaltay/beam
sdks/python/apache_beam/examples/complete/game/hourly_team_score_test.py
3
2147
# # 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 file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # """Test for the user_score example.""" # pytype: skip-file from __future__ import absolute_import import logging import unittest import apache_beam as beam from apache_beam.examples.complete.game import hourly_team_score from apache_beam.testing.test_pipeline import TestPipeline from apache_beam.testing.util import assert_that from apache_beam.testing.util import equal_to class HourlyTeamScoreTest(unittest.TestCase): SAMPLE_DATA = [ 'user1_team1,team1,18,1447686663000,2015-11-16 15:11:03.921', 'user1_team1,team1,18,1447690263000,2015-11-16 16:11:03.921', 'user2_team2,team2,2,1447690263000,2015-11-16 16:11:03.955', 'user3_team3,team3,8,1447690263000,2015-11-16 16:11:03.955', 'user4_team3,team3,5,1447690263000,2015-11-16 16:11:03.959', 'user1_team1,team1,14,1447697463000,2015-11-16 18:11:03.955', ] def test_hourly_team_score(self): with TestPipeline() as p: result = ( p | beam.Create(HourlyTeamScoreTest.SAMPLE_DATA) | hourly_team_score.HourlyTeamScore( start_min='2015-11-16-15-20', stop_min='2015-11-16-17-20', window_duration=60)) assert_that( result, equal_to([('team1', 18), ('team2', 2), ('team3', 13)])) if __name__ == '__main__': logging.getLogger().setLevel(logging.INFO) unittest.main()
apache-2.0
huxh10/iSDX
xctrl/lib.py
2
3484
#!/usr/bin/env python # Author: # Rudiger Birkner (Networked Systems Group ETH Zurich) from collections import namedtuple import json from netaddr import IPNetwork ''' Config Parser ''' class Config(object): MULTISWITCH = 0 MULTITABLE = 1 ONESWITCH = 2 SUPERSETS = 0 MDS = 1 def __init__(self, config_file): self.mode = None self.vmac_mode = None self.vmac_options = None self.vnhs = None self.refmon = None self.flanc_auth = None self.route_server = None self.arp_proxy = None self.peers = {} # loading config file config = json.load(open(config_file, 'r')) # parse config self.parse_config(config) def parse_config(self, config): if "Mode" in config: if config["Mode"] == "Multi-Switch": self.mode = self.MULTISWITCH elif config["Mode"] == "Multi-Table": self.mode = self.MULTITABLE elif config["Mode"] == "One-Switch": self.mode = self.ONESWITCH if "VMAC" in config: if "Mode" in config["VMAC"]: if config["VMAC"]["Mode"] == "Superset": self.vmac_mode = self.SUPERSETS if config["VMAC"]["Mode"] == "MDS": self.vmac_mode = self.MDS if "Options" in config["VMAC"]: self.vmac_options = config["VMAC"]["Options"] if "RefMon Server" in config: self.refmon = config["RefMon Server"] if "Flanc Auth Info" in config: self.flanc_auth = config["Flanc Auth Info"] if "VNHs" in config: self.vnhs = IPNetwork(config["VNHs"]) if "Route Server" in config: self.route_server = Peer("RS", [Port(config["Route Server"]["Port"], config["Route Server"]["MAC"], config["Route Server"]["IP"])]) if "ARP Proxy" in config: self.arp_proxy = Peer("ARP", [Port(config["ARP Proxy"]["Port"], config["ARP Proxy"]["MAC"], config["ARP Proxy"]["IP"])]) if "Participants" in config: for participant_name, participant in config["Participants"].iteritems(): participant_name = int(participant_name) if ("Inbound Rules" in participant): inbound_rules = participant["Inbound Rules"] else: inbound_rules = None if ("Outbound Rules" in participant): outbound_rules = participant["Outbound Rules"] else: outbound_rules = None if ("Ports" in participant): ports = [Port(port['Id'], port['MAC'], port['IP']) for port in participant["Ports"]] self.peers[participant_name] = Participant(participant_name, ports, inbound_rules, outbound_rules) def isMultiSwitchMode(self): return self.mode == self.MULTISWITCH def isMultiTableMode(self): return self.mode == self.MULTITABLE def isOneSwitchMode(self): return self.mode == self.ONESWITCH def isSupersetsMode(self): return self.vmac_mode == self.SUPERSETS def isMDSMode(self): return self.vmac_mode == self.MDS Peer = namedtuple('Peer', 'name ports') Port = namedtuple('Port', 'id mac ip') Participant = namedtuple('Participant', 'name ports inbound_rules outbound_rules')
apache-2.0
alfkjartan/nvgimu
nvg/environment/base.py
3
2274
""" Overall model of the environment experienced by simulated IMUs. """ # Copyright (C) 2009-2011 University of Edinburgh # # This file is part of IMUSim. # # IMUSim 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. # # IMUSim is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with IMUSim. If not, see <http://www.gnu.org/licenses/>. from imusim.maths.vector_fields import VectorField from imusim.environment.magnetic_fields import EarthMagneticField from imusim.environment.gravity import ConstantGravitationalField from imusim.environment.radio_environment import RadioEnvironment, \ IdealRadioEnvironment class Environment(object): """ Overall model of the environment experienced by simulated IMUs. An environment includes gravitational and magnetic vector fields, and a radio environment that models the propagation of radio transmissions. The default environment has constant magnetic and gravitational field models with nominal values for Edinburgh, UK, and an ideal, lossless radio environment. @ivar magneticField: L{VectorField} model of magnetic field. @ivar gravitationalField: L{VectorField} model of gravity. @ivar radioEnvironment: L{RadioEnvironment} model instance. """ def __init__(self, magneticField=EarthMagneticField(), gravitationalField=ConstantGravitationalField(), radioEnvironment=IdealRadioEnvironment()): """ Construct environment model. @param magneticField: L{VectorField} model of magnetic field. @param gravitationalField: L{VectorField} model of gravity. @param radioEnvironment: L{RadioEnvironment} model instance. """ self.gravitationalField = gravitationalField self.magneticField = magneticField self.radioEnvironment = radioEnvironment
gpl-3.0
prkumar/uplink
uplink/clients/io/templates.py
1
1708
# Standard library imports import operator # Local imports from uplink.clients.io import RequestTemplate, transitions class DefaultRequestTemplate(RequestTemplate): """The fallback behaviors for all hooks.""" def before_request(self, request): return transitions.send(request) def after_response(self, request, response): return transitions.finish(response) def after_exception(self, request, exc_type, exc_val, exc_tb): return transitions.fail(exc_type, exc_val, exc_tb) class CompositeRequestTemplate(RequestTemplate): """A chain of many templates with fallback behaviors.""" __FALLBACK = DefaultRequestTemplate() def _get_transition(self, method, *args, **kwargs): caller = operator.methodcaller(method, *args, **kwargs) for template in self._templates: transition = caller(template) if transition is not None: return transition else: return caller(self._fallback) def __init__(self, templates, fallback=__FALLBACK): self._templates = list(templates) self._fallback = fallback def before_request(self, request): return self._get_transition( RequestTemplate.before_request.__name__, request ) def after_response(self, request, response): return self._get_transition( RequestTemplate.after_response.__name__, request, response ) def after_exception(self, request, exc_type, exc_val, exc_tb): return self._get_transition( RequestTemplate.after_exception.__name__, request, exc_type, exc_val, exc_tb, )
mit
milmd90/TwitterBot
build/lib.linux-armv6l-2.7/twitter/trend.py
4
1421
#!/usr/bin/env python class Trend(object): """ A class representing a trending topic """ def __init__(self, name=None, query=None, timestamp=None, url=None): self.name = name self.query = query self.timestamp = timestamp self.url = url def __repr__(self): return self.name.encode('utf-8') def __str__(self): return 'Name: %s\nQuery: %s\nTimestamp: %s\nSearch URL: %s\n' % \ (self.name, self.query, self.timestamp, self.url) def __ne__(self, other): return not self.__eq__(other) def __eq__(self, other): try: return other and \ self.name == other.name and \ self.query == other.query and \ self.timestamp == other.timestamp and \ self.url == self.url except AttributeError: return False @staticmethod def NewFromJsonDict(data, timestamp=None): """Create a new instance based on a JSON dict Args: data: A JSON dict timestamp: Gets set as the timestamp property of the new object Returns: A twitter.Trend object """ return Trend(name=data.get('name', None), query=data.get('query', None), url=data.get('url', None), timestamp=timestamp)
apache-2.0
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/gunicorn/workers/async.py
24
4592
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from datetime import datetime import errno import socket import ssl import gunicorn.http as http import gunicorn.http.wsgi as wsgi import gunicorn.util as util import gunicorn.workers.base as base from gunicorn import six ALREADY_HANDLED = object() class AsyncWorker(base.Worker): def __init__(self, *args, **kwargs): super(AsyncWorker, self).__init__(*args, **kwargs) self.worker_connections = self.cfg.worker_connections def timeout_ctx(self): raise NotImplementedError() def handle(self, listener, client, addr): req = None try: parser = http.RequestParser(self.cfg, client) try: if not self.cfg.keepalive: req = six.next(parser) self.handle_request(listener, req, client, addr) else: # keepalive loop while True: req = None with self.timeout_ctx(): req = six.next(parser) if not req: break self.handle_request(listener, req, client, addr) except http.errors.NoMoreData as e: self.log.debug("Ignored premature client disconnection. %s", e) except StopIteration as e: self.log.debug("Closing connection. %s", e) except ssl.SSLError: raise # pass to next try-except level except socket.error: raise # pass to next try-except level except Exception as e: self.handle_error(req, client, addr, e) except ssl.SSLError as e: if e.args[0] == ssl.SSL_ERROR_EOF: self.log.debug("ssl connection closed") client.close() else: self.log.debug("Error processing SSL request.") self.handle_error(req, client, addr, e) except socket.error as e: if e.args[0] not in (errno.EPIPE, errno.ECONNRESET): self.log.exception("Socket error processing request.") else: if e.args[0] == errno.ECONNRESET: self.log.debug("Ignoring connection reset") else: self.log.debug("Ignoring EPIPE") except Exception as e: self.handle_error(req, client, addr, e) finally: util.close(client) def handle_request(self, listener, req, sock, addr): request_start = datetime.now() environ = {} resp = None try: self.cfg.pre_request(self, req) resp, environ = wsgi.create(req, sock, addr, listener.getsockname(), self.cfg) self.nr += 1 if self.alive and self.nr >= self.max_requests: self.log.info("Autorestarting worker after current request.") resp.force_close() self.alive = False if not self.cfg.keepalive: resp.force_close() respiter = self.wsgi(environ, resp.start_response) if respiter == ALREADY_HANDLED: return False try: if isinstance(respiter, environ['wsgi.file_wrapper']): resp.write_file(respiter) else: for item in respiter: resp.write(item) resp.close() request_time = datetime.now() - request_start self.log.access(resp, req, environ, request_time) finally: if hasattr(respiter, "close"): respiter.close() if resp.should_close(): raise StopIteration() except Exception: if resp and resp.headers_sent: # If the requests have already been sent, we should close the # connection to indicate the error. try: sock.shutdown(socket.SHUT_RDWR) sock.close() except socket.error: pass raise StopIteration() raise finally: try: self.cfg.post_request(self, req, environ, resp) except Exception: self.log.exception("Exception in post_request hook") return True
mit
wavefrontHQ/python-client
test/test_paged_external_link.py
1
1308
# coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST API documentation you must add the header \"Authorization: Bearer &lt;&lt;API-TOKEN&gt;&gt;\" to your HTTP requests.</p> # noqa: E501 OpenAPI spec version: v2 Contact: chitimba@wavefront.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import wavefront_api_client from wavefront_api_client.models.paged_external_link import PagedExternalLink # noqa: E501 from wavefront_api_client.rest import ApiException class TestPagedExternalLink(unittest.TestCase): """PagedExternalLink unit test stubs""" def setUp(self): pass def tearDown(self): pass def testPagedExternalLink(self): """Test PagedExternalLink""" # FIXME: construct object with mandatory attributes with example values # model = wavefront_api_client.models.paged_external_link.PagedExternalLink() # noqa: E501 pass if __name__ == '__main__': unittest.main()
apache-2.0
yelizariev/website-addons
website_booking_calendar/models.py
6
4843
from datetime import datetime, timedelta import pytz from openerp import api, models, fields from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DTF from openerp.addons.resource.resource import seconds MIN_TIMESLOT_HOURS = 1 class sale_order_line(models.Model): _inherit = 'sale.order.line' @api.model def events_to_bookings(self, events): calendar_obj = self.env['resource.calendar'] resource_obj = self.env['resource.resource'] lang_obj = self.env['res.lang'] lang = lang_obj.search([('code', '=', self.env.context.get('lang'))]) user_df = ('%s %s' % (lang.date_format, lang.time_format)) if lang else DTF products = self.env['product.product'].search([('calendar_id','!=',False)]) bookings = {} for event in events: r = event['resource'] if not r in bookings: bookings[r] = {} start_dt = datetime.strptime(event['start'], DTF) end_dt = datetime.strptime(event['end'], DTF) #check products and its working calendars by every hour booked by user hour_dt = start_dt while hour_dt < end_dt: hour = hour_dt.strftime(DTF) if hour_dt < end_dt: bookings[r][hour] = { 'start': hour_dt, 'start_f': (hour_dt).strftime(user_df), 'end': (hour_dt+timedelta(hours=MIN_TIMESLOT_HOURS)), 'end_f': (hour_dt+timedelta(hours=MIN_TIMESLOT_HOURS)).strftime(user_df), 'resource': resource_obj.browse(int(event['resource'])), 'products': {} } hour_end_dt = hour_dt+timedelta(hours=MIN_TIMESLOT_HOURS) duration = seconds(hour_end_dt - hour_dt)/3600 for product in products: hours = product.calendar_id.get_working_accurate_hours(hour_dt, hour_end_dt) if hours == duration: bookings[r][hour]['products'][str(product.id)] = { 'id': product.id, 'name': product.name, 'price': product.lst_price or product.price, 'currency': product.company_id.currency_id.name } #join adjacent hour intervals to one SO position for h in bookings[r]: if h == hour or bookings[r][h]['products'].keys() != bookings[r][hour]['products'].keys(): continue adjacent = False if bookings[r][hour]['start'] == bookings[r][h]['end']: adjacent = True bookings[r][h].update({ 'end': bookings[r][hour]['end'], 'end_f': bookings[r][hour]['end_f'] }) elif bookings[r][hour]['end'] == bookings[r][h]['start']: adjacent = True bookings[r][h].update({ 'start': bookings[r][hour]['end'], 'start_f': bookings[r][hour]['start_f'] }) if adjacent: for id, p in bookings[r][h]['products'].iteritems(): bookings[r][h]['products'][id]['price'] += bookings[r][hour]['products'][id]['price'] del bookings[r][hour] break hour_dt += timedelta(hours=MIN_TIMESLOT_HOURS) res = [] for r in bookings.values(): res += r.values() return res class sale_order(models.Model): _inherit = 'sale.order' @api.multi def _add_booking_line(self, product_id, resource, start, end): set_qty = 1 for rec in self: if start and end: user_tz = pytz.timezone(rec.env.context.get('tz', 'UTC')) start = user_tz.localize(fields.Datetime.from_string(start)).astimezone(pytz.utc) end = user_tz.localize(fields.Datetime.from_string(end)).astimezone(pytz.utc) set_qty = (end - start).seconds/3600 values = self.sudo()._website_product_id_change(rec.id, product_id, qty=set_qty) values.update({ 'product_uom_qty': set_qty, 'resource_id': int(resource), 'booking_start': start, 'booking_end': end, }) line = rec.env['sale.order.line'].sudo().create(values) return line
lgpl-3.0
eniram/homePC
node_modules/grunt-contrib-uglify/node_modules/gzip-js/test/zipTest.py
182
1836
import os from helpers import run_cmd from colorama import Fore defaultTestDir = 'test-files' defaultOutDir = 'test-outs' """ Run a single test @param tFile- required; the full path to the file to run @param level- optional (default: all); the compression level [1-9] @return True if all tests passed; False if at least one test failed """ def runTest(tFile, level=None, outDir=defaultOutDir): passed = True if level == None: for x in range(1, 10): if runTest(tFile, x, outDir) == False: passed = False return passed out1 = os.path.join(outDir, '%(file)s.%(level)d.gz' % {'file': os.path.basename(tFile), 'level' : level}) out2 = os.path.join(outDir, '%(file)s.%(level)d.out.gz' % {'file': os.path.basename(tFile), 'level' : level}) run_cmd('gzip -c -%(level)d %(file)s > %(outfile)s' % {'level' : level, 'file' : tFile, 'outfile' : out1}) run_cmd('../bin/gzip.js --level %(level)d --file %(file)s --output %(output)s' % {'level' : level, 'file' : tFile, 'output' : out2}) result = run_cmd('diff %(file1)s %(file2)s' % {'file1' : out1, 'file2' : out2}) if result['returncode'] == 0: status = Fore.GREEN + 'PASSED' + Fore.RESET else: passed = False status = Fore.RED + 'FAILED' + Fore.RESET print 'Level %(level)d: %(status)s' % {'level' : level, 'status' : status} return passed """ Runs all tests on the given level. This iterates throuth the testDir directory defined above. @param level- The level to run on [1-9] (default: None, runs on all levels all) @return True if all levels passed, False if at least one failed """ def runAll(level=None, testDir=defaultTestDir): passed = True for tFile in os.listdir(testDir): fullPath = os.path.join(testDir, tFile) print Fore.YELLOW + tFile + Fore.RESET if runTest(fullPath, level) == False: passed = False print '' return passed
gpl-2.0
ropik/chromium
native_client_sdk/src/build_tools/sdk_tools/sdk_update.py
5
23815
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''A simple tool to update the Native Client SDK to the latest version''' import cStringIO import cygtar import errno import exceptions import hashlib import json import manifest_util import optparse import os import shutil import subprocess import sys import tempfile from third_party import fancy_urllib import time import urllib2 import urlparse #------------------------------------------------------------------------------ # Constants # Bump the MINOR_REV every time you check this file in. MAJOR_REV = 2 MINOR_REV = 17 GLOBAL_HELP = '''Usage: naclsdk [options] command [command_options] naclsdk is a simple utility that updates the Native Client (NaCl) Software Developer's Kit (SDK). Each component is kept as a 'bundle' that this utility can download as as subdirectory into the SDK. Commands: help [command] - Get either general or command-specific help list - Lists the available bundles update/install - Updates/installs bundles in the SDK sources - Manage external package sources Example Usage: naclsdk list naclsdk update --force pepper_17 naclsdk install recommended naclsdk help update naclsdk sources --list''' CONFIG_FILENAME='naclsdk_config.json' MANIFEST_FILENAME='naclsdk_manifest2.json' SDK_TOOLS='sdk_tools' # the name for this tools directory USER_DATA_DIR='sdk_cache' HTTP_CONTENT_LENGTH = 'Content-Length' # HTTP Header field for content length #------------------------------------------------------------------------------ # General Utilities _debug_mode = False _quiet_mode = False def DebugPrint(msg): '''Display a message to stderr if debug printing is enabled Note: This function appends a newline to the end of the string Args: msg: A string to send to stderr in debug mode''' if _debug_mode: sys.stderr.write("%s\n" % msg) sys.stderr.flush() def InfoPrint(msg): '''Display an informational message to stdout if not in quiet mode Note: This function appends a newline to the end of the string Args: mgs: A string to send to stdio when not in quiet mode''' if not _quiet_mode: sys.stdout.write("%s\n" % msg) sys.stdout.flush() def WarningPrint(msg): '''Display an informational message to stderr. Note: This function appends a newline to the end of the string Args: mgs: A string to send to stderr.''' sys.stderr.write("WARNING: %s\n" % msg) sys.stderr.flush() class Error(Exception): '''Generic error/exception for sdk_update module''' pass def UrlOpen(url): request = fancy_urllib.FancyRequest(url) ca_certs = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'cacerts.txt') request.set_ssl_info(ca_certs=ca_certs) url_opener = urllib2.build_opener( fancy_urllib.FancyProxyHandler(), fancy_urllib.FancyRedirectHandler(), fancy_urllib.FancyHTTPSHandler()) return url_opener.open(request) def ExtractInstaller(installer, outdir): '''Extract the SDK installer into a given directory If the outdir already exists, then this function deletes it Args: installer: full path of the SDK installer outdir: output directory where to extract the installer Raises: CalledProcessError - if the extract operation fails''' RemoveDir(outdir) if os.path.splitext(installer)[1] == '.exe': # If the installer has extension 'exe', assume it's a Windows NSIS-style # installer that handles silent (/S) and relocated (/D) installs. command = [installer, '/S', '/D=%s' % outdir] subprocess.check_call(command) else: os.mkdir(outdir) tar_file = None curpath = os.getcwd() try: tar_file = cygtar.CygTar(installer, 'r', verbose=True) if outdir: os.chdir(outdir) tar_file.Extract() finally: if tar_file: tar_file.Close() os.chdir(curpath) def RemoveDir(outdir): '''Removes the given directory On Unix systems, this just runs shutil.rmtree, but on Windows, this doesn't work when the directory contains junctions (as does our SDK installer). Therefore, on Windows, it runs rmdir /S /Q as a shell command. This always does the right thing on Windows. If the directory already didn't exist, RemoveDir will return successfully without taking any action. Args: outdir: The directory to delete Raises: CalledProcessError - if the delete operation fails on Windows OSError - if the delete operation fails on Linux ''' DebugPrint('Removing %s' % outdir) try: shutil.rmtree(outdir) except: if not os.path.exists(outdir): return # On Windows this could be an issue with junctions, so try again with rmdir if sys.platform == 'win32': subprocess.check_call(['rmdir', '/S', '/Q', outdir], shell=True) def RenameDir(srcdir, destdir): '''Renames srcdir to destdir. Removes destdir before doing the rename if it already exists.''' max_tries = 5 for num_tries in xrange(max_tries): try: RemoveDir(destdir) os.rename(srcdir, destdir) return except OSError as err: if err.errno != errno.EACCES: raise err # If we are here, we didn't exit due to raised exception, so we are # handling a Windows flaky access error. Sleep one second and try # again. time.sleep(num_tries + 1) # end of while loop -- could not RenameDir raise Error('Could not RenameDir %s => %s after %d tries.\n' % 'Please check that no shells or applications ' 'are accessing files in %s.' % (srcdir, destdir, num_tries, destdir)) class ProgressFunction(object): '''Create a progress function for a file with a given size''' def __init__(self, file_size=0): '''Constructor Args: file_size: number of bytes in file. 0 indicates unknown''' self.dots = 0 self.file_size = int(file_size) def GetProgressFunction(self): '''Returns a progress function based on a known file size''' def ShowKnownProgress(progress): if progress == 0: sys.stdout.write('|%s|\n' % ('=' * 48)) else: new_dots = progress * 50 / self.file_size - self.dots sys.stdout.write('.' * new_dots) self.dots += new_dots if progress == self.file_size: sys.stdout.write('\n') sys.stdout.flush() return ShowKnownProgress def DownloadArchiveToFile(archive, dest_path): '''Download the archive's data to a file at dest_path. As a side effect, computes the sha1 hash and data size, both returned as a tuple. Raises an Error if the url can't be opened, or an IOError exception if dest_path can't be opened. Args: dest_path: Path for the file that will receive the data. Return: A tuple (sha1, size) with the sha1 hash and data size respectively.''' sha1 = None size = 0 with open(dest_path, 'wb') as to_stream: from_stream = None try: from_stream = UrlOpen(archive.url) except urllib2.URLError: raise Error('Cannot open "%s" for archive %s' % (archive.url, archive.host_os)) try: content_length = int(from_stream.info()[HTTP_CONTENT_LENGTH]) progress_function = ProgressFunction(content_length).GetProgressFunction() InfoPrint('Downloading %s' % archive.url) sha1, size = manifest_util.DownloadAndComputeHash( from_stream, to_stream=to_stream, progress_func=progress_function) if size != content_length: raise Error('Download size mismatch for %s.\n' 'Expected %s bytes but got %s' % (archive.url, content_length, size)) finally: if from_stream: from_stream.close() return sha1, size def LoadFromFile(path, obj): '''Returns a manifest loaded from the JSON file at |path|. If the path does not exist or is invalid, returns unmodified object.''' methodlist = [m for m in dir(obj) if callable(getattr(obj, m))] if 'LoadDataFromString' not in methodlist: return obj if not os.path.exists(path): return obj with open(path, 'r') as f: json_string = f.read() if not json_string: return obj obj.LoadDataFromString(json_string) return obj def LoadManifestFromURLs(urls): '''Returns a manifest loaded from |urls|, merged into one manifest.''' manifest = manifest_util.SDKManifest() for url in urls: try: url_stream = UrlOpen(url) except urllib2.URLError as e: raise Error('Unable to open %s. [%s]' % (url, e)) manifest_stream = cStringIO.StringIO() sha1, size = manifest_util.DownloadAndComputeHash(url_stream, manifest_stream) temp_manifest = manifest_util.SDKManifest() temp_manifest.LoadDataFromString(manifest_stream.getvalue()) manifest.MergeManifest(temp_manifest) def BundleFilter(bundle): # Only add this bundle if it's supported on this platform. return bundle.GetHostOSArchive() manifest.FilterBundles(BundleFilter) return manifest def WriteToFile(path, obj): '''Write |manifest| to a JSON file at |path|.''' methodlist = [m for m in dir(obj) if callable(getattr(obj, m))] if 'GetDataAsString' not in methodlist: raise Error('Unable to write object to file') json_string = obj.GetDataAsString() # Write the JSON data to a temp file. temp_file_name = None # TODO(dspringer): Use file locks here so that multiple sdk_updates can # run at the same time. with tempfile.NamedTemporaryFile(mode='w', delete=False) as f: f.write(json_string) temp_file_name = f.name # Move the temp file to the actual file. if os.path.exists(path): os.remove(path) shutil.move(temp_file_name, path) class SDKConfig(object): '''This class contains utilities for manipulating an SDK config ''' def __init__(self): '''Create a new SDKConfig object with default contents''' self._data = { 'sources': [], } def AddSource(self, string): '''Add a source file to load packages from. Args: string: a URL to an external package manifest file.''' # For now whitelist only the following location for external sources: # https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk (scheme, host, path, _, _, _) = urlparse.urlparse(string) if (host != 'commondatastorage.googleapis.com' or scheme != 'https' or not path.startswith('/nativeclient-mirror/nacl/nacl_sdk')): WarningPrint('Only whitelisted sources from ' '\'https://commondatastorage.googleapis.com/nativeclient-' 'mirror/nacl/nacl_sdk\' are currently allowed.') return if string in self._data['sources']: WarningPrint('source \''+string+'\' already exists in config.') return try: url_stream = UrlOpen(string) except urllib2.URLError: WarningPrint('Unable to fetch manifest URL \'%s\'. Exiting...' % string) return self._data['sources'].append(string) InfoPrint('source \''+string+'\' added to config.') def RemoveSource(self, string): '''Remove a source file to load packages from. Args: string: a URL to an external SDK manifest file.''' if string not in self._data['sources']: WarningPrint('source \''+string+'\' doesn\'t exist in config.') else: self._data['sources'].remove(string) InfoPrint('source \''+string+'\' removed from config.') def RemoveAllSources(self): if len(self.GetSources()) == 0: InfoPrint('There are no external sources to remove.') # Copy the list because RemoveSource modifies the underlying list sources = list(self.GetSources()) for source in sources: self.RemoveSource(source) def ListSources(self): '''List all external sources in config.''' if len(self._data['sources']): InfoPrint('Installed sources:') for s in self._data['sources']: InfoPrint(' '+s) else: InfoPrint('No external sources installed') def GetSources(self): '''Return a list of external sources''' return self._data['sources'] def LoadDataFromString(self, string): ''' Load a JSON config string. Raises an exception if string is not well-formed JSON. Args: string: a JSON-formatted string containing the previous config''' self._data = json.loads(string) def GetDataAsString(self): '''Returns the current JSON manifest object, pretty-printed''' pretty_string = json.dumps(self._data, sort_keys=False, indent=2) # json.dumps sometimes returns trailing whitespace and does not put # a newline at the end. This code fixes these problems. pretty_lines = pretty_string.split('\n') return '\n'.join([line.rstrip() for line in pretty_lines]) + '\n' #------------------------------------------------------------------------------ # Commands def List(options, argv, config): '''Usage: %prog [options] list Lists the available SDK bundles that are available for download.''' def PrintBundles(bundles): for bundle in bundles: InfoPrint(' %s' % bundle.name) for key, value in bundle.iteritems(): if key not in (manifest_util.ARCHIVES_KEY, manifest_util.NAME_KEY): InfoPrint(' %s: %s' % (key, value)) DebugPrint("Running List command with: %s, %s" %(options, argv)) parser = optparse.OptionParser(usage=List.__doc__) (list_options, args) = parser.parse_args(argv) manifest = LoadManifestFromURLs([options.manifest_url] + config.GetSources()) InfoPrint('Available bundles:') PrintBundles(manifest.GetBundles()) # Print the local information. manifest_path = os.path.join(options.user_data_dir, options.manifest_filename) local_manifest = LoadFromFile(manifest_path, manifest_util.SDKManifest()) InfoPrint('\nCurrently installed bundles:') PrintBundles(local_manifest.GetBundles()) def Update(options, argv, config): '''Usage: %prog [options] update [target] Updates the Native Client SDK to a specified version. By default, this command updates all the recommended components. The update process works like this: 1. Fetch the manifest from the mirror. 2. Load manifest from USER_DATA_DIR - if there is no local manifest file, make an empty manifest object. 3. Update each the bundle: for bundle in bundles: # Compare bundle versions & revisions. # Test if local version.revision < mirror OR local doesn't exist. if local_manifest < mirror_manifest: update(bundle) update local_manifest with mirror_manifest for bundle write manifest to disk. Use locks. else: InfoPrint('bundle is up-to-date') Targets: recommended: (default) Install/Update all recommended components all: Install/Update all available components bundle_name: Install/Update only the given bundle ''' DebugPrint("Running Update command with: %s, %s" % (options, argv)) ALL='all' # Update all bundles RECOMMENDED='recommended' # Only update the bundles with recommended=yes parser = optparse.OptionParser(usage=Update.__doc__) parser.add_option( '-F', '--force', dest='force', default=False, action='store_true', help='Force updating existing components that already exist') (update_options, args) = parser.parse_args(argv) if len(args) == 0: args = [RECOMMENDED] manifest = LoadManifestFromURLs([options.manifest_url] + config.GetSources()) bundles = manifest.GetBundles() local_manifest_path = os.path.join(options.user_data_dir, options.manifest_filename) local_manifest = LoadFromFile(local_manifest_path, manifest_util.SDKManifest()) # Validate the arg list against the available bundle names. Raises an # error if any invalid bundle names or args are detected. valid_args = set([ALL, RECOMMENDED] + [bundle.name for bundle in bundles]) bad_args = set(args) - valid_args if len(bad_args) > 0: raise Error("Unrecognized bundle name or argument: '%s'" % ', '.join(bad_args)) for bundle in bundles: bundle_path = os.path.join(options.sdk_root_dir, bundle.name) bundle_update_path = '%s_update' % bundle_path if not (bundle.name in args or ALL in args or (RECOMMENDED in args and bundle[RECOMMENDED] == 'yes')): continue def UpdateBundle(): '''Helper to install a bundle''' archive = bundle.GetHostOSArchive() (scheme, host, path, _, _, _) = urlparse.urlparse(archive['url']) dest_filename = os.path.join(options.user_data_dir, path.split('/')[-1]) sha1, size = DownloadArchiveToFile(archive, dest_filename) if sha1 != archive.GetChecksum(): raise Error("SHA1 checksum mismatch on '%s'. Expected %s but got %s" % (bundle.name, archive.GetChecksum(), sha1)) if size != archive.size: raise Error("Size mismatch on Archive. Expected %s but got %s bytes" % (archive.size, size)) InfoPrint('Updating bundle %s to version %s, revision %s' % ( (bundle.name, bundle.version, bundle.revision))) ExtractInstaller(dest_filename, bundle_update_path) if bundle.name != SDK_TOOLS: repath = bundle.get('repath', None) if repath: bundle_move_path = os.path.join(bundle_update_path, repath) else: bundle_move_path = bundle_update_path RenameDir(bundle_move_path, bundle_path) if os.path.exists(bundle_update_path): RemoveDir(bundle_update_path) os.remove(dest_filename) local_manifest.MergeBundle(bundle) WriteToFile(local_manifest_path, local_manifest) # Test revision numbers, update the bundle accordingly. # TODO(dspringer): The local file should be refreshed from disk each # iteration thought this loop so that multiple sdk_updates can run at the # same time. if local_manifest.BundleNeedsUpdate(bundle): if (not update_options.force and os.path.exists(bundle_path) and bundle.name != SDK_TOOLS): WarningPrint('%s already exists, but has an update available.\n' 'Run update with the --force option to overwrite the ' 'existing directory.\nWarning: This will overwrite any ' 'modifications you have made within this directory.' % bundle.name) else: UpdateBundle() else: InfoPrint('%s is already up-to-date.' % bundle.name) def Sources(options, argv, config): '''Usage: %prog [options] sources [--list,--add URL,--remove URL] Manage additional package sources. URL should point to a valid package manifest file for download. ''' DebugPrint("Running Sources command with: %s, %s" % (options, argv)) parser = optparse.OptionParser(usage=Sources.__doc__) parser.add_option( '-a', '--add', dest='url_to_add', default=None, help='Add additional package source') parser.add_option( '-r', '--remove', dest='url_to_remove', default=None, help='Remove package source (use \'all\' for all additional sources)') parser.add_option( '-l', '--list', dest='do_list', default=False, action='store_true', help='List additional package sources') (source_options, args) = parser.parse_args(argv) write_config = False if source_options.url_to_add: config.AddSource(source_options.url_to_add) write_config = True elif source_options.url_to_remove: if source_options.url_to_remove == 'all': config.RemoveAllSources() else: config.RemoveSource(source_options.url_to_remove) write_config = True elif source_options.do_list: config.ListSources() else: parser.print_help() if write_config: WriteToFile(os.path.join(options.user_data_dir, options.config_filename), config) #------------------------------------------------------------------------------ # Command-line interface def main(argv): '''Main entry for the sdk_update utility''' parser = optparse.OptionParser(usage=GLOBAL_HELP) DEFAULT_SDK_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) parser.add_option( '-U', '--manifest-url', dest='manifest_url', default='https://commondatastorage.googleapis.com/nativeclient-mirror/' 'nacl/nacl_sdk/%s' % MANIFEST_FILENAME, help='override the default URL for the NaCl manifest file') parser.add_option( '-d', '--debug', dest='debug', default=False, action='store_true', help='enable displaying debug information to stderr') parser.add_option( '-q', '--quiet', dest='quiet', default=False, action='store_true', help='suppress displaying informational prints to stdout') parser.add_option( '-u', '--user-data-dir', dest='user_data_dir', # TODO(mball): the default should probably be in something like # ~/.naclsdk (linux), or ~/Library/Application Support/NaClSDK (mac), # or %HOMEPATH%\Application Data\NaClSDK (i.e., %APPDATA% on windows) default=os.path.join(DEFAULT_SDK_ROOT, USER_DATA_DIR), help="specify location of NaCl SDK's data directory") parser.add_option( '-s', '--sdk-root-dir', dest='sdk_root_dir', default=DEFAULT_SDK_ROOT, help="location where the SDK bundles are installed") parser.add_option( '-v', '--version', dest='show_version', action='store_true', help='show version information and exit') parser.add_option( '-m', '--manifest', dest='manifest_filename', default=MANIFEST_FILENAME, help="name of local manifest file relative to user-data-dir") parser.add_option( '-c', '--config', dest='config_filename', default=CONFIG_FILENAME, help="name of the local config file relative to user-data-dir") COMMANDS = { 'list': List, 'update': Update, 'install': Update, 'sources': Sources, } # Separate global options from command-specific options global_argv = argv command_argv = [] for index, arg in enumerate(argv): if arg in COMMANDS: global_argv = argv[:index] command_argv = argv[index:] break (options, args) = parser.parse_args(global_argv) args += command_argv global _debug_mode, _quiet_mode _debug_mode = options.debug _quiet_mode = options.quiet def PrintHelpAndExit(unused_options=None, unused_args=None): parser.print_help() exit(1) if options.show_version: print "Native Client SDK Updater, version %s.%s" % (MAJOR_REV, MINOR_REV) exit(0) if not args: print "Need to supply a command" PrintHelpAndExit() def DefaultHandler(unused_options=None, unused_args=None): print "Unknown Command: %s" % args[0] PrintHelpAndExit() def InvokeCommand(args): command = COMMANDS.get(args[0], DefaultHandler) # Load the config file before running commands config = LoadFromFile(os.path.join(options.user_data_dir, options.config_filename), SDKConfig()) command(options, args[1:], config) if args[0] == 'help': if len(args) == 1: PrintHelpAndExit() else: InvokeCommand([args[1], '-h']) else: # Make sure the user_data_dir exists. if not os.path.exists(options.user_data_dir): os.makedirs(options.user_data_dir) InvokeCommand(args) return 0 # Success if __name__ == '__main__': try: sys.exit(main(sys.argv[1:])) except Error as error: print "Error: %s" % error sys.exit(1)
bsd-3-clause
YggdrasiI/PBStats
PBs/Python/v5/Webserver.py
2
54675
from CvPythonExtensions import * import CvUtil import CvEventInterface # For WB Saves # import StringIO import cStringIO import CvWBDesc # import CvWBInterface # import zlib # not included # import gzip # exists in Civ4/Assets/Python/System, but can not be imported from SocketServer import ThreadingMixIn from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer import re import cgi import os.path # import os.listdir import os import glob import time import thread from threading import Timer, Thread, Event import urllib # import hashlib # Python 2.4 has no hashlib use md5 import md5 import simplejson import sys PB = CyPitboss() gc = CyGlobalContext() localText = CyTranslator() # Default settings. Does not work for multiple PB instances due port collision. pbDefaultSettings = { "webserver": { "host": "", # Leave string empty # Port of the python web interface of this mod. Use different port for # each game "port": 13373, # Password for admin commands on the webinterface "password": "defaultpassword" }, "webfrontend": { # Url of the pbStats file on your http webserver "url": "http://localhost/civ/page/update.php", "gameId": 0, # Id of game at above website # Set 0 to disable periodical sending of game data "sendPeriodicalData": 1, "sendInterval": 10, # Seconds during automatic sending of game data }, "save": { # Filename (without path) of loaded game at startup (require autostart) "filename": "A.CivBeyondSwordSave", "adminpw": "", # Admin password of above save "savefolder": "saves\\multi\\", # First choice to save games. # List of relative paths which can be used to load games. "readfolders": [] }, "shortnames": { # Truncate names to fix login issue due packet drop "enable": True, # Maximal Leader name length. Length of 1 force replacement with player # Id, 0=A,1=B,...,51=z "maxLenName": 1, # Maximal Nation name length. Length of 1 force replacement with player # Id, 0=A,1=B,...,51=z "maxLenDesc": 4 }, # Each login and logoff produce a save. This option controls the length of # history "numRecoverySavesPerPlayer": 5, "MotD": "Welcome on the modified PitBoss Server", "noGui": 0, # Do not show admin window. (This option force the autostart.) "autostart": 0, # Load savegame at startup "errorLogFile": None } pbSettings = None # Try to load pbSettings file. # To get a different settings file for each pitboss we need # access to a variable in the ini file # We reuse a widely unused variable of the standard BTS ini file altrootDir = gc.getAltrootDir() # Cut of badly formated beginning of String [...]@ (If EMail Ini variable used) # altrootDir = altrootDir[altrootDir.rfind("@")+1:len(altrootDir)] # If the loading of the setting file failed the path will be set no None # in getPbSettings() pbFn = os.path.join(altrootDir, "pbSettings.json") def getPbSettings(): """Loads settings file and use default settings as fallback.""" global altrootDir global pbFn global pbSettings global pbDefaultSettings if pbSettings is not None: return pbSettings if os.path.isfile(pbFn): fp = file(pbFn, "r") pbSettings = simplejson.load(fp) fp.close() return pbSettings elif altrootDir != "": pbSettings = pbDefaultSettings savePbSettings() return pbSettings else: pbSettings = pbDefaultSettings pbFn = None return pbDefaultSettings def getPbPasswords(): """Loads list of alternative passwords for your games. pbSettings['save']['adminpw'] and this list will be tested as valid values before the game try to load the save. """ global altrootDir pwdFile = os.path.join(altrootDir, "..", "pbPasswords.json") if os.path.isfile(pwdFile): try: fp = file(pwdFile, "r") pbPasswords = simplejson.load(fp) finally: fp.close() return pbPasswords.get("adminPasswords", []) else: return [] def savePbSettings(): """ Save the current state into pbSettings.json. Attention: Use the ThreadedHTTPServer.savePbSettings to wrap this into a mutex if you saved the file over the webinterface. This function should only be called directly if the webserver wasn't started. """ global pbFn global pbSettings if pbFn is None: return try: fp = file(pbFn, "w") # Note that it's ness. to use the old syntax (integer value) for indent # argument! simplejson.dump(pbSettings, fp, indent=1) except Exception, e: pass def getPossibleSaveFolders(): """Use two default values and the value(s) from the setting file to generate possible source paths of saves. The return value dos not contain duplicates. There are two reasons why this was constructed by hand: A hashmap construction would destroy the ordering and OrderedDict requires at least Python 2.7. """ global altrootDir if "save" not in pbSettings: pbSettings["save"] = {} # Note: "path" is the deprecated name of "savefolder" userPath = str( pbSettings["save"].get( "savefolder", pbSettings["save"].get( "path", "saves\\multi\\"))) folders = [ altrootDir + "\\" + userPath, altrootDir + "\\" + userPath + "auto\\", altrootDir + "\\" + "saves\\multi\\", altrootDir + "\\" + "saves\\multi\\auto\\", altrootDir + "\\" + "saves\\pitboss\\", altrootDir + "\\" + "saves\\pitboss\\auto\\" ] # Add extra folders for extraUserPath in pbSettings["save"].get("readfolders", []): folders.append(altrootDir + "\\" + str(extraUserPath)) folders.append(altrootDir + "\\" + str(extraUserPath) + "auto\\") def remove_duplicates(li): my_set = set() res = [] for e in li: if e not in my_set: res.append((e, len(res))) my_set.add(e) return res return remove_duplicates(folders) class HTTPRequestHandler(BaseHTTPRequestHandler): """The do_POST method of this class handle the control commands of the webinterface """ def log_message(self, format, *args): "Redefine is ness. to omit python error popups!!" return def do_POST(self): if None != re.search('/api/v1/', self.path): ctype, pdict = cgi.parse_header( self.headers.getheader('content-type')) # ctype = self.headers.getheader('content-type').strip(" \n\r\t") if ctype == 'application/json': self.send_response(200) self.end_headers() try: length = int(self.headers.getheader('content-length')) rawdata = self.rfile.read(length) parseddata = cgi.parse_qs(rawdata, keep_blank_values=1) inputdata = simplejson.loads(parseddata.keys()[0]) """ parseddata = rawdata.split("&") inputdata = simplejson.loads( parseddata[0] ) """ action = inputdata.get("action") if(action == "chat" and inputdata.get("password") == pbSettings["webserver"]["password"]): try: msg = str( inputdata.get( "msg", "Default message. Missing msg argument?!")) msg = msg.replace('&', '&amp;') msg = msg.replace('<', '&lt;') msg = msg.replace('>', '&gt;') PB.sendChat(msg) self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Send: ' + msg}) + "\n") except: self.wfile.write( simplejson.dumps( { 'return': 'fail', 'info': 'Some error occured trying to send the message. Probably a character that cannot be encoded.'}) + "\n") elif(action == "setAutostart" and inputdata.get("password") == pbSettings["webserver"]["password"]): self.server.lock.acquire() pbSettings["autostart"] = int( inputdata.get( "value", 0)) self.server.lock.release() self.server.savePbSettings() self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Autostart flag: ' + str(pbSettings["autostart"])}) + "\n") elif(action == "setHeadless" and inputdata.get("password") == pbSettings["webserver"]["password"]): self.server.lock.acquire() pbSettings["noGui"] = int(inputdata.get("value", 0)) self.server.lock.release() self.server.savePbSettings() self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Headless/noGui flag: ' + str(pbSettings["noGui"])}) + "\n") elif(action == "save" and inputdata.get("password") == pbSettings["webserver"]["password"]): defaultFile = "Pitboss_" + PB.getGamedate(True) filename = str( inputdata.get( "filename", defaultFile)) + ".CivBeyondSwordSave" # remove "\ or /" chars to cut of directory changes filename = filename[ max(filename.rfind("/"), filename.rfind("\\")) + 1: len(filename)] ret = self.server.createSave(filename) self.wfile.write(simplejson.dumps(ret) + "\n") elif(action == "setTurnTimer" and inputdata.get("password") == pbSettings["webserver"]["password"]): iHours = int(inputdata.get("value", 24)) PB.turnTimerChanged(iHours) self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Set turn timer on ' + str(iHours) + ' hours.'}) + "\n") elif(action == "setCurrentTurnTimer" and inputdata.get("password") == pbSettings["webserver"]["password"]): iSeconds = int(inputdata.get("seconds", 0)) iMinutes = int(inputdata.get("minutes", 0)) iHours = int(inputdata.get("hours", 0)) iSeconds = iSeconds + 60*iMinutes + 3600*iHours if iSeconds < 60: iSeconds = 60 gc.getGame().incrementTurnTimer(-PB.getTurnTimeLeft() + 4 * iSeconds) self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Set timer for current round.'}) + "\n") elif(action == "setPause" and inputdata.get("password") == pbSettings["webserver"]["password"]): bPause = int(inputdata.get("value", 0)) if bPause: if not gc.getGame().isPaused(): PB.sendChat("(Webinterface) Activate pause.") #gc.getGame().setPausePlayer(gc.getMAX_PLAYERS()-1) gc.sendPause(0) # Note that babarian player index would # be nice, but leads to an error... just use index 0... #gc.sendPause(gc.getMAX_CIV_PLAYERS()-1) self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Activate pause.'}) + "\n") else: if gc.getGame().isPaused(): PB.sendChat("(Webinterface) Deactivate pause.") # This removes the pause only locally. gc.getGame().setPausePlayer(-1) # This crashs on Linux/Wine # gc.sendPause(-1) # Workaround sends chat message gc.sendChat("RemovePause", ChatTargetTypes.CHATTARGET_ALL) self.wfile.write( simplejson.dumps({'return': 'ok', 'info': 'Deactivate pause.'}) + "\n") elif(action == "endTurn" and inputdata.get("password") == pbSettings["webserver"]["password"]): # Create Backup save in auto-Folder filename = r"Auto_" + \ PB.getGamename() + r"_R" + str(PB.getGameturn()) + r"end_" + PB.getGamedate(False) + r".CivBeyondSwordSave" self.server.createSave(str(filename), 1) if(PB.getTurnTimer()): gc.getGame().incrementTurnTimer(-PB.getTurnTimeLeft() + 4 * 20) msg = 'Set timer on a few seconds.' else: # This variant made trouble with automated units # and KI?! messageControl = CyMessageControl() messageControl.sendTurnCompleteAll() msg = 'End turn' self.wfile.write( simplejson.dumps({'return': 'ok', 'info': msg}) + "\n") elif(action == "restart" and inputdata.get("password") == pbSettings["webserver"]["password"]): # Save current game and reload this save if no expicit # filename is given bReload = True filename = str(inputdata.get("filename", "")) folderIndex = int(inputdata.get("folderIndex", 0)) # remove "\ or /" chars to cut of directory changes filename = filename[ max(filename.rfind("/"), filename.rfind("\\")) + 1: len(filename)] # Use first folder if no filename is given if len(filename) == 0: folderIndex = 0 if len(filename) > 0: # Save selected filename for reloading in the # settings file filename = filename + ".CivBeyondSwordSave" filename = filename.replace( "CivBeyondSwordSave.CivBeyondSwordSave", "CivBeyondSwordSave") # Now, checks if file can be found. Otherwise abort because # loading of missing files let crash the pb server # and grab 100% of cpu. folderpaths = getPossibleSaveFolders() try: folderpaths.insert(0, folderpaths[folderIndex]) except IndexError: pass folderIndexFound = -1 for fp in folderpaths: tmpFilePath = os.path.join(fp[0], filename) if os.path.isfile(tmpFilePath): folderIndexFound = fp[1] break if folderIndexFound == -1: # No save game with this filename found. Abort # reloading bReload = False self.wfile.write( simplejson.dumps( { 'return': 'fail', 'info': 'Reloading failed. Can not detect path of save "' + filename + '".'}) + "\n") else: self.server.lock.acquire() pbSettings["save"]["filename"] = filename pbSettings["save"][ "folderIndex"] = folderIndexFound pbSettings["save"]["oneOffAutostart"] = 1 self.server.lock.release() self.server.savePbSettings() else: self.server.lock.acquire() pbSettings["save"]["oneOffAutostart"] = 1 self.server.lock.release() filename = "Reload.CivBeyondSwordSave" ret = self.server.createSave(filename) if ret["return"] != "ok": bReload = False self.wfile.write(simplejson.dumps( {'return': 'fail', 'info': 'Reloading failed. Was not able to save game.'}) + "\n") if bReload: # Quit server. The loop in the batch file should # restart the server.... if self.server.adminWindow is not None: self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Set loaded file on "' + filename + '" and quit PB server window.'}) + "\n") self.server.adminWindow.OnExit(None) else: self.wfile.write( simplejson.dumps( { 'return': 'fail', 'info': 'Reloading failed. Was not able to quit PB server window.'}) + "\n") elif(action == "setPlayerPassword" and inputdata.get("password") == pbSettings["webserver"]["password"]): playerId = int(inputdata.get("playerId", -1)) newCivPW = str(inputdata.get("newCivPW", r"")) ret = -1 if playerId > -1: # Well, the hashing should be done in the DLL, but I forgot this call # and will not change the DLL in this version of the mod. # TODO: Move this line into the DLL for newer # versions of the mod. adminPW = str( pbSettings.get( "save", {}).get( "adminpw", "")) if len(adminPW) > 0: adminPWHash = md5.new(adminPW).hexdigest() else: adminPWHash = "" ret = gc.getGame().setCivPassword( playerId, newCivPW, adminPWHash) if ret == 0: self.wfile.write(simplejson.dumps( {'return': 'ok', 'info': 'Passwort of player ' + str(playerId) + ' changed to "' + newCivPW + '"'}) + "\n") else: self.wfile.write( simplejson.dumps( {'return': 'fail', 'info': 'Passwort change failed.'}) + "\n") elif(action == "kickPlayer" and inputdata.get("password") == pbSettings["webserver"]["password"]): playerId = int(inputdata.get("playerId", -1)) if playerId > -1: PB.kick(playerId) self.wfile.write(simplejson.dumps( {'return': 'ok', 'info': 'Player ' + str(playerId) + ' was kicked."'}) + "\n") else: self.wfile.write( simplejson.dumps( {'return': 'fail', 'info': 'Wrong player id for kicking.'}) + "\n") elif(action == "setPlayerColor" and inputdata.get("password") == pbSettings["webserver"]["password"]): playerId = int(inputdata.get("playerId", -1)) colorId = int(inputdata.get("colorId", -1)) ret = -1 if playerId > -1 and colorId > -1: gc.getPlayer(playerId).setPlayerColor(colorId) self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Player color of player ' + str(playerId) + ' changed to "' + str(colorId) + '"'}) + "\n") else: self.wfile.write( simplejson.dumps( {'return': 'fail', 'info': 'Player color change failed.'}) + "\n") elif(action == "getMotD" and inputdata.get("password") == pbSettings["webserver"]["password"]): try: motd = "" if self.server.adminApp is not None: motd = self.server.adminApp.getMotD() self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Return MotD.', 'msg': motd}) + "\n") except Exception, e: self.wfile.write( simplejson.dumps( { 'return': 'fail', 'info': 'Some error occured trying to get the MotD. Error msg:' + str(e)}) + "\n") elif(action == "getWBSave" and inputdata.get("password") == pbSettings["webserver"]["password"] and pbSettings["webserver"].get("allowWB", False)): bCache = (inputdata.get("noCache", "0") == "0") bCompress = (inputdata.get("compress", "0") == "1") ret = self.server.createWBSave(bCache, bCompress) self.wfile.write(simplejson.dumps(ret) + "\n") elif(action == "getReplay" and pbSettings["webserver"].get("allowReplay", False)): try: replayInfo = gc.getGame().getReplayInfo() if replayInfo.isNone(): replayInfo = CyReplayInfo() # (gc.getGame().getActivePlayer()) replayInfo.createInfo(-1) iTurn = replayInfo.getInitialTurn() i = 0 replayMessages = [] while (i < replayInfo.getNumReplayMessages()): iPlayer = replayInfo.getReplayMessagePlayer(i) iTurn = replayInfo.getReplayMessageTurn(i) eMessageType = replayInfo.getReplayMessageType( i) eColor = replayInfo.getReplayMessageColor(i) colRgba = localText.changeTextColor("", eColor) color = colRgba[7:colRgba.find(">")] if eMessageType in [ReplayMessageTypes.REPLAY_MESSAGE_CITY_FOUNDED, ReplayMessageTypes.REPLAY_MESSAGE_MAJOR_EVENT]: # Why does this not work?! # msgText = replayInfo.getReplayMessageText(i).decode('ascii', 'replace') msgText = replayInfo.getReplayMessageText( i) msgText = ''.join( i for i in msgText if ord(i) < 128) # filtering replayMessages.append( {'id': i, 'turn': iTurn, 'player': iPlayer, 'color': color, 'text': msgText}) i += 1 # Scores # iEnd = replayInfo.getReplayMessageTurn(i) iEnd = replayInfo.getFinalTurn() iStart = replayInfo.getInitialTurn() playerScores = {} for iPlayer in range(gc.getMAX_CIV_PLAYERS()): gcPlayer = gc.getPlayer(iPlayer) if (gcPlayer.isEverAlive()): i = iStart score = [] economy = [] industry = [] agriculture = [] while (i <= iEnd): score.append( replayInfo.getPlayerScore( iPlayer, i)) economy.append( replayInfo.getPlayerEconomy( iPlayer, i)) industry.append( replayInfo.getPlayerIndustry( iPlayer, i)) agriculture.append( replayInfo.getPlayerAgriculture( iPlayer, i)) i += 1 playerScores[iPlayer] = { 'score': score, 'economy': economy, 'industry': industry, 'agriculture': agriculture} self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Return subset of replay messages.', 'replay': replayMessages, 'graphs': playerScores}) + "\n") except Exception, e: self.wfile.write( simplejson.dumps( { 'return': 'fail', 'info': 'Some error occured trying to get the Replay. Error msg:' + str(e)}) + "\n") elif(action == "setMotD" and inputdata.get("password") == pbSettings["webserver"]["password"]): try: msg = str( inputdata.get( "msg", "No MotD given. Missing msg argument?!")) msg = msg.replace('&', '&amp;') msg = msg.replace('<', '&lt;') msg = msg.replace('>', '&gt;') self.server.lock.acquire() pbSettings["MotD"] = msg self.server.lock.release() self.server.savePbSettings() if self.server.adminApp is not None: self.server.adminApp.setMotD(msg) self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'New MotD: ' + msg}) + "\n") except Exception, e: self.wfile.write( simplejson.dumps( { 'return': 'fail', 'info': 'Some error occured trying to set the MotD. Probably a character that cannot be encoded. Error msg:' + str(e)}) + "\n") elif(action == "setShortNames" and inputdata.get("password") == pbSettings["webserver"]["password"]): try: bShortNames = bool(inputdata.get("enable", True)) iMaxLenName = int(inputdata.get("maxLenName", 1)) iMaxLenDesc = int(inputdata.get("maxLenDesc", 4)) self.server.lock.acquire() pbSettings["shortnames"] = { "enable": bShortNames, "maxLenName": iMaxLenName, "maxLenDesc": iMaxLenDesc} self.server.lock.release() self.server.savePbSettings() gc.getGame().setPitbossShortNames( bShortNames, iMaxLenName, iMaxLenDesc) self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': 'Short names enabled: ' + str(bShortNames) + ', Maximal length of Leadername: ' + str(iMaxLenName) + 'Maximal length of Civ description: ' + str(iMaxLenDesc)}) + "\n") except Exception, e: self.wfile.write( simplejson.dumps( { 'return': 'fail', 'info': 'Some error occured during change of short names-feature. Error msg:' + str(e)}) + "\n") elif(action == "info"): gamedata = self.server.createGamedata() self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': gamedata}) + "\n") elif(action == "listSaves"): # Print list of saves of the selected folder. This can be used for a dropdown list # of available saves. folderpaths = getPossibleSaveFolders() saveList = [] for fp in folderpaths: folderpath = fp[0] for savefile in os.listdir(folderpath): if savefile.endswith(".CivBeyondSwordSave"): timestamp = os.path.getctime( folderpath + savefile) saveList.append({ 'name': str(savefile), 'folderIndex': fp[1], 'date': time.ctime(timestamp), 'timestamp': timestamp }) self.wfile.write( simplejson.dumps( {'return': 'ok', 'list': saveList}) + "\n") elif(action == "listPlayerColors"): colorList = [] for c in range(gc.getNumPlayerColorInfos()): playerColors = gc.getPlayerColorInfo(c) col = localText.changeTextColor( u"", playerColors.getColorTypePrimary()) playerColor1 = col[7:col.find(">")] col = localText.changeTextColor( u"", playerColors.getColorTypeSecondary()) playerColor2 = col[7:col.find(">")] col = localText.changeTextColor( u"", playerColors.getTextColorType()) playerColor3 = col[7:col.find(">")] colorList.append({ "primary": playerColor1, "secondary": playerColor2, "text": playerColor3, "usedBy": [] }) for rowNum in range(gc.getMAX_CIV_PLAYERS()): gcPlayer = gc.getPlayer(rowNum) if (gcPlayer.isEverAlive()): colorList[gcPlayer.getPlayerColor()]["usedBy"].append( {"id": rowNum, "name": gcPlayer.getName()}) self.wfile.write( simplejson.dumps( {'return': 'ok', 'colors': colorList}) + "\n") elif(action == "listSigns" and inputdata.get("password") == pbSettings["webserver"]["password"] and pbSettings["webserver"].get("allowSigns", False)): engine = CyEngine() signs = [] for i in range(engine.getNumSigns()-1, -1, -1): pSign = engine.getSignByIndex(i) sign = { 'plot': [ pSign.getPlot().getX(), pSign.getPlot().getY()], 'id': pSign.getPlayerType(), 'caption': pSign.getCaption()} signs.append(sign) self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': signs}) + "\n") elif(action == "cleanupSigns" and inputdata.get("password") == pbSettings["webserver"]["password"] and pbSettings["webserver"].get("allowSigns", False)): # Debugging: Reset all Signs. Remove some special chars engine = CyEngine() signs = [] for i in range(engine.getNumSigns()-1, -1, -1): pSign = engine.getSignByIndex(i) sign = { 'plot': [ pSign.getPlot().getX(), pSign.getPlot().getY()], 'id': pSign.getPlayerType(), 'caption': pSign.getCaption()} signs.append(sign) engine.removeSign( pSign.getPlot(), pSign.getPlayerType()) for sign in signs: caption = sign['caption'] # caption = re.sub("[^A-z 0-9]","", caption) # not enought # caption = sign['caption'].encode('ascii', # 'ignore') # does not help caption = caption[0:18] # shortening required caption = ''.join( i for i in caption if ord(i) < 128) # filtering required sign['caption'] = caption engine.addSign( gc.getMap().plot( sign['plot'][0], sign['plot'][1]), sign['id'], caption.__str__()) self.wfile.write( simplejson.dumps( {'return': 'ok', 'info': signs}) + "\n") else: self.wfile.write( simplejson.dumps( { 'return': 'fail', 'info': 'Wrong password or unknown action. Available actions are info, chat, save, restart, listSaves, setAutostart, setHeadless, getMotD, setMotD, setShortNames, listPlayerColors, setPlayerColor, listSigns, cleanupSigns, getReplay, getWBSave. For security reasons the last four commands require the activation of some extra flags, see Webserver.py'}) + "\n") except Exception, e: try: errInfo = str(e) self.wfile.write( simplejson.dumps({'return': 'fail', 'info': "Exception: " + errInfo}) + "\n") except: pass else: try: data = { "return": "fail", "info": "Wrong content type. Assume JSON data."} self.send_response(200) self.end_headers() self.wfile.write(simplejson.dumps(data) + "\n") except Exception, e: pass else: try: self.send_response(403) self.send_header('Content-Type', 'application/json') self.end_headers() except Exception, e: pass return def do_GET(self): """Server has no get functionality.""" if None != re.search('/api/v1/somepage/*', self.path): if True: self.send_response(200) self.send_header('Content-Type', 'application/json') self.end_headers() self.wfile.write( "Bitte weitergehen. Hier gibts nichts zu sehen.") else: self.send_response(400, 'Bad Request: record does not exist') self.send_header('Content-Type', 'application/json') self.end_headers() else: self.send_response(403) self.send_header('Content-Type', 'application/json') self.end_headers() return class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): allow_reuse_address = True oldGamestate = {} def shutdown(self): self.socket.close() self.server_close() # In Python 2.4 the method 'shutdown' does not exists. # But we set the Deamon flag to true, thus it should shutdown. # HTTPServer.shutdown(self) def setPbApp(self, adminApp): self.adminApp = adminApp self.adminWindow = adminApp.adminFrame self.lock = thread.allocate_lock() # Setup some extra Values in the DLL if "shortnames" not in pbSettings: pbSettings["shortnames"] = { "enable": True, "maxLenName": 1, "maxLenDesc": 4} shortnames = pbSettings.get("shortnames", {}) bShortNames = bool(shortnames.get("enable", True)) iMaxLenName = int(shortnames.get("maxLenName", 1)) iMaxLenDesc = int(shortnames.get("maxLenDesc", 4)) gc.getGame().setPitbossShortNames( bShortNames, iMaxLenName, iMaxLenDesc) # Cache value because the evaluation is an expensive operation wbsaveCache = None def createWBSave(self, bCache=True, bCompress=False): self.lock.acquire() # Reset cache for new rounds if self.wbsaveCache is not None and self.wbsaveCache.get("turn", -1) != PB.getGameturn(): self.wbsaveCache = None if self.wbsaveCache is None or bCache == False: self.wbsaveCache = {"turn": PB.getGameturn()} # f = file("/dev/shm/Test.WBSave", "w") f = cStringIO.StringIO() version = 11 f.write("Version=%d\n" % (version,)) CvWBDesc.CvGameDesc().write(f) for i in range(gc.getMAX_TEAMS()): CvWBDesc.CvTeamDesc().write(f, i) # write team info for i in range(gc.getMAX_PLAYERS()): CvWBDesc.CvPlayerDesc().write(f, i) # write player info CvWBDesc.CvMapDesc().write(f) f.write("\n# # # Plot Info # # # \n") iGridW = CyMap().getGridWidth() iGridH = CyMap().getGridHeight() for iX in range(iGridW): for iY in range(iGridH): plot = CyMap().plot(iX, iY) pDesc = CvWBDesc.CvPlotDesc() if pDesc.needToWritePlot(plot): pDesc.write(f, plot) # Signs should be private """ f.write("\n# # # Sign Info # # # \n") iNumSigns = CyEngine().getNumSigns() for i in range(iNumSigns): sign = CyEngine().getSignByIndex(i) pDesc = CvSignDesc() pDesc.write(f, sign) """ wbsave = f.getvalue() self.wbsaveCache["raw"] = wbsave.decode( 'ascii', 'replace') # required for umlauts f.close() if bCompress and "zip" not in self.wbsaveCache: # self.wbsaveCache["zip"] = zlib.compress(self.wbsaveCache.get("raw","No WB data cached.")) """ zf = cStringIO.StringIO() z = GzipFile(None, 'w', 9, zf) z.write( self.wbsaveCache.get("raw","No WB data cached.") ) self.wbsaveCache["zip"] = z.read() zf.close() """ self.wbsaveCache["zip"] = self.wbsaveCache.get( "raw", "No WB data cached.") if bCompress: ret = { 'return': 'ok', 'info': 'Compressed WBSave returned.', 'save': self.wbsaveCache["zip"]} else: ret = { 'return': 'ok', 'info': 'WBSave returned.', 'save': self.wbsaveCache["raw"]} self.lock.release() return ret def createWBSaveDoNotWork(self, filename, folderIndex=0): filepath = os.path.join(self.getSaveFolder(folderIndex), filename) if (filepath != ""): self.lock.acquire() WBDesc = CvWBDesc.CvWBDesc() if 0 == WBDesc.write(filename): ret = { 'return': 'ok', 'info': 'File was saved in ' + filepath + '.', 'save': 'blub'} else: ret = { 'return': 'fail', 'info': 'Can not create WBSave ' + filepath + '.', 'save': ''} else: ret = {'return': 'fail', 'info': 'No filename.', 'save': ''} self.lock.release() return ret def createSave(self, filename, folderIndex=0): filepath = os.path.join(self.getSaveFolder(folderIndex), filename) if (filename != ""): self.lock.acquire() if (not PB.save(filepath)): ret = { 'return': 'fail', 'info': 'Saving of ' + filepath + ' failed.'} self.lock.release() else: # Update last file name info and save json file pbSettings["save"]["filename"] = filename pbSettings["save"]["folderIndex"] = folderIndex self.lock.release() self.savePbSettings() ret = { 'return': 'ok', 'info': 'File was saved in ' + filepath + '.'} return ret def getSaveFolder(self, folderIndex=0): global altrootDir folderpaths = getPossibleSaveFolders() try: return folderpaths[folderIndex][0] except IndexError: return folderpaths[0][0] def createPlayerRecoverySave(self, playerId, playerName, bOnline): # 1. Check which saves already exists for this player # and remove old recovery saves folder = self.getSaveFolder(1) RecoverPrefix = 'Logoff_' if bOnline: RecoverPrefix = 'Login_' # Windows file names can not contain * characters. Replace the string "*Mod* ", which # can prepend the player name. playerName = playerName.replace("*MOD* ", "MOD_").strip() existingRecoverySaves = glob.glob( folder + RecoverPrefix + 'P' + str(playerId) + '_*.CivBeyondSwordSave') # Add timestamp (as tuple) existingRecoverySavesWithTimestamps = map( lambda x: ( x, os.path.getctime(x)), existingRecoverySaves) # Sort by timestamp existingRecoverySavesWithTimestamps.sort(key=lambda xx: xx[1]) # Remove oldest while(len(existingRecoverySavesWithTimestamps) >= pbSettings.get("numRecoverySavesPerPlayer", 3)): old = existingRecoverySavesWithTimestamps.pop(0) os.remove(old[0]) # 2. Save new recovery save filename = (RecoverPrefix + 'P' + str(playerId) + '_' + playerName + '_T' + str(int(time.time())) + '.CivBeyondSwordSave') self.createSave(str(filename), 1) def compareGamedata(self, new, old=None): if old is None: old = self.oldGamestate # Remove volative keys ttvOld = old.pop("turnTimerValue", None) ttvNew = new.pop("turnTimerValue", None) bSame = (old == new) if ttvNew is not None: new["turnTimerValue"] = ttvNew # cache new value self.oldGamestate = new return bSame def createGamedata(self): # Collect all available data gamedata = {'gameTurn': PB.getGameturn(), 'gameName': PB.getGamename(), 'gameDate': PB.getGamedate(False), 'bPaused': gc.getGame().isPaused(), 'modName': PB.getModName(), } if(PB.getTurnTimer()): gamedata["turnTimer"] = 1 gamedata['turnTimerMax'] = gc.getGame().getPitbossTurnTime() gamedata['turnTimerValue'] = PB.getTurnTimeLeft() else: gamedata["turnTimer"] = 0 players = [] for rowNum in range(gc.getMAX_CIV_PLAYERS()): gcPlayer = gc.getPlayer(rowNum) if (gcPlayer.isEverAlive()): playerData = PB.getPlayerAdminData(rowNum) player = {'id': rowNum} player['finishedTurn'] = not playerData.bTurnActive player['name'] = gcPlayer.getName() player['score'] = playerData.getScore() player['ping'] = playerData.getPing() player['bHuman'] = playerData.bHuman player['bClaimed'] = playerData.bClaimed player['civilization'] = gcPlayer.getCivilizationDescription(0) player['leader'] = gc.getLeaderHeadInfo( gcPlayer.getLeaderType()).getDescription() player['color'] = u"%d,%d,%d" % ( gcPlayer.getPlayerTextColorR(), gcPlayer.getPlayerTextColorG(), gcPlayer.getPlayerTextColorB()) players.append(player) gamedata['players'] = players gamedata['bHeadless'] = pbSettings.get("noGui", 0) gamedata['bAutostart'] = pbSettings.get("autostart", 0) return gamedata def savePbSettings(self): self.lock.acquire() # Call non-member function savePbSettings() self.lock.release() class PerpetualTimer: """Class to invoke request from to the 'client' side of webinterface. If reduceTraffic flag is set, only changed game states will be send. Moreover, every self.reduceFactor times an alive message will be send to respect some offline detection mechanism of the webinterface. """ def __init__(self, settings, webserver, reduceTraffic=False): self.settings = settings self.t = settings['sendInterval'] self.tFirst = self.t + 10 self.reduceTraffic = reduceTraffic self.reduceFactor = 12 self.requestCounter = 0 self.webserver = webserver self.hFunction = self.request self.thread = Timer(self.tFirst, self.handle_function) def handle_function(self): self.hFunction(self.webserver) self.thread = Timer(self.t, self.handle_function) self.thread.start() def start(self): self.thread.start() def cancel(self): self.thread.cancel() def request(self, webserver): gamedata = webserver.createGamedata() newState = not webserver.compareGamedata(gamedata) # Check if CvGame::doTurn is currently running. # Try ness for mods without the DLL changes for bGameTurnProcessing inconsistentState = False try: inconsistentState = CvEventInterface.getEventManager( ).bGameTurnProcessing except AttributeError: pass url = self.settings["url"] gameId = self.settings["gameId"] pwHash = md5.new(pbSettings['webserver']['password']).hexdigest() self.requestCounter += 1 if(not inconsistentState and (newState or not self.reduceTraffic or self.requestCounter % self.reduceFactor == 0)): params = urllib.urlencode( {'action': 'update', 'id': gameId, 'pwHash': pwHash, 'info': simplejson.dumps( {'return': 'ok', 'info': gamedata})}) else: # Minimal alive message. gamedataMinimal = {"turnTimer": gamedata.get("turnTimer")} if gamedata["turnTimer"] == 1: gamedataMinimal["turnTimerValue"] = gamedata.get( "turnTimerValue") params = urllib.urlencode( {'action': 'update', 'id': gameId, 'pwHash': pwHash, 'info': simplejson.dumps( {'return': 'ok', 'info': gamedataMinimal})}) try: # f = urllib.urlopen("%s?%s" % (url,params) ) # GET method urllib.urlopen(url, params) # POST method except: pass
gpl-2.0
lzambella/Qyoutube-dl
youtube_dl/extractor/podomatic.py
198
2327
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import int_or_none class PodomaticIE(InfoExtractor): IE_NAME = 'podomatic' _VALID_URL = r'^(?P<proto>https?)://(?P<channel>[^.]+)\.podomatic\.com/entry/(?P<id>[^?]+)' _TESTS = [ { 'url': 'http://scienceteachingtips.podomatic.com/entry/2009-01-02T16_03_35-08_00', 'md5': '84bb855fcf3429e6bf72460e1eed782d', 'info_dict': { 'id': '2009-01-02T16_03_35-08_00', 'ext': 'mp3', 'uploader': 'Science Teaching Tips', 'uploader_id': 'scienceteachingtips', 'title': '64. When the Moon Hits Your Eye', 'duration': 446, } }, { 'url': 'http://ostbahnhof.podomatic.com/entry/2013-11-15T16_31_21-08_00', 'md5': 'd2cf443931b6148e27638650e2638297', 'info_dict': { 'id': '2013-11-15T16_31_21-08_00', 'ext': 'mp3', 'uploader': 'Ostbahnhof / Techno Mix', 'uploader_id': 'ostbahnhof', 'title': 'Einunddreizig', 'duration': 3799, } }, ] def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') channel = mobj.group('channel') json_url = (('%s://%s.podomatic.com/entry/embed_params/%s' + '?permalink=true&rtmp=0') % (mobj.group('proto'), channel, video_id)) data_json = self._download_webpage( json_url, video_id, 'Downloading video info') data = json.loads(data_json) video_url = data['downloadLink'] if not video_url: video_url = '%s/%s' % (data['streamer'].replace('rtmp', 'http'), data['mediaLocation']) uploader = data['podcast'] title = data['title'] thumbnail = data['imageLocation'] duration = int_or_none(data.get('length'), 1000) return { 'id': video_id, 'url': video_url, 'title': title, 'uploader': uploader, 'uploader_id': channel, 'thumbnail': thumbnail, 'duration': duration, }
gpl-3.0
cible/sveeaccounts
sveeaccounts/crispies.py
2
1877
# -*- coding: utf-8 -*- """ Stuff for form helpers with ``crispy_forms`` ``crispy_forms`` import and usage is optionnal and no exception should be raised if you don't have installed it. """ import warnings from django import forms from django.conf import settings from django.utils.importlib import import_module from django.utils.translation import ugettext def get_form_helper(helper_path, default=None): """ Get the crispy_forms Helper from the given Python path @helper_path is a string containing a Python path to the wanted helper, @default is a callable used as the default layout if the @helper_path import fails. @default could be None if you don't want a default layout (and use the automated one from crispy_forms). You should only use the None value for @default if you don't plan to use crispy_forms. Return a callable or None """ if helper_path is None: return default dot = helper_path.rindex('.') module_name = helper_path[:dot] class_name = helper_path[dot + 1:] try: _class = getattr(import_module(module_name), class_name) return _class except (ImportError, AttributeError): warnings.warn('%s cannot be imported' % helper_path, RuntimeWarning) return default try: from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Fieldset, Div, Submit from crispy_forms.bootstrap import FormActions except ImportError: def default_helper(): return None def UserProfileBaseHelper(): return None else: def default_helper(form_tag=True): helper = FormHelper() helper.form_action = '.' helper.form_tag = form_tag helper.form_style = 'inline' helper.add_input(Submit('submit', ugettext('Submit'))) return helper
mit
DavidLP/home-assistant
homeassistant/components/homematic/climate.py
6
4636
"""Support for Homematic thermostats.""" import logging from homeassistant.components.climate import ClimateDevice from homeassistant.components.climate.const import ( STATE_AUTO, STATE_MANUAL, SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE) from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS from . import ATTR_DISCOVER_DEVICES, HM_ATTRIBUTE_SUPPORT, HMDevice _LOGGER = logging.getLogger(__name__) STATE_BOOST = 'boost' STATE_COMFORT = 'comfort' STATE_LOWERING = 'lowering' HM_STATE_MAP = { 'AUTO_MODE': STATE_AUTO, 'MANU_MODE': STATE_MANUAL, 'BOOST_MODE': STATE_BOOST, 'COMFORT_MODE': STATE_COMFORT, 'LOWERING_MODE': STATE_LOWERING } HM_TEMP_MAP = [ 'ACTUAL_TEMPERATURE', 'TEMPERATURE', ] HM_HUMI_MAP = [ 'ACTUAL_HUMIDITY', 'HUMIDITY', ] HM_CONTROL_MODE = 'CONTROL_MODE' HMIP_CONTROL_MODE = 'SET_POINT_MODE' SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Homematic thermostat platform.""" if discovery_info is None: return devices = [] for conf in discovery_info[ATTR_DISCOVER_DEVICES]: new_device = HMThermostat(conf) devices.append(new_device) add_entities(devices) class HMThermostat(HMDevice, ClimateDevice): """Representation of a Homematic thermostat.""" @property def supported_features(self): """Return the list of supported features.""" return SUPPORT_FLAGS @property def temperature_unit(self): """Return the unit of measurement that is used.""" return TEMP_CELSIUS @property def current_operation(self): """Return current operation ie. heat, cool, idle.""" if HM_CONTROL_MODE not in self._data: return None # boost mode is active if self._data.get('BOOST_MODE', False): return STATE_BOOST # HmIP uses the set_point_mode to say if its # auto or manual if HMIP_CONTROL_MODE in self._data: code = self._data[HMIP_CONTROL_MODE] # Other devices use the control_mode else: code = self._data['CONTROL_MODE'] # get the name of the mode name = HM_ATTRIBUTE_SUPPORT[HM_CONTROL_MODE][1][code] return name.lower() @property def operation_list(self): """Return the list of available operation modes.""" # HMIP use set_point_mode for operation if HMIP_CONTROL_MODE in self._data: return [STATE_MANUAL, STATE_AUTO, STATE_BOOST] # HM op_list = [] for mode in self._hmdevice.ACTIONNODE: if mode in HM_STATE_MAP: op_list.append(HM_STATE_MAP.get(mode)) return op_list @property def current_humidity(self): """Return the current humidity.""" for node in HM_HUMI_MAP: if node in self._data: return self._data[node] @property def current_temperature(self): """Return the current temperature.""" for node in HM_TEMP_MAP: if node in self._data: return self._data[node] @property def target_temperature(self): """Return the target temperature.""" return self._data.get(self._state) def set_temperature(self, **kwargs): """Set new target temperature.""" temperature = kwargs.get(ATTR_TEMPERATURE) if temperature is None: return None self._hmdevice.writeNodeData(self._state, float(temperature)) def set_operation_mode(self, operation_mode): """Set new target operation mode.""" for mode, state in HM_STATE_MAP.items(): if state == operation_mode: code = getattr(self._hmdevice, mode, 0) self._hmdevice.MODE = code return @property def min_temp(self): """Return the minimum temperature - 4.5 means off.""" return 4.5 @property def max_temp(self): """Return the maximum temperature - 30.5 means on.""" return 30.5 def _init_data_struct(self): """Generate a data dict (self._data) from the Homematic metadata.""" self._state = next(iter(self._hmdevice.WRITENODE.keys())) self._data[self._state] = None if HM_CONTROL_MODE in self._hmdevice.ATTRIBUTENODE or \ HMIP_CONTROL_MODE in self._hmdevice.ATTRIBUTENODE: self._data[HM_CONTROL_MODE] = None for node in self._hmdevice.SENSORNODE.keys(): self._data[node] = None
apache-2.0
LANGFAN/ardupilot
mk/VRBRAIN/Tools/genmsg/src/genmsg/deps.py
51
4087
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # * Neither the name of Willow Garage, Inc. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. import os import genmsg.msg_loader import genmsg # pkg_name - string # msg_file - string full path # search_paths - dict of {'pkg':'msg_dir'} def find_msg_dependencies_with_type(pkg_name, msg_file, search_paths): # Read and parse the source msg file msg_context = genmsg.msg_loader.MsgContext.create_default() full_type_name = genmsg.gentools.compute_full_type_name(pkg_name, os.path.basename(msg_file)) spec = genmsg.msg_loader.load_msg_from_file(msg_context, msg_file, full_type_name) try: genmsg.msg_loader.load_depends(msg_context, spec, search_paths) except genmsg.InvalidMsgSpec as e: raise genmsg.MsgGenerationException("Cannot read .msg for %s: %s"%(full_type_name, str(e))) deps = set() for dep_type_name in msg_context.get_all_depends(full_type_name): deps.add((dep_type_name, msg_context.get_file(dep_type_name))) return list(deps) def find_msg_dependencies(pkg_name, msg_file, search_paths): deps = find_msg_dependencies_with_type(pkg_name, msg_file, search_paths) return [d[1] for d in deps] def find_srv_dependencies_with_type(pkg_name, msg_file, search_paths): # Read and parse the source msg file msg_context = genmsg.msg_loader.MsgContext.create_default() full_type_name = genmsg.gentools.compute_full_type_name(pkg_name, os.path.basename(msg_file)) spec = genmsg.msg_loader.load_srv_from_file(msg_context, msg_file, full_type_name) try: genmsg.msg_loader.load_depends(msg_context, spec, search_paths) except genmsg.InvalidMsgSpec as e: raise genmsg.MsgGenerationException("Cannot read .msg for %s: %s"%(full_type_name, str(e))) deps = set() for dep_type_name in msg_context.get_all_depends(spec.request.full_name): deps.add((dep_type_name, msg_context.get_file(dep_type_name))) for dep_type_name in msg_context.get_all_depends(spec.response.full_name): deps.add((dep_type_name, msg_context.get_file(dep_type_name))) return list(deps) def find_srv_dependencies(pkg_name, msg_file, search_paths): deps = find_srv_dependencies_with_type(pkg_name, msg_file, search_paths) return [d[1] for d in deps] #paths = {'std_msgs':'/u/mkjargaard/repositories/mkjargaard/dist-sandbox/std_msgs/msg'} #file = '/u/mkjargaard/repositories/mkjargaard/dist-sandbox/quux_msgs/msg/QuuxString.msg' #find_msg_dependencies('quux_msgs', file, paths)
gpl-3.0
chrishas35/django-travis-ci
django/contrib/sessions/models.py
146
1994
from django.db import models from django.utils.translation import ugettext_lazy as _ class SessionManager(models.Manager): def encode(self, session_dict): """ Returns the given session dictionary pickled and encoded as a string. """ return SessionStore().encode(session_dict) def save(self, session_key, session_dict, expire_date): s = self.model(session_key, self.encode(session_dict), expire_date) if session_dict: s.save() else: s.delete() # Clear sessions with no data. return s class Session(models.Model): """ Django provides full support for anonymous sessions. The session framework lets you store and retrieve arbitrary data on a per-site-visitor basis. It stores data on the server side and abstracts the sending and receiving of cookies. Cookies contain a session ID -- not the data itself. The Django sessions framework is entirely cookie-based. It does not fall back to putting session IDs in URLs. This is an intentional design decision. Not only does that behavior make URLs ugly, it makes your site vulnerable to session-ID theft via the "Referer" header. For complete documentation on using Sessions in your code, consult the sessions documentation that is shipped with Django (also available on the Django Web site). """ session_key = models.CharField(_('session key'), max_length=40, primary_key=True) session_data = models.TextField(_('session data')) expire_date = models.DateTimeField(_('expire date'), db_index=True) objects = SessionManager() class Meta: db_table = 'django_session' verbose_name = _('session') verbose_name_plural = _('sessions') def get_decoded(self): return SessionStore().decode(self.session_data) # At bottom to avoid circular import from django.contrib.sessions.backends.db import SessionStore
bsd-3-clause