<s> import os <EOL> import json <EOL> from itertools import groupby <EOL> from rest_framework_ccbv . config import VERSION <EOL> from rest_framework_ccbv . inspector import drfklasses <EOL> def main ( ) : <EOL> d = { } <EOL> d_version = { } <EOL> klasses = sorted ( drfklasses . values ( ) , key = lambda x : x . __module__ ) <EOL> for key , value in groupby ( klasses , lambda x : x . __module__ ) : <EOL> d_version [ key ] = map ( lambda x : x . __name__ , list ( value ) ) <EOL> if os . path . isfile ( '<STR_LIT>' ) : <EOL> with open ( '<STR_LIT>' , '<STR_LIT:r>' ) as f : <EOL> d = json . loads ( f . read ( ) ) <EOL> d [ VERSION ] = d_version <EOL> with open ( '<STR_LIT>' , '<STR_LIT:w>' ) as f : <EOL> json . dump ( d , f , indent = <NUM_LIT:2> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
