'Generates an unpredictable byte string.
:type number_of_bytes: integer
:param number_of_bytes: Integer that contains the number of bytes to
generate. Common values are 128, 256, 512, 1024 and so on. The
current limit is 1024 bytes.'

def generate_random(self, number_of_bytes=None):

    params = {}
    if (number_of_bytes is not None):
        params['NumberOfBytes'] = number_of_bytes
    response = self.make_request(action='GenerateRandom', body=json.dumps(params))
    if (response.get('Plaintext') is not None):
        response['Plaintext'] = base64.b64decode(response['Plaintext'].encode('utf-8'))
    return response
