def where(iterable, properties):
    """
     Looks through each value in the list, returning an array of all the values that contain all of the key-value pairs listed in properties. 

     params: iterable, properties
         iterable-> a list/generator of dictionaries
         properties-> key value pairs which need to be in a dictionary.

     Examples:
    >>> list(_.where(list_of_plays, {author: "Shakespeare", year: 1611}))
    >>> [{title: "Cymbeline", author: "Shakespeare", year: 1611}, {title: "The Tempest", author: "Shakespeare", year: 1611}]

    """
    items_to_be_checked = properties.items()
    for dictionary in iterable:
        if not isinstance(dictionary, dict):
            raise TypeError(
                '"array" should be a collection of dictionaries only')
        if items_to_be_checked <= dictionary.items():
            yield dictionary
