def METHOD_NAME(self, context, principal_id):
    """Returns the dynamically calculated 'local' roles for the given
    principal and context
    @param context: context to calculate roles for the given principal
    @param principal_id: User login id
    @return List of dynamically calculated local-roles for user and context
    """
    roles = set()
    path = api.get_path(context)
    adapters = getAdapters((context,), IDynamicLocalRoles)
    for name, adapter in adapters:
        local_roles = adapter.getRoles(principal_id)
        if local_roles:
            logger.debug(u"{}::{}::{}: {}".format(name, path, principal_id,
                                                  repr(local_roles)))
        roles.update(local_roles)
    return list(roles)