def METHOD_NAME(self, userid):
    """Returns the member with 'userid' if available and None otherwise."""
    if get_member_by_login_name:
        registry = getUtility(IRegistry)
        settings = registry.forInterface(ISecuritySchema, prefix="plone")
        if settings.use_email_as_login:
            return get_member_by_login_name(self, userid, raise_exceptions=False)
    membertool = getToolByName(self, "portal_membership")
    return membertool.getMemberById(userid)