st2common/st2common/util/actionalias_matching.py
def normalise_alias_format_string(alias_format):
    '''
    StackStorm action aliases come in two forms;
        1. A string holding the format, which is also used as the help string.
        2. A dictionary containing "display" and/or "representation" keys.
           "representation": a list of numerous alias format "representation(s)"
           "display": a help string to be displayed.
    This function processes both forms and returns a standardized form.

    :param alias_format: The alias format
    :type  alias_format: ``str`` or ``dict``

    :return: The representation of the alias
    :rtype: ``tuple`` of (``str``, ``str``)
    '''
    display = None
    representation = []

    if isinstance(alias_format, six.string_types):
        display = alias_format
        representation.append(alias_format)
    elif isinstance(alias_format, dict):
        display = alias_format.get('display')
        representation = alias_format.get('representation') or []
        if isinstance(representation, six.string_types):
            representation = [representation]
    else:
        raise TypeError("alias_format '%s' is neither a dictionary or string type."
                        % repr(alias_format))
    return (display, representation)

    StackStorm action aliases come in two forms;
        1. A string holding the format, which is also used as the help string.
        2. A dictionary containing "display" and/or "representation" keys.
           "representation": a list of numerous alias format "representation(s)"
           "display": a help string to be displayed.
    This function processes both forms and returns a standardized form.

    :param alias_format: The alias format
    :type  alias_format: ``str`` or ``dict``

    :return: The representation of the alias
    :rtype: ``tuple`` of (``str``, ``str``)
    
StackStorm action aliases come in two forms;
1. A string holding the format, which is also used as the help string.
2. A dictionary containing "display" and/or "representation" keys.
StackStorm action aliases come in two forms ; 1 . A string holding the format which is also used as the help string . 2 . A dictionary containing " display " and / or " representation " keys .
def normalise_alias_format_string(alias_format):
    display = None
    representation = []
    if isinstance(alias_format, six.string_types):
        display = alias_format
        representation.append(alias_format)
    elif isinstance(alias_format, dict):
        display = alias_format.get('display')
        representation = alias_format.get('representation') or []
        if isinstance(representation, six.string_types):
            representation = [representation]
    else:
        raise TypeError("alias_format '%s' is neither a dictionary or string type."
                        % repr(alias_format))
    return (display, representation)
def normalise_alias_format_string ( alias_format ) : display = None representation = [ ] if isinstance ( alias_format , six . string_types ) : display = alias_format representation . append ( alias_format ) elif isinstance ( alias_format , dict ) : display = alias_format . get ( 'display' ) representation = alias_format . get ( 'representation' ) or [ ] if isinstance ( representation , six . string_types ) : representation = [ representation ] else : raise TypeError ( "alias_format '%s' is neither a dictionary or string type." % repr ( alias_format ) ) return ( display , representation )
StackStorm action aliases come in two forms;
1.
StackStorm action aliases come in two forms ; 1 .
'''
    StackStorm action aliases come in two forms;
        1. A string holding the format, which is also used as the help string.
        2. A dictionary containing "display" and/or "representation" keys.
           "representation": a list of numerous alias format "representation(s)"
           "display": a help string to be displayed.
    This function processes both forms and returns a standardized form.

    :param alias_format: The alias format
    :type  alias_format: ``str`` or ``dict``

    :return: The representation of the alias
    :rtype: ``tuple`` of (``str``, ``str``)
    '''
The representation of the alias
The representation of the alias
``tuple`` of (``str``, ``str``)
alias_format
The alias format
The alias format