<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _write_string(self, string, pos_x, pos_y, height, color, bold=False, align_right=False, depth=0.):
 """Write a string Writes a string with a simple OpenGL method in the given size at the given position. :param string: The string to draw :param pos_x: x starting position :param pos_y: y starting position :param height: desired height :param bold: flag whether to use a bold font :param depth: the Z layer """

        stroke_width = height / 8.
        if bold:
            stroke_width = height / 5.
        color.set()
        self._set_closest_stroke_width(stroke_width)
        glMatrixMode(GL_MODELVIEW)
        glPushMatrix()
        pos_y -= height
        if not align_right:
            glTranslatef(pos_x, pos_y, depth)
        else:
            width = self._string_width(string, height)
            glTranslatef(pos_x - width, pos_y, depth)
        font_height = 119.5  # According to https://www.opengl.org/resources/libraries/glut/spec3/node78.html
        scale_factor = height / font_height
        glScalef(scale_factor, scale_factor, scale_factor)
        for c in string:
            # glTranslatef(0, 0, 0)
            glutStrokeCharacter(GLUT_STROKE_ROMAN, ord(c))
            # width = glutStrokeWidth(GLUT_STROKE_ROMAN, ord(c))

        glPopMatrix()