def get_object_by_path(path):
<EOL>if not isinstance(path, str):<EOL><INDENT>return None<EOL><DEDENT>path = str(path)<EOL>portal = get_portal()<EOL>portal_path = get_path(portal)<EOL>if path == portal_path:<EOL><INDENT>return portal<EOL><DEDENT>if path.startswith(portal_path):<EOL><INDENT>segments = path.split("<STR_LIT:/>")<EOL>path = "<STR_LIT:/>".join(segments[<NUM_LIT:2>:])<EOL><DEDENT>try:<EOL><INDENT>return portal.restrictedTraverse(str(path))<EOL><DEDENT>except (KeyError, AttributeError):<EOL><INDENT>fail(<NUM_LIT>, "<STR_LIT>".format(str(path)))<EOL><DEDENT>
Find an object by a given physical path

    :param path: The physical path of the object to find
    :type path: string
    :returns: Found Object or None
    :rtype: object