class_docstr: Provide a few methods necessary to support nipype interface api
  
  The inputs attribute of interfaces call certain methods that are not
  available in traits.HasTraits. These are provided here.
  
  new metadata:
  
  * usedefault : set this to True if the default value of the trait should be
    used. Unless this is set, the attributes are set to traits.Undefined
  
  new attribute:
  
  * get_hashval : returns a tuple containing the state of the trait as a dict
    and hashvalue corresponding to dict.
  
  XXX Reconsider this in the long run, but it seems like the best
  solution to move forward on the refactoring.
class_docstr_tok: ["Provide","a","few","methods","necessary","to","support","nipype","interface","api","The","inputs","attribute","of","interfaces","call","certain","methods","that","are","not","available","in","traits.HasTraits",".","These","are","provided","here",".","new","metadata",":","*","usedefault",":","set","this","to","True","if","the","default","value","of","the","trait","should","be","used",".","Unless","this","is","set",",","the","attributes","are","set","to","traits.Undefined","new","attribute",":","*","get_hashval",":","returns","a","tuple","containing","the","state","of","the","trait","as","a","dict","and","hashvalue","corresponding","to","dict",".","XXX","Reconsider","this","in","the","long","run",",","but","it","seems","like","the","best","solution","to","move","forward","on","the","refactoring","."]
docstr: Checks if a user assigns a value to a deprecated trait
docstr_tok: ["Checks","if","a","user","assigns","a","value","to","a","deprecated","trait"]
code: def _deprecated_warn(self, obj, name, old, new):
      """Checks if a user assigns a value to a deprecated trait"""
      if isdefined(new):
          trait_spec = self.traits()[name]
          msg1 = "Input {} in interface {} is deprecated.".format(
              name,
              self.__class__.__name__.split("InputSpec")[0],
          )
          msg2 = (
              "Will be removed or raise an error as of release %s"
              % trait_spec.deprecated
          )
          if trait_spec.new_name:
              if trait_spec.new_name not in self.copyable_trait_names():
                  raise TraitError(
                      msg1
                      + " Replacement trait %s not found"
                      % trait_spec.new_name
                  )
              msg3 = "It has been replaced by %s." % trait_spec.new_name
          else:
              msg3 = ""
          msg = " ".join((msg1, msg2, msg3))
          if Version(str(trait_spec.deprecated)) < self.package_version:
              raise TraitError(msg)
          else:
              if trait_spec.new_name:
                  msg += "Unsetting old value {}; setting new value {}.".format(
                      name,
                      trait_spec.new_name,
                  )
              warn(msg)
              if trait_spec.new_name:
                  self.trait_set(
                      trait_change_notify=False,
                      **{
                          "%s" % name: Undefined,
                          "%s" % trait_spec.new_name: new,
                      },
                  )
  
imports: import os
  from inspect import isclass
  from copy import deepcopy
  from warnings import warn
  from packaging.version import Version
  from traits.trait_errors import TraitError
  from traits.trait_handlers import TraitDictObject, TraitListObject
  from ...utils.filemanip import md5, hash_infile, hash_timestamp
  from .traits_extension import traits, File, Str, Undefined, isdefined, has_metadata, OutputMultiObject
  from ...None import config, __version__
label_desc: Use image node_id 6 for calling the BaseTraitedSpec obj's underlying member method code with example usage: obj._deprecated_warn(obj, name, old, new) without return types