You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Filter.m
    path of file: ./repos/bids-matlab/+bids/+transformers_list
    
    the code of the file until where you have to start completion: function data = Filter(transformer, data)
  %
  % Subsets rows using a logical expression.
  %
  % JSON EXAMPLE
  % ------------
  %
  % .. code-block:: json
  %
  %     {
  %       "Name": "Filter",
  %       "Input": "sex",
  %       "Query": "age > 20"
  %     }
  %
  % Arguments:
  %
  % :param Input: **mandatory**. The name(s) of the variable(s) to operate on.
  % :type  Input: char or array
  %
  % :param Query: **mandatory**. logical expression used to filter
  % :type  Query: char
  %
  % Supports:
  %
  %   - ``>``, ``<``, ``>=``, ``<=``, ``==``, ``~=`` for numeric values
  %
  %   - ``==``, ``~=`` for char operation (case sensitive).
  %     Regular expressions are supported
  %
  % :param Output: Optional. The optional column names to write out to.
  % :type  Output: char or array
  %
  % By default, computation is done in-place (i.e., input columnise overwritten).
  % If provided, the number of values must exactly match the number of input values,
  % and the order will be mapped 1-to-1.
  %
  % CODE EXAMPLE
  % ------------
  %
  % .. code-block:: matlab
  %
  %   transformer = struct('Name', 'Filter', ...
  %                         'Input', 'sex', ...
  %                         'Query', 'age > 20');
  %
  %   data.sex = {'M', 'F', 'F', 'M'};

    
function data = Filter(transformer, data)
  %
  % Subsets rows using a logical expression.
  %
  % JSON EXAMPLE
  % ------------
  %
  % .. code-block:: json
  %
  %     {
  %       "Name": "Filter",
  %       "Input": "sex",
  %       "Query": "age > 20"
  %     }
  %
  % Arguments:
  %
  % :param Input: **mandatory**. The name(s) of the variable(s) to operate on.
  % :type  Input: char or array
  %
  % :param Query: **mandatory**. logical expression used to filter
  % :type  Query: char
  %
  % Supports:
  %
  %   - ``>``, ``<``, ``>=``, ``<=``, ``==``, ``~=`` for numeric values
  %
  %   - ``==``, ``~=`` for char operation (case sensitive).
  %     Regular expressions are supported
  %
  % :param Output: Optional. The optional column names to write out to.
  % :type  Output: char or array
  %
  % By default, computation is done in-place (i.e., input columnise overwritten).
  % If provided, the number of values must exactly match the number of input values,
  % and the order will be mapped 1-to-1.
  %
  % CODE EXAMPLE
  % ------------
  %
  % .. code-block:: matlab
  %
  %   transformer = struct('Name', 'Filter', ...
  %                         'Input', 'sex', ...
  %                         'Query', 'age > 20');
  %
  %   data.sex = {'M', 'F', 'F', 'M'};
  %   data.age = [10, 21, 15, 26];
  %
  %   data = bids.transformers(transformer, data);
  %
  %   data.sex
  %
  %     ans =
  %
  %     4X1 cell array
  %
  %         [NaN]
  %         'F'
  %         [NaN]
  %         'M'
  %
  %

  % (C) Copyright 2022 BIDS-MATLAB developers

  % TODO
  % - By(str; optional): Name of column to group filter operation by

  input = bids.transformers_list.get_input(transformer, data);
  output = bids.transformers_list.get_output(transformer, data);

  [left, query_type, right] = bids.transformers_list.get_query(transformer);

  % if the variable to filter on does not exist we return
  status = bids.transformers_list.check_field(left, data, 'query', true);
  if ~status
    return
  end