code: def run_step(context):
      
      logger.debug("started")
  
      assert context, f"context must have value for {__name__}"
  
      deprecated(context)
      found_at_least_one = False
  
      context.assert_key_has_value('tar', __name__)
  
      tar = context['tar']
      if 'extract' in tar:
          found_at_least_one = True
          tar_extract(context)
  
      if 'archive' in tar:
          found_at_least_one = True
          tar_archive(context)
  
      if not found_at_least_one:
          # This will raise exception on first item with a problem.
          raise KeyNotInContextError('pypyr.steps.tar must have either extract '
                                     'or archive specified under the tar key. '
                                     'Or both of these. It has neither.')
  
      logger.debug("done")
docs: Archive and/or extract tars with or without compression.
  
      Args:
          context: dictionary-like. Mandatory.
  
          Expects the following context:
          tar:
              extract:
                  - in: /path/my.tar
                    out: /out/path
              archive:
                  - in: /dir/to/archive
                    out: /out/destination.tar
              format: ''
  
          tar['format'] - if not specified, defaults to lzma/xz
                         Available options:
                          - '' - no compression
                          - gz (gzip)
                          - bz2 (bzip2)
                          - xz (lzma)
  
      This step will run whatever combination of Extract and Archive you specify.
      Regardless of combination, execution order is Extract, Archive.
  
      Source and destination paths support {key} string interpolation.
  
      Never extract archives from untrusted sources without prior inspection.
      It is possible that files are created outside of path, e.g. members that
      have absolute filenames starting with "/" or filenames with two dots "..".