try:<EOL><INDENT>return os.environ['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>if os.name!='<STR_LIT>':<EOL><INDENT>return os.path.expanduser('<STR_LIT>')<EOL><DEDENT>app_data = '<STR_LIT>'   <EOL>app_homes = [<EOL>(('<STR_LIT>',), None),       <EOL>(('<STR_LIT>',), app_data),<EOL>(('<STR_LIT>','<STR_LIT>'), app_data),<EOL>(('<STR_LIT>',), app_data),<EOL>(('<STR_LIT>',), None),<EOL>(('<STR_LIT>',), app_data),    <EOL>]<EOL>for keys, subdir in app_homes:<EOL><INDENT>dirname = '<STR_LIT>'<EOL>for key in keys:<EOL><INDENT>if key in os.environ:<EOL><INDENT>dirname = os.path.join(dirname, os.environ[key])<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if subdir:<EOL><INDENT>dirname = os.path.join(dirname,subdir)<EOL><DEDENT>return os.path.join(dirname, '<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise RuntimeError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>

Determine the default cache location

    This returns the ``PYTHON_EGG_CACHE`` environment variable, if set.
    Otherwise, on Windows, it returns a "Python-Eggs" subdirectory of the
    "Application Data" directory.  On all other systems, it's "~/.python-eggs".


if req.project_name == '<STR_LIT>':<EOL><INDENT>if not len(req.specs):<EOL><INDENT>return True<EOL><DEDENT>for comparator, version in req.specs:<EOL><INDENT>if comparator in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT:>>']:<EOL><INDENT>if '<STR_LIT>' in version:<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>return True<EOL><DEDENT>return False<EOL>

Return True when distribute wants to override a setuptools dependency.

    We want to override when the requirement is setuptools and the version is
    a variant of 0.6.


version = version.replace('<STR_LIT:U+0020>','<STR_LIT:.>')<EOL>return re.sub('<STR_LIT>', '<STR_LIT:->', version)<EOL>

Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.


def find_on_path(importer, path_item, only=False):

path_item = _normalize_cached(path_item)<EOL>if os.path.isdir(path_item) and os.access(path_item, os.R_OK):<EOL><INDENT>if path_item.lower().endswith('<STR_LIT>'):<EOL><INDENT>yield Distribution.from_filename(<EOL>path_item, metadata=PathMetadata(<EOL>path_item, os.path.join(path_item,'<STR_LIT>')<EOL>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>for entry in os.listdir(path_item):<EOL><INDENT>lower = entry.lower()<EOL>if lower.endswith('<STR_LIT>') or lower.endswith('<STR_LIT>'):<EOL><INDENT>fullpath = os.path.join(path_item, entry)<EOL>if os.path.isdir(fullpath):<EOL><INDENT>metadata = PathMetadata(path_item, fullpath)<EOL><DEDENT>else:<EOL><INDENT>metadata = FileMetadata(fullpath)<EOL><DEDENT>yield Distribution.from_location(<EOL>path_item,entry,metadata,precedence=DEVELOP_DIST<EOL>)<EOL><DEDENT>elif not only and lower.endswith('<STR_LIT>'):<EOL><INDENT>for dist in find_distributions(os.path.join(path_item, entry)):<EOL><INDENT>yield dist<EOL><DEDENT><DEDENT>elif not only and lower.endswith('<STR_LIT>'):<EOL><INDENT>for line in open(os.path.join(path_item, entry)):<EOL><INDENT>if not line.strip(): continue<EOL>for item in find_distributions(os.path.join(path_item,line.rstrip())):<EOL><INDENT>yield item<EOL><DEDENT>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>

Yield distributions accessible on a sys.path directory


if self.cached_files:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>self.extraction_path = path<EOL>

Set the base path where resources will be extracted to, if needed.

        If you do not call this routine before any extractions take place, the
        path defaults to the return value of ``get_default_cache()``.  (Which
        is based on the ``PYTHON_EGG_CACHE`` environment variable, with various
        platform-specific fallbacks.  See that routine's documentation for more
        details.)

        Resources are extracted to subdirectories of this path based upon
        information given by the ``IResourceProvider``.  You may set this to a
        temporary directory, but then you must call ``cleanup_resources()`` to
        delete the extracted files when done.  There is no guarantee that
        ``cleanup_resources()`` will be able to remove all extracted files.

        (Note: you may not change the extraction path for a given resource
        manager once resources have been extracted, unless you first call
        ``cleanup_resources()``.)


if provided is None or required is None or provided==required:<EOL><INDENT>return True     <EOL><DEDENT>reqMac = macosVersionString.match(required)<EOL>if reqMac:<EOL><INDENT>provMac = macosVersionString.match(provided)<EOL>if not provMac:<EOL><INDENT>provDarwin = darwinVersionString.match(provided)<EOL>if provDarwin:<EOL><INDENT>dversion = int(provDarwin.group(<NUM_LIT:1>))<EOL>macosversion = "<STR_LIT>" % (reqMac.group(<NUM_LIT:1>), reqMac.group(<NUM_LIT:2>))<EOL>if dversion == <NUM_LIT:7> and macosversion >= "<STR_LIT>" ordversion == <NUM_LIT:8> and macosversion >= "<STR_LIT>":<EOL><INDENT>return True<EOL><DEDENT><DEDENT>return False    <EOL><DEDENT>if provMac.group(<NUM_LIT:1>) != reqMac.group(<NUM_LIT:1>) orprovMac.group(<NUM_LIT:3>) != reqMac.group(<NUM_LIT:3>):<EOL><INDENT>return False<EOL><DEDENT>if int(provMac.group(<NUM_LIT:2>)) > int(reqMac.group(<NUM_LIT:2>)):<EOL><INDENT>return False<EOL><DEDENT>return True<EOL><DEDENT>return False<EOL>

Can code for the `provided` platform run on the `required` platform?

    Returns true if either platform is ``None``, or the platforms are equal.

    XXX Needs compatibility checks for Linux and other unixy OSes.


imp.acquire_lock()<EOL>try:<EOL><INDENT>for package in _namespace_packages.get(parent,()):<EOL><INDENT>subpath = _handle_ns(package, path_item)<EOL>if subpath: fixup_namespace_packages(subpath,package)<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>imp.release_lock()<EOL><DEDENT>

Ensure that previously-declared namespace packages include path_item


dm = self._dep_map<EOL>deps = []<EOL>deps.extend(dm.get(None,()))<EOL>for ext in extras:<EOL><INDENT>try:<EOL><INDENT>deps.extend(dm[safe_extra(ext)])<EOL><DEDENT>except KeyError:<EOL><INDENT>raise UnknownExtra(<EOL>"<STR_LIT>" % (self, ext)<EOL>)<EOL><DEDENT><DEDENT>return deps<EOL>

List of Requirements needed for this distro if `extras` are used


global StringIO<EOL>try:<EOL><INDENT>from io import StringIO<EOL><DEDENT>except ImportError:<EOL><INDENT>from io import StringIO<EOL><DEDENT>return StringIO(*args,**kw)<EOL>

Thunk to load the real StringIO on demand


if attr.startswith('<STR_LIT:_>'):<EOL><INDENT>raise AttributeError(attr)<EOL><DEDENT>return getattr(self._provider, attr)<EOL>

Delegate all unrecognized public attributes to .metadata provider


imp.acquire_lock()<EOL>try:<EOL><INDENT>if packageName in _namespace_packages:<EOL><INDENT>return<EOL><DEDENT>path, parent = sys.path, None<EOL>if '<STR_LIT:.>' in packageName:<EOL><INDENT>parent = '<STR_LIT:.>'.join(packageName.split('<STR_LIT:.>')[:-<NUM_LIT:1>])<EOL>declare_namespace(parent)<EOL>if parent not in _namespace_packages:<EOL><INDENT>__import__(parent)<EOL><DEDENT>try:<EOL><INDENT>path = sys.modules[parent].__path__<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise TypeError("<STR_LIT>", parent)<EOL><DEDENT><DEDENT>_namespace_packages.setdefault(parent,[]).append(packageName)<EOL>_namespace_packages.setdefault(packageName,[])<EOL>for path_item in path:<EOL><INDENT>_handle_ns(packageName, path_item)<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>imp.release_lock()<EOL><DEDENT>

Declare that package 'packageName' is a namespace package


return dict(_VARS)<EOL>

Return copy of default PEP 385 globals dictionary.


new_node = ast.Name("<STR_LIT>" % (node.value.id, node.attr), node.ctx)<EOL>return ast.copy_location(new_node, node)<EOL>


super(NoseExclude, self).configure(options, conf)<EOL>self.exclude_dirs = {}<EOL>if options.exclude_dir_file:<EOL><INDENT>if not options.exclude_dirs:<EOL><INDENT>options.exclude_dirs = []<EOL><DEDENT>new_dirs = self._load_from_file(options.exclude_dir_file)<EOL>options.exclude_dirs.extend(new_dirs)<EOL><DEDENT>if not options.exclude_dirs:<EOL><INDENT>self.enabled = False<EOL>return<EOL><DEDENT>self.enabled = True<EOL>root = os.getcwd()<EOL>log.debug('<STR_LIT>' % root)<EOL>for exclude_param in options.exclude_dirs:<EOL><INDENT>for d in exclude_param.split('<STR_LIT:\n>'):<EOL><INDENT>d = d.strip()<EOL>abs_d = self._force_to_abspath(d)<EOL>if abs_d:<EOL><INDENT>self.exclude_dirs[abs_d] = True<EOL><DEDENT><DEDENT><DEDENT>exclude_str = "<STR_LIT>" % "<STR_LIT:U+002C>".join(self.exclude_dirs.keys())<EOL>log.debug(exclude_str)<EOL>

Configure plugin based on command line options


return self.getParser(doc).format_help()<EOL>


user = user_config_files()<EOL>if os.path.exists('<STR_LIT>'):<EOL><INDENT>return user + ['<STR_LIT>']<EOL><DEDENT>return user<EOL>

Return path to any existing user config files, plus any setup.cfg
    in the current working directory.


for name in names:<EOL><INDENT>func = getattr(obj, name, None)<EOL>if func is not None:<EOL><INDENT>if type(obj) == types.ModuleType:<EOL><INDENT>try:<EOL><INDENT>args, varargs, varkw, defaults = inspect.getargspec(func)<EOL><DEDENT>except TypeError:<EOL><INDENT>if hasattr(func, '<STR_LIT>'):<EOL><INDENT>func = func.__call__<EOL><DEDENT>try:<EOL><INDENT>args, varargs, varkw, defaults =inspect.getargspec(func)<EOL>args.pop(<NUM_LIT:0>) <EOL><DEDENT>except TypeError:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" %<EOL>(name, obj))<EOL><DEDENT><DEDENT>if len(args):<EOL><INDENT>log.debug("<STR_LIT>", obj, name, obj)<EOL>return func(obj)<EOL><DEDENT><DEDENT>log.debug("<STR_LIT>", obj, name)<EOL>return func()<EOL><DEDENT><DEDENT>

Given a list of possible method names, try to run them with the
    provided object. Keep going until something works. Used to run
    setup/teardown methods for module, package, and function tests.


from nose.tools import make_decorator<EOL>def newfunc(*arg, **kw):<EOL><INDENT>return func(*arg, **kw)<EOL><DEDENT>newfunc = make_decorator(func)(newfunc)<EOL>newfunc.__module__ = module<EOL>return newfunc<EOL>

Make a function imported from module A appear as if it is located
in module B.

>>> from pprint import pprint
>>> pprint.__module__
'pprint'
>>> pp = transplant_func(pprint, __name__)
>>> pp.__module__
'nose.util'

The original function is not modified.

>>> pprint.__module__
'pprint'

Calling the transplanted function calls the original.

>>> pp([1, 2])
[1, 2]
>>> pprint([1,2])
[1, 2]


if not os.path.isabs(path):<EOL><INDENT>path = os.path.normpath(os.path.abspath(os.path.join(os.getcwd(),<EOL>path)))<EOL><DEDENT>if path is None or not os.path.isdir(path):<EOL><INDENT>return None<EOL><DEDENT>return path<EOL>

Return absolute, normalized path to directory, if it exists; None
    otherwise.


if val is None:<EOL><INDENT>return None<EOL><DEDENT>try:<EOL><INDENT>val.extend([])<EOL>return val<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>return re.split(r'<STR_LIT>', val)<EOL><DEDENT>except TypeError:<EOL><INDENT>return list(val)<EOL><DEDENT>

Convert a value that may be a list or a (possibly comma-separated)
    string into a list. The exception: None is returned as None, not [None].

    >>> tolist(["one", "two"])
    ['one', 'two']
    >>> tolist("hello")
    ['hello']
    >>> tolist("separate,values, with, commas,  spaces , are    ,ok")
    ['separate', 'values', 'with', 'commas', 'spaces', 'are', 'ok']


if filename is None:<EOL><INDENT>return filename<EOL><DEDENT>if sys.platform.startswith('<STR_LIT>') and filename.endswith('<STR_LIT>'):<EOL><INDENT>return '<STR_LIT:.>'.join((filename[:-<NUM_LIT:9>], '<STR_LIT>'))<EOL><DEDENT>base, ext = os.path.splitext(filename)<EOL>if ext in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>return '<STR_LIT:.>'.join((base, '<STR_LIT>'))<EOL><DEDENT>return filename<EOL>

Find the python source file for a .pyc, .pyo or $py.class file on
    jython. Returns the filename provided if it is not a python source
    file.


try:<EOL><INDENT>return func.compat_co_firstlineno<EOL><DEDENT>except AttributeError:<EOL><INDENT>try:<EOL><INDENT>return func.func_code.co_firstlineno<EOL><DEDENT>except AttributeError:<EOL><INDENT>return -<NUM_LIT:1><EOL><DEDENT><DEDENT>

Get the line number of a function. First looks for
    compat_co_firstlineno, then func_code.co_first_lineno.


label_len = len(label) + <NUM_LIT:2><EOL>chunk = (<NUM_LIT> - label_len) // <NUM_LIT:2><EOL>out = '<STR_LIT>' % ('<STR_LIT:->' * chunk, label, '<STR_LIT:->' * chunk)<EOL>pad = <NUM_LIT> - len(out)<EOL>if pad > <NUM_LIT:0>:<EOL><INDENT>out = out + ('<STR_LIT:->' * pad)<EOL><DEDENT>return out<EOL>


def k(obj):<EOL><INDENT>if regex.search(obj):<EOL><INDENT>return (<NUM_LIT:1>, obj)<EOL><DEDENT>return (<NUM_LIT:0>, obj)<EOL><DEDENT>return k<EOL>

Sort key function factory that puts items that match a
    regular expression last.

    >>> from nose.config import Config
    >>> from nose.pyversion import sort_list
    >>> c = Config()
    >>> regex = c.testMatch
    >>> entries = ['.', '..', 'a_test', 'src', 'lib', 'test', 'foo.py']
    >>> sort_list(entries, regex_last_key(regex))
    >>> entries
    ['.', '..', 'foo.py', 'lib', 'src', 'a_test', 'test']


def proxied_attribute(local_attr, proxied_attr, doc):

def fget(self):<EOL><INDENT>return getattr(getattr(self, local_attr), proxied_attr)<EOL><DEDENT>def fset(self, value):<EOL><INDENT>setattr(getattr(self, local_attr), proxied_attr, value)<EOL><DEDENT>def fdel(self):<EOL><INDENT>delattr(getattr(self, local_attr), proxied_attr)<EOL><DEDENT>return property(fget, fset, fdel, doc)<EOL>

Create a property that proxies attribute ``proxied_attr`` through
    the local attribute ``local_attr``.


return ((self.match.search(name)<EOL>or (self.include and<EOL>filter(None,<EOL>[inc.search(name) for inc in self.include])))<EOL>and ((not self.exclude)<EOL>or not filter(None,<EOL>[exc.search(name) for exc in self.exclude])<EOL>))<EOL>

Does the name match my requirements?

        To match, a name must match config.testMatch OR config.include
        and it must not match config.exclude


tail = op_basename(dirname)<EOL>if ispackage(dirname):<EOL><INDENT>wanted = (not self.exclude<EOL>or not filter(None,<EOL>[exc.search(tail) for exc in self.exclude]<EOL>))<EOL><DEDENT>else:<EOL><INDENT>wanted = (self.matches(tail)<EOL>or (self.config.srcDirs<EOL>and tail in self.config.srcDirs))<EOL><DEDENT>plug_wants = self.plugins.wantDirectory(dirname)<EOL>if plug_wants is not None:<EOL><INDENT>log.debug("<STR_LIT>",<EOL>dirname, plug_wants)<EOL>wanted = plug_wants<EOL><DEDENT>log.debug("<STR_LIT>", dirname, wanted)<EOL>return wanted<EOL>

Is the directory a wanted test directory?

        All package directories match, so long as they do not match exclude.
        All other directories must match test requirements.


declared = getattr(cls, '<STR_LIT>', None)<EOL>if declared is not None:<EOL><INDENT>wanted = declared<EOL><DEDENT>else:<EOL><INDENT>wanted = (not cls.__name__.startswith('<STR_LIT:_>')<EOL>and (issubclass(cls, unittest.TestCase)<EOL>or self.matches(cls.__name__)))<EOL><DEDENT>plug_wants = self.plugins.wantClass(cls)        <EOL>if plug_wants is not None:<EOL><INDENT>log.debug("<STR_LIT>", cls, plug_wants)<EOL>wanted = plug_wants<EOL><DEDENT>log.debug("<STR_LIT>", cls, wanted)<EOL>return wanted<EOL>

Is the class a wanted test class?

        A class must be a unittest.TestCase subclass, or match test name
        requirements. Classes that start with _ are always excluded.


try:<EOL><INDENT>method_name = method.__name__<EOL><DEDENT>except AttributeError:<EOL><INDENT>return False<EOL><DEDENT>if method_name.startswith('<STR_LIT:_>'):<EOL><INDENT>return False<EOL><DEDENT>declared = getattr(method, '<STR_LIT>', None)<EOL>if declared is not None:<EOL><INDENT>wanted = declared<EOL><DEDENT>else:<EOL><INDENT>wanted = self.matches(method_name)<EOL><DEDENT>plug_wants = self.plugins.wantMethod(method)<EOL>if plug_wants is not None:<EOL><INDENT>wanted = plug_wants<EOL><DEDENT>log.debug("<STR_LIT>", method, wanted)<EOL>return wanted<EOL>


dir = os.path.normpath(os.path.abspath(dir))<EOL>log.debug("<STR_LIT>", fqname, dir)<EOL>if fqname == '<STR_LIT:__main__>':<EOL><INDENT>return sys.modules[fqname]<EOL><DEDENT>if self.config.addPaths:<EOL><INDENT>add_path(dir, self.config)<EOL><DEDENT>path = [dir]<EOL>parts = fqname.split('<STR_LIT:.>')<EOL>part_fqname = '<STR_LIT>'<EOL>mod = parent = fh = None<EOL>for part in parts:<EOL><INDENT>if part_fqname == '<STR_LIT>':<EOL><INDENT>part_fqname = part<EOL><DEDENT>else:<EOL><INDENT>part_fqname = "<STR_LIT>" % (part_fqname, part)<EOL><DEDENT>try:<EOL><INDENT>acquire_lock()<EOL>log.debug("<STR_LIT>",<EOL>part, part_fqname, path)<EOL>fh, filename, desc = find_module(part, path)<EOL>old = sys.modules.get(part_fqname)<EOL>if old is not None:<EOL><INDENT>log.debug("<STR_LIT>", part_fqname, old)<EOL>if (self.sameModule(old, filename)<EOL>or (self.config.firstPackageWins and<EOL>getattr(old, '<STR_LIT>', None))):<EOL><INDENT>mod = old<EOL><DEDENT>else:<EOL><INDENT>del sys.modules[part_fqname]<EOL>mod = load_module(part_fqname, fh, filename, desc)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>mod = load_module(part_fqname, fh, filename, desc)<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>if fh:<EOL><INDENT>fh.close()<EOL><DEDENT>release_lock()<EOL><DEDENT>if parent:<EOL><INDENT>setattr(parent, part, mod)<EOL><DEDENT>if hasattr(mod, '<STR_LIT>'):<EOL><INDENT>path = mod.__path__<EOL><DEDENT>parent = mod<EOL><DEDENT>return mod<EOL>

Import a module *only* from path, ignoring sys.path and
        reloading if the version in sys.modules is not the one we want.


<EOL>log.debug('<STR_LIT>' % path)    <EOL>if not path:<EOL><INDENT>return []<EOL><DEDENT>added = []<EOL>parent = os.path.dirname(path)<EOL>if (parent<EOL>and os.path.exists(os.path.join(path, '<STR_LIT>'))):<EOL><INDENT>added.extend(add_path(parent, config))<EOL><DEDENT>elif not path in sys.path:<EOL><INDENT>log.debug("<STR_LIT>", path)<EOL>sys.path.insert(<NUM_LIT:0>, path)<EOL>added.append(path)<EOL><DEDENT>if config and config.srcDirs:<EOL><INDENT>for dirname in config.srcDirs:<EOL><INDENT>dirpath = os.path.join(path, dirname)<EOL>if os.path.isdir(dirpath):<EOL><INDENT>sys.path.insert(<NUM_LIT:0>, dirpath)<EOL>added.append(dirpath)<EOL><DEDENT><DEDENT><DEDENT>return added<EOL>

Ensure that the path, or the root of the current package (if
    path is in a package), is in sys.path.


if self.setUpFunc:<EOL><INDENT>self.setUpFunc()<EOL><DEDENT>else:<EOL><INDENT>names = ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>try_run(self.test, names)<EOL><DEDENT>

Run any setup function attached to the test function


def decorate(func):<EOL><INDENT>def newfunc(*arg, **kw):<EOL><INDENT>start = time.time()<EOL>func(*arg, **kw)<EOL>end = time.time()<EOL>if end - start > limit:<EOL><INDENT>raise TimeExpired("<STR_LIT>" % limit)<EOL><DEDENT><DEDENT>newfunc = make_decorator(func)(newfunc)<EOL>return newfunc<EOL><DEDENT>return decorate<EOL>

Test must finish within specified time limit to pass.

    Example use::

      @timed(.1)
      def test_that_fails():
          time.sleep(.2)


def __init__(self, examples, globs, name, filename, lineno, docstring):

assert not isinstance(examples, str),"<STR_LIT>"<EOL>self.examples = examples<EOL>self.docstring = docstring<EOL>self.globs = globs.copy()<EOL>self.name = name<EOL>self.filename = filename<EOL>self.lineno = lineno<EOL>

Create a new DocTest containing the given examples.  The
DocTest's globals are initialized with a copy of `globs`.


def _parse_example(self, m, name, lineno):

<EOL>indent = len(m.group('<STR_LIT>'))<EOL>source_lines = m.group('<STR_LIT:source>').split('<STR_LIT:\n>')<EOL>self._check_prompt_blank(source_lines, indent, name, lineno)<EOL>self._check_prefix(source_lines[<NUM_LIT:1>:], '<STR_LIT:U+0020>'*indent + '<STR_LIT:.>', name, lineno)<EOL>source = '<STR_LIT:\n>'.join([sl[indent+<NUM_LIT:4>:] for sl in source_lines])<EOL>want = m.group('<STR_LIT>')<EOL>want_lines = want.split('<STR_LIT:\n>')<EOL>if len(want_lines) > <NUM_LIT:1> and re.match(r'<STR_LIT>', want_lines[-<NUM_LIT:1>]):<EOL><INDENT>del want_lines[-<NUM_LIT:1>]  <EOL><DEDENT>self._check_prefix(want_lines, '<STR_LIT:U+0020>'*indent, name,<EOL>lineno + len(source_lines))<EOL>want = '<STR_LIT:\n>'.join([wl[indent:] for wl in want_lines])<EOL>m = self._EXCEPTION_RE.match(want)<EOL>if m:<EOL><INDENT>exc_msg = m.group('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>exc_msg = None<EOL><DEDENT>options = self._find_options(source, name, lineno)<EOL>return source, options, want, exc_msg<EOL>

Given a regular expression match from `_EXAMPLE_RE` (`m`),
return a pair `(source, want)`, where `source` is the matched
example's source code (with prompts and indentation stripped);
and `want` is the example's expected output (with indentation
stripped).

`name` is the string's name, and `lineno` is the line number
where the example starts; both are used for error messages.


def output_difference(self, example, got, optionflags):

want = example.want<EOL>if not (optionflags & DONT_ACCEPT_BLANKLINE):<EOL><INDENT>got = re.sub('<STR_LIT>', BLANKLINE_MARKER, got)<EOL><DEDENT>if self._do_a_fancy_diff(want, got, optionflags):<EOL><INDENT>want_lines = want.splitlines(True)  <EOL>got_lines = got.splitlines(True)<EOL>if optionflags & REPORT_UDIFF:<EOL><INDENT>diff = difflib.unified_diff(want_lines, got_lines, n=<NUM_LIT:2>)<EOL>diff = list(diff)[<NUM_LIT:2>:] <EOL>kind = '<STR_LIT>'<EOL><DEDENT>elif optionflags & REPORT_CDIFF:<EOL><INDENT>diff = difflib.context_diff(want_lines, got_lines, n=<NUM_LIT:2>)<EOL>diff = list(diff)[<NUM_LIT:2>:] <EOL>kind = '<STR_LIT>'<EOL><DEDENT>elif optionflags & REPORT_NDIFF:<EOL><INDENT>engine = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK)<EOL>diff = list(engine.compare(want_lines, got_lines))<EOL>kind = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>assert <NUM_LIT:0>, '<STR_LIT>'<EOL><DEDENT>diff = [line.rstrip() + '<STR_LIT:\n>' for line in diff]<EOL>return '<STR_LIT>' % kind + _indent('<STR_LIT>'.join(diff))<EOL><DEDENT>if want and got:<EOL><INDENT>return '<STR_LIT>' % (_indent(want), _indent(got))<EOL><DEDENT>elif want:<EOL><INDENT>return '<STR_LIT>' % _indent(want)<EOL><DEDENT>elif got:<EOL><INDENT>return '<STR_LIT>' % _indent(got)<EOL><DEDENT>else:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>

Return a string describing the differences between the
expected output for a given example (`example`) and the actual
output (`got`).  `optionflags` is the set of option flags used
to compare `want` and `got`.


return (self._namefilter is not None and<EOL>self._namefilter(prefix, base))<EOL>

Return true if the given object should not be examined.


def debug_src(src, pm=False, globs=None):

testsrc = script_from_examples(src)<EOL>debug_script(testsrc, pm, globs)<EOL>

Debug a single doctest docstring, in argument `src`


def check_output(self, want, got, optionflags):

<EOL>if got == want:<EOL><INDENT>return True<EOL><DEDENT>if not (optionflags & DONT_ACCEPT_TRUE_FOR_1):<EOL><INDENT>if (got,want) == ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>return True<EOL><DEDENT>if (got,want) == ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>if not (optionflags & DONT_ACCEPT_BLANKLINE):<EOL><INDENT>want = re.sub('<STR_LIT>' % re.escape(BLANKLINE_MARKER),<EOL>'<STR_LIT>', want)<EOL>got = re.sub('<STR_LIT>', '<STR_LIT>', got)<EOL>if got == want:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>if optionflags & NORMALIZE_WHITESPACE:<EOL><INDENT>got = '<STR_LIT:U+0020>'.join(got.split())<EOL>want = '<STR_LIT:U+0020>'.join(want.split())<EOL>if got == want:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>if optionflags & ELLIPSIS:<EOL><INDENT>if _ellipsis_match(want, got):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>return False<EOL>

Return True iff the actual output from an example (`got`)
matches the expected output (`want`).  These strings are
always considered to match if they are identical; but
depending on what option flags the test runner is using,
several non-exact match types are also possible.  See the
documentation for `TestRunner` for more information about
option flags.


if inspect.ismodule(module):<EOL><INDENT>return module<EOL><DEDENT>elif isinstance(module, str):<EOL><INDENT>return __import__(module, globals(), locals(), ["<STR_LIT:*>"])<EOL><DEDENT>elif module is None:<EOL><INDENT>return sys.modules[sys._getframe(depth).f_globals['<STR_LIT>']]<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>

Return the module specified by `module`.  In particular:
  - If `module` is a module, then return module.
  - If `module` is a string, then import and return the
    module with that name.
  - If `module` is None, then return the calling module.
    The calling module is assumed to be the module of
    the stack frame at the given depth in the call stack.


def _check_prefix(self, lines, prefix, name, lineno):

for i, line in enumerate(lines):<EOL><INDENT>if line and not line.startswith(prefix):<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(lineno+i+<NUM_LIT:1>, name, line))<EOL><DEDENT><DEDENT>

Check that every line in the given list starts with the given
prefix; if any line does not, then raise a ValueError.


def find(self, obj, name=None, module=None, globs=None,<EOL>extraglobs=None):

<EOL>if name is None:<EOL><INDENT>name = getattr(obj, '<STR_LIT>', None)<EOL>if name is None:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" %<EOL>(type(obj),))<EOL><DEDENT><DEDENT>if module is False:<EOL><INDENT>module = None<EOL><DEDENT>elif module is None:<EOL><INDENT>module = inspect.getmodule(obj)<EOL><DEDENT>try:<EOL><INDENT>file = inspect.getsourcefile(obj) or inspect.getfile(obj)<EOL>source_lines = linecache.getlines(file)<EOL>if not source_lines:<EOL><INDENT>source_lines = None<EOL><DEDENT><DEDENT>except TypeError:<EOL><INDENT>source_lines = None<EOL><DEDENT>if globs is None:<EOL><INDENT>if module is None:<EOL><INDENT>globs = {}<EOL><DEDENT>else:<EOL><INDENT>globs = module.__dict__.copy()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>globs = globs.copy()<EOL><DEDENT>if extraglobs is not None:<EOL><INDENT>globs.update(extraglobs)<EOL><DEDENT>tests = []<EOL>self._find(tests, obj, name, module, source_lines, globs, {})<EOL>tests.sort()<EOL>return tests<EOL>

Return a list of the DocTests that are defined by the given
object's docstring, or by any of its contained objects'
docstrings.

The optional parameter `module` is the module that contains
the given object.  If the module is not specified or is None, then
the test finder will attempt to automatically determine the
correct module.  The object's module is used:

    - As a default namespace, if `globs` is not specified.
    - To prevent the DocTestFinder from extracting DocTests
      from objects that are imported from other modules.
    - To find the name of the file containing the object.
    - To help find the line number of the object within its
      file.

Contained objects whose module does not match `module` are ignored.

If `module` is False, no attempt to find the module will be made.
This is obscure, of use mostly in tests:  if `module` is False, or
is None but cannot be found automatically, then all objects are
considered to belong to the (non-existent) module, so all contained
objects will (recursively) be searched for doctests.

The globals for each DocTest is formed by combining `globs`
and `extraglobs` (bindings in `extraglobs` override bindings
in `globs`).  A new copy of the globals dictionary is created
for each DocTest.  If `globs` is not specified, then it
defaults to the module's `__dict__`, if specified, or {}
otherwise.  If `extraglobs` is not specified, then it defaults
to {}.


def autohelp_directive(dirname, arguments, options, content, lineno,<EOL>content_offset, block_text, state, state_machine):

config = Config(parserClass=OptBucket,<EOL>plugins=BuiltinPluginManager())<EOL>parser = config.getParser(TestProgram.usage())<EOL>rst = ViewList()<EOL>for line in parser.format_help().split('<STR_LIT:\n>'):<EOL><INDENT>rst.append(line, '<STR_LIT>')<EOL><DEDENT>rst.append('<STR_LIT>', '<STR_LIT>')<EOL>rst.append('<STR_LIT>', '<STR_LIT>')<EOL>rst.append('<STR_LIT>', '<STR_LIT>')<EOL>for opt in parser:<EOL><INDENT>rst.append(opt.options(), '<STR_LIT>')<EOL>rst.append('<STR_LIT>', '<STR_LIT>')<EOL>rst.append('<STR_LIT:U+0020>' + opt.help + '<STR_LIT:\n>', '<STR_LIT>')<EOL>rst.append('<STR_LIT:\n>', '<STR_LIT>')    <EOL><DEDENT>node = nodes.section()<EOL>node.document = state.document<EOL>surrounding_title_styles = state.memo.title_styles<EOL>surrounding_section_level = state.memo.section_level<EOL>state.memo.title_styles = []<EOL>state.memo.section_level = <NUM_LIT:0><EOL>state.nested_parse(rst, <NUM_LIT:0>, node, match_titles=<NUM_LIT:1>)<EOL>state.memo.title_styles = surrounding_title_styles<EOL>state.memo.section_level = surrounding_section_level<EOL>return node.children<EOL>


<EOL>log.debug("<STR_LIT>",<EOL>id(self), self, self._tests)<EOL>if self.resultProxy:<EOL><INDENT>result, orig = self.resultProxy(result, self), result<EOL><DEDENT>else:<EOL><INDENT>result, orig = result, result<EOL><DEDENT>try:<EOL><INDENT>self.setUp()<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>raise<EOL><DEDENT>except:<EOL><INDENT>self.error_context = '<STR_LIT>'<EOL>result.addError(self, self._exc_info())<EOL>return<EOL><DEDENT>try:<EOL><INDENT>for test in self._tests:<EOL><INDENT>if (isinstance(test,nose.case.Test)<EOL>and self.arg is not None):<EOL><INDENT>test.test.arg = self.arg<EOL><DEDENT>else:<EOL><INDENT>test.arg = self.arg<EOL><DEDENT>test.testQueue = self.testQueue<EOL>test.tasks = self.tasks<EOL>if result.shouldStop:<EOL><INDENT>log.debug("<STR_LIT>")<EOL>break<EOL><DEDENT>try:<EOL><INDENT>test(orig)<EOL><DEDENT>except KeyboardInterrupt as e:<EOL><INDENT>timeout = isinstance(e, TimedOutException)<EOL>if timeout:<EOL><INDENT>msg = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>msg = '<STR_LIT>'<EOL><DEDENT>log.debug(msg, test, self)<EOL>err = (TimedOutException,TimedOutException(str(test)),<EOL>sys.exc_info()[<NUM_LIT:2>])<EOL>test.config.plugins.addError(test,err)<EOL>orig.addError(test,err)<EOL>if not timeout:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT><DEDENT>finally:<EOL><INDENT>self.has_run = True<EOL>try:<EOL><INDENT>self.tearDown()<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>raise<EOL><DEDENT>except:<EOL><INDENT>self.error_context = '<STR_LIT>'<EOL>result.addError(self, self._exc_info())<EOL><DEDENT><DEDENT>

Run tests in suite inside of suite fixtures.


self.loaderClass = loader.__class__<EOL>

Remember loader class so MultiProcessTestRunner can instantiate
        the right loader.


try:<EOL><INDENT>self.status.pop('<STR_LIT>')<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>if not hasattr(options, '<STR_LIT>'):<EOL><INDENT>self.enabled = False<EOL>return<EOL><DEDENT>if config.worker:<EOL><INDENT>return<EOL><DEDENT>self.config = config<EOL>try:<EOL><INDENT>workers = int(options.multiprocess_workers)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>workers = <NUM_LIT:0><EOL><DEDENT>if workers:<EOL><INDENT>_import_mp()<EOL>if Process is None:<EOL><INDENT>self.enabled = False<EOL>return<EOL><DEDENT>self.enabled = True<EOL>self.config.multiprocess_workers = workers<EOL>t = float(options.multiprocess_timeout)<EOL>self.config.multiprocess_timeout = t<EOL>r = int(options.multiprocess_restartworker)<EOL>self.config.multiprocess_restartworker = r<EOL>self.status['<STR_LIT>'] = True<EOL><DEDENT>


def _loadTestsFromNames(self, names, module=None):

suite = []<EOL>for p, meth in self.plugins:<EOL><INDENT>result = meth(names, module=module)<EOL>if result is not None:<EOL><INDENT>suite_part, names = result<EOL>if suite_part:<EOL><INDENT>suite.extend(suite_part)<EOL><DEDENT><DEDENT><DEDENT>return suite, names<EOL>

Chainable but not quite normal. Plugins return a tuple of
        (tests, names) after processing the names. The tests are added
        to a suite that is accumulated throughout the full call, while
        names are input for the next plugin in the chain.


from pkg_resources import iter_entry_points<EOL>loaded = {}<EOL>for entry_point, adapt in self.entry_points:<EOL><INDENT>for ep in iter_entry_points(entry_point):<EOL><INDENT>if ep.name in loaded:<EOL><INDENT>continue<EOL><DEDENT>loaded[ep.name] = True<EOL>log.debug('<STR_LIT>', self.__class__.__name__, ep)<EOL>try:<EOL><INDENT>plugcls = ep.load()<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>raise<EOL><DEDENT>except Exception as e:<EOL><INDENT>warn("<STR_LIT>" % (ep, e),<EOL>RuntimeWarning)<EOL>continue<EOL><DEDENT>if adapt:<EOL><INDENT>plug = adapt(plugcls())<EOL><DEDENT>else:<EOL><INDENT>plug = plugcls()<EOL><DEDENT>self.addPlugin(plug)<EOL><DEDENT><DEDENT>super(EntryPointPluginManager, self).loadPlugins()<EOL>

Load plugins by iterating the `nose.plugins` entry point.


for p, meth in self.plugins:<EOL><INDENT>result = None<EOL>try:<EOL><INDENT>result = meth(*arg, **kw)<EOL>if result is not None:<EOL><INDENT>for r in result:<EOL><INDENT>yield r<EOL><DEDENT><DEDENT><DEDENT>except (KeyboardInterrupt, SystemExit):<EOL><INDENT>raise<EOL><DEDENT>except:<EOL><INDENT>exc = sys.exc_info()<EOL>yield Failure(*exc)<EOL>continue<EOL><DEDENT><DEDENT>

Call all plugins, yielding each item in each non-None result.


result = None<EOL>static = [a for (static, a)<EOL>in zip(getattr(self.method, '<STR_LIT>', []), arg)<EOL>if static]<EOL>for p, meth in self.plugins:<EOL><INDENT>result = meth(*arg, **kw)<EOL>arg = static[:]<EOL>arg.append(result)<EOL><DEDENT>return result<EOL>

Call plugins in a chain, where the result of each plugin call is
        sent to the next plugin as input. The final output result is returned.


Plugin.configure(self, options, config)<EOL>self.doctest_result_var = options.doctest_result_var<EOL>self.doctest_tests = options.doctest_tests<EOL>self.extension = tolist(options.doctestExtension)<EOL>self.fixtures = options.doctestFixtures<EOL>self.finder = doctest.DocTestFinder()<EOL>self.optionflags = <NUM_LIT:0><EOL>if options.doctestOptions:<EOL><INDENT>flags = "<STR_LIT:U+002C>".join(options.doctestOptions).split('<STR_LIT:U+002C>')<EOL>for flag in flags:<EOL><INDENT>try:<EOL><INDENT>if flag.startswith('<STR_LIT:+>'):<EOL><INDENT>self.optionflags |= getattr(doctest, flag[<NUM_LIT:1>:])<EOL><DEDENT>elif flag.startswith('<STR_LIT:->'):<EOL><INDENT>self.optionflags &= ~getattr(doctest, flag[<NUM_LIT:1>:])<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" +<EOL>"<STR_LIT>" % (flag,))<EOL><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>raise ValueError("<STR_LIT>" %<EOL>(flag[<NUM_LIT:1>:],))<EOL><DEDENT><DEDENT><DEDENT>


self.conf = conf<EOL>if not options.logcapture or conf.loggingConfig:<EOL><INDENT>self.enabled = False<EOL><DEDENT>self.logformat = options.logcapture_format<EOL>self.logdatefmt = options.logcapture_datefmt<EOL>self.clear = options.logcapture_clear<EOL>self.loglevel = options.logcapture_level<EOL>if options.logcapture_filters:<EOL><INDENT>self.filters = options.logcapture_filters.split('<STR_LIT:U+002C>')<EOL><DEDENT>


if not self:<EOL><INDENT>return True<EOL><DEDENT>return self._allow(record) and not self._deny(record)<EOL>

returns whether this record should be printed


env_opt = '<STR_LIT>'<EOL>parser.add_option('<STR_LIT>', action='<STR_LIT:store_true>',<EOL>dest='<STR_LIT>', default=env.get(env_opt, False),<EOL>help="<STR_LIT>"<EOL>"<STR_LIT>")<EOL>


pass<EOL>

Return true to collect this function as a test, false to
        prevent it from being collected, and None if you don't care.

        :param function: The function object being examined by the selector


pass<EOL>

Called before tests are loaded. To replace the test loader,
        return a test loader. To allow other plugins to process the
        test loader, return None. Only one plugin may replace the test
        loader. Only valid when using nose.TestProgram.

        :param loader: :class:`nose.loader.TestLoader`
             (or other loader) instance


pass<EOL>

Called after all error output has been printed. Print your
        plugin's report to the provided stream. Return None to allow
        other plugins to print reports, any other value to stop them.

        :param stream: stream object; send your output here
        :type stream: file-like object


pass<EOL>

Called before tests are run. To replace the test runner,
        return a test runner. To allow other plugins to process the
        test runner, return None. Only valid when using nose.TestProgram.

        :param runner: :class:`nose.core.TextTestRunner`
             (or other runner) instance


pass<EOL>

Called before a context (generally a module) is
        examined. Because the context is not yet loaded, plugins don't
        get to know what the context is; so any context operations
        should use a stack that is pushed in `beforeContext` and popped
        in `afterContext` to ensure they operate symmetrically.

        `beforeContext` and `afterContext` are mainly useful for tracking
        and restoring global state around possible changes from within a
        context, whatever the context may be. If you need to operate on
        contexts themselves, see `startContext` and `stopContext`, which
        are passed the context in question, but are called after
        it has been loaded (imported in the module case).


def loadTestsFromNames(self, names, module=None):

pass<EOL>

Return a tuple of (tests loaded, remaining names). Return
        None if you are not able to load any tests. Multiple plugins
        may implement loadTestsFromNames; the remaining name list from
        each will be passed to the next as input.

        :param names: List of test names.
        :type names: iterable
        :param module: Module from which the names are to be loaded


def add_options(self, parser, env=None):

<EOL>if env is None:<EOL><INDENT>env = os.environ<EOL><DEDENT>try:<EOL><INDENT>self.options(parser, env)<EOL>self.can_configure = True<EOL><DEDENT>except OptionConflictError as e:<EOL><INDENT>warn("<STR_LIT>"<EOL>"<STR_LIT>" % (self, e), RuntimeWarning)<EOL>self.enabled = False<EOL>self.can_configure = False<EOL><DEDENT>

Non-camel-case version of func name for backwards compatibility.

        .. warning ::

           DEPRECATED: Do not use this method,
           use :meth:`options <nose.plugins.base.IPluginInterface.options>`
           instead.


pass<EOL>

Return true if you want test collection to descend into this
        directory, false if you do not, and None if you don't care.

        :param dirname: Full path to directory being examined by the selector


pass<EOL>

Called after a context (generally a module) has been
        lazy-loaded, imported, setup, had its tests loaded and
        executed, and torn down.


def afterImport(self, filename, module):

pass<EOL>

Called after module is imported from filename. afterImport
        is called even if the import failed.

        :param filename: The file that was loaded
        :type filename: string
        :param filename: The name of the module
        :type module: string


pass<EOL>

Return tests in this test class. Class will *not* be a
        unittest.TestCase subclass. Return None if you are not able to
        load any tests, an iterable if you are. May be a generator.

        :param cls: The test case class. Must be **not** be subclass of
           :class:`unittest.TestCase`.


pass<EOL>

Called before any tests are collected or run. Use this to
        perform any setup needed before testing begins.


from nose import run<EOL>from nose.config import Config<EOL>from nose.plugins.manager import PluginManager<EOL>buffer = Buffer()<EOL>if '<STR_LIT>' not in kw:<EOL><INDENT>plugins = kw.pop('<STR_LIT>', [])<EOL>if isinstance(plugins, list):<EOL><INDENT>plugins = PluginManager(plugins=plugins)<EOL><DEDENT>env = kw.pop('<STR_LIT>', {})<EOL>kw['<STR_LIT>'] = Config(env=env, plugins=plugins)<EOL><DEDENT>if '<STR_LIT>' not in kw:<EOL><INDENT>kw['<STR_LIT>'] = ['<STR_LIT>', '<STR_LIT>']<EOL><DEDENT>kw['<STR_LIT>'].stream = buffer<EOL>stderr = sys.stderr<EOL>stdout = sys.stdout<EOL>if kw.pop('<STR_LIT>', False):<EOL><INDENT>sys.stdout = sys.stderr = buffer<EOL>restore = True<EOL><DEDENT>else:<EOL><INDENT>restore = False<EOL>warn("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>DeprecationWarning, stacklevel=<NUM_LIT:2>)<EOL><DEDENT>try:<EOL><INDENT>run(*arg, **kw)<EOL><DEDENT>finally:<EOL><INDENT>if restore:<EOL><INDENT>sys.stderr = stderr<EOL>sys.stdout = stdout<EOL><DEDENT><DEDENT>out = buffer.getvalue()<EOL>print(munge_nose_output_for_doctest(out))<EOL>

Specialized version of nose.run for use inside of doctests that
test test runs.

This version of run() prints the result output to stdout.  Before
printing, the output is processed by replacing the timing
information with an ellipsis (...), removing traceback stacks, and
removing trailing whitespace.

Use this version of run wherever you are writing a doctest that
tests nose (or unittest) test result output.

Note: do not use doctest: +ELLIPSIS when testing nose output,
since ellipses ("test_foo ... ok") in your expected test runner
output may match multiple lines of output, causing spurious test
passes!


try:<EOL><INDENT>self.status.pop('<STR_LIT>')<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>super(Coverage, self).configure(options, conf)<EOL>if conf.worker:<EOL><INDENT>return<EOL><DEDENT>if self.enabled:<EOL><INDENT>try:<EOL><INDENT>import coverage<EOL><DEDENT>except ImportError:<EOL><INDENT>log.error("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>self.enabled = False<EOL>return<EOL><DEDENT><DEDENT>self.conf = conf<EOL>self.coverErase = options.cover_erase<EOL>self.coverTests = options.cover_tests<EOL>self.coverPackages = []<EOL>if options.cover_packages:<EOL><INDENT>for pkgs in [tolist(x) for x in options.cover_packages]:<EOL><INDENT>self.coverPackages.extend(pkgs)<EOL><DEDENT><DEDENT>self.coverInclusive = options.cover_inclusive<EOL>if self.coverPackages:<EOL><INDENT>log.info("<STR_LIT>",<EOL>self.coverPackages)<EOL><DEDENT>self.coverHtmlDir = None<EOL>if options.cover_html:<EOL><INDENT>self.coverHtmlDir = options.cover_html_dir<EOL>log.debug('<STR_LIT>', self.coverHtmlDir)<EOL><DEDENT>self.coverBranches = options.cover_branches<EOL>self.coverXmlFile = None<EOL>if options.cover_min_percentage:<EOL><INDENT>self.coverMinPercentage = int(options.cover_min_percentage.rstrip('<STR_LIT:%>'))<EOL><DEDENT>if options.cover_xml:<EOL><INDENT>self.coverXmlFile = options.cover_xml_file<EOL>log.debug('<STR_LIT>', self.coverXmlFile)<EOL><DEDENT>if self.enabled:<EOL><INDENT>self.status['<STR_LIT>'] = True<EOL>self.coverInstance = coverage.coverage(auto_data=False,<EOL>branch=self.coverBranches, data_suffix=None)<EOL><DEDENT>


Plugin.options(self, parser, env)<EOL>parser.add_option('<STR_LIT>', action='<STR_LIT:store>', dest='<STR_LIT>',<EOL>default='<STR_LIT>', metavar="<STR_LIT>",<EOL>help="<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>parser.add_option('<STR_LIT>', action='<STR_LIT:store_true>',<EOL>dest='<STR_LIT>', default=False,<EOL>help="<STR_LIT>"<EOL>"<STR_LIT>")<EOL>


if inspect.isclass(obj):<EOL><INDENT>cls_name = obj.__name__<EOL><DEDENT>else:<EOL><INDENT>cls_name = obj.__class__.__name__<EOL><DEDENT>mod = inspect.getmodule(obj)<EOL>if mod:<EOL><INDENT>name = mod.__name__<EOL>if name.startswith('<STR_LIT>'):<EOL><INDENT>name = name[len('<STR_LIT>'):]<EOL><DEDENT>return "<STR_LIT>" % (name, cls_name)<EOL><DEDENT>else:<EOL><INDENT>return cls_name<EOL><DEDENT>

Returns a nice name for class object or class instance.

        >>> nice_classname(Exception()) # doctest: +ELLIPSIS
        '...Exception'
        >>> nice_classname(Exception) # doctest: +ELLIPSIS
        '...Exception'


if not self.can_configure:<EOL><INDENT>return<EOL><DEDENT>self.enabled = options.detailedErrors<EOL>self.conf = conf<EOL>


parser.add_option('<STR_LIT>',<EOL>action='<STR_LIT:store_true>',<EOL>dest=self.enableOpt,<EOL>default=env.get('<STR_LIT>'),<EOL>help="<STR_LIT>" %<EOL>(self.help()))<EOL>


return make_instancemethod(TextTestResult.printErrors, result)<EOL>

Create a new printErrors method that prints errorClasses items
    as well.


return make_instancemethod(TextTestResult.printLabel, result)<EOL>

Create a new printLabel method that prints errorClasses items
    as well.


def wanted(attr, cls=cls, sel=self.selector):<EOL><INDENT>item = getattr(cls, attr, None)<EOL>if isfunction(item):<EOL><INDENT>item = unbound_method(cls, item)<EOL><DEDENT>elif not ismethod(item):<EOL><INDENT>return False<EOL><DEDENT>return sel.wantMethod(item)<EOL><DEDENT>cases = [self.makeTest(getattr(cls, case), cls)<EOL>for case in filter(wanted, dir(cls))]<EOL>for test in self.config.plugins.loadTestsFromTestClass(cls):<EOL><INDENT>cases.append(test)<EOL><DEDENT>return self.suiteClass(ContextList(cases, context=cls))<EOL>

Load tests from a test class that is *not* a unittest.TestCase
        subclass.

        In this case, we can't depend on the class's `__init__` taking method
        name arguments, so we have to compose a MethodTestCase for each
        method in the class that looks testlike.


e = self.exc_info()<EOL>if sys.platform == '<STR_LIT>':<EOL><INDENT>if isinstance(e[<NUM_LIT:0>], StringException):<EOL><INDENT>e = (str(e[<NUM_LIT:0>]), e[<NUM_LIT:1>], e[<NUM_LIT:2>])<EOL><DEDENT><DEDENT>return e<EOL>

Bottleneck to fix up IronPython string exceptions


return sys.exc_info()<EOL>


import textwrap<EOL>class DummyParser:<EOL><INDENT>def __init__(self):<EOL><INDENT>self.options = []<EOL><DEDENT>def add_option(self, *arg, **kw):<EOL><INDENT>self.options.append((arg, kw.pop('<STR_LIT>', '<STR_LIT>')))<EOL><DEDENT><DEDENT>v = self.config.verbosity<EOL>self.config.plugins.sort()<EOL>for p in self.config.plugins:<EOL><INDENT>print("<STR_LIT>" % p.name)<EOL>if v >= <NUM_LIT:2>:<EOL><INDENT>print("<STR_LIT>" % p.score)<EOL>print('<STR_LIT:\n>'.join(textwrap.wrap(p.help().strip(),<EOL>initial_indent='<STR_LIT:U+0020>',<EOL>subsequent_indent='<STR_LIT:U+0020>')))<EOL>if v >= <NUM_LIT:3>:<EOL><INDENT>parser = DummyParser()<EOL>p.addOptions(parser)<EOL>if len(parser.options):<EOL><INDENT>print()<EOL>print("<STR_LIT>")<EOL>for opts, help in parser.options:<EOL><INDENT>print('<STR_LIT>' % ('<STR_LIT:U+002CU+0020>'.join(opts)))<EOL>if help:<EOL><INDENT>print('<STR_LIT:\n>'.join(<EOL>textwrap.wrap(help.strip(),<EOL>initial_indent='<STR_LIT:U+0020>',<EOL>subsequent_indent='<STR_LIT:U+0020>')))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>print()<EOL><DEDENT><DEDENT>


def makeConfig(self, env, plugins=None):

cfg_files = all_config_files()<EOL>if plugins:<EOL><INDENT>manager = PluginManager(plugins=plugins)<EOL><DEDENT>else:<EOL><INDENT>manager = DefaultPluginManager()<EOL><DEDENT>return Config(<EOL>env=env, files=cfg_files, plugins=manager)<EOL>

Load a Config, pre-filled with user config files if any are
        found.


self.config.configure(argv, doc=self.usage())<EOL>log.debug("<STR_LIT>", self.config)<EOL>if self.config.options.version:<EOL><INDENT>from nose import __version__<EOL>sys.stdout = sys.__stdout__<EOL>print("<STR_LIT>" % (os.path.basename(sys.argv[<NUM_LIT:0>]), __version__))<EOL>sys.exit(<NUM_LIT:0>)<EOL><DEDENT>if self.config.options.showPlugins:<EOL><INDENT>self.showPlugins()<EOL>sys.exit(<NUM_LIT:0>)<EOL><DEDENT>if self.testLoader is None:<EOL><INDENT>self.testLoader = defaultTestLoader(config=self.config)<EOL><DEDENT>elif isclass(self.testLoader):<EOL><INDENT>self.testLoader = self.testLoader(config=self.config)<EOL><DEDENT>plug_loader = self.config.plugins.prepareTestLoader(self.testLoader)<EOL>if plug_loader is not None:<EOL><INDENT>self.testLoader = plug_loader<EOL><DEDENT>log.debug("<STR_LIT>", self.testLoader)<EOL>if self.config.testNames:<EOL><INDENT>self.testNames = self.config.testNames<EOL><DEDENT>else:<EOL><INDENT>self.testNames = tolist(self.defaultTest)<EOL><DEDENT>log.debug('<STR_LIT>', self.defaultTest)<EOL>log.debug('<STR_LIT>', self.testNames)<EOL>if self.config.workingDir is not None:<EOL><INDENT>os.chdir(self.config.workingDir)<EOL><DEDENT>self.createTests()<EOL>

Parse argv and env and configure running environment.


log.debug("<STR_LIT>")<EOL>if self.testRunner is None:<EOL><INDENT>self.testRunner = TextTestRunner(stream=self.config.stream,<EOL>verbosity=self.config.verbosity,<EOL>config=self.config)<EOL><DEDENT>plug_runner = self.config.plugins.prepareTestRunner(self.testRunner)<EOL>if plug_runner is not None:<EOL><INDENT>self.testRunner = plug_runner<EOL><DEDENT>result = self.testRunner.run(self.test)<EOL>self.success = result.wasSuccessful()<EOL>if self.exit:<EOL><INDENT>sys.exit(not self.success)<EOL><DEDENT>return self.success<EOL>

Run Tests. Returns true on success, false on failure, and sets
        self.success to the same value.


log.debug("<STR_LIT>", self.suite)<EOL>if self.suite is not None:<EOL><INDENT>self.test = self.testLoader.suiteClass(self.suite)<EOL><DEDENT>else:<EOL><INDENT>self.test = self.testLoader.loadTestsFromNames(self.testNames)<EOL><DEDENT>

Create the tests to run. If a self.suite
        is set, then that suite will be used. Otherwise, tests will be
        loaded from the given test names (self.testNames) using the
        test loader.


log.debug('<STR_LIT>', tb)<EOL>while tb.tb_next:<EOL><INDENT>tb = tb.tb_next<EOL><DEDENT>frame = tb.tb_frame<EOL>lines, exc_line = tbsource(tb)<EOL>inspect_lines, mark_line = find_inspectable_lines(lines, exc_line)<EOL>src = StringIO(textwrap.dedent('<STR_LIT>'.join(inspect_lines)))<EOL>exp = Expander(frame.f_locals, frame.f_globals)<EOL>while inspect_lines:<EOL><INDENT>try:<EOL><INDENT>for tok in tokenize.generate_tokens(src.readline):<EOL><INDENT>exp(*tok)<EOL><DEDENT><DEDENT>except tokenize.TokenError as e:<EOL><INDENT>log.debug("<STR_LIT>", e)<EOL>inspect_lines.pop(<NUM_LIT:0>)<EOL>mark_line -= <NUM_LIT:1><EOL>src = StringIO(textwrap.dedent('<STR_LIT>'.join(inspect_lines)))<EOL>exp = Expander(frame.f_locals, frame.f_globals)<EOL>continue<EOL><DEDENT>break<EOL><DEDENT>padded = []<EOL>if exp.expanded_source:<EOL><INDENT>exp_lines = exp.expanded_source.split('<STR_LIT:\n>')<EOL>ep = <NUM_LIT:0><EOL>for line in exp_lines:<EOL><INDENT>if ep == mark_line:<EOL><INDENT>padded.append('<STR_LIT>' + line)<EOL><DEDENT>else:<EOL><INDENT>padded.append('<STR_LIT:U+0020>' + line)<EOL><DEDENT>ep += <NUM_LIT:1><EOL><DEDENT><DEDENT>return '<STR_LIT:\n>'.join(padded)<EOL>

Inspect a traceback and its frame, returning source for the expression
    where the exception was raised, with simple variable replacement performed
    and the line on which the exception was raised marked with '>>'


lineno = tb.tb_lineno<EOL>frame = tb.tb_frame<EOL>if context > <NUM_LIT:0>:<EOL><INDENT>start = lineno - <NUM_LIT:1> - context//<NUM_LIT:2><EOL>log.debug("<STR_LIT>", lineno, start)<EOL>try:<EOL><INDENT>lines, dummy = inspect.findsource(frame)<EOL><DEDENT>except IOError:<EOL><INDENT>lines, index = ['<STR_LIT>'], <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>all_lines = lines<EOL>start = max(start, <NUM_LIT:1>)<EOL>start = max(<NUM_LIT:0>, min(start, len(lines) - context))<EOL>lines = lines[start:start+context]<EOL>index = lineno - <NUM_LIT:1> - start<EOL>if sys.version_info >= (<NUM_LIT:2>, <NUM_LIT:5>) and index > <NUM_LIT:0>:<EOL><INDENT>while lines[index-<NUM_LIT:1>].strip().endswith('<STR_LIT:\\>'):<EOL><INDENT>start -= <NUM_LIT:1><EOL>lines = all_lines[start:start+context]<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>lines, index = ['<STR_LIT>'], <NUM_LIT:0><EOL><DEDENT>log.debug("<STR_LIT>", lines, index)<EOL>return (lines, index)<EOL>

Get source from  a traceback object.

    A tuple of two things is returned: a list of lines of context from
    the source code, and the index of the current line within that list.
    The optional second argument specifies the number of lines of context
    to return, which are centered around the current line.

    .. Note ::
       This is adapted from inspect.py in the python 2.4 standard library,
       since a bug in the 2.3 version of inspect prevents it from correctly
       locating source lines in a traceback frame.


cnt = re.compile(r'<STR_LIT>')<EOL>df = re.compile(r'<STR_LIT>')<EOL>ind = re.compile(r'<STR_LIT>')<EOL>toinspect = []<EOL>home = lines[pos]<EOL>home_indent = ind.match(home).groups()[<NUM_LIT:0>]<EOL>before = lines[max(pos-<NUM_LIT:3>, <NUM_LIT:0>):pos]<EOL>before.reverse()<EOL>after = lines[pos+<NUM_LIT:1>:min(pos+<NUM_LIT:4>, len(lines))]<EOL>for line in before:<EOL><INDENT>if ind.match(line).groups()[<NUM_LIT:0>] == home_indent:<EOL><INDENT>toinspect.append(line)<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>toinspect.reverse()<EOL>toinspect.append(home)<EOL>home_pos = len(toinspect)-<NUM_LIT:1><EOL>continued = cnt.search(home)<EOL>for line in after:<EOL><INDENT>if ((continued or ind.match(line).groups()[<NUM_LIT:0>] == home_indent)<EOL>and not df.search(line)):<EOL><INDENT>toinspect.append(line)<EOL>continued = cnt.search(line)<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>log.debug("<STR_LIT>", toinspect, home_pos)<EOL>return toinspect, home_pos<EOL>

Find lines in home that are inspectable.

    Walk back from the err line up to 3 lines, but don't walk back over
    changes in indent level.

    Walk forward up to 3 lines, counting \ separated lines as 1. Don't walk
    over changes in indent level (unless part of an extended line)


reactor, reactor_thread = threaded_reactor()<EOL>if reactor is None:<EOL><INDENT>raise ImportError("<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>timeout is None or timeout + <NUM_LIT:0><EOL><DEDENT>except TypeError:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>def decorate(func):<EOL><INDENT>def wrapper(*args, **kargs):<EOL><INDENT>q = Queue()<EOL>def callback(value):<EOL><INDENT>q.put(None)<EOL><DEDENT>def errback(failure):<EOL><INDENT>try:<EOL><INDENT>failure.raiseException()<EOL><DEDENT>except:<EOL><INDENT>q.put(sys.exc_info())<EOL><DEDENT><DEDENT>def g():<EOL><INDENT>try:<EOL><INDENT>d = func(*args, **kargs)<EOL>try:<EOL><INDENT>d.addCallbacks(callback, errback)<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>except:<EOL><INDENT>q.put(sys.exc_info())<EOL><DEDENT><DEDENT>reactor.callFromThread(g)<EOL>try:<EOL><INDENT>error = q.get(timeout=timeout)<EOL><DEDENT>except Empty:<EOL><INDENT>raise TimeExpired("<STR_LIT>"<EOL>% timeout)<EOL><DEDENT>if error is not None:<EOL><INDENT>exc_type, exc_value, tb = error<EOL>raise exc_type(exc_value).with_traceback(tb)<EOL><DEDENT><DEDENT>wrapper = make_decorator(func)(wrapper)<EOL>return wrapper<EOL><DEDENT>return decorate<EOL>

By wrapping a test function with this decorator, you can return a
twisted Deferred and the test will wait for the deferred to be triggered.
The whole test function will run inside the Twisted event loop.

The optional timeout parameter specifies the maximum duration of the test.
The difference with timed() is that timed() will still wait for the test
to end, while deferred() will stop the test when its timeout has expired.
The latter is more desireable when dealing with network tests, because
the result may actually never arrive.

If the callback is triggered, the test has passed.
If the errback is triggered or the timeout expires, the test has failed.

Example::

    @deferred(timeout=5.0)
    def test_resolve():
        return reactor.resolve("www.python.org")

Attention! If you combine this decorator with other decorators (like
"raises"), deferred() must be called *first*!

In other words, this is good::

    @raises(DNSLookupError)
    @deferred()
    def test_error():
        return reactor.resolve("xxxjhjhj.biz")

and this is bad::

    @deferred()
    @raises(DNSLookupError)
    def test_error():
        return reactor.resolve("xxxjhjhj.biz")


if not gurumate.base.get_pid_list(process_name):<EOL><INDENT>fail("<STR_LIT>" % process_name)<EOL>return False <EOL><DEDENT>return True<EOL>

CHECK if process (default=apache2) is not running


if port not in get_listening_ports(process_name):<EOL><INDENT>fail("<STR_LIT>" % port)<EOL><DEDENT>

CHECK if process (default=apache2) is running and listening on port 80


ports = set()<EOL>for _, address_info in gurumate.base.get_listening_ports(process_name):<EOL><INDENT>ports.add(address_info[<NUM_LIT:1>])<EOL><DEDENT>return list(ports)<EOL>

returns a list of listening ports for running process (default=apache2)


try:<EOL><INDENT>response = urllib.request.urlopen(url)<EOL><DEDENT>except HTTPError as e:<EOL><INDENT>return e.code == code<EOL><DEDENT>except:<EOL><INDENT>return False<EOL><DEDENT>return response.code == code<EOL>

Compare the response code of url param with code param and returns boolean
@param url -> string e.g. http://127.0.0.1/index
@param content_type -> int e.g. 404, 500, 400 ..etc


super(CallbackModule, self).__init__(display)<EOL>self.last_skipped = False<EOL>self.last_task_name = None<EOL>self.printed_last_task = False<EOL>


return self.__status<EOL>

Getter method for status, mapped from YANG variable /vlans/vlan/state/status (enumeration)

YANG Description: Admin state of the VLAN


def _set_subinterface(self, v, load=False):

if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=six.text_type,<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__subinterface = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for subinterface, mapped from YANG variable /vlans/vlan/members/member/interface_ref/state/subinterface (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_subinterface is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_subinterface() directly.

    YANG Description: Reference to a subinterface -- this requires the base
interface to be specified using the interface leaf in
this container.  If only a reference to a base interface
is requuired, this leaf should not be set.


def _set_interface_ref(self, v, load=False):

if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=interface_ref.interface_ref,<EOL>is_container="<STR_LIT>",<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>extensions=None,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__interface_ref = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for interface_ref, mapped from YANG variable /vlans/vlan/members/member/interface_ref (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_interface_ref is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_interface_ref() directly.

YANG Description: Reference to an interface or subinterface


return self.__member<EOL>

Getter method for member, mapped from YANG variable /vlans/vlan/members/member (list)

    YANG Description: List of references to interfaces / subinterfaces
associated with the VLAN.


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=six.text_type,<EOL>restriction_type="<STR_LIT>",<EOL>restriction_arg={<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>},<EOL>),<EOL>default=six.text_type("<STR_LIT>"),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=True,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__tpid = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for tpid, mapped from YANG variable /vlans/vlan/config/tpid (identityref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tpid is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tpid() directly.

    YANG Description: Optionally set the tag protocol identifier field (TPID) that
is accepted on the VLAN


return self.__status<EOL>

Getter method for status, mapped from YANG variable /vlans/vlan/config/status (enumeration)

YANG Description: Admin state of the VLAN


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=state.state,<EOL>is_container="<STR_LIT>",<EOL>yang_name="<STR_LIT:state>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>extensions=None,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=True,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__state = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for state, mapped from YANG variable /vlans/vlan/state (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_state is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_state() directly.

YANG Description: State variables for VLANs


return self.__config<EOL>

Getter method for config, mapped from YANG variable /vlans/vlan/config (container)

YANG Description: Configuration parameters for VLANs


return self.__vlan<EOL>

Getter method for vlan, mapped from YANG variable /vlans/vlan (list)

YANG Description: Configured VLANs keyed by id


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=six.text_type,<EOL>restriction_type="<STR_LIT>",<EOL>restriction_arg={<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>},<EOL>),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__facility = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for facility, mapped from YANG variable /system/logging/console/selectors/selector/state/facility (identityref)
If this variable is read-only (config: false) in the
source YANG file, then _set_facility is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_facility() directly.

YANG Description: Specifies the facility, or class of messages to log


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=six.text_type,<EOL>restriction_type="<STR_LIT>",<EOL>restriction_arg={<EOL>"<STR_LIT>": {},<EOL>"<STR_LIT>": {},<EOL>"<STR_LIT>": {},<EOL>"<STR_LIT>": {},<EOL>"<STR_LIT>": {},<EOL>"<STR_LIT>": {},<EOL>"<STR_LIT>": {},<EOL>"<STR_LIT>": {},<EOL>},<EOL>),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__severity = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for severity, mapped from YANG variable /system/logging/console/selectors/selector/state/severity (syslog-severity)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_severity is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_severity() directly.

    YANG Description: Specifies that only messages of the given severity (or
greater severity) for the corresonding facility are logged


return self.__facility<EOL>

Getter method for facility, mapped from YANG variable /system/logging/console/selectors/selector/state/facility (identityref)

YANG Description: Specifies the facility, or class of messages to log


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=six.text_type,<EOL>restriction_type="<STR_LIT>",<EOL>restriction_arg={<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>},<EOL>},<EOL>),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=True,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__facility = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for facility, mapped from YANG variable /system/logging/console/selectors/selector/config/facility (identityref)
If this variable is read-only (config: false) in the
source YANG file, then _set_facility is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_facility() directly.

YANG Description: Specifies the facility, or class of messages to log


parent = getattr(self, "<STR_LIT>", None)<EOL>if parent is not None and load is False:<EOL><INDENT>raise AttributeError(<EOL>"<STR_LIT>" + "<STR_LIT>"<EOL>)<EOL><DEDENT>if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=six.text_type,<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>is_keyval=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=True,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__facility = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for facility, mapped from YANG variable /system/logging/console/selectors/selector/facility (leafref)
If this variable is read-only (config: false) in the
source YANG file, then _set_facility is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_facility() directly.

YANG Description: Reference to facility list key


return self.__facility<EOL>

Getter method for facility, mapped from YANG variable /system/logging/console/selectors/selector/facility (leafref)

YANG Description: Reference to facility list key


return self.__selector<EOL>

Getter method for selector, mapped from YANG variable /system/logging/console/selectors/selector (list)

YANG Description: List of selectors for log messages


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=console.console,<EOL>is_container="<STR_LIT>",<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>extensions=None,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=True,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__console = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for console, mapped from YANG variable /system/logging/console (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_console is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_console() directly.

    YANG Description: Top-level container for data related to console-based
logging


return self.__remote_port<EOL>

Getter method for remote_port, mapped from YANG variable /system/logging/remote_servers/remote_server/state/remote_port (inet:port-number)

    YANG Description: Sets the destination port number for syslog UDP messages to
the server.  The default for syslog is 514.


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=config.config,<EOL>is_container="<STR_LIT>",<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>extensions=None,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=True,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__config = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for config, mapped from YANG variable /system/logging/remote_servers/remote_server/selectors/selector/config (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_config is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_config() directly.

YANG Description: Configuration data


return self.__severity<EOL>

Getter method for severity, mapped from YANG variable /system/logging/remote_servers/remote_server/selectors/selector/severity (leafref)

YANG Description: Reference to severity list key


return self.__host<EOL>

Getter method for host, mapped from YANG variable /system/logging/remote_servers/remote_server/config/host (inet:host)

YANG Description: IP address or hostname of the remote log server


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=[<EOL>RestrictedClassType(<EOL>base_type=six.text_type,<EOL>restriction_dict={<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>},<EOL>),<EOL>RestrictedClassType(<EOL>base_type=six.text_type,<EOL>restriction_dict={<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>},<EOL>),<EOL>RestrictedClassType(<EOL>base_type=six.text_type,<EOL>restriction_dict={<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": ["<STR_LIT>"],<EOL>},<EOL>),<EOL>],<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT:host>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=True,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__host = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for host, mapped from YANG variable /system/logging/remote_servers/remote_server/config/host (inet:host)
If this variable is read-only (config: false) in the
source YANG file, then _set_host is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_host() directly.

YANG Description: IP address or hostname of the remote log server


return self.__remote_port<EOL>

Getter method for remote_port, mapped from YANG variable /system/logging/remote_servers/remote_server/config/remote_port (inet:port-number)

    YANG Description: Sets the destination port number for syslog UDP messages to
the server.  The default for syslog is 514.


return self.__state<EOL>

Getter method for state, mapped from YANG variable /system/logging/remote_servers/remote_server/state (container)

YANG Description: Operational state data for remote log servers


parent = getattr(self, "<STR_LIT>", None)<EOL>if parent is not None and load is False:<EOL><INDENT>raise AttributeError(<EOL>"<STR_LIT>" + "<STR_LIT>"<EOL>)<EOL><DEDENT>if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=six.text_type,<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT:host>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>is_keyval=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=True,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__host = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for host, mapped from YANG variable /system/logging/remote_servers/remote_server/host (leafref)
If this variable is read-only (config: false) in the
source YANG file, then _set_host is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_host() directly.

YANG Description: Reference to the host list key


return self.__boot_time<EOL>

Getter method for boot_time, mapped from YANG variable /system/state/boot_time (oc-types:timeticks64)

    YANG Description: This timestamp indicates the time that the system was last
restarted.  The value is the timestamp in seconds relative
to the Unix Epoch (Jan 1, 1970 00:00:00 UTC).


def _set_login_banner(self, v, load=False):

if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=six.text_type,<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT:string>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT:string>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__login_banner = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for login_banner, mapped from YANG variable /system/state/login_banner (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_login_banner is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_login_banner() directly.

    YANG Description: The console login message displayed before the login prompt,
i.e., before a user logs into the system.


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=six.text_type,<EOL>restriction_dict={<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": ["<STR_LIT>"],<EOL>},<EOL>),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__hostname = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for hostname, mapped from YANG variable /system/state/hostname (inet:domain-name)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_hostname is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_hostname() directly.

    YANG Description: The hostname of the device -- should be a single domain
label, without the domain.


return self.__current_datetime<EOL>

Getter method for current_datetime, mapped from YANG variable /system/state/current_datetime (yang:date-and-time)

    YANG Description: [adapted from IETF system model RFC 7317]

The current system date and time.


return self.__timezone_name<EOL>

Getter method for timezone_name, mapped from YANG variable /system/clock/state/timezone_name (timezone-name-type)

    YANG Description: The TZ database name to use for the system, such
as 'Europe/Stockholm'.


return self.__timezone_name<EOL>

Getter method for timezone_name, mapped from YANG variable /system/clock/config/timezone_name (timezone-name-type)

    YANG Description: The TZ database name to use for the system, such
as 'Europe/Stockholm'.


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=YANGBool,<EOL>default=YANGBool("<STR_LIT:false>"),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__enabled = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for enabled, mapped from YANG variable /system/ntp/state/enabled (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enabled is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enabled() directly.

    YANG Description: [adapted from IETF system model RFC 7317]

Enables the NTP protocol and indicates that the system should
attempt to synchronize the system clock with an NTP server
from the servers defined in the 'ntp/server' list.


def _set_auth_mismatch(self, v, load=False):

if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=long,<EOL>restriction_dict={"<STR_LIT>": ["<STR_LIT>"]},<EOL>int_size=<NUM_LIT:64>,<EOL>),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__auth_mismatch = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for auth_mismatch, mapped from YANG variable /system/ntp/state/auth_mismatch (yang:counter64)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_auth_mismatch is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_auth_mismatch() directly.

    YANG Description: Count of the number of NTP packets received that were not
processed due to authentication mismatch.


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=int, restriction_dict={"<STR_LIT>": ["<STR_LIT>"]}, int_size=<NUM_LIT:16><EOL>),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__key_id = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for key_id, mapped from YANG variable /system/ntp/ntp_keys/ntp_key/state/key_id (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_key_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_key_id() directly.

    YANG Description: Integer identifier used by the client and server to
designate a secret key.  The client and server must use
the same key id.


return self.__key_id<EOL>

Getter method for key_id, mapped from YANG variable /system/ntp/ntp_keys/ntp_key/state/key_id (uint16)

    YANG Description: Integer identifier used by the client and server to
designate a secret key.  The client and server must use
the same key id.


return self.__key_value<EOL>

Getter method for key_value, mapped from YANG variable /system/ntp/ntp_keys/ntp_key/config/key_value (string)

YANG Description: NTP authentication key value


Setter method for state, mapped from YANG variable /system/ntp/ntp_keys/ntp_key/state (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_state is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_state() directly.

YANG Description: Operational state data for NTP auth keys


return self.__state<EOL>

Getter method for state, mapped from YANG variable /system/ntp/ntp_keys/ntp_key/state (container)

YANG Description: Operational state data for NTP auth keys


Setter method for config, mapped from YANG variable /system/ntp/ntp_keys/ntp_key/config (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_config is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_config() directly.

YANG Description: Configuration data for NTP auth keys


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=ntp_keys.ntp_keys,<EOL>is_container="<STR_LIT>",<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>extensions=None,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=True,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__ntp_keys = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for ntp_keys, mapped from YANG variable /system/ntp/ntp_keys (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_ntp_keys is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_ntp_keys() directly.

YANG Description: Enclosing container for list of NTP authentication keys


return self.__config<EOL>

Getter method for config, mapped from YANG variable /system/ntp/config (container)

YANG Description: Configuration data for NTP client.


def _set_association_type(self, v, load=False):

if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=six.text_type,<EOL>restriction_type="<STR_LIT>",<EOL>restriction_arg={"<STR_LIT>": {}, "<STR_LIT>": {}, "<STR_LIT>": {}},<EOL>),<EOL>default=six.text_type("<STR_LIT>"),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__association_type = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for association_type, mapped from YANG variable /system/ntp/servers/server/state/association_type (enumeration)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_association_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_association_type() directly.

    YANG Description: [adapted from IETF system model RFC 7317]

The desired association type for this NTP server.


return self.__address<EOL>

Getter method for address, mapped from YANG variable /system/ntp/servers/server/state/address (inet:host)

    YANG Description: [adapted from IETF system model RFC 7317]

The address or hostname of the NTP server.


def _set_poll_interval(self, v, load=False):

if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=long,<EOL>restriction_dict={"<STR_LIT>": ["<STR_LIT>"]},<EOL>int_size=<NUM_LIT:32>,<EOL>),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__poll_interval = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for poll_interval, mapped from YANG variable /system/ntp/servers/server/state/poll_interval (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_poll_interval is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_poll_interval() directly.

YANG Description: Polling interval of the peer


return self.__iburst<EOL>

Getter method for iburst, mapped from YANG variable /system/ntp/servers/server/state/iburst (boolean)

    YANG Description: [adapted from IETF system model RFC 7317]

Indicates whether this server should enable burst
synchronization or not.


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=int, restriction_dict={"<STR_LIT>": ["<STR_LIT>"]}, int_size=<NUM_LIT:8><EOL>),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__stratum = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for stratum, mapped from YANG variable /system/ntp/servers/server/state/stratum (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_stratum is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_stratum() directly.

    YANG Description: Indicates the level of the server in the NTP hierarchy. As
stratum number increases, the accuracy is degraded.  Primary
servers are stratum while a maximum value of 16 indicates
unsynchronized.  The values have the following specific
semantics:

| 0      | unspecified or invalid
| 1      | primary server (e.g., equipped with a GPS receiver)
| 2-15   | secondary server (via NTP)
| 16     | unsynchronized
| 17-255 | reserved


if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v._utype(v)<EOL><DEDENT>try:<EOL><INDENT>t = YANGDynClass(<EOL>v,<EOL>base=RestrictedClassType(<EOL>base_type=RestrictedClassType(<EOL>base_type=int,<EOL>restriction_dict={"<STR_LIT>": ["<STR_LIT>"]},<EOL>int_size=<NUM_LIT:8>,<EOL>),<EOL>restriction_dict={"<STR_LIT>": ["<STR_LIT>"]},<EOL>),<EOL>default=RestrictedClassType(<EOL>base_type=int, restriction_dict={"<STR_LIT>": ["<STR_LIT>"]}, int_size=<NUM_LIT:8><EOL>)(<EOL><NUM_LIT:4><EOL>),<EOL>is_leaf=True,<EOL>yang_name="<STR_LIT:version>",<EOL>parent=self,<EOL>path_helper=self._path_helper,<EOL>extmethods=self._extmethods,<EOL>register_paths=True,<EOL>namespace="<STR_LIT>",<EOL>defining_module="<STR_LIT>",<EOL>yang_type="<STR_LIT>",<EOL>is_config=False,<EOL>)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>raise ValueError(<EOL>{<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": """<STR_LIT>""",<EOL>}<EOL>)<EOL><DEDENT>self.__version = t<EOL>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>self._set()<EOL><DEDENT>

Setter method for version, mapped from YANG variable /system/ntp/servers/server/state/version (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_version is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_version() directly.

    YANG Description: [adapted from IETF system model RFC 7317]

Version number to put in outgoing NTP packets


return self.__prefer<EOL>

Getter method for prefer, mapped from YANG variable /system/ntp/servers/server/config/prefer (boolean)

    YANG Description: [adapted from IETF system model RFC 7317]

Indicates whether this server should be preferred
or not.


return self.__association_type<EOL>

Getter method for association_type, mapped from YANG variable /system/ntp/servers/server/config/association_type (enumeration)

    YANG Description: [adapted from IETF system model RFC 7317]

The desired association type for this NTP server.