docstr: Returns a PullRequestState with the current PR state label
  based on label starting with LABEL_PREFIX.
  If more than one label is found raises EventError.
  If no label is found returns None.
docstr_tok: ["Returns","a","PullRequestState","with","the","current","PR","state","label","based","on","label","starting","with","LABEL_PREFIX",".","If","more","than","one","label","is","found","raises","EventError",".","If","no","label","is","found","returns","None","."]
code: def get_current_state(self):
      """
      Returns a PullRequestState with the current PR state label
      based on label starting with LABEL_PREFIX.
      If more than one label is found raises EventError.
      If no label is found returns None.
      """
      states = [
          label.name
          for label in self.pull.get_labels()
          if label.name.startswith(LABEL_PREFIX)
      ]
      if len(states) > 1:
          raise EventError(
              f"PR cannot be on more than one states - {states}"
          )
      elif states:
          return PullRequestState(states[0])
  
imports: import enum
  import os
  import shlex
  from pathlib import Path
  from functools import lru_cache, partial
  import tempfile
  import click
  import github
  from .utils.git import git
  from .utils.logger import logger
  from .crossbow import Repo, Queue, Config, Target, Job, CommentReport
label_desc: Use image node_id 6 for calling the PullRequestWorkflowBot obj's underlying member method code with example usage: obj.get_current_state() and returns: PullRequestState