def isSegmentAround(aroundSegmentsDictionary, aroundSegmentsDictionaryKey, segment):
 if (aroundSegmentsDictionaryKey not in aroundSegmentsDictionary):
  return False
 for aroundSegment in aroundSegmentsDictionary[aroundSegmentsDictionaryKey]:
  endpoint = aroundSegment[0]
  if isSegmentInX(segment, endpoint.point.real, endpoint.otherEndpoint.point.real):
   return True
 return False

def isSegmentAround ( aroundSegmentsDictionary , aroundSegmentsDictionaryKey , segment ) : if ( aroundSegmentsDictionaryKey not in aroundSegmentsDictionary ) : return False for aroundSegment in aroundSegmentsDictionary [ aroundSegmentsDictionaryKey ] : endpoint = aroundSegment [ 0 ] if isSegmentInX ( segment , endpoint . point . real , endpoint . otherEndpoint . point . real ) : return True return False
determine if there is another segment around .