original_docstring: Create JSON suitable for Wikibase API.
  
          When diffto is provided, JSON representing differences
          to the provided data is created.
  
          :param diffto: JSON containing entity data
          
docstring: Create JSON suitable for Wikibase API.
  When diffto is provided, JSON representing differences
  to the provided data is created.
docstring_tokens: Create JSON suitable for Wikibase API . When diffto is provided JSON representing differences to the provided data is created .
code: def toJSON(self, diffto: Optional[dict] = None) -> dict:
          """Create JSON suitable for Wikibase API.
  
          When diffto is provided, JSON representing differences
          to the provided data is created.
  
          :param diffto: JSON containing entity data
          """
          data = {}
          diffto = diffto or {}
          for key in diffto.keys() - self.keys():
              data[key] = {'language': key, 'value': ''}
          for key in self.keys() - diffto.keys():
              data[key] = {'language': key, 'value': self[key]}
          for key in self.keys() & diffto.keys():
              if self[key] != diffto[key]['value']:
                  data[key] = {'language': key, 'value': self[key]}
          return data
code_tokens: def toJSON ( self , diffto : Optional [ dict ] = None ) -> dict : data = { } diffto = diffto or { } for key in diffto . keys ( ) - self . keys ( ) : data [ key ] = { 'language' : key , 'value' : '' } for key in self . keys ( ) - diffto . keys ( ) : data [ key ] = { 'language' : key , 'value' : self [ key ] } for key in self . keys ( ) & diffto . keys ( ) : if self [ key ] != diffto [ key ] [ 'value' ] : data [ key ] = { 'language' : key , 'value' : self [ key ] } return data
short_docstring: Create JSON suitable for Wikibase API.
short_docstring_tokens: Create JSON suitable for Wikibase API .
comment: """Create JSON suitable for Wikibase API.
  
          When diffto is provided, JSON representing differences
          to the provided data is created.
  
          :param diffto: JSON containing entity data
          """