def parse_link(header_value, strict=True):
sanitized = _remove_comments(header_value)<EOL>links = []<EOL>def parse_links(buf):<EOL><INDENT>"""<STR_LIT>"""<EOL>quoted = re.findall('<STR_LIT>', buf)<EOL>for segment in quoted:<EOL><INDENT>left, match, right = buf.partition(segment)<EOL>match = match.replace('<STR_LIT:U+002C>', '<STR_LIT>')<EOL>match = match.replace('<STR_LIT:;>', '<STR_LIT>')<EOL>buf = '<STR_LIT>'.join([left, match, right])<EOL><DEDENT>while buf:<EOL><INDENT>matched = re.match(r'<STR_LIT>', buf)<EOL>if matched:<EOL><INDENT>groups = matched.groupdict()<EOL>params, _, buf = groups['<STR_LIT>'].partition('<STR_LIT:U+002C>')<EOL>params = params.replace('<STR_LIT>', '<STR_LIT:U+002C>')  <EOL>if params and not params.startswith('<STR_LIT:;>'):<EOL><INDENT>raise errors.MalformedLinkValue(<EOL>'<STR_LIT>')<EOL><DEDENT>yield (groups['<STR_LIT>'].strip(),<EOL>[p.replace('<STR_LIT>', '<STR_LIT:;>').strip()<EOL>for p in params[<NUM_LIT:1>:].split('<STR_LIT:;>') if p])<EOL>buf = buf.strip()<EOL><DEDENT>else:<EOL><INDENT>raise errors.MalformedLinkValue('<STR_LIT>', buf)<EOL><DEDENT><DEDENT><DEDENT>for target, param_list in parse_links(sanitized):<EOL><INDENT>parser = _helpers.ParameterParser(strict=strict)<EOL>for name, value in _parse_parameter_list(param_list):<EOL><INDENT>parser.add_value(name, value)<EOL><DEDENT>links.append(datastructures.LinkHeader(target=target,<EOL>parameters=parser.values))<EOL><DEDENT>return links<EOL>
Parse a HTTP Link header.

:param str header_value: the header value to parse
:param bool strict: set this to ``False`` to disable semantic
    checking.  Syntactical errors will still raise an exception.
    Use this if you want to receive all parameters.
:return: a sequence of :class:`~ietfparse.datastructures.LinkHeader`
    instances
:raises ietfparse.errors.MalformedLinkValue:
    if the specified `header_value` cannot be parsed