code: def pkgconfig(*packages, **kw):
  	
  	kw = kw.copy()
  	flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}  # kwargs of :class:`Extension`
  	for token in check_output(["pkg-config", "--libs", "--cflags"] + list(packages)).split():
  		if token[:2] in flag_map:
  			kw.setdefault(flag_map[token[:2]], []).append(token[2:])
  		else:  # throw others to extra_link_args
  			kw.setdefault('extra_link_args', []).append(token)
  	return kw
docs: :param str packages: list like 'libavutil', 'libavformat', ...
  	:rtype: dict[str]