def cluster_number(self, data, maxgap):
data.sort()<EOL>groups = [[data[<NUM_LIT:0>]]]<EOL>for x in data[<NUM_LIT:1>:]:<EOL><INDENT>if abs(x - groups[-<NUM_LIT:1>][-<NUM_LIT:1>]) <= maxgap:<EOL><INDENT>groups[-<NUM_LIT:1>].append(x)<EOL><DEDENT>else:<EOL><INDENT>groups.append([x])<EOL><DEDENT><DEDENT>return groups<EOL>
General function that clusters numbers.

        Args
            data (list): list of integers.
            maxgap (int): max gap between numbers in the cluster.