def compute_poi_email_ratio(poi_messages, all_messages):
    """ FEATURE
        given a number messages to/from POI (numerator) 
        and number of all messages to/from a person (denominator),
        return the ratio of messages to/from that person
        that are from/to a POI
    """
    ratio = 0.
    if type(poi_messages) is int and type(all_messages) is int and poi_messages > 0 and all_messages > 0:
        ratio = float(poi_messages) / float(all_messages)
    return ratio