comefrom: <qiyuangong>351_Android_Unlock_Patterns_1.py
code: def is_valid( used, index, last):
      if used[index]:
          return False
      if last == -1:
          return True
      if (last + index) % 2 == 1:
          return True
      mid = (last + index) / 2
      if mid == 4:
          return used[mid]
      if (index % 3 != last % 3) and (index / 3 != last / 3):
          return True
      return used[mid]
masked: def sample_funcname ( var_0 , var_1 , var_2 ) :
      if var_0 [ var_1 ] :
          return False
      if var_2 == - 1 :
          return True
      if ( var_2 + var_1 ) % 2 == 1 :
          return True
      var_7 = ( var_2 + var_1 ) / 2
      if var_7 == 4 :
          return var_0 [ var_7 ]
      if ( var_1 % 3 != var_2 % 3 ) and ( var_1 / 3 != var_2 / 3 ) :
          return True
      return var_0 [ var_7 ]
  