Main processing method which can go recursive.
321164
private ContentData matchBytes(byte[] bytes, int prevOffset, int level, ContentData contentData) {
		int offset = this.offset;
		if (offsetInfo != null) {
			// offset can be null if we run out of bytes
			Integer maybeOffset = offsetInfo.getOffset(bytes);
			if (maybeOffset == null) {
				return null;
			}
			offset = maybeOffset;
		}
		if (addOffset) {
			offset = prevOffset + offset;
		}
		boolean required = (testValue == null && formatter != null);
		Object val = matcher.extractValueFromBytes(offset, bytes, required);
		if (val == null) {
			return null;
		}
		if (testValue != null) {
			MutableOffset mutableOffset = new MutableOffset(offset);
			val = matcher.isMatch(testValue, andValue, unsignedType, val, mutableOffset, bytes);
			if (val == null) {
				return null;
			}
			offset = mutableOffset.offset;
		}

		if (contentData == null) {
			contentData = new ContentData(name, mimeType, level);
			// default is a child didn't match, set a partial so the matcher will keep looking
			contentData.partial = true;
		}
		if (formatter != null) {
			if (clearFormat) {
				contentData.sb.setLength(0);
			}
			// if we are appending and need a space then prepend one
			if (formatSpacePrefix && contentData.sb.length() > 0) {
				contentData.sb.append(' ');
			}
			matcher.renderValue(contentData.sb, val, formatter);
		}
		logger.trace("matched data: {}: {}", this, contentData);

		if (children == null) {
			// no children so we have a full match and can set partial to false
			contentData.partial = false;
		} else {
			// run through the children to add more content-type details
			boolean allOptional = true;
			for (MagicEntry entry : children) {
				if (!entry.isOptional()) {
					allOptional = false;
				}
				// goes recursive here
				entry.matchBytes(bytes, offset, level + 1, contentData);
				// we continue to match to see if we can add additional children info to the name
			}
			if (allOptional) {
				contentData.partial = false;
			}
		}

		/*
		 * Now that we have processed this entry (either with or without children), see if we still need to annotate the
		 * content information.
		 * 
		 * NOTE: the children will have the first opportunity to set this which makes sense since they are the most
		 * specific.
		 */
		if (name != MagicEntryParser.UNKNOWN_NAME && contentData.name == MagicEntryParser.UNKNOWN_NAME) {
			contentData.name = name;
		}
		/*
		 * Set the mime-type if it is not set already or if we've gotten more specific in the processing of a pattern
		 * and determine that it's actually a different type so we can override the previous mime-type. Example of this
		 * is Adobe Illustrator which looks like a PDF but has extra stuff in it.
		 */
		if (mimeType != null && (contentData.mimeType == null || level > contentData.mimeTypeLevel)) {
			contentData.mimeType = mimeType;
			contentData.mimeTypeLevel = level;
		}
		return contentData;
	}
282086
def main():  # pragma: nocover
    
    p = argparse.ArgumentParser(add_help="Recursively list interesting files.")
    p.add_argument(
        'directory', nargs="?", default="",
        help="The directory to process (current dir if omitted)."
    )
    p.add_argument(
        '--verbose', '-v', action='store_true',
        help="Increase verbosity."
    )

    args = p.parse_args()
    args.curdir = os.getcwd()
    if not args.directory:
        args.direcotry = args.curdir
    if args.verbose:
        print(args)

    for chsm, fname in list_files(args.directory):
        print(chsm, fname)
194598
public static void main(String[] args) {
        DirectoryIterator iter = new DirectoryIterator(args);
        while(iter.hasNext())
            System.out.println(iter.next().getAbsolutePath());
    }
690868
def main():
    """"""
    parser = build_command_parser()
    options = parser.parse_args()
    file_pointer = options.filename
    input_format = options.input_format

    with file_pointer:
        json_data = json.load(file_pointer)

    if input_format == SIMPLE_JSON:
        report = Report(json_data)
    elif input_format == EXTENDED_JSON:
        report = Report(
            json_data.get('messages'),
            json_data.get('stats'),
            json_data.get('previous'))

    print(report.render(), file=options.output)
255121
def recursive(self):
        
        for m in self.members.values():
            if m.kind is not None and m.kind.lower() == self.name.lower():
                return True
        else:
            return False
648964
function main() {
	// TODO: move loading of inputs into main function
	check(lookupQType(typeDecl.global,[]), {key: snapshot.global}, '', false, null, '<global>');
	if (program.missing) {
		findSuggestions()
	}
	if (program.coverage) {
		printCoverage();
	}
	if (program.stats) {
		console.log("# heap objects = " + snapshot.heap.length)
		console.log("# call signatures = " + num_callsigs_analyzed)
	}
}
1053820
def main_loop():
    ''''''
    while True:
        if mestate is None or mestate.exit:
            return
        while not mestate.input_queue.empty():
            line = mestate.input_queue.get()
            cmds = line.split(';')
            for c in cmds:
                process_stdin(c)
        time.sleep(0.1)
553309
def main():
    
    args = parser.parse_args()
    try:
        function = args.func
    except AttributeError:
        parser.print_usage()
        parser.exit(1)
    function(vars(args))
1209424
@Override
  public void process(Node externs, Node root) {
    checkState(topLevelStatements.isEmpty(), "process() called more than once");
    NodeTraversal t = new NodeTraversal(compiler, this, scopeCreator);
    t.traverseRoots(externs, root);
  }
414476
public function process(): void
    {
        try {
            $this->queue = msg_get_queue(ftok(__FILE__, 't'));
            $this->catchSignal();
            $this->initWorkerManager();
            $this->main();
        } catch (\Exception $e) {
            $this->logger->error('main() throw an exception, cleanup and exit', [
                'class' => get_class($this),
                'exception' => $e,
            ]);

            $this->cleanup(SIGTERM);
        }
    }
1096410
def main(argv, stdin, stdout):
    """"""
    if len(argv) > 1 and argv[1:3] == ["compile", "markov"]:
        algo = load_markov(argv, stdin)
        print(algo.compile(), file=stdout)
    elif len(argv) == 4 and argv[1:3] == ["run", "markov"]:
        algo = load_markov(argv, stdin)
        for line in stdin:
            print(algo.execute(''.join(line.split())), file=stdout)

    elif len(argv) > 1 and argv[1:3] == ["compile", "turing"]:
        machine = load_turing(argv, stdin)
        print(machine.compile(), file=stdout)
    elif len(argv) == 4 and argv[1:3] == ["run", "turing"]:
        machine = load_turing(argv, stdin)
        for line in stdin:
            print(machine.execute(line), file=stdout)

    elif len(argv) == 2 and argv[1] == "test":
        path = os.path.abspath(os.path.dirname(__file__))
        argv[1] = path
        pytest.main()
    elif len(argv) == 2 and argv[1] == "version":
        print("TuringMarkov", VERSION, file=stdout)

    else:
        print(USAGE, file=stdout)
        if not (len(argv) == 2 and argv[1] == "help"):
            exit(1)
234395
def main_loop_iteration(timeout=None):
    """"""
    prev_nr_read = nr_handle_read
    asyncore.loop(count=1, timeout=timeout, use_poll=True)
    return nr_handle_read - prev_nr_read
1249867
public boolean process()
	{
		boolean continueIterate = true;
		boolean found = false;
		String attempt = getCurrentAttempt();
		while (continueIterate)
		{
			if (attempt.equals(toCheckAgainst))
			{
				found = true;
				break;
			}
			attempt = getCurrentAttempt();
			continueIterate = increment();
		}
		return found;
	}
345790
def _recursive_cleanup(foo):
    
    if isinstance(foo, dict):
        for (key, val) in list(foo.items()):
            if isinstance(val, dict):
                _recursive_cleanup(val)
            if val == "" or val == [] or val == {}:
                del foo[key]
18758
def main():
    ''''''
    global output
    if len(sys.argv[1:]) == 1:
        with io.open(sys.argv[1], 'r', encoding='utf-8') as f:
            output = load(f)
    else:
        output = load(sys.stdin)

    dump(output, sys.stdout)
953748
private void handleMainMethodIfPresent(List methods) {
        boolean found = false;
        for (Iterator iter = methods.iterator(); iter.hasNext();) {
            MethodNode node = (MethodNode) iter.next();
            if(node.getName().equals("main")) {
                if (node.isStatic() && node.getParameters().length == 1) {
                    boolean retTypeMatches, argTypeMatches;
                    ClassNode argType = node.getParameters()[0].getType();
                    ClassNode retType = node.getReturnType();

                    argTypeMatches = (argType.equals(ClassHelper.OBJECT_TYPE) || argType.getName().contains("String[]"));
                    retTypeMatches = (retType == ClassHelper.VOID_TYPE || retType == ClassHelper.OBJECT_TYPE);
                    
                    if(retTypeMatches && argTypeMatches) {
                        if(found) {
                            throw new RuntimeException("Repetitive main method found.");
                        } else {
                            found = true;
                        }
                        // if script has both loose statements as well as main(), then main() is ignored
                        if(statementBlock.isEmpty()) {
                            addStatement(node.getCode());
                        }
                        iter.remove();
                    }
                }
            }
        }
    }
1322070
public function main()
  {
    $this->logInfo("Setting mtime recursively under directory %s", $this->myWorkDirName);

    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->myWorkDirName,
                                                                            FilesystemIterator::SKIP_DOTS),
                                             RecursiveIteratorIterator::CHILD_FIRST);

    foreach ($iterator as $path => $file_info)
    {
      if ($file_info->isDir())
      {
        $mtime = $this->getMaxMTime($path);
        if (isset($mtime))
        {
          $this->logVerbose("Set mtime of %s to %s", $path, date('Y-m-d H:i:s', $mtime));
          $success = touch($path, $mtime);
          if (!$success)
          {
            $this->logError("Unable to set mtime of %s", $path);
          }

          $this->myCount++;
        }
      }
    }

    $this->logInfo("Found %d sub-directories", $this->myCount);
  }