class_docstr: Non permanent collection
  
  This collection is meant for debugging purposes within the EphemeralDB.
  
  .. seealso:: :class:`orion.core.io.database.ephemeraldb.EphemeralDB` for database object.
class_docstr_tok: ["Non","permanent","collection","This","collection","is","meant","for","debugging","purposes","within","the","EphemeralDB",".","..","seealso",":",":",":","class",":","`","orion.core.io.database.ephemeraldb.EphemeralDB","`","for","database","object","."]
docstr: Create given indexes if they do not already exist for this collection.
  
  Indexes are only created if `unique` is True.
docstr_tok: ["Create","given","indexes","if","they","do","not","already","exist","for","this","collection",".","Indexes","are","only","created","if","`","unique","`","is","True","."]
code: def create_index(self, keys, unique=False):
      """Create given indexes if they do not already exist for this collection.
  
      Indexes are only created if `unique` is True.
      """
      # turn single key into list for coherence
      if not isinstance(keys, (list, tuple)):
          keys = [(keys, None)]
  
      keys = tuple(key for (key, order) in keys)
      name = _convert_keys_to_name(keys)
      if unique and name not in self._indexes:
          data = set()
  
          self._indexes[name] = (keys, data)
  
          for document in self._documents:
              self._validate_index(document, indexes=[name])
              data.add(tuple(document[key] for key in keys))
  
imports: import copy
  from collections import defaultdict
  from orion.core.io.database import Database, DatabaseError, DuplicateKeyError
  from orion.core.utils.flatten import flatten, unflatten
label_desc: Use image node_id 2 for calling the EphemeralCollection obj's underlying member method code with example usage: obj.create_index(keys, unique) without return types