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: pm_get_defaults.m
    path of file: ./repos/bspm/thirdparty/spm8/toolbox/FieldMap
    
    the code of the file until where you have to start completion: function varargout = pm_get_defaults(defstr, varargin)

% FORMAT defval = pm_get_defaults(defstr)
% Return the defaults value associated with identifier "defstr". 
% Currently, this is a '.' subscript reference into the global  
% "defaults" variable defined in spm_defaults.m.
%

    
function varargout = pm_get_defaults(defstr, varargin)

% FORMAT defval = pm_get_defaults(defstr)
% Return the defaults value associated with identifier "defstr". 
% Currently, this is a '.' subscript reference into the global  
% "defaults" variable defined in spm_defaults.m.
%
% FORMAT spm_get_defaults(defstr, defval)
% Sets the defaults value associated with identifier "defstr". The new
% defaults value applies immediately to:
% * new modules in batch jobs
% * modules in batch jobs that have not been saved yet
% This value will not be saved for future sessions of SPM. To make
% persistent changes, edit spm_defaults.m.
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Chloe Hutton
% $Id: pm_get_defaults.m 4571 2011-11-23 17:34:12Z chloe $
% ---------------------------------------------------------------------
global pm_def
if isempty(pm_def)
    pm_defaults;
    pm_def.sessname='session';
    pm_def.pedir=2;
elseif ~isfield(pm_def,'pedir');
    pm_def.pedir=2;
elseif ~isfield(pm_def,'sessname');
    pm_def.sessname='session';
end