code: def encode_fare(df):
      df.Fare = df.Fare.fillna(-0.5)
      bins = (-1, 0, 8, 15, 31, 1000)
      categories = pd.cut(df.Fare, bins, labels=False)
      df.Fare = categories
      return df
  
file_path: gradio/demo/titanic_survival/run.py
imports: import os
  import pandas
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.model_selection import train_test_split
  import gradio
label_desc: Use image node_id 2 for calling a global function with example usage: encode_fare(df) and returns: df