def filepath_representer(dumper, path):
    if hasattr(path, 'origpath'):
        if getattr(path, 'pipedpath', False):
            # this was loaded via !pipedpath, so dump it as such
            return dumper.represent_scalar(u'!pipedpath', path.origpath)
        else:
            # we have the original path used when loading, so use it.
            return dumper.represent_scalar(u'!filepath', path.origpath)

    # previously unkonwn path, so we use the full path
    return dumper.represent_scalar(u'!filepath', path.path)
Represents the filepath when dumping.
dataset/ETHPy150Open foundit/Piped/piped/yamlutil.py/filepath_representer