code: def add_variables_from_file(self, file_path):
          
          try:
              file_name = path.splitext(path.basename(file_path))[0]
  
              #  As Python remembers loaded modules by name, in order to prevent collisions, we need to make sure that:
              #  - Files with the same name, but located in different directories, have a different module names. Hence the file path hash in the module name.
              #  - The same file, loaded by different tax and benefit systems, has distinct module names. Hence the `id(self)` in the module name.
              module_name = '{}_{}_{}'.format(id(self), hash(path.abspath(file_path)), file_name)
  
              module_directory = path.dirname(file_path)
              try:
                  module = load_module(module_name, *find_module(file_name, [module_directory]))
              except NameError as e:
                  logging.error(str(e) + ": if this code used to work, this error might be due to a major change in OpenFisca-Core. Checkout the changelog to learn more: <https://github.com/openfisca/openfisca-core/blob/master/CHANGELOG.md>")
                  raise
              potential_variables = [getattr(module, item) for item in dir(module) if not item.startswith('__')]
              for pot_variable in potential_variables:
                  # We only want to get the module classes defined in this module (not imported)
                  if isclass(pot_variable) and issubclass(pot_variable, Variable) and pot_variable.__module__ == module_name:
                      self.add_variable(pot_variable)
          except Exception:
              log.error('Unable to load OpenFisca variables from file "{}"'.format(file_path))
              raise
docs: Adds all OpenFisca variables contained in a given file to the tax and benefit system.