def METHOD_NAME(self, name, num=None, default=0):
    if num is None:
        return int(self.has_signal(name)) or default
    else:
        with open(os.path.join(self.log_dir, name), 'w') as writer:
            writer.write(str(num))
        return num