def sameSegment(seg1, seg2):
result = True<EOL>for field in [<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>, <NUM_LIT:4>, <NUM_LIT:5>, <NUM_LIT:6>]:<EOL><INDENT>if abs(seg1[<NUM_LIT:0>][field] - seg2[<NUM_LIT:0>][field]) > <NUM_LIT>:<EOL><INDENT>result = False<EOL><DEDENT><DEDENT>if len(seg1[<NUM_LIT:1>:]) != len(seg2[<NUM_LIT:1>:]):<EOL><INDENT>result = False<EOL><DEDENT>for syn in seg2[<NUM_LIT:1>:]:<EOL><INDENT>if syn[<NUM_LIT:2>] <= <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>")<EOL>result = False<EOL><DEDENT><DEDENT>if result == True:<EOL><INDENT>for syn in seg1[<NUM_LIT:1>:]:<EOL><INDENT>if syn[<NUM_LIT:2>] <= <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>")<EOL>result = False<EOL><DEDENT>res = sameSynapse(syn, seg2[<NUM_LIT:1>:])<EOL>if res == False:<EOL><INDENT>result = False<EOL><DEDENT><DEDENT><DEDENT>return result<EOL>
Return True if seg1 and seg2 are identical, ignoring order of synapses