def processClubConsumption(f, clubs):
try:<EOL><INDENT>line = next(f)<EOL>assert line.endswith('<STR_LIT>')<EOL>valid_times = list(range(<NUM_LIT>))<EOL>t = <NUM_LIT:0> <EOL>club = None<EOL>clubName = None<EOL>lastDate = None<EOL>while True:<EOL><INDENT>assert t in valid_times<EOL>consumption = <NUM_LIT:0><EOL>for x in range(<NUM_LIT:4>):<EOL><INDENT>line = f.next()[:-<NUM_LIT:1>]<EOL>fields = line.split('<STR_LIT:U+002C>')<EOL>assert len(fields) == <NUM_LIT:4><EOL>for i, field in enumerate(fields):<EOL><INDENT>assert field[<NUM_LIT:0>] == '<STR_LIT:">' and field[-<NUM_LIT:1>] == '<STR_LIT:">'<EOL>fields[i] = field[<NUM_LIT:1>:-<NUM_LIT:1>]<EOL><DEDENT>name = fields[<NUM_LIT:1>]<EOL>partialNames = ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>for pn in partialNames:<EOL><INDENT>if pn in name:<EOL><INDENT>name = pn<EOL><DEDENT><DEDENT>if name != clubName:<EOL><INDENT>clubName = name<EOL>club = clubs[name]<EOL><DEDENT>tokens = fields[<NUM_LIT:2>].split()<EOL>if len(tokens) == <NUM_LIT:1>:<EOL><INDENT>assert consumption == <NUM_LIT:0> and t == <NUM_LIT:0><EOL><DEDENT>date = tokens[<NUM_LIT:0>]<EOL>consumption += float(fields[<NUM_LIT:3>])<EOL><DEDENT>club.updateRecord(date, t, consumption)<EOL>t += <NUM_LIT:1><EOL>t %= <NUM_LIT><EOL><DEDENT><DEDENT>except StopIteration:<EOL><INDENT>return<EOL><DEDENT>
Process the consumption a club

    - Skip the header line
    - Iterate over lines
      - Read 4 records at a time
        - Parse each line: club, date, time, consumption
        - Get club object from dictionary if needed
        - Aggregate consumption
      - Call club.processConsumption() with data