<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def blockstart_tolineno(self):
 """The line on which the beginning of this block ends. :type: int """

        if self.name:
            return self.name.tolineno
        if self.type:
            return self.type.tolineno
        return self.lineno