def login(self): email = ask("Input login email: ") password = ask("Input password: "******"Not find you in the system.") ins = ask("Sign up? (y/n): ") if ins == 'y': self.create_user() else: exit() else: self.current_user = user info("Welcome you, %s" % user.nickname)
def q5(): answer = ask(c.violet + "Are you a sloth?" + c.reset) if answer == "yes": print("OMG YOURE A SLOTH TOO!!!" + c.green + c.reset) return True else: print("Well thats boring" + c.reset)
def q1(): answer = ask("Who is jackssepticeye?") if answer == "A famous youtuber": print("And what a boss he is.") return True print("That is incorrect.") return False
def q4(): answer =ask(c.magenta + 'what is the average life span of a narwhal in years?') if answer == '25-30': print('yes') return True print('no') return False
def do_load(self, context, *args): "usage: load [xml] {replace|update} {<url>|<path>}" if not cib_factory.is_cib_sane(): context.fatal_error("CIB is not valid") if len(args) < 2: context.fatal_error("Expected 2 arguments (0 given)") if args[0] == "xml": if len(args) != 3: context.fatal_error("Expected 3 arguments (%d given)" % len(args)) url = args[2] method = args[1] xml = True else: if len(args) != 2: context.fatal_error("Expected 2 arguments (%d given)" % len(args)) url = args[1] method = args[0] xml = False if method not in ("replace", "update"): context.fatal_error("Unknown method %s" % method) if method == "replace": if options.interactive and cib_factory.has_cib_changed(): if not utils.ask("This operation will erase all changes. Do you want to proceed?"): return False cib_factory.erase() if xml: set_obj = mkset_obj("xml") else: set_obj = mkset_obj() return set_obj.import_file(method, url)
def q3(): answer = ask("Use one word to describe the texture of the unicors magic fur?") if answer.startswith("smile"): print(":)") return True print(":<") return False
def q1(): answer = ask(c.orange + 'WHAT COLOR WERE THE FABILOOS UNICORNS?' + c.reset) if answer == 'pink': print('so nice and purty') return True print('incorect :(======') return False
def q1(): answer = ask(c.red + 'Question 1: What colour are the unicorns?') if answer == "pink": print('And what a lovely color it is') return True print('That is incorrect') return False
def q2(): answer = ask("What are deh Unicorns dancing on?") if answer.startswith("rainbow"): print(derpynessrules.yellow + "Correct! You got it right. Now try to get the next one right!") return True print(derpynessrules.blue + "Oh no! You got it wrong! Try it again.") return False
def do_delete(self, arg): """Deletes the user, upon confirmation from the user.""" if utils.ask("Are you sure you want to delete {0}?".format( self.user.firstName)): self.book.removeUser(user=self.user) return True
def q3(): answer = ask(c.red + 'Question 3: Please use one word to describe the texture of their magical fur?') if answer == "smiles": print('It feels wonderful on your skin' + c.clear) return True print('That is incorrect' + c.clear) return False
def q1(): answer = ask('What is the name of our country?') if answer == 'USA': print('We honer our country.') return True print('That is incorrect.') return False
def q3(): answer = ask('How many states are in our country?') if answer == '50': print('There is so many states!') return True print('That is incorrect.') return False
def q2(): answer = ask('Who was our first presendent?') if answer == 'George Washington': print('It is so soft.') return True print('That is incorrect.') return False
def set_deep_meta_attr_node(target_node, attr, value): nvpair_l = [] if xmlutil.is_clone(target_node): for c in target_node.iterchildren(): if xmlutil.is_child_rsc(c): rm_meta_attribute(c, attr, nvpair_l) if config.core.manage_children != "never" and \ (xmlutil.is_group(target_node) or (xmlutil.is_clone(target_node) and xmlutil.cloned_el(target_node) == "group")): odd_children = get_children_with_different_attr(target_node, attr, value) for c in odd_children: if config.core.manage_children == "always" or \ (config.core.manage_children == "ask" and utils.ask("Do you want to override %s for child resource %s?" % (attr, c.get("id")))): common_debug("force remove meta attr %s from %s" % (attr, c.get("id"))) rm_meta_attribute(c, attr, nvpair_l, force_children=True) xmlutil.rmnodes(list(set(nvpair_l))) # work around issue with pcs interoperability # by finding exising nvpairs -- if there are any, just # set the value in those. Otherwise fall back to adding # to all meta_attributes tags nvpairs = target_node.xpath("./meta_attributes/nvpair[@name='%s']" % (attr)) if len(nvpairs) > 0: for nvpair in nvpairs: nvpair.set("value", value) else: for n in xmlutil.get_set_nodes(target_node, "meta_attributes", 1): xmlutil.set_attr(n, attr, value) return True
def q3(): answer = ask("Use one word to descride their magical fur?") if answer.startswith("smiles"): print(derpynessrules.yellow + "Correct! You got it right. This is the end of this quiz YEAH!:)") return True print(derpynessrules.blue + "Oh no! You got it wrong! Try it again.:<") return False
def _gitflow_release_finish(self): if self.data['tag_already_exists']: return cmd = self.vcs.cmd_gitflow_release_finish(self.data['version']) print cmd if utils.ask("Run this command"): print utils.execute_command(cmd)
def q1(): answer = ask("What color are deh Unicorns?") if answer == "pink": print(derpynessrules.yellow + "Correct! You got it right. Now try to get the next one right!") return True print(derpynessrules.blue + "Oh no! You got it wrong! Try it again.") return False
def _gitflow_release_start(self): logger.info('Location: ' + utils.execute_command('pwd')) self.vcs.gitflow_check_branch("develop", switch=True) cmd = self.vcs.cmd_gitflow_release_start(self.data['new_version']) print cmd if utils.ask("Run this command"): print utils.execute_command(cmd)
def run(self): """run the demo""" #render the initial scene self.world.render() #run the simulation done = False while not done: if (self.world.multi_agent_mode and 'human' in [agent.name for agent in self.world.agent]) or \ (not self.world.multi_agent_mode and self.world.agent.name == 'human'): # single step at a time done = self.step() else: # run some number of steps num_steps = ask( 'maximum number of steps to execute, or q to quit:', default=1, choices=[Number, 'q'], num_type=int) if num_steps == 'q': done = True else: for _ in xrange(num_steps): done = self.step() if done: break #display the result and end the simulation print '%s finished at time %d' % (self._name, self.world.time) print 'total reward: %s' % (self.world.total_reward) #end the world, possibly after confirmation if not self._end_prompt or askyn('end the world?', default=True): self.end()
def q2(): answer = ask(c.magenta + 'are narwhals swaggy?') if answer == 'yes': print('yes') return True print('u make me sad :(=======') return False
def q1(): answer = ask("What wool color does white wool and pink dye make?") if answer == "pink": print("Good job") return True print("that is incorrect.") return False
def q3(): answer = ask("Use one word that would describe the unicorns magical fur?") if answer.startswith("smile"): print(":)") return True print(":<") return False
def q2(): answer = ask("How many letters on a keyboard?") if answer == "26": print("Super.") return True print("Nope") return False
def do_use(self, context, name='', withstatus=''): "usage: use [<shadow_cib>] [withstatus]" # check the name argument if name and not utils.is_filename_sane(name): context.fatal_error("Bad filename: " + name) if name and name != "live": if not os.access(xmlutil.shadowfile(name), os.F_OK): context.fatal_error("%s: no such shadow CIB" % name) if withstatus and withstatus != "withstatus": context.fatal_error("Expected 'withstatus', got '%s'" % (withstatus)) # If invoked from configure # take special precautions if not context.previous_level_is("cibconfig"): return self._use(name, withstatus) if not cib_factory.has_cib_changed(): ret = self._use(name, withstatus) # new CIB: refresh the CIB factory cib_factory.refresh() return ret saved_cib = utils.get_cib_in_use() self._use(name, '') # don't load the status yet if not cib_factory.is_current_cib_equal(silent=True): # user made changes and now wants to switch to a # different and unequal CIB; we refuse to cooperate context.error_message("the requested CIB is different from the current one") if config.core.force: context.info("CIB overwrite forced") elif not utils.ask("All changes will be dropped. Do you want to proceed?"): self._use(saved_cib, '') # revert to the previous CIB return False return self._use(name, withstatus) # now load the status too
def q3(): answer = ask("What number is this:1000000?") if answer == "1 million": print(":)") return True print(":<") return False
def q2(): answer = ask("What game dous he play most?") if answer.startswith("Happy Wheels"): print("But isn't that physically impossible? Oh well.") return True print("Nope.") return False
def q1(): answer1 = ask( '''If you had three apples and four oranges in one hand and four apples and three oranges in the other hand, what would you have?''') if answer1.startswith("b"): return True return False
def q1(): answer = ask("What is the hardest color to get?") if answer == "black": print(":)") return True print(":<") return False
def q2(): answer = ask('What texture were the unicorns?') if answer == 'cotton': print('It is so soft.') return True print('That is incorrect.') return False
def do_weak_bond(self, context, *nodes): ''' Create a 'weak' colocation: Colocating a non-sequential resource set with a dummy resource which is not monitored creates, in effect, a colocation which does not imply any internal relationship between resources. ''' if len(nodes) < 2: context.fatal_error("Need at least two arguments") for node in nodes: obj = cib_factory.find_object(node) if not obj: context.fatal_error("Object not found: %s" % (node)) if not xmlutil.is_primitive(obj.node): context.fatal_error("Object not primitive: %s" % (node)) constraint_name = self.make_unique_name('place-constraint-') dummy_name = self.make_unique_name('place-dummy-') print "Create weak bond / independent colocation" print "The following elements will be created:" print " * Colocation constraint, ID: %s" % (constraint_name) print " * Dummy resource, ID: %s" % (dummy_name) if not utils.can_ask() or utils.ask("Create resources?"): cib_factory.create_object('primitive', dummy_name, 'ocf:heartbeat:Dummy') colo = ['colocation', constraint_name, 'inf:', '('] colo.extend(nodes) colo.append(')') colo.append(dummy_name) cib_factory.create_object(*colo)
def q3(): answer = ask('What were the unicorns doing?') if answer == 'dancing': print('Dancing is so much FUN!') return True print('That is incorrect.') return False
def delete(self, snapshot: str=None, **kwargs: dict): if snapshot: utils.pend("delete snapshot %s" % kwargs['name[:snapshot]']) if snapshot not in self.snapshots: utils.fail("%s: snapshot does not exist" % kwargs['name[:snapshot]']) exit(1) try: os.unlink('%s.%s' % (self.path_raw, snapshot)) utils.ok() except PermissionError: utils.fail("Permission denied") exit(1) else: if not os.path.isdir(self.path): utils.fail("%s: VM does not exist" % self.name) exit(1) if not utils.ask("Delete VM %s?" % self.name, default=False): exit(1) utils.pend("delete %s" % self.name) try: shutil.rmtree(self.path) utils.ok() except PermissionError: utils.fail("Permission denied") exit(1)
def q1(): answer = ask('What are the color of the unicorns?') if answer == 'pink': print('And what a lovely color it is.') return True print('That is incorrect.') return False
def q2(): answer = ask("What are the unicors dancing on?") if answer.startswith("rainbow"): print("But isn't that physically impossible? Oh well.") return True print("Nope.") return False
def q1(): answer = ask("What color are the unicors?") if answer == "pink": print("And what a lovely color it is.") return True print("That is incorrect.") return False
def q2(): answer = ask("What level is the hardest of them all?") if answer.startswith("theory of everything 2"): print(":)") return True print(":<") return False
def q2(): answer = ask(c.magenta + 'WHAT WERE THE UNICORNS DANCING ON?') if answer.startswith('rainbows'): print('also so nice an purty') return True print('u make me sad :(=======') return False
def q3(): answer = ask("Can you use one word to describe how awesome Geomtry dash is?") if answer.startswith("epic"): print(":)") return True print(":<") return False
def check_authentication(self): if self.conn is None: self.connect() self.cursor.execute("SELECT host, user FROM mysql.user") weak_passwords = utils.get_weak_passwords() for u in self.cursor.fetchall(): if "%" in u[0]: logs.WARN(f"User {u[1]} is exposed to the internet (0.0.0.0)") else: if utils.is_internal(u[0]): continue else: logs.WARN(f"User {u[1]} is exposed to external IP {u[0]}") if utils.ask("Would you like to perform weak-password check? This may create high traffic load " "for MySQL server. (i.e. Do not perform this when there is already high traffic.)"): flag = True for password in weak_passwords: try: conn = pymysql.connect(host=self.__host, user=u[1], passwd=password, port=self.__port) logs.WARN(f"Weak password {password} set by user {u[1]} with host {u[0]}") conn.close() flag = False break except pymysql.err.OperationalError: pass except pymysql.err.InternalError as e: pass if flag: logs.DEBUG(f"No weak password is used by user {u[1]} with host {u[0]}")
def q3(): answer =ask(c.magenta + 'should narwhals be the dominant species of the world?') if answer == 'yes': print('yyyeeeeeaaaahhhh') return True print('eradicate from the world, }:(========') return False
def q1(): answer = ask(c.orange + 'What are the swaggiest animals ever?' + c.reset) if answer =='narwhals': print('so nice and purty') return True print('incorect :(======') return False
def do_use(self, context, name='', withstatus=''): "usage: use [<shadow_cib>] [withstatus]" # check the name argument if name and not utils.is_filename_sane(name): context.fatal_error("Bad filename: " + name) if name and name != "live": if not os.access(xmlutil.shadowfile(name), os.F_OK): context.fatal_error("%s: no such shadow CIB" % name) if withstatus and withstatus != "withstatus": context.fatal_error("Expected 'withstatus', got '%s'" % (withstatus)) # If invoked from configure # take special precautions if not context.previous_level_is("cibconfig"): return self._use(name, withstatus) if not cib_factory.has_cib_changed(): ret = self._use(name, withstatus) # new CIB: refresh the CIB factory cib_factory.refresh() return ret saved_cib = utils.get_cib_in_use() self._use(name, '') # don't load the status yet if not cib_factory.is_current_cib_equal(silent=True): # user made changes and now wants to switch to a # different and unequal CIB; we refuse to cooperate context.error_message( "the requested CIB is different from the current one") if config.core.force: context.info("CIB overwrite forced") elif not utils.ask( "All changes will be dropped. Do you want to proceed?"): self._use(saved_cib, '') # revert to the previous CIB return False return self._use(name, withstatus) # now load the status too
def set_deep_meta_attr_node(target_node, attr, value): nvpair_l = [] if xmlutil.is_clone(target_node): for c in target_node.iterchildren(): if xmlutil.is_child_rsc(c): rm_meta_attribute(c, attr, nvpair_l) if config.core.manage_children != "never" and \ (xmlutil.is_group(target_node) or (xmlutil.is_clone(target_node) and xmlutil.cloned_el(target_node) == "group")): odd_children = get_children_with_different_attr(target_node, attr, value) for c in odd_children: if config.core.manage_children == "always" or \ (config.core.manage_children == "ask" and utils.ask("Do you want to override %s for child resource %s?" % (attr, c.get("id")))): common_debug("force remove meta attr %s from %s" % (attr, c.get("id"))) rm_meta_attribute(c, attr, nvpair_l, force_children=True) xmlutil.rmnodes(list(set(nvpair_l))) xmlutil.xml_processnodes(target_node, xmlutil.is_emptynvpairs, xmlutil.rmnodes) # work around issue with pcs interoperability # by finding exising nvpairs -- if there are any, just # set the value in those. Otherwise fall back to adding # to all meta_attributes tags nvpairs = target_node.xpath("./meta_attributes/nvpair[@name='%s']" % (attr)) if len(nvpairs) > 0: for nvpair in nvpairs: nvpair.set("value", value) else: for n in xmlutil.get_set_nodes(target_node, "meta_attributes", 1): xmlutil.set_attr(n, attr, value) return True
def q2(): answer = ask("What are the unicorns dancing on?") if answer.startswith("rainbow"): print(":)") return True print(":<") return False
def q3(): answer = ask("Use one word to describe the texture of their magical fur?") if answer.startswith("smile"): print(":)") return True print(":<") return False
def __init__(self, path: str, *args): self.vars = self.parse_vars(args) self.bwd = Path(path) self.name = self.bwd.parts[-1] if not self.bwd.exists(): if ask('Path does not exist. Create?') == 'y': self.new_box()
def q1(): answer = ask("What color are the unicorns?") if answer == "pink": print(":)") return True print(":<") return False
def q2(): 7 = ask('how much damige does a diamond sowrd do im in the bad spellers club') if rainbows.startswith("7"): print('good job!!!!!!!!!!!!!!!') return True return False
def q1(): a1 = ask('What color are the unicorns?') if 'pink' in a1: yes() return True no() return False
def q3(): answer = ask("What famous youtuber made a shoutout to him") if answer.startswith("pewdipie"): print(":)") return True print(":<") return False
def q2(): a2 = ask('Where are they dancing?') if 'rainbows' in a2: yes() return True no() return False
def q3(): answer = ask("What is in the end?") if answer.startswith("enderd"): print(":)") return True print(":<") return False