<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate(self):
 """Validate that the GlobalContextField is correctly representable."""

        if not isinstance(self.location, Location):
            raise TypeError(u'Expected Location location, got: {} {}'
                            .format(type(self.location).__name__, self.location))

        if self.location.field is None:
            raise AssertionError(u'Received Location without a field: {}'
                                 .format(self.location))

        if not is_graphql_type(self.field_type):
            raise ValueError(u'Invalid value of "field_type": {}'.format(self.field_type))