def get_dist(self):<EOL>
if self.metadata_directory:<EOL><INDENT>base_dir, distinfo = os.path.split(self.metadata_directory)<EOL>metadata = pkg_resources.PathMetadata(<EOL>base_dir, self.metadata_directory<EOL>)<EOL>dist_name = os.path.splitext(distinfo)[<NUM_LIT:0>]<EOL>typ = pkg_resources.DistInfoDistribution<EOL><DEDENT>else:<EOL><INDENT>egg_info = self.egg_info_path.rstrip(os.path.sep)<EOL>base_dir = os.path.dirname(egg_info)<EOL>metadata = pkg_resources.PathMetadata(base_dir, egg_info)<EOL>dist_name = os.path.splitext(os.path.basename(egg_info))[<NUM_LIT:0>]<EOL>typ = pkg_resources.Distribution  <EOL><DEDENT>return typ(<EOL>base_dir,<EOL>project_name=dist_name,<EOL>metadata=metadata,<EOL>)<EOL>
Return a pkg_resources.Distribution for this requirement