class_docstr: Service schema handler 
class_docstr_tok: ["Service","schema","handler"]
code: def _expand_schema_references_with_definitions(
      self, schema, refs=None
  ):
      definitions = schema.get("definitions", {})
      refs = (
          refs
          if refs is not None
          else self._get_schema_references(schema)
      )
      required_refs = set(refs).difference(definitions)
      if not required_refs:
          return required_refs
      if not required_refs.issubset(self.definitions):
          raise ValueError(
              "Unresolved references (%s)"
              % ", ".join(required_refs.difference(self.definitions))
          )
  
      # update required refs with all sub requirements
      last_required_refs = None
      while last_required_refs != required_refs:
          last_required_refs = required_refs.copy()
          additional_refs = set(
              itertools.chain(
                  *(
                      self.definitions_refs.get(ref, [])
                      for ref in required_refs
                  )
              )
          )
          required_refs.update(additional_refs)
      return required_refs
  
imports: import itertools
  import re
  import attr
  import six
  from ...utilities.pyhocon import ConfigTree
  from .action import Action
label_desc: Use image node_id 12 for calling the Service obj's underlying member method code with example usage: obj._expand_schema_references_with_definitions(schema, refs) and returns: required_refs, required_refs