code: def register(self, task_spec):
          
          if self.validate(task_spec.lsid):
              # Add the module name to the map
              self.registered_modules[task_spec.lsid] = task_spec.name
  
              # Increment module count
              self.module_count += 1
  
              # Write the updated LSID authority file and reload
              with open(self.authority, 'w') as authority_file:
                  json.dump({
                      'base_lsid': self.base_lsid,
                      'module_count': self.module_count,
                      'registered_modules': self.registered_modules,
                  }, authority_file, sort_keys=True, indent=4, separators=(',', ': '))
              self._load_lsid_authority()
          else:
              raise RuntimeError("Module LSID id not valid: " + str(task_spec.lsid))
  
          return True
docs: Registers a module specification with the LSID authority.
          Validates that it possesses an LSID assigned by the authority.
          Raises an exception if registration wasn't successful.
          :param task_spec:
          :return: boolean - True if registration was successful