def extract_log(log_path, dict_type=dict):
        """
        Parses the log file generated by a launcher and returns
        dictionary with tid keys and specification values.

        Ordering can be maintained by setting dict_type to the
        appropriate constructor (i.e. OrderedDict). Keys are converted
        from unicode to strings for kwarg use.
        """
        log_path = (log_path if os.path.isfile(log_path)
                    else os.path.join(os.getcwd(), log_path))
        with open(log_path,'r') as log:
            splits = (line.split() for line in log)
            uzipped = ((int(split[0]), json.loads(" ".join(split[1:]))) for split in splits)
            szipped = [(i, dict((str(k),v) for (k,v) in d.items())) for (i,d) in uzipped]
        return dict_type(szipped)
def extract_log(log_path, dict_type=dict):
        """
        Parses the log file generated by a launcher and returns
        dictionary with tid keys and specification values.

        Ordering can be maintained by setting dict_type to the
        appropriate constructor (i.e. OrderedDict). Keys are converted
        from unicode to strings for kwarg use.
        """
        log_path = (log_path if os.path.isfile(log_path)
                    else os.path.join(os.getcwd(), log_path))
        with open(log_path,'r') as log:
            splits = (line.split() for line in log)
            uzipped = ((int(split[0]), json.loads(" ".join(split[1:]))) for split in splits)
            szipped = [(i, dict((str(k),v) for (k,v) in d.items())) for (i,d) in uzipped]
        return dict_type(szipped)
def extract_log ( log_path , dict_type = dict ) : log_path = ( log_path if os . path . isfile ( log_path ) else os . path . join ( os . getcwd ( ) , log_path ) ) with open ( log_path , 'r' ) as log : splits = ( line . split ( ) for line in log ) uzipped = ( ( int ( split [ 0 ] ) , json . loads ( " " . join ( split [ 1 : ] ) ) ) for split in splits ) szipped = [ ( i , dict ( ( str ( k ) , v ) for ( k , v ) in d . items ( ) ) ) for ( i , d ) in uzipped ] return dict_type ( szipped )
Parses the log file generated by a launcher and returns
        dictionary with tid keys and specification values.

        Ordering can be maintained by setting dict_type to the
        appropriate constructor (i.e. OrderedDict). Keys are converted
        from unicode to strings for kwarg use.
Parses the log file generated by a launcher and returns dictionary with tid keys and specification values .