def __EncodeIfNeeded(self, value):
    if isinstance(value, unicode):
      return value.encode('utf8')
    else:
      return value
Simple helper function to create an str from possibly unicode strings.
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/gql/__init__.py/GQL.__EncodeIfNeeded