code: def pick(channel: channel_types.BaseChannel, i: int, /):
      """Pick an i'th artifact from channel.
  
      Like in python, negative indexing is allowed.
  
      If the index is out of range, in synchronous pipeline it raises an error and
      the component would not get executed. In asynchronous pipeline, it will wait
      until the input length is sufficient to handle the index.
  
      Usage:
  
      ```python
      # In ASYNC pipeline:
      with ForEach(example_gen.outputs['examples']) as each_example:
        statistics_gen = StatisticsGen(examples=each_example)
  
      latest_statistics_pair = latest_created(
          statistics_gen.outputs['statistics'], n=2
      )
      validator = DistributionValidator(
          baseline_statistics=pick(latest_statistics_pair, 0),
          statistics=pick(latest_statistics_pair, 1),
          ...
      )
      ```
  
      Args:
        channel: A channel instance (e.g. `my_component.outputs['x']`).
        i: An index to pick. Can be negative.
  
      Returns:
        A channel that represents `inputs[i]`.
      """
      return _slice(channel, start=i, stop=(i + 1) or None, min_count=1)
  
imports: from typing import Optional, Sequence, Union
  from absl import logging
  from tfx.dsl.input_resolution import resolver_function
  from tfx.dsl.input_resolution.ops import ops
  from tfx.types import artifact
  from tfx.types import channel
label_desc: Use image node_id 15 for calling a global function with example usage: pick() and returns: _slice