code: def encode_pointwise_features(
      features,
      context_feature_columns,
      example_feature_columns,
      mode=tf_estimator.ModeKeys.PREDICT,
      scope=None,
  ):
      """Returns dense tensors from pointwise features using feature columns.
  
      Args:
        features: (dict) mapping feature names to 2-D tensors, possibly obtained
          from input_fn.
        context_feature_columns: (dict) context feature names to columns.
        example_feature_columns: (dict) example feature names to columns.
        mode: (`estimator.ModeKeys`) Specifies if this is training, evaluation or
          inference. See `ModeKeys`.
        scope: (str) variable scope for the per column input layers.
  
      Returns:
        context_features: (dict) A mapping from context feature names to dense
        2-D tensors of shape [batch_size, ...].
        example_features: (dict) A mapping from example feature names to dense
        3-D tensors of shape [batch_size, 1, ...].
      """
      context_features = {}
      if context_feature_columns:
          context_cols_to_tensors = encode_features(
              features,
              context_feature_columns.values(),
              mode=mode,
              scope=scope,
          )
          context_features = {
              name: context_cols_to_tensors[col]
              for name, col in six.iteritems(context_feature_columns)
          }
  
      example_features = {}
      if example_feature_columns:
          # Handles the case when tf.Example is used as input during serving.
          example_cols_to_tensors = encode_features(
              features,
              example_feature_columns.values(),
              mode=mode,
              scope=scope,
          )
          example_features = {
              name: tf.expand_dims(example_cols_to_tensors[col], 1)
              for name, col in six.iteritems(example_feature_columns)
          }
  
      return context_features, example_features
  
file_path: ranking/tensorflow_ranking/python/feature.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import six
  import tensorflow
  from tensorflow import estimator
  from tensorflow.python.feature_column import feature_column_lib
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 5 for calling a global function with example usage: encode_pointwise_features(features, context_feature_columns, example_feature_columns, mode, scope) and returns: context_features,  example_features