parameters: (comp)
return_statement: return validator
docstring: Validate that this option can only be specified when the component `comp` is loaded.
docstring_summary: Validate that this option can only be specified when the component `comp` is loaded.
docstring_tokens: Validate that this option can only be specified when the component comp is loaded .
function: def requires_component(comp):
      """Validate that this option can only be specified when the component `comp` is loaded."""
      # pylint: disable=unsupported-membership-test
      def validator(value):
          # pylint: disable=unsupported-membership-test
          if comp not in CORE.loaded_integrations:
              raise Invalid(f"This option requires component {comp}")
          return value
  
      return validator
function_tokens: def requires_component ( comp ) : # pylint: disable=unsupported-membership-test def validator ( value ) : # pylint: disable=unsupported-membership-test if comp not in CORE . loaded_integrations : raise Invalid ( f"This option requires component {comp}" ) return value return validator