def _coerce_scalar_to_timedelta_type(r, unit='<STR_LIT>', box=True, errors='<STR_LIT>'):
try:<EOL><INDENT>result = Timedelta(r, unit)<EOL>if not box:<EOL><INDENT>result = result.asm8.view('<STR_LIT>')<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>if errors == '<STR_LIT>':<EOL><INDENT>raise<EOL><DEDENT>elif errors == '<STR_LIT:ignore>':<EOL><INDENT>return r<EOL><DEDENT>result = NaT<EOL><DEDENT>return result<EOL>
Convert string 'r' to a timedelta object.