parameters: (self)
docstring: Get a lowercase string representing the operating system of this machine
  
          Returns
          -------
          str
              Returns one of these strings: debian, redhat, windows, darwin, unknown
docstring_summary: Get a lowercase string representing the operating system of this machine
docstring_tokens: Get a lowercase string representing the operating system of this machine
function: def get_operating_system(self):
          """
          Get a lowercase string representing the operating system of this machine
  
          Returns
          -------
          str
              Returns one of these strings: debian, redhat, windows, darwin, unknown
          """
          # Windows is easy
          if platform.system().lower() == 'windows':
              return 'windows'
          # Darwin (Mac OSX) is easy
          if platform.system().lower() == 'darwin':
              return 'darwin'
          # Linux is hard
          # NOTE: sys.platform will not distinguish between flavors of linux and platform.linux_distribution()
          #   doesn't exist on all linux distributions! Also we can't rely on 'import distro' because it's
          #   only pip-installable at the moment. -Jordan 2/2021
          # Determine platform the old fashioned way, by seeing what package manager exists
          rpm_exist = not run_subprocess(command='which rpm', m_shell=True,
              m_stdout=subprocess.PIPE, m_stderr=subprocess.PIPE).code
          apt_exist = not run_subprocess(command='which apt', m_shell=True,
              m_stdout=subprocess.PIPE, m_stderr=subprocess.PIPE).code
          if rpm_exist:
              return 'redhat'
          elif apt_exist:
              return 'debian'
          else:
              return 'unknown'
function_tokens: def get_operating_system ( self ) : # Windows is easy if platform . system ( ) . lower ( ) == 'windows' : return 'windows' # Darwin (Mac OSX) is easy if platform . system ( ) . lower ( ) == 'darwin' : return 'darwin' # Linux is hard # NOTE: sys.platform will not distinguish between flavors of linux and platform.linux_distribution() #   doesn't exist on all linux distributions! Also we can't rely on 'import distro' because it's #   only pip-installable at the moment. -Jordan 2/2021 # Determine platform the old fashioned way, by seeing what package manager exists rpm_exist = not run_subprocess ( command = 'which rpm' , m_shell = True , m_stdout = subprocess . PIPE , m_stderr = subprocess . PIPE ) . code apt_exist = not run_subprocess ( command = 'which apt' , m_shell = True , m_stdout = subprocess . PIPE , m_stderr = subprocess . PIPE ) . code if rpm_exist : return 'redhat' elif apt_exist : return 'debian' else : return 'unknown'