<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def segment_pofiles(configuration, locale):
 """Segment all the pofiles for `locale`. Returns a set of filenames, all the segment files written. """

    files_written = set()
    for filename, segments in configuration.segment.items():
        filename = configuration.get_messages_dir(locale) / filename
        files_written.update(segment_pofile(filename, segments))
    return files_written