def channel_session(func):
    @functools.wraps(func)
    def inner(message, *args, **kwargs):
        # Make sure there's NOT a channel_session already
        if hasattr(message, "channel_session"):
            return func(message, *args, **kwargs)
        # Make sure there's a reply_channel
        if not message.reply_channel:
            raise ValueError(
                "No reply_channel sent to consumer; @channel_session " +
                "can only be used on messages containing it."
            )
        # If the session does not already exist, save to force our
        # session key to be valid.
        session = session_for_reply_channel(message.reply_channel.name)
        if not session.exists(session.session_key):
            try:
                session.save(must_create=True)
            except CreateError:
                # Session wasn't unique, so another consumer is doing the same thing
                raise ConsumeLater()
        message.channel_session = session
        # Run the consumer
        try:
            return func(message, *args, **kwargs)
        finally:
            # Persist session if needed
            if session.modified:
                session.save()
    return inner
Reads the installation requirements from requirements.pip
dataset/ETHPy150Open andrewgodwin/channels/channels/sessions.py/channel_session--crossover with--dataset/ETHPy150Open jordan-wright/rapportive/setup.py/get_requirements