def _returnPD(self, code, tablename, **kwargs):
    '\n        private function to take a sas code normally to create a table, generate pandas data frame and cleanup.\n\n        :param code: string of SAS code\n        :param tablename: the name of the SAS Data Set\n        :param kwargs:\n        :return: Pandas Data Frame\n        '
    if self.sas.sascfg.pandas:
        raise type(self.sas.sascfg.pandas)(self.sas.sascfg.pandas.msg)
    libref = kwargs.get('libref', 'work')
    ll = self.sas._io.submit(code)
    (check, errorMsg) = self._checkLogForError(ll['LOG'])
    if (not check):
        raise ValueError(('Internal code execution failed: ' + errorMsg))
    if isinstance(tablename, str):
        df = self.sas.sasdata2dataframe(tablename, libref)
        self.sas._io.submit(('proc delete data=%s.%s; run;' % (libref, tablename)))
    elif isinstance(tablename, list):
        df = dict()
        for t in tablename:
            if self.sas.exist(t, libref):
                df[t.replace('_', '').capitalize()] = self.sas.sasdata2dataframe(t, libref)
            self.sas._io.submit(('proc delete data=%s.%s; run;' % (libref, t)))
    else:
        raise SyntaxError(('The tablename must be a string or list %s was submitted' % str(type(tablename))))
    return df
private function to take a sas code normally to create a table, generate pandas data frame and cleanup.

:param code: string of SAS code
:param tablename: the name of the SAS Data Set
:param kwargs:
:return: Pandas Data Frame
def _returnPD(self, code, tablename, **kwargs):
    '\n        private function to take a sas code normally to create a table, generate pandas data frame and cleanup.\n\n        :param code: string of SAS code\n        :param tablename: the name of the SAS Data Set\n        :param kwargs:\n        :return: Pandas Data Frame\n        '
    if self.sas.sascfg.pandas:
        raise type(self.sas.sascfg.pandas)(self.sas.sascfg.pandas.msg)
    libref = kwargs.get('libref', 'work')
    ll = self.sas._io.submit(code)
    (check, errorMsg) = self._checkLogForError(ll['LOG'])
    if (not check):
        raise ValueError(('Internal code execution failed: ' + errorMsg))
    if isinstance(tablename, str):
        df = self.sas.sasdata2dataframe(tablename, libref)
        self.sas._io.submit(('proc delete data=%s.%s; run;' % (libref, tablename)))
    elif isinstance(tablename, list):
        df = dict()
        for t in tablename:
            if self.sas.exist(t, libref):
                df[t.replace('_', ).capitalize()] = self.sas.sasdata2dataframe(t, libref)
            self.sas._io.submit(('proc delete data=%s.%s; run;' % (libref, t)))
    else:
        raise SyntaxError(('The tablename must be a string or list %s was submitted' % str(type(tablename))))
    return df