<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def kms_encrypt(value, key, aws_config=None):
 """Encrypt and value with KMS key. Args: value (str):
 value to encrypt key (str):
 key id or alias aws_config (optional[dict]):
 aws credentials dict of arguments passed into boto3 session example: aws_creds = {'aws_access_key_id': aws_access_key_id, 'aws_secret_access_key': aws_secret_access_key, 'region_name': 'us-east-1'} Returns: str: encrypted cipher text """

    aws_config = aws_config or {}
    aws = boto3.session.Session(**aws_config)
    client = aws.client('kms')
    enc_res = client.encrypt(KeyId=key,
                             Plaintext=value)
    return n(b64encode(enc_res['CiphertextBlob']))