def pad(data_to_pad, block_size, style='<STR_LIT>'):
padding_len = block_size-len(data_to_pad)%block_size<EOL>if style == '<STR_LIT>':<EOL><INDENT>padding = bchr(padding_len)*padding_len<EOL><DEDENT>elif style == '<STR_LIT>':<EOL><INDENT>padding = bchr(<NUM_LIT:0>)*(padding_len-<NUM_LIT:1>) + bchr(padding_len)<EOL><DEDENT>elif style == '<STR_LIT>':<EOL><INDENT>padding = bchr(<NUM_LIT>) + bchr(<NUM_LIT:0>)*(padding_len-<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return data_to_pad + padding<EOL>
Apply standard padding.

    :Parameters:
      data_to_pad : byte string
        The data that needs to be padded.
      block_size : integer
        The block boundary to use for padding. The output length is guaranteed
        to be a multiple of ``block_size``.
      style : string
        Padding algorithm. It can be *'pkcs7'* (default), *'iso7816'* or *'x923'*.
    :Return:
      The original data with the appropriate padding added at the end.