def format_arg(arg):
    s = str(arg)
    if type(arg) is type:
        # convert to string directly; the string isn't very long
        return s
    elif isinstance(arg, object) and len(s) > max_param_len:
        # format into a shorter representation
        return parse_repr(arg)
    else:
        # the string representation of `arg` is short enough to display directly
        return s
Convert `arg` to a string
dataset/ETHPy150Open veegee/guv/guv/util/decorators.py/format_arg