diff --git a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
index 8f8f677..7d220dc 100644
--- a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
+++ b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
@@ -9,6 +9,7 @@
 import time
 import json
 
+
 class FUNCintentRest:
 
     def __init__( self ):
@@ -28,7 +29,6 @@
             - Install ONOS package
             - Build ONOS package
         """
-
         main.case( "Constructing test variables and building ONOS package" )
         main.step( "Constructing test variables" )
         main.caseExplanation = "This test case is mainly for loading " +\
@@ -63,7 +63,7 @@
             gitPull = main.params[ 'GIT' ][ 'pull' ]
             main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
             main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
-            main.cellData = {} # for creating cell file
+            main.cellData = {}  # for creating cell file
             main.hostsData = {}
             main.RESTs = []
             main.CLIs = []
@@ -71,14 +71,14 @@
             main.scapyHostNames = main.params[ 'SCAPY' ][ 'HOSTNAMES' ].split( ',' )
             main.scapyHosts = []  # List of scapy hosts for iterating
             main.assertReturnString = ''  # Assembled assert return string
-            main.cycle = 0 # How many times FUNCintent has run through its tests
+            main.cycle = 0  # How many times FUNCintent has run through its tests
 
             main.ONOSip = main.ONOSbench.getOnosIps()
             print main.ONOSip
 
             # Assigning ONOS cli handles to a list
             try:
-                for i in range( 1,  main.maxNodes + 1 ):
+                for i in range( 1, main.maxNodes + 1 ):
                     main.RESTs.append( getattr( main, 'ONOSrest' + str( i ) ) )
                     main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
             except AttributeError:
@@ -96,9 +96,9 @@
                                             ".py" )
 
             main.intentFunction = imp.load_source( wrapperFile2,
-                                            main.dependencyPath +
-                                            wrapperFile2 +
-                                            ".py" )
+                                                   main.dependencyPath +
+                                                   wrapperFile2 +
+                                                   ".py" )
 
             main.topo = imp.load_source( wrapperFile3,
                                          main.dependencyPath +
@@ -153,7 +153,6 @@
         - Install ONOS cluster
         - Connect to cli
         """
-
         main.cycle += 1
 
         # main.scale[ 0 ] determines the current number of ONOS controller
@@ -166,8 +165,6 @@
         main.caseExplanation = "Set up ONOS with " + str( main.numCtrls ) +\
                                 " node(s) ONOS cluster"
 
-
-
         #kill off all onos processes
         main.log.info( "Safety check, killing all ONOS processes" +
                        " before initiating environment setup" )
@@ -194,7 +191,7 @@
 
         tempOnosIp = []
         for i in range( main.numCtrls ):
-            tempOnosIp.append( main.ONOSip[i] )
+            tempOnosIp.append( main.ONOSip[ i ] )
 
         main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
                                        "temp", main.Mininet1.ip_address,
@@ -206,7 +203,7 @@
         stepResult = cellResult and verifyResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Successfully applied cell to " + \
+                                 onpass="Successfully applied cell to " +
                                         "environment",
                                  onfail="Failed to apply cell to environment " )
 
@@ -233,7 +230,7 @@
         main.step( "Set up ONOS secure SSH" )
         secureSshResult = main.TRUE
         for i in range( int( main.numCtrls ) ):
-            secureSshResult = secureSshResult and main.ONOSbench.onosSecureSSH( node=main.ONOSip[i] )
+            secureSshResult = secureSshResult and main.ONOSbench.onosSecureSSH( node=main.ONOSip[ i ] )
         utilities.assert_equals( expect=main.TRUE, actual=secureSshResult,
                                  onpass="Test step PASS",
                                  onfail="Test step FAIL" )
@@ -385,7 +382,7 @@
         main.step( "Comparing Mininet topology to ONOS topology" )
 
         while ( attempts >= 0 ) and\
-            ( not devicesResults or not linksResults or not hostsResults ):
+                ( not devicesResults or not linksResults or not hostsResults ):
             time.sleep( 2 )
             if not devicesResults:
                 devices = main.topo.getAllDevices( main )
@@ -406,19 +403,19 @@
                 controllerStr = str( controller + 1 )  # ONOS node number
                 # Compare Devices
                 if devices[ controller ] and ports[ controller ] and\
-                    "Error" not in devices[ controller ] and\
-                    "Error" not in ports[ controller ]:
+                        "Error" not in devices[ controller ] and\
+                        "Error" not in ports[ controller ]:
 
                     try:
                         deviceData = json.loads( devices[ controller ] )
                         portData = json.loads( ports[ controller ] )
-                    except (TypeError,ValueError):
+                    except ( TypeError, ValueError ):
                         main.log.error( "Could not load json: {0} or {1}".format( str( devices[ controller ] ),
                                                                                   str( ports[ controller ] ) ) )
                         currentDevicesResult = main.FALSE
                     else:
                         currentDevicesResult = main.Mininet1.compareSwitches(
-                            mnSwitches,deviceData,portData )
+                            mnSwitches, deviceData, portData )
                 else:
                     currentDevicesResult = main.FALSE
                 if not currentDevicesResult:
@@ -428,12 +425,12 @@
                 if links[ controller ] and "Error" not in links[ controller ]:
                     try:
                         linkData = json.loads( links[ controller ] )
-                    except (TypeError,ValueError):
-                        main.log.error("Could not load json:" + str( links[ controller ] ) )
+                    except ( TypeError, ValueError ):
+                        main.log.error( "Could not load json:" + str( links[ controller ] ) )
                         currentLinksResult = main.FALSE
                     else:
                         currentLinksResult = main.Mininet1.compareLinks(
-                            mnSwitches, mnLinks,linkData )
+                            mnSwitches, mnLinks, linkData )
                 else:
                     currentLinksResult = main.FALSE
                 if not currentLinksResult:
@@ -443,12 +440,12 @@
                 if hosts[ controller ] and "Error" not in hosts[ controller ]:
                     try:
                         hostData = json.loads( hosts[ controller ] )
-                    except (TypeError,ValueError):
-                        main.log.error("Could not load json:" + str( hosts[ controller ] ) )
+                    except ( TypeError, ValueError ):
+                        main.log.error( "Could not load json:" + str( hosts[ controller ] ) )
                         currentHostsResult = main.FALSE
                     else:
                         currentHostsResult = main.Mininet1.compareHosts(
-                                mnHosts,hostData )
+                                mnHosts, hostData )
                 else:
                     currentHostsResult = main.FALSE
                 if not currentHostsResult:
@@ -457,7 +454,6 @@
             # Decrement Attempts Remaining
             attempts -= 1
 
-
         utilities.assert_equals( expect=[],
                                  actual=deviceFails,
                                  onpass="ONOS correctly discovered all devices",
@@ -480,14 +476,14 @@
                                  onfail="ONOS incorrectly discovered the topology" )
 
     def CASE9( self, main ):
-        '''
+        """
             Report errors/warnings/exceptions
-        '''
+        """
         main.log.info( "Error report: \n" )
         main.ONOSbench.logReport( globalONOSip[ 0 ],
-                [ "INFO", "FOLLOWER", "WARN", "flow", "ERROR" , "Except" ],
-                "s" )
-        #main.ONOSbench.logReport( globalONOSip[1], [ "INFO" ], "d" )
+                                  [ "INFO", "FOLLOWER", "WARN", "flow", "ERROR", "Except" ],
+                                  "s" )
+        #main.ONOSbench.logReport( globalONOSip[ 1 ], [ "INFO" ], "d" )
 
     def CASE10( self, main ):
         """
@@ -595,7 +591,7 @@
         if not stepResult:
             main.initialized = main.FALSE
 
-    def CASE13( self,main ):
+    def CASE13( self, main ):
         """
             Create Scapy components
         """
@@ -619,7 +615,6 @@
             main.log.debug( host.hostIp )
             main.log.debug( host.hostMac )
 
-
         utilities.assert_equals( expect=main.TRUE,
                                  actual=scapyResult,
                                  onpass="Successfully created Scapy Components",
@@ -738,7 +733,7 @@
                                             propName="useFlowObjectives", value="true" )
         stepResult &= main.CLIs[ 0 ].setCfg( component=cmd,
                                              propName="defaultFlowObjectiveCompiler",
-                                             value='org.onosproject.net.intent.impl.compiler.LinkCollectionIntentObjectiveCompiler')
+                                             value='org.onosproject.net.intent.impl.compiler.LinkCollectionIntentObjectiveCompiler' )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -775,14 +770,14 @@
                                  onfail="Failed to stop mininet and scapy" )
 
         main.step( "Stopping Mininet Topology" )
-        mininetResult = main.Mininet1.stopNet( )
+        mininetResult = main.Mininet1.stopNet()
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="Successfully stop mininet",
                                  onfail="Failed to stop mininet" )
         # Exit if topology did not load properly
-        if not (mininetResult and scapyResult ):
+        if not ( mininetResult and scapyResult ):
             main.cleanup()
             main.exit()
 
@@ -802,15 +797,15 @@
             main.node = main.CLIs[ i ]
             ip = main.ONOSip[ i ]
             main.node.ip_address = ip
-            scpResult = scpResult and main.ONOSbench.scp( main.node ,
-                                            "/opt/onos/log/karaf.log",
-                                            "/tmp/karaf.log",
-                                            direction="from" )
+            scpResult = scpResult and main.ONOSbench.scp( main.node,
+                                                          "/opt/onos/log/karaf.log",
+                                                          "/tmp/karaf.log",
+                                                          direction="from" )
             copyResult = copyResult and main.ONOSbench.cpLogsToDir( "/tmp/karaf.log", main.logdir,
                                                                     copyFileName=( "karaf.log.node{0}.cycle{1}".format(
                                                                         str( i + 1 ), str( main.cycle ) ) ) )
             if scpResult and copyResult:
-                stepResult =  main.TRUE and stepResult
+                stepResult = main.TRUE and stepResult
             else:
                 stepResult = main.FALSE and stepResult
         utilities.assert_equals( expect=main.TRUE,
@@ -861,7 +856,7 @@
         try:
             assert main.numSwitch
         except AssertionError:
-            main.log.error( "Place the total number of switch topology in "+\
+            main.log.error( "Place the total number of switch topology in " +
                              main.numSwitch )
             main.initialized = main.FALSE
             main.skipCase()
@@ -881,25 +876,25 @@
 
         main.step( "IPV4: Add and test host intents between h1 and h9" )
         main.assertReturnString = "Assertion result for IPV4 host intent with mac addresses\n"
-        host1 = { "name":"h1","id":"00:00:00:00:00:01/-1" }
-        host2 = { "name":"h9","id":"00:00:00:00:00:09/-1" }
+        host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" }
+        host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" }
         testResult = main.FALSE
         installResult = main.intentFunction.installHostIntent( main,
-                                              name='IPV4',
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2 )
+                                                               name='IPV4',
+                                                               onosNode='0',
+                                                               host1=host1,
+                                                               host2=host2 )
 
         if installResult:
             testResult = main.intentFunction.testHostIntent( main,
-                                              name='IPV4',
-                                              intentId = installResult,
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2,
-                                              sw1='s5',
-                                              sw2='s2',
-                                              expectedLink=18 )
+                                                             name='IPV4',
+                                                             intentId=installResult,
+                                                             onosNode='0',
+                                                             host1=host1,
+                                                             host2=host2,
+                                                             sw1='s5',
+                                                             sw2='s2',
+                                                             expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=testResult,
@@ -908,25 +903,25 @@
 
         main.step( "DUALSTACK1: Add host intents between h3 and h11" )
         main.assertReturnString = "Assertion Result for dualstack IPV4 with MAC addresses\n"
-        host1 = { "name":"h3", "id":"00:00:00:00:00:03/-1" }
-        host2 = { "name":"h11","id":"00:00:00:00:00:0B/-1" }
+        host1 = { "name": "h3", "id": "00:00:00:00:00:03/-1" }
+        host2 = { "name": "h11", "id": "00:00:00:00:00:0B/-1" }
         testResult = main.FALSE
         installResult = main.intentFunction.installHostIntent( main,
-                                              name='DUALSTACK1',
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2 )
+                                                               name='DUALSTACK1',
+                                                               onosNode='0',
+                                                               host1=host1,
+                                                               host2=host2 )
 
         if installResult:
             testResult = main.intentFunction.testHostIntent( main,
-                                              name='DUALSTACK1',
-                                              intentId = installResult,
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2,
-                                              sw1='s5',
-                                              sw2='s2',
-                                              expectedLink=18 )
+                                                             name='DUALSTACK1',
+                                                             intentId=installResult,
+                                                             onosNode='0',
+                                                             host1=host1,
+                                                             host2=host2,
+                                                             sw1='s5',
+                                                             sw2='s2',
+                                                             expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=testResult,
@@ -935,25 +930,25 @@
 
         main.step( "DUALSTACK2: Add host intents between h1 and h11" )
         main.assertReturnString = "Assertion Result for dualstack2 host intent\n"
-        host1 = { "name":"h1" }
-        host2 = { "name":"h11" }
+        host1 = { "name": "h1" }
+        host2 = { "name": "h11" }
         testResult = main.FALSE
         installResult = main.intentFunction.installHostIntent( main,
-                                              name='DUALSTACK2',
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2 )
+                                                               name='DUALSTACK2',
+                                                               onosNode='0',
+                                                               host1=host1,
+                                                               host2=host2 )
 
         if installResult:
             testResult = main.intentFunction.testHostIntent( main,
-                                              name='DUALSTACK2',
-                                              intentId = installResult,
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2,
-                                              sw1='s5',
-                                              sw2='s2',
-                                              expectedLink=18 )
+                                                             name='DUALSTACK2',
+                                                             intentId=installResult,
+                                                             onosNode='0',
+                                                             host1=host1,
+                                                             host2=host2,
+                                                             sw1='s5',
+                                                             sw2='s2',
+                                                             expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=testResult,
@@ -962,25 +957,25 @@
 
         main.step( "1HOP: Add host intents between h1 and h3" )
         main.assertReturnString = "Assertion Result for 1HOP for IPV4 same switch\n"
-        host1 = { "name":"h1" }
-        host2 = { "name":"h3" }
+        host1 = { "name": "h1" }
+        host2 = { "name": "h3" }
         testResult = main.FALSE
         installResult = main.intentFunction.installHostIntent( main,
-                                              name='1HOP',
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2 )
+                                                               name='1HOP',
+                                                               onosNode='0',
+                                                               host1=host1,
+                                                               host2=host2 )
 
         if installResult:
             testResult = main.intentFunction.testHostIntent( main,
-                                              name='1HOP',
-                                              intentId = installResult,
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2,
-                                              sw1='s5',
-                                              sw2='s2',
-                                              expectedLink=18 )
+                                                             name='1HOP',
+                                                             intentId=installResult,
+                                                             onosNode='0',
+                                                             host1=host1,
+                                                             host2=host2,
+                                                             sw1='s5',
+                                                             sw2='s2',
+                                                             expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=testResult,
@@ -989,25 +984,25 @@
 
         main.step( "VLAN1: Add vlan host intents between h4 and h12" )
         main.assertReturnString = "Assertion Result vlan IPV4\n"
-        host1 = { "name":"h4","id":"00:00:00:00:00:04/100", "vlanId":"100" }
-        host2 = { "name":"h12","id":"00:00:00:00:00:0C/100", "vlanId":"100" }
+        host1 = { "name": "h4", "id": "00:00:00:00:00:04/100", "vlanId": "100" }
+        host2 = { "name": "h12", "id": "00:00:00:00:00:0C/100", "vlanId": "100" }
         testResult = main.FALSE
         installResult = main.intentFunction.installHostIntent( main,
-                                              name='VLAN1',
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2 )
+                                                               name='VLAN1',
+                                                               onosNode='0',
+                                                               host1=host1,
+                                                               host2=host2 )
 
         if installResult:
             testResult = main.intentFunction.testHostIntent( main,
-                                              name='VLAN1',
-                                              intentId = installResult,
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2,
-                                              sw1='s5',
-                                              sw2='s2',
-                                              expectedLink=18 )
+                                                             name='VLAN1',
+                                                             intentId=installResult,
+                                                             onosNode='0',
+                                                             host1=host1,
+                                                             host2=host2,
+                                                             sw1='s5',
+                                                             sw2='s2',
+                                                             expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=testResult,
@@ -1029,7 +1024,7 @@
         # if installResult:
         #     testResult = main.intentFunction.testHostIntent( main,
         #                                       name='VLAN2',
-        #                                       intentId = installResult,
+        #                                       intentId=installResult,
         #                                       onosNode='0',
         #                                       host1=host1,
         #                                       host2=host2,
@@ -1053,7 +1048,7 @@
         utilities.assert_equals( expect=main.TRUE,
                                  actual=testResult,
                                  onpass="ONOS Leaders Unchanged",
-                                 onfail="ONOS Leader Mismatch")
+                                 onfail="ONOS Leader Mismatch" )
 
         main.intentFunction.report( main )
 
@@ -1097,13 +1092,13 @@
         try:
             assert main.numSwitch
         except AssertionError:
-            main.log.error( "Place the total number of switch topology in "+\
+            main.log.error( "Place the total number of switch topology in " +
                              main.numSwitch )
             main.initialized = main.FALSE
             main.skipCase()
 
         main.case( "Point Intents Test - " + str( main.numCtrls ) +
-                  " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test point to point" + \
                                " intents using " + str( main.numCtrls ) + \
                                " node(s) cluster;\n" + \
@@ -1191,7 +1186,7 @@
         #     senders=senders,
         #     recipients=recipients,
         #     protected=True )
-        # 
+        #
         # if installResult:
         #     testResult = main.intentFunction.testPointIntent(
         #         main,
@@ -1250,11 +1245,11 @@
             { "name": "h9", "device": "of:0000000000000006/1", "mac": "00:00:00:00:00:09",
               "ip": ( main.h9.hostIp + "/24" ) }
         ]
-        # ipProto = main.params['SDNIP']['icmpProto']
+        # ipProto = main.params[ 'SDNIP' ][ 'icmpProto' ]
         ipProto = main.params[ 'SDNIP' ][ 'ipPrototype' ]
         # Uneccessary, not including this in the selectors
-        tcpSrc = main.params['SDNIP']['srcPort']
-        tcpDst = main.params['SDNIP']['dstPort']
+        tcpSrc = main.params[ 'SDNIP' ][ 'srcPort' ]
+        tcpDst = main.params[ 'SDNIP' ][ 'dstPort' ]
 
         installResult = main.intentFunction.installPointIntent(
             main,
@@ -1285,13 +1280,13 @@
 
         main.step( "SDNIP-TCP: Add point intents between h1 and h9" )
         main.assertReturnString = "Assertion Result for SDNIP-TCP IPV4 using ICMP point intents\n"
-        mac1 = main.hostsData['h1']['mac']
-        mac2 = main.hostsData['h9']['mac']
-        ip1 = str(main.hostsData['h1']['ipAddresses'][0]) + "/32"
-        ip2 = str(main.hostsData['h9']['ipAddresses'][0]) + "/32"
-        ipProto = main.params['SDNIP']['tcpProto']
-        tcp1 = main.params['SDNIP']['srcPort']
-        tcp2 = main.params['SDNIP']['dstPort']
+        mac1 = main.hostsData[ 'h1' ][ 'mac' ]
+        mac2 = main.hostsData[ 'h9' ][ 'mac' ]
+        ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/32"
+        ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/32"
+        ipProto = main.params[ 'SDNIP' ][ 'tcpProto' ]
+        tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ]
+        tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ]
 
         stepResult = main.intentFunction.pointIntentTcp(
             main,
@@ -1410,7 +1405,6 @@
 
         main.intentFunction.report( main )
 
-
     def CASE3000( self, main ):
         """
             Add single point to multi point intents
@@ -1445,7 +1439,7 @@
 
         main.testName = "Single to Multi Point Intents"
         main.case( main.testName + " Test - " + str( main.numCtrls ) +
-                  " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test single point to" + \
                                " multi point intents using " + \
                                str( main.numCtrls ) + " node(s) cluster;\n" + \
@@ -1493,24 +1487,24 @@
                                  onpass=main.assertReturnString,
                                  onfail=main.assertReturnString )
 
-        main.step("IPV4: Install and test single point to multi point intents")
+        main.step( "IPV4: Install and test single point to multi point intents" )
         main.assertReturnString = "Assertion results for IPV4 single to multi point intent " \
                                   "with IPV4 type and MAC addresses\n"
         senders = [
-            {"name": "h8", "device": "of:0000000000000005/8", "mac": "00:00:00:00:00:08"}
+            { "name": "h8", "device": "of:0000000000000005/8", "mac": "00:00:00:00:00:08" }
         ]
         recipients = [
-            {"name": "h16", "device": "of:0000000000000006/8", "mac": "00:00:00:00:00:10"},
-            {"name": "h24", "device": "of:0000000000000007/8", "mac": "00:00:00:00:00:18"}
+            { "name": "h16", "device": "of:0000000000000006/8", "mac": "00:00:00:00:00:10" },
+            { "name": "h24", "device": "of:0000000000000007/8", "mac": "00:00:00:00:00:18" }
         ]
-        badSenders = [{"name": "h9"}]  # Senders that are not in the intent
-        badRecipients = [{"name": "h17"}]  # Recipients that are not in the intent
+        badSenders = [ { "name": "h9" } ]  # Senders that are not in the intent
+        badRecipients = [ { "name": "h17" } ]  # Recipients that are not in the intent
         installResult = main.intentFunction.installSingleToMultiIntent(
             main,
             name="IPV4",
             senders=senders,
             recipients=recipients,
-            ethType="IPV4")
+            ethType="IPV4" )
 
         if installResult:
             testResult = main.intentFunction.testPointIntent(
@@ -1630,7 +1624,7 @@
             recipients=recipients,
             sw1="s5",
             sw2="s2" )
-            #setVlan=100 )
+        #setVlan=100 )
 
         if installResult:
             testResult = main.intentFunction.testPointIntent(
@@ -1693,7 +1687,7 @@
         main.step( "NOOPTION: Add multi point to single point intents" )
         stepResult = main.TRUE
         hostNames = [ 'h8', 'h16', 'h24' ]
-        devices = [ 'of:0000000000000005/8', 'of:0000000000000006/8', \
+        devices = [ 'of:0000000000000005/8', 'of:0000000000000006/8',
                     'of:0000000000000007/8' ]
         macs = [ '00:00:00:00:00:08', '00:00:00:00:00:10', '00:00:00:00:00:18' ]
         stepResult = main.intentFunction.multiToSingleIntent(
@@ -1764,7 +1758,7 @@
         main.step( "VLAN: Add multi point to single point intents" )
         stepResult = main.TRUE
         hostNames = [ 'h5', 'h13', 'h21' ]
-        devices = [ 'of:0000000000000005/5', 'of:0000000000000006/5', \
+        devices = [ 'of:0000000000000005/5', 'of:0000000000000006/5',
                     'of:0000000000000007/5' ]
         macs = [ '00:00:00:00:00:05', '00:00:00:00:00:0D', '00:00:00:00:00:15' ]
         stepResult = main.intentFunction.multiToSingleIntent(
@@ -1819,7 +1813,7 @@
         try:
             assert main.numSwitch
         except AssertionError:
-            main.log.error( "Place the total number of switch topology in " +\
+            main.log.error( "Place the total number of switch topology in " +
                              main.numSwitch )
             main.initialized = main.FALSE
             main.skipCase()
@@ -1853,24 +1847,24 @@
 
         main.step( "IPV4: Add host intents between h1 and h9" )
         main.assertReturnString = "Assert result for IPV4 host intent between h1, moved, and h9\n"
-        host1 = { "name":"h1","id":"00:00:00:00:00:01/-1" }
-        host2 = { "name":"h9","id":"00:00:00:00:00:09/-1" }
+        host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" }
+        host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" }
 
         installResult = main.intentFunction.installHostIntent( main,
-                                              name='IPV4 Mobility IPV4',
-                                              onosNode='0',
-                                              host1=host1,
-                                              host2=host2 )
+                                                               name='IPV4 Mobility IPV4',
+                                                               onosNode='0',
+                                                               host1=host1,
+                                                               host2=host2 )
         if installResult:
             testResult = main.intentFunction.testHostIntent( main,
-                                                  name='Host Mobility IPV4',
-                                                  intentId = installResult,
-                                                  onosNode='0',
-                                                  host1=host1,
-                                                  host2=host2,
-                                                  sw1="s6",
-                                                  sw2="s2",
-                                                  expectedLink=18 )
+                                                             name='Host Mobility IPV4',
+                                                             intentId=installResult,
+                                                             onosNode='0',
+                                                             host1=host1,
+                                                             host2=host2,
+                                                             sw1="s6",
+                                                             sw2="s2",
+                                                             expectedLink=18 )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=testResult,
diff --git a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
old mode 100755
new mode 100644
index 8fa65f2..4bbbd9f
--- a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
@@ -8,9 +8,11 @@
 import json
 import types
 
+
 def __init__( self ):
     self.default = ''
 
+
 def installHostIntent( main,
                        name,
                        host1,
@@ -55,7 +57,6 @@
         ipProto - IP protocol
         tcp - TCP ports in the same order as the hosts in hostNames
     """
-
     assert main, "There is no main variable"
     assert host1, "You must specify host1"
     assert host2, "You must specify host2"
@@ -81,8 +82,8 @@
         main.log.info( itemName + ": Adding host intents" )
 
         intent1 = main.RESTs[ onosNode ].addHostIntent( hostIdOne=host1.get( "id" ),
-                                                       hostIdTwo=host2.get( "id" ),
-                                                       vlanId=vlanId )
+                                                        hostIdTwo=host2.get( "id" ),
+                                                        vlanId=vlanId )
 
         # Get all intents ID in the system, time delay right after intents are added
         time.sleep( main.addIntentSleep )
@@ -108,6 +109,7 @@
         main.assertReturnString += 'Install Intent State Failed\n'
         return main.FALSE
 
+
 def testHostIntent( main,
                     name,
                     intentId,
@@ -160,7 +162,6 @@
                        switches are down
 
     """
-
     # Parameter Validity Check
     assert main, "There is no main variable"
     assert host1, "You must specify host1"
@@ -297,6 +298,7 @@
 
     return testResult
 
+
 def installPointIntent( main,
                         name,
                         senders,
@@ -346,7 +348,6 @@
                        be two links lower than the links before the two
                        switches are down
     """
-
     assert main, "There is no main variable"
     assert senders, "You must specify a sender"
     assert recipients, "You must specify a recipient"
@@ -370,7 +371,6 @@
                 recipient[ "device" ] = main.hostsData.get( recipient.get( "name" ) ).get( "location" )
         vlanId = senders[ 0 ].get( "vlanId" )
 
-
         ingressDevice = senders[ 0 ].get( "device" )
         egressDevice = recipients[ 0 ].get( "device" )
 
@@ -427,6 +427,7 @@
         main.assertReturnString += 'Install Intent State Failed\n'
         return main.FALSE
 
+
 def testPointIntent( main,
                      name,
                      intentId,
@@ -494,7 +495,6 @@
                        switches are down
 
     """
-
     # Parameter Validity Check
     assert main, "There is no main variable"
     assert senders, "You must specify a sender"
@@ -523,7 +523,7 @@
             if not recipient.get( "device" ):
                 main.log.warn( "Device not given for recipient {0}. Loading from main.hostData".format( recipient.get( "name" ) ) )
                 recipient[ "device" ] = main.hostsData.get( recipient.get( "name" ) ).get( "location" )
-        vlanId=senders[ 0 ].get( "vlanId" )
+        vlanId = senders[ 0 ].get( "vlanId" )
     except( KeyError, TypeError ):
         main.log.error( "There was a problem loading the hosts data." )
         return main.FALSE
@@ -546,7 +546,7 @@
         testResult = main.FALSE
 
     # Check Connectivity
-    if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, senderNames, recipientNames,  vlanId, useTCP ) ):
+    if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, senderNames, recipientNames, vlanId, useTCP ) ):
         main.assertReturnString += 'Initial Ping Passed\n'
     else:
         main.assertReturnString += 'Initial Ping Failed\n'
@@ -555,7 +555,7 @@
     # Check connections that shouldn't work
     if badSenderNames:
         main.log.info( "Checking that packets from incorrect sender do not go through" )
-        if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, badSenderNames, recipientNames ), kwargs={ "expectFailure":True } ):
+        if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, badSenderNames, recipientNames ), kwargs={ "expectFailure": True } ):
             main.assertReturnString += 'Bad Sender Ping Passed\n'
         else:
             main.assertReturnString += 'Bad Sender Ping Failed\n'
@@ -563,7 +563,7 @@
 
     if badRecipientNames:
         main.log.info( "Checking that packets to incorrect recipients do not go through" )
-        if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, senderNames, badRecipientNames ), kwargs={ "expectFailure":True } ):
+        if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, senderNames, badRecipientNames ), kwargs={ "expectFailure": True } ):
             main.assertReturnString += 'Bad Recipient Ping Passed\n'
         else:
             main.assertReturnString += 'Bad Recipient Ping Failed\n'
@@ -580,14 +580,14 @@
 
         if protected:
             # Check Connection
-            if utilities.retry(f=scapyCheckConnection, retValue=main.FALSE,
-                               args=(main, senderNames, recipientNames, vlanId, useTCP)):
+            if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE,
+                                args=( main, senderNames, recipientNames, vlanId, useTCP ) ):
                 main.assertReturnString += 'Link down Scapy Packet Received Passed\n'
             else:
                 main.assertReturnString += 'Link down Scapy Packet Recieved Failed\n'
                 testResult = main.FALSE
 
-            if ProtectedIntentCheck(main):
+            if ProtectedIntentCheck( main ):
                 main.assertReturnString += 'Protected Intent Check Passed\n'
             else:
                 main.assertReturnString += 'Protected Intent Check Failed\n'
@@ -615,7 +615,7 @@
             testResult = main.FALSE
 
         # Check Connection
-        if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, senderNames, recipientNames, vlanId, useTCP  ) ):
+        if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, senderNames, recipientNames, vlanId, useTCP ) ):
             main.assertReturnString += 'Link Down Pingall Passed\n'
         else:
             main.assertReturnString += 'Link Down Pingall Failed\n'
@@ -653,7 +653,7 @@
             testResult = main.FALSE
 
         # Check Connection
-        if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, senderNames, recipientNames,  vlanId, useTCP  ) ):
+        if utilities.retry( f=scapyCheckConnection, retValue=main.FALSE, args=( main, senderNames, recipientNames, vlanId, useTCP ) ):
             main.assertReturnString += 'Link Up Scapy Packet Received Passed\n'
         else:
             main.assertReturnString += 'Link Up Scapy Packet Recieved Failed\n'
@@ -668,6 +668,7 @@
 
     return testResult
 
+
 def pointIntentTcp( main,
                     name,
                     host1,
@@ -690,7 +691,6 @@
                     sw1="",
                     sw2="",
                     expectedLink=0 ):
-
     """
     Description:
         Verify add-point-intent only for TCP
@@ -740,7 +740,6 @@
                        be two links lower than the links before the two
                        switches are down
     """
-
     assert main, "There is no main variable"
     assert name, "variable name is empty"
     assert host1 and host2, "You must specify hosts"
@@ -764,64 +763,64 @@
     # Adding bidirectional point  intents
     main.log.info( itemName + ": Adding point intents" )
     intent1 = main.RESTs[ onosNode ].addPointIntent( ingressDevice=deviceId1,
-                                                    egressDevice=deviceId2,
-                                                    ingressPort=port1,
-                                                    egressPort=port2,
-                                                    ethType=ethType,
-                                                    ethSrc=mac1,
-                                                    ethDst=mac2,
-                                                    bandwidth=bandwidth,
-                                                    lambdaAlloc=lambdaAlloc,
-                                                    ipProto=ipProto,
-                                                    ipSrc=ip1,
-                                                    ipDst=ip2,
-                                                    tcpSrc=tcp1,
-                                                    tcpDst="" )
+                                                     egressDevice=deviceId2,
+                                                     ingressPort=port1,
+                                                     egressPort=port2,
+                                                     ethType=ethType,
+                                                     ethSrc=mac1,
+                                                     ethDst=mac2,
+                                                     bandwidth=bandwidth,
+                                                     lambdaAlloc=lambdaAlloc,
+                                                     ipProto=ipProto,
+                                                     ipSrc=ip1,
+                                                     ipDst=ip2,
+                                                     tcpSrc=tcp1,
+                                                     tcpDst="" )
 
     intent2 = main.RESTs[ onosNode ].addPointIntent( ingressDevice=deviceId2,
-                                                    egressDevice=deviceId1,
-                                                    ingressPort=port2,
-                                                    egressPort=port1,
-                                                    ethType=ethType,
-                                                    ethSrc=mac2,
-                                                    ethDst=mac1,
-                                                    bandwidth=bandwidth,
-                                                    lambdaAlloc=lambdaAlloc,
-                                                    ipProto=ipProto,
-                                                    ipSrc=ip2,
-                                                    ipDst=ip1,
-                                                    tcpSrc=tcp2,
-                                                    tcpDst="" )
+                                                     egressDevice=deviceId1,
+                                                     ingressPort=port2,
+                                                     egressPort=port1,
+                                                     ethType=ethType,
+                                                     ethSrc=mac2,
+                                                     ethDst=mac1,
+                                                     bandwidth=bandwidth,
+                                                     lambdaAlloc=lambdaAlloc,
+                                                     ipProto=ipProto,
+                                                     ipSrc=ip2,
+                                                     ipDst=ip1,
+                                                     tcpSrc=tcp2,
+                                                     tcpDst="" )
 
     intent3 = main.RESTs[ onosNode ].addPointIntent( ingressDevice=deviceId1,
-                                                    egressDevice=deviceId2,
-                                                    ingressPort=port1,
-                                                    egressPort=port2,
-                                                    ethType=ethType,
-                                                    ethSrc=mac1,
-                                                    ethDst=mac2,
-                                                    bandwidth=bandwidth,
-                                                    lambdaAlloc=lambdaAlloc,
-                                                    ipProto=ipProto,
-                                                    ipSrc=ip1,
-                                                    ipDst=ip2,
-                                                    tcpSrc="",
-                                                    tcpDst=tcp2 )
+                                                     egressDevice=deviceId2,
+                                                     ingressPort=port1,
+                                                     egressPort=port2,
+                                                     ethType=ethType,
+                                                     ethSrc=mac1,
+                                                     ethDst=mac2,
+                                                     bandwidth=bandwidth,
+                                                     lambdaAlloc=lambdaAlloc,
+                                                     ipProto=ipProto,
+                                                     ipSrc=ip1,
+                                                     ipDst=ip2,
+                                                     tcpSrc="",
+                                                     tcpDst=tcp2 )
 
     intent4 = main.RESTs[ onosNode ].addPointIntent( ingressDevice=deviceId2,
-                                                    egressDevice=deviceId1,
-                                                    ingressPort=port2,
-                                                    egressPort=port1,
-                                                    ethType=ethType,
-                                                    ethSrc=mac2,
-                                                    ethDst=mac1,
-                                                    bandwidth=bandwidth,
-                                                    lambdaAlloc=lambdaAlloc,
-                                                    ipProto=ipProto,
-                                                    ipSrc=ip2,
-                                                    ipDst=ip1,
-                                                    tcpSrc="",
-                                                    tcpDst=tcp1 )
+                                                     egressDevice=deviceId1,
+                                                     ingressPort=port2,
+                                                     egressPort=port1,
+                                                     ethType=ethType,
+                                                     ethSrc=mac2,
+                                                     ethDst=mac1,
+                                                     bandwidth=bandwidth,
+                                                     lambdaAlloc=lambdaAlloc,
+                                                     ipProto=ipProto,
+                                                     ipSrc=ip2,
+                                                     ipDst=ip1,
+                                                     tcpSrc="",
+                                                     tcpDst=tcp1 )
 
     # Get all intents ID in the system, time delay right after intents are added
     time.sleep( main.addIntentSleep )
@@ -925,8 +924,8 @@
         in the same order index wise. All devices in the list should have the
         same format, either all the devices have its port or it doesn't.
         eg. hostName = [ 'h1', 'h2' ,..  ]
-            devices = [ 'of:0000000000000001', 'of:0000000000000002', ...]
-            ports = [ '1', '1', ..]
+            devices = [ 'of:0000000000000001', 'of:0000000000000002', ... ]
+            ports = [ '1', '1', .. ]
             ...
         Description:
             Verify add-single-to-multi-intent iterates through the list of given
@@ -973,7 +972,6 @@
                            be two links lower than the links before the two
                            switches are down
     """
-
     assert main, "There is no main variable"
     assert senders, "You must specify a sender"
     assert recipients, "You must specify a recipient"
@@ -1055,6 +1053,7 @@
         main.log.error( "Single to Multi Intent did not install correctly" )
         return main.FALSE
 
+
 def multiToSingleIntent( main,
                          name,
                          hostNames,
@@ -1077,8 +1076,8 @@
         same order index wise. All devices in the list should have the same
         format, either all the devices have its port or it doesn't.
         eg. hostName = [ 'h1', 'h2' ,..  ]
-            devices = [ 'of:0000000000000001', 'of:0000000000000002', ...]
-            ports = [ '1', '1', ..]
+            devices = [ 'of:0000000000000001', 'of:0000000000000002', ... ]
+            ports = [ '1', '1', .. ]
             ...
         Description:
             Verify add-multi-to-single-intent
@@ -1124,7 +1123,6 @@
                            be two links lower than the links before the two
                            switches are down
     """
-
     assert main, "There is no main variable"
     assert hostNames, "You must specify hosts"
     assert devices or main.hostsData, "You must specify devices"
@@ -1159,11 +1157,11 @@
         devices = []
         main.log.info( "multiToSingleIntent function is using main.hostsData" )
         for host in hostNames:
-               devices.append( main.hostsData.get( host ).get( 'location' ) )
-               macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
-                           main.hostsData.get( host ).get( 'mac' )
-               ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
-                           main.hostsData.get( host ).get( 'ipAddresses' )
+            devices.append( main.hostsData.get( host ).get( 'location' ) )
+            macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+                        main.hostsData.get( host ).get( 'mac' )
+            ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+                        main.hostsData.get( host ).get( 'ipAddresses' )
         #print main.hostsData
 
     #print 'host names = ', hostNames
@@ -1202,7 +1200,7 @@
             dstMac = ""
         else:
             dstMac = macsDict[ egressDevice ]
-            if dstMac == None:
+            if dstMac is None:
                 main.log.debug( "There is no MAC in device - " + egressDevice )
                 dstMac = ""
 
@@ -1298,6 +1296,7 @@
 
     return stepResult
 
+
 def pingallHosts( main, hostList ):
     # Ping all host in the hosts list variable
     print "Pinging : ", hostList
@@ -1305,11 +1304,11 @@
     pingResult = main.Mininet1.pingallHosts( hostList )
     return pingResult
 
+
 def getHostsData( main, hostList ):
     """
         Use fwd app and pingall to discover all the hosts
     """
-
     activateResult = main.TRUE
     appCheck = main.TRUE
     getDataResult = main.TRUE
@@ -1353,6 +1352,7 @@
 
     return getDataResult
 
+
 def checkTopology( main, expectedLink ):
     statusResult = main.TRUE
     # Check onos topology
@@ -1360,7 +1360,7 @@
 
     for i in range( main.numCtrls ):
         statusResult = main.RESTs[ i ].checkStatus( main.numSwitch,
-                                                   expectedLink )\
+                                                    expectedLink )\
                        and statusResult
     if not statusResult:
         main.log.error( itemName + ": Topology mismatch" )
@@ -1368,12 +1368,12 @@
         main.log.info( itemName + ": Topology match" )
     return statusResult
 
+
 def checkIntentState( main, intentsId ):
     """
         This function will check intent state to make sure all the intents
         are in INSTALLED state
     """
-
     intentResult = main.TRUE
     results = []
 
@@ -1406,13 +1406,15 @@
 
     return intentResult
 
+
 def checkFlowsState( main ):
 
     main.log.info( itemName + ": Check flows state" )
     checkFlowsResult = main.RESTs[ 0 ].checkFlowsState()
     return checkFlowsResult
 
-def link( main, sw1, sw2, option):
+
+def link( main, sw1, sw2, option ):
 
     # link down
     main.log.info( itemName + ": Bring link " + option + "between " +
@@ -1420,15 +1422,15 @@
     linkResult = main.Mininet1.link( end1=sw1, end2=sw2, option=option )
     return linkResult
 
+
 def removeAllIntents( main ):
     """
         Remove all intents in the intentsId
     """
-
     onosSummary = []
     removeIntentResult = main.TRUE
     # Remove intents
-    removeIntentResult = main.RESTs[ 0 ].removeAllIntents( )
+    removeIntentResult = main.RESTs[ 0 ].removeAllIntents()
 
     if removeIntentResult:
         main.log.info( itemName + ": There are no more intents remaining, " +
@@ -1436,18 +1438,18 @@
 
     return removeIntentResult
 
+
 def checkFlowsCount( main ):
     """
         Check flows count in each node
     """
-
     flowsCount = []
     main.log.info( itemName + ": Checking flows count in each ONOS node" )
     for i in range( main.numCtrls ):
         flowsCount.append( len( json.loads( main.RESTs[ i ].flows() ) ) )
 
     if flowsCount:
-        if all( flows==flowsCount[ 0 ] for flows in flowsCount ):
+        if all( flows == flowsCount[ 0 ] for flows in flowsCount ):
             main.log.info( itemName + ": There are " + str( flowsCount[ 0 ] ) +
                            " flows in all ONOS node" )
         else:
@@ -1460,6 +1462,7 @@
 
     return main.TRUE
 
+
 def sendDiscoveryArp( main, hosts=None ):
     """
         Sends Discovery ARP packets from each host provided
@@ -1469,7 +1472,7 @@
     if not hosts:
         hosts = main.scapyHosts
     for host in hosts:
-        pkt = 'Ether( src="{0}")/ARP( psrc="{1}")'.format( host.hostMac ,host.hostIp )
+        pkt = 'Ether( src="{0}")/ARP( psrc="{1}")'.format( host.hostMac, host.hostIp )
         # Send from the VLAN interface if there is one so ONOS discovers the VLAN correctly
         iface = None
         for interface in host.getIfList():
@@ -1480,6 +1483,7 @@
         host.sendPacket( packet=pkt, iface=iface )
         main.log.info( "Sending ARP packet from {0}".format( host.name ) )
 
+
 def confirmHostDiscovery( main ):
     """
         Confirms that all ONOS nodes have discovered all scapy hosts
@@ -1510,7 +1514,7 @@
                     onosHostIPs = [ x.get( "ipAddresses" )[ 0 ]
                                     for x in hostData
                                     if len( x.get( "ipAddresses" ) ) > 0 ]
-                    if not set( collections.Counter( scapyHostIPs ) ).issubset( set ( collections.Counter( onosHostIPs ) ) ):
+                    if not set( collections.Counter( scapyHostIPs ) ).issubset( set( collections.Counter( onosHostIPs ) ) ):
                         main.log.warn( "Controller {0} only sees nodes with {1} IPs. It should see all of the following: {2}".format( controllerStr, onosHostIPs, scapyHostIPs ) )
                         hostFails.append( controllerStr )
             else:
@@ -1526,6 +1530,7 @@
     else:
         return main.TRUE
 
+
 def populateHostData( main ):
     """
         Populates hostsData
@@ -1552,7 +1557,7 @@
         main.log.error( "ValueError while populating hostsData" )
         return main.FALSE
     except KeyError:
-        main.log.error( "KeyError while populating hostsData")
+        main.log.error( "KeyError while populating hostsData" )
         return main.FALSE
     except IndexError:
         main.log.error( "IndexError while populating hostsData" )
@@ -1561,6 +1566,7 @@
         main.log.error( "TypeError while populating hostsData" )
         return main.FALSE
 
+
 def scapyCheckConnection( main, senders, recipients, vlanId=None, useTCP=False, packet=None, packetFilter=None, expectFailure=False ):
     """
         Checks the connectivity between all given sender hosts and all given recipient hosts
@@ -1602,9 +1608,9 @@
                 continue
 
             if vlanId:
-                recipientComp.startFilter( pktFilter = ( "vlan {}".format( vlanId ) + " && " + packetFilter.format( senderComp.hostMac ) ) )
+                recipientComp.startFilter( pktFilter=( "vlan {}".format( vlanId ) + " && " + packetFilter.format( senderComp.hostMac ) ) )
             else:
-                recipientComp.startFilter( pktFilter = packetFilter.format( senderComp.hostMac ) )
+                recipientComp.startFilter( pktFilter=packetFilter.format( senderComp.hostMac ) )
 
             if not packet:
                 if vlanId:
@@ -1625,24 +1631,25 @@
             if vlanId:
                 senderComp.sendPacket( iface=( "{0}-eth0.{1}".format( sender, vlanId ) ), packet = pkt )
             else:
-                senderComp.sendPacket( packet = pkt )
+                senderComp.sendPacket( packet=pkt )
 
             if recipientComp.checkFilter( timeout ):
                 if expectFailure:
-                    main.log.error( "Packet from {0} successfully received by {1} when it should not have been".format( sender , recipient ) )
+                    main.log.error( "Packet from {0} successfully received by {1} when it should not have been".format( sender, recipient ) )
                     connectionsFunctional = main.FALSE
                 else:
-                    main.log.info( "Packet from {0} successfully received by {1}".format( sender , recipient ) )
+                    main.log.info( "Packet from {0} successfully received by {1}".format( sender, recipient ) )
             else:
                 recipientComp.killFilter()
                 if expectFailure:
-                    main.log.info( "As expected, packet from {0} was not received by {1}".format( sender , recipient ) )
+                    main.log.info( "As expected, packet from {0} was not received by {1}".format( sender, recipient ) )
                 else:
-                    main.log.error( "Packet from {0} was not received by {1}".format( sender , recipient ) )
+                    main.log.error( "Packet from {0} was not received by {1}".format( sender, recipient ) )
                     connectionsFunctional = main.FALSE
 
         return connectionsFunctional
 
+
 def checkLeaderChange( leaders1, leaders2 ):
     """
         Checks for a change in intent partition leadership.
@@ -1656,7 +1663,7 @@
     try:
         leaders1 = json.loads( leaders1 )
         leaders2 = json.loads( leaders2 )
-    except ( AttributeError, TypeError):
+    except ( AttributeError, TypeError ):
         main.log.exception( self.name + ": Object not as expected" )
         return main.FALSE
     except Exception:
@@ -1669,12 +1676,12 @@
         if "intent" in dict1.get( "topic", [] ):
             for dict2 in leaders2:
                 if dict1.get( "topic", 0 ) == dict2.get( "topic", 0 ) and \
-                    dict1.get( "leader", 0 ) != dict2.get( "leader", 0 ):
+                        dict1.get( "leader", 0 ) != dict2.get( "leader", 0 ):
                     mismatch = True
-                    main.log.error( "{0} changed leader from {1} to {2}".\
-                        format( dict1.get( "topic", "no-topic" ),\
-                            dict1.get( "leader", "no-leader" ),\
-                            dict2.get( "leader", "no-leader" ) ) )
+                    main.log.error( "{0} changed leader from {1} to {2}".
+                                    format( dict1.get( "topic", "no-topic" ),
+                                            dict1.get( "leader", "no-leader" ),
+                                            dict2.get( "leader", "no-leader" ) ) )
     if mismatch:
         return main.FALSE
     else:
@@ -1697,20 +1704,21 @@
     main.log.info( "ERROR report: \n" )
     for i in range( main.numCtrls ):
         main.ONOSbench.logReport( main.ONOSip[ i ],
-                [ "ERROR" ],
-                "d" )
+                                  [ "ERROR" ],
+                                  "d" )
 
     main.log.info( "EXCEPTIONS report: \n" )
     for i in range( main.numCtrls ):
         main.ONOSbench.logReport( main.ONOSip[ i ],
-                [ "Except" ],
-                "d" )
+                                  [ "Except" ],
+                                  "d" )
 
     main.log.info( "WARNING report: \n" )
     for i in range( main.numCtrls ):
         main.ONOSbench.logReport( main.ONOSip[ i ],
-                [ "WARN" ],
-                "d" )
+                                  [ "WARN" ],
+                                  "d" )
+
 
 def flowDuration( main ):
     """
@@ -1750,9 +1758,10 @@
         return main.FALSE
     return main.TRUE
 
+
 def ProtectedIntentCheck( main ):
     intent = main.RESTs[ 0 ].intents()
-    main.log.debug(intent)
+    main.log.debug( intent )
     main.stop()
     if "Protection" in intent:
         return main.TRUE
diff --git a/TestON/tests/FUNC/FUNCintentRest/dependencies/startUp.py b/TestON/tests/FUNC/FUNCintentRest/dependencies/startUp.py
index bf2a2b6..8122586 100644
--- a/TestON/tests/FUNC/FUNCintentRest/dependencies/startUp.py
+++ b/TestON/tests/FUNC/FUNCintentRest/dependencies/startUp.py
@@ -1,16 +1,15 @@
 """
     This wrapper function is use for starting up onos instance
 """
-
 import time
 import os
 import json
 
+
 def onosBuild( main, gitBranch ):
     """
         This includes pulling ONOS and building it using maven install
     """
-
     buildResult = main.FALSE
 
     # Git checkout a branch of ONOS
@@ -18,10 +17,10 @@
     # Does the git pull on the branch that was checked out
     if not checkOutResult:
         main.log.warn( "Failed to checked out " + gitBranch +
-                                           " branch")
+                                           " branch" )
     else:
         main.log.info( "Successfully checked out " + gitBranch +
-                                           " branch")
+                                           " branch" )
     gitPullResult = main.ONOSbench.gitPull()
     if gitPullResult == main.ERROR:
         main.log.error( "Error pulling git branch" )
@@ -32,7 +31,3 @@
     buildResult = main.ONOSbench.cleanInstall()
 
     return buildResult
-
-
-
-
diff --git a/TestON/tests/FUNC/FUNCintentRest/dependencies/topo.py b/TestON/tests/FUNC/FUNCintentRest/dependencies/topo.py
index b44e3fc..7217d4d 100644
--- a/TestON/tests/FUNC/FUNCintentRest/dependencies/topo.py
+++ b/TestON/tests/FUNC/FUNCintentRest/dependencies/topo.py
@@ -1,11 +1,11 @@
 """
     These functions can be used for topology comparisons
 """
-
 import time
 import os
 import json
 
+
 def getAllDevices( main ):
     """
         Return a list containing the devices output from each ONOS node
@@ -13,9 +13,9 @@
     devices = []
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].devices,
+        t = main.Thread( target=main.CLIs[ i ].devices,
                          name="devices-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
@@ -24,6 +24,7 @@
         devices.append( t.result )
     return devices
 
+
 def getAllHosts( main ):
     """
         Return a list containing the hosts output from each ONOS node
@@ -32,9 +33,9 @@
     ipResult = main.TRUE
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].hosts,
+        t = main.Thread( target=main.CLIs[ i ].hosts,
                          name="hosts-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
@@ -43,6 +44,7 @@
         hosts.append( t.result )
     return hosts
 
+
 def getAllPorts( main ):
     """
         Return a list containing the ports output from each ONOS node
@@ -50,9 +52,9 @@
     ports = []
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].ports,
+        t = main.Thread( target=main.CLIs[ i ].ports,
                          name="ports-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
@@ -61,6 +63,7 @@
         ports.append( t.result )
     return ports
 
+
 def getAllLinks( main ):
     """
         Return a list containing the links output from each ONOS node
@@ -68,9 +71,9 @@
     links = []
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].links,
+        t = main.Thread( target=main.CLIs[ i ].links,
                          name="links-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
@@ -79,6 +82,7 @@
         links.append( t.result )
     return links
 
+
 def getAllClusters( main ):
     """
         Return a list containing the clusters output from each ONOS node
@@ -86,9 +90,9 @@
     clusters = []
     threads = []
     for i in range( main.numCtrls ):
-        t = main.Thread( target=main.CLIs[i].clusters,
+        t = main.Thread( target=main.CLIs[ i ].clusters,
                          name="clusters-" + str( i ),
-                         args=[ ] )
+                         args=[] )
         threads.append( t )
         t.start()
 
@@ -96,5 +100,3 @@
         t.join()
         clusters.append( t.result )
     return clusters
-
-
