<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tile_to_quadkey(tile, level):
 """Transform tile coordinates to a quadkey"""

        tile_x = tile[0]
        tile_y = tile[1]
        quadkey = ""
        for i in xrange(level):
            bit = level - i
            digit = ord('0')
            mask = 1 << (bit - 1)  # if (bit - 1) > 0 else 1 >> (bit - 1)
            if (tile_x & mask) is not 0:
                digit += 1
            if (tile_y & mask) is not 0:
                digit += 2
            quadkey += chr(digit)
        return quadkey