':param container_instance: The container instance trying to be placed onto
:param task_resource_requirements: The calculated resource requirements of the task in the form of a dict
:return: A boolean stating whether the given container instance has enough resources to have the task placed on
it as well as a description, if it cannot be placed this will describe why.'

@staticmethod
def _can_be_placed(container_instance, task_resource_requirements):

    remaining_cpu = 0
    remaining_memory = 0
    reserved_ports = []
    for resource in container_instance.remaining_resources:
        if (resource.get(u'name') == u'CPU'):
            remaining_cpu = resource.get(u'integerValue')
        elif (resource.get(u'name') == u'MEMORY'):
            remaining_memory = resource.get(u'integerValue')
        elif (resource.get(u'name') == u'PORTS'):
            reserved_ports = resource.get(u'stringSetValue')
    if (task_resource_requirements.get(u'CPU') > remaining_cpu):
        return (False, u'Not    enough    CPU    credits')
    if (task_resource_requirements.get(u'MEMORY') > remaining_memory):
        return (False, u'Not    enough    memory')
    ports_needed = task_resource_requirements.get(u'PORTS')
    for port in ports_needed:
        if (str(port) in reserved_ports):
            return (False, u'Port    clash')
    return (True, u'Can    be    placed')
