[VOL-2241] Python 3 refactor of pyvoltha

Majority of work was manual fixes to bytes and strings types, which are
different in py3, but same in py2. As the OMCI library does a lot of
these comparisons and scapy then renders packets, this was frequently
nontrival to debug.

Also:

- Removed grpc dep which wasn't being used, not py3 compatible
- s/Alarms/Events/ to work with protobuf changes per VOL-2224
- Automatic fixes via modernize tooling
- Removed unused OrderedWeakValueDict code
- Removed frameio send_frame specific to Darwin (MacOS), which had no
  corresponding linux code
- Use library functions for hex and unicode conversions
- Various other cleanups and fixes (EOL whitespace, etc.)

Also more (Matt):

 - handle stringify better, check if already string
 - use binary string for binary work
 - import new thread paths
 - update requirements.txt for newer libraries needed with newer python
 - return proper tuple for unpacking
 - bytes string formatting fixed
 - fix mock task unit test

Even more (Zack):

- Python 2/3 compat for _thread by using 'future'
- Bump version to 2.3.0

Change-Id: I53b596d374a944bfb80d0b112f21bcc1f8bcee6e
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_activation_fail_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_activation_fail_alarm.py
index 58dbf9c..3678ab3 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_activation_fail_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_activation_fail_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_active_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_active_alarm.py
index c675b9a..0856706 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_active_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_active_alarm.py
@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from __future__ import absolute_import
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_discovery_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_discovery_alarm.py
index a9f90ee..bd977d6 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_discovery_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_discovery_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_dying_gasp_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_dying_gasp_alarm.py
index 6e702a5..2db9bdd 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_dying_gasp_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_dying_gasp_alarm.py
@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_equipment_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_equipment_alarm.py
index 0c5fee4..e624ba0 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_equipment_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_equipment_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_high_rx_optical_power_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_high_rx_optical_power_alarm.py
index 217db10..bafe649 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_high_rx_optical_power_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_high_rx_optical_power_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_high_tx_optical_power_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_high_tx_optical_power_alarm.py
index 623e0c5..ffcfe30 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_high_tx_optical_power_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_high_tx_optical_power_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_laser_bias_current_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_laser_bias_current_alarm.py
index 129340e..4b96719 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_laser_bias_current_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_laser_bias_current_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_laser_eol_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_laser_eol_alarm.py
index cbf8a87..9cc5f5b 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_laser_eol_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_laser_eol_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_lob_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_lob_alarm.py
index 4b898a1..6eae3d0 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_lob_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_lob_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_lopc_mic_error_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_lopc_mic_error_alarm.py
index 01871ca..2403c21 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_lopc_mic_error_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_lopc_mic_error_alarm.py
@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_lopc_miss_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_lopc_miss_alarm.py
index 550f616..b354ca8 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_lopc_miss_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_lopc_miss_alarm.py
@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_los_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_los_alarm.py
index 8c86372..11bb1bf 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_los_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_los_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_low_rx_optical_power_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_low_rx_optical_power_alarm.py
index 881f9d6..30f7338 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_low_rx_optical_power_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_low_rx_optical_power_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_low_tx_optical_power_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_low_tx_optical_power_alarm.py
index 48a408a..4be3b7c 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_low_tx_optical_power_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_low_tx_optical_power_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_selftest_failure_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_selftest_failure_alarm.py
index f411f9d..6b2f1e2 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_selftest_failure_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_selftest_failure_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_signal_degrade_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_signal_degrade_alarm.py
index 8c74eac..7a0b1a1 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_signal_degrade_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_signal_degrade_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_signal_fail_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_signal_fail_alarm.py
index d24c688..38e5e18 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_signal_fail_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_signal_fail_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_startup_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_startup_alarm.py
index d81d947..5286947 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_startup_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_startup_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_temp_red_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_temp_red_alarm.py
index 62a8293..2ac4f78 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_temp_red_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_temp_red_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_temp_yellow_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_temp_yellow_alarm.py
index 4182bfe..4b028fb 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_temp_yellow_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_temp_yellow_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_voltage_red_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_voltage_red_alarm.py
index f428e2e..49f4e37 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_voltage_red_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_voltage_red_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_voltage_yellow_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_voltage_yellow_alarm.py
index 2555078..3b0d22c 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_voltage_yellow_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_voltage_yellow_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
 
diff --git a/pyvoltha/adapters/extensions/events/onu/onu_window_drift_alarm.py b/pyvoltha/adapters/extensions/events/onu/onu_window_drift_alarm.py
index c00195b..4f9ad04 100644
--- a/pyvoltha/adapters/extensions/events/onu/onu_window_drift_alarm.py
+++ b/pyvoltha/adapters/extensions/events/onu/onu_window_drift_alarm.py
@@ -11,6 +11,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 __future__ import absolute_import
 from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
 from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase