Pick entities from a set by selector. In most cases you should use one
        of the higher-level pick_* functions.

def pick(self, selector, entity_set, min_quantity=None):
        """
        Pick entities from a set by selector. In most cases you should use one
        of the higher-level pick_* functions.
        """
        if isinstance(selector, int):
            for e in entity_set:
                if e.id == selector:
                    return set((e,))
        else:
            if selector.lower() in ('self', 'me', 'myself'):
                return set((self.entity,))

            return set(
                e for e in entity_set
                if (e.is_('Named') and selector.lower() in e.Named.name.lower())
                and not e.is_(Invisible)
                and (not min_quantity or min_quantity == 1 or (e.is_(Stackable) and e.Stackable.quantity >= min_quantity))
            )