def _has_system_user(system_user: str) -> bool:
    """Make sure the system_user exists.

    This should not import the st2 code as it should be self-contained.
    """
    try:
        pwd.getpwnam(system_user)
    except KeyError:
        # put current user (for use in error msg instructions)
        print(pwd.getpwuid(os.getuid()).pw_name)
        return False
    print(system_user)
    return True
Make sure the system_user exists.

    This should not import the st2 code as it should be self-contained.
    
pants-plugins/uses_services/scripts/has_system_user.py