<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filename_metadata(filename):
 """Return metadata parsed from a filename following LIGO-T050017 This method is lenient with regards to integers in the GPS start time of the file, as opposed to `gwdatafind.utils.filename_metadata`, which is strict. Parameters filename : `str` the path name of a file Returns ------- obs : `str` the observatory metadata tag : `str` the file tag segment : `gwpy.segments.Segment` the GPS ``[float, float)`` interval for this file Notes ----- `LIGO-T050017 <https://dcc.ligo.org/LIGO-T050017>`__ declares a file naming convention that includes documenting the GPS start integer and integer duration of a file, see that document for more details. Examples -------- ('A', 'B', Segment(0, 1)) ("A", "B", Segment(0.456, 1.801)) """

    from ..segments import Segment
    name = Path(filename).name
    try:
        obs, desc, start, dur = name.split('-')
    except ValueError as exc:
        exc.args = ('Failed to parse {!r} as LIGO-T050017-compatible '
                    'filename'.format(name),)
        raise
    start = float(start)
    dur = dur.rsplit('.', 1)[0]
    while True:  # recursively remove extension components
        try:
            dur = float(dur)
        except ValueError:
            if '.' not in dur:
                raise
            dur = dur.rsplit('.', 1)[0]
        else:
            break
    return obs, desc, Segment(start, start+dur)