Mastermind game in Python
Organization
As Simon points out, you shouldn't put the list of functions inside of run. It doesn't make much sense. Move them out into the class.
Use self
self in python is equivalent to this in C# and many other languages.
This:
    guesses = []
    game_states = []
    length = int(input(&quot;Choose length of code to break: &quot;))
    code = [random.randint(0, 9) for i in range(length)]

Should be this:
def __init__(self):
    self.guesses = []
    self.game_states = []
    self.code = [] # Add this later when you define length.

(Also, I would keep length as a local variable defined in run and then refer to len(self.code) instead.)
I would advise you look at how Python classes work.
You can replace random.randint(0, 9) with random.randrange(10).
Furthermore, once you pull the functions out of run, things like:
def take_guess():

become:
def take_guess(self):

Naming
        correct_guess_length = False

I expect a varaible with the name of length have some sort of integer (maybe real?) value. A boolean? Not often.
You don't really need this anyway!
            else:
                correct_guess_length = True

Can just be:
            else:
                break

I would probably just get rid of that too and say:
            else:
                return guess

Same thing goes for:
    correct = False
    while not correct:
        ...

You can get rid of these and use a break statement instead.
randrange
    code = [random.randint(0, 9) for i in range(length)]

Is pretty good except, randrange is a little more specialized for this:
    code = [random.randrange(10) for _ in range(length)]

(Also, when you disregard a variable the convention is to use _, not i.)
__str__
Since you rap everything in a game object, maybe you should give it a string representation overloading the __str__ function, and just print out the string representation of itself. Move print_game_state to __str__.