GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — master ( b8ae6a...dff9b6 )
by Benjamin
01:15
created

Led.deactivate()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
1
class Led(object):
2
    def __init__(self, bus, address, port):
3
        self.bus = bus
4
        self.address = address
5
        self.port = port
6
        self.active = False
7
8
    def activate(self):
9
        self.toggle(True)
10
        self.active = True
11
12
    def deactivate(self):
13
        self.toggle(False)
14
        self.active = False
15
16
    def toggle(self, state):
17
        state_list = list(bin(self.active)[2:].zfill(8))
18
19
        state_list[self.port] = int(state)
20
        state = ''.join(state_list)
21
22
        state = int(state, 2)
23
        self.bus.write_byte(self.address, state)
24