code: def pipeline_counter(self):
          
          if 'pipeline_counter' in self.data and self.data.pipeline_counter:
              return self.data.get('pipeline_counter')
          elif self.stage.pipeline is not None:
              return self.stage.pipeline.data.counter
          else:
              return self.stage.data.pipeline_counter
docs: Get pipeline counter of current job instance.
  
          Because instantiating job instance could be performed in different ways and those return different results,
          we have to check where from to get counter of the pipeline.
  
          :return: pipeline counter.