code: def getuser():
      """Get the username from the environment or password database.
  
      First try various environment variables, then the password
      database.  This works on Windows as long as USERNAME is set.
      Any failure to find a username raises OSError.
  
      .. versionchanged:: 3.13
          Previously, various exceptions beyond just :exc:`OSError`
          were raised.
      """
  
      for name in ("LOGNAME", "USER", "LNAME", "USERNAME"):
          user = os.environ.get(name)
          if user:
              return user
  
      try:
          import pwd
  
          return pwd.getpwuid(os.getuid())[0]
      except (ImportError, KeyError) as e:
          raise OSError("No username set in the environment") from e
  
file_path: cpython/Lib/getpass.py
imports: import contextlib
  import io
  import os
  import sys
label_desc: Use image node_id 5 for calling a global function with example usage: getuser() and returns: pwd, user