code: def format_field(self, value: Any, spec: str) -> str:
          
          from cirq import ops  # HACK: avoids cyclic dependency.
          if isinstance(value, (float, int)):
              if isinstance(value, float):
                  value = round(value, self.precision)
              if spec == 'half_turns':
                  value = 'pi*{}'.format(value) if value != 0 else '0'
                  spec = ''
          elif isinstance(value, ops.Qid):
              value = self.qubit_id_map[value]
          elif isinstance(value, str) and spec == 'meas':
              value = self.meas_key_id_map[value]
              spec = ''
          return super().format_field(value, spec)
docs: Method of string.Formatter that specifies the output of format().