def FlagIsRequired(flag_dict):
  """Returns whether a flag is required or not.

  Args:
    flag_dict: a specific flag's dictionary as found in the gcloud_tree

  Returns:
    True if the flag's required, False otherwise. If the passed dictionary does
    not correspond to a flag (does not contain the 'required' key), False is
    also returned
  """
  return flag_dict.get('required', False)