@staticmethod
  def _PrintOneUser(user, long_list=False):
    """Prints select fields from returned user json.

    Available fields include:
      agreedToTerms, changePasswordAtNextLogin, creationTime, customerId,
      emails, id, includeInGlobalAddressList, ipWhitelisted, isAdmin,
      isDelegatedAdmin, isMailboxSetup, kind, lastLoginTime,
      name ({'familyName': 'xx', 'fullName': 'yy', 'givenName': 'zz'}),
      nonEditableAliases, orgUnitPath, primaryEmail and suspended.
    Special handling is needed for:
      emails, name, nonEditableAliases, name: sort for deterministic output.

    Args:
      user: user json object returned from the users API list().
      long_list: if True, print all known user fields.
    """
    UsersApiWrapper._PrintOneLine(GetFieldFromUser(user, 'primaryEmail'),
                                  GetFieldFromUser(user, 'id'),
                                  GetFieldFromUser(user, 'name',
                                                   sub_field_name='fullName'))
    if long_list:
      for field in sorted(user.keys()):
        if field in ('primaryEmail', 'id', 'fullName'):  # already displayed.
          continue
        # For deterministic output, need to pprint container objects like
        # dict. Textwrap is used for the hanging indent.  We use a hanging
        # indent of 7 because 4 spaces is the normal margin and the extra
        # 3 spaces are used for: colon, space and opening brace.
        formatted_text = textwrap.fill(
            pprint.pformat(GetFieldFromUser(user, field)),
            subsequent_indent=(7+len(field)) * ' ', break_on_hyphens=False)
        print '    %s: %s' % (field, formatted_text)
dataset/ETHPy150Open google/gfw-toolkit/toolkit/admin_sdk_directory_api/users_api.py/UsersApiWrapper._PrintOneUser/original