<commit_before>.. _expansions_and_fields:

Expansions and Fields
=====================

.. _expansions_parameter:

``expansions``
--------------
`Expansions`_ enable you to request additional data objects that relate to the
originally returned List, Space, Tweets, Users, or DirectMessageEvents. Submit
a list of desired expansions in a comma-separated list without spaces. The ID
that represents the expanded data object will be included directly in the List,
Space, Tweet, User, or DirectMessageEvents data object, but the expanded object
metadata will be returned within the ``includes`` response object, and will
also include the ID so that you can match this data object to the original
Space, Tweet, User or DirectMessageEvents object.

At this time, the only expansion available to endpoints that primarily return
List objects is ``expansions=owner_id``. You will find the expanded user data
object living in the ``includes`` response object.

For methods that return Spaces, the following data objects can be expanded
using this parameter:

* The Spaces creator's user object
* The user objects of any Space co-host
* Any mentioned users’ object
* Any speaker's user object

For methods that return Tweets, the following data objects can be expanded
using this parameter:

* The Tweet author's user object
* The user object of the Tweet’s author that the<commit_msg>Update expansions section in docs/expansions_and_fields.rst<commit_after>.. _expansions_and_fields:

Expansions and Fields
=====================

.. _expansions_parameter:

``expansions``
--------------
`Expansions`_ enable you to request additional data objects that relate to the
originally returned List, Space, Tweets, Users, or Direct Message conversation
events. Submit a list of desired expansions in a comma-separated list without
spaces. The ID(s) that represent(s) the expanded data object(s) will be
included directly in the List, Space, Tweet, user, or event data object, but
the expanded object metadata will be returned within the ``includes`` response
object, and will also include the ID so that you can match this data object to
the original Space, Tweet, User or Direct Message conversation event object.

At this time, the only expansion available to endpoints that primarily return
List objects is ``expansions=owner_id``. You will find the expanded user data
object living in the ``includes`` response object.

For methods that return Spaces, the following data objects can be expanded
using this parameter:

* The Spaces creator's user object
* The user objects of any Space co-host
* Any mentioned users’ object
* Any speaker's user object

For methods that return Tweets, the following data objects can be expanded
using this parameter:

* The Tweet author's user object
* The user object of the Tweet’s author that the
{'fraction_non_alphanumeric': 0.0724174653887114, 'fraction_numerical': 0.0, 'mean_word_length': 4.9077568134171905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4497163', 'n_tokens_mistral': 707, 'n_tokens_neox': 681, 'n_words': 391}