def align_left(text, length, left_edge='|', right_edge='|', text_length=None,
               left_padding=2):
    """Left align text."""
    # postcondition: len(returned_text) == length
    if text_length is None:
        text_length = len(text)
    computed_length = (
        text_length + left_padding + len(left_edge) + len(right_edge))
    if length - computed_length >= 0:
        padding = left_padding
    else:
        padding = 0
    output = []
    length_so_far = 0
    output.append(left_edge)
    length_so_far += len(left_edge)
    output.append(' ' * padding)
    length_so_far += padding
    output.append(text)
    length_so_far += text_length
    output.append(' ' * (length - length_so_far - len(right_edge)))
    output.append(right_edge)
    return ''.join(output)
dataset/ETHPy150Open aws/aws-cli/awscli/table.py/align_left/original