code: def build_query(experiment, query):
      """Convert query string to dict format
  
      String format must be <attr name>=<value>
      """
      if query.strip() == "*":
          return {}
  
      attribute, value = query.split("=")
  
      if attribute not in VALID_QUERY_ATTRS:
          raise ValueError(
              f"Invalid query attribute `{attribute}`. Must be one of {VALID_QUERY_ATTRS}"
          )
  
      query = {attribute: value}
  
      if attribute == "id":
          query["experiment"] = experiment.id
  
      return query
  
file_path: orion/src/orion/core/cli/db/set.py
imports: import argparse
  import logging
  import sys
  import orion.core.io.experiment_builder
  from orion.core.utils.pptree import print_tree
  from orion.core.utils.terminal import confirm_name
label_desc: Use image node_id 3 for calling a global function with example usage: build_query(experiment, query) and returns: query, dict