code: def _returnPD(self, code, tablename, **kwargs):
          
          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):
              pd = self.sas.sasdata2dataframe(tablename, libref)
              self.sas._io.submit("proc delete data=%s.%s; run;" % (libref, tablename))
          elif isinstance(tablename, list):
              pd = dict()
              for t in tablename:
                  # strip leading '_' from names and capitalize for dictionary labels
                  if self.sas.exist(t, libref):
                     pd[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 pd
docs: 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