from manager import Manager

manager = Manager()


@manager.command
def build(threads=1):
    print("Starting a build with %d threads ..." % threads)

@manager.command
def clean():
    pass

if __name__ == '__main__':
    manager.main()

from manager import Manager
from multiprocessing import Pool

manager = Manager()


def func(period):
    from time import sleep
    sleep(period)


@manager.command
def build(threads=1):
    pool = Pool(threads)
    print("Starting a build with %d threads ..." % threads)
    pool.map(func, [1, 1, 1, 1, 1])


@manager.command
def clean():
    pass


if __name__ == '__main__':
    manager.main()

Add parallelizing code to build
Add parallelizing code to build

  from manager import Manager
+ from multiprocessing import Pool
  
  manager = Manager()
  
  
+ def func(period):
+     from time import sleep
+     sleep(period)
+ 
+ 
  @manager.command
  def build(threads=1):
+     pool = Pool(threads)
      print("Starting a build with %d threads ..." % threads)
+     pool.map(func, [1, 1, 1, 1, 1])
+ 
  
  @manager.command
  def clean():
      pass
  
+ 
  if __name__ == '__main__':
      manager.main()
  
Add parallelizing code to build
## Code Before:
from manager import Manager

manager = Manager()


@manager.command
def build(threads=1):
    print("Starting a build with %d threads ..." % threads)

@manager.command
def clean():
    pass

if __name__ == '__main__':
    manager.main()

## Instruction:
Add parallelizing code to build
## Code After:
from manager import Manager
from multiprocessing import Pool

manager = Manager()


def func(period):
    from time import sleep
    sleep(period)


@manager.command
def build(threads=1):
    pool = Pool(threads)
    print("Starting a build with %d threads ..." % threads)
    pool.map(func, [1, 1, 1, 1, 1])


@manager.command
def clean():
    pass


if __name__ == '__main__':
    manager.main()
