I would like to have a function `AllTrue` that takes three arguments:

* List: a list of values
* Function: a function to apply to all values
* Condition: something to test against the function's output

and return a boolean of whether or not all values in the list match the criteria.

I can get this to work for basic conditions as follows:

```
def AllTrue(List, Function = "Boolean", Condition = True):
  flag = True
  condition = Condition
  if Function == "Boolean"
    for element in List:
      if element != condition:
        flag = False
        break
  else:
    Map = map(Function, List)
    for m in Map:
      if m != condition:
        flag = False
        break
  return flag

```

Since python doesn't have function meant for explicitly returning if something is True, I just make the default "Boolean". One could clean this up by defining `TrueQ` to return True if an element is True and then just mapping `TrueQ` on the `List`. 

The else handles queries like:

```
l = [[0,1], [2,3,4,5], [6,7], [8,9],[10]]
AllTrue(l, len, 2)
#False

```

testing if all elements in the list are of length 2. However, it can't handle more complex conditions like `>`/`<` or compound conditions like `len > 2 and element[0] == 15`

How can one do this?

---

Cleaned up version

```
def TrueQ(item):
  return item == True

def AllTrue(List, Function = TrueQ, Condition = True):
  flag = True
  condition = Condition
  Map = map(Function, List)
  for m in Map:
    if m != condition:
      flag = False
      break
  return flag

```

and then just call `AllTrue(List,TrueQ)`