code: def get_in_out_from_ray(points_from_ray, sample_factor=10, std=0.01):
      """Get sample points from points from ray.
  
      Args:
        points_from_ray: [npts, 6], where first 3 dims are xyz, last 3 are ray dir.
        sample_factor: int, number of samples to pick per surface point.
        std: float, std of samples to generate.
      Returns:
        near_surface_samples: [npts*sample_factor, 4], where last dimension is
        distance to surface point.
      """
      surface_point_samples = points_from_ray[:, :3]
      surface_point_normals = points_from_ray[:, 3:]
      # make sure normals are normalized to unit length
      n = surface_point_normals
      surface_point_normals = n / (
          np.linalg.norm(n, axis=1, keepdims=True) + 1e-8
      )
      npoints = points_from_ray.shape[0]
      offsets = np.random.randn(npoints, sample_factor, 1) * std
      near_surface_samples = (
          surface_point_samples[:, np.newaxis, :]
          + surface_point_normals[:, np.newaxis, :] * offsets
      )
      near_surface_samples = np.concatenate(
          [near_surface_samples, offsets], axis=-1
      )
      near_surface_samples = near_surface_samples.reshape([-1, 4])
      return near_surface_samples
  
imports: import os
  import numpy
  from skimage import measure
  import tensorflow.compat.v1
  from tensorflow_graphics.projects.local_implicit_grid.core import evaluator
  from tensorflow_graphics.projects.local_implicit_grid.core import local_implicit_grid_layer
  from tensorflow_graphics.projects.local_implicit_grid.core import point_utils
label_desc: Use image node_id 3 for calling a global function with example usage: get_in_out_from_ray(points_from_ray, sample_factor, std) and returns: near_surface_samples