code: def slope(
      close,
      length=None,
      as_angle=None,
      to_degrees=None,
      vertical=None,
      offset=None,
      **kwargs,
  ):
      """Indicator: Slope"""
      # Validate arguments
      length = int(length) if length and length > 0 else 1
      as_angle = True if isinstance(as_angle, bool) else False
      to_degrees = True if isinstance(to_degrees, bool) else False
      close = verify_series(close, length)
      offset = get_offset(offset)
  
      if close is None:
          return
  
      # Calculate Result
      slope = close.diff(length) / length
      if as_angle:
          slope = slope.apply(npAtan)
          if to_degrees:
              slope *= 180 / npPi
  
      # Offset
      if offset != 0:
          slope = slope.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          slope.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          slope.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name and Categorize it
      slope.name = (
          f"SLOPE_{length}"
          if not as_angle
          else f"ANGLE{'d' if to_degrees else 'r'}_{length}"
      )
      slope.category = "momentum"
  
      return slope
  
label_desc: Use image node_id 1 for calling a global function with example usage: slope(close, length, as_angle, to_degrees, vertical, offset) and returns: slope