def create_constrained_inputcubelist_converter(*constraints):
    "Makes function that the input constraints are used in a loop.\n\n    The function is a @value_converter, this means it is used by clize to convert\n    strings into objects.\n    This is a way of not using the IMPROVER load_cube which will try to merge\n    cubes. Iris load on the other hand won't deal with meta data properly.\n    So an example is if you wanted to load an X cube and a Y cube from a cubelist\n    of 2. You call this function with a list of constraints.\n    These cubes get loaded and returned as a CubeList.\n\n    Args:\n        *constraints (tuple of str or callable or iris.Constraint):\n            Constraints to be used in extracting the required cubes.\n            Each constraint must match exactly one cube and extracted cubes\n            will be sorted to match their order.\n            A constraint can be an iris.Constraint object or a callable\n            or cube name that can be used to construct one.\n\n    Returns:\n        callable:\n            A function with the constraints used for a list comprehension.\n    "

    @value_converter
    def constrained_inputcubelist_converter(to_convert):
        'Passes the cube and constraints onto maybe_coerce_with.\n\n        Args:\n            to_convert (str or iris.cube.CubeList):\n                A CubeList or a filename to be loaded into a CubeList.\n\n        Returns:\n            iris.cube.CubeList:\n                The loaded cubelist of constrained cubes.\n        '
        from iris import Constraint
        from iris.cube import CubeList
        from improver.utilities.load import load_cubelist
        cubelist = maybe_coerce_with(load_cubelist, to_convert)
        return CubeList((cubelist.extract_cube((Constraint(cube_func=constr) if callable(constr) else constr)) for constr in constraints))
    return constrained_inputcubelist_converter
Makes function that the input constraints are used in a loop.

The function is a @value_converter, this means it is used by clize to convert
strings into objects.
This is a way of not using the IMPROVER load_cube which will try to merge
cubes. Iris load on the other hand won't deal with meta data properly.
So an example is if you wanted to load an X cube and a Y cube from a cubelist
of 2. You call this function with a list of constraints.
These cubes get loaded and returned as a CubeList.

Args:
    *constraints (tuple of str or callable or iris.Constraint):
        Constraints to be used in extracting the required cubes.
        Each constraint must match exactly one cube and extracted cubes
        will be sorted to match their order.
        A constraint can be an iris.Constraint object or a callable
        or cube name that can be used to construct one.

Returns:
    callable:
        A function with the constraints used for a list comprehension.
def create_constrained_inputcubelist_converter(*constraints):
    "Makes function that the input constraints are used in a loop.\n\n    The function is a @value_converter, this means it is used by clize to convert\n    strings into objects.\n    This is a way of not using the IMPROVER load_cube which will try to merge\n    cubes. Iris load on the other hand won't deal with meta data properly.\n    So an example is if you wanted to load an X cube and a Y cube from a cubelist\n    of 2. You call this function with a list of constraints.\n    These cubes get loaded and returned as a CubeList.\n\n    Args:\n        *constraints (tuple of str or callable or iris.Constraint):\n            Constraints to be used in extracting the required cubes.\n            Each constraint must match exactly one cube and extracted cubes\n            will be sorted to match their order.\n            A constraint can be an iris.Constraint object or a callable\n            or cube name that can be used to construct one.\n\n    Returns:\n        callable:\n            A function with the constraints used for a list comprehension.\n    "

    @value_converter
    def constrained_inputcubelist_converter(to_convert):
        'Passes the cube and constraints onto maybe_coerce_with.\n\n        Args:\n            to_convert (str or iris.cube.CubeList):\n                A CubeList or a filename to be loaded into a CubeList.\n\n        Returns:\n            iris.cube.CubeList:\n                The loaded cubelist of constrained cubes.\n        '
        from iris import Constraint
        from iris.cube import CubeList
        from improver.utilities.load import load_cubelist
        cubelist = maybe_coerce_with(load_cubelist, to_convert)
        return CubeList((cubelist.extract_cube((Constraint(cube_func=constr) if callable(constr) else constr)) for constr in constraints))
    return constrained_inputcubelist_converter