def get_simple_date(datestring):
    """Transforms a datestring into shorter date 7.9.2017 > 07.09

    Expects the datestring to be format 07.09.2017. If this is not the
    case, returns string "Failed".

    Keyword arguments:
    datestring -- a string

    Returns:
    String -- The date in format "dd.MM." or "Failed"
    """
    simple_date = re.compile(r"\d{1,2}(\.)\d{1,2}")
    date = simple_date.search(datestring)
    if date:
        dates = date.group().split(".")
        if len(dates[0]) == 1:
            dates[0] = add_zero(dates[0])
        if len(dates[1]) == 1:
            dates[1] = add_zero(dates[1])

        if date_is_valid(dates):
            return '.'.join(dates) + '.'
        return "Failed"
Transforms a datestring into shorter date 7.9.2017 > 07.09

    Expects the datestring to be format 07.09.2017. If this is not the
    case, returns string "Failed".

    Keyword arguments:
    datestring -- a string

    Returns:
    String -- The date in format "dd.MM." or "Failed"