Those line of code create a new group with some specific properties and settings. But its not work for display_settings properties and Group membership settings (Who can view this group?) I set as "only group member". Please let me know if any ArcGIS python api reference sample code will help to be able to set the settings.
from arcgis.gis import GIS
gis = GIS("https://www.arcgis.com", "user_name", "password")
group_properties = {
"title": "My_Group",
"tags": "GIS",
"description": "Only for testing",
"access": "org", # Set the access level (org, public, private)
"display_settings": "apps",
"is_invitation_only": 'True',
"leaving_disallowed": 'True'
}
new_group = gis.groups.create(**group_properties)
new_group.protected = True
new_group.update()