<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _ext_attr_to_partial(self, name, kwarg_key):
 """ Convert a string like '233' or 'aliceblue' into partial for self.chained. """

        try:
            intval = int(name)
        except ValueError:
            # Try as an extended name_data name.
            info = name_data.get(name, None)
            if info is None:
                # Not an int value or name_data name.
                return None
            kws = {kwarg_key: info['code']}
            return partial(self.chained, **kws)
        # Integer str passed, use the int value.
        kws = {kwarg_key: intval}
        return partial(self.chained, **kws)