def has_digit(string_or_list, sep="_"):
    """
    Given a string or a list will return true if the last word or
    element is a digit.  sep is used when a string is given to know
    what separates one word from another.
    """
    if isinstance(string_or_list, list):
        list_length = len(string_or_list)
        return unicode(string_or_list[-1]).isdigit() if list_length > 0 else False
    else:
        return has_digit(string_or_list.split(sep))
dataset/ETHPy150Open jazzband/django-mongonaut/mongonaut/forms/form_utils.py/has_digit/original