<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _format_sha1(graph, node):
 """Return formatted text with the submodule information."""

    try:
        submodules = node.submodules

        if submodules:
            submodule = ':'.join(submodules)
            return click.style(submodule, fg='green') + '@' + click.style(
                node.commit.hexsha[:8], fg='yellow'
            )
    except KeyError:
        pass
    return click.style(node.commit.hexsha[:8], fg='yellow')