Add a new vehicle (new style with all possible parameters)
776900
def addFull(self, vehID, routeID, typeID="DEFAULT_VEHTYPE", depart=None,
                departLane="first", departPos="base", departSpeed="0",
                arrivalLane="current", arrivalPos="max", arrivalSpeed="current",
                fromTaz="", toTaz="", line="", personCapacity=0, personNumber=0):
        
        messageString = struct.pack("!Bi", tc.TYPE_COMPOUND, 14)
        if depart is None:
            depart = str(self._connection.simulation.getCurrentTime() / 1000.)
        for val in (routeID, typeID, depart, departLane, departPos, departSpeed,
                    arrivalLane, arrivalPos, arrivalSpeed, fromTaz, toTaz, line):
            messageString += struct.pack("!Bi",
                                         tc.TYPE_STRING, len(val)) + str(val).encode("latin1")
        messageString += struct.pack("!Bi", tc.TYPE_INTEGER, personCapacity)
        messageString += struct.pack("!Bi", tc.TYPE_INTEGER, personNumber)

        self._connection._beginMessage(
            tc.CMD_SET_VEHICLE_VARIABLE, tc.ADD_FULL, vehID, len(messageString))
        self._connection._string += messageString
        self._connection._sendExact()
116030
def new(self, *args, **kwargs):
        '''
'''
        return self.session().add(self.model(*args, **kwargs))
389867
def update(self):
        """"""
        vehicle = self.api.vehicles(vid=self.vid)['vehicle']
        newbus = self.fromapi(self.api, vehicle)
        self.__dict__ = newbus.__dict__
        del newbus
635031
def setShapeClass(self, typeID, clazz):
        
        self._connection._sendStringCmd(
            tc.CMD_SET_VEHICLETYPE_VARIABLE, tc.VAR_SHAPECLASS, typeID, clazz)
771867
def add(self, arg, options=None):
    
    fut = tasklets.Future('%s.add(%s, %s)' % (self, arg, options))
    todo = self._queues.get(options)
    if todo is None:
      utils.logging_debug('AutoBatcher(%s): creating new queue for %r',
                          self._todo_tasklet.__name__, options)
      if not self._queues:
        eventloop.add_idle(self._on_idle)
      todo = self._queues[options] = []
    todo.append((fut, arg))
    if len(todo) >= self._limit:
      del self._queues[options]
      self.run_queue(options, todo)
    return fut
433885
function add () {

    var a = arguments; 

    var type, o, ref = false, n = null;

    if( typeof a[0] === 'string' ){ 

        type = a[0];
        o = a[1] || {};

    } else if ( typeof a[0] === 'object' ){ // like dat gui

        ref = true;
        if( a[2] === undefined ) [].push.call(a, {});

        type = a[2].type ? a[2].type : 'slide';//autoType.apply( this, a );

        o = a[2];
        o.name = a[1];
        o.value = a[0][a[1]];

    }

    var name = type.toLowerCase();

    switch( name ){

        case 'bool': n = new Bool(o); break;
        case 'button': n = new Button(o); break;
        case 'circular': n = new Circular(o); break;
        case 'color': n = new Color(o); break;
        case 'fps': n = new Fps(o); break;
        case 'graph': n = new Graph(o); break;
        case 'group': n = new Group(o); break;
        case 'joystick': n = new Joystick(o); break;
        case 'knob': n = new Knob(o); break;
        case 'list': n = new List(o); break;
        case 'numeric': case 'number': n = new Numeric(o); break;
        case 'slide': n = new Slide(o); break;
        case 'textInput': case 'string': n = new TextInput(o); break;
        case 'title': n = new Title(o); break;

    }

    if( n !== null ){

        if( ref ) n.setReferency( a[0], a[1] );
        return n;

    }
    

}
933626
def update_vehicle_menu(self):
        ''''''
        self.vehicle_menu.items = []
        for s in sorted(self.vehicle_list):
            clist = self.module('param').get_component_id_list(s)
            if len(clist) == 1:
                name = 'SysID %u: %s' % (s, self.vehicle_name_by_sysid[s])
                self.vehicle_menu.items.append(MPMenuItem(name, name, '# vehicle %u' % s))
            else:
                for c in sorted(clist):
                    try:
                        name = 'SysID %u[%u]: %s' % (s, c, self.component_name[s][c])
                    except KeyError as e:
                        name = 'SysID %u[%u]: ?' % (s,c)
                    self.vehicle_menu.items.append(MPMenuItem(name, name, '# vehicle %u:%u' % (s,c)))
        self.mpstate.console.set_menu(self.menu, self.menu_callback)
917588
public void add(T style)
    {
        Integer cnt = styles.get(style);
        if (cnt == null)
            styles.put(style, 1);
        else
            styles.put(style, cnt+1);
    }
931586
def add_model(self, model_type: str, model_uuid: str, meta: dict,
                  template_model: Template, update_default: bool=False):
        """"""
        if update_default or model_type not in self.meta:
            self.meta[model_type] = meta["default"]
        model_meta = meta["model"]
        self.models.setdefault(model_type, {})[model_uuid] = model_meta
        model_directory = os.path.join(self.cached_repo, model_type)
        os.makedirs(model_directory, exist_ok=True)
        model = os.path.join(model_directory, model_uuid + ".md")
        if os.path.exists(model):
            os.remove(model)
        links = {}
        for m_type, items in self.models.items():
            for uuid in items:
                if uuid in model_meta["dependencies"]:
                    links[uuid] = os.path.join("/", m_type, "%s.md" % uuid)
        with open(model, "w") as fout:
            fout.write(template_model.render(model_type=model_type, model_uuid=model_uuid,
                                             meta=model_meta, links=links))
        git.add(self.cached_repo, [model])
        self._log.info("Added %s", model)
155404
public function add(): void
    {
        $menu = $this->Menus->newEntity();
        if ($this->request->is('post')) {
            $data = (array)$this->request->getData();
            $menu = $this->Menus->patchEntity($menu, $data);
            if ($this->Menus->save($menu)) {
                $this->Flash->success((string)__('The menu has been saved.'));
                $this->redirect(['action' => 'index']);

                return;
            } else {
                $this->Flash->error((string)__('The menu could not be saved. Please, try again.'));
            }
        }
        $this->set('navMenu', $menu);
        $this->set('_serialize', ['navMenu']);
    }
1331407
def new(self):
        """"""
        new_dashboard = models.Dashboard(
            dashboard_title='[ untitled dashboard ]',
            owners=[g.user],
        )
        db.session.add(new_dashboard)
        db.session.commit()
        return redirect(f'/superset/dashboard/{new_dashboard.id}/?edit=true')
889602
def bootstrap_styled(cls=None, add_meta=True, form_group=True, 
    input_class='form-control'):
    

    def real_decorator(cls):
        class NewClass(cls): pass
        NewClass.__name__ = cls.__name__
        NewClass = custom_widget_wrapper(NewClass)

        _call = NewClass.__call__

        def call(*args, **kwargs):
            if input_class:
                kwargs.setdefault('class', input_class)

            return _call(*args, **kwargs)

        if add_meta: call = meta_wrapped(call)
        if form_group: call = form_group_wrapped(call)

        NewClass.__call__ = call
        return NewClass

    if cls:
        # Allow calling decorator(cls) instead of decorator()(cls)
        rv = real_decorator(cls)
        return rv

    return real_decorator
441371
def add(self, parent, obj_type, **attributes):
        
        return self.ixnCommand('add', parent.obj_ref(), obj_type, get_args_pairs(attributes))
18689
def add(name, value)
      build(name, value).tap do |hook|
        hook.save
      end
    end
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
294480
def add_tracked_motors(self, tracked_motors):
        """"""
        new_mockup_motors = map(self.get_mockup_motor, tracked_motors)
        self.tracked_motors = list(set(self.tracked_motors + new_mockup_motors))
1127173
def add(self):
        '''
        '''
        # TODO validation per object type
        submit_attribs = {}
        for attrib in self.ATTRIBUTES:
            val = getattr(self, attrib, None)
            if val:
                submit_attribs[attrib] = val
        path = '/'.join([self.RESOURCE, 'add'])
        result = self.client.request(path, submit_attribs)
        return result