code: def get_version(filename, encoding='utf8'):
      
  
      with io.open(filename, encoding=encoding) as sourcecode:
          for line in sourcecode:
              version = RE_VERSION.match(line)
              if version:
                  return version.group(1)
  
      return None
docs: Get __version__ definition out of a source file