<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_move_data(move):
 """Return the index number for the given move name. Check moves.json in the same directory."""

    srcpath = path.dirname(__file__)
    try:
        f = open(path.join(srcpath, 'moves.json'), 'r')
    except IOError:
        get_moves()
        f = open(path.join(srcpath, 'moves.json'), 'r')
    finally:
        with f:
            return json.load(f)[move]