code: def export_mesh(mesh, file_obj, file_type=None, **kwargs):
      
      # if we opened a file object in this function
      # we will want to close it when we're done
      was_opened = False
  
      if util.is_string(file_obj):
          if file_type is None:
              file_type = (str(file_obj).split('.')[-1]).lower()
          if file_type in _mesh_exporters:
              was_opened = True
              file_obj = open(file_obj, 'wb')
      file_type = str(file_type).lower()
  
      if not (file_type in _mesh_exporters):
          raise ValueError('%s exporter not available!', file_type)
  
      if isinstance(mesh, (list, tuple, set, np.ndarray)):
          faces = 0
          for m in mesh:
              faces += len(m.faces)
          log.debug('Exporting %d meshes with a total of %d faces as %s',
                    len(mesh), faces, file_type.upper())
      else:
          log.debug('Exporting %d faces as %s', len(mesh.faces),
                    file_type.upper())
      export = _mesh_exporters[file_type](mesh, **kwargs)
  
      if hasattr(file_obj, 'write'):
          result = util.write_encoded(file_obj, export)
      else:
          result = export
  
      if was_opened:
          file_obj.close()
  
      return result
docs: Export a Trimesh object to a file- like object, or to a filename
  
      Parameters
      ---------
      file_obj : str, file-like
        Where should mesh be exported to
      file_type : str or None
        Represents file type (eg: 'stl')
  
      Returns
      ----------
      exported : bytes or str
        Result of exporter