<jupyter_start><jupyter_text>Editing a Custom BasketEditing a custom basket is very similar to the creation process. You simply fetch your basket, set its properties to match your preferences, and call update! Please note that not all settings are modifiable after creation (see the list of options below). Additionally, if you'd like to adjust your basket's composition or price settings, please refer to the [rebalance tutorial](./Basket%20Rebalance.ipynb) instead.  Step 1: Authenticate & Initialize your sessionFirst you will import the necessary modules and add your client id and client secret.<jupyter_code>from gs_quant.markets.baskets import Basket
from gs_quant.session import Environment, GsSession

client = 'CLIENT ID'
secret = 'CLIENT SECRET'

GsSession.use(Environment.PROD, client_id=client, client_secret=secret, scopes=('read_product_data read_user_profile modify_product_data',))<jupyter_output><empty_output><jupyter_text>Step 2: Fetch your basket and set your changesNext you will fetch the basket you'd like to edit by passing in any of its identifiers such as BloombergId, Cusip, Ticker, etc. If this is a basket you or someone from your organization created, please make sure your application has edit/admin entitlements or you will not be able to modify it. You will then be ready to change any of the properties listed below.| Parameter Name      |Description ||:--------------------|:-----------||name                 |Display name of the basket||description          |Free text description of basket. Description provided will be indexed in the search service for free text relevance match.||publish_to_bloomberg |If you'd like us to publish your basket to Bloomberg||publish_to_reuters   |If you'd like us to publish your basket to Reuters  ||publish_to_factset   |If you'd like us to publish your basket to Factset  ||include_price_history|Republish price history based on current composition when publishing to Bloomberg|<jupyter_code>basket = Basket.get('GSMBXXXX')

basket.description = 'My New and Improved basket description'
basket.publish_to_reuters = True<jupyter_output><empty_output><jupyter_text>Step 3: Update your basket's entitlementsThe application you use to create your basket will initially be the only one permissioned to view, edit, and submit rebalance requests. If you'd like to entitle other users or groups with view or admin access, you may update your basket's permissions at any time.In order to add or remove permissions for a specific user, you will need either their Marquee user id or email. You may also permission groups using their group id. See the snippet below, or refer to the [baskets permissions examples](../examples/07_basket_permissions/0001_permission_application_to_basket.ipynb) for more options.<jupyter_code>from gs_quant.entities.entitlements import Group, User

user = User.get(user_id='application_id')
basket.entitlements.view.users.remove(user)

group = Group.get(group_id='group_id')
basket.entitlements.admin.groups += [group]

basket.entitlements.to_frame() # call to verify the entitlement changes are now reflected properly<jupyter_output><empty_output><jupyter_text>Step 4: Submit your changesOnce you've ensured that your basket has been updated to your satisfaction, you're ready to officially submit these changes to Marquee! Once you call update on the basket, you may poll its status to make sure that it has processed successfully. This will check the report status every 30 seconds for 10 minutes by default, but you can override this option if you prefer as shown below.<jupyter_code>my_basket.get_details() # call to make sure that your changes are all reflected properly

my_basket.update()

my_basket.poll_status(timeout=120, step=20) # optional: constantly checks edit status until report succeeds, fails, or the poll times out (this example checks every 20 seconds for 2 minutes)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06468933776527742, 'fraction_numerical': 0.006136537969828688, 'mean_word_length': 5.360975609756098, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '356950', 'license': 'Apache-2.0', 'n_tokens_mistral': 1049, 'n_tokens_neox': 995, 'n_words': 477, 'path': 'gs_quant/documentation/06_baskets/tutorials/Basket Edit.ipynb', 'repo_name': 'webclinic017/gs-quant', 'size': '3911'}