<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_obj(self, env, prefix, name, obj_type, searchorder=0):
 """Find object reference :param env: Build environment :param prefix: Object prefix :param name: Object name :param obj_type: Object type :param searchorder: Search for exact match """

        # Skip parens
        if name[-2:] == '()':
            name = name[:-2]

        if not name:
            return []

        object_types = list(self.object_types)
        if obj_type is not None:
            object_types = self.objtypes_for_role(obj_type)

        objects = self.data['objects']
        newname = None
        fullname = name
        if prefix is not None:
            fullname = '.'.join([prefix, name])

        if searchorder == 1:
            if prefix and fullname in objects and objects[fullname][1] in object_types:
                newname = fullname
            elif name in objects and objects[name][1] in object_types:
                newname = name
            else:
                try:
                    matches = [obj_name for obj_name in objects
                               if obj_name.endswith('.' + name)]
                    newname = matches.pop()
                except IndexError:
                    pass
        else:
            if name in objects:
                newname = name
            elif prefix and fullname in objects:
                newname = fullname

        if newname is None:
            return None
        return newname, objects.get(newname, (None, None))