original_docstring: Returns s with a random bit flipped in a random position
docstring: Returns s with a random bit flipped in a random position
docstring_tokens: Returns s with a random bit flipped in a random position
code: def flip_random_character(s):
      """Returns s with a random bit flipped in a random position"""
      if s == "":
          return s
  
      pos = random.randint(0, len(s) - 1)
      c = s[pos]
      bit = 1 << random.randint(0, 6)
      new_c = chr(ord(c) ^ bit)
      # print("Flipping", bit, "in", repr(c) + ", giving", repr(new_c))
      return s[:pos] + new_c + s[pos + 1:]
code_tokens: def flip_random_character ( s ) : if s == "" : return s pos = random . randint ( 0 , len ( s ) - 1 ) c = s [ pos ] bit = 1 << random . randint ( 0 , 6 ) new_c = chr ( ord ( c ) ^ bit ) return s [ : pos ] + new_c + s [ pos + 1 : ]
short_docstring: Returns s with a random bit flipped in a random position
short_docstring_tokens: Returns s with a random bit flipped in a random position
comment: """Returns s with a random bit flipped in a random position"""$SEP$# print("Flipping", bit, "in", repr(c) + ", giving", repr(new_c))