I would make a single function for `checkin_versions` and `mkbranch_versions` that takes in the type/operation:

```
def filter_versions(self, versions, op, date):
    def f(s):
        return s[0] ==  and s[1] < date and filterBranches(s[2], True)
    return list(filter(f, versions))

self.filter_versions(all_versions, 'checkinversion', date)
```