def HomeDir(user=None):
  if user is None:
    pw_struct = pwd.getpwuid(os.geteuid())
  elif isinstance(user, int):
    pw_struct = pwd.getpwuid(user)
  elif isinstance(user, str):
    pw_struct = pwd.getpwnam(user)
  else:
    raise TypeError('user must be None or an instance of int or str')
  return pw_struct.pw_dir
Find the home directory of a user.
dataset/ETHPy150Open google/google-apputils/google/apputils/file_util.py/HomeDir