>>> _format_array([0, 1.0], "{:0.3f}")
    '[0.000, 1.000]'

def _format_array(x, fmt):
    # type: (Any, str) -> str
    """
    >>> _format_array([0, 1.0], "{:0.3f}")
    '[0.000, 1.000]'
    """
    value_repr = ", ".join(fmt.format(v) for v in x)
    return "[{}]".format(value_repr)