Parses the output of the provisioning for changed and returns a bool.

        :param output: A string containing the output of the ansible run.
        :return: bool
493839
def _is_idempotent(self, output):
        

        # Remove blank lines to make regex matches easier
        output = re.sub(r'\n\s*\n*', '\n', output)

        # Look for any non-zero changed lines
        changed = re.search(r'(changed=[1-9][0-9]*)', output)

        if changed:
            # Not idempotent
            return False

        return True
1219604
def _get_version_output(self):
        
        if not self.executable:
            return ''
        command = [self.executable, '--version']
        out, _, _ = self._check(self.conn, command)
        try:
            return out.decode('utf-8').split()[2]
        except IndexError:
            return ''
128087
def output_for(cmd, options = {})
      output = StringIO.new
      execute(cmd, options.merge(:outstream => output))
      output.string
    end
401274
def changed(dirname, filename='.md5', args=None, glob=None):
    
    root = Path(dirname)
    if not root.exists():
        # if dirname doesn't exist it is changed (by definition)
        return True

    cachefile = root / filename
    current_digest = cachefile.open().read() if cachefile.exists() else ""
    
    _digest = digest(dirname, glob=glob)
    if args and args.verbose:  # pragma: nocover
        print("md5:", _digest)
    has_changed = current_digest != _digest

    if has_changed:
        with open(os.path.join(dirname, filename), 'w') as fp:
            fp.write(_digest)

    return has_changed
542189
def write_output(self):
        
        self.tcex.log.info('Writing Output')
        self.tcex.playbook.create_output('json.pretty', self.pretty_json)
407340
def subprocess_check_output(*args, cwd=None, env=None, stderr=False):
    

    if stderr:
        proc = yield from asyncio.create_subprocess_exec(*args, stderr=asyncio.subprocess.PIPE, cwd=cwd, env=env)
        output = yield from proc.stderr.read()
    else:
        proc = yield from asyncio.create_subprocess_exec(*args, stdout=asyncio.subprocess.PIPE, cwd=cwd, env=env)
        output = yield from proc.stdout.read()
    if output is None:
        return ""
    # If we received garbage we ignore invalid characters
    # it should happens only when user try to use another binary
    # and the code of VPCS, dynamips... Will detect it's not the correct binary
    return output.decode("utf-8", errors="ignore")
342129
def _output_from_file(self, entry='git_describe'):
        
        try:
            vfile = os.path.join(os.path.dirname(self.fpath), '.version')
            with open(vfile, 'r') as f:
                return json.loads(f.read()).get(entry, None)
        except: # File may be missing if using pip + git archive
            return None
1100709
def check_output(self, cmd, timeout=None, keep_rc=False, env=None):
        
        return subproc.call(cmd, timeout=timeout or self.timeout,
                keep_rc=keep_rc, env=env)
702119
def print
      return unless $stdout.tty?
      return if recently_fetched?

      resp = fetch_server_message
      update_fetched
      puts resp unless resp.empty?
    end
643187
def parse_changelog(args: Any) -> Tuple[str, str]:
    """"""
    with open("CHANGELOG.rst", "r") as file:
        match = re.match(
            pattern=r"(.*?Unreleased\n---+\n)(.+?)(\n*[^\n]+\n---+\n.*)",
            string=file.read(),
            flags=re.DOTALL,
        )
    assert match
    header, changes, tail = match.groups()
    tag = "%s - %s" % (args.tag, datetime.date.today().isoformat())

    tagged = "\n%s\n%s\n%s" % (tag, "-" * len(tag), changes)
    if args.verbose:
        print(tagged)

    return "".join((header, tagged, tail)), changes
1137443
def get_output(script, expanded):
    
    env = dict(os.environ)
    env.update(settings.env)

    is_slow = shlex.split(expanded) in settings.slow_commands
    with logs.debug_time(u'Call: {}; with env: {}; is slow: '.format(
            script, env, is_slow)):
        result = Popen(expanded, shell=True, stdin=PIPE,
                       stdout=PIPE, stderr=STDOUT, env=env)
        if _wait_output(result, is_slow):
            output = result.stdout.read().decode('utf-8')
            logs.debug(u'Received output: {}'.format(output))
            return output
        else:
            logs.debug(u'Execution timed out!')
            return None
1350293
def show_output(self, txt, device='Console'):
        
        if device == 'Console':
            print(txt)
        elif device == 'File':
            raise ('show_output to File not implemented')
        elif device == 'Function_Return':  # hacky, to run test_AI_CLI.py
            return txt
232155
def current_command_version
      output = command('version', [], false)
      version = output[/\d+\.\d+(\.\d+)+/]
      version.split('.').collect {|i| i.to_i}
    end
1151192
def parse_output(output, keep=("INCLUDE", "LIB", "LIBPATH", "PATH")):
    

    # dkeep is a dict associating key: path_list, where key is one item from
    # keep, and pat_list the associated list of paths
    dkeep = dict([(i, []) for i in keep])

    # rdk will  keep the regex to match the .bat file output line starts
    rdk = {}
    for i in keep:
        rdk[i] = re.compile('%s=(.*)' % i, re.I)

    def add_env(rmatch, key, dkeep=dkeep):
        path_list = rmatch.group(1).split(os.pathsep)
        for path in path_list:
            # Do not add empty paths (when a var ends with ;)
            if path:
                # XXX: For some reason, VC98 .bat file adds "" around the PATH
                # values, and it screws up the environment later, so we strip
                # it.
                path = path.strip('"')
                dkeep[key].append(str(path))

    for line in output.splitlines():
        for k, value in rdk.items():
            match = value.match(line)
            if match:
                add_env(match, k)

    return dkeep
1002025
def _nested_changes(changes):
    '''
    
    '''
    ret = '\n'
    ret += salt.output.out_format(
            changes,
            'nested',
            __opts__,
            nested_indent=14)
    return ret
785852
def expect_output(output)
      if output.respond_to?(:~)
        assert_matching_output(output.to_s, all_output)
      else
        assert_partial_output(output, all_output)
      end
    end
654965
def get_progress(opts, out, progress):
    '''
    
    '''
    return salt.loader.raw_mod(opts,
                                out,
                                'rawmodule',
                                mod='output')['{0}.progress_iter'.format(out)](progress)