def get_shared(fname, encoding="<STR_LIT:utf-8>"):
relative_path = "<STR_LIT>".format(__version__, fname)<EOL>prefixed_path = os.path.join(sys.prefix, *relative_path.split("<STR_LIT:/>"))<EOL>try:<EOL><INDENT>return "<STR_LIT:\n>".join(read_plain_text(prefixed_path, encoding=encoding))<EOL><DEDENT>except IOError:<EOL><INDENT>pass<EOL><DEDENT>cellar_index = sys.prefix.find("<STR_LIT>")<EOL>if cellar_index != -<NUM_LIT:1>: <EOL><INDENT>outside_cellar_path = os.path.join(sys.prefix[:cellar_index],<EOL>*relative_path.split("<STR_LIT:/>"))<EOL>try:<EOL><INDENT>return "<STR_LIT:\n>".join(read_plain_text(outside_cellar_path,<EOL>encoding=encoding))<EOL><DEDENT>except IOError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>from pkg_resources import Requirement, resource_string<EOL>return resource_string(Requirement.parse("<STR_LIT>"), relative_path)<EOL>
Loads the string data from a text file that was packaged as a
data file in the distribution.

Uses the setuptools ``pkg_resources.resource_string`` function as
a fallback, as installing Dose with it directly instead of using
wheel/pip would store the setup.py ``data_files`` otherwhere. For
more information, see this:

https://github.com/pypa/setuptools/issues/130