anchor.diff:  -define(SCOPE_SEPARATOR, <<"::">>).
   -define(SCOPED_NAME_REGEX, "^(?:(" ?NAME "+)|(?:(" ?NAME "*)\\:\\:(" ?NAME "+)))$").
   
  --type db_callback() :: fun().
  +-type db_callback() :: fun((any()) -> any()).
   
   -record(context, {org_id :: binary(),
                     db_context :: any() | undefined,
  
positive.code:     {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
  names_from_records(Records) ->
      [ name_from_record(R) || R  <- Records].
  
  name_from_record({Name, _,  _}) ->
      Name;
  name_from_record({Name, _}) ->
      Name.
  
  ids_from_records(Records) ->
      [ id_from_record(R) || R <- Records ].
  
  id_from_record({_, AuthzId}) ->
      AuthzId;
  id_from_record({_, UserAuthzId, null}) ->
  
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 ].
  