def measure_type(x):
    """Takes Numeric Code and returns String API code

    Input Values: 1:"Base", 2:"Advanced", 3:"Misc", 4:"Four Factors", 5:"Scoring", 6:"Opponent", 7:"Usage"

    Used in:

    """
    measure = {(1): 'Base', (2): 'Advanced', (3): 'Misc', (4):
        'Four Factors', (5): 'Scoring', (6): 'Opponent', (7): 'Usage'}
    try:
        return measure[x]
    except:
        raise ValueError('Please enter a number between 1 and ' + str(len(
            measure)))
