code: def allocation_used(self, state, allocation_id):
          '''
          Checks if allocation is used by any of the partners.
          If allocation does not exist returns False.
          @param allocation_id: ID of the allocation
          @returns: True/False
          '''
          return len(filter(lambda x: x.allocation_id == allocation_id,
                            state.partners.all)) > f allocation_used(self, state, allocation_id):
          '''
          Checks if allocation is used by any of the partners.
          If allocation does not exist returns False.
          @param allocation_id: ID of the allocation
          @returns: True/False
          '''
          return len(filter(lambda x: x.allocation_id == allocation_id,
                            state.partners.all)) > 0
docs: Checks if allocation is used by any of the partners.
          If allocation does not exist returns False.
          @param allocation_id: ID of the allocation
          @returns: True/False