<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def quirks_from_any_parent( loc: Union[Labware, Well, str, ModuleGeometry, None]) -> List[str]: """ Walk the tree of wells and labwares and extract quirks """

    def recursive_get_quirks(obj, found):
        if isinstance(obj, Labware):
            return found + obj.quirks
        elif isinstance(obj, Well):
            return recursive_get_quirks(obj.parent, found)
        else:
            return found
    return recursive_get_quirks(loc, [])