docs: def import_external_db(self, db_file, db_type=None):
          """
          Import an external database for use in lcopt
  
          db_type must be one of ``technosphere`` or ``biosphere``
  
          The best way to 'obtain' an external database is to 'export' it from brightway as a pickle file
  
          e.g.::
  
              import brightway2 as bw
              bw.projects.set_current('MyModel')
              db = bw.Database('MyDatabase')
              db_as_dict = db.load()
              import pickle
              with open('MyExport.pickle', 'wb') as f:
                  pickle.dump(db_as_dict, f)
  
          NOTE: The Ecoinvent cutoff 3.3 database and the full biosphere database are included in the lcopt model as standard - no need to import those
  
          This can be useful if you have your own methods which require new biosphere flows that you want to analyse using lcopt
  
          """
          
          db = pickle.load(open("{}.pickle".format(db_file), "rb"))
          name = list(db.keys())[0][0]
          new_db = {'items': db, 'name': name}
          self.external_databases.append(new_db)
  
          if db_type is None:             # Assume its a technosphere database
              db_type = 'technosphere'
  
          if db_type == 'technosphere':
              self.technosphere_databases.append(name)
          elif db_type == 'biosphere':
              self.biosphere_databases.append(name)
  
          else:
              raise Exception
              print ("Database type must be 'technosphere' or 'biosphere'")