original_docstring: 
      Return SWID tags as utf8-encoded xml bytestrings for all available
      packages.
  
      :param pkcs12_file: Path to the pkcs12 file.
      :param new_root_path: Evidence SWID tag Root path.
      :param version: Evidence SWID tag version.
      :param name: Evidence SWID tag name.
      :param meta_for: Whether the Meta element should hold information about the distribution or about the package.
      :param evidence_paths: List of folders from which the evidence method starts to create SWID tag.
      :param file_path: File-Path to the Package-File.
      :param hierarchic: Optional parameter for the creation of a hierarchical SWID tag.
      :param environment: The package management environment.
      :param entity_name: The SWID tag entity name.
      :param id_prefix: Custom prefix for unique IDs.
      :param regid: The SWID tag regid.
      :param hash_algorithms: Comma separated list of the hash algorithms to include in the SWID tag,
      :param full: Whether to include file payload. Default is False.
      :param matcher: A function that defines whether to return a tag or not. Default is a function that returns ``True`` for all tags.
      :param xml_lang: xml:lang attribute value. Default en-US.
      :param dpkg_include_package_arch: Whether to include architecture in tagId and version.
  
      Returns:
          A generator object for all available SWID XML strings. The XML strings
          are all bytestrings, using UTF-8 encoding.
  
      
docstring: Return SWID tags as utf8-encoded xml bytestrings for all available
  packages.
docstring_tokens: Return SWID tags as utf8 - encoded xml bytestrings for all available packages .
code: def create_swid_tags(environment, entity_name, regid, os_string=None, architecture=None, hash_algorithms='sha256',
                       full=False, matcher=all_matcher, hierarchic=False, file_path=None, evidence_paths=None,
                       name=None, version=None, new_root_path=None, pkcs12_file=None, xml_lang=None, schema_location=False,
                       meta_for='os', id_prefix=None, dpkg_include_package_arch=False):
      """
      Return SWID tags as utf8-encoded xml bytestrings for all available
      packages.
  
      :param pkcs12_file: Path to the pkcs12 file.
      :param new_root_path: Evidence SWID tag Root path.
      :param version: Evidence SWID tag version.
      :param name: Evidence SWID tag name.
      :param meta_for: Whether the Meta element should hold information about the distribution or about the package.
      :param evidence_paths: List of folders from which the evidence method starts to create SWID tag.
      :param file_path: File-Path to the Package-File.
      :param hierarchic: Optional parameter for the creation of a hierarchical SWID tag.
      :param environment: The package management environment.
      :param entity_name: The SWID tag entity name.
      :param id_prefix: Custom prefix for unique IDs.
      :param regid: The SWID tag regid.
      :param hash_algorithms: Comma separated list of the hash algorithms to include in the SWID tag,
      :param full: Whether to include file payload. Default is False.
      :param matcher: A function that defines whether to return a tag or not. Default is a function that returns ``True`` for all tags.
      :param xml_lang: xml:lang attribute value. Default en-US.
      :param dpkg_include_package_arch: Whether to include architecture in tagId and version.
  
      Returns:
          A generator object for all available SWID XML strings. The XML strings
          are all bytestrings, using UTF-8 encoding.
  
      """
  
      ctx = {
          'regid': regid,
          'environment': environment,
          'entity_name': entity_name,
          'os_string': os_string,
          'architecture': architecture,
          'meta_for': meta_for,
          'full': full,
          'hash_algorithms': hash_algorithms,
          'hierarchic': hierarchic,
          'file_path': file_path,
          'evidence_paths': evidence_paths,
          'new_root_path': new_root_path,
          'xml_lang': xml_lang,
          'schema_location': schema_location,
          'id_prefix': id_prefix,
          'dpkg_include_package_arch': dpkg_include_package_arch,
      }
  
      if os_string is None:
          ctx['os_string'] = ctx['environment'].get_os_string()
  
      if architecture is None:
          ctx['architecture'] = ctx['environment'].get_architecture()
  
      if file_path is not None:
          pi = environment.get_packageinfo_from_packagefile(file_path, ctx)
  
          ctx['package_info'] = pi
  
          software_identity = create_software_identity_element(ctx, from_package_file=True)
  
          if pkcs12_file is not None:
              ET.register_namespace('dsig', "http://www.w3.org/2000/09/xmldsig#")
              signature_template_tree = ET.fromstring(SIGNATURE)
              software_identity.append(signature_template_tree)
  
          swidtag = ET.tostring(software_identity, encoding='utf-8').replace(b'\n', b'')
          yield XML_DECLARATION.encode('utf-8') + swidtag
  
      elif evidence_paths is not None and len(evidence_paths) > 0:
          pi = PackageInfo()
          pi.package = name
          pi.version = version
  
          ctx['package_info'] = pi
  
          software_identity = create_software_identity_element(ctx, from_folder=True)
  
          if pkcs12_file is not None:
              ET.register_namespace('dsig', "http://www.w3.org/2000/09/xmldsig#")
              signature_template_tree = ET.fromstring(SIGNATURE)
              software_identity.append(signature_template_tree)
  
          swidtag = ET.tostring(software_identity, encoding='utf-8').replace(b'\n', b'')
          yield XML_DECLARATION.encode('utf-8') + swidtag
  
      elif name is not None and version is not None:
          pi = PackageInfo()
          pi.package = name
          pi.version = version
  
          ctx['package_info'] = pi
          ctx['full'] = False
  
          software_identity = create_software_identity_element(ctx)
  
          if pkcs12_file is not None:
              ET.register_namespace('dsig', "http://www.w3.org/2000/09/xmldsig#")
              signature_template_tree = ET.fromstring(SIGNATURE)
              software_identity.append(signature_template_tree)
  
          swidtag = ET.tostring(software_identity, encoding='utf-8').replace(b'\n', b'')
          yield XML_DECLARATION.encode('utf-8') + swidtag
  
      else:
          pkg_info = environment.get_package_list(ctx)
  
          for pi in pkg_info:
  
              ctx['package_info'] = pi
  
              # Check if the software-id of the current package matches the targeted request
              if not matcher(ctx):
                  continue
              software_identity = create_software_identity_element(ctx)
  
              if pkcs12_file is not None:
                  ET.register_namespace('dsig', "http://www.w3.org/2000/09/xmldsig#")
                  signature_template_tree = ET.fromstring(SIGNATURE)
                  software_identity.append(signature_template_tree)
  
              swidtag = ET.tostring(software_identity, encoding='utf-8').replace(b'\n', b'')
              yield XML_DECLARATION.encode('utf-8') + swidtag
code_tokens: def create_swid_tags ( environment , entity_name , regid , os_string = None , architecture = None , hash_algorithms = 'sha256' , full = False , matcher = all_matcher , hierarchic = False , file_path = None , evidence_paths = None , name = None , version = None , new_root_path = None , pkcs12_file = None , xml_lang = None , schema_location = False , meta_for = 'os' , id_prefix = None , dpkg_include_package_arch = False ) : ctx = { 'regid' : regid , 'environment' : environment , 'entity_name' : entity_name , 'os_string' : os_string , 'architecture' : architecture , 'meta_for' : meta_for , 'full' : full , 'hash_algorithms' : hash_algorithms , 'hierarchic' : hierarchic , 'file_path' : file_path , 'evidence_paths' : evidence_paths , 'new_root_path' : new_root_path , 'xml_lang' : xml_lang , 'schema_location' : schema_location , 'id_prefix' : id_prefix , 'dpkg_include_package_arch' : dpkg_include_package_arch , } if os_string is None : ctx [ 'os_string' ] = ctx [ 'environment' ] . get_os_string ( ) if architecture is None : ctx [ 'architecture' ] = ctx [ 'environment' ] . get_architecture ( ) if file_path is not None : pi = environment . get_packageinfo_from_packagefile ( file_path , ctx ) ctx [ 'package_info' ] = pi software_identity = create_software_identity_element ( ctx , from_package_file = True ) if pkcs12_file is not None : ET . register_namespace ( 'dsig' , "http://www.w3.org/2000/09/xmldsig#" ) signature_template_tree = ET . fromstring ( SIGNATURE ) software_identity . append ( signature_template_tree ) swidtag = ET . tostring ( software_identity , encoding = 'utf-8' ) . replace ( b'\n' , b'' ) yield XML_DECLARATION . encode ( 'utf-8' ) + swidtag elif evidence_paths is not None and len ( evidence_paths ) > 0 : pi = PackageInfo ( ) pi . package = name pi . version = version ctx [ 'package_info' ] = pi software_identity = create_software_identity_element ( ctx , from_folder = True ) if pkcs12_file is not None : ET . register_namespace ( 'dsig' , "http://www.w3.org/2000/09/xmldsig#" ) signature_template_tree = ET . fromstring ( SIGNATURE ) software_identity . append ( signature_template_tree ) swidtag = ET . tostring ( software_identity , encoding = 'utf-8' ) . replace ( b'\n' , b'' ) yield XML_DECLARATION . encode ( 'utf-8' ) + swidtag elif name is not None and version is not None : pi = PackageInfo ( ) pi . package = name pi . version = version ctx [ 'package_info' ] = pi ctx [ 'full' ] = False software_identity = create_software_identity_element ( ctx ) if pkcs12_file is not None : ET . register_namespace ( 'dsig' , "http://www.w3.org/2000/09/xmldsig#" ) signature_template_tree = ET . fromstring ( SIGNATURE ) software_identity . append ( signature_template_tree ) swidtag = ET . tostring ( software_identity , encoding = 'utf-8' ) . replace ( b'\n' , b'' ) yield XML_DECLARATION . encode ( 'utf-8' ) + swidtag else : pkg_info = environment . get_package_list ( ctx ) for pi in pkg_info : ctx [ 'package_info' ] = pi if not matcher ( ctx ) : continue software_identity = create_software_identity_element ( ctx ) if pkcs12_file is not None : ET . register_namespace ( 'dsig' , "http://www.w3.org/2000/09/xmldsig#" ) signature_template_tree = ET . fromstring ( SIGNATURE ) software_identity . append ( signature_template_tree ) swidtag = ET . tostring ( software_identity , encoding = 'utf-8' ) . replace ( b'\n' , b'' ) yield XML_DECLARATION . encode ( 'utf-8' ) + swidtag
short_docstring: Return SWID tags as utf8-encoded xml bytestrings for all available
  packages.
short_docstring_tokens: Return SWID tags as utf8 - encoded xml bytestrings for all available packages .
comment: """
      Return SWID tags as utf8-encoded xml bytestrings for all available
      packages.
  
      :param pkcs12_file: Path to the pkcs12 file.
      :param new_root_path: Evidence SWID tag Root path.
      :param version: Evidence SWID tag version.
      :param name: Evidence SWID tag name.
      :param meta_for: Whether the Meta element should hold information about the distribution or about the package.
      :param evidence_paths: List of folders from which the evidence method starts to create SWID tag.
      :param file_path: File-Path to the Package-File.
      :param hierarchic: Optional parameter for the creation of a hierarchical SWID tag.
      :param environment: The package management environment.
      :param entity_name: The SWID tag entity name.
      :param id_prefix: Custom prefix for unique IDs.
      :param regid: The SWID tag regid.
      :param hash_algorithms: Comma separated list of the hash algorithms to include in the SWID tag,
      :param full: Whether to include file payload. Default is False.
      :param matcher: A function that defines whether to return a tag or not. Default is a function that returns ``True`` for all tags.
      :param xml_lang: xml:lang attribute value. Default en-US.
      :param dpkg_include_package_arch: Whether to include architecture in tagId and version.
  
      Returns:
          A generator object for all available SWID XML strings. The XML strings
          are all bytestrings, using UTF-8 encoding.
  
      """$SEP$# Check if the software-id of the current package matches the targeted request