def get_boto_client(<EOL>client,<EOL>region=None,<EOL>aws_access_key_id=None,<EOL>aws_secret_access_key=None,<EOL>aws_session_token=None,<EOL>endpoint_url=None<EOL>):
cache_key = '<STR_LIT>'.format(<EOL>client,<EOL>region,<EOL>aws_access_key_id,<EOL>endpoint_url or '<STR_LIT>'<EOL>)<EOL>if not aws_session_token:<EOL><INDENT>if cache_key in CLIENT_CACHE:<EOL><INDENT>return CLIENT_CACHE[cache_key]<EOL><DEDENT><DEDENT>session = get_boto_session(<EOL>region,<EOL>aws_access_key_id,<EOL>aws_secret_access_key,<EOL>aws_session_token<EOL>)<EOL>if not session:<EOL><INDENT>logging.error("<STR_LIT>".format(client))<EOL>return None<EOL><DEDENT>CLIENT_CACHE[cache_key] = session.client(<EOL>client,<EOL>endpoint_url=endpoint_url<EOL>)<EOL>return CLIENT_CACHE[cache_key]<EOL>
Get a boto3 client connection.