def _toEndpoint(description, certificate=None):
    from twisted.internet import reactor
    try:
        port = int(description)
    except ValueError:
        return endpoints.serverFromString(reactor, description)

    warnings.warn(
        "Specifying plain ports and/or a certificate is deprecated since "
        "Twisted 11.0; use endpoint descriptions instead.",
        category=DeprecationWarning, stacklevel=3)

    if certificate:
        from twisted.internet.ssl import DefaultOpenSSLContextFactory
        ctx = DefaultOpenSSLContextFactory(certificate, certificate)
        return endpoints.SSL4ServerEndpoint(reactor, port, ctx)
    return endpoints.TCP4ServerEndpoint(reactor, port)
bluetoothGetLocalAddress()
dataset/ETHPy150Open tkanerva/openmail/OpenMail/openmail/mytap.py/_toEndpoint--crossover with--dataset/ETHPy150Open brousch/sl4a_pydroid_mock_api/src/android/utils/androidhelper_r6.py/Android.bluetoothGetLocalAddress