<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_cands(filename):
 """Read in the contents of a cands comb file"""

    import sre
    
    lines=file(filename).readlines()
    exps=[]
    cands=[]
    coo=[]
    for line in lines:
        if ( line[0:2]=="##" ) :
            break
        exps.append(line[2:].strip())

    for line in lines:
        if ( line[0]=="#" ) :
            continue
        if len(line.strip())==0:
            if len(coo)!=0:
                cands.append(coo)
            coo=[]
            continue
        vals=line.split()
        cols=['x','y','x_0','y_0','flux','size','max_int','elon']
        values={}
        for j in range(len(cols)):
            col=cols.pop().strip()
            val=vals.pop().strip()
            values[col]=float(val)
        coo.append(values)
    cands.append(coo)
    return {'fileId': exps, 'cands': cands}