parameters: (filename)
return_statement: return json.loads(mo.group(1))
docstring: Try to determine the version from _version.py if present.
docstring_summary: Try to determine the version from _version.py if present.
docstring_tokens: Try to determine the version from _version . py if present .
function: def versions_from_file(filename):
      """Try to determine the version from _version.py if present."""
      try:
          with open(filename) as f:
              contents = f.read()
      except EnvironmentError:
          raise NotThisMethod("unable to read _version.py")
      mo = re.search(r"version_json = '''\n(.*)'''  # END VERSION_JSON",
                     contents, re.M | re.S)
      if not mo:
          raise NotThisMethod("no version_json in _version.py")
      return json.loads(mo.group(1))
function_tokens: def versions_from_file ( filename ) : try : with open ( filename ) as f : contents = f . read ( ) except EnvironmentError : raise NotThisMethod ( "unable to read _version.py" ) mo = re . search ( r"version_json = '''\n(.*)'''  # END VERSION_JSON" , contents , re . M | re . S ) if not mo : raise NotThisMethod ( "no version_json in _version.py" ) return json . loads ( mo . group ( 1 ) )