(inp, length)
return truncate(inp, length)
Short a dict or a list a tuple or a string to a maximus length.

    Args:
        inp (dict, list, tuple, str): The object to short.
        length (int): The length.
    Returns:
        the shorted object.
Short a dict or a list a tuple or a string to a maximus length.
Short a dict or a list a tuple or a string to a maximus length .
def shorten(inp, length):
    """Short a dict or a list a tuple or a string to a maximus length.

    Args:
        inp (dict, list, tuple, str): The object to short.
        length (int): The length.
    Returns:
        the shorted object.

    """
    if isinstance(inp, dict):
        return dict([(k, shorten(v, length)) for k, v in inp.items()])
    elif isinstance(inp, (list, tuple)):
        lis = [shorten(x, length) for x in inp]
        if isinstance(inp, tuple):
            lis = tuple(lis)
        return lis
    return truncate(inp, length)
def shorten ( inp , length ) : if isinstance ( inp , dict ) : return dict ( [ ( k , shorten ( v , length ) ) for k , v in inp . items ( ) ] ) elif isinstance ( inp , ( list , tuple ) ) : lis = [ shorten ( x , length ) for x in inp ] if isinstance ( inp , tuple ) : lis = tuple ( lis ) return lis return truncate ( inp , length )