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 lang in diffto.keys() & self.keys():
              if (sorted(val['value'] for val in diffto[lang])
                      != sorted(self[lang])):
                  data[lang] = [{'language': lang, 'value': i}
                                for i in self[lang]]
          for lang in diffto.keys() - self.keys():
              data[lang] = [
                  {'language': lang, 'value': i['value'], 'remove': ''}
                  for i in diffto[lang]]
          for lang in self.keys() - diffto.keys():
              data[lang] = [{'language': lang, 'value': i} for i in self[lang]]
          return data
code_tokens: def toJSON ( self , diffto : Optional [ dict ] = None ) -> dict : data = { } diffto = diffto or { } for lang in diffto . keys ( ) & self . keys ( ) : if ( sorted ( val [ 'value' ] for val in diffto [ lang ] ) != sorted ( self [ lang ] ) ) : data [ lang ] = [ { 'language' : lang , 'value' : i } for i in self [ lang ] ] for lang in diffto . keys ( ) - self . keys ( ) : data [ lang ] = [ { 'language' : lang , 'value' : i [ 'value' ] , 'remove' : '' } for i in diffto [ lang ] ] for lang in self . keys ( ) - diffto . keys ( ) : data [ lang ] = [ { 'language' : lang , 'value' : i } for i in self [ lang ] ] 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
          """