'Obtain tokens in this translation unit.
This is a generator for Token instances. The caller specifies a range
of source code to obtain tokens for. The range can be specified as a
2-tuple of SourceLocation or as a SourceRange. If both are defined,
behavior is undefined.'

def get_tokens(self, locations=None, extent=None):

    if (locations is not None):
        extent = SourceRange(start=locations[0], end=locations[1])
    return TokenGroup.get_tokens(self, extent)
