# Path: aredis/exceptions.py
# class RedisError(Exception):
#     pass
# 
# Path: aredis/utils.py
# def b(x):
#     return x.encode('latin-1') if not isinstance(x, bytes) else x
# 
# def nativestr(x):
#     return x if isinstance(x, str) else x.decode('utf-8', 'replace')


from aredis.exceptions import RedisError
from aredis.utils import b, nativestr
    # the properly native Python value.
    f = [nativestr]
    f += [cast[o] for o in ['withdist', 'withhash', 'withcoord'] if options[o]]
    return [
        list(map(lambda fv: fv[0](fv[1]), zip(f, r))) for r in response_list
    ]


class GeoCommandMixin:

    RESPONSE_CALLBACKS = {
        'GEOPOS': lambda r: list(map(lambda ll: (float(ll[0]),
                                                 float(ll[1]))
                                                 if ll is not None else None, r)),
        'GEOHASH': lambda r: list(r),
        'GEORADIUS': parse_georadius_generic,
        'GEORADIUSBYMEMBER': parse_georadius_generic,
        'GEODIST': float,
        'GEOADD': int
    }

    # GEO COMMANDS
    async def geoadd(self, name, *values):
        """
        Add the specified geospatial items to the specified key identified
        by the ``name`` argument. The Geospatial items are given as ordered
        members of the ``values`` argument, each item or place is formed by
        the triad latitude, longitude and name.
        """
        if len(values) % 3 != 0:

# Path: aredis/exceptions.py
# class RedisError(Exception):
#     pass
# 
# Path: aredis/utils.py
# def b(x):
#     return x.encode('latin-1') if not isinstance(x, bytes) else x
# 
# def nativestr(x):
#     return x if isinstance(x, str) else x.decode('utf-8', 'replace')


# Path: aredis/commands/geo.py
from aredis.exceptions import RedisError
from aredis.utils import b, nativestr

    # the properly native Python value.
    f = [nativestr]
    f += [cast[o] for o in ['withdist', 'withhash', 'withcoord'] if options[o]]
    return [
        list(map(lambda fv: fv[0](fv[1]), zip(f, r))) for r in response_list
    ]


class GeoCommandMixin:

    RESPONSE_CALLBACKS = {
        'GEOPOS': lambda r: list(map(lambda ll: (float(ll[0]),
                                                 float(ll[1]))
                                                 if ll is not None else None, r)),
        'GEOHASH': lambda r: list(r),
        'GEORADIUS': parse_georadius_generic,
        'GEORADIUSBYMEMBER': parse_georadius_generic,
        'GEODIST': float,
        'GEOADD': int
    }

    # GEO COMMANDS
    async def geoadd(self, name, *values):
        """
        Add the specified geospatial items to the specified key identified
        by the ``name`` argument. The Geospatial items are given as ordered
        members of the ``values`` argument, each item or place is formed by
        the triad latitude, longitude and name.
        """
        if len(values) % 3 != 0:

            raise RedisError("GEOADD requires places with lon, lat and name"