code: def categorize(df, name, value, criteria,
                 color=None, marker=None, linestyle=None, **kwargs):
      
      fdf = df.filter(**kwargs)
      fdf.categorize(name=name, value=value, criteria=criteria, color=color,
                     marker=marker, linestyle=linestyle)
  
      # update metadata
      if name in df.meta:
          df.meta[name].update(fdf.meta[name])
      else:
          df.meta[name] = fdf.meta[name]
docs: Assign scenarios to a category according to specific criteria
      or display the category assignment
  
      Parameters
      ----------
      df: IamDataFrame instance
      args: see `IamDataFrame.categorize()` for details
      kwargs: passed to `df.filter()`