def generate_example_input(inptype: Optional[CWLOutputType], default: Optional[CWLOutputType]) -> Tuple[(Any, str)]:
    'Convert a single input schema into an example.'
    example = None
    comment = ''
    defaults = {'null': 'null', 'Any': 'null', 'boolean': False, 'int': 0, 'long': 0, 'float': 0.1, 'double': 0.1, 'string': 'a_string', 'File': ruamel.yaml.comments.CommentedMap([('class', 'File'), ('path', 'a/file/path')]), 'Directory': ruamel.yaml.comments.CommentedMap([('class', 'Directory'), ('path', 'a/directory/path')])}
    if isinstance(inptype, MutableSequence):
        optional = False
        if ('null' in inptype):
            inptype.remove('null')
            optional = True
        if (len(inptype) == 1):
            (example, comment) = generate_example_input(inptype[0], default)
            if optional:
                if comment:
                    comment = f'{comment} (optional)'
                else:
                    comment = 'optional'
        else:
            example = CommentedSeq()
            for (index, entry) in enumerate(inptype):
                (value, e_comment) = generate_example_input(entry, default)
                example.append(value)
                example.yaml_add_eol_comment(e_comment, index)
            if optional:
                comment = 'optional'
    elif (isinstance(inptype, Mapping) and ('type' in inptype)):
        if (inptype['type'] == 'array'):
            first_item = cast(MutableSequence[CWLObjectType], inptype['items'])[0]
            items_len = len(cast(Sized, inptype['items']))
            if ((items_len == 1) and ('type' in first_item) and (first_item['type'] == 'enum')):
                example = first_item['symbols']
                if ('name' in first_item):
                    comment = 'array of type "{}".'.format(first_item['name'])
            else:
                (value, comment) = generate_example_input(inptype['items'], None)
                comment = ('array of ' + comment)
                if (items_len == 1):
                    example = [value]
                else:
                    example = value
            if (default is not None):
                example = default
        elif (inptype['type'] == 'enum'):
            symbols = cast(List[str], inptype['symbols'])
            if (default is not None):
                example = default
            elif ('default' in inptype):
                example = inptype['default']
            elif (len(cast(Sized, inptype['symbols'])) == 1):
                example = symbols[0]
            else:
                example = '{}_enum_value'.format(inptype.get('name', 'valid'))
            comment = 'enum; valid values: "{}"'.format('", "'.join(symbols))
        elif (inptype['type'] == 'record'):
            example = ruamel.yaml.comments.CommentedMap()
            if ('name' in inptype):
                comment = '"{}" record type.'.format(inptype['name'])
            else:
                comment = 'Anonymous record type.'
            for field in cast(List[CWLObjectType], inptype['fields']):
                (value, f_comment) = generate_example_input(field['type'], None)
                example.insert(0, shortname(cast(str, field['name'])), value, f_comment)
        elif ('default' in inptype):
            example = inptype['default']
            comment = 'default value of type "{}".'.format(inptype['type'])
        else:
            example = defaults.get(cast(str, inptype['type']), str(inptype))
            comment = 'type "{}".'.format(inptype['type'])
    elif (not default):
        example = defaults.get(str(inptype), str(inptype))
        comment = f'type "{inptype}"'
    else:
        example = default
        comment = f'default value of type "{inptype}".'
    return (example, comment)
Convert a single input schema into an example.
def generate_example_input(inptype: Optional[CWLOutputType], default: Optional[CWLOutputType]) -> Tuple[(Any, str)]:
    
    example = None
    comment = 
    defaults = {'null': 'null', 'Any': 'null', 'boolean': False, 'int': 0, 'long': 0, 'float': 0.1, 'double': 0.1, 'string': 'a_string', 'File': ruamel.yaml.comments.CommentedMap([('class', 'File'), ('path', 'a/file/path')]), 'Directory': ruamel.yaml.comments.CommentedMap([('class', 'Directory'), ('path', 'a/directory/path')])}
    if isinstance(inptype, MutableSequence):
        optional = False
        if ('null' in inptype):
            inptype.remove('null')
            optional = True
        if (len(inptype) == 1):
            (example, comment) = generate_example_input(inptype[0], default)
            if optional:
                if comment:
                    comment = f'{comment} (optional)'
                else:
                    comment = 'optional'
        else:
            example = CommentedSeq()
            for (index, entry) in enumerate(inptype):
                (value, e_comment) = generate_example_input(entry, default)
                example.append(value)
                example.yaml_add_eol_comment(e_comment, index)
            if optional:
                comment = 'optional'
    elif (isinstance(inptype, Mapping) and ('type' in inptype)):
        if (inptype['type'] == 'array'):
            first_item = cast(MutableSequence[CWLObjectType], inptype['items'])[0]
            items_len = len(cast(Sized, inptype['items']))
            if ((items_len == 1) and ('type' in first_item) and (first_item['type'] == 'enum')):
                example = first_item['symbols']
                if ('name' in first_item):
                    comment = 'array of type "{}".'.format(first_item['name'])
            else:
                (value, comment) = generate_example_input(inptype['items'], None)
                comment = ('array of ' + comment)
                if (items_len == 1):
                    example = [value]
                else:
                    example = value
            if (default is not None):
                example = default
        elif (inptype['type'] == 'enum'):
            symbols = cast(List[str], inptype['symbols'])
            if (default is not None):
                example = default
            elif ('default' in inptype):
                example = inptype['default']
            elif (len(cast(Sized, inptype['symbols'])) == 1):
                example = symbols[0]
            else:
                example = '{}_enum_value'.format(inptype.get('name', 'valid'))
            comment = 'enum; valid values: "{}"'.format('", "'.join(symbols))
        elif (inptype['type'] == 'record'):
            example = ruamel.yaml.comments.CommentedMap()
            if ('name' in inptype):
                comment = '"{}" record type.'.format(inptype['name'])
            else:
                comment = 'Anonymous record type.'
            for field in cast(List[CWLObjectType], inptype['fields']):
                (value, f_comment) = generate_example_input(field['type'], None)
                example.insert(0, shortname(cast(str, field['name'])), value, f_comment)
        elif ('default' in inptype):
            example = inptype['default']
            comment = 'default value of type "{}".'.format(inptype['type'])
        else:
            example = defaults.get(cast(str, inptype['type']), str(inptype))
            comment = 'type "{}".'.format(inptype['type'])
    elif (not default):
        example = defaults.get(str(inptype), str(inptype))
        comment = f'type "{inptype}"'
    else:
        example = default
        comment = f'default value of type "{inptype}".'
    return (example, comment)