parameters: (self)
return_statement: return queue_position
docstring: Search job_queues to calculate the queue position for this job -- how many pending jobs have to be processed
              before this one?
  
              Returns 0 if job is not pending.
docstring_summary: Search job_queues to calculate the queue position for this job -- how many pending jobs have to be processed
              before this one?
docstring_tokens: Search job_queues to calculate the queue position for this job -- how many pending jobs have to be processed before this one?
function: def queue_position(self):
          """
              Search job_queues to calculate the queue position for this job -- how many pending jobs have to be processed
              before this one?
  
              Returns 0 if job is not pending.
          """
          if self.status != 'pending':
              return 0
  
          queue_position = CaptureJob.objects.filter(status='pending', order__lte=self.order, human=self.human).count()
          if not self.human:
              queue_position += CaptureJob.objects.filter(status='pending', human=True).count()
  
          return queue_position
function_tokens: def queue_position ( self ) : if self . status != 'pending' : return 0 queue_position = CaptureJob . objects . filter ( status = 'pending' , order__lte = self . order , human = self . human ) . count ( ) if not self . human : queue_position += CaptureJob . objects . filter ( status = 'pending' , human = True ) . count ( ) return queue_position