
from __future__ import (
    print_function, division, unicode_literals, absolute_import)


import subdir.profiling_test_script2 as script2


@profile
def fact(n):
    result = 1
    for i in xrange(2, n + 1):
        result *= i
    return result


@profile
def sum_(n):
    result = 0

    for i in xrange(1, n + 1):
        result += i
    return result

if __name__ == "__main__":
    print(fact(120))
    print(sum_(120))
    print(script2.fact2(120))
    print(script2.sum2(120))


from __future__ import (
    print_function, division, unicode_literals, absolute_import)


import subdir.profiling_test_script2 as script2


@profile
def fact(n):
    result = 1
    for i in xrange(2, n // 4):
        result *= i
    result = 1
    for i in xrange(2, n // 16):
        result *= i
    result = 1
    for i in xrange(2, n + 1):
        result *= i
    return result


@profile
def sum_(n):
    result = 0

    for i in xrange(1, n + 1):
        result += i
    return result

if __name__ == "__main__":
    print(fact(120))
    print(sum_(120))
    print(script2.fact2(120))
    print(script2.sum2(120))

Add diversity to test script
Add diversity to test script

  
  from __future__ import (
      print_function, division, unicode_literals, absolute_import)
  
  
  import subdir.profiling_test_script2 as script2
  
  
  @profile
  def fact(n):
+     result = 1
+     for i in xrange(2, n // 4):
+         result *= i
+     result = 1
+     for i in xrange(2, n // 16):
+         result *= i
      result = 1
      for i in xrange(2, n + 1):
          result *= i
      return result
  
  
  @profile
  def sum_(n):
      result = 0
  
      for i in xrange(1, n + 1):
          result += i
      return result
  
  if __name__ == "__main__":
      print(fact(120))
      print(sum_(120))
      print(script2.fact2(120))
      print(script2.sum2(120))
  
Add diversity to test script
## Code Before:

from __future__ import (
    print_function, division, unicode_literals, absolute_import)


import subdir.profiling_test_script2 as script2


@profile
def fact(n):
    result = 1
    for i in xrange(2, n + 1):
        result *= i
    return result


@profile
def sum_(n):
    result = 0

    for i in xrange(1, n + 1):
        result += i
    return result

if __name__ == "__main__":
    print(fact(120))
    print(sum_(120))
    print(script2.fact2(120))
    print(script2.sum2(120))

## Instruction:
Add diversity to test script
## Code After:

from __future__ import (
    print_function, division, unicode_literals, absolute_import)


import subdir.profiling_test_script2 as script2


@profile
def fact(n):
    result = 1
    for i in xrange(2, n // 4):
        result *= i
    result = 1
    for i in xrange(2, n // 16):
        result *= i
    result = 1
    for i in xrange(2, n + 1):
        result *= i
    return result


@profile
def sum_(n):
    result = 0

    for i in xrange(1, n + 1):
        result += i
    return result

if __name__ == "__main__":
    print(fact(120))
    print(sum_(120))
    print(script2.fact2(120))
    print(script2.sum2(120))
