<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def assign_selective_dynamics(self, slab):
 """ Helper function to assign selective dynamics site_properties based on surface, subsurface site properties Args: slab (Slab):
 slab for which to assign selective dynamics """

        sd_list = []
        sd_list = [[False, False, False] if site.properties['surface_properties'] == 'subsurface'
                   else [True, True, True] for site in slab.sites]
        new_sp = slab.site_properties
        new_sp['selective_dynamics'] = sd_list
        return slab.copy(site_properties=new_sp)