def get_all_with_given_response(rdd, response='404'):
    """ 
        Return a rdd only with those requests 
        that received the response code entered.
        Default set to '404'.

        return type: pyspark.rdd.PipelinedRDD
    """

    def status_iterator(ln):
        try:
            status = ln.split(' ')[-2]
            return True if status == response else False
        except:
            pass

    return rdd.filter(status_iterator)