code: def load_pandas_df(
      size="100k",
      header=None,
      local_cache_path=None,
      title_col=None,
      genres_col=None,
      year_col=None,
  ):
      """Loads the MovieLens dataset as pd.DataFrame.
  
      Download the dataset from https://files.grouplens.org/datasets/movielens, unzip, and load.
      To load movie information only, you can use load_item_df function.
  
      Args:
          size (str): Size of the data to load. One of ("100k", "1m", "10m", "20m", "mock100").
          header (list or tuple or None): Rating dataset header.
              If `size` is set to any of 'MOCK_DATA_FORMAT', this parameter is ignored and data is rendered using the 'DEFAULT_HEADER' instead.
          local_cache_path (str): Path (directory or a zip file) to cache the downloaded zip file.
              If None, all the intermediate files will be stored in a temporary directory and removed after use.
              If `size` is set to any of 'MOCK_DATA_FORMAT', this parameter is ignored.
          title_col (str): Movie title column name. If None, the column will not be loaded.
          genres_col (str): Genres column name. Genres are '|' separated string.
              If None, the column will not be loaded.
          year_col (str): Movie release year column name. If None, the column will not be loaded.
              If `size` is set to any of 'MOCK_DATA_FORMAT', this parameter is ignored.
  
      Returns:
          pandas.DataFrame: Movie rating dataset.
  
  
      **Examples**
  
      .. code-block:: python
  
          # To load just user-id, item-id, and ratings from MovieLens-1M dataset,
          df = load_pandas_df('1m', ('UserId', 'ItemId', 'Rating'))
  
          # To load rating's timestamp together,
          df = load_pandas_df('1m', ('UserId', 'ItemId', 'Rating', 'Timestamp'))
  
          # To load movie's title, genres, and released year info along with the ratings data,
          df = load_pandas_df('1m', ('UserId', 'ItemId', 'Rating', 'Timestamp'),
              title_col='Title',
              genres_col='Genres',
              year_col='Year'
          )
      """
      size = size.lower()
      if size not in DATA_FORMAT and size not in MOCK_DATA_FORMAT:
          raise ValueError(f"Size: {size}. " + ERROR_MOVIE_LENS_SIZE)
  
      if header is None:
          header = DEFAULT_HEADER
      elif len(header) < 2:
          raise ValueError(ERROR_HEADER)
      elif len(header) > 4:
          warnings.warn(WARNING_MOVIE_LENS_HEADER)
          header = header[:4]
  
      if size in MOCK_DATA_FORMAT:
          # generate fake data
          return MockMovielensSchema.get_df(
              keep_first_n_cols=len(header),
              keep_title_col=(title_col is not None),
              keep_genre_col=(genres_col is not None),
              **MOCK_DATA_FORMAT[
                  size
              ],  # supply the rest of the kwarg with the dictionary
          )
  
      movie_col = header[1]
  
      with download_path(local_cache_path) as path:
          filepath = os.path.join(path, "ml-{}.zip".format(size))
          datapath, item_datapath = _maybe_download_and_extract(
              size, filepath
          )
  
          # Load movie features such as title, genres, and release year
          item_df = _load_item_df(
              size,
              item_datapath,
              movie_col,
              title_col,
              genres_col,
              year_col,
          )
  
          # Load rating data
          df = pd.read_csv(
              datapath,
              sep=DATA_FORMAT[size].separator,
              engine="python",
              names=header,
              usecols=[*range(len(header))],
              header=0 if DATA_FORMAT[size].has_header else None,
          )
  
          # Convert 'rating' type to float
          if len(header) > 2:
              df[header[2]] = df[header[2]].astype(float)
  
          # Merge rating df w/ item_df
          if item_df is not None:
              df = df.merge(item_df, on=header[1])
  
      return df
  
imports: import os
  import re
  import random
  import shutil
  import warnings
  import pandas
  from typing import Optional
  from zipfile import ZipFile
  from recommenders.datasets.download_utils import maybe_download, download_path
  from recommenders.utils.notebook_utils import is_databricks
  from recommenders.utils.constants import DEFAULT_HEADER, DEFAULT_ITEM_COL, DEFAULT_USER_COL, DEFAULT_RATING_COL, DEFAULT_TIMESTAMP_COL, DEFAULT_TITLE_COL, DEFAULT_GENRE_COL
  import pandera
  import pandera.extensions
  from pandera import Field
  from pandera.typing import Series
label_desc: Use image node_id 1 for calling a global function with example usage: load_pandas_df(size, header, local_cache_path, title_col, genres_col, year_col) and returns: df, MockMovielensSchema