code: def load_maf_dataframe(path, nrows=None, raise_on_error=True, encoding=None):
      
      require_string(path, "Path to MAF")
  
      n_basic_columns = len(MAF_COLUMN_NAMES)
  
      # pylint: disable=no-member
      # pylint gets confused by read_csv
      df = pandas.read_csv(
          path,
          comment="#",
          sep="\t",
          low_memory=False,
          skip_blank_lines=True,
          header=0,
          encoding=encoding)
  
      if len(df.columns) < n_basic_columns:
          error_message = (
              "Too few columns in MAF file %s, expected %d but got  %d : %s" % (
                  path, n_basic_columns, len(df.columns), df.columns))
          if raise_on_error:
              raise ValueError(error_message)
          else:
              logging.warn(error_message)
  
      # check each pair of expected/actual column names to make sure they match
      for expected, actual in zip(MAF_COLUMN_NAMES, df.columns):
          if expected != actual:
              # MAFs in the wild have capitalization differences in their
              # column names, normalize them to always use the names above
              if expected.lower() == actual.lower():
                  # using DataFrame.rename in Python 2.7.x doesn't seem to
                  # work for some files, possibly because Pandas treats
                  # unicode vs. str columns as different?
                  df[expected] = df[actual]
                  del df[actual]
              else:
                  error_message = (
                      "Expected column %s but got %s" % (expected, actual))
                  if raise_on_error:
                      raise ValueError(error_message)
                  else:
                      logging.warn(error_message)
  
      return df
docs: Load the guaranteed columns of a TCGA MAF file into a DataFrame
  
      Parameters
      ----------
      path : str
          Path to MAF file
  
      nrows : int
          Optional limit to number of rows loaded
  
      raise_on_error : bool
          Raise an exception upon encountering an error or log an error
  
      encoding : str, optional
          Encoding to use for UTF when reading MAF file.