Press R in home view to retrieve quiz list
491256
def reload_list(self):
        ''''''
        self.leetcode.load()
        if self.leetcode.quizzes and len(self.leetcode.quizzes) > 0:
            self.home_view = self.make_listview(self.leetcode.quizzes)
            self.view_stack = []
            self.goto_view(self.home_view)
608328
def answers(self):
        
        from .question import Question
        from .answer import Answer

        if self.url is None or self.answer_num == 0:
            return
        for page_index in range(1, (self.answer_num - 1) // 20 + 2):
            html = self._session.get(
                self.url + 'answers?page=' + str(page_index)).text
            soup = BeautifulSoup(html)
            questions = soup.find_all('a', class_='question_link')
            upvotes = soup.find_all('a', class_='zm-item-vote-count')
            for q, upvote in zip(questions, upvotes):
                answer_url = Zhihu_URL + q['href']
                question_url = Zhihu_URL + re_a2q.match(q['href']).group(1)
                question_title = q.text
                upvote_num = upvote.text
                if upvote_num.isdigit():
                    upvote_num = int(upvote_num)
                else:
                    upvote_num = None
                question = Question(question_url, question_title,
                                    session=self._session)
                yield Answer(answer_url, question, self, upvote_num,
                             session=self._session)
1045888
def list_quizzes_in_course(self, course_id, search_term=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # OPTIONAL - search_term
        """The partial title of the quizzes to match and return."""
        if search_term is not None:
            params["search_term"] = search_term

        self.logger.debug("GET /api/v1/courses/{course_id}/quizzes with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/courses/{course_id}/quizzes".format(**path), data=data, params=params, all_pages=True)
110432
function listRemote(store, attrs) {
      // TODO - Check connection and work on local data if disconnected
      // Replace previous list params from url
      var listObj = {};
      listObj[store.listParam] = JSON.stringify(attrs);
      store.url = vcomet.util.replaceParam(store.url, {
        list: JSON.stringify(attrs)
      });
      // Get request
      StoreRest.restXhr(store, store.url, "onListRemote");
    }
1125414
async def get_home_data(self):
        """"""
        cmd = 'get_home_stats'
        url = self.base_url + cmd
        data = {}
        try:
            async with async_timeout.timeout(8, loop=self._loop):
                request = await self._session.get(url)
                response = await request.json()
                for stat in response.get('response', {}).get('data', {}):
                    if stat.get('stat_id') == 'top_movies':
                        try:
                            row = stat.get('rows', {})[0]
                            data['movie'] = row.get('title')
                        except (IndexError, KeyError):
                            data['movie'] = None
                    if stat.get('stat_id') == 'top_tv':
                        try:
                            row = stat.get('rows', {})[0]
                            data['tv'] = row.get('title')
                        except (IndexError, KeyError):
                            data['tv'] = None
                    if stat.get('stat_id') == 'top_users':
                        try:
                            row = stat.get('rows', {})[0]
                            data['user'] = row.get('user')
                        except (IndexError, KeyError):
                            data['user'] = None
            logger("Status from Tautulli: " + str(request.status))
            self.tautulli_home_data = data
            logger(self.tautulli_home_data)

        except (asyncio.TimeoutError, aiohttp.ClientError, socket.gaierror,
                AttributeError) as error:
            msg = "Can not load data from Tautulli: {} - {}".format(url, error)
            logger(msg, 40)
976352
public void clickOnActionBarHomeButton() {
		Activity activity = activityUtils.getCurrentActivity();
		MenuItem homeMenuItem = null;

		try {
			Class<?> cls = Class.forName("com.android.internal.view.menu.ActionMenuItem");
			Class<?> partypes[] = new Class[6];
			partypes[0] = Context.class;
			partypes[1] = Integer.TYPE;
			partypes[2] = Integer.TYPE;
			partypes[3] = Integer.TYPE;
			partypes[4] = Integer.TYPE;
			partypes[5] = CharSequence.class;
			Constructor<?> ct = cls.getConstructor(partypes);
			Object argList[] = new Object[6];
			argList[0] = activity;
			argList[1] = 0;
			argList[2] = android.R.id.home;
			argList[3] = 0;
			argList[4] = 0;
			argList[5] = "";
			homeMenuItem = (MenuItem) ct.newInstance(argList);
		} catch (Exception ex) {
			Log.d(LOG_TAG, "Can not find methods to invoke Home button!");
		}

		if (homeMenuItem != null) {
			try{
				activity.getWindow().getCallback().onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL, homeMenuItem);
			}catch(Exception ignored) {}
		}
	}
944421
def _select_list(self, model=None, queryview=None, queryform=None,
                     auto_condition=True,
                     post_view=None, post_run=None, **kwargs):
        
        from uliweb import request, json
        from uliweb.utils.generic import get_sort_field
        import copy

        condition = None
        if queryview and auto_condition:
            queryview.run()
            if hasattr(queryview, 'get_condition'):
                condition = queryview.get_condition()

        if 'condition' in kwargs:
            condition = kwargs['condition'] & condition

        kwargs['condition'] = condition

        #process order
        if 'order_by' not in kwargs:
            order_by = get_sort_field(model)
            if order_by is not None:
                kwargs['order_by'] = order_by

        _fields = copy.copy(kwargs.get('fields_convert_map', []))
        self._process_fields_convert_map(kwargs)
        downloads = self._parse_download_args(kwargs, _fields)
        self._process_fields_convert_map(downloads, download=True)

        view = self._select_list_view(model, **kwargs)

        if post_view:
            post_view(view)

        if 'data' in request.values:
            return json(view.json())
        elif 'download' in request.GET:
            return view.download(**downloads)
        else:
            result = view.run()
            if queryform or queryview:
                result.update({'query_form':queryform or queryview.form})
            else:
                result.update({'query_form':''})
            result.update({'table':view})

            if post_run:
                post_run(view, result)
            return result
756081
private void rechecksqlistpl()
    {
    	if(data != null)
    	{
    		Node[] childrens = ((SimpleNode)data).getChildren();
    		if(childrens != null && childrens.length > 0)
    		{
    			boolean switchcase = true;
    			for(Node node:childrens)
    			{
    				if(!(node instanceof ASTText))
    				{
    					switchcase = false;
    					break;
    				}
    			}
    			if(switchcase)
    			{
    				this.esInfo.setTpl(false);
    				 
    			}
    			else
    			{
    				this.esInfo.setTpl(true);
    			}
    		}
    		
    	}
    }
917771
def _querystring(self):
        """"""

        kw = {"studyoid": self.studyoid}
        if self.location_oid is not None:
            kw["locationoid"] = self.location_oid
        return kw
1124804
function () {
      var done = this.async();
      var questions = [];

      // Project name
      if (typeof this.preset.name === 'undefined' || this.preset.name === '') {
        questions.push({
          type: 'input',
          name: 'name',
          message: 'Project Name',
          default: this.settings.name || _s.titleize(this.appname)
        });
      }

      // Feature options
      options.forEach(function (option) {
        var question;
        var name = option.name;
        var type = option.type;
        if (typeof this.preset[name] === 'undefined') {
          switch (type) {
            case 'list':
              question = _.pick(option, 'name', 'message', 'type');
              question.choices = _.map(option.choices, function (choice) {
                var data = _.pick(choice, 'name', 'value', 'disabled');
                return data;
              }.bind(this));
              question.default = this.settings[name];
              break;
            case 'checkbox':
              question = _.pick(option, 'name', 'message', 'type', 'validate');
              question.choices = _.map(option.choices, function (choice) {
                var data = _.pick(choice, 'name', 'value', 'disabled');
                data.checked = _.includes(this.settings[name], data.value);
                return data;
              }.bind(this));
              break;
          }
          questions.push(question);
        }
      }.bind(this));

      // Save config or not
      if (this.configType === 'custom') {
        questions.push({
          type: 'confirm',
          name: 'store',
          message: 'Do you want to save this config to .yo-rc.json?',
          default: false
        });
      }

      this.prompt(questions, function (answers) {
        // Finalize generator settings
        this.settings.name = typeof answers.name !== 'undefined' ? answers.name : this.preset.name;
        this.store = answers.store || false;
        options.forEach(function (option) {
          var name = option.name;
          this.settings[name] = answers[name] || this.preset[name];
        }.bind(this));

        done();
      }.bind(this));
    }
1020666
def register_view(self, view):
        """"""
        super(ListViewController, self).register_view(view)
        self.tree_view.connect('button_press_event', self.mouse_click)
717095
def get_declared_items(self):
        
        for k, v in super(AndroidListView, self).get_declared_items():
            if k == 'layout':
                yield k, v
                break
1204238
def getSNPSetsList() :
	""""""
	import rabaDB.filters as rfilt
	f = rfilt.RabaQuery(SNPMaster)
	names = []
	for g in f.iterRun() :
		names.append(g.setName)
	return names
1331423
def QueryHowDoI(Query, num_answers, full_text):
    '''
    
    '''
    howdoi_command = HOW_DO_I_COMMAND
    full_text_option = ' -a' if full_text else ''
    t = subprocess.Popen(howdoi_command + ' \"'+ Query + '\" -n ' + str(num_answers)+full_text_option, stdout=subprocess.PIPE)
    (output, err) = t.communicate()
    print('{:^88}'.format(Query.rstrip()))
    print('_'*60)
    print(output.decode("utf-8") )
    exit_code = t.wait()
577263
def list(self,header,choices):
        ""

        if not self.__list_window:
            (y,x)=self.__main.getmaxyx()
            self.__list_window = self.__main.subwin(35,x,0,0)
            
        _lw=self.__list_window


        _lw.keypad(1)
        (y_max,x_max)=_lw.getmaxyx()
        (y_0, x_0)=_lw.getbegyx()
        x_start=1+x_0
        _lw.box()
        ## Number of list items allowed.
        ### first entry in the list appears at page_top
        page_top=y_0+2
        ### the last entry display will be at page_bottom
        page_bottom = y_max-2

        ### break the list into chunks.
        max_items_per_page = page_bottom-page_top

        ### start at the top of the list
        top_item=0
        f=open('log.msg','w')
        first_item=page_top
        current_item=0
        item_list=[]
        while 1:
            _lw.erase()
            _lw.box()
            _lw.addstr(page_top-1,x_start,header)
            if top_item > len(choices):
                top_item=0
            for i in range(max_items_per_page):
                item=i+top_item
                if not item in range(len(choices)):
                    break
                _lw.addstr(i+page_top,x_start,choices[item])
            ### provide a hint that there is more info in the list
            ### setup where we are in the list
            last_item=item
            if top_item > 0 :
                _lw.addstr(page_bottom,x_start,"P(revious)")
            if last_item < len(choices):
                _lw.addstr(page_bottom,x_max-8,"N(ext)")
            while 1:
                c=_lw.getch(current_item-top_item+page_top,x_start)
                if c==curses.KEY_UP:
                    current_item=current_item-1
                elif c==curses.KEY_DOWN:
                    current_item=current_item+1
                elif c==ord(' '):
                    if current_item in item_list:
                        _lw.addstr(choices[current_item])
                        item_list.remove(current_item)
                    else:
                        _lw.addstr(choices[current_item],curses.A_REVERSE)
                        item_list.append(current_item)
                elif c==ord('P'):
                    top_item=top_item-max_items_per_page
                    current_item=top_item
                    break
                elif c==ord('N'):
                    top_item=top_item + max_items_per_page
                    current_item=top_item
                    break
                elif c==10:
                    return(item_list)
                elif c==ord('q'):
                    _lw.erase()
                    return(None)
		elif c==ord('x'):
		    choices[current_item]=choices[current_item][:4]+" "+choices[current_item][5:]
                    _lw.addstr(choices[current_item])
		else:
		    choices[current_item]=choices[current_item][:7]+chr(c).capitalize()+choices[current_item][8:]
                    _lw.addstr(choices[current_item])

                if current_item > last_item-1:
                    if last_item < len(choices):
                        top_item = top_item+1
                        break
                    else:
                        current_item=current_item-1
                if current_item < top_item :
                    if top_item > 0:
                        top_item = top_item-1
                        break
                    else:
                        current_item=current_item+1
551770
function viewListReady(list, error) {
        if (typeof error != 'undefined') {
          callback(error);
          return;
        }
        if (!list.moveFirst()) {
          callback(Error('no records!'));
          return;
        }

        var set = new self.StoogeSet();
        var stooge = new self.Stooge();
        self.shouldBeTrue('indoor' == list.get(set.modelType + '.' + 'name'));
        self.shouldBeTrue('1' == list.get('Scene'));
        self.shouldBeTrue('Moe' == list.get(stooge.modelType + '.' + 'name'));
        self.shouldBeTrue('To be or not to be?' == list.get('Line'));
        if (!list.moveNext()) {
          callback(Error('no more records!'));
          return;
        }
        self.shouldBeTrue('desert' == list.get(set.modelType + '.' + 'name'));
        self.shouldBeTrue('2' == list.get('Scene'));
        self.shouldBeTrue('Larry' == list.get(stooge.modelType + '.' + 'name'));
        self.shouldBeTrue('That is the question!' == list.get('Line'));
        callback(true);
      }
251462
private void forceWebViewToReloadManually(int retry) {

    boolean ok = false;
    setMode(WorkingMode.Native);
    for (int i = 0; i < retry; i++) {

      try {
        // to get Safari out of his home page and become responsive we need to click
        // on one of the home icons, click on the "about:blank" we added in prefs
        WebElement
            b =
            getNativeDriver().findElement(By.xpath("//UIAWindow/UIAScrollView/UIAButton"));
        b.click();

//        // click on the Go! button on the keyboard
//        log.fine("clicking on about:blank button: " + i);
//        Criteria c = new AndCriteria(new NameCriteria("Go"), new TypeCriteria(UIAButton.class));
//        UIAButton go = getNativeDriver().findElement(c);
//        go.click();
        ok = true;
      } catch (WebDriverException e) {
        sleep(2000); // allow some time to take effect
        // else keep trying as sometimes the click doesn't take effect on slow machines
        log.fine("about:blank button gone, proceeding");
        break;
      }
    }

    if (!ok) {
      log.warning("Couldn't find button after "+retry+"retries.");
      throw new RecoverableCrashException(
          "coudln't find the about:blank button after " + retry + " retries.");
    }
    setMode(WorkingMode.Web);
  }