code: def _compute_operation(string, idx):
      # type: (str, int) -> Optional[int]
      
      operator = string[idx]
      if operator == "&":
          return AND
      elif operator == "|":
          return OR
      elif operator == "!":
          return NOT
  
      return None
docs: Tries to compute the LDAP operation at the given index
  
      Valid operations are :
  
      * & : AND
      * | : OR
      * ! : NOT
  
      :param string: A LDAP filter string
      :param idx: An index in the given string
      :return: The corresponding operator (AND, OR or NOT)