def _get_value(self, key, context):
        """Works out whether key is a value or if it's a variable referencing a
        value in context and returns the correct value.
        """
        string_quotes = ('"', "'")

        if key[0] in string_quotes and key[-1] in string_quotes:
            return key[1:-1]
        if key in string.digits:
            return int(key)
        return context.get(key, None)
def _get_value ( self , key , context ) : string_quotes = ( '"' , "'" ) if key [ 0 ] in string_quotes and key [ - 1 ] in string_quotes : return key [ 1 : - 1 ] if key in string . digits : return int ( key ) return context . get ( key , None )
Works out whether key is a value or if it's a variable referencing a
        value in context and returns the correct value.