original_docstring:  Count the number of one time keys the server has for a device
          Returns:
              Dict mapping from algorithm to number of keys for that algorithm.
          
docstring: Count the number of one time keys the server has for a device
docstring_tokens: Count the number of one time keys the server has for a device
code: def count_e2e_one_time_keys(self, user_id, device_id):
          """ Count the number of one time keys the server has for a device
          Returns:
              Dict mapping from algorithm to number of keys for that algorithm.
          """
          def _count_e2e_one_time_keys(txn):
              sql = (
                  "SELECT algorithm, COUNT(key_id) FROM e2e_one_time_keys_json"
                  " WHERE user_id = ? AND device_id = ?"
                  " GROUP BY algorithm"
              )
              txn.execute(sql, (user_id, device_id))
              result = {}
              for algorithm, key_count in txn:
                  result[algorithm] = key_count
              return result
          return self.runInteraction(
              "count_e2e_one_time_keys", _count_e2e_one_time_keys
          )
code_tokens: def count_e2e_one_time_keys ( self , user_id , device_id ) : def _count_e2e_one_time_keys ( txn ) : sql = ( "SELECT algorithm, COUNT(key_id) FROM e2e_one_time_keys_json" " WHERE user_id = ? AND device_id = ?" " GROUP BY algorithm" ) txn . execute ( sql , ( user_id , device_id ) ) result = { } for algorithm , key_count in txn : result [ algorithm ] = key_count return result return self . runInteraction ( "count_e2e_one_time_keys" , _count_e2e_one_time_keys )
short_docstring: Count the number of one time keys the server has for a device
short_docstring_tokens: Count the number of one time keys the server has for a device
comment: """ Count the number of one time keys the server has for a device
          Returns:
              Dict mapping from algorithm to number of keys for that algorithm.
          """