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: get_metadata.m
    path of file: ./repos/ExploreASL/External/bids-matlab/+bids/+internal
    
    the code of the file until where you have to start completion: function meta = get_metadata(filename, pattern)
  % Read a BIDS's file metadata according to the inheritance principle
  % FORMAT meta = bids.internal.get_metadata(filename, pattern)
  % filename    - name of file following BIDS standard

    
function meta = get_metadata(filename, pattern)
  % Read a BIDS's file metadata according to the inheritance principle
  % FORMAT meta = bids.internal.get_metadata(filename, pattern)
  % filename    - name of file following BIDS standard
  % pattern     - regular expression matching metadata file
  % meta        - metadata structure
  % __________________________________________________________________________

  % Copyright (C) 2016-2018, Guillaume Flandin, Wellcome Centre for Human Neuroimaging
  % Copyright (C) 2018--, BIDS-MATLAB developers

  if nargin == 1
    pattern = '^.*%s\\.json$';
  end