  
  
  def main():
      test = TestReverse()
      test.test_reverse()
      test.test_reverse_inplace()
  
  
  if __name__ == '__main__':
      main() 
</s> remove     "    test.test_reverse()\n",
    "    test.test_reverse_inplace()\n",
 </s> add     "    reverse_string = ReverseString()\n",
    "    test.test_reverse(reverse_string.reverse)\n",
    "    test.test_reverse_inplace(reverse_string.reverse)\n", </s> remove     "    test.test_reverse()\n",
    "    test.test_reverse_inplace()\n",
 </s> add     "    reverse_string = ReverseString()\n",
    "    test.test_reverse(reverse_string.reverse)\n",
    "    test.test_reverse_inplace(reverse_string.reverse)\n", </s> remove         reverse_string(target_list)
 </s> add         func(target_list) </s> remove     "def reverse_string(chars):\n",
    "    if chars is None:\n",
    "        return None\n",
    "    size = len(chars)\n",
    "    for i in range(size//2):\n",
    "        chars[i], chars[size-1-i] = \\\n",
    "            chars[size-1-i], chars[i]\n",
    "    return chars"
 </s> add     "class ReverseString(object):\n",
    "\n",
    "    def reverse(self, chars):\n",
    "        if chars is None:\n",
    "            return None\n",
    "        size = len(chars)\n",
    "        for i in range(size//2):\n",
    "            chars[i], chars[size-1-i] = \\\n",
    "                chars[size-1-i], chars[i]\n",
    "        return chars"
    reverse_string = ReverseString()
    test.test_reverse(reverse_string.reverse)
    test.test_reverse_inplace(reverse_string.reverse)
  
  
  def main():
      test = TestReverse()
    reverse_string = ReverseString()
    test.test_reverse(reverse_string.reverse)
    test.test_reverse_inplace(reverse_string.reverse)
    reverse_string = ReverseString()
    test.test_reverse(reverse_string.reverse)
    test.test_reverse_inplace(reverse_string.reverse)
  
  
  if __name__ == '__main__':
      main() 
keep keep keep keep replace replace keep keep keep keep
 Move string reverse to a class 
arrays_strings/reverse_string/test_reverse_string.py