class_docstr: Traitlet for validating a single (Widget, 'trait_name') pair
class_docstr_tok: ["Traitlet","for","validating","a","single","(","Widget",",","'trait_name","'",")","pair"]
code: def validate_elements(self, obj, value):
      value = super().validate_elements(obj, value)
      widget, trait_name = value
      trait = widget.traits().get(trait_name)
      trait_repr = "{}.{}".format(widget.__class__.__name__, trait_name)
      # Can't raise TraitError because the parent will swallow the message
      # and throw it away in a new, less informative TraitError
      if trait is None:
          raise TypeError("No such trait: %s" % trait_repr)
      elif not trait.metadata.get("sync"):
          raise TypeError("%s cannot be synced" % trait_repr)
      return value
  
file_path: catboost/contrib/python/ipywidgets/py3/ipywidgets/widgets/widget_link.py
imports: from .widget import Widget, register, widget_serialization
  from .widget_core import CoreWidget
  from traitlets import Unicode, Tuple, Instance, TraitError
label_desc: Use image node_id 2 for calling the WidgetTraitTuple obj's underlying member method code with example usage: obj.validate_elements(obj, value) and returns: value