Gets the intersecting ranges based on the partition key.

def _GetIntersectingRanges(self, partition_key):
        """Gets the intersecting ranges based on the partition key.
        """
        partitionkey_ranges = set()
        intersecting_ranges = set()

        if partition_key is None:
            return list(self.partition_map.keys())

        if isinstance(partition_key, prange.Range):
            partitionkey_ranges.add(partition_key)
        elif isinstance(partition_key, list):
            for key in partition_key:
                if key is None:
                    return list(self.partition_map.keys())
                elif isinstance(key, prange.Range):
                    partitionkey_ranges.add(key)
                else:
                    partitionkey_ranges.add(prange.Range(key, key))
        else:
            partitionkey_ranges.add(prange.Range(partition_key, partition_key))

        for partitionKeyRange in partitionkey_ranges:
            for keyrange in self.partition_map.keys():
                if keyrange.Intersect(partitionKeyRange):
                    intersecting_ranges.add(keyrange)

        return intersecting_ranges