def main(): l = helpers.list_from_array([3, 5, 8, 5, 10, 2, 1]) helpers.print_list(l) num = 5 print(num) # partition(l, num) helpers.print_list(alternative(l, 5))
def conf(): if cfg_files: log.info("Following config files were read:") helpers.print_list(cfg_files) else: log.info("No rdopkg config files found, using default config:") log.info("") for item in cfg.items(): log.info("%s: %s" % item)
def main(): l_617 = helpers.list_from_array([7, 1, 6]) l_295 = helpers.list_from_array([5, 9, 2]) helpers.print_list(reverse_sum_lists(l_617, l_295)) l_617 = helpers.list_from_array([6, 1, 7]) l_295 = helpers.list_from_array([2, 9, 5]) helpers.print_list(forward_sum_list(l_617, l_295))
def main(): l = helpers.list_from_array([3, 4, 5, 6, 7, 8, 9, 0]) helpers.print_list(l) curr = l for i in range(3): curr = curr.next print(curr.val) remove_node(curr) helpers.print_list(l)
def upush_summary(update_repo_path, dest_base, update_files, update_fails, temp_path, need_sync=None, debug=False): pusher = pushupdate.UpdatePusher( update_repo_path, dest_base, update_files=update_files, fails=update_fails, temp_path=temp_path, debug=debug ) pusher.print_summary() if need_sync: log.success("Updated trees (might need sync):") helpers.print_list(map(os.path.basename, need_sync), nl_after=True) log.info(log.term.warn("Don't forget to push changes to update repo:")) log.info(update_repo_path) log.info("")
def print_summary(good, fails, good_s, fail_s): n_good = len(good) n_fails = len(fails) n_all = n_good + n_fails if good: log.success("\n%d updates %s:" % (n_good, good_s)) fmt = '{t.bold}{upf}:{t.normal}\n{up}' if len(good[0]) == 2: l = map(lambda x: fmt.format(t=log.term, upf=x[0], up=x[1]), good) else: l = [] for upf, up, builds in good: bstr = '\n'.join(map(str, builds)) l.append(fmt.format(t=log.term, upf=upf, up=bstr)) helpers.print_list(l) if fails: log.error("\n%s updates %s:" % (n_fails, fail_s)) fmt = "{t.warn}{upf}:{t.normal} {err}" l = map(lambda x: fmt.format(t=log.term, upf=x[0], err=str(x[1])), fails) helpers.print_list(l)
def main(): l = helpers.list_from_array([1, 1, 4, 5, 6, 7, 7, 3, 4, 6, 8, 9, 9]) helpers.print_list(l) # helpers.print_list(remove_dups(l)) helpers.print_list(alternative(l))
def list_build_sources(): log.info("Available build sources:") helpers.print_list(sorted(bsource.BuildSource.sources))
def main(): l = helpers.list_from_array(list('gobbbbog')) helpers.print_list(l) print(stack_impl(l))
def main(): l = helpers.input_list() l = solution.reverse_list(l) helpers.print_list(l)