<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_flat(coord):
 """Converts from a Minigo coordinate to a flattened coordinate."""

    if coord is None:
        return go.N * go.N
    return go.N * coord[0] + coord[1]