<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_composite_tokens(self, name, tokens):
 """ Return the key and contents of a KEY..END block for PATTERN, POINTS, and PROJECTION """

        assert len(tokens) >= 2
        key = tokens[0]

        assert key.value.lower() == name
        assert tokens[-1].value.lower() == "end"

        if len(tokens) == 2:
            body = []  # empty TYPE..END block
        else:
            body = tokens[1:-1]

        body_tokens = []

        for t in body:
            if isinstance(t, dict):
                body_tokens.append(t["__tokens__"])
            else:
                body_tokens.append(t)
        return key, body_tokens