parameters: (target_name: str,
                                     bazel_rules: BuildDict)
return_statement: return result
docstring: Create build.yaml-like target definition from bazel metadata
docstring_summary: Create build.yaml-like target definition from bazel metadata
docstring_tokens: Create build . yaml - like target definition from bazel metadata
function: def _create_target_from_bazel_rule(target_name: str,
                                     bazel_rules: BuildDict) -> BuildMetadata:
      """Create build.yaml-like target definition from bazel metadata"""
      bazel_rule = bazel_rules[_get_bazel_label(target_name)]
  
      # Create a template for our target from the bazel rule. Initially we only
      # populate some "private" fields with the original info we got from bazel
      # and only later we will populate the public fields (once we do some extra
      # postprocessing).
      result = {
          'name': target_name,
          '_PUBLIC_HEADERS_BAZEL': _extract_public_headers(bazel_rule),
          '_HEADERS_BAZEL': _extract_nonpublic_headers(bazel_rule),
          '_SRC_BAZEL': _extract_sources(bazel_rule),
          '_DEPS_BAZEL': _extract_deps(bazel_rule, bazel_rules),
          'public_headers': bazel_rule['_COLLAPSED_PUBLIC_HEADERS'],
          'headers': bazel_rule['_COLLAPSED_HEADERS'],
          'src': bazel_rule['_COLLAPSED_SRCS'],
          'deps': bazel_rule['_COLLAPSED_DEPS'],
      }
      return result
function_tokens: def _create_target_from_bazel_rule ( target_name : str , bazel_rules : BuildDict ) -> BuildMetadata : bazel_rule = bazel_rules [ _get_bazel_label ( target_name ) ] # Create a template for our target from the bazel rule. Initially we only # populate some "private" fields with the original info we got from bazel # and only later we will populate the public fields (once we do some extra # postprocessing). result = { 'name' : target_name , '_PUBLIC_HEADERS_BAZEL' : _extract_public_headers ( bazel_rule ) , '_HEADERS_BAZEL' : _extract_nonpublic_headers ( bazel_rule ) , '_SRC_BAZEL' : _extract_sources ( bazel_rule ) , '_DEPS_BAZEL' : _extract_deps ( bazel_rule , bazel_rules ) , 'public_headers' : bazel_rule [ '_COLLAPSED_PUBLIC_HEADERS' ] , 'headers' : bazel_rule [ '_COLLAPSED_HEADERS' ] , 'src' : bazel_rule [ '_COLLAPSED_SRCS' ] , 'deps' : bazel_rule [ '_COLLAPSED_DEPS' ] , } return result