<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_coords(data, coords):
 """Subselects xarray dataset object to provided coords. Raises exception if fails. Raises ------ ValueError If coords name are not available in data KeyError If coords dims are not available in data Returns ------- data: xarray xarray.Dataset object """

    try:
        return data.sel(**coords)

    except ValueError:
        invalid_coords = set(coords.keys()) - set(data.coords.keys())
        raise ValueError("Coords {} are invalid coordinate keys".format(invalid_coords))

    except KeyError as err:
        raise KeyError(
            (
                "Coords should follow mapping format {{coord_name:[dim1, dim2]}}. "
                "Check that coords structure is correct and"
                " dimensions are valid. {}"
            ).format(err)
        )