diff --git a/contrib/fb303/py/fb303/FacebookBase.py b/contrib/fb303/py/fb303/FacebookBase.py
index 685ff20..07db10c 100644
--- a/contrib/fb303/py/fb303/FacebookBase.py
+++ b/contrib/fb303/py/fb303/FacebookBase.py
@@ -24,59 +24,60 @@
 import thrift.reflection.limited
 from ttypes import fb_status
 
+
 class FacebookBase(FacebookService.Iface):
 
-  def __init__(self, name):
-    self.name = name
-    self.alive = int(time.time())
-    self.counters = {}
+    def __init__(self, name):
+        self.name = name
+        self.alive = int(time.time())
+        self.counters = {}
 
-  def getName(self, ):
-    return self.name
+    def getName(self, ):
+        return self.name
 
-  def getVersion(self, ):
-    return ''
+    def getVersion(self, ):
+        return ''
 
-  def getStatus(self, ):
-    return fb_status.ALIVE
+    def getStatus(self, ):
+        return fb_status.ALIVE
 
-  def getCounters(self):
-    return self.counters
+    def getCounters(self):
+        return self.counters
 
-  def resetCounter(self, key):
-    self.counters[key] = 0
+    def resetCounter(self, key):
+        self.counters[key] = 0
 
-  def getCounter(self, key):
-    if self.counters.has_key(key):
-      return self.counters[key]
-    return 0
+    def getCounter(self, key):
+        if self.counters.has_key(key):
+            return self.counters[key]
+        return 0
 
-  def incrementCounter(self, key):
-    self.counters[key] = self.getCounter(key) + 1
+    def incrementCounter(self, key):
+        self.counters[key] = self.getCounter(key) + 1
 
-  def setOption(self, key, value):
-    pass
+    def setOption(self, key, value):
+        pass
 
-  def getOption(self, key):
-    return ""
+    def getOption(self, key):
+        return ""
 
-  def getOptions(self):
-    return {}
+    def getOptions(self):
+        return {}
 
-  def getOptions(self):
-    return {}
+    def getOptions(self):
+        return {}
 
-  def aliveSince(self):
-    return self.alive
+    def aliveSince(self):
+        return self.alive
 
-  def getCpuProfile(self, duration):
-    return ""
+    def getCpuProfile(self, duration):
+        return ""
 
-  def getLimitedReflection(self):
-    return thrift.reflection.limited.Service()
+    def getLimitedReflection(self):
+        return thrift.reflection.limited.Service()
 
-  def reinitialize(self):
-    pass
+    def reinitialize(self):
+        pass
 
-  def shutdown(self):
-    pass
+    def shutdown(self):
+        pass
diff --git a/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py b/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
index 4f8ce99..4b1c257 100644
--- a/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
+++ b/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
@@ -19,7 +19,8 @@
 # under the License.
 #
 
-import sys, os
+import sys
+import os
 from optparse import OptionParser
 
 from thrift.Thrift import *
@@ -31,11 +32,12 @@
 from fb303 import *
 from fb303.ttypes import *
 
+
 def service_ctrl(
-                 command,
-                 port,
-                 trans_factory = None,
-                 prot_factory = None):
+        command,
+        port,
+        trans_factory=None,
+        prot_factory=None):
     """
     service_ctrl is a generic function to execute standard fb303 functions
 
@@ -66,19 +68,19 @@
             return 3
 
     # scalar commands
-    if command in ["version","alive","name"]:
+    if command in ["version", "alive", "name"]:
         try:
-            result = fb303_wrapper(command,  port, trans_factory, prot_factory)
+            result = fb303_wrapper(command, port, trans_factory, prot_factory)
             print result
             return 0
         except:
-            print "failed to get ",command
+            print "failed to get ", command
             return 3
 
     # counters
     if command in ["counters"]:
         try:
-            counters = fb303_wrapper('counters',  port, trans_factory, prot_factory)
+            counters = fb303_wrapper('counters', port, trans_factory, prot_factory)
             for counter in counters:
                 print "%s: %d" % (counter, counters[counter])
             return 0
@@ -86,11 +88,10 @@
             print "failed to get counters"
             return 3
 
-
     # Only root should be able to run the following commands
     if os.getuid() == 0:
         # async commands
-        if command in ["stop","reload"] :
+        if command in ["stop", "reload"]:
             try:
                 fb303_wrapper(command, port, trans_factory, prot_factory)
                 return 0
@@ -98,23 +99,21 @@
                 print "failed to tell the service to ", command
                 return 3
     else:
-        if command in ["stop","reload"]:
+        if command in ["stop", "reload"]:
             print "root privileges are required to stop or reload the service."
             return 4
 
     print "The following commands are available:"
-    for command in ["counters","name","version","alive","status"]:
+    for command in ["counters", "name", "version", "alive", "status"]:
         print "\t%s" % command
     print "The following commands are available for users with root privileges:"
-    for command in ["stop","reload"]:
+    for command in ["stop", "reload"]:
         print "\t%s" % command
 
+    return 0
 
 
-    return 0;
-
-
-def fb303_wrapper(command, port, trans_factory = None, prot_factory = None):
+def fb303_wrapper(command, port, trans_factory=None, prot_factory=None):
     sock = TSocket.TSocket('localhost', port)
 
     # use input transport factory if provided
@@ -179,11 +178,11 @@
 
     # parse command line options
     parser = OptionParser()
-    commands=["stop","counters","status","reload","version","name","alive"]
+    commands = ["stop", "counters", "status", "reload", "version", "name", "alive"]
 
     parser.add_option("-c", "--command", dest="command", help="execute this API",
                       choices=commands, default="status")
-    parser.add_option("-p","--port",dest="port",help="the service's port",
+    parser.add_option("-p", "--port", dest="port", help="the service's port",
                       default=9082)
 
     (options, args) = parser.parse_args()
diff --git a/contrib/fb303/py/setup.py b/contrib/fb303/py/setup.py
index 6710c8f..4321ce2 100644
--- a/contrib/fb303/py/setup.py
+++ b/contrib/fb303/py/setup.py
@@ -24,26 +24,25 @@
     from setuptools import setup, Extension
 except:
     from distutils.core import setup, Extension, Command
-        
-setup(name = 'thrift_fb303',
-    version = '1.0.0-dev',
-    description = 'Python bindings for the Apache Thrift FB303',
-    author = ['Thrift Developers'],
-    author_email = ['dev@thrift.apache.org'],
-    url = 'http://thrift.apache.org',
-    license = 'Apache License 2.0',
-    packages = [
-        'fb303',
-        'fb303_scripts',
-    ],
-    classifiers = [
-        'Development Status :: 5 - Production/Stable',
-        'Environment :: Console',
-        'Intended Audience :: Developers',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 2',
-        'Topic :: Software Development :: Libraries',
-        'Topic :: System :: Networking'
-    ],
-)
 
+setup(name='thrift_fb303',
+      version='1.0.0-dev',
+      description='Python bindings for the Apache Thrift FB303',
+      author=['Thrift Developers'],
+      author_email=['dev@thrift.apache.org'],
+      url='http://thrift.apache.org',
+      license='Apache License 2.0',
+      packages=[
+          'fb303',
+          'fb303_scripts',
+      ],
+      classifiers=[
+          'Development Status :: 5 - Production/Stable',
+          'Environment :: Console',
+          'Intended Audience :: Developers',
+          'Programming Language :: Python',
+          'Programming Language :: Python :: 2',
+          'Topic :: Software Development :: Libraries',
+          'Topic :: System :: Networking'
+      ],
+      )
