def __call__(self, test_record):  # pylint: disable=invalid-name
    as_dict = data.ConvertToBaseTypes(test_record)
    serialized = _TestRunFromTestRecord(test_record).SerializeToString()
    if isinstance(self.filename_pattern, basestring):
      with open(self.filename_pattern % as_dict, 'w') as outfile:
        outfile.write(serialized)
    else:
      self.filename_pattern.write(serialized)
dataset/ETHPy150Open google/openhtf/openhtf/io/output/mfg_inspector.py/OutputToTestRunProto.__call__/original