

class Factory(object):

    def __init__(self, generator, roi):

        self.generator = generator
        self.roi = roi

    def iterator(self):

        for point in self.generator.iterator():
            if self.roi.contains_point(point):
                yield point



class MaskedGenerator(object):

    def __init__(self, generator, roi):

        self.generator = generator
        self.roi = roi

    def iterator(self):

        for point in self.generator.iterator():
            if self.roi.contains_point(point):
                yield point

Rename Factory class to MaskedGenerator
Rename Factory class to MaskedGenerator

  
  
- class Factory(object):
+ class MaskedGenerator(object):
  
      def __init__(self, generator, roi):
  
          self.generator = generator
          self.roi = roi
  
      def iterator(self):
  
          for point in self.generator.iterator():
              if self.roi.contains_point(point):
                  yield point
  
Rename Factory class to MaskedGenerator
## Code Before:


class Factory(object):

    def __init__(self, generator, roi):

        self.generator = generator
        self.roi = roi

    def iterator(self):

        for point in self.generator.iterator():
            if self.roi.contains_point(point):
                yield point

## Instruction:
Rename Factory class to MaskedGenerator
## Code After:


class MaskedGenerator(object):

    def __init__(self, generator, roi):

        self.generator = generator
        self.roi = roi

    def iterator(self):

        for point in self.generator.iterator():
            if self.roi.contains_point(point):
                yield point
