def create_site(self, site, states=None):
        """Create a new site on an agent if it doesn't already exist."""
        if site not in self.sites:
            self.sites.append(site)
        if states is not None:
            self.site_states.setdefault(site, [])
            try:
                states = list(states)
            except TypeError:
                return
            self.add_site_states(site, states)
def create_site ( self , site , states = None ) : if site not in self . sites : self . sites . append ( site ) if states is not None : self . site_states . setdefault ( site , [ ] ) try : states = list ( states ) except TypeError : return self . add_site_states ( site , states )
Create a new site on an agent if it doesn't already exist.