def get_items(self, field=None,
                  names=None, input_map=None, filter_function=None):
        """Returns the items array, previously selected by the field
           corresponding to the given field name or a user-defined function
           (if set)

        """
        items = []
        if field:
            if field in self.fields:
                field_id = field
            elif field in self.inverted_fields:
                field_id = self.inverted_fields[field]
            else:
                raise ValueError("Failed to find a field name or ID"
                                 " corresponding to %s." % field)

        def filter_function_set(item):
            """Checking filter function if set

            """
            if filter_function is None:
                return True
            return filter_function(item)

        def field_filter(item):
            """Checking if an item is associated to a fieldInfo

            """
            if field is None:
                return True
            return item.field_id == field_id

        def names_filter(item):
            """Checking if an item by name

            """
            if names is None:
                return True
            return item.name in names

        def input_map_filter(item):
            """ Checking if an item is in the input map

            """
            if input_map is None:
                return True
            value = input_map.get(item.field_id)
            return item.matches(value)

        for item in self.items:
            if all([field_filter(item), names_filter(item),
                    input_map_filter(item),
                    filter_function_set(item)]):
                items.append(item)

        return items
dataset/ETHPy150Open bigmlcom/python/bigml/association.py/Association.get_items/original