code: def generate_operator_complexity(
      part,
      precision,
      unary_operators=None,
      binary_operators=None,
      hls_include_path=None,
      hls_libs_path=None,
  ):
      """Generates HLS projects and synthesizes them to obtain operator complexity (clock cycles per given math operation).
  
      This function can be used to obtain a list of operator complexity for a given FPGA part at a given precision.
  
      Args:
          part (str): FPGA part number to use.
          precision (str): Precision to use.
          unary_operators (list, optional): List of unary operators to evaluate. Defaults to None.
          binary_operators (list, optional): List of binary operators to evaluate. Defaults to None.
          hls_include_path (str, optional): Path to the HLS include files. Defaults to None.
          hls_libs_path (str, optional): Path to the HLS libs. Defaults to None.
  
      Returns:
          dict: Dictionary of obtained operator complexities.
      """
  
      from sympy.parsing.sympy_parser import (
          parse_expr as parse_sympy_expr,
      )
  
      from hls4ml.converters import convert_from_symbolic_expression
  
      if unary_operators is None:
          unary_ops = _unary_ops
      else:
          unary_ops = {
              fn_name: sympy_expr
              for fn_name, sympy_expr in _unary_ops.items()
              if fn_name in unary_operators
          }
      if binary_operators is None:
          binary_ops = _binary_ops
      else:
          binary_ops = {
              fn_name: sympy_expr
              for fn_name, sympy_expr in _binary_ops.items()
              if fn_name in binary_operators
          }
  
      complexity_of_operators = {}
  
      with tempfile.TemporaryDirectory() as tmp_dir:
          for fn_name, sympy_expr in binary_ops.items():
              print(f"Estimating complexity of {fn_name}")
              equation = sympy_expr.replace("x", "x0").replace(
                  "y", "x1"
              )
              expression = parse_sympy_expr(equation)
              hls_model = convert_from_symbolic_expression(
                  expression,
                  n_symbols=2,
                  output_dir=tmp_dir,
                  precision=precision,
                  part=part,
                  hls_include_path=hls_include_path,
                  hls_libs_path=hls_libs_path,
              )
              hls_model.write()
              subprocess.run(
                  [
                      "vivado_hls",
                      "-f",
                      "build_prj.tcl",
                      '"reset=1 synth=1 csim=0 cosim=0 validation=0 export=0"',
                  ],
                  cwd=tmp_dir,
                  stdout=subprocess.DEVNULL,
                  stderr=subprocess.STDOUT,
              )
              result = subprocess.check_output(
                  [
                      "awk",
                      "NR==32",
                      "myproject_prj/solution1/syn/report/myproject_csynth.rpt",
                  ],
                  cwd=tmp_dir,
              )
              cc = result.decode("utf-8").replace(" ", "").split("|")[1]
              complexity_of_operators[fn_name] = max(int(cc), 1)
  
          for fn_name, sympy_expr in unary_ops.items():
              print(f"Estimating complexity of {fn_name}")
              equation = sympy_expr.replace("sympy.", "")
              if "x" in equation and fn_name != "exp":
                  equation = equation.replace("x", "x0")
              else:
                  equation += "(x0)"
              expression = parse_sympy_expr(equation)
              hls_model = convert_from_symbolic_expression(
                  expression,
                  n_symbols=1,
                  output_dir=tmp_dir,
                  precision=precision,
                  part=part,
                  hls_include_path=hls_include_path,
                  hls_libs_path=hls_libs_path,
              )
              hls_model.write()
              subprocess.run(
                  [
                      "vivado_hls",
                      "-f",
                      "build_prj.tcl",
                      '"reset=1 synth=1 csim=0 cosim=0 validation=0 export=0"',
                  ],
                  cwd=tmp_dir,
                  stdout=subprocess.DEVNULL,
                  stderr=subprocess.STDOUT,
              )
              result = subprocess.check_output(
                  [
                      "awk",
                      "NR==32",
                      "myproject_prj/solution1/syn/report/myproject_csynth.rpt",
                  ],
                  cwd=tmp_dir,
              )
              cc = result.decode("utf-8").replace(" ", "").split("|")[1]
              complexity_of_operators[fn_name] = max(int(cc), 1)
  
      return complexity_of_operators
  
imports: import subprocess
  import tempfile
label_desc: Use image node_id 3 for calling a global function with example usage: generate_operator_complexity(part, precision, unary_operators, binary_operators, hls_include_path, hls_libs_path) and returns: complexity_of_operators