original_docstring: Main function of the script.
docstring: Main function of the script.
docstring_tokens: Main function of the script .
code: def search(ctx, search_term):
      """Main function of the script."""
      ark_json = quick_search(search_term)
  
      if len(ark_json) < 1:
          click.echo("Couldn't find any processors matching "
                     "{0}".format(search_term))
          ctx.exit(0)
  
      click.echo(u"Processors found: {0}".format(len(ark_json)))
      choice_dict = {}
      counter = 0
      for cpu in ark_json:
          choice_dict[counter] = cpu['prodUrl']
          click.echo(u"[{0}] {1}".format(counter, cpu['label']))
          counter += 1
  
      if len(ark_json) > 1:
          choice = click.prompt(u"Which processor", prompt_suffix='? ', type=int)
      else:
          choice = 0
  
      cpu_data = get_cpu_html(choice_dict[int(choice)])
      table_data = generate_table_data(cpu_data)
      table = AsciiTable(table_data)
      click.echo(table.table)
      ctx.exit(0)
code_tokens: def search ( ctx , search_term ) : ark_json = quick_search ( search_term ) if len ( ark_json ) < 1 : click . echo ( "Couldn't find any processors matching " "{0}" . format ( search_term ) ) ctx . exit ( 0 ) click . echo ( u"Processors found: {0}" . format ( len ( ark_json ) ) ) choice_dict = { } counter = 0 for cpu in ark_json : choice_dict [ counter ] = cpu [ 'prodUrl' ] click . echo ( u"[{0}] {1}" . format ( counter , cpu [ 'label' ] ) ) counter += 1 if len ( ark_json ) > 1 : choice = click . prompt ( u"Which processor" , prompt_suffix = '? ' , type = int ) else : choice = 0 cpu_data = get_cpu_html ( choice_dict [ int ( choice ) ] ) table_data = generate_table_data ( cpu_data ) table = AsciiTable ( table_data ) click . echo ( table . table ) ctx . exit ( 0 )
short_docstring: Main function of the script.
short_docstring_tokens: Main function of the script .
comment: """Main function of the script."""