code: def _get_filter(sdk_filter, attr_map):
      
      if not isinstance(sdk_filter, dict):
          raise CloudValueError('filter value must be a dictionary, was %r' % (sdk_filter,))
      custom = sdk_filter.pop('custom_attributes', {})
      new_filter = _normalise_key_values(filter_obj=sdk_filter, attr_map=attr_map)
      new_filter.update({
          'custom_attributes__%s' % k: v for k, v in _normalise_key_values(filter_obj=custom).items()
      })
      return new_filter
docs: Common functionality for filter structures
  
      :param sdk_filter: {field:constraint, field:{operator:constraint}, ...}
      :return: {field__operator: constraint, ...}