'Returns a new :class:`Arrow <arrow.arrow.Arrow>` object with attributes updated
according to inputs.
Use single property names to set their value absolutely:
>>> import arrow
>>> arw = arrow.utcnow()
>>> arw
<Arrow [2013-05-11T22:27:34.787885+00:00]>
>>> arw.replace(year=2014, month=6)
<Arrow [2014-06-11T22:27:34.787885+00:00]>
Use plural property names to shift their current value relatively:
>>> arw.replace(years=1, months=-1)
<Arrow [2014-04-11T22:27:34.787885+00:00]>
You can also provide a timezone expression can also be replaced:
>>> arw.replace(tzinfo=tz.tzlocal())
<Arrow [2013-05-11T22:27:34.787885-07:00]>
Recognized timezone expressions:
- A ``tzinfo`` object.
- A ``str`` describing a timezone, similar to \'US/Pacific\', or \'Europe/Berlin\'.
- A ``str`` in ISO-8601 style, as in \'+07:00\'.
- A ``str``, one of the following:  \'local\', \'utc\', \'UTC\'.'

def replace(self, **kwargs):

    absolute_kwargs = {}
    relative_kwargs = {}
    for (key, value) in kwargs.items():
        if (key in self._ATTRS):
            absolute_kwargs[key] = value
        elif ((key in self._ATTRS_PLURAL) or (key == 'weeks')):
            relative_kwargs[key] = value
        elif (key == 'week'):
            raise AttributeError('setting    absolute    week    is    not    supported')
        elif (key != 'tzinfo'):
            raise AttributeError()
    current = self._datetime.replace(**absolute_kwargs)
    current += relativedelta(**relative_kwargs)
    tzinfo = kwargs.get('tzinfo')
    if (tzinfo is not None):
        tzinfo = self._get_tzinfo(tzinfo)
        current = current.replace(tzinfo=tzinfo)
    return self.fromdatetime(current)
