code: def guard_reinstate(analysis_request):
      
      parent = analysis_request.getParentAnalysisRequest()
      if not parent:
          return True
      if api.get_workflow_status_of(parent) != "cancelled":
          return True
      return isTransitionAllowed(parent, "reinstate")
docs: Returns whether 'reinstate" transition can be performed or not. Returns
      True only if this is not a partition or the parent analysis request can be
      reinstated or is not in a cancelled state