diff --git a/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py b/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
index 290a26a..5dc0bcd 100644
--- a/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
+++ b/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
@@ -1,31 +1,31 @@
-def addBucket( main , egressPort = "" ):
-       """
-       Description:
-            Create a single bucket which can be added to a Group.
-       Optional:
-            * egressPort: port of egress device
-       Returns:
-            * Returns a Bucket
-            * Returns None in case of error
-       Note:
-            The ip and port option are for the requests input's ip and port
-            of the ONOS node.
-       """
-       try:
+def addBucket( main, egressPort="" ):
+    """
+    Description:
+         Create a single bucket which can be added to a Group.
+    Optional:
+         * egressPort: port of egress device
+    Returns:
+         * Returns a Bucket
+         * Returns None in case of error
+    Note:
+         The ip and port option are for the requests input's ip and port
+         of the ONOS node.
+    """
+    try:
 
-           bucket = {
-                        "treatment":{ "instructions":[] }
-                    }
-           if egressPort:
-               bucket[ 'treatment' ][ 'instructions' ].append( {
-                                                        "type":"OUTPUT",
-                                                        "port":egressPort } )
-           return bucket
+        bucket = {
+                     "treatment": { "instructions": [] }
+                 }
+        if egressPort:
+            bucket[ 'treatment' ][ 'instructions' ].append( {
+                                                     "type": "OUTPUT",
+                                                     "port": egressPort } )
+        return bucket
 
-       except ( AttributeError, TypeError ):
-           main.log.exception( self.name + ": Object not as expected" )
-           return None
-       except Exception:
-           main.log.exception( self.name + ": Uncaught exception!" )
-           main.cleanup()
-           main.exit()
+    except ( AttributeError, TypeError ):
+        main.log.exception( self.name + ": Object not as expected" )
+        return None
+    except Exception:
+        main.log.exception( self.name + ": Uncaught exception!" )
+        main.cleanup()
+        main.exit()
diff --git a/TestON/tests/FUNC/FUNCgroup/dependencies/startUp.py b/TestON/tests/FUNC/FUNCgroup/dependencies/startUp.py
index bf2a2b6..8122586 100644
--- a/TestON/tests/FUNC/FUNCgroup/dependencies/startUp.py
+++ b/TestON/tests/FUNC/FUNCgroup/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/FUNCgroup/dependencies/topo.py b/TestON/tests/FUNC/FUNCgroup/dependencies/topo.py
index b44e3fc..7217d4d 100644
--- a/TestON/tests/FUNC/FUNCgroup/dependencies/topo.py
+++ b/TestON/tests/FUNC/FUNCgroup/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
-
-
