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: power.m
    path of file: ./repos/chebfun/@chebfun3
    
    the code of the file until where you have to start completion: function f = power(f, n)
%.^   CHEBFUN3 power.
%   F.^G returns a CHEBFUN3 F to the scalar power G, a scalar F to the 
%   CHEBFUN3 power G, or a CHEBFUN3 F to the CHEBFUN3 power G. F and/or G 
%   may be complex.
%
%   H = POWER(F, G) is called for the syntax 'F .^ G'.
%
% See also CHEBFUN3/SQRT and CHEBFUN3/COMPOSE.

% Copyright 2017 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.

if ( isempty(f) || isempty(n) )        % Check for empty objects.
    f = chebfun3();

    
function f = power(f, n)
%.^   CHEBFUN3 power.
%   F.^G returns a CHEBFUN3 F to the scalar power G, a scalar F to the 
%   CHEBFUN3 power G, or a CHEBFUN3 F to the CHEBFUN3 power G. F and/or G 
%   may be complex.
%
%   H = POWER(F, G) is called for the syntax 'F .^ G'.
%
% See also CHEBFUN3/SQRT and CHEBFUN3/COMPOSE.

% Copyright 2017 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.

if ( isempty(f) || isempty(n) )        % Check for empty objects.
    f = chebfun3();
    
elseif ( isa (f, 'double') && isscalar(f))          % DOUBLE .^ CHEBFUN3    
    op = @(x,y,z) f .^ (feval(n, x, y, z));
    f = chebfun3(op, n.domain);
    
elseif ( isa(n, 'double') && isscalar(n) )          % CHEBFUN3 .^ DOUBLE
   if ( round(n) ~= n )
       % Fractional power --> positive/negative test for the base.
       if ( isreal(f) )
           % Positive/negative test.
           ss = singleSignTest(f);
           if ( ~ss )
               error('CHEBFUN:CHEBFUN3:power:fractional', ...
                   'Sign change detected. Unable to represent the result.'); 
           end