Use the active param and set the link to active
427637
private function updateActive()
    {
        $this->each(function ($item) {
            if (isset($item->links)) {
                $this->makeActive($item);
            }
        });
    }
905878
def set_link_status(link_id, status, **kwargs):
    
    user_id = kwargs.get('user_id')
    #check_perm(user_id, 'edit_topology')
    try:
        link_i = db.DBSession.query(Link).filter(Link.id == link_id).one()
    except NoResultFound:
        raise ResourceNotFoundError("Link %s not found"%(link_id))

    link_i.network.check_write_permission(user_id)

    link_i.status = status
    db.DBSession.flush()
1325154
function setAction( $value, $params=FALSE ) {
    $this->action['value']  = $value;
    $this->action['params'] = $this->_setParams( $params );
  }
920018
function(e) {
        if (this.options.preventDefault || e.currentTarget.getAttribute('href').substr(0, 1) !== '#') {
            e.preventDefault();
        }

        this.show(e.currentTarget);
    }
1223161
function at_link() {
  match(/\{@link/)
  skip_horiz_white();

  var linkText = strip(match(/.*?\}/)).replace(/\s*@link\s*/, "").slice(0,-1); 

  if (/^https?/.test(linkText)) {
    var anchor = linkText.split(/\s+/);
    var link = anchor.shift();
    current_tag["doc"] = current_tag["doc"].slice(0,-1) + 
                         "[" + anchor.join(" ") + "]" +
                         "(" + link + ")";
  }
  else { // sugar this into panino style [[ ]] link block
    current_tag["doc"] = current_tag["doc"].slice(0,-1) + 
                         "[[" + 
                         linkText
                         + "]] ";
  }

  skip_white();
}
1100186
protected function setActiveField()
    {
        $bActive = array_get($this->arImportData, 'active');
        if ($bActive === null) {
            $this->arImportData['active'] = true;
        } else {
            $this->arImportData['active'] = (bool) $bActive;
        }
    }
5432
def activable_li_tag(*url, &block)
      content_tag :li, capture(&block), :class => ("active" if url.any?{|u| current_page?(u)})
    end
838143
function( id, activeInfo, addr ) {

			this.id = id;
			this.addr = addr;
			this.size = activeInfo.size;
			this.setValue = getPureArraySetter( activeInfo.type );

			// this.path = activeInfo.name; // DEBUG

		}
1089153
def set_active(self, active):
        """"""
        url = CONST.AUTOMATION_EDIT_URL
        url = url.replace(
            '$AUTOMATIONID$', self.automation_id)

        self._automation['is_active'] = str(int(active))

        response = self._abode.send_request(
            method="put", url=url, data=self._automation)

        response_object = json.loads(response.text)

        if isinstance(response_object, (tuple, list)):
            response_object = response_object[0]

        if (str(response_object['id']) != str(self._automation['id']) or
                response_object['is_active'] != self._automation['is_active']):
            raise AbodeException((ERROR.INVALID_AUTOMATION_EDIT_RESPONSE))

        self.update(response_object)

        return True
160000
function activeLinks(sidebarContainer) {
  const linksContainer = sidebarContainer.querySelector('ul');

  linksContainer.addEventListener('click', e => {
    if (e.target.tagName === 'A') {
      Array.from(linksContainer.querySelectorAll('a')).forEach(item =>
        item.classList.remove('active')
      );
      e.target.classList.add('active');
    }
  });
}
1266417
public function actionActivate ()
		{
			if (Yii::$app->request->isAjax)
			{
				$post = Yii::$app->request->post();
				$page = Page::findOne($post[ 'id' ]);
				$page->updateAttributes([ 'active' => $page->active ? 0 : 1 ]);

				echo $page->active;
			}
			Yii::$app->end();
		}
365209
function isActive(to, params, query) {
    return this.context.router.isActive(to, params, query);
  }
828873
function setActiveUser (user) {
    var button = $('<button>')
                    .addClass ('btn btn-default')
                    .attr ('data-toggle', 'tooltip')
                    .attr ('data-placement', 'bottom')
                    .attr ('title', user.id)
                    .attr ('id', 'active-user-' + user.id)
                    .html ('<span class="glyphicon glyphicon-user" aria-hidden="true"></span>')
                    .css  ('color', user.color);

    $('#active-users-indicator').append (button);
    $('[data-toggle="tooltip"]').tooltip ({
      container: 'body'
    });
  }
1158438
def updateObj(self,event):
        """"""
        
        name=w.objList.get("active")
        w.SearchVar.set(name)
        w.ObjInfo.set(objInfoDict[name])
        return
752486
def enable_data_link(self, instance, link):
        
        req = rest_pb2.EditLinkRequest()
        req.state = 'enabled'
        url = '/links/{}/{}'.format(instance, link)
        self.patch_proto(url, data=req.SerializeToString())
1312142
def apply_with_get_params(params = {})
      base_path = apply_named_params(params)
      get_params = params.reject { |param_name| named_params.values.include?(param_name) }

      get_params.empty? ? base_path : "#{base_path}?#{URI.encode_www_form(get_params)}"
    end
838851
def follow_link(key, options = {})
      if link = links[key = key.to_s]
        response = API.send link[:method], link[:href], options[:body], options
        if resource_class = link[:resource_class]
          response = resource_class.from_response response
          response.attributes[self.class.member_name] = self
        end
        response
      end
    rescue Recurly::API::NotFound
      raise unless resource_class
    end