code: def _get_dataframe_movielens(
      name: str, folder_path: Path
  ) -> pd.DataFrame:
      if name == "ml-1m":
          file_path = folder_path.joinpath("ratings.dat")
          df = pd.read_csv(file_path, sep="::", header=None)
      elif name == "ml-20m":
          file_path = folder_path.joinpath("ratings.csv")
          df = pd.read_csv(file_path)
      else:
          raise ValueError("Invalid name")
      return df
  
imports: import random
  from collections import Counter
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: _get_dataframe_movielens(name, folder_path) and returns: df