docstr: Read the rules from a file
docstr_tok: ["Read","the","rules","from","a","file"]
code: def get_rules(self, measurement_group):
      """Read the rules from a file"""
      rules_file = measurement_group.rules_file_name.value
      rules_directory = (
          measurement_group.rules_directory.get_absolute_path()
      )
      path = os.path.join(rules_directory, rules_file)
      if not os.path.isfile(path):
          raise ValidationError(
              "No such rules file: %s" % path, rules_file
          )
      else:
          rules = Rules(allow_fuzzy=measurement_group.allow_fuzzy)
          rules.parse(path)
          return rules
  
imports: import logging
  import os
  import numpy
  from cellprofiler_core.constants.measurement import IMAGE, COLTYPE_INTEGER
  from cellprofiler_core.constants.module import IO_FOLDER_CHOICE_HELP_TEXT
  from cellprofiler_core.constants.workspace import DISPOSITION_CONTINUE, DISPOSITION_SKIP
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.module import Module
  from cellprofiler_core.preferences import DEFAULT_INPUT_FOLDER_NAME
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Divider
  from cellprofiler_core.setting import HiddenCount
  from cellprofiler_core.setting import Measurement
  from cellprofiler_core.setting import SettingsGroup
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.do_something import DoSomething, RemoveSettingButton
  from cellprofiler_core.setting.multichoice import MultiChoice
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import Text, Filename, Directory, Float
  from cellprofiler.utilities.rules import Rules
label_desc: Use image node_id 14 for calling the FlagImage obj's underlying member method code with example usage: obj.get_rules(measurement_group) and returns: rules