code: def exportGurobiModel(self, gurobiDriver='gurobi', verbose=False):
          
          from gurobipy import GRB, read
          from tempfile import mkdtemp
          from shutil import rmtree
          from os import path
          import sys
          if (sys.version_info > (3, 0)):
              from io import StringIO
          else:
              from io import BytesIO as StringIO
          tmp_dir = mkdtemp()
          model_file = path.join(tmp_dir, 'model.mps')
  
          previous = {
              'solver': self.getOption('solver') or '',
              'gurobi_auxfiles': self.getOption('auxfiles') or '',
              'gurobi_options': self.getOption('gurobi_options') or '',
          }
          temporary = {
              'solver': gurobiDriver,
              'gurobi_auxfiles': 'rc',
              'gurobi_options': '''
                  writeprob={}
                  timelim=0
                  presolve=0
                  heurfrac=0
                  outlev=0
              '''.format(model_file)
          }
  
          for option in temporary:
              self.setOption(option, temporary[option])
  
          output = self.getOutput('solve;')
          if not path.isfile(model_file):
              raise RuntimeError(output)
  
          for option in previous:
              self.setOption(option, previous[option])
  
          text_trap = StringIO()
          stdout = sys.stdout
          sys.stdout = text_trap
          model = read(model_file)
          sys.stdout = stdout
          if verbose:
              print(text_trap.getvalue())
          if model_file.endswith('.mps'):
              if not self.getCurrentObjective().minimization():
                  model.ModelSense = GRB.MAXIMIZE
                  model.setObjective(- model.getObjective())
          model.update()
          rmtree(tmp_dir)
          return model
docs: Export the model to Gurobi as a gurobipy.Model object.
  
          Args:
              gurobiDriver: The name or the path of the Gurobi solver driver.
              verbose: Whether should generate verbose output.
  
          Returns:
              A :class:`gurobipy.Model` object with the model loaded.