from __future__ import absolute_import
from __future__ import division


from xmlrpc2 import client as xmlrpc2


class BaseProcessor(object):

    def __init__(self, index, *args, **kwargs):
        super(BaseProcessor, self).__init__(*args, **kwargs)

        self.index = index
        self.client = xmlrpc2.Client(self.index)

    def process(self):
        raise NotImplementedError


class BulkProcessor(BaseProcessor):

    def process(self):
        pass

from __future__ import absolute_import
from __future__ import division


from xmlrpc2 import client as xmlrpc2


class BaseProcessor(object):

    def __init__(self, index, *args, **kwargs):
        super(BaseProcessor, self).__init__(*args, **kwargs)

        self.index = index
        self.client = xmlrpc2.Client(self.index)

    def process(self):
        raise NotImplementedError

    def get_releases(self, name, version=None):
        if version is None:
            return set(self.client.package_releases(name, True))
        else:
            return set([version])


class BulkProcessor(BaseProcessor):

    def process(self):
        pass

Add a method for getting a list of releases to fetch
Add a method for getting a list of releases to fetch

  from __future__ import absolute_import
  from __future__ import division
  
  
  from xmlrpc2 import client as xmlrpc2
  
  
  class BaseProcessor(object):
  
      def __init__(self, index, *args, **kwargs):
          super(BaseProcessor, self).__init__(*args, **kwargs)
  
          self.index = index
          self.client = xmlrpc2.Client(self.index)
  
      def process(self):
          raise NotImplementedError
  
+     def get_releases(self, name, version=None):
+         if version is None:
+             return set(self.client.package_releases(name, True))
+         else:
+             return set([version])
+ 
  
  class BulkProcessor(BaseProcessor):
  
      def process(self):
          pass
  
Add a method for getting a list of releases to fetch
## Code Before:
from __future__ import absolute_import
from __future__ import division


from xmlrpc2 import client as xmlrpc2


class BaseProcessor(object):

    def __init__(self, index, *args, **kwargs):
        super(BaseProcessor, self).__init__(*args, **kwargs)

        self.index = index
        self.client = xmlrpc2.Client(self.index)

    def process(self):
        raise NotImplementedError


class BulkProcessor(BaseProcessor):

    def process(self):
        pass

## Instruction:
Add a method for getting a list of releases to fetch
## Code After:
from __future__ import absolute_import
from __future__ import division


from xmlrpc2 import client as xmlrpc2


class BaseProcessor(object):

    def __init__(self, index, *args, **kwargs):
        super(BaseProcessor, self).__init__(*args, **kwargs)

        self.index = index
        self.client = xmlrpc2.Client(self.index)

    def process(self):
        raise NotImplementedError

    def get_releases(self, name, version=None):
        if version is None:
            return set(self.client.package_releases(name, True))
        else:
            return set([version])


class BulkProcessor(BaseProcessor):

    def process(self):
        pass
