def write_shared_locations(self, paths, dry_run=False):
shared_path = os.path.join(self.path, '<STR_LIT>')<EOL>logger.info('<STR_LIT>', shared_path)<EOL>if dry_run:<EOL><INDENT>return None<EOL><DEDENT>lines = []<EOL>for key in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:data>'):<EOL><INDENT>path = paths[key]<EOL>if os.path.isdir(paths[key]):<EOL><INDENT>lines.append('<STR_LIT>' % (key,  path))<EOL><DEDENT><DEDENT>for ns in paths.get('<STR_LIT>', ()):<EOL><INDENT>lines.append('<STR_LIT>' % ns)<EOL><DEDENT>with codecs.open(shared_path, '<STR_LIT:w>', encoding='<STR_LIT:utf-8>') as f:<EOL><INDENT>f.write('<STR_LIT:\n>'.join(lines))<EOL><DEDENT>return shared_path<EOL>
Write shared location information to the SHARED file in .dist-info.
:param paths: A dictionary as described in the documentation for
:meth:`shared_locations`.
:param dry_run: If True, the action is logged but no file is actually
                written.
:return: The path of the file written to.