def reduce_technote_metadata(github_url, metadata, github_data,<EOL>ltd_product_data):
repo_slug = parse_repo_slug_from_url(github_url)<EOL>jsonld = {<EOL>'<STR_LIT>': [<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>"<STR_LIT>"],<EOL>'<STR_LIT>': ['<STR_LIT>', '<STR_LIT>'],<EOL>'<STR_LIT>': github_url<EOL>}<EOL>if '<STR_LIT:url>' in metadata:<EOL><INDENT>url = metadata['<STR_LIT:url>']<EOL><DEDENT>elif '<STR_LIT>' in ltd_product_data:<EOL><INDENT>url = ltd_product_data['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>'<EOL>'<STR_LIT:{}>'.format(github_url))<EOL><DEDENT>jsonld['<STR_LIT>'] = url<EOL>jsonld['<STR_LIT:url>'] = url<EOL>if '<STR_LIT>' in metadata and '<STR_LIT>' in metadata:<EOL><INDENT>jsonld['<STR_LIT>'] = '<STR_LIT>'.format(**metadata)<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>'.format(github_url))<EOL><DEDENT>if '<STR_LIT>' in metadata:<EOL><INDENT>jsonld['<STR_LIT:name>'] = metadata['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT:description>' in metadata:<EOL><INDENT>jsonld['<STR_LIT:description>'] = metadata['<STR_LIT:description>']<EOL><DEDENT>if '<STR_LIT>' in metadata:<EOL><INDENT>jsonld['<STR_LIT>'] = [{'<STR_LIT>': '<STR_LIT>', '<STR_LIT:name>': author_name}<EOL>for author_name in metadata['<STR_LIT>']]<EOL><DEDENT>if '<STR_LIT>' in metadata:<EOL><INDENT>jsonld['<STR_LIT>'] = datetime.datetime.strptime(<EOL>metadata['<STR_LIT>'],<EOL>'<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>_repo_data = github_data['<STR_LIT:data>']['<STR_LIT>']<EOL>_master_data = _repo_data['<STR_LIT>']<EOL>jsonld['<STR_LIT>'] = datetime.datetime.strptime(<EOL>_master_data['<STR_LIT:target>']['<STR_LIT>'],<EOL>'<STR_LIT>')<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>try:<EOL><INDENT>_license_data = github_data['<STR_LIT:data>']['<STR_LIT>']['<STR_LIT>']<EOL>_spdxId = _license_data['<STR_LIT>']<EOL>if _spdxId is not None:<EOL><INDENT>_spdx_url = '<STR_LIT>'.format(_spdxId)<EOL>jsonld['<STR_LIT>'] = _spdx_url<EOL><DEDENT><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>_master_data = github_data['<STR_LIT:data>']['<STR_LIT>']['<STR_LIT>']<EOL>_files = _master_data['<STR_LIT:target>']['<STR_LIT>']['<STR_LIT>']<EOL>for _node in _files:<EOL><INDENT>filename = _node['<STR_LIT:name>']<EOL>normalized_filename = filename.lower()<EOL>if normalized_filename.startswith('<STR_LIT>'):<EOL><INDENT>readme_url = make_raw_content_url(repo_slug, '<STR_LIT>',<EOL>filename)<EOL>jsonld['<STR_LIT>'] = readme_url<EOL>break<EOL><DEDENT><DEDENT><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>travis_url = '<STR_LIT>'.format(repo_slug.full)<EOL>jsonld['<STR_LIT>'] = travis_url<EOL>return jsonld<EOL>
Reduce a technote project's metadata from multiple sources into a
    single JSON-LD resource.

    Parameters
    ----------
    github_url : `str`
        URL of the technote's GitHub repository.
    metadata : `dict`
        The parsed contents of ``metadata.yaml`` found in a technote's
        repository.
    github_data : `dict`
        The contents of the ``technote_repo`` GitHub GraphQL API query.
    ltd_product_data : `dict`
        JSON dataset for the technote corresponding to the
        ``/products/<product>`` of LTD Keeper.

    Returns
    -------
    metadata : `dict`
        JSON-LD-formatted dictionary.

    .. `GitHub personal access token guide`: https://ls.st/41d