parameters: (
      device_name: str, port: Optional[str] = None, baudrate: int = 115200
  )
return_statement: return _connect(port_name=port, baudrate=baudrate)
docstring: Creates a serial connection.
  
      Args:
          device_name: defaults to 'Smoothieboard'
          port: the optional port
          baudrate: integer frequency for serial communication
  
      Returns:
          serial.Serial connection
docstring_summary: Creates a serial connection.
docstring_tokens: Creates a serial connection .
function: def connect(
      device_name: str, port: Optional[str] = None, baudrate: int = 115200
  ) -> Serial:
      """
      Creates a serial connection.
  
      Args:
          device_name: defaults to 'Smoothieboard'
          port: the optional port
          baudrate: integer frequency for serial communication
  
      Returns:
          serial.Serial connection
      """
      if not port:
          port = get_ports_by_name(device_name=device_name)[0]
      log.debug("Device name: {}, Port: {}".format(device_name, port))
      return _connect(port_name=port, baudrate=baudrate)
function_tokens: def connect ( device_name : str , port : Optional [ str ] = None , baudrate : int = 115200 ) -> Serial : if not port : port = get_ports_by_name ( device_name = device_name ) [ 0 ] log . debug ( "Device name: {}, Port: {}" . format ( device_name , port ) ) return _connect ( port_name = port , baudrate = baudrate )