code: def findAll(self, pattern):
          
          find_time = time.time()
          r = self.clipRegionToScreen()
          if r is None:
              raise ValueError("Region outside all visible screens")
              return None
          seconds = self.autoWaitTimeout
          if not isinstance(pattern, Pattern):
              if not isinstance(pattern, basestring):
                  raise TypeError("find expected a string [image path] or Pattern object")
              pattern = Pattern(pattern)
          needle = cv2.imread(pattern.path)
          if needle is None:
              raise ValueError("Unable to load image '{}'".format(pattern.path))
          needle_height, needle_width, needle_channels = needle.shape
          positions = []
          timeout = time.time() + seconds
  
          # Check TemplateMatcher for valid matches
          matches = []
          while time.time() < timeout and len(matches) == 0:
              matcher = TemplateMatcher(r.getBitmap())
              matches = matcher.findAllMatches(needle, pattern.similarity)
              time.sleep(1/self._defaultScanRate if self._defaultScanRate is not None else 1/Settings.WaitScanRate)
  
          if len(matches) == 0:
              Debug.info("Couldn't find '{}' with enough similarity.".format(pattern.path))
              return iter([])
  
          # Matches found! Turn them into Match objects
          lastMatches = []
          for match in matches:
              position, confidence = match
              x, y = position
              lastMatches.append(
                  Match(
                      confidence,
                      pattern.offset,
                      ((x+self.x, y+self.y), (needle_width, needle_height))))
          self._lastMatches = iter(lastMatches)
          Debug.info("Found match(es) for pattern '{}' at similarity ({})".format(pattern.path, pattern.similarity))
          self._lastMatchTime = (time.time() - find_time) * 1000 # Capture find time in milliseconds
          return self._lastMatches
docs: Searches for an image pattern in the given region
  
          Returns ``Match`` object if ``pattern`` exists, empty array otherwise (does not
          throw exception). Sikuli supports OCR search with a text parameter. This does not (yet).