def query_reliabledictionary(client, application_name, service_name, dictionary_name, query_string, partition_key=None, partition_id=None, output_file=None):
cluster = Cluster.from_sfclient(client)<EOL>dictionary = cluster.get_application(application_name).get_service(service_name).get_dictionary(dictionary_name)<EOL>start = time.time()<EOL>if (partition_id != None):<EOL><INDENT>result = dictionary.query(query_string, PartitionLookup.ID, partition_id)<EOL><DEDENT>elif (partition_key != None):<EOL><INDENT>result = dictionary.query(query_string, PartitionLookup.KEY, partition_key)<EOL><DEDENT>else:<EOL><INDENT>result = dictionary.query(query_string)<EOL><DEDENT>if type(result) is str:<EOL><INDENT>print(result)<EOL>return<EOL><DEDENT>else:<EOL><INDENT>result = json.dumps(result.get("<STR_LIT:value>"), indent=<NUM_LIT:4>)<EOL><DEDENT>print("<STR_LIT>" + str(time.time() - start) + "<STR_LIT>")<EOL>if (output_file == None):<EOL><INDENT>output_file = "<STR_LIT>".format(application_name, service_name, dictionary_name)<EOL><DEDENT>with open(output_file, "<STR_LIT:w>") as output:<EOL><INDENT>output.write(result)<EOL><DEDENT>print()<EOL>print('<STR_LIT>' + output_file)<EOL>print(result)<EOL>
Query existing reliable dictionary.

    Query existing reliable dictionaries for given application and service.

    :param application_name: Name of the application.
    :type application_name: str
    :param service_name: Name of the service.
    :type service_name: str
    :param dictionary_name: Name of the reliable dictionary.
    :type dictionary_name: str
    :param query_string: An OData query string. For example $top=10. Check https://www.odata.org/documentation/ for more information.
    :type query_string: str
    :param partition_key: Optional partition key of the desired partition, either a string if named schema or int if Int64 schema
    :type partition_id: str
    :param partition_id: Optional partition GUID of the owning reliable dictionary.
    :type partition_id: str
    :param output_file: Optional file to save the schema.