def get_clinical_data(tcga_id):
payload = {<EOL>'<STR_LIT>': '<STR_LIT:true>',<EOL>"<STR_LIT>": json.dumps({<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT:content>": [<EOL>{<EOL>"<STR_LIT>":"<STR_LIT>",<EOL>"<STR_LIT:content>":{<EOL>"<STR_LIT>":"<STR_LIT>",<EOL>"<STR_LIT:value>":["<STR_LIT>"]}},<EOL>{<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT:content>": {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT:value>": [tcga_id]}}]<EOL>}),<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT:true>',<EOL>'<STR_LIT:size>': <NUM_LIT>,<EOL>'<STR_LIT:filename>': '<STR_LIT>' % tcga_id,<EOL>}<EOL>r = requests.get('<STR_LIT>', params=payload)<EOL>j = json.loads(r.content.decode())<EOL>clinical = {}<EOL>valid = <NUM_LIT:0><EOL>for s in j:<EOL><INDENT>if '<STR_LIT>' not in s:<EOL><INDENT>continue<EOL><DEDENT>valid += <NUM_LIT:1><EOL>assert len(s['<STR_LIT>']) == <NUM_LIT:1><EOL>diag = s['<STR_LIT>'][<NUM_LIT:0>]<EOL>tcga_id = diag['<STR_LIT>'][:<NUM_LIT:12>]<EOL>clinical[tcga_id] = diag<EOL><DEDENT>logger.info('<STR_LIT>', valid)<EOL>df = pd.DataFrame.from_dict(clinical).T<EOL>df.sort_index(inplace=True)<EOL>return df<EOL>
Get clinical data for a TCGA project.

    Parameters
    ----------
    tcga_id : str
        The TCGA project ID.

    Returns
    -------
    `pandas.DataFrame`
        The clinical data.abs

    Notes
    -----
    Clinical data is associated with individual cases (patients). These
    correspond to rows in the returned data frame, and are identified by
    12-character TCGA barcodes.