<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_file(self, name, full_path=False, directory="."):
 """Extract a member from the archive to the specified working directory. Behaviour of name and pull_path is the same as in function get_content_of_file. """

        if self.handle:
            for member in self.handle.getmembers():
                if (full_path and member.name == name or
                        not full_path and os.path.basename(
                            member.name) == name):
                    # TODO handle KeyError exception
                    self.handle.extract(member, path=directory)