# Path: servicebus/pika/frame.py
# LOGGER = logging.getLogger(__name__)
#     NAME = 'Frame'
#     NAME = 'METHOD'
#     NAME = 'Header'
#     NAME = 'Body'
#     NAME = 'Heartbeat'
#     NAME = 'ProtocolHeader'
# class Frame(amqp_object.AMQPObject):
# class Method(Frame):
# class Header(Frame):
# class Body(Frame):
# class Heartbeat(Frame):
# class ProtocolHeader(amqp_object.AMQPObject):
#     def __init__(self, frame_type, channel_number):
#     def _marshal(self, pieces):
#     def marshal(self):
#     def __init__(self, channel_number, method):
#     def marshal(self):
#     def __init__(self, channel_number, body_size, props):
#     def marshal(self):
#     def __init__(self, channel_number, fragment):
#     def marshal(self):
#     def __init__(self):
#     def marshal(self):
#     def __init__(self, major=None, minor=None, revision=None):
#     def marshal(self):
# def decode_frame(data_in):
# 
# Path: servicebus/pika/amqp_object.py
# class AMQPObject(object):
# class Class(AMQPObject):
# class Method(AMQPObject):
# class Properties(AMQPObject):
#     NAME = 'AMQPObject'
#     INDEX = None
#     NAME = 'Unextended Class'
#     NAME = 'Unextended Method'
#     NAME = 'Unextended Properties'
#     def __repr__(self):
#     def _set_content(self, properties, body):
#     def get_properties(self):
#     def get_body(self):


import functools
import logging
from servicebus.pika import frame
from servicebus.pika import amqp_object
from servicebus.pika.compat import xrange, canonical_str
"""Callback management class, common area for keeping track of all callbacks in
the Pika stack.

"""


LOGGER = logging.getLogger(__name__)


def name_or_value(value):
    """Will take Frame objects, classes, etc and attempt to return a valid
    string identifier for them.

    :param value: The value to sanitize
    :type value:  pika.amqp_object.AMQPObject|pika.frame.Frame|int|unicode|str
    :rtype: str

    """
    # Is it subclass of AMQPObject
    try:
        if issubclass(value, amqp_object.AMQPObject):
            return value.NAME
    except TypeError:
        pass

    # Is it a Pika frame object?
    if isinstance(value, frame.Method):
        return value.method.NAME

    # Is it a Pika frame object (go after Method since Method extends this)

# Path: servicebus/pika/frame.py
# LOGGER = logging.getLogger(__name__)
#     NAME = 'Frame'
#     NAME = 'METHOD'
#     NAME = 'Header'
#     NAME = 'Body'
#     NAME = 'Heartbeat'
#     NAME = 'ProtocolHeader'
# class Frame(amqp_object.AMQPObject):
# class Method(Frame):
# class Header(Frame):
# class Body(Frame):
# class Heartbeat(Frame):
# class ProtocolHeader(amqp_object.AMQPObject):
#     def __init__(self, frame_type, channel_number):
#     def _marshal(self, pieces):
#     def marshal(self):
#     def __init__(self, channel_number, method):
#     def marshal(self):
#     def __init__(self, channel_number, body_size, props):
#     def marshal(self):
#     def __init__(self, channel_number, fragment):
#     def marshal(self):
#     def __init__(self):
#     def marshal(self):
#     def __init__(self, major=None, minor=None, revision=None):
#     def marshal(self):
# def decode_frame(data_in):
# 
# Path: servicebus/pika/amqp_object.py
# class AMQPObject(object):
# class Class(AMQPObject):
# class Method(AMQPObject):
# class Properties(AMQPObject):
#     NAME = 'AMQPObject'
#     INDEX = None
#     NAME = 'Unextended Class'
#     NAME = 'Unextended Method'
#     NAME = 'Unextended Properties'
#     def __repr__(self):
#     def _set_content(self, properties, body):
#     def get_properties(self):
#     def get_body(self):


# Path: servicebus/pika/callback.py
import functools
import logging
from servicebus.pika import frame
from servicebus.pika import amqp_object
from servicebus.pika.compat import xrange, canonical_str

"""Callback management class, common area for keeping track of all callbacks in
the Pika stack.

"""


LOGGER = logging.getLogger(__name__)


def name_or_value(value):
    """Will take Frame objects, classes, etc and attempt to return a valid
    string identifier for them.

    :param value: The value to sanitize
    :type value:  pika.amqp_object.AMQPObject|pika.frame.Frame|int|unicode|str
    :rtype: str

    """
    # Is it subclass of AMQPObject
    try:
        if issubclass(value, amqp_object.AMQPObject):
            return value.NAME
    except TypeError:
        pass

    # Is it a Pika frame object?
    if isinstance(value, frame.Method):
        return value.method.NAME

    # Is it a Pika frame object (go after Method since Method extends this)

    if isinstance(value, amqp_object.AMQPObject):