def METHOD_NAME(attachment):
    enc = FeedParserDict()
    enc["href"] = attachment["url"]
    enc["type"] = attachment["mime_type"]
    if "size_in_bytes" in attachment:
        enc["length"] = attachment["size_in_bytes"]
    return enc