def create_index(self, name, **kwargs):
    index = {}
    keys = [key for key in kwargs.keys() if (key in self.table.headers())]
    is_callable = {}
    is_regex = {}
    for key in keys:
        index[key] = []
        value = kwargs[key]
        is_callable[key] = (isinstance(value, FunctionType) or isinstance(value, LambdaType))
        is_regex[key] = isinstance(value, _pattern_type)
    for (idx, row) in enumerate(self.table):
        for key in keys:
            value = kwargs[key]
            if value:
                if is_callable[key]:
                    index_available = value(idx, row)
                elif is_regex[key]:
                    index_available = bool(value.match(row[key]))
                else:
                    index_available = (row[key] == value)
                if (not index_available):
                    continue
            index[key].append(idx)
    for key in keys:
        index[key] = set(index[key])
    self.indices[name] = index
    return self
def create_index(self, name, **kwargs):
    index = {}
    keys = [key for key in kwargs.keys() if (key in self.table.headers())]
    is_callable = {}
    is_regex = {}
    for key in keys:
        index[key] = []
        value = kwargs[key]
        is_callable[key] = (isinstance(value, FunctionType) or isinstance(value, LambdaType))
        is_regex[key] = isinstance(value, _pattern_type)
    for (idx, row) in enumerate(self.table):
        for key in keys:
            value = kwargs[key]
            if value:
                if is_callable[key]:
                    index_available = value(idx, row)
                elif is_regex[key]:
                    index_available = bool(value.match(row[key]))
                else:
                    index_available = (row[key] == value)
                if (not index_available):
                    continue
            index[key].append(idx)
    for key in keys:
        index[key] = set(index[key])
    self.indices[name] = index
    return self