diff --git a/synapse/__init__.py b/synapse/__init__.py
index aa760fb34156aedc764dee477042fdee2e9fd6c4..1e7b2ab2722711d71418dee1f8ecb983570766bb 100644
--- a/synapse/__init__.py
+++ b/synapse/__init__.py
@@ -12,5 +12,6 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """ This is a reference implementation of a synapse home server.
 """
diff --git a/synapse/api/__init__.py b/synapse/api/__init__.py
index fe8a073cd32d8d9cd7907bd4e9e9495e15b2561b..2216c0f1ca860bd888872e1eea7de8d572f6a851 100644
--- a/synapse/api/__init__.py
+++ b/synapse/api/__init__.py
@@ -12,3 +12,4 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 5c66a7261f7e59c46c8115a276228695efe2e1c7..84bc0398fdff912f01469adb680f947b0a3c03a1 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """This module contains classes for authenticating the user."""
 from twisted.internet import defer
 
diff --git a/synapse/api/constants.py b/synapse/api/constants.py
index 37bf41bfb3285469e7ad241085f3de7488f04a67..29687c34821234590b1700a2dcfae8778d65b2dd 100644
--- a/synapse/api/constants.py
+++ b/synapse/api/constants.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """Contains constants from the specification."""
 
 
diff --git a/synapse/api/errors.py b/synapse/api/errors.py
index 7ad4d636c2e06b1b3ccf5e4037a8667b5aec70b4..8b9766fab7a9309b64cb6e657e31b3b223077de8 100644
--- a/synapse/api/errors.py
+++ b/synapse/api/errors.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """Contains exceptions and error codes."""
 
 import logging
diff --git a/synapse/api/events/__init__.py b/synapse/api/events/__init__.py
index bc2daf3361af09d406b012817a94a4da96d9820f..921fd08832e12aaa62c3a115e1a77ebd3d3bdd21 100644
--- a/synapse/api/events/__init__.py
+++ b/synapse/api/events/__init__.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from synapse.api.errors import SynapseError, Codes
 from synapse.util.jsonobject import JsonEncodedObject
 
diff --git a/synapse/api/events/factory.py b/synapse/api/events/factory.py
index ea7afa234e67dc4f15252c9652f45ff1ed74aa74..12aa04fc6e6e112dc14f6d8978aad4feb2255249 100644
--- a/synapse/api/events/factory.py
+++ b/synapse/api/events/factory.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from synapse.api.events.room import (
     RoomTopicEvent, MessageEvent, RoomMemberEvent, FeedbackEvent,
     InviteJoinEvent, RoomConfigEvent
diff --git a/synapse/api/events/room.py b/synapse/api/events/room.py
index b31cd19f4b97e5958311c852b4bbcbf3590c9e67..f3df849af26a9080c66449609287dbc879503fce 100644
--- a/synapse/api/events/room.py
+++ b/synapse/api/events/room.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from . import SynapseEvent
 
 
diff --git a/synapse/api/notifier.py b/synapse/api/notifier.py
index 974f7f0ba018d30eedf17a6fc7c6ea93332165f5..22d2914d38530f3cd9ddf55fa0954e94760afbb4 100644
--- a/synapse/api/notifier.py
+++ b/synapse/api/notifier.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from synapse.api.constants import Membership
 from synapse.api.events.room import RoomMemberEvent
 
diff --git a/synapse/api/streams/__init__.py b/synapse/api/streams/__init__.py
index 08137c1e797fb591588cd07dadb7f0b4d02348a1..989e63f9ec321bcdcdc5ab0c1f7d6180606e0112 100644
--- a/synapse/api/streams/__init__.py
+++ b/synapse/api/streams/__init__.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from synapse.api.errors import SynapseError
 
 
diff --git a/synapse/api/streams/event.py b/synapse/api/streams/event.py
index 0cc1a3e36ae1eccd8d17bef89e71c95a48f820d0..4b6d739e54ba9469e912c8be7067bb681ec44465 100644
--- a/synapse/api/streams/event.py
+++ b/synapse/api/streams/event.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """This module contains classes for streaming from the event stream: /events.
 """
 from twisted.internet import defer
diff --git a/synapse/app/__init__.py b/synapse/app/__init__.py
index fe8a073cd32d8d9cd7907bd4e9e9495e15b2561b..2216c0f1ca860bd888872e1eea7de8d572f6a851 100644
--- a/synapse/app/__init__.py
+++ b/synapse/app/__init__.py
@@ -12,3 +12,4 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 5708b3ad95b3d6d608b48169f594cb10b6c43099..9ad8ac7f0e3976fcdeaeefe47bca6b5002de39c2 100644
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 # Copyright 2014 matrix.org
 #
@@ -12,7 +13,6 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-#!/usr/bin/env python
 
 from synapse.storage import read_schema
 
diff --git a/synapse/crypto/__init__.py b/synapse/crypto/__init__.py
index fe8a073cd32d8d9cd7907bd4e9e9495e15b2561b..2216c0f1ca860bd888872e1eea7de8d572f6a851 100644
--- a/synapse/crypto/__init__.py
+++ b/synapse/crypto/__init__.py
@@ -12,3 +12,4 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
diff --git a/synapse/crypto/config.py b/synapse/crypto/config.py
index 801dfd8656c0e79281fb14f2e783f78fc058ebaf..2330133e71cdf3760b2a576125781d095be6567b 100644
--- a/synapse/crypto/config.py
+++ b/synapse/crypto/config.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 import ConfigParser as configparser
 import argparse
 import socket
diff --git a/synapse/crypto/keyclient.py b/synapse/crypto/keyclient.py
index b53d1c572b187d78e37129e6dc1b96aea01f0fe4..e615866b68492467c4d6475136530d053b0ad940 100644
--- a/synapse/crypto/keyclient.py
+++ b/synapse/crypto/keyclient.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.web.http import HTTPClient
 from twisted.internet import defer, reactor
 from twisted.internet.protocol import ClientFactory
diff --git a/synapse/crypto/keyserver.py b/synapse/crypto/keyserver.py
index 48bd3807815c4a2265af07c30ebce188c7dfe001..3d80a0e660a08a760c99669a4db69b2d150243e8 100644
--- a/synapse/crypto/keyserver.py
+++ b/synapse/crypto/keyserver.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.internet import reactor, ssl
 from twisted.web import server
 from twisted.web.resource import Resource
diff --git a/synapse/crypto/resource/__init__.py b/synapse/crypto/resource/__init__.py
index fe8a073cd32d8d9cd7907bd4e9e9495e15b2561b..2216c0f1ca860bd888872e1eea7de8d572f6a851 100644
--- a/synapse/crypto/resource/__init__.py
+++ b/synapse/crypto/resource/__init__.py
@@ -12,3 +12,4 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
diff --git a/synapse/crypto/resource/key.py b/synapse/crypto/resource/key.py
index 6ce6e0b03439a26629da9d59aa7f17fdbe9ba77a..6aecd2b95f1aa314719b32ff2bc47c197cf9d86a 100644
--- a/synapse/crypto/resource/key.py
+++ b/synapse/crypto/resource/key.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.web.resource import Resource
 from twisted.web.server import NOT_DONE_YET
 from twisted.internet import defer
diff --git a/synapse/federation/__init__.py b/synapse/federation/__init__.py
index b4d95ed5ac2be20d533ef7c4ca86e32c03ac4a90..ac0c10dc33c212b1d6a05b8f4a0149cc34be2657 100644
--- a/synapse/federation/__init__.py
+++ b/synapse/federation/__init__.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """ This package includes all the federation specific logic.
 """
 
diff --git a/synapse/federation/handler.py b/synapse/federation/handler.py
index 31e8470b33d00865bb839e14efe50330f7ef0656..d361f0aaf7775ac83272ff45354edaad1d6707ca 100644
--- a/synapse/federation/handler.py
+++ b/synapse/federation/handler.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.internet import defer
 
 from .pdu_codec import PduCodec
diff --git a/synapse/federation/pdu_codec.py b/synapse/federation/pdu_codec.py
index 9155930e4757100d3dd05ee42f60162c189aec49..adc166c56402034facede817485338b97c97afd1 100644
--- a/synapse/federation/pdu_codec.py
+++ b/synapse/federation/pdu_codec.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from .units import Pdu
 
 import copy
diff --git a/synapse/federation/persistence.py b/synapse/federation/persistence.py
index ad4111c683cc8da0a2f3fe3a44bdd27e88dc1fc8..372245712a653d1e6be65ee9fc6dea96b9c8f241 100644
--- a/synapse/federation/persistence.py
+++ b/synapse/federation/persistence.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """ This module contains all the persistence actions done by the federation
 package.
 
diff --git a/synapse/federation/replication.py b/synapse/federation/replication.py
index 0f5b9742911bcb3dac59115f4b7e9a81b7071b6e..bea5335f89687e448f463151c352fa6079bbf4f2 100644
--- a/synapse/federation/replication.py
+++ b/synapse/federation/replication.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """This layer is responsible for replicating with remote home servers using
 a given transport.
 """
diff --git a/synapse/federation/transport.py b/synapse/federation/transport.py
index 2136adf8d7f04d10b73994f8cd5a75d3c14339d2..09a5e5901a4899e66242dc4a32fa127cb2786b3a 100644
--- a/synapse/federation/transport.py
+++ b/synapse/federation/transport.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """The transport layer is responsible for both sending transactions to remote
 home servers and receiving a variety of requests from other home servers.
 
diff --git a/synapse/federation/units.py b/synapse/federation/units.py
index 0efea7b7682c10f54f32910c96f6c292fc106d5f..2b2f11f36ab2da074368a56dea793fca591be18a 100644
--- a/synapse/federation/units.py
+++ b/synapse/federation/units.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """ Defines the JSON structure of the protocol units used by the server to
 server protocol.
 """
diff --git a/synapse/handlers/__init__.py b/synapse/handlers/__init__.py
index 5688b68e49a09552265cdb513501d990c5ee806a..8a4aa6e5d6f2002ede4cfebe43cc3001645cb7a7 100644
--- a/synapse/handlers/__init__.py
+++ b/synapse/handlers/__init__.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from .register import RegistrationHandler
 from .room import (
     MessageHandler, RoomCreationHandler, RoomMemberHandler, RoomListHandler
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 87a392dd770a23e6c16b87d421bdfea9abe7488e..c2f4685c92edc71c1fa9b9a7de78e940b99c5b8e 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 
+
 class BaseHandler(object):
 
     def __init__(self, hs):
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index 456007c71d50b71990739e02b99ad90afb4164fa..3cc634890604e1a31f1d8df1276fbd3394d15a9c 100644
--- a/synapse/handlers/directory.py
+++ b/synapse/handlers/directory.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.internet import defer
 from ._base import BaseHandler
 
diff --git a/synapse/handlers/events.py b/synapse/handlers/events.py
index 79742a4e1c768c47d7f8ef2aeeb17bada9b43a7a..3af7d824a2aa99d0ba91304fd3b0c07330a21581 100644
--- a/synapse/handlers/events.py
+++ b/synapse/handlers/events.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 from ._base import BaseHandler
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 12e7afca4cec206a257f3c0abbc34e2195795cb2..7026df90a26065b8e4f2c07da08f8a287da4bda5 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """Contains handlers for federation events."""
 
 from ._base import BaseHandler
diff --git a/synapse/handlers/login.py b/synapse/handlers/login.py
index 5a1acd710251139999b40937b5471801a0f09ce7..ca69829d77248963663fb7b27dec7bff96d9acdb 100644
--- a/synapse/handlers/login.py
+++ b/synapse/handlers/login.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 from ._base import BaseHandler
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index 38db4b1d6789f122f747ad08c2cfef8b2fc5a660..1c24efd45495cca6a2530eb900c5e7c0fcadcc05 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 from synapse.api.errors import SynapseError, AuthError
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py
index a27206b00230a864678b1f625f41bc241d122dc4..976b8cfcdc1678f6c59a5fa109fdae2216012f0c 100644
--- a/synapse/handlers/profile.py
+++ b/synapse/handlers/profile.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 from synapse.api.errors import SynapseError, AuthError
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index 246c1f6530bf8fefc116b750be305e52de802df5..593c6033465cb277004a24e908245774e544acad 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """Contains functions for registering clients."""
 from twisted.internet import defer
 
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 4d82b339933118ffa386fd3d8de306371017ce28..eae40765b3cc51b3ab4b2f3022a7f2b8d5717469 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """Contains functions for performing events on rooms."""
 from twisted.internet import defer
 
diff --git a/synapse/http/__init__.py b/synapse/http/__init__.py
index fe8a073cd32d8d9cd7907bd4e9e9495e15b2561b..2216c0f1ca860bd888872e1eea7de8d572f6a851 100644
--- a/synapse/http/__init__.py
+++ b/synapse/http/__init__.py
@@ -12,3 +12,4 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
diff --git a/synapse/http/client.py b/synapse/http/client.py
index bb22b0ee9af5207dbf2c6bae5efe03f50ebd920d..d0facbdc6cf0b81eee00f0ad077e0802943c96d9 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.internet import defer, reactor
 from twisted.web.client import _AgentBase, _URI, readBody
 from twisted.web.http_headers import Headers
diff --git a/synapse/http/endpoint.py b/synapse/http/endpoint.py
index c4e6e63a8097392e1526a79b2ae311114a185165..d91500b07df95b78bc8b69f1973381f8d38a3e4b 100644
--- a/synapse/http/endpoint.py
+++ b/synapse/http/endpoint.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet.endpoints import SSL4ClientEndpoint, TCP4ClientEndpoint
 from twisted.internet import defer
 from twisted.internet.error import ConnectError
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 9fb45971d552dc8df885e357a3def93fc3476132..d7f4b691bc89c1c7eb6497eae442149a6f726f82 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from syutil.jsonutil import (
     encode_canonical_json, encode_pretty_printed_json
 )
diff --git a/synapse/rest/__init__.py b/synapse/rest/__init__.py
index 3d4dd098d65a60163bb34d68c20f3ebdfeaa5354..b7f0c1fd2efdee488e72cf8e68a51c7e02c19538 100644
--- a/synapse/rest/__init__.py
+++ b/synapse/rest/__init__.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from . import (
     room, events, register, login, profile, public, presence, im, directory
 )
diff --git a/synapse/rest/base.py b/synapse/rest/base.py
index d90ac611fedd5bde8d8f4a9b5b8ff191fc95b1a0..2f1ab57c735527b42ccb72af8449117101ac71e4 100644
--- a/synapse/rest/base.py
+++ b/synapse/rest/base.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """ This module contains base REST classes for constructing REST servlets. """
 import re
 
diff --git a/synapse/rest/directory.py b/synapse/rest/directory.py
index a426003a38b431570e96a404faa26a3bee8956fd..31fd26e8485725698bfe30b4effdaf34d8fe3564 100644
--- a/synapse/rest/directory.py
+++ b/synapse/rest/directory.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.internet import defer
 
 from synapse.types import RoomAlias, RoomID
diff --git a/synapse/rest/events.py b/synapse/rest/events.py
index 147257a940f8a9f9a322b9395bc120f835984653..dc811b813a8b423c5ce0e1f2fa2a7b24f5a3b562 100644
--- a/synapse/rest/events.py
+++ b/synapse/rest/events.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """This module contains REST servlets to do with event streaming, /events."""
 from twisted.internet import defer
 
diff --git a/synapse/rest/im.py b/synapse/rest/im.py
index 39f2dbd749a8659840fa12baccf58194d6856ecc..63a77716a0902e2c7d358ce168b0bbee63a0373d 100644
--- a/synapse/rest/im.py
+++ b/synapse/rest/im.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 from synapse.api.streams import PaginationConfig
diff --git a/synapse/rest/login.py b/synapse/rest/login.py
index 0284e125b458d0b21475bcae93e7a5572c74d0ec..88a321833249184e8f7725840b63584eaf875955 100644
--- a/synapse/rest/login.py
+++ b/synapse/rest/login.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 from synapse.api.errors import SynapseError
diff --git a/synapse/rest/presence.py b/synapse/rest/presence.py
index e4925c20a5bdef12fd9dba72845c5a7f2c868dd7..604384859522d0bbfca23130909ae249a6501d1c 100644
--- a/synapse/rest/presence.py
+++ b/synapse/rest/presence.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """ This module contains REST servlets to do with presence: /presence/<paths>
 """
 from twisted.internet import defer
diff --git a/synapse/rest/profile.py b/synapse/rest/profile.py
index f384227c290ce37461763520c0f48a2d9e6bba67..3d0427bf724ff93508fe55940df629396305d97b 100644
--- a/synapse/rest/profile.py
+++ b/synapse/rest/profile.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """ This module contains REST servlets to do with profile: /profile/<paths> """
 from twisted.internet import defer
 
diff --git a/synapse/rest/public.py b/synapse/rest/public.py
index 6fd1731a6171ad17ef8b16ae6afc140bd6c61bed..3430c8049f1c9f6461a75c613e3af8b46ea93aaa 100644
--- a/synapse/rest/public.py
+++ b/synapse/rest/public.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """This module contains REST servlets to do with public paths: /public"""
 from twisted.internet import defer
 
diff --git a/synapse/rest/register.py b/synapse/rest/register.py
index f1cbce5c672ca74bf0823059659cb4b25b4d1174..eb457562b9b3b9022028e3cf66c21b2800b61307 100644
--- a/synapse/rest/register.py
+++ b/synapse/rest/register.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """This module contains REST servlets to do with registration: /register"""
 from twisted.internet import defer
 
diff --git a/synapse/rest/room.py b/synapse/rest/room.py
index c96de5e65d71f13c5213f9060c7dd332df70b508..228bc9623da978a45ad4de9f5d2a6772abf5dc74 100644
--- a/synapse/rest/room.py
+++ b/synapse/rest/room.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 """ This module contains REST servlets to do with rooms: /rooms/<paths> """
 from twisted.internet import defer
 
diff --git a/synapse/server.py b/synapse/server.py
index 0aff75f3994aa1ed89c23133976acc8b6167fd59..4ba203ac38a6801e2677eff2d52c959b51af4a99 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 # This file provides some classes for setting up (partially-populated)
 # homeservers; either as a full homeserver as a real application, or a small
 # partial one for unit test mocking.
diff --git a/synapse/state.py b/synapse/state.py
index 439c0b519a21b179e4a662f2e89e64e864e06e79..b081de8f4fa6e2a6a0b1c77640f3da3ce5365ce0 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.internet import defer
 
 from synapse.federation.pdu_codec import encode_event_id
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index ec93f9f8a7072e8fcb3146f6c704259597c070be..3c27428c08a2f5a4223b54a51b27035bc8d847a4 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from synapse.api.events.room import (
     RoomMemberEvent, MessageEvent, RoomTopicEvent, FeedbackEvent,
     RoomConfigEvent
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 4d98a6fd0d712d0464a5d0ea491439ff48c275ac..65f691ead43bd619e0036d08a6d4116ae7837028 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 import logging
 
 from twisted.internet import defer
diff --git a/synapse/storage/directory.py b/synapse/storage/directory.py
index 71fa9d9c9c676695853b29eb97b9dd5f50ddc21f..b22ce02f3f791f58c4c1ad02c6d656c6d62026cc 100644
--- a/synapse/storage/directory.py
+++ b/synapse/storage/directory.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from ._base import SQLBaseStore
 from twisted.internet import defer
 
diff --git a/synapse/storage/feedback.py b/synapse/storage/feedback.py
index 2b421e33429becf3284cd5a8027484dbf97390b7..9bd562c762293fc7d40c59252f61e8534ccb71ce 100644
--- a/synapse/storage/feedback.py
+++ b/synapse/storage/feedback.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from ._base import SQLBaseStore, Table
 from synapse.api.events.room import FeedbackEvent
 
diff --git a/synapse/storage/message.py b/synapse/storage/message.py
index 4822fa709dc441f9ce3747b7b6ac36ad4b9b21e8..7bb69c138471daf1f254385b540184f0b91cfc9a 100644
--- a/synapse/storage/message.py
+++ b/synapse/storage/message.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from ._base import SQLBaseStore, Table
 from synapse.api.events.room import MessageEvent
 
diff --git a/synapse/storage/pdu.py b/synapse/storage/pdu.py
index a1cdde0a3b21b47c64d31db35f05ebaa4b55c736..202d7f6cb6787c87c7be530bc41418b68b7013a0 100644
--- a/synapse/storage/pdu.py
+++ b/synapse/storage/pdu.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from ._base import SQLBaseStore, Table, JoinHelper
 
 from synapse.util.logutils import log_function
diff --git a/synapse/storage/presence.py b/synapse/storage/presence.py
index e57ddaf149131d791ecc098ac392be4bb71abd21..6f5b042c25f6d6ae7978b25c8454651a736a599c 100644
--- a/synapse/storage/presence.py
+++ b/synapse/storage/presence.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from ._base import SQLBaseStore
 
 
diff --git a/synapse/storage/profile.py b/synapse/storage/profile.py
index d2f24930c19da4ef14803190f82c3bf9956991f3..91dd565033aebf585da7c9d2f3e1f93cab1d0ece 100644
--- a/synapse/storage/profile.py
+++ b/synapse/storage/profile.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from ._base import SQLBaseStore
 
 
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index 4a970dd546516eed52b1ad7d31f606a121ff99fc..68cdfbb4ca0bbb4df2b4812347451615fe84dcd9 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 from sqlite3 import IntegrityError
diff --git a/synapse/storage/room.py b/synapse/storage/room.py
index 174cbcf3d8af5ca40821ce9636c058997d20a902..09d9c2339b4e0947e30fb7d44c7710bac766369f 100644
--- a/synapse/storage/room.py
+++ b/synapse/storage/room.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 from sqlite3 import IntegrityError
diff --git a/synapse/storage/roomdata.py b/synapse/storage/roomdata.py
index 781d477931694742a57ac81247ea5d183124ad2e..cc04d1ba1460ba5aa2f5cb6d54ded201a2e781c1 100644
--- a/synapse/storage/roomdata.py
+++ b/synapse/storage/roomdata.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from ._base import SQLBaseStore, Table
 
 import collections
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index e6e76177978968809ce328c4428ab15faa857778..ef73be4af44291c81c8b76ad2bb2f0194f28564f 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 from synapse.types import UserID
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index c3b1bfeb329fd4779f374ce7b88c844f095b4627..1dedffac49a77f419510ca90a4ef6d095a26fa14 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from ._base import SQLBaseStore
 from .message import MessagesTable
 from .feedback import FeedbackTable
diff --git a/synapse/storage/transactions.py b/synapse/storage/transactions.py
index aa41e2ad7fa810149ec0b2245d2f8729683a0217..a277e4971ac54ac5180887563dd853e1b2c0b280 100644
--- a/synapse/storage/transactions.py
+++ b/synapse/storage/transactions.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from ._base import SQLBaseStore, Table
 from .pdu import PdusTable
 
diff --git a/synapse/types.py b/synapse/types.py
index 1adc95bbb062120c68ade7880479f8fc2974002b..054b1e713cc02f1ccea89f3ce9a45d4027a1acdc 100644
--- a/synapse/types.py
+++ b/synapse/types.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from synapse.api.errors import SynapseError
 
 from collections import namedtuple
diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py
index 5361cb7ec2ef2e41617d48beb85c14e910868760..3ea431a7f9ae5479c5bceca45e08ecf1dee2c531 100644
--- a/synapse/util/__init__.py
+++ b/synapse/util/__init__.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.internet import reactor
 
 import time
diff --git a/synapse/util/async.py b/synapse/util/async.py
index e04db8e285f995ba4eb0d1e9ed37c893c269d84a..ebbdc00ae1be6ecf5f96c32e97fd61f35603a462 100644
--- a/synapse/util/async.py
+++ b/synapse/util/async.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.internet import defer, reactor
 
 
diff --git a/synapse/util/distributor.py b/synapse/util/distributor.py
index 32d19402b4917713fbed67eef9d00f7d68ba5ed8..9605d7d1b95db712645498f5b9c58e768df954d9 100644
--- a/synapse/util/distributor.py
+++ b/synapse/util/distributor.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 from twisted.internet import defer
 
 import logging
diff --git a/synapse/util/jsonobject.py b/synapse/util/jsonobject.py
index 190a80a322a2f6920135e9791b397d554487f12a..e2840b59f99b1134b387b9b108feda34cede7737 100644
--- a/synapse/util/jsonobject.py
+++ b/synapse/util/jsonobject.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 import copy
 
 class JsonEncodedObject(object):
diff --git a/synapse/util/lockutils.py b/synapse/util/lockutils.py
index e4d609d84eb5f1ecdcc4e815481fc94b5feef91f..758be0b901b47994740dd1d6dee5a78e4579e71a 100644
--- a/synapse/util/lockutils.py
+++ b/synapse/util/lockutils.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from twisted.internet import defer
 
 import logging
diff --git a/synapse/util/logutils.py b/synapse/util/logutils.py
index 08d5aafca4b99cd826814b90fdc8e1ca501b8d9e..9270a1790b19a881b9670d066305f779e459655e 100644
--- a/synapse/util/logutils.py
+++ b/synapse/util/logutils.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 from inspect import getcallargs
 
 import logging
diff --git a/synapse/util/stringutils.py b/synapse/util/stringutils.py
index 91550583a414c564d403f3f66cea3416b62666a5..e1b0796e56486e2855ccc394b8a7dda1b44b6f97 100644
--- a/synapse/util/stringutils.py
+++ b/synapse/util/stringutils.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 import random
 import string
 
diff --git a/tests/test_distributor.py b/tests/test_distributor.py
index 36cbf6c52d055c8c74d6ae9eef9f7c8ee7807877..db23f166738f495d69ee10a77037eab21d389185 100644
--- a/tests/test_distributor.py
+++ b/tests/test_distributor.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 import unittest
 
 from twisted.internet import defer