<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def filter_data(df, filter_name, verbose=False):
    "Filter certain entries with given name."

    # pick only entries ending with 'Berlin' in column stop_name, incl. '(Berlin)' 
    # df = df[df.stop_name.apply(lambda cell: 'Berlin' in cell)]
    df = df[df.stop_name.apply(
        lambda cell: filter_name.encode('utf-8') in cell)]

    # remove ' (Berlin)' in column stop_name
    # df.stop_name = df.stop_name.apply(lambda cell: re.sub(' \(Berlin\)', '', cell))

    # remove initial 'S' and 'U' and 'S+U' in column stop_name
    # this creates a warning!
    # df.stop_name = df.stop_name.apply(lambda cell: re.sub('^([S\+U]+) +(.*)', lambda m: m.groups()[1], cell))

    if verbose:
        msg = '- Filtered down to %d entries containing "%s".'
        print(msg % (len(df), filter_name))

    return df