code: def setup_layout(self, board_layout):
          
          # Create pin instances based on board layout
          self.analog = []
          for i in board_layout['analog']:
              self.analog.append(Pin(self, i))
  
          self.digital = []
          self.digital_ports = []
          for i in range(0, len(board_layout['digital']), 8):
              num_pins = len(board_layout['digital'][i:i + 8])
              port_number = int(i / 8)
              self.digital_ports.append(Port(self, port_number, num_pins))
  
          # Allow to access the Pin instances directly
          for port in self.digital_ports:
              self.digital += port.pins
  
          # Setup PWM pins
          for i in board_layout['pwm']:
              self.digital[i].PWM_CAPABLE = True
  
          # Disable certain ports like Rx/Tx and crystal ports
          for i in board_layout['disabled']:
              self.digital[i].mode = UNAVAILABLE
  
          # Create a dictionary of 'taken' pins. Used by the get_pin method
          self.taken = {'analog': dict(map(lambda p: (p.pin_number, False), self.analog)),
                        'digital': dict(map(lambda p: (p.pin_number, False), self.digital))}
  
          self._set_default_handlers()
docs: Setup the Pin instances based on the given board layout.