generate a random message
550351
function random_msg(name){
	name = filter_name(name);
	return  util.format(thanks_temp[Math.floor(Math.random()*10)%(thanks_temp.length-1)] , name);
}
1291994
def create_message(self):
        """"""
        self.counter += 1
        self._transport.send(
            "transient.transaction",
            "TXMessage #%d\n++++++++Produced@ %f"
            % (self.counter, (time.time() % 1000) * 1000),
        )
        self.log.info("Created message %d", self.counter)
1091575
def _randomString():
    """"""

    return ''.join(
        random.choice(string.ascii_uppercase + string.digits)
        for x in range(10))
966475
def random_str_uuid(string_length):
    """"""
    if not isinstance(string_length, int) or not 1 <= string_length <= 32:
        msg = "string_length must be type int where 1 <= string_length <= 32"
        raise ValueError(msg)
    random = str(uuid.uuid4()).upper().replace('-', '')
    return random[0:string_length]
1319438
def random_id(k=5):
  """"""
  #  https://stackoverflow.com/questions/2257441/random-string-generation-with-upper-case-letters-and-digits-in-python
  return ''.join(random.choices(string.ascii_lowercase + string.digits, k=k))
381423
def random_str(n=20):
    
    return ''.join(random.sample(string.ascii_letters + string.digits, n))
169922
def generate_random_string(length=8):
    
    char_set = string.ascii_uppercase + string.digits
    return ''.join(random.sample(char_set * (length - 1), length))
53287
def generate_random_id(method)
      data = File.open("/dev/urandom", "rb") do |f|
        f.read(64)
      end
      case method
      when :base64
        data = base64(data)
        data.gsub!("+", '')
        data.gsub!("/", '')
        data.gsub!(/==$/, '')
        return data
      when :hex
        return data.unpack('H*')[0]
      else
        raise ArgumentError, "Invalid method #{method.inspect}"
      end
    end
1037668
def _random_string():
    
    rng = random.SystemRandom()
    token_value = u''.join(rng.choice(CHARSET) for _ in range(CHAR_GROUPS * CHARS_PER_GROUP))
    if CHARS_PER_GROUP > 1:
        return GROUP_SEP.join(map(u''.join, zip(*[iter(token_value)] * CHARS_PER_GROUP)))
    else:
        return token_value
867955
def _generate(self, message):
        """"""
        raw_params = {"INPUT_TEXT"  : message.encode('UTF8'),
                      "INPUT_TYPE"  : self.input_type,
                      "OUTPUT_TYPE" : self.output_type,
                      "LOCALE"      : self._locale,
                      "AUDIO"       : self.audio,
                      "VOICE"       : self._voice,
                      }
        params = urlencode(raw_params)
        headers = {}

        logging.debug('maryclient: generate, raw_params=%s' % repr(raw_params))

        # Open connection to self._host, self._port.
        conn = httplib.HTTPConnection(self._host, self._port)

        #conn.set_debuglevel(5)
        
        conn.request("POST", "/process", params, headers)
        response = conn.getresponse()
        if response.status != 200:
            logging.error(response.getheaders())
            raise Exception ("{0}: {1}".format(response.status, response.reason))
        return response.read()
180279
function generateMessage(type, data)
{
  var message;

  switch (type)
  {
    // default message type, no need to perform special actions, will be sent as is
    case types.MESSAGE:
      message = data;
      break;

    case types.TEXT:
      // `text` must be UTF-8 and has a 320 character limit
      // https://developers.facebook.com/docs/messenger-platform/send-api-reference/text-message
      message = {text: data.substr(0, 320)};
      break;

    case types.AUDIO:
    case types.FILE:
    case types.IMAGE:
    case types.VIDEO:
      message = {attachment: {type: type, payload: {url: data}}};
      break;

    case types.QUICK_REPLIES:
      // `quick_replies` is limited to 10
      // https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies
      message = {text: data.text, quick_replies: data.quick_replies.slice(0, 10)};
      break;

    case types.GENERIC:
      message = templates.generic.call(this, data);
      break;

    case types.BUTTON:
      message = templates.button.call(this, data);
      break;

    case types.RECEIPT:
      message = templates.receipt.call(this, data);
      break;

    default:
      this.logger.error({message: 'Unrecognized message type', type: type, payload: data});
  }

  return message;
}
1064760
def random_string(length):
    
    valid_chars = string_ascii_letters + string_digits

    return ''.join(random.choice(valid_chars) for i in range(length))
949620
def random_string(**kwargs):
    
    n = kwargs.get('length', 10)
    pool = kwargs.get('pool') or string.digits + string.ascii_lowercase
    return ''.join(random.SystemRandom().choice(pool) for _ in range(n))
120582
private byte[] generateAesKey() {
        byte[] bytes = new byte[32];
        if (!testMode) {
            SecureRandom random = new SecureRandom();
            random.nextBytes(bytes);
        } else {
            bytes = "TEST1234TEST1234TEST1234TEST1234".getBytes(MESSAGE_ENCODING);
        }
        return bytes;
    }
1114744
def random_letters(self, length=16):
        """"""
        return self.random_choices(
            getattr(string, 'letters', string.ascii_letters),
            length=length,
        )
589221
def make_random(cls):
        """"""
        self = object.__new__(cls)
        self.rank = Rank.make_random()
        self.suit = Suit.make_random()
        return self
1022676
private static final String randomString(final Random random) {
		final byte[] bytes = new byte[RANDOM_BYTES_LENGTH];
		random.nextBytes(bytes);
		return StringUtils.byteToHexString(bytes);
	}