anchor.diff:      {AuthzIds, Remaining, ordsets:new()}.
   
   %% Helper functions for oc_chef_authz_db:authz_records_by_name and oc_chef_authz_db:find_org_actors_by_name
  +-spec names_from_records([{binary(),_} | {binary(),_,_}]) -> [binary()].
   names_from_records(Records) ->
       [ name_from_record(R) || R  <- Records].
   
  +-spec name_from_record({binary(),_} | {binary(),_,_}) -> binary().
   name_from_record({Name, _,  _}) ->
       Name;
   name_from_record({Name, _}) ->
       Name.
   
  +-spec ids_from_records([{_,binary()} | {_,'null' | binary(),'null' | binary()}]) -> [binary()].
   ids_from_records(Records) ->
       [ id_from_record(R) || R <- Records ].
   
  +-spec id_from_record({_, binary()} | {_, binary()|null, binary()|null}) -> binary().
   id_from_record({_, AuthzId}) ->
       AuthzId;
   id_from_record({_, UserAuthzId, null}) ->
  
positive.code: -define(SCOPE_SEPARATOR, <<"::">>).
  -define(SCOPED_NAME_REGEX, "^(?:(" ?NAME "+)|(?:(" ?NAME "*)\\:\\:(" ?NAME "+)))$").
  
  -type db_callback() :: fun().
  
  -record(context, {org_id :: binary(),
                    db_context :: any() | undefined,
  
negative.code: %%
  %% Some consumers of the name mapper want to split out errors by type
  %%
  -spec filter_by_error_type(atom(), [binary()]) -> [binary()].
  filter_by_error_type(ErrorType, Errors) ->
      %% ET is introduced to work around issue with shadowed variables in list comprehensions
      [ Name || {ET, Name} <- Errors, ET =:= ErrorType ].
  