nodes: 0, module; 1, function_definition; 2, function_name:import_identities; 3, parameters; 4, block; 5, identifier:self; 6, identifier:parser; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, expression_statement; 16, try_statement; 17, return_statement; 18, identifier:matching; 19, None; 20, identifier:match_new; 21, False; 22, identifier:no_strict_matching; 23, False; 24, identifier:reset; 25, False; 26, identifier:verbose; 27, False; 28, comment:"""Import identities information on the registry.
  
          New unique identities, organizations and enrollment data parsed
          by 'parser' will be added to the registry.
  
          Optionally, this method can look for possible identities that match with
          the new one to insert using 'matching' method. If a match is found,
          that means both identities are likely the same. Therefore, both identities
          would be merged into one. The 'match_new' parameter can be set to match
          and merge only new loaded identities. Rigorous validation of mathching
          values (i.e, well formed email addresses) will be disabled when
          <no_strict_matching> is set to to `True`.
  
          When `reset` is set, relationships and enrollments will be removed
          before loading any data.
  
          :param parser: sorting hat parser
          :param matching: type of matching used to merge existing identities
          :param match_new: match and merge only the new loaded identities
          :param no_strict_matching: disable strict matching (i.e, well-formed email addresses)
          :param reset: remove relationships and enrollments before loading data
          :param verbose: run in verbose mode when matching is set
          """; 29, assignment; 30, identifier:matching; 31, block; 32, assignment; 33, block; 34, except_clause; 35, identifier:CMD_SUCCESS; 36, identifier:matcher; 37, None; 38, expression_statement; 39, try_statement; 40, identifier:uidentities; 41, attribute; 42, expression_statement; 43, as_pattern; 44, block; 45, assignment; 46, block; 47, except_clause; 48, identifier:parser; 49, identifier:identities; 50, call; 51, identifier:LoadError; 52, as_pattern_target; 53, expression_statement; 54, return_statement; 55, identifier:strict; 56, not_operator; 57, expression_statement; 58, expression_statement; 59, as_pattern; 60, block; 61, attribute; 62, argument_list; 63, identifier:e; 64, call; 65, attribute; 66, identifier:no_strict_matching; 67, assignment; 68, assignment; 69, identifier:MatcherNotSupportedError; 70, as_pattern_target; 71, expression_statement; 72, return_statement; 73, identifier:self; 74, identifier:__load_unique_identities; 75, identifier:uidentities; 76, identifier:matcher; 77, identifier:match_new; 78, identifier:reset; 79, identifier:verbose; 80, attribute; 81, argument_list; 82, identifier:e; 83, identifier:code; 84, identifier:blacklist; 85, call; 86, identifier:matcher; 87, call; 88, identifier:e; 89, call; 90, attribute; 91, identifier:self; 92, identifier:error; 93, call; 94, attribute; 95, argument_list; 96, identifier:create_identity_matcher; 97, argument_list; 98, attribute; 99, argument_list; 100, identifier:e; 101, identifier:code; 102, identifier:str; 103, argument_list; 104, identifier:api; 105, identifier:blacklist; 106, attribute; 107, identifier:matching; 108, identifier:blacklist; 109, keyword_argument; 110, identifier:self; 111, identifier:error; 112, call; 113, identifier:e; 114, identifier:self; 115, identifier:db; 116, identifier:strict; 117, identifier:strict; 118, identifier:str; 119, argument_list; 120, identifier:e
code: def import_identities(self, parser, matching=None, match_new=False,
                            no_strict_matching=False,
                            reset=False, verbose=False):
          """Import identities information on the registry.
  
          New unique identities, organizations and enrollment data parsed
          by 'parser' will be added to the registry.
  
          Optionally, this method can look for possible identities that match with
          the new one to insert using 'matching' method. If a match is found,
          that means both identities are likely the same. Therefore, both identities
          would be merged into one. The 'match_new' parameter can be set to match
          and merge only new loaded identities. Rigorous validation of mathching
          values (i.e, well formed email addresses) will be disabled when
          <no_strict_matching> is set to to `True`.
  
          When `reset` is set, relationships and enrollments will be removed
          before loading any data.
  
          :param parser: sorting hat parser
          :param matching: type of matching used to merge existing identities
          :param match_new: match and merge only the new loaded identities
          :param no_strict_matching: disable strict matching (i.e, well-formed email addresses)
          :param reset: remove relationships and enrollments before loading data
          :param verbose: run in verbose mode when matching is set
          """
          matcher = None
  
          if matching:
              strict = not no_strict_matching
  
              try:
                  blacklist = api.blacklist(self.db)
                  matcher = create_identity_matcher(matching, blacklist, strict=strict)
              except MatcherNotSupportedError as e:
                  self.error(str(e))
                  return e.code
  
          uidentities = parser.identities
  
          try:
              self.__load_unique_identities(uidentities, matcher, match_new,
                                            reset, verbose)
          except LoadError as e:
              self.error(str(e))
              return e.code
  
          return CMD_SUCCESS