original_docstring:  Check to see if a task fits a given offer's resources
  
      :param task: the task specification to check
      :param offer_resources: a mapping of resource name -> available resources
          (should come from :func:`get_offer_resources`)
      :returns: True if the offer has enough resources for the task, False otherwise
      
docstring: Check to see if a task fits a given offer's resources
docstring_tokens: Check to see if a task fits a given offer ' s resources
code: def task_fits(task: MesosTaskConfig, offer_resources: ResourceSet) -> bool:
      """ Check to see if a task fits a given offer's resources
  
      :param task: the task specification to check
      :param offer_resources: a mapping of resource name -> available resources
          (should come from :func:`get_offer_resources`)
      :returns: True if the offer has enough resources for the task, False otherwise
      """
      for rname, value in offer_resources.items():
          if rname in _NUMERIC_RESOURCES and task[rname] > value:
              return False
          elif rname == 'ports' and len(value) == 0:  # TODO validate port ranges
              return False
  
      return True
code_tokens: def task_fits ( task : MesosTaskConfig , offer_resources : ResourceSet ) -> bool : for rname , value in offer_resources . items ( ) : if rname in _NUMERIC_RESOURCES and task [ rname ] > value : return False elif rname == 'ports' and len ( value ) == 0 : return False return True
short_docstring: Check to see if a task fits a given offer's resources
short_docstring_tokens: Check to see if a task fits a given offer ' s resources
comment: """ Check to see if a task fits a given offer's resources
  
      :param task: the task specification to check
      :param offer_resources: a mapping of resource name -> available resources
          (should come from :func:`get_offer_resources`)
      :returns: True if the offer has enough resources for the task, False otherwise
      """$SEP$# TODO validate port ranges