code: def get_reference_points(spatial_shapes, valid_ratios):
      reference_points_list = []
      for lvl, (H_, W_) in enumerate(spatial_shapes):
          ref_y, ref_x = paddle.meshgrid(
              paddle.linspace(
                  0.5, H_ - 0.5, H_.astype("int32"), "float32"
              ),
              paddle.linspace(
                  0.5, W_ - 0.5, W_.astype("int32"), "float32"
              ),
          )
          ref_y = ref_y.flatten()[None] / (
              valid_ratios[:, None, lvl, 1] * H_
          )
          ref_x = ref_x.flatten()[None] / (
              valid_ratios[:, None, lvl, 0] * W_
          )
          ref = paddle.stack((ref_x, ref_y), -1)
          reference_points_list.append(ref)
      reference_points = paddle.concat(reference_points_list, 1)
      reference_points = (
          reference_points[:, :, None] * valid_ratios[:, None]
      )
      return reference_points
  
imports: import copy
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import param_init
  from paddlepanseg.models.param_init import c2_xavier_fill, THLinearInitMixin
  from .common import Conv2D, PositionEmbeddingSine
  from ._ms_deform_attn import MSDeformAttn
label_desc: Use image node_id 2 for calling the MSDeformAttnTransformerEncoder obj's underlying member method code with example usage: obj.get_reference_points(spatial_shapes, valid_ratios) and returns: reference_points