def read_csvlc(lcfile):
<EOL>if '<STR_LIT>' in os.path.basename(lcfile):<EOL><INDENT>LOGINFO('<STR_LIT>' % lcfile)<EOL>infd = gzip.open(lcfile,'<STR_LIT:rb>')<EOL><DEDENT>else:<EOL><INDENT>LOGINFO('<STR_LIT>' % lcfile)<EOL>infd = open(lcfile,'<STR_LIT:rb>')<EOL><DEDENT>lcformat_check = infd.read(<NUM_LIT:12>).decode()<EOL>if '<STR_LIT>' in lcformat_check:<EOL><INDENT>infd.close()<EOL>return read_lcc_csvlc(lcfile)<EOL><DEDENT>else:<EOL><INDENT>infd.seek(<NUM_LIT:0>)<EOL><DEDENT>lctext = infd.read().decode()  <EOL>infd.close()<EOL>lcstart = lctext.index('<STR_LIT>')<EOL>lcheader = lctext[:lcstart+<NUM_LIT:12>]<EOL>lccolumns = lctext[lcstart+<NUM_LIT>:].split('<STR_LIT:\n>')<EOL>lccolumns = [x for x in lccolumns if len(x) > <NUM_LIT:0>]<EOL>lcdict = _parse_csv_header(lcheader)<EOL>lccolumns = [x.split('<STR_LIT:U+002C>') for x in lccolumns]<EOL>lccolumns = list(zip(*lccolumns))  <EOL>for colind, col in enumerate(lcdict['<STR_LIT>']):<EOL><INDENT>if (col.split('<STR_LIT:_>')[<NUM_LIT:0>] in LC_MAG_COLUMNS or<EOL>col.split('<STR_LIT:_>')[<NUM_LIT:0>] in LC_ERR_COLUMNS or<EOL>col.split('<STR_LIT:_>')[<NUM_LIT:0>] in LC_FLAG_COLUMNS):<EOL><INDENT>lcdict[col] = np.array([_smartcast(x,<EOL>COLUMNDEFS[col.split('<STR_LIT:_>')[<NUM_LIT:0>]][<NUM_LIT:2>])<EOL>for x in lccolumns[colind]])<EOL><DEDENT>elif col in COLUMNDEFS:<EOL><INDENT>lcdict[col] = np.array([_smartcast(x,COLUMNDEFS[col][<NUM_LIT:2>])<EOL>for x in lccolumns[colind]])<EOL><DEDENT>else:<EOL><INDENT>LOGWARNING('<STR_LIT>' % col)<EOL>continue<EOL><DEDENT><DEDENT>return lcdict<EOL>
This reads a HAT data server or LCC-Server produced CSV light curve
    into an lcdict.

    This will automatically figure out the format of the file
    provided. Currently, it can read:

    - legacy HAT data server CSV LCs (e.g. from
      https://hatsouth.org/planets/lightcurves.html) with an extension of the
      form: `.hatlc.csv.gz`.
    - all LCC-Server produced LCC-CSV-V1 LCs (e.g. from
      https://data.hatsurveys.org) with an extension of the form: `-csvlc.gz`.


    Parameters
    ----------

    lcfile : str
        The light curve file to read.

    Returns
    -------

    dict
        Returns an lcdict that can be read and used by many astrobase processing
        functions.