code: def packageFromPath(path, includeModule=False):
      
      path = nstr(path)
      module = ''
      if os.path.isfile(path):
          path, fname = os.path.split(path)
          if fname.endswith('.py') and fname != '__init__.py':
              module = fname.split('.')[0]
  
      parts = os.path.normpath(path).split(os.path.sep)
      package_parts = []
  
      for i in range(len(parts), 0, -1):
          filename = os.path.sep.join(parts[:i] + ['__init__.py'])
  
          if not os.path.isfile(filename):
              break
  
          package_parts.insert(0, parts[i - 1])
  
      if includeModule and module:
          package_parts.append(module)
  
      return '.'.join(package_parts)
docs: Determines the python package path based on the inputted path.
      
      :param      path | <str>
      
      :return     <str>