import json


def parse(args):
    """
    The format of the arguments must be:

        This is some %(word)s string.|{'word': 1234}
        This is some string.

    The first argument is required; the second argument is not
    required. This will return the first argument and either the
    second as a dictionary or an empty dictionary if the second
    isn't present.
    """

    res = args.split('|', 1)
    if len(res) == 1:
        return args, {}
    else:
        return res[0], json.loads(res[1])