def format_args(args, kwargs):
    """Formats args and kwargs the way they look in a function call."""
    return ', '.join([repr(arg) for arg in args] +
                     ['%s=%r' % item for item in sorted(kwargs.items())])