Instantiate object from the environment, possibly giving some extra arguments

def instantiate_by_name(self, object_name):
        """ Instantiate object from the environment, possibly giving some extra arguments """
        if object_name not in self.instances:
            instance = self.instantiate_from_data(self.environment[object_name])

            self.instances[object_name] = instance
            return instance
        else:
            return self.instances[object_name]