# Path: geopy/timezone.py
# class Timezone:
#     """
#     Contains a parsed response for a timezone request, which is
#     implemented in few geocoders which provide such lookups.
#     """
# 
#     __slots__ = ("_pytz_timezone", "_raw")
# 
#     def __init__(self, pytz_timezone, raw):
#         self._pytz_timezone = pytz_timezone
#         self._raw = raw
# 
#     @property
#     def pytz_timezone(self):
#         """
#         pytz timezone instance.
# 
#         :rtype: :class:`pytz.tzinfo.BaseTzInfo`
#         """
#         return self._pytz_timezone
# 
#     @property
#     def raw(self):
#         """
#         Timezone's raw, unparsed geocoder response. For details on this,
#         consult the service's documentation.
# 
#         :rtype: dict
#         """
#         return self._raw
# 
#     def __str__(self):
#         return str(self._pytz_timezone)
# 
#     def __repr__(self):
#         return "Timezone(%s)" % repr(self.pytz_timezone)
# 
#     def __getstate__(self):
#         return self._pytz_timezone, self._raw
# 
#     def __setstate__(self, state):
#         self._pytz_timezone, self._raw = state
# 
#     def __eq__(self, other):
#         return (
#             isinstance(other, Timezone) and
#             self._pytz_timezone == other._pytz_timezone and
#             self.raw == other.raw
#         )
# 
#     def __ne__(self, other):
#         return not (self == other)
# 
# def from_fixed_gmt_offset(gmt_offset_hours, raw):
#     ensure_pytz_is_installed()
#     pytz_timezone = pytz.FixedOffset(gmt_offset_hours * 60)
#     return Timezone(pytz_timezone, raw)
# 
# def from_timezone_name(timezone_name, raw):
#     ensure_pytz_is_installed()
#     try:
#         pytz_timezone = pytz.timezone(timezone_name)
#     except pytz.UnknownTimeZoneError:
#         raise GeocoderParseError(
#             "pytz could not parse the timezone identifier (%s) "
#             "returned by the service." % timezone_name
#         )
#     except KeyError:
#         raise GeocoderParseError(
#             "geopy could not find a timezone in this response: %s" %
#             raw
#         )
#     return Timezone(pytz_timezone, raw)


import datetime
import pickle
import unittest
import pytest
    import pytz
    import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
        olson_tz = pytz.timezone(self.timezone_name)
        dt = datetime.datetime.utcnow()
        self.assertEqual(tz.pytz_timezone.utcoffset(dt), olson_tz.utcoffset(dt))

    def test_create_from_pytz_timezone(self):
        pytz_timezone = pytz.timezone(self.timezone_name)
        tz = Timezone(pytz_timezone, {})
        self.assertIs(tz.pytz_timezone, pytz_timezone)

    def test_string(self):
        raw = dict(foo="bar")
        tz = from_timezone_name(self.timezone_name, raw)
        self.assertEqual(str(tz), self.timezone_name)

    def test_repr(self):
        raw = dict(foo="bar")
        pytz_timezone = pytz.timezone(self.timezone_name)
        tz = Timezone(pytz_timezone, raw)
        self.assertEqual(repr(tz), "Timezone(%s)" % repr(pytz_timezone))

    def test_eq(self):
        tz = pytz.timezone("Europe/Paris")
        raw1 = dict(a=1)
        raw2 = dict(a=1)
        self.assertEqual(Timezone(tz, raw1), Timezone(tz, raw2))

    def test_ne(self):
        tz1 = pytz.timezone("Europe/Paris")
        tz2 = pytz.timezone("Europe/Prague")
        raw = {}

# Path: geopy/timezone.py
# class Timezone:
#     """
#     Contains a parsed response for a timezone request, which is
#     implemented in few geocoders which provide such lookups.
#     """
# 
#     __slots__ = ("_pytz_timezone", "_raw")
# 
#     def __init__(self, pytz_timezone, raw):
#         self._pytz_timezone = pytz_timezone
#         self._raw = raw
# 
#     @property
#     def pytz_timezone(self):
#         """
#         pytz timezone instance.
# 
#         :rtype: :class:`pytz.tzinfo.BaseTzInfo`
#         """
#         return self._pytz_timezone
# 
#     @property
#     def raw(self):
#         """
#         Timezone's raw, unparsed geocoder response. For details on this,
#         consult the service's documentation.
# 
#         :rtype: dict
#         """
#         return self._raw
# 
#     def __str__(self):
#         return str(self._pytz_timezone)
# 
#     def __repr__(self):
#         return "Timezone(%s)" % repr(self.pytz_timezone)
# 
#     def __getstate__(self):
#         return self._pytz_timezone, self._raw
# 
#     def __setstate__(self, state):
#         self._pytz_timezone, self._raw = state
# 
#     def __eq__(self, other):
#         return (
#             isinstance(other, Timezone) and
#             self._pytz_timezone == other._pytz_timezone and
#             self.raw == other.raw
#         )
# 
#     def __ne__(self, other):
#         return not (self == other)
# 
# def from_fixed_gmt_offset(gmt_offset_hours, raw):
#     ensure_pytz_is_installed()
#     pytz_timezone = pytz.FixedOffset(gmt_offset_hours * 60)
#     return Timezone(pytz_timezone, raw)
# 
# def from_timezone_name(timezone_name, raw):
#     ensure_pytz_is_installed()
#     try:
#         pytz_timezone = pytz.timezone(timezone_name)
#     except pytz.UnknownTimeZoneError:
#         raise GeocoderParseError(
#             "pytz could not parse the timezone identifier (%s) "
#             "returned by the service." % timezone_name
#         )
#     except KeyError:
#         raise GeocoderParseError(
#             "geopy could not find a timezone in this response: %s" %
#             raw
#         )
#     return Timezone(pytz_timezone, raw)


# Path: test/test_timezone.py
import datetime
import pickle
import unittest
import pytest
    import pytz
    import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name

        olson_tz = pytz.timezone(self.timezone_name)
        dt = datetime.datetime.utcnow()
        self.assertEqual(tz.pytz_timezone.utcoffset(dt), olson_tz.utcoffset(dt))

    def test_create_from_pytz_timezone(self):
        pytz_timezone = pytz.timezone(self.timezone_name)
        tz = Timezone(pytz_timezone, {})
        self.assertIs(tz.pytz_timezone, pytz_timezone)

    def test_string(self):
        raw = dict(foo="bar")
        tz = from_timezone_name(self.timezone_name, raw)
        self.assertEqual(str(tz), self.timezone_name)

    def test_repr(self):
        raw = dict(foo="bar")
        pytz_timezone = pytz.timezone(self.timezone_name)
        tz = Timezone(pytz_timezone, raw)
        self.assertEqual(repr(tz), "Timezone(%s)" % repr(pytz_timezone))

    def test_eq(self):
        tz = pytz.timezone("Europe/Paris")
        raw1 = dict(a=1)
        raw2 = dict(a=1)
        self.assertEqual(Timezone(tz, raw1), Timezone(tz, raw2))

    def test_ne(self):
        tz1 = pytz.timezone("Europe/Paris")
        tz2 = pytz.timezone("Europe/Prague")
        raw = {}

        self.assertNotEqual(Timezone(tz1, raw), Timezone(tz2, raw))