def __get__(self, obj, cls=None):
        """Get the value of the trait by self.name for the instance.

        Default values are instantiated when :meth:`HasTraits.__new__`
        is called.  Thus by the time this method gets called either the
        default value or a user defined value (they called :meth:`__set__`)
        is in the :class:`HasTraits` instance.
        """
        if obj is None:
            return self
        else:
            try:
                value = obj._trait_values[self.name]
            except KeyError:
                # Check for a dynamic initializer.
                if self.name in obj._trait_dyn_inits:
                    value = obj._trait_dyn_inits[self.name](obj)
                    # FIXME: Do we really validate here?
                    value = self._validate(obj, value)
                    obj._trait_values[self.name] = value
                    return value
                else:
                    raise TraitError('Unexpected error in TraitType: '
                        'both default value and dynamic initializer are '
                        'absent.')
            except Exception:
                # HasTraits should call set_default_value to populate
                # this.  So this should never be reached.
                raise TraitError('Unexpected error in TraitType: '
                                    'default value not set properly')
            else:
                return value
dataset/ETHPy150Open enthought/depsolver/depsolver/bundled/traitlets/_implementation.py/TraitType.__get__/original