def get_biospecimen_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>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<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>biospec = {}<EOL>valid = <NUM_LIT:0><EOL>for case in j:<EOL><INDENT>if '<STR_LIT>' not in case:<EOL><INDENT>continue<EOL><DEDENT>valid += <NUM_LIT:1><EOL>for s in case['<STR_LIT>']:<EOL><INDENT>tcga_id = s['<STR_LIT>'][:<NUM_LIT:16>]<EOL>del s['<STR_LIT>']<EOL>del s['<STR_LIT>']<EOL>biospec[tcga_id] = s<EOL><DEDENT><DEDENT>logger.info('<STR_LIT>', valid)<EOL>df = pd.DataFrame.from_dict(biospec).T<EOL>df.sort_index(inplace=True)<EOL>return df<EOL>
Get biospecimen data for a TCGA project.

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

    Returns
    -------
    `pandas.DataFrame`
        The biospecmin data.

    Notes
    -----
    Biospecimen data is associated with individual vials. TCGA vials correspond
    to portions of a sample, and are uniquely identified by a 16-character
    barcode. For example, one vial can contain FFPE material and the other
    fresh-frozen material from the same sample. Each row in the returned data
    frame corresponds to a vial.