Run method iterates through triple maps and calls the execute
        method
551456
def run(self, **kwargs):
        """"""
        if 'timestamp' not in kwargs:
            kwargs['timestamp'] = datetime.datetime.utcnow().isoformat()
        if 'version' not in kwargs:
            kwargs['version'] = "Not Defined" #bibcat.__version__
        # log.debug("kwargs: %s", pprint.pformat({k:v for k, v in kwargs.items()
        #                                         if k != "dataset"}))
        # log.debug("parents: %s", self.parents)
        for map_key, triple_map in self.triple_maps.items():
            if map_key not in self.parents:
                self.execute(triple_map, **kwargs)
791482
function(connection, collection, functionName) {
      var args = Array.prototype.slice.call(arguments, 3);
      return connections[connection].runFunction(functionName, args);
    }
1063330
public void map(K1 arg0, V1 arg1, OutputCollector<Text, Text> arg2,
                  Reporter arg3) throws IOException {
    throw new IOException ("should not be called\n");
  }
621969
@SuppressWarnings("unchecked")
	public static void execute(Map<String, Object> map, BindMapListener listener) {
		if (listener == null)
			throw (new KriptonRuntimeException("listener can not be null"));
		if (map == null)
			throw (new KriptonRuntimeException("map can not be null"));

		VisitorStatusType status = VisitorStatusType.RUN;

		for (Entry<String, Object> item : map.entrySet()) {
			if (item.getValue() == null || item.getValue() instanceof String) {
				visit(item.getKey(), (String) item.getValue(), listener, status);
			} else if (item.getValue() instanceof List) {
				visitList(item.getKey(), (List<Object>) item.getValue(), listener, status);
			} else if (item.getValue() instanceof Map) {
				visitMap(item.getKey(), (Map<String, Object>) item.getValue(), listener, status);
			}

			if (status == VisitorStatusType.STOP)
				return;

		}

	}
211105
function mapExec(array, func) {
  for (var i = 0; i < array.length; ++i) {
    func.call(this, array[i], i);
  }
}
335774
def exec(method, options = {}, &code)
    Manager.connection.exec(method, options, &code)
  end
647441
def map(self, function, *iterables, **kwargs):
        
        self._check_pool_state()

        timeout = kwargs.get('timeout')
        chunksize = kwargs.get('chunksize', 1)

        if chunksize < 1:
            raise ValueError("chunksize must be >= 1")

        futures = [self.schedule(process_chunk, args=(function, chunk))
                   for chunk in iter_chunks(chunksize, *iterables)]

        map_future = MapFuture(futures)
        if not futures:
            map_future.set_result(MapResults(futures))
            return map_future

        def done_map(_):
            if not map_future.done():
                map_future.set_result(MapResults(futures, timeout=timeout))

        for future in futures:
            future.add_done_callback(done_map)
            setattr(future, 'map_future', map_future)

        return map_future
163700
def _loop(self, map):
        
        try:
            from asyncore import poll
        except ImportError:
            raise Exception("Couldn't find poll function. Cannot start bot.")
    
        while map:
            self.before_poll()
            poll(timeout=30.0, map=map)
            self.after_poll()
57728
private List<SQLPPTriplesMap> getJoinMappings(Collection<TriplesMap> tripleMaps, TriplesMap tm) throws Exception {
		String sourceQuery = "";
		List<SQLPPTriplesMap> joinMappings = new ArrayList<SQLPPTriplesMap>();
		for (PredicateObjectMap pobm: tm.getPredicateObjectMaps()) {
			
			for(RefObjectMap robm : pobm.getRefObjectMaps()) {
				sourceQuery = robm.getJointQuery();

				ImmutableList.Builder<TargetAtom> bodyBuilder = ImmutableList.builder();

				ImmutableTerm joinSubject1 = r2rmlParser.getSubjectAtom(tm);
				
				TriplesMap parent = robm.getParentMap();
				TriplesMap parentTriple = null;
				Iterator<TriplesMap> it = tripleMaps.iterator();
				while(it.hasNext()){
					TriplesMap current = it.next();
					if (current.equals(parent)) {
						parentTriple = current;
						break;
					}
				}
				
				ImmutableTerm joinSubject2 = r2rmlParser.getSubjectAtom(parentTriple);
				
			List<ImmutableFunctionalTerm> joinPredicates = r2rmlParser.getBodyURIPredicates(pobm);
			for (ImmutableFunctionalTerm pred : joinPredicates) {
				//TODO:joinPredicates
				bodyBuilder.add(targetAtomFactory.getTripleTargetAtom(joinSubject1, pred, joinSubject2));   // objectAtom
			}

			//Function head = getHeadAtom(body);
			//CQIE targetQuery = DATALOG_FACTORY.getCQIE(head, body);
			
			if (sourceQuery.isEmpty()) {
				throw new Exception("Could not create source query for join in " + tm);
			}
			//finally, create mapping and add it to the list
                //use referenceObjectMap robm as id, because there could be multiple joinCondition in the same triple map
			// TODO: use a R2RML-specific class	instead
			SQLPPTriplesMap mapping = new OntopNativeSQLPPTriplesMap("mapping-join-"+robm.hashCode(),
					MAPPING_FACTORY.getSQLQuery(sourceQuery), bodyBuilder.build());
			System.out.println("WARNING joinMapping introduced : " + mapping);
			joinMappings.add(mapping);
		}
			
		}
		return joinMappings;
	}
701870
@Override
  public void map(MethodRef method,
                  String sql, 
                  Object ...args)
  {
    _kraken.map(method, sql, args);
  }
1330373
function run() {
	var len = series.length,
		ctx = context(),
		i = 0;

	series[ i ].call( ctx, next );

	function next() {
		i += 1;
		if ( i < len ) {
			series[ i ].call( ctx, next );
		}
	}
}
874464
function runPostMapping (args, uriMappers, location) {
  uriMappers.some(mapper => {
    if (mapper.expression.test(location.path)) {
      args = mapper.map(args);
      return true;
    }
    return false;
  });

  return args;
}
115030
protected final void writeMapTo( Map<String,Object> map , RawDataBuffer out )
    {
    	if (map == null)
    	{
    		out.writeInt(0);
    		return;
    	}
    	
        out.writeInt(map.size());
        if (!map.isEmpty())
        {
            Iterator<Map.Entry<String,Object>> allEntries = map.entrySet().iterator();
            while (allEntries.hasNext())
            {
                Map.Entry<String,Object> entry = allEntries.next();
                out.writeUTF(entry.getKey());
                out.writeGeneric(entry.getValue());
            }
        }
    }
820171
def execute(*args, **kwargs):
        

        # Inspect the call stack for the originating call
        args = CoyoteDb.__add_query_comment(args[0])
        db = CoyoteDb.__get_db_write_instance(target_database=kwargs.pop('target_database', None))
        filtered_kwargs = {k: v for k, v in kwargs.iteritems() if k != 'target_database'}

        # Execute the query
        cursor = db.cursor()
        try:
            cursor.execute(*args, **filtered_kwargs)
        except OperationalError, e:
            raise OperationalError('{} when executing: {}'.format(e.args, args[0]))
        return db, cursor
983427
@Override
	public void execute(Map<String, Object> attributes) throws FrameworkException {

		final String nodeType         = (String) attributes.get("type");
		final String relType          = (String) attributes.get("relType");
		final Boolean allNodes        = (Boolean) attributes.get("allNodes");
		final Boolean allRels         = (Boolean) attributes.get("allRels");
		final DatabaseService graphDb = (DatabaseService) arguments.get("graphDb");

		final SecurityContext superUserContext = SecurityContext.getSuperUserInstance();
		final NodeFactory nodeFactory          = new NodeFactory(superUserContext);
		final RelationshipFactory relFactory   = new RelationshipFactory(superUserContext);

		if (nodeType != null || Boolean.TRUE.equals(allNodes)) {

			Iterator<AbstractNode> nodeIterator = null;

			if (Boolean.TRUE.equals(allNodes)) {

				nodeIterator = Iterables.map(nodeFactory, graphDb.getAllNodes()).iterator();

				info("Start setting UUID on all nodes");

			} else {

				nodeIterator = Iterables.map(nodeFactory, graphDb.getNodesByTypeProperty(nodeType)).iterator();

				info("Start setting UUID on nodes of type {}", new Object[] { nodeType });
			}

			final long count = bulkGraphOperation(securityContext, nodeIterator, 1000, "SetNodeUuid", new BulkGraphOperation<AbstractNode>() {

				@Override
				public boolean handleGraphObject(final SecurityContext securityContext, final AbstractNode node) {

					try {

						if (node.getProperty(GraphObject.id) == null) {

							node.unlockSystemPropertiesOnce();
							node.setProperty(GraphObject.id, NodeServiceCommand.getNextUuid());
						}

					} catch (FrameworkException fex) {

						logger.warn("Unable to set UUID of node {}", node, fex);
					}

					return true;
				}

				@Override
				public void handleThrowable(SecurityContext securityContext, Throwable t, AbstractNode node) {
					logger.warn("Unable to set UUID of node {}", node, t);
				}

				@Override
				public void handleTransactionFailure(SecurityContext securityContext, Throwable t) {
					logger.warn("Unable to set UUID on node", t);
				}

				@Override
				public boolean doValidation() {
					return false;
				}
			});

			info("Done with setting UUID on {} nodes", count);

			return;
		}

		if (relType != null || Boolean.TRUE.equals(allRels)) {

			Iterator<AbstractRelationship> relIterator = null;

			if (Boolean.TRUE.equals(allRels)) {

				relIterator = Iterables.map(relFactory, graphDb.getAllRelationships()).iterator();

				info("Start setting UUID on all rels");

			} else {

				relIterator = Iterables.map(relFactory, graphDb.getRelationshipsByType(relType)).iterator();

				info("Start setting UUID on rels of type {}", relType);
			}

			final long count = bulkGraphOperation(securityContext, relIterator, 1000, "SetRelationshipUuid", new BulkGraphOperation<AbstractRelationship>() {

				@Override
				public boolean handleGraphObject(SecurityContext securityContext, AbstractRelationship rel) {

					try {

						if (rel.getProperty(GraphObject.id) == null) {

							rel.unlockSystemPropertiesOnce();
							rel.setProperty(GraphObject.id, NodeServiceCommand.getNextUuid());
						}

					} catch (FrameworkException fex) {

						logger.warn("Unable to set UUID of relationship {}: {}", new Object[] { rel, fex.getMessage() });
					}

					return true;
				}

				@Override
				public void handleThrowable(SecurityContext securityContext, Throwable t, AbstractRelationship rel) {
					logger.warn("Unable to set UUID of relationship {}: {}", rel, t.getMessage());
				}

				@Override
				public void handleTransactionFailure(SecurityContext securityContext, Throwable t) {
					logger.warn("Unable to set UUID on relationships {}", t.toString());
				}

				@Override
				public boolean doValidation() {
					return false;
				}
			});

			info("Done with setting UUID on {} relationships", count);

			return;
		}

		info("Unable to determine entity type to set UUID.");

	}
100455
public int run(String[] args) throws Exception {
    if (args.length != 2) {
      System.err.println("Usage: "+getClass().getName()+" <nMaps> <nSamples>");
      ToolRunner.printGenericCommandUsage(System.err);
      return -1;
    }
    
    final int nMaps = Integer.parseInt(args[0]);
    final long nSamples = Long.parseLong(args[1]);
        
    System.out.println("Number of Maps  = " + nMaps);
    System.out.println("Samples per Map = " + nSamples);
        
    final JobConf jobConf = new JobConf(getConf(), getClass());
    System.out.println("Estimated value of Pi is "
        + estimate(nMaps, nSamples, jobConf));
    return 0;
  }
1144579
private int doAfterRun(Map<String, Command> references) throws Exception
	{
		if (status == Command.COMMAND_EXECUTED)
		{
			// System.out.println("doAfterRun(): command " + getResultType() + "
			// processed...");
			Vector<Command> toBeRemoved = new Vector<Command>();
			try
			{
				Statement[] statements = null;

				for (int i = 0; i < operations.size(); ++i)
				{
					Command cmd = operations.elementAt(i);

					if (cmd.isArrayElement())
					{

						if (cmd.isResolved())
						{
							if (statements == null)
							{
								statements = new Statement[operations.size()];
							}
							statements[i] = new Statement(getResultValue(), "set", new Object[] { Integer.valueOf(i), //$NON-NLS-1$
									cmd.getResultValue() });
							if ((i + 1) == operations.size())
							{
								for (int j = 0; j < operations.size(); ++j)
								{
									statements[j].execute();
								}
								toBeRemoved.addAll(operations);
							}
						}
						else
						{
							break;
						}

					}
					else
					{
						// since the call is Array.set()
						if (!isArray())
						{
							cmd.setTarget(getResultValue());
						}
						cmd.exec(references);

						if (cmd.isResolved())
						{
							// System.out.println("doAfterRun(): cmd = " +
							// cmd.methodName + " is resolved");
							toBeRemoved.add(cmd);
						}
						else
						{
							// System.out.println("doAfterRun(): cmd = " +
							// cmd.methodName + " is unresolved");
							break;
						}

					}

				}
			}
			catch (Exception e)
			{
				throw new Exception(e);
			}
			finally
			{
				operations.removeAll(toBeRemoved);
			}

			// if (operations.size() == 0) {
			// System.out.println("doAfterRun(): command " + getResultType()
			// + " completely processed.");
			// } else {
			// System.out.println("doAfterRun(): command " + getResultType()
			// + " contains incomplete " +
			// operations.size() + " commands.");
			// }
			return (operations.size() == 0) ? Command.CHILDREN_PROCESSED : status;
		}
		return status;
	}