def format_as_float_or_array(name, values, val_if_none=0.0, flatten=False):
    '\n    Format array option values.\n\n    Checks that the given array values are either None, float, or an iterable\n    of numeric values. On output all iterables of numeric values are\n    converted to a flat np.ndarray. If values is scalar, it is converted\n    to float.\n\n    Parameters\n    ----------\n    name : str\n        The path of the variable relative to the current system.\n    values : float or numpy ndarray or Iterable\n        Values of the array option to be formatted to the expected form.\n    val_if_none : float or numpy ndarray\n        The default value for the option if values is None.\n    flatten : bool\n        Set to True to flatten any ndarray return.\n\n    Returns\n    -------\n    float or np.ndarray\n        Values transformed to the expected form.\n\n    Raises\n    ------\n    ValueError\n        If values is Iterable but cannot be converted to a numpy ndarray\n    TypeError\n        If values is scalar, not None, and not a Number.\n    '
    if isinstance(values, np.ndarray):
        if flatten:
            values = values.flatten()
    elif ((not isinstance(values, str)) and isinstance(values, Iterable)):
        values = np.asarray(values, dtype=float)
        if flatten:
            values = values.flatten()
    elif (values is None):
        values = val_if_none
    elif (values == float('inf')):
        values = INF_BOUND
    elif (values == (- float('inf'))):
        values = (- INF_BOUND)
    elif isinstance(values, numbers.Number):
        values = float(values)
    else:
        raise TypeError('Expected values of {0} to be an Iterable of numeric values, or a scalar numeric value. Got {1} instead.'.format(name, values))
    return values
Format array option values.

Checks that the given array values are either None, float, or an iterable
of numeric values. On output all iterables of numeric values are
converted to a flat np.ndarray. If values is scalar, it is converted
to float.

Parameters
----------
name : str
    The path of the variable relative to the current system.
values : float or numpy ndarray or Iterable
    Values of the array option to be formatted to the expected form.
val_if_none : float or numpy ndarray
    The default value for the option if values is None.
flatten : bool
    Set to True to flatten any ndarray return.

Returns
-------
float or np.ndarray
    Values transformed to the expected form.

Raises
------
ValueError
    If values is Iterable but cannot be converted to a numpy ndarray
TypeError
    If values is scalar, not None, and not a Number.
def format_as_float_or_array(name, values, val_if_none=0.0, flatten=False):
    '\n    Format array option values.\n\n    Checks that the given array values are either None, float, or an iterable\n    of numeric values. On output all iterables of numeric values are\n    converted to a flat np.ndarray. If values is scalar, it is converted\n    to float.\n\n    Parameters\n    ----------\n    name : str\n        The path of the variable relative to the current system.\n    values : float or numpy ndarray or Iterable\n        Values of the array option to be formatted to the expected form.\n    val_if_none : float or numpy ndarray\n        The default value for the option if values is None.\n    flatten : bool\n        Set to True to flatten any ndarray return.\n\n    Returns\n    -------\n    float or np.ndarray\n        Values transformed to the expected form.\n\n    Raises\n    ------\n    ValueError\n        If values is Iterable but cannot be converted to a numpy ndarray\n    TypeError\n        If values is scalar, not None, and not a Number.\n    '
    if isinstance(values, np.ndarray):
        if flatten:
            values = values.flatten()
    elif ((not isinstance(values, str)) and isinstance(values, Iterable)):
        values = np.asarray(values, dtype=float)
        if flatten:
            values = values.flatten()
    elif (values is None):
        values = val_if_none
    elif (values == float('inf')):
        values = INF_BOUND
    elif (values == (- float('inf'))):
        values = (- INF_BOUND)
    elif isinstance(values, numbers.Number):
        values = float(values)
    else:
        raise TypeError('Expected values of {0} to be an Iterable of numeric values, or a scalar numeric value. Got {1} instead.'.format(name, values))
    return values