parameters: (p1, p2)
return_statement: return 1
docstring: control pin sort order
docstring_summary: control pin sort order
docstring_tokens: control pin sort order
function: def pin_compare(p1, p2):
      '''control pin sort order'''
      (p1,f1) = p1.split(':')
      (p2,f2) = p2.split(':')
      port1 = p1[:2]
      port2 = p2[:2]
      pin1 = int(p1[2:])
      pin2 = int(p2[2:])
      #print(port1, pin1, port2, pin2)
      if port1 == port2:
          if pin1 == pin2:
              if f1 < f2:
                  return -1
              return 1
          if pin1 < pin2:
              return -1
          return 1
      if port1 < port2:
          return -1
      return 1
function_tokens: def pin_compare ( p1 , p2 ) : ( p1 , f1 ) = p1 . split ( ':' ) ( p2 , f2 ) = p2 . split ( ':' ) port1 = p1 [ : 2 ] port2 = p2 [ : 2 ] pin1 = int ( p1 [ 2 : ] ) pin2 = int ( p2 [ 2 : ] ) #print(port1, pin1, port2, pin2) if port1 == port2 : if pin1 == pin2 : if f1 < f2 : return - 1 return 1 if pin1 < pin2 : return - 1 return 1 if port1 < port2 : return - 1 return 1