code: def log_return(
      close, length=None, cumulative=None, offset=None, **kwargs
  ):
      """Indicator: Log Return"""
      # Validate Arguments
      length = int(length) if length and length > 0 else 1
      cumulative = (
          bool(cumulative)
          if cumulative is not None and cumulative
          else False
      )
      close = verify_series(close, length)
      offset = get_offset(offset)
  
      if close is None:
          return
  
      # Calculate Result
      if cumulative:
          # log_return = nplog(close).diff(length).cumsum()
          log_return = nplog(close / close.iloc[0])
      else:
          log_return = nplog(
              close / close.shift(length)
          )  # nplog(close).diff(length)
  
      # Offset
      if offset != 0:
          log_return = log_return.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          log_return.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          log_return.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name & Category
      log_return.name = f"{'CUM' if cumulative else ''}LOGRET_{length}"
      log_return.category = "performance"
  
      return log_return
  
label_desc: Use image node_id 1 for calling a global function with example usage: log_return(close, length, cumulative, offset) and returns: log_return