Function for printing the menu

    Keyword arguments:
    place -- name of the cafeteria / mensa
    static -- set true if a static menu exists (default: False)
337296
def print_menu(place, static=False):
    
    day = get_day()
    if static:
        plan = get(FILES[1])
        for meal in plan["weeks"][0]["days"][day][place]["meals"]:
            if place == "Diner":
                print(meal["category"] + " " + meal["meal"])
            else:
                print(meal["category"] + ": " + meal["meal"])
    else:
        plan = get(FILES[0])
        for meal in plan["weeks"][0]["days"][day][place]["meals"]:
            print(meal["category"] + ": " + meal["meal"])
756311
def _prompt_placement(D, tt):
    
    _model_name = ""
    # There wasn't a table name match, so we need prompts to fix it
    _placement_options = _get_available_placements(D, tt)
    print("Please choose where you'd like to place this model:")
    for _idx, _opt in enumerate(_placement_options):
        print("({}) {}".format(_idx, _opt))
    _choice = input("> ")
    try:
        if int(_choice) <= len(_placement_options) and _choice:
            # Get the option the user chose
            _model_name = _placement_options[int(_choice)]
        else:
            # They user chose an option out of the placement list range
            print("Invalid choice input")
            return
    except Exception as e:
        # Choice was not a number or empty
        print("Invalid choice")

    return _model_name
552933
def menu_daily(self, building_id):
        
        today = str(datetime.date.today())
        v2_response = DiningV2(self.bearer, self.token).menu(building_id, today)
        response = {'result_data': {'Document': {}}}
        response["result_data"]["Document"]["menudate"] = datetime.datetime.strptime(today, '%Y-%m-%d').strftime('%-m/%d/%Y')
        if building_id in VENUE_NAMES:
            response["result_data"]["Document"]["location"] = VENUE_NAMES[building_id]
        else:
            response["result_data"]["Document"]["location"] = v2_response["result_data"]["days"][0]["cafes"][building_id]["name"]
        response["result_data"]["Document"]["tblMenu"] = {"tblDayPart": get_meals(v2_response, building_id)}
        return response
1090950
def chooser_menu():
    
    title = TITLE + "The" + Colors.ORANGE + " Metal" + Colors.RESET + TITLE + " Menu" + RESET
    menu = """
        ________________________________________________________________

            """ + title + """
        ________________________________________________________________


                ( """ + TITLE + "a" + RESET + """ ) :  Install RKhunter Rootkit Scanner (v1.6)

                ( """ + TITLE + "b" + RESET + """ ) :  Install Chkrootkit Rootkit Scanner (latest)

                ( """ + TITLE + "c" + RESET + """ ) :  Run RKhunter Scan of Local Machine

                ( """ + TITLE + "d" + RESET + """ ) :  Run Chkrootkit Scan of Local Machine

    """
    print(menu)
    answer: str = input("\t\tEnter Choice [quit]:  ") or ''

    if answer == 'a':
        return rkhunter()

    elif answer == 'b':
        print('\t\nrun chkrootkit installer\n')
        return chkrootkit.main()

    elif answer == 'c':
        print('\t\nrun rkhunter scan of local machine\n')

    elif answer == 'd':
        return chkrootkit_exec()
    return True
158236
def add_menu(self, name):
        
        if name in self._menus:
            raise exceptions.MenuAlreadyExists("Menu name {!r} already exists.".format(name))
        menu = self._menu.addMenu(name)
        self._menus[name] = menu
421107
public boolean printToolbarData(boolean bFieldsFound, PrintWriter out, int iHtmlAttributes)
    {
        int iNumCols = ((ToolScreen)this.getScreenField()).getSFieldCount();
        for (int iIndex = 0; iIndex < iNumCols; iIndex++)
        {
            ScreenField sField = ((ToolScreen)this.getScreenField()).getSField(iIndex);
            if (sField.getConverter() == null)
                if (sField instanceof SCannedBox)
            {
                SCannedBox button = (SCannedBox)sField;   // Found the toolscreen
                String strCommand = button.getButtonCommand();
                if (strCommand.equalsIgnoreCase(MenuConstants.BACK))
                { // Ignore back for HTML
                }
                else if (strCommand.equalsIgnoreCase(MenuConstants.HELP))
                { // Ignore help for HTML
                }
                else if (strCommand.equalsIgnoreCase(MenuConstants.RESET))
                {   // Special case - for reset do an HTML reset
                    out.println("<input type=\"Reset\"/>");
                    bFieldsFound = false; // Don't need Submit/Reset button
                }
                else if ((strCommand.equalsIgnoreCase(MenuConstants.FIRST))
                        || (strCommand.equalsIgnoreCase(MenuConstants.PREVIOUS))
                        || (strCommand.equalsIgnoreCase(MenuConstants.NEXT))
                        || (strCommand.equalsIgnoreCase(MenuConstants.LAST))
                        || (strCommand.equalsIgnoreCase(MenuConstants.SUBMIT))
                        || (strCommand.equalsIgnoreCase(MenuConstants.DELETE)))
                { // Valid command - send it as a post command
                    out.println("<input type=\"submit\" name=\"" + DBParams.COMMAND + "\" value=\"" + strCommand + "\"/>");
                    bFieldsFound = false; // Don't need Submit button
                }
                else if (strCommand.equalsIgnoreCase(MenuConstants.FORM))
                { // Valid command - send it as a post command
                    if (this.getMainRecord() != null)
                    {
                        String strRecord = this.getMainRecord().getClass().getName().toString();
                        String strLink = "?" + DBParams.RECORD + "=" + strRecord + "&" + DBParams.COMMAND + "=" + MenuConstants.REFRESH;
                        out.println("<input type=\"button\" value=" + strCommand + " onclick=\"window.open('" + strLink + "','_top');\"/>");
                    }
                }
                else if (strCommand.equalsIgnoreCase(MenuConstants.LOOKUP))
                { // Valid command - send it as a post command
                    if (this.getMainRecord() != null)
                    {
                        String strRecord = this.getMainRecord().getClass().getName().toString();
                        String strLink = "?" + DBParams.RECORD + "=" + strRecord;
                        out.println("<input type=\"button\" value=\"Lookup\" onclick=\"window.open('" + strLink + "','_top');\"/>");
                    }
                }
                else
                { // Valid command - send it as a post command
                    //+ Add code here to process a doCommand(xxx)
                }
            }
        }
        String strCommand = MenuConstants.SUBMIT;
        if (this.getScreenField().getParentScreen() instanceof GridScreen)
        {
            strCommand = MenuConstants.LOOKUP;
            if (this.getScreenField().getParentScreen().getEditing())
                bFieldsFound = true;        // Need these buttons for grid input
        }
        if (bFieldsFound)
        {
            out.println("<input type=\"submit\" name=\"" + DBParams.COMMAND + "\" value=\"" + strCommand + "\"/>");
            out.println("<input type=\"Reset\"/>");
        }
        return bFieldsFound;
    }
720229
def createMenu( self ):
        
        name, accepted = QInputDialog.getText( self,
                                               'Create Menu',
                                               'Name: ')
        
        if ( accepted ):
            self.addMenuItem(self.createMenuItem(name), 
                             self.uiMenuTREE.currentItem())
147396
private void syncMenu() {
        if (bugInstance != null) {
            isBugItem.setEnabled(true);
            notBugItem.setEnabled(true);

            BugProperty isBugProperty = bugInstance.lookupProperty(BugProperty.IS_BUG);
            if (isBugProperty == null) {
                // Unclassified
                isBugItem.setSelection(false);
                notBugItem.setSelection(false);
            } else {
                boolean isBug = isBugProperty.getValueAsBoolean();
                isBugItem.setSelection(isBug);
                notBugItem.setSelection(!isBug);
            }
        } else {
            // No bug instance, so uncheck and disable the menu items
            if (DEBUG) {
                System.out.println("No bug instance found, disabling menu items");
            }
            isBugItem.setEnabled(false);
            notBugItem.setEnabled(false);
            isBugItem.setSelection(false);
            notBugItem.setSelection(false);
        }
    }
728584
def lunch(rest):
	""
	rs = rest.strip()
	if not rs:
		return "Give me an area and I'll pick a place: (%s)" % (
			', '.join(list(pmxbot.config.lunch_choices)))
	if rs not in pmxbot.config.lunch_choices:
		return "I didn't recognize that area; here's what i have: (%s)" % (
			', '.join(list(pmxbot.config.lunch_choices)))
	choices = pmxbot.config.lunch_choices[rs]
	return random.choice(choices)
218811
def print_menuconfig(kconf):
    
    # Print the expanded mainmenu text at the top. This is the same as
    # kconf.top_node.prompt[0], but with variable references expanded.
    print("\n======== {} ========\n".format(kconf.mainmenu_text))

    print_menuconfig_nodes(kconf.top_node.list, 0)
    print("")
250504
def addAboutMenu(menuName, parentMenuFunction=None):
    '''
    
    '''

    parentMenuFunction = parentMenuFunction or iface.addPluginToMenu
    namespace = _callerName().split(".")[0]
    icon = QtGui.QIcon(os.path.join(os.path.dirname(os.path.dirname(__file__)), "icons", "help.png"))
    aboutAction = QtWidgets.QAction(icon, "About...", iface.mainWindow())
    aboutAction.setObjectName(namespace + "about")
    aboutAction.triggered.connect(lambda: openAboutDialog(namespace))
    parentMenuFunction(menuName, aboutAction)
    global _aboutActions
    _aboutActions[menuName] = aboutAction
297821
def menu(self, event_button, event_time, data=None):
        
        self.sub_menu()
        menu = gtk.Menu()
        menu.append(self.daemon)

        separator = gtk.SeparatorMenuItem()

        menu_Check = gtk.ImageMenuItem("Check updates")
        img_Check = gtk.image_new_from_stock(gtk.STOCK_OK,
                                             gtk.ICON_SIZE_MENU)
        img_Check.show()

        menu_Info = gtk.ImageMenuItem("OS Info")
        img_Info = gtk.image_new_from_stock(gtk.STOCK_INFO,
                                            gtk.ICON_SIZE_MENU)
        img_Info.show()

        menu_About = gtk.ImageMenuItem("About")
        img_About = gtk.image_new_from_stock(gtk.STOCK_ABOUT,
                                             gtk.ICON_SIZE_MENU)
        img_About.show()

        self.daemon.set_image(self.img_daemon)
        menu.append(self.daemon)
        self.daemon.show()

        menu_Quit = gtk.ImageMenuItem("Quit")
        img_Quit = gtk.image_new_from_stock(gtk.STOCK_QUIT, gtk.ICON_SIZE_MENU)
        img_Quit.show()

        menu_Check.set_image(img_Check)
        menu_Info.set_image(img_Info)
        menu_About.set_image(img_About)
        menu_Quit.set_image(img_Quit)

        menu.append(menu_Check)
        menu.append(menu_Info)
        menu.append(separator)
        menu.append(menu_About)
        menu.append(menu_Quit)

        separator.show()
        menu_Check.show()
        menu_Info.show()
        menu_About.show()
        menu_Quit.show()

        menu_Check.connect_object("activate", self._Check, " ")
        menu_Info.connect_object("activate", self._Info, "OS Info")
        menu_About.connect_object("activate", self._About, "SUN")
        self.start.connect_object("activate", self._start, "Start daemon   ")
        self.stop.connect_object("activate", self._stop, "Stop daemon   ")
        self.restart.connect_object("activate", self._restart,
                                    "Restart daemon   ")
        self.status.connect_object("activate", self._status, daemon_status())
        menu_Quit.connect_object("activate", self._Quit, "stop")

        menu.popup(None, None, None, event_button, event_time, data)
39377
def menu_weekly(self, building_id):
        
        din = DiningV2(self.bearer, self.token)
        response = {'result_data': {'Document': {}}}
        days = []
        for i in range(7):
            date = str(datetime.date.today() + datetime.timedelta(days=i))
            v2_response = din.menu(building_id, date)
            if building_id in VENUE_NAMES:
                response["result_data"]["Document"]["location"] = VENUE_NAMES[building_id]
            else:
                response["result_data"]["Document"]["location"] = v2_response["result_data"]["days"][0]["cafes"][building_id]["name"]
            formatted_date = datetime.datetime.strptime(date, '%Y-%m-%d').strftime('%-m/%d/%Y')
            days.append({"tblDayPart": get_meals(v2_response, building_id), "menudate": formatted_date})
        response["result_data"]["Document"]["tblMenu"] = days
        return normalize_weekly(response)
1228635
private boolean locationAwareLog(int level_int, String msgTemplate, Object[] arguments) {
		return locationAwareLog(level_int, null, msgTemplate, arguments);
	}
119944
def __placeSellOrder(self, tick):
        '''  '''
        if self.__position < 0:
            return

        share=self.__position
        order=Order(accountId=self.__strategy.accountId,
                         action=Action.SELL,
                         is_market=True,
                         symbol=self.__symbol,
                         share=-share)
        if self.__strategy.placeOrder(order):
            self.__position=0
            self.__buyPrice=0
1247361
def __placeStopOrder(self, order):
        '''  '''
        orderId=self.__strategy.placeOrder(order)
        if orderId:
            self.__stopOrderId=orderId
            self.__stopOrder=order
        else:
            LOG.error("Can't  %s" % order)
1282576
def showOptionsMenu(self):
        
        point        = QPoint(0, self._optionsButton.height())
        global_point = self._optionsButton.mapToGlobal(point)
        
        # prompt the custom context menu
        if self.optionsMenuPolicy() == Qt.CustomContextMenu:
            if not self.signalsBlocked():
                self.optionsMenuRequested.emit(global_point)
            return
        
        # use the default context menu
        menu = XViewProfileManagerMenu(self)
        menu.exec_(global_point)