<jupyter_start><jupyter_text>Configure Target OrgIn this notebook, the target organization's User Interface will be customized with banner, boackground, thumbnail images, a description, a footer, and a featured group shown on the homepage.  Getting Started1. Create a config file directory. Inside the config folder put all png and txt files that will be used to customize your target organization. We will include the following files.    - Organization background image    - Organization banner image    - Organization thumbnail image    - Organization description text file    - Organization footer text file2. Change the variables in code cell 1. Example variables:    - TARGET_URL = "https://esrienergy.maps.arcgis.com"    - TARGET_USERNAME = "portaladmin"    - FOLDER = "/my/config/dir/Sample_Config"     - FEATURED_GROUP_ID = "4f4fcac023dc430294cea226231ab448"    - THUMBNAIL_FILENAME = "thumbnail.png"    - FOOTER_FILENAME = "footer.txt"    - BACKGROUND_FILENAME = "background.png"    - BANNER_FILENAME = "banner.png"    - DESCRIPTION_FILENAME = "description.txt"3. Run the notebook cell by cell.    - In code cell 4, you will need to enter the passwords for the project and delivery organizations when prompted4. After running the notebook you will have a customized target organization.<jupyter_code># Global Variables Set by User **change these values before running script**

# URL of the portal that will be customized and have users added
TARGET_URL = "https://my-target-enterprise.maps.arcgis.com"

# Delivery username for log-on (needs to be admin)
TARGET_USERNAME = "my-target-login"

# delivery org UX Component locations - local full path
FOLDER = "/my/config/dir/Sample_Config" 

# featured group to display on delivery home page
FEATURED_GROUP_ID = "3ed4d38dc942410ab294f65f459c2c33"

# filenames of UI components and user file, which are located in FOLDER
THUMBNAIL_FILENAME = "thumbnail.png"
FOOTER_FILENAME = "footer.txt"
BACKGROUND_FILENAME = "background.png"
BANNER_FILENAME = "banner.png"
DESCRIPTION_FILENAME = "description.txt"
USERS_FILENAME = "users.csv"
# import libraries
from arcgis.gis import GIS
from arcgis.gis import Group
from arcgis.gis import UserManager
import os
import csv
# get UI component filepaths
THUMBNAIL = os.path.join(FOLDER, THUMBNAIL_FILENAME)
FOOTER = os.path.join(FOLDER, FOOTER_FILENAME)
BACKGROUND = os.path.join(FOLDER, BACKGROUND_FILENAME)
BANNER = os.path.join(FOLDER, BANNER_FILENAME)
DESCRIPTION = os.path.join(FOLDER, DESCRIPTION_FILENAME)
# connect to delivery orgs

print("Connecting to {} with username {}...".format(TARGET_URL, TARGET_USERNAME))
delivery = GIS(TARGET_URL, TARGET_USERNAME)
# customize UI by setting background, banner, logo, etc.
ux = delivery.admin.ux
ux.set_background(BACKGROUND)
ux.set_banner(BANNER)
ux.set_logo(THUMBNAIL)

# read description text file and set portal description
with open(DESCRIPTION, 'r') as f:
    description = f.read()
    ux.description = description
    
# find and set featured group
if FEATURED_GROUP_ID:
    featured_group = Group(delivery, FEATURED_GROUP_ID)
    ux.featured_content = {'group': featured_group}<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07916402786573781, 'fraction_numerical': 0.014882837238758708, 'mean_word_length': 4.904672897196262, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '469539', 'license': 'Apache-2.0', 'n_tokens_mistral': 1034, 'n_tokens_neox': 963, 'n_words': 314, 'path': 'agol-to-enterprise-notebooks/Configure_Target_Org.ipynb', 'repo_name': 'Esri/project-delivery-scripts', 'size': '3158'}