def WithArgs(self, **kwargs):
    new_meas = mutablerecords.CopyRecord(self)
    if '{' in new_meas.name:
      formatter = lambda x: x.format(**kwargs) if x else x
    else:
      # str % {'a': 1} is harmless if str doesn't use any interpolation.
      # .format is as well, but % is more likely to be used in other contexts.
      formatter = lambda x: x % kwargs if x else x
    new_meas.name = formatter(self.name)
    new_meas.docstring = formatter(self.docstring)
    return new_meas
Edit this file or directory
dataset/ETHPy150Open google/openhtf/openhtf/util/measurements.py/Measurement.WithArgs--crossover with--dataset/ETHPy150Open shichao-an/115wangpan/u115/api.py/BaseFile.edit