def process_user_record(cls, info):
        """Type convert the csv record, modifies in place."""
        keys = list(info.keys())
        # Value conversion
        for k in keys:
            v = info[k]
            if v in ('N/A', 'no_information'):
                info[k] = None
            elif v == 'false':
                info[k] = False
            elif v == 'true':
                info[k] = True
        # Object conversion
        for p, t in cls.list_sub_objects:
            obj = dict([(k[len(p):], info.pop(k))
                        for k in keys if k.startswith(p)])
            if obj.get('active', False):
                info.setdefault(t, []).append(obj)
        return info
def process_user_record ( cls , info ) : keys = list ( info . keys ( ) ) for k in keys : v = info [ k ] if v in ( 'N/A' , 'no_information' ) : info [ k ] = None elif v == 'false' : info [ k ] = False elif v == 'true' : info [ k ] = True for p , t in cls . list_sub_objects : obj = dict ( [ ( k [ len ( p ) : ] , info . pop ( k ) ) for k in keys if k . startswith ( p ) ] ) if obj . get ( 'active' , False ) : info . setdefault ( t , [ ] ) . append ( obj ) return info
Type convert the csv record, modifies in place.