<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_keystone_endpoint(self, keystone_ip, api_version=None, admin_port=False):
 """Return keystone endpoint"""

        port = 5000
        if admin_port:
            port = 35357
        base_ep = "http://{}:{}".format(keystone_ip.strip().decode('utf-8'),
                                        port)
        if api_version == 2:
            ep = base_ep + "/v2.0"
        else:
            ep = base_ep + "/v3"
        return ep