some help methods... crude but will work for first impl.
17623
private synchronized Long getAvailableTxId() throws TCAPException {
        if (this.dialogs.size() >= this.stack.getMaxDialogs())
            throw new TCAPException("Current dialog count exceeds its maximum value");

        while (true) {
//            Long id;
//            if (!currentDialogId.compareAndSet(this.stack.getDialogIdRangeEnd(), this.stack.getDialogIdRangeStart() + 1)) {
//                id = currentDialogId.getAndIncrement();
//            } else {
//                id = this.stack.getDialogIdRangeStart();
//            }
//            if (checkAvailableTxId(id))
//                return id;



            if (this.curDialogId < this.stack.getDialogIdRangeStart())
                this.curDialogId = this.stack.getDialogIdRangeStart() - 1;
            if (++this.curDialogId > this.stack.getDialogIdRangeEnd())
                this.curDialogId = this.stack.getDialogIdRangeStart();
            Long id = this.curDialogId;
            if (checkAvailableTxId(id))
                return id;
        }
    }
784209
def step_impl(context):
    """"""
    expected_lines = context.text.split('\n')
    assert len(expected_lines) == len(context.output)
    for expected, actual in zip(expected_lines, context.output):
        print('--\n\texpected: {}\n\tactual: {}'.format(expected, actual))
        assert expected == actual
35106
def prepareToSolve(self):
        '''
        
        '''
        self.setAndUpdateValues(self.solution_next,self.IncomeDstn,self.LivPrb,self.DiscFac)
        self.defBoroCnst(self.BoroCnstArt)
277486
def write_intro (self):
        """"""
        self.writeln(configuration.AppInfo)
        self.writeln(configuration.Freeware)
        self.writeln(_("Get the newest version at %(url)s") %
                     {'url': configuration.Url})
        self.writeln(_("Write comments and bugs to %(url)s") %
                     {'url': configuration.SupportUrl})
        self.writeln(_("Support this project at %(url)s") %
                     {'url': configuration.DonateUrl})
        self.check_date()
        self.writeln()
        self.writeln(_("Start checking at %s") %
                     strformat.strtime(self.starttime))
860117
def definitions_help():
    
    message = m.Message()
    message.add(m.Brand())
    message.add(heading())
    message.add(content())
    return message
503606
function Dummy() {
    "use strict";
    this.colorize = function colorize(text, styleName, pad) {
        return text;
    };
    this.format = function format(text, style, pad){
        return text;
    };
}
1207775
def help(help_options={})
      comment_starting_with = help_options[:comment_starting_with] || ""
      located_in_file = help_options[:located_in_file] || __FILE__
      text = File.read(located_in_file)

      result = text.match(/(^\s*#\s*#{comment_starting_with}.*)^\s*class .* AppAction/m)
      result = $1
      result = result.gsub(/ @example/, '')
      result = result.gsub(/ @return \[Number\]/, ' Exit code:')
      result = result.gsub(/ @return .*/, '')
      result = result.gsub(/ @see .*$/, '')

      # strip the leading whitespace, the '#' and space
      result = result.gsub(/^\s*# ?/, '')

      # strip surrounding whitespace
      result.strip
    end
502379
public function help() {
        $this->showHeader();
        echo "ufw - Helper to uFw framework\n\nOptions:\n";
        foreach (self::HELP['options'] as $helpOption => $helpDescription) {
            echo "\n   $helpOption \t " . ($helpDescription['summary'] ?? "");
            if (array_key_exists('examples', $helpDescription)) {
                echo "\n            \t Ex:";
                foreach ($helpDescription['examples'] as $example) {
                    echo "\n           \t   $example";
                }
                echo "\n";
            }
        }
        echo "\n";
    }
1087533
def show_help(fd=sys.stdout):
    '''
    
    '''
    with Modules() as m:
        fd.write(m.help())
1245528
function setup(e) {

  e.explaination = []
  e.explain = function (template, parts, message) {
    e.explaination.push({
      template: template,
      parts: parts,
      message: message
    })
    return e
  }
  e.simple = function (name, actual, expected, operator, message) {
    return e.explain(
        name + ': {actual} {operator} {expected}'
      , { actual: actual
        , expected: expected
        , operator: operator }
      , message
    )
  }
  e.toString = function () {
    return e.explaination.map(function (e) {
      return (
        fomatto(e.template, e.parts)
      + ( e.message  ? '\n  ' + fomatto(e.message, e.parts) : '' )
      )
    }).join('\n')  
  }
 
  e.__defineGetter__('message', function () {
    return '' + e
  })
  return e
  
}
429756
def avail_approaches(pkg):
    '''
    '''
    methods = [modname for importer, modname, ispkg in
               pkgutil.walk_packages(path=pkg.__path__)
               if modname not in
               ['common_args', 'directions', 'sobol_sequence']]
    return methods
175713
protected void generalHelp(IsInfoSetFT info){
		//collect all commands belonging to a particular category
		String defKey = "__standard";
		Map<String, TreeMap<String, SkbShellCommand>> cat2Cmd = new TreeMap<>();
		for(CommandInterpreter ci : this.skbShell.getCommandMap().values()){
			for(SkbShellCommand ssc : ci.getCommands().values()){
				String cat = defKey;
				if(ssc.getCategory()!=null){
					cat = ssc.getCategory().getCategory();
				}
				if(!cat2Cmd.containsKey(cat)){
					cat2Cmd.put(cat, new TreeMap<>());
				}
				cat2Cmd.get(cat).put(ssc.getCommand(), ssc);
			}
		}

		//no argument, means general help
		info.addInfo("");
		info.addInfo("{} {}", this.skbShell.getDisplayName(), this.skbShell.getDescription());
		info.addInfo("");

		//do the commands per category, starting with "__standard"
		for(String cat : cat2Cmd.keySet()){
			String catDescr = cat;
			if(defKey.equals(cat)){
				catDescr = "standard commands";
			}
			info.addInfo("- {}: {}", new Object[]{catDescr, cat2Cmd.get(cat).keySet()});
		}
		info.addInfo("  try: 'help <command>' for more details");
	}
13387
public void method2() {
        Engine engine = null;
        String configurationFile = "/ObstacleAvoidance.fll";
        URL url = SimpleDimmer.class.getResource(configurationFile);
        try {
            engine = new FllImporter().fromFile(new File(url.toURI()));
        } catch (Exception ex) {
            FuzzyLite.logger().log(Level.SEVERE, ex.toString(), ex);
        }

        FuzzyLite.logger().info(new FldExporter().toString(engine));
    }
161912
def get
      begin
        easy.http_request(
          request.base_url.to_s,
          request.options.fetch(:method, :get),
          sanitize(request.options)
        )
      rescue Ethon::Errors::InvalidOption => e
        help = provide_help(e.message.match(/:\s(\w+)/)[1])
        raise $!, "#{$!}#{help}", $!.backtrace
      end
      set_callback
      easy
    end
1011011
def write_intro (self):
        """"""
        self.comment(_("created by %(app)s at %(time)s") %
                    {"app": configuration.AppName,
                     "time": strformat.strtime(self.starttime)})
        self.comment(_("Get the newest version at %(url)s") %
                     {'url': configuration.Url})
        self.comment(_("Write comments and bugs to %(url)s") %
                     {'url': configuration.SupportUrl})
        self.comment(_("Support this project at %(url)s") %
                     {'url': configuration.DonateUrl})
        self.check_date()
825439
function initializeStep( $package, $http, $step, &$persistentData, $tpl )
    {
        $methodMap = $this->initializeStepMethodMap();
        if ( count( $methodMap ) > 0 )
        {
            if ( isset( $methodMap[$step['id']] ) )
            {
                $method = $methodMap[$step['id']];
                return $this->$method( $package, $http, $step, $persistentData, $tpl );
            }
        }
    }
1113167
def do_first(self):
        """"""
        pid = os.getpid()
        self.basename = os.path.join(self.tmpdir, 'iiif_netpbm_' + str(pid))
        outfile = self.basename + '.pnm'
        # Convert source file to pnm
        filetype = self.file_type(self.srcfile)
        if (filetype == 'png'):
            if (self.shell_call(self.pngtopnm + ' ' + self.srcfile + ' > ' + outfile)):
                raise IIIFError(text="Oops... got error from pngtopnm.")
        elif (filetype == 'jpg'):
            if (self.shell_call(self.jpegtopnm + ' ' + self.srcfile + ' > ' + outfile)):
                raise IIIFError(text="Oops... got error from jpegtopnm.")
        else:
            raise IIIFError(code='501',
                            text='bad input file format (only know how to read png/jpeg)')
        self.tmpfile = outfile
        # Get size
        (self.width, self.height) = self.image_size(self.tmpfile)