Return list of directives together with expected arguments
    and places where the directive is valid (``apachectl -L``)

    CLI Example:

    .. code-block:: bash

        salt '*' apache.directives
777261
def directives():
    '''
    
    '''
    cmd = '{0} -L'.format(_detect_os())
    ret = {}
    out = __salt__['cmd.run'](cmd)
    out = out.replace('\n\t', '\t')
    for line in out.splitlines():
        if not line:
            continue
        comps = line.split('\t')
        desc = '\n'.join(comps[1:])
        ret[comps[0]] = desc
    return ret
680673
def expand_args(cmd_args):
    
    if isinstance(cmd_args, (tuple, list)):
        args_list = list(cmd_args)
    else:
        args_list = shlex.split(cmd_args)
    return args_list
517290
def find_directives(text, klass):
    
    directives = []
    for directive in parse_str(text):
        method = klass.__getattribute__(directive[0])
        args = directive[1:]
        directives.append((method, args))
    return directives
166611
def p_declare_list(p):
    ''''''
    if len(p) == 4:
        p[0] = [ast.Directive(p[1], p[3], lineno=p.lineno(1))]
    else:
        p[0] = p[1] + [ast.Directive(p[3], p[5], lineno=p.lineno(2))]
62053
def commandline_to_list(self, cmdline_str, trigger_string):
        '''
        
        '''
        cmdline = salt.utils.args.shlex_split(cmdline_str[len(trigger_string):])
        # Remove slack url parsing
        #  Translate target=<http://host.domain.net|host.domain.net>
        #  to target=host.domain.net
        cmdlist = []
        for cmditem in cmdline:
            pattern = r'(?P<begin>.*)(<.*\|)(?P<url>.*)(>)(?P<remainder>.*)'
            mtch = re.match(pattern, cmditem)
            if mtch:
                origtext = mtch.group('begin') + mtch.group('url') + mtch.group('remainder')
                cmdlist.append(origtext)
            else:
                cmdlist.append(cmditem)
        return cmdlist
1107573
def command_ls(self, list_what):
        
        if list_what in ('available', 'mounted', 'unmounted'):
            callback = getattr(self.environment, 'get_%s_ids' % list_what)
            lst = callback()
        else:
            lst = []
        if len(lst) != 0:
            print(("\n".join(lst)))
35120
def list_():
    '''
    
    '''
    mdata = _check_mdata_list()
    if mdata:
        cmd = '{0}'.format(mdata)
        return __salt__['cmd.run'](cmd, ignore_retcode=True).splitlines()
    return {}
221448
def _get_proc_cmdline(proc):
    '''
    
    '''
    try:
        return salt.utils.data.decode(proc.cmdline() if PSUTIL2 else proc.cmdline)
    except (psutil.NoSuchProcess, psutil.AccessDenied):
        return []
500861
def list_commands(self, ctx):
        """"""
        commands = []
        for filename in os.listdir(self.path):
            if filename == '__init__.py':
                continue
            if filename.endswith('.py'):
                commands.append(filename[:-3].replace("_", "-"))
        commands.sort()
        return commands
290308
def withArgs(self, *args, **kwargs): #pylint: disable=invalid-name
        
        def check(): #pylint: disable=missing-docstring
            return super(SinonExpectation, self).calledWith(*args, **kwargs)
        self.valid_list.append(check)
        return self
396637
def parse_cmd_arguments():
    """"""
    parser = argparse.ArgumentParser()
    parser.add_argument('file', type=str,
                        help='Filename to be staticfied')
    parser.add_argument('--static-endpoint',
                        help='Static endpoint which is "static" by default')
    parser.add_argument('--add-tags', type=str,
                        help='Additional tags to staticfy')
    parser.add_argument('--exc-tags', type=str, help='tags to exclude')
    parser.add_argument('--framework', type=str,
                        help='Web Framework: Defaults to Flask')
    parser.add_argument('--namespace', type=str,
                        help='String to prefix url with')
    parser.add_argument('-o', type=str, help='Specify output file')
    parser.add_argument('--output', type=str, help='Specify output file')
    args = parser.parse_args()

    return args
609112
public function getDirectives()
    {
        return array(
            new Directives\Dummy,
            new Directives\CodeBlock,
            new Directives\Raw,
            new Directives\Replace,
            new Directives\Toctree,
            new Directives\Document,
            new Directives\RedirectionTitle,
        );
    }
892023
def directives(self):
        """"""
        directive_sources = chain(hug.defaults.directives.items(), getattr(self, '_directives', {}).items())
        return {'hug_' + directive_name: directive for directive_name, directive in directive_sources}
979455
def _get_directives_and_roles_from_sphinx():
    """"""
    if SPHINX_INSTALLED:
        sphinx_directives = list(sphinx.domains.std.StandardDomain.directives)
        sphinx_roles = list(sphinx.domains.std.StandardDomain.roles)

        for domain in [sphinx.domains.c.CDomain,
                       sphinx.domains.cpp.CPPDomain,
                       sphinx.domains.javascript.JavaScriptDomain,
                       sphinx.domains.python.PythonDomain]:

            sphinx_directives += list(domain.directives) + [
                '{}:{}'.format(domain.name, item)
                for item in list(domain.directives)]

            sphinx_roles += list(domain.roles) + [
                '{}:{}'.format(domain.name, item)
                for item in list(domain.roles)]
    else:
        sphinx_roles = [
            'abbr',
            'command',
            'dfn',
            'doc',
            'download',
            'envvar',
            'file',
            'guilabel',
            'kbd',
            'keyword',
            'mailheader',
            'makevar',
            'manpage',
            'menuselection',
            'mimetype',
            'newsgroup',
            'option',
            'program',
            'py:func',
            'ref',
            'regexp',
            'samp',
            'term',
            'token']

        sphinx_directives = [
            'autosummary',
            'currentmodule',
            'centered',
            'c:function',
            'c:type',
            'include',
            'deprecated',
            'envvar',
            'glossary',
            'index',
            'no-code-block',
            'literalinclude',
            'hlist',
            'option',
            'productionlist',
            'py:function',
            'seealso',
            'toctree',
            'todo',
            'versionadded',
            'versionchanged']

    return (sphinx_directives, sphinx_roles)
1276429
def list(*args, &block) # :yield: line
      cmd = "LIST"
      args.each do |arg|
        cmd = cmd + " " + arg.to_s
      end
      if block
        retrlines(cmd, &block)
      else
        lines = []
        retrlines(cmd) do |line|
          lines << line
        end
        return lines
      end
    end
339329
def build_value
      directives.map do |directive_name|
        case DIRECTIVE_VALUE_TYPES[directive_name]
        when :source_list, :require_sri_for_list # require_sri is a simple set of strings that don't need to deal with symbol casing
          build_source_list_directive(directive_name)
        when :boolean
          symbol_to_hyphen_case(directive_name) if @config.directive_value(directive_name)
        when :sandbox_list
          build_sandbox_list_directive(directive_name)
        when :media_type_list
          build_media_type_list_directive(directive_name)
        end
      end.compact.join("; ")
    end
170861
def _systemctl_cmd(action, name=None, systemd_scope=False, no_block=False,
                   root=None):
    '''
    
    '''
    ret = []
    if systemd_scope \
            and salt.utils.systemd.has_scope(__context__) \
            and __salt__['config.get']('systemd.scope', True):
        ret.extend(['systemd-run', '--scope'])
    ret.append('systemctl')
    if no_block:
        ret.append('--no-block')
    if root:
        ret.extend(['--root', root])
    if isinstance(action, six.string_types):
        action = shlex.split(action)
    ret.extend(action)
    if name is not None:
        ret.append(_canonical_unit_name(name))
    if 'status' in ret:
        ret.extend(['-n', '0'])
    return ret