def toscalar(self):
if self.shape == ():<EOL><INDENT>return self.toarray().reshape(<NUM_LIT:1>)[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>return self<EOL><DEDENT>
Returns the single scalar element contained in an array of shape (), if
the array has that shape. Returns self otherwise.