def _returnPD(self, code, tablename, **kwargs):
libref = kwargs.get('<STR_LIT>','<STR_LIT>')<EOL>ll = self.sas._io.submit(code)<EOL>check, errorMsg = self._checkLogForError(ll['<STR_LIT>'])<EOL>if not check:<EOL><INDENT>raise ValueError("<STR_LIT>" + errorMsg)<EOL><DEDENT>if isinstance(tablename, str):<EOL><INDENT>pd = self.sas.sasdata2dataframe(tablename, libref)<EOL>self.sas._io.submit("<STR_LIT>" % (libref, tablename))<EOL><DEDENT>elif isinstance(tablename, list):<EOL><INDENT>pd = dict()<EOL>for t in tablename:<EOL><INDENT>if self.sas.exist(t, libref):<EOL><INDENT>pd[t.replace('<STR_LIT:_>', '<STR_LIT>').capitalize()] = self.sas.sasdata2dataframe(t, libref)<EOL><DEDENT>self.sas._io.submit("<STR_LIT>" % (libref, t))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise SyntaxError("<STR_LIT>" % str(type(tablename)))<EOL><DEDENT>return pd<EOL>
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