diff --git a/lib/utilities.py b/lib/utilities.py
index 96421e8..1599ffb 100755
--- a/lib/utilities.py
+++ b/lib/utilities.py
@@ -4,10 +4,9 @@
 Generic utility functions.
 """
 import imp
-import random
 import string
+import random
 import subprocess
-
 from robot.libraries.BuiltIn import BuiltIn
 from robot.utils import DotDict
 
@@ -17,12 +16,8 @@
     Return random mac address in the following format.
     Example: 00:01:6C:80:02:78
     """
-    return ":".join(
-        map(
-            lambda x: "%02x" % x,
-            (random.randint(0x00, 0xFF) for _ in range(6)),
-        )
-    )
+    return ":".join(map(lambda x: "%02x" % x, (random.randint(0x00, 0xff)
+                                               for _ in range(6))))
 
 
 def random_ip():
@@ -30,17 +25,19 @@
     Return random ip address in the following format.
     Example: 9.3.128.100
     """
-    return ".".join(map(str, (random.randint(0, 255) for _ in range(4))))
+    return ".".join(map(str, (random.randint(0, 255)
+                              for _ in range(4))))
 
 
 def get_sensor(module_name, value):
     r"""
     Return sensor matched ID name.
     """
-    m = imp.load_source("module.name", module_name)
+    m = imp.load_source('module.name', module_name)
 
-    for i in m.ID_LOOKUP["SENSOR"]:
-        if m.ID_LOOKUP["SENSOR"][i] == value:
+    for i in m.ID_LOOKUP['SENSOR']:
+
+        if m.ID_LOOKUP['SENSOR'][i] == value:
             return i
 
     return 0xFF
@@ -50,12 +47,13 @@
     r"""
     Return sensor matched ID name from inventory.
     """
-    m = imp.load_source("module.name", module_name)
+    m = imp.load_source('module.name', module_name)
 
-    value = string.replace(value, m.INVENTORY_ROOT, "<inventory_root>")
+    value = string.replace(value, m.INVENTORY_ROOT, '<inventory_root>')
 
-    for i in m.ID_LOOKUP["SENSOR"]:
-        if m.ID_LOOKUP["SENSOR"][i] == value:
+    for i in m.ID_LOOKUP['SENSOR']:
+
+        if m.ID_LOOKUP['SENSOR'][i] == value:
             return i
 
     return 0xFF
@@ -75,11 +73,11 @@
     """
 
     inventory_list = []
-    m = imp.load_source("module.name", module_name)
+    m = imp.load_source('module.name', module_name)
 
-    for i in m.ID_LOOKUP["FRU"]:
-        s = m.ID_LOOKUP["FRU"][i]
-        s = s.replace("<inventory_root>", m.INVENTORY_ROOT)
+    for i in m.ID_LOOKUP['FRU']:
+        s = m.ID_LOOKUP['FRU'][i]
+        s = s.replace('<inventory_root>', m.INVENTORY_ROOT)
         inventory_list.append(s)
 
     return inventory_list
@@ -98,11 +96,11 @@
     Return FRU URI(s) list of a given type from inventory.
     """
     inventory_list = []
-    m = imp.load_source("module.name", module_name)
+    m = imp.load_source('module.name', module_name)
 
     for i in m.FRU_INSTANCES.keys():
-        if m.FRU_INSTANCES[i]["fru_type"] == fru:
-            s = i.replace("<inventory_root>", m.INVENTORY_ROOT)
+        if m.FRU_INSTANCES[i]['fru_type'] == fru:
+            s = i.replace('<inventory_root>', m.INVENTORY_ROOT)
             inventory_list.append(s)
 
     return inventory_list
@@ -121,13 +119,13 @@
     Return VPD URI(s) list of a FRU type from inventory.
     """
     inventory_list = []
-    m = imp.load_source("module.name", module_name)
+    m = imp.load_source('module.name', module_name)
 
-    for i in m.ID_LOOKUP["FRU_STR"]:
-        x = m.ID_LOOKUP["FRU_STR"][i]
+    for i in m.ID_LOOKUP['FRU_STR']:
+        x = m.ID_LOOKUP['FRU_STR'][i]
 
-        if m.FRU_INSTANCES[x]["fru_type"] == fru:
-            s = x.replace("<inventory_root>", m.INVENTORY_ROOT)
+        if m.FRU_INSTANCES[x]['fru_type'] == fru:
+            s = x.replace('<inventory_root>', m.INVENTORY_ROOT)
             inventory_list.append(s)
 
     return inventory_list
@@ -144,7 +142,7 @@
     r"""
     Python main func call.
     """
-    print(get_vpd_inventory_list("../data/Palmetto.py", "DIMM"))
+    print(get_vpd_inventory_list('../data/Palmetto.py', 'DIMM'))
 
 
 if __name__ == "__main__":
@@ -189,19 +187,15 @@
 
     # Run the mtr command.  Exclude the header line.  Trim leading space from
     # each line.  Change all multiple spaces delims to single space delims.
-    cmd_buf = (
-        "mtr --report "
-        + host
-        + " | tail -n +2 | sed -r -e 's/^[ ]+//g' -e 's/[ ]+/ /g'"
-    )
-    sub_proc = subprocess.Popen(
-        cmd_buf, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
-    )
+    cmd_buf = "mtr --report " + host +\
+        " | tail -n +2 | sed -r -e 's/^[ ]+//g' -e 's/[ ]+/ /g'"
+    sub_proc = subprocess.Popen(cmd_buf, shell=True, stdout=subprocess.PIPE,
+                                stderr=subprocess.STDOUT)
     out_buf, err_buf = sub_proc.communicate()
     shell_rc = sub_proc.returncode
 
     # Split the output by line.
-    rows = out_buf.rstrip("\n").split("\n")
+    rows = out_buf.rstrip('\n').split("\n")
 
     # Initialize report dictionary.
     report = DotDict()
@@ -211,16 +205,16 @@
         row_list = row.split(" ")
         # Create dictionary for the row.
         row = DotDict()
-        row["row_num"] = row_list[0].rstrip(".")
-        row["host"] = row_list[1]
-        row["loss"] = row_list[2].rstrip("%")
-        row["snt"] = row_list[3]
-        row["last"] = row_list[4]
-        row["avg"] = row_list[5]
-        row["best"] = row_list[6]
-        row["wrst"] = row_list[7]
-        row["stdev"] = row_list[8]
-        report[row["host"]] = row
+        row['row_num'] = row_list[0].rstrip('.')
+        row['host'] = row_list[1]
+        row['loss'] = row_list[2].rstrip('%')
+        row['snt'] = row_list[3]
+        row['last'] = row_list[4]
+        row['avg'] = row_list[5]
+        row['best'] = row_list[6]
+        row['wrst'] = row_list[7]
+        row['stdev'] = row_list[8]
+        report[row['host']] = row
 
     # Return the full report as dictionary of dictionaries.
     return report
@@ -302,8 +296,8 @@
     Input string      0a 01
     Return string     0x0a 0x01
     """
-    prefix_string = ""
+    prefix_string = ''
     data_list = string.strip().split(" ")
     for item in data_list:
-        prefix_string += prefix + item + " "
+        prefix_string += prefix + item + ' '
     return prefix_string.strip()
