code: def resample(df: pd.DataFrame, interval: str) -> pd.DataFrame:
      """Resample DataFrame by <interval>."""
  
      d = {
          "open": "first",
          "high": "max",
          "low": "min",
          "close": "last",
          "volume": "sum",
      }
  
      return df.resample(interval).agg(d)
  
imports: import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: resample(df, interval) and returns: df