def checkDefineName(self, category, argument, instructions):
    allowedFields = []
    allowedFields.append('filename')
    allowedFields.append('method')
    allowedFields.append('modify text')
    allowedFields.append('path argument')

    # Loop over the arguments and check if there are any invalid fields supplied.
    for field in instructions:
      if field not in allowedFields: self.errors.invalidConstructionField(self.name, category, argument, 'define name', field, allowedFields)

    # Check for required fields.
    if instructions not in 'filename': self.errors.missingConstructionField(self.name, category, argument, 'filename', 'define name')

    # If a path argument is supplied, ensure that the supplied argument is valid for the tool.
    if 'path argument' in instructions:
      pathArgument = instructions['path argument']
      if pathArgument not in self.arguments: self.errors.invalidPathArgument(self.name, category, argument, pathArgument, 'define name')

  # Check that substring replacement is valid.
dataset/ETHPy150Open gkno/gkno_launcher/src/gkno/toolConfiguration.py/toolConfiguration.checkDefineName/swapped operands of `not in`