Manage verilog examples.\n
       Install with `apio install examples`
774621
def cli(ctx, list, dir, files, project_dir, sayno):
    """"""

    exit_code = 0

    if list:
        exit_code = Examples().list_examples()
    elif dir:
        exit_code = Examples().copy_example_dir(dir, project_dir, sayno)
    elif files:
        exit_code = Examples().copy_example_files(files, project_dir, sayno)
    else:
        click.secho(ctx.get_help())
        click.secho(Examples().examples_of_use_cad())

    ctx.exit(exit_code)
1176265
def cli(ctx, name,all):
    """"""
    ctx.gbc.say('all_example_functions',stuff=all_examples_functions, verbosity=1000)

    for example in all_examples_functions:
        if all or (name and example['name'] == name):
            if all:
                ctx.gbc.say('example',stuff=example, verbosity=100)
                name = example['name']
            #click.echo_via_pager(example['fun']())
            click.echo("#"*80)
            click.echo("### start of bubble example: "+name)
            click.echo("#"*80)
            click.echo(example['fun']())
            click.echo("#"*80)
            click.echo("### end of bubble example: "+name)
            click.echo("#"*80)
            click.echo()

        else:
            click.echo("available example: " + example['name'])
482633
def cli():
    """"""
    parser = get_argparser()

    args = parser.parse_args()
    check_args(args)
    if args.v:
        print('ERAlchemy version {}.'.format(__version__))
        exit(0)
    render_er(
        args.i,
        args.o,
        include_tables=args.include_tables,
        include_columns=args.include_columns,
        exclude_tables=args.exclude_tables,
        exclude_columns=args.exclude_columns,
        schema=args.s
    )
561622
def cli(env, identifier, enable):
    """"""

    mgr = SoftLayer.HardwareManager(env.client)
    hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware')
    result = env.client['Hardware_Server'].toggleManagementInterface(enable, id=hw_id)
    env.fout(result)
949221
def main():
    
    try:
        args = get_args()
        if 'setup_cfg' in args and 'stdeb_cfg' in args:
            _construct_cfgs_from_json(args)
        else:
            construct_cfgs(**args)
    except Exception as Error:
        print(str(Error))
        print("Exiting cleanly...")
        exit_cleanly()
    exit_cleanly(error_number=0)
396871
def main():
    
    import jsonschema
    parser = argparse.ArgumentParser(version=__version__)
    parser.add_argument(
        '--verbose', action='store_true', default=False,
        help='Turn on verbose output.')
    parser.add_argument(
        '--header', action='store_true', default=False,
        help='Turn on header.')
    parser.add_argument(
        'playbooks', metavar='PLAYBOOKS', type=str, nargs='+',
        help='The playbook(s) to lint.')

    args = parser.parse_args()

    validation_results = {}
    all_valid = True
    # Load the playbook schema
    with open(resource_filename(
            'relent', 'schemas/playbook_schema.json'), 'r') as schema_fp:
        schema = json.load(schema_fp)
        # Do checks against playbooks
        for playbook in args.playbooks:
            try:
                with open(playbook, 'r') as pb:
                    # Schema check
                    jsonschema.validate(json.load(pb), schema)
            except jsonschema.ValidationError, e:
                all_valid = False
                validation_results[playbook] = (
                    False, e.message, list(e.schema_path), str(e))
            except ValueError, e:
                all_valid = False
                validation_results[playbook] = (
                    False, 'JSON is invalid.', str(e), str(e))

    # If all_valid is True then return back happy results
    if all_valid is True:
        if args.verbose or args.header:
            parser._print_message('Found 0 issues.\n')
        raise SystemExit(0)
    else:
        if args.verbose or args.header:
            parser._print_message('Found %s issues.\n\n' % len(
                validation_results))
        for problem_playbook in validation_results.keys():
            parser._print_message('%s: E: %s %s\n' % (
                problem_playbook,
                validation_results[problem_playbook][1],
                validation_results[problem_playbook][2]))
            if args.verbose:
                parser._print_message(
                    validation_results[problem_playbook][3] + '\n--\n')
        raise SystemExit(1)
1061873
def cli(ctx, board, serial_port, ftdi_id, sram, project_dir,
        verbose, verbose_yosys, verbose_arachne):
    """"""

    drivers = Drivers()
    drivers.pre_upload()
    # Run scons
    exit_code = SCons(project_dir).upload({
        'board': board,
        'verbose': {
            'all': verbose,
            'yosys': verbose_yosys,
            'arachne': verbose_arachne
        }
    }, serial_port, ftdi_id, sram)
    drivers.post_upload()
    ctx.exit(exit_code)
205515
def cli(env):
    """"""

    table = formatting.Table(['Code', 'Reason'])
    table.align['Code'] = 'r'
    table.align['Reason'] = 'l'

    mgr = SoftLayer.HardwareManager(env.client)

    for code, reason in mgr.get_cancellation_reasons().items():
        table.add_row([code, reason])

    env.fout(table)
1210980
def main(*args, **kwargs):
    
    kwargs = {**kwargs, **_get_kwargs()}
    # FIXME: This filepath handeling is messed up and not transparent as it should be
    default_filepath = get_config_filepath()
    configuration_filepath = kwargs.get('configuration_filepath')
    if configuration_filepath is None:
        configuration_filepath = default_filepath
    # configuration is from an `ini` file
    configuration = _get_config(configuration_filepath)
    # setup some sane defaults
    robot_name = _configuration_sane_defaults(configuration)
    # Get the port configuration out of the configuration
    port_config = _port_configuration_helper(configuration)
    # create the settings manager using the port config
    if _setproctitle:
        _setproctitle.setproctitle('vexbot')

    robot = Robot(robot_name, port_config)
    robot.run()
621102
def main() -> None:
    """"""
    parser = argparse.ArgumentParser(
        description="Security analysis of Ethereum smart contracts"
    )
    create_parser(parser)

    # Get config values

    args = parser.parse_args()
    parse_args(parser=parser, args=args)
677166
def main():

    ''' '''

    f = FSM ('INIT', [])
    f.set_default_transition (Error, 'INIT')
    f.add_transition_any  ('INIT', None, 'INIT')
    f.add_transition      ('=',               'INIT',            DoEqual,          'INIT')
    f.add_transition_list (string.digits,     'INIT',            BeginBuildNumber, 'BUILDING_NUMBER')
    f.add_transition_list (string.digits,     'BUILDING_NUMBER', BuildNumber,      'BUILDING_NUMBER')
    f.add_transition_list (string.whitespace, 'BUILDING_NUMBER', EndBuildNumber,   'INIT')
    f.add_transition_list ('+-*/',            'INIT',            DoOperator,       'INIT')

    print()
    print('Enter an RPN Expression.')
    print('Numbers may be integers. Operators are * / + -')
    print('Use the = sign to evaluate and print the expression.')
    print('For example: ')
    print('    167 3 2 2 * * * 1 - =')
    inputstr = (input if PY3 else raw_input)('> ')  # analysis:ignore
    f.process_list(inputstr)
581083
def parse_verilog(text):
  '''
  '''
  lex = VerilogLexer

  name = None
  kind = None
  saved_type = None
  mode = 'input'
  ptype = 'wire'

  metacomments = []
  parameters = []
  param_items = []

  generics = []
  ports = collections.OrderedDict()
  sections = []
  port_param_index = 0
  last_item = None
  array_range_start_pos = 0

  objects = []

  for pos, action, groups in lex.run(text):
    if action == 'metacomment':
      if last_item is None:
        metacomments.append(groups[0])
      else:
        last_item.desc = groups[0]

    if action == 'section_meta':
      sections.append((port_param_index, groups[0]))

    elif action == 'module':
      kind = 'module'
      name = groups[0]
      generics = []
      ports = collections.OrderedDict()
      param_items = []
      sections = []
      port_param_index = 0

    elif action == 'parameter_start':
      net_type, vec_range = groups

      new_ptype = ''
      if net_type is not None:
        new_ptype += net_type

      if vec_range is not None:
        new_ptype += ' ' + vec_range

      ptype = new_ptype

    elif action == 'param_item':
      generics.append(VerilogParameter(groups[0], 'in', ptype))

    elif action == 'module_port_start':
      new_mode, net_type, signed, vec_range = groups

      new_ptype = ''
      if net_type is not None:
        new_ptype += net_type

      if signed is not None:
        new_ptype += ' ' + signed

      if vec_range is not None:
        new_ptype += ' ' + vec_range

      # Complete pending items
      for i in param_items:
        ports[i] = VerilogParameter(i, mode, ptype)

      param_items = []
      if len(ports) > 0:
        last_item = next(reversed(ports))

      # Start with new mode
      mode = new_mode
      ptype = new_ptype

    elif action == 'port_param':
      ident = groups[0]

      param_items.append(ident)
      port_param_index += 1

    elif action == 'end_module':
      # Finish any pending ports
      for i in param_items:
        ports[i] = VerilogParameter(i, mode, ptype)

      vobj = VerilogModule(name, ports.values(), generics, dict(sections), metacomments)
      objects.append(vobj)
      last_item = None
      metacomments = []

  return objects
1061442
def main(version=DEFAULT_VERSION):
    """"""
    options = _parse_args()
    tarball = download_setuptools(download_base=options.download_base)
    return _install(tarball, _build_install_args(options))
870618
def main(argv, version=DEFAULT_VERSION):
    """"""
    try:
        import setuptools
    except ImportError:
        egg = None
        try:
            egg = download_setuptools(version, delay=0)
            sys.path.insert(0,egg)
            from setuptools.command.easy_install import main
            return main(list(argv)+[egg])   # we're done here
        finally:
            if egg and os.path.exists(egg):
                os.unlink(egg)
    else:
        if setuptools.__version__ == '0.0.1':
            print >>sys.stderr, (
            "You have an obsolete version of setuptools installed.  Please\n"
            "remove it from your system entirely before rerunning this script."
            )
            sys.exit(2)

    req = "setuptools>="+version
    import pkg_resources
    try:
        pkg_resources.require(req)
    except pkg_resources.VersionConflict:
        try:
            from setuptools.command.easy_install import main
        except ImportError:
            from easy_install import main
        main(list(argv)+[download_setuptools(delay=0)])
        sys.exit(0) # try to force an exit
    else:
        if argv:
            from setuptools.command.easy_install import main
            main(argv)
        else:
            print "Setuptools version",version,"or greater has been installed."
            print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
506089
def cli(env, identifier, postinstall, key):
    """"""

    hardware = SoftLayer.HardwareManager(env.client)
    hardware_id = helpers.resolve_id(hardware.resolve_ids,
                                     identifier,
                                     'hardware')
    key_list = []
    if key:
        for single_key in key:
            resolver = SoftLayer.SshKeyManager(env.client).resolve_ids
            key_id = helpers.resolve_id(resolver, single_key, 'SshKey')
            key_list.append(key_id)
    if not (env.skip_confirmations or formatting.no_going_back(hardware_id)):
        raise exceptions.CLIAbort('Aborted')

    hardware.reload(hardware_id, postinstall, key_list)
1293046
def execute_cmdLine_instructions(instructions, m, l):
    
    opt_lut = dict()
    inst_lut = dict()
    for k, v in six.iteritems(instructions):
        bits = k.split('-', 1)
        if len(bits) == 1:
            if v not in m.modules:
                raise KeyError("No such module: %s" % v)
            inst_lut[bits[0]] = v
        else:
            if not bits[0] in opt_lut:
                opt_lut[bits[0]] = list()
            opt_lut[bits[0]].append((bits[1], v))
    inst_list = sort_by_successors(
        six.viewkeys(inst_lut),
        lambda inst: [v for (k, v) in opt_lut.get(inst, ())
                      if k in m.modules[inst_lut[inst]].deps]
    )
    for k in reversed(tuple(inst_list)):
        if k in m.insts:
            raise NotImplementedError(
                "Overwriting instancens not yet supported")
        settings = dict()
        if k in opt_lut:
            for k2, v2 in opt_lut[k]:
                settings[k2] = v2
        m.create_instance(k, inst_lut[k], settings)
    for k in opt_lut:
        if k in inst_lut:
            continue
        for k2, v2 in opt_lut[k]:
            if k not in m.insts:
                raise ValueError("No such instance %s" % k)
            m.change_setting(k, k2, v2)
580646
def _init_posix(vars):
    """"""
    # load the installed Makefile:
    makefile = get_makefile_filename()
    try:
        _parse_makefile(makefile, vars)
    except IOError as e:
        msg = "invalid Python installation: unable to open %s" % makefile
        if hasattr(e, "strerror"):
            msg = msg + " (%s)" % e.strerror
        raise IOError(msg)
    # load the installed pyconfig.h:
    config_h = get_config_h_filename()
    try:
        with open(config_h) as f:
            parse_config_h(f, vars)
    except IOError as e:
        msg = "invalid Python installation: unable to open %s" % config_h
        if hasattr(e, "strerror"):
            msg = msg + " (%s)" % e.strerror
        raise IOError(msg)
    # On AIX, there are wrong paths to the linker scripts in the Makefile
    # -- these paths are relative to the Python source, but when installed
    # the scripts are in another directory.
    if _PYTHON_BUILD:
        vars['LDSHARED'] = vars['BLDSHARED']