Adds a Plan Series to this StructureSet.

 @param [Plan] plan a plan instance to be associated with this structure set
770180
def add_plan(plan)
      raise ArgumentError, "Invalid argument 'plan'. Expected Plan, got #{plan.class}." unless plan.is_a?(Plan)
      @plans << plan unless @associated_plans[plan.uid]
      @associated_plans[plan.uid] = plan
    end
409395
public static final function create_from_plan(plan $plan) {
        if (!$plan->get('id')) {
            throw new \coding_exception('The plan ID must be set.');
        }
        $event = static::create(array(
            'contextid'  => $plan->get_context()->id,
            'objectid' => $plan->get('id')
        ));
        $event->add_record_snapshot(plan::TABLE, $plan->to_record());
        return $event;
    }
317292
public void addChildren( PlanNode first,
                             PlanNode second,
                             PlanNode third ) {
        if (first != null) this.addLastChild(first);
        if (second != null) this.addLastChild(second);
        if (third != null) this.addLastChild(third);
    }
1366763
def add_struct(struct)
      raise ArgumentError, "Invalid argument 'struct'. Expected StructureSet, got #{struct.class}." unless struct.is_a?(StructureSet)
      # Do not add it again if the struct already belongs to this instance:
      @structs << struct unless @associated_structs[struct.uid]
      @associated_structs[struct.uid] = struct
    end
741612
public void createOrUpdatePlan(Plan plan) throws WorkerDaoException {
    try {
      createZookeeperBase();
      Stat s = this.framework.getCuratorFramework().checkExists().forPath(PLANS_ZK + "/" + plan.getName());
      if (s != null) {
        framework.getCuratorFramework().setData().withVersion(s.getVersion())
                .forPath(PLANS_ZK + "/" + plan.getName(), serializePlan(plan));
      } else {
        framework.getCuratorFramework().create().withMode(CreateMode.PERSISTENT)
                .withACL(Ids.OPEN_ACL_UNSAFE)
                .forPath(PLANS_ZK + "/" + plan.getName(), serializePlan(plan));
      }
    } catch (Exception e) {
      LOGGER.warn(e);
      throw new WorkerDaoException(e);
    }
  }
611555
def plans
      service = args.shift
      raise CommandFailed.new("Missing add-on service") if service.nil?

      service = get_service!(service)
      display_header("#{service['human_name']} Plans")

      plans = get_plans(:service => service['id'])

      plans = plans.sort_by { |p| [(!p['default']).to_s, p['price']['cents']] }.map do |plan|
        {
          "default"    => ('default' if plan['default']),
          "name"       => plan["name"],
          "human_name" => plan["human_name"],
          "price"      => format_price(plan["price"])
        }
      end

      display_table(plans, %w[default name human_name price], [nil, 'Slug', 'Name', 'Price'])
    end
575585
def add_layout(self, layout):
        
        layout.register_frame(self)
        self._layouts.append(layout)
1287598
def add_data_set(self, data, series_type="map", name=None, is_coordinate = False, **kwargs):
        
        
        self.data_set_count += 1
        if not name:
            name = "Series %d" % self.data_set_count
        kwargs.update({'name':name})

        if is_coordinate:
            self.data_is_coordinate = True
            self.add_JSsource('https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js')
            if self.map and not self.data_temp:
                series_data = Series([], series_type='map', **{'mapData': self.map})
                series_data.__options__().update(SeriesOptions(series_type='map', **{'mapData': self.map}).__options__())
                self.data_temp.append(series_data)

        if self.map and 'mapData' in kwargs.keys():
            kwargs.update({'mapData': self.map})

        series_data = Series(data, series_type=series_type, **kwargs)
       
        series_data.__options__().update(SeriesOptions(series_type=series_type, **kwargs).__options__())
        self.data_temp.append(series_data)
384541
def add(name, options={}, &block)
      options = options[:_defaults].(name, options) if options[:_defaults] # FIXME: pipeline?
      base    = options[:_base]

      if options.delete(:inherit) and parent_property = get(name)
        base    = parent_property[:nested]
        options = parent_property.merge(options) # TODO: Definition#merge
      end

      if options[:_nested_builder]
        options[:nested] = build_nested(
          options.merge(
            _base: base,
            _name: name,
            _block: block,
          )
        )
      end

      # clean up, we don't want that stored in the Definition instance.
      [:_defaults, :_base, :_nested_builder, :_features].each { |key| options.delete(key) }

      self[name.to_s] = @definition_class.new(name, options)
    end
361136
public void getPlanNodeList_recurse(ArrayList<AbstractPlanNode> collected,
            HashSet<AbstractPlanNode> visited) {
        if (visited.contains(this)) {
            assert(false): "do not expect loops in plangraph.";
            return;
        }
        visited.add(this);

        for (AbstractPlanNode n : m_children) {
            n.getPlanNodeList_recurse(collected, visited);
        }
        collected.add(this);
    }
1073809
def add_tileset(self, tileset):
        
        assert (isinstance(tileset, TiledTileset))
        self.tilesets.append(tileset)
833734
public void setScalingPlans(java.util.Collection<ScalingPlan> scalingPlans) {
        if (scalingPlans == null) {
            this.scalingPlans = null;
            return;
        }

        this.scalingPlans = new java.util.ArrayList<ScalingPlan>(scalingPlans);
    }
1347175
def draw(self, layout, coord):
        
        params = copy(self.geom.params)
        params.update(self.stat.params)
        params['zorder'] = self.zorder
        self.data = self.geom.handle_na(self.data)
        # At this point each layer must have the data
        # that is created by the plot build process
        self.geom.draw_layer(self.data, layout, coord, **params)
973884
public static String asString_ApiPlanBeans(Set<ApiPlanBean> plans) {
        TreeSet<ApiPlanBean> sortedPlans = new TreeSet<>(new Comparator<ApiPlanBean>() {
            @Override
            public int compare(ApiPlanBean o1, ApiPlanBean o2) {
                String p1 = o1.getPlanId() + ":" + o1.getVersion(); //$NON-NLS-1$
                String p2 = o2.getPlanId() + ":" + o2.getVersion(); //$NON-NLS-1$
                return p1.compareTo(p2);
            }
        });
        sortedPlans.addAll(plans);

        StringBuilder builder = new StringBuilder();
        boolean first = true;
        if (plans != null) {
            for (ApiPlanBean plan : sortedPlans) {
                if (!first) {
                    builder.append(", "); //$NON-NLS-1$
                }
                builder.append(plan.getPlanId()).append(":").append(plan.getVersion()); //$NON-NLS-1$
                first = false;
            }
        }
        return builder.toString();
    }
1034376
public CompiledPlan plan() throws PlanningErrorException {
        // reset any error message
        m_recentErrorMsg = null;

        // what's going to happen next:
        //  If a parameterized statement exists, try to make a plan with it
        //  On success return the plan.
        //  On failure, try the plan again without parameterization

        if (m_paramzInfo != null) {
            try {
                // compile the plan with new parameters
                CompiledPlan plan = compileFromXML(m_paramzInfo.getParameterizedXmlSQL(),
                                                   m_paramzInfo.getParamLiteralValues());
                if (plan != null) {
                    if (plan.extractParamValues(m_paramzInfo)) {
                        return plan;
                    }
                }
                else if (DEBUGGING_STATIC_MODE_TO_RETRY_ON_ERROR) {
                    compileFromXML(m_paramzInfo.getParameterizedXmlSQL(),
                                   m_paramzInfo.getParamLiteralValues());
                }
                // fall through to try replan without parameterization.
            }
            catch (Exception | StackOverflowError e) {
                // ignore any errors planning with parameters
                // fall through to re-planning without them
                m_hasExceptionWhenParameterized = true;

                // note, expect real planning errors ignored here to be thrown again below
                m_recentErrorMsg = null;
                m_partitioning.resetAnalysisState();
            }
        }

        // if parameterization isn't requested or if it failed, plan here
        CompiledPlan plan = compileFromXML(m_xmlSQL, null);
        if (plan == null) {
            if (DEBUGGING_STATIC_MODE_TO_RETRY_ON_ERROR) {
                plan = compileFromXML(m_xmlSQL, null);
            }
            throw new PlanningErrorException(m_recentErrorMsg);
        }

        return plan;
    }
1126302
def insert(self, context, plan):
	
		
		
		op = execution.Insert(self.__comp_name, self.__comp())
		if op not in plan and self.available(context) != True:
			for dep_stub in self.dependencies():
				dep_stub.insert(context, plan)
			plan.append(op)
545235
public function plan($plan = null)
    {
        if ($plan === null) {
            return $this->subscription_plan;
        } else {
            $this->subscription_plan = $plan;
            return $this;
        }
    }