Returns a list of operations that need to be performed to turn the
        cached source code into the one in the buffer.
439749
def _get_operations(self, context):
        """"""
        #Most of the time, the real-time update is going to fire with
        #incomplete statements that don't result in any changes being made
        #to the module instances. The SequenceMatches caches hashes for the
        #second argument. Logically, we want to turn the cached version into
        #the buffer version; however, the buffer is the string that keeps 
        #changing.

        #in order to optimize the real-time update, we *switch* the two strings
        #when we set the sequence and then fix the references on the operations
        #after the fact.
        if context.module.changed or self.unset:
            self.matcher.set_seq2(context.cachedstr)
            self.unset = False
            #Set the changed flag back to false now that the sequencer has
            #reloaded it.
            context.module.changed = False
        self.matcher.set_seq1(context.bufferstr)

        opcodes = self.matcher.get_opcodes()
        result = []

        #Index i keeps track of how many operations were actually added because
        #they constituted a change we need to take care of.
        i = 0
        for code in opcodes:
            if code[0] != "equal":
                #Replacements don't have a mode change. All of the operations
                #switch the order of the line indices for the two strings.
                if code[0] == "insert":
                    newcode = ("delete", code[3], code[4], code[1], code[2])
                elif code[0] == "delete":
                    newcode = ("insert", code[3], code[4], code[1], code[2])
                else:
                    newcode = ("replace", code[3], code[4], code[1], code[2])

                op = Operation(context, self.parser, newcode, i)
                result.append(op)
                i += 1

        return result
836089
public void addOperations(final Map<MemcachedNode, Operation> ops) {
    for (Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) {
      addOperation(me.getKey(), me.getValue());
    }
  }
1139119
def preprocess_code(code)
      code = Utils.bytes_to_int_array code
      ops = []

      i = 0
      while i < code.size
        o = Opcodes::TABLE.fetch(code[i], [:INVALID, 0, 0, 0]) + [code[i], 0]
        ops.push o

        if o[0][0,Opcodes::PREFIX_PUSH.size] == Opcodes::PREFIX_PUSH
          n = o[0][Opcodes::PREFIX_PUSH.size..-1].to_i
          n.times do |j|
            i += 1
            byte = i < code.size ? code[i] : 0
            o[-1] = (o[-1] << 8) + byte

            # polyfill, these INVALID ops will be skipped in execution
            ops.push [:INVALID, 0, 0, 0, byte, 0] if i < code.size
          end
        end

        i += 1
      end

      ops
    end
1029369
private static void processOtherMappings() {
		codeToJavaMapping.clear();
		codeToJKTypeMapping.clear();
		shortListOfJKTypes.clear();
		Set<Class<?>> keySet = javaToCodeMapping.keySet();
		for (Class<?> clas : keySet) {
			List<Integer> codes = javaToCodeMapping.get(clas);
			for (Integer code : codes) {
				codeToJavaMapping.put(code, clas);
				logger.debug(" Code ({}) class ({}) name ({})", code, clas.getSimpleName(), namesMapping.get(code));
				codeToJKTypeMapping.put(code, new JKType(code, clas, namesMapping.get(code)));
			}
			shortListOfJKTypes.add(new JKType(codes.get(0), clas, namesMapping.get(codes.get(0))));
		}
	}
45385
private List applyOperationAndCheck(Operation op, MithraTransaction tx)
    {
        boolean oldEvaluationMode = tx.zIsInOperationEvaluationMode();
        List resultList = null;
        try
        {
            tx.zSetOperationEvaluationMode(true);
            if (this.isPureHome() || (!this.isOperationPartiallyCached(op) && !this.txParticipationRequired(tx, op)))
            {
                resultList = this.resolveOperationOnCache(op);
            }
            else
            {
                resultList = op.applyOperationToPartialCache();
                if (resultList == null && !this.isOperationPartiallyCached(op) && this.getTxParticipationMode(tx).mustParticipateInTxOnRead())
                {
                    // attempt to find what we have in cache to trigger waiting for potential other transactions
                    List untrustworthyResult = op.applyOperationToFullCache();
                    checkTransactionParticipationAndWaitForOtherTransactions(untrustworthyResult, tx);
                }
                resultList = checkTransactionParticipationAndWaitForOtherTransactions(resultList, tx);
            }
        }
        finally
        {
            tx.zSetOperationEvaluationMode(oldEvaluationMode);
        }
        if (this.isPureHome())
        {
            checkTransactionParticipationForPureObject(resultList, tx);
        }
        return resultList;
    }
229163
private List<OperationPair> createMutateOperationPairs() {
    List<OperationPair> ops = Lists.newArrayList();

    if (originalRoot == null) {
      // The original tree was empty, so treat all nodes in this tree as ADDs.
      return createAddOperations(root);
    }

    // Add the mutate operations required to apply changes to the root node.
    Set<ProductDimension> dimensionsToProcess = addMutateOperations(originalRoot, root, ops);

    // Add additional mutate operations for the remaining child dimensions to process.
    addMutateOperationsByParent(originalRoot, root, dimensionsToProcess, ops);
    return ops;
  }
877118
public Operations getOperationsForScope(OperationScope... scopes) {
        final Operations result = new Operations();
        final List<Operation> r = new ArrayList<Operation>();
        if (getOperations() != null) {
            for (Operation op : getOperations()) {
                if (op.getScope() != null) {
                    String s = op.getScope().trim();
                    for (int i = 0; i < scopes.length; i++) {
                        OperationScope scope = scopes[i];
                        if (scope.is(s)) {
                            r.add(op);
                            break;
                        }
                    }
                }
            }
            result.setOperations(r);
        }
        return result;
    }
893536
private static List<byte[]> makeDOAs(final List<byte[]> l)
	{
		for (int i = 0; i < l.size(); ++i) {
			final byte[] pdu = l.get(i);
			l.set(i, Arrays.copyOfRange(pdu, 2, pdu.length));
		}
		return l;
	}
1019715
def _loadcache(cachefile):
    
    cache = {}
    if os.path.exists(cachefile):
        with open(cachefile) as f:
            for line in f:
                line = line.split()
                if len(line) == 2:
                    try:
                        cache[int(line[0])] = float(line[1])
                    except:
                        pass
    return cache
1177071
def _sync_code(self):
        
        new_code = []
        for line in self.lines:
            if isinstance(line, CodeAnswer):
                new_code.append(line.dump())
            else:
                new_code.append(line)
        self.code = '\n'.join(new_code)
601603
public <T> List<T> asList() {
		String cacheKey = null;
		
		// is the result of the query cached?
		if (isCacheable() && transaction == null) {
			cacheKey = getCacheKey();
			List<Key> keys = getCacheManager().get(cacheNamespace, cacheKey);
			if (keys != null) {
				if (isKeysOnly()) {
					return (List) keys;
				} else {
					final Map<Key, T> values = entityManager.get(keys);
					return Lists.transform(keys, new Function<Key, T>() {

						@Override
						public T apply(Key key) {
							return values.get(key);
						}
						
					});
				}
			}
		}
		
		// execute the query
		List<T> result = Lists.newArrayList((Iterable<T>) asIterable());
		if (isCacheable()) {
			Collection<Key> keys = isKeysOnly()? result : Collections2.transform(result, new EntityToKeyFunction(classMetadata.getPersistentClass()));
			populateCache(cacheKey, Lists.newArrayList(keys));
		}
		return result;
	}
847382
def operations(self):
        
        return [op for block in self.blocks for op in block.vex.operations]
679279
private MBeanOperationInfo[] getOperationInfo() {
        final List<MBeanOperationInfo> infoList = new ArrayList<>();

        if (type != null) {
            ReflectionUtils.doWithMethods(type, new ReflectionUtils.MethodCallback() {
                @Override
                public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
                    infoList.add(new MBeanOperationInfo(OPERATION_DESCRIPTION, method));
                }
            }, new ReflectionUtils.MethodFilter() {
                @Override
                public boolean matches(Method method) {
                    return method.getDeclaringClass().equals(type)
                            && !method.getName().startsWith("set")
                            && !method.getName().startsWith("get")
                            && !method.getName().startsWith("is")
                            && !method.getName().startsWith("$jacoco"); // Fix for code coverage
                }
            });
        } else {
            for (ManagedBeanInvocation.Operation operation : operations) {
                List<MBeanParameterInfo> parameterInfo = new ArrayList<>();

                int i = 1;
                for (OperationParam parameter : operation.getParameter().getParameter()) {
                    parameterInfo.add(new MBeanParameterInfo("p" + i++, parameter.getType(), "Parameter #" + i));
                }

                infoList.add(new MBeanOperationInfo(operation.getName(), OPERATION_DESCRIPTION, parameterInfo.toArray(new MBeanParameterInfo[operation.getParameter().getParameter().size()]), operation.getReturnType(), MBeanOperationInfo.UNKNOWN));
            }
        }

        return infoList.toArray(new MBeanOperationInfo[infoList.size()]);
    }
70702
private void processNewOperation(StorageOperation operation) {
        if (operation instanceof MergeSegmentOperation) {
            this.operations.add(operation);
            this.mergeTransactionCount.incrementAndGet();
        } else if (operation instanceof StreamSegmentSealOperation) {
            this.operations.add(operation);
            this.hasSealPending.set(true);
        } else if (operation instanceof StreamSegmentTruncateOperation) {
            this.operations.add(operation);
            this.truncateCount.incrementAndGet();
        } else if (operation instanceof CachedStreamSegmentAppendOperation) {
            // Aggregate the Append Operation.
            AggregatedAppendOperation aggregatedAppend = getOrCreateAggregatedAppend(
                    operation.getStreamSegmentOffset(), operation.getSequenceNumber());
            aggregateAppendOperation((CachedStreamSegmentAppendOperation) operation, aggregatedAppend);
        }
    }
462767
def cache_call_signatures(source, user_pos, stmt):
    """"""
    index = user_pos[0] - 1
    lines = source.splitlines() or ['']
    if source and source[-1] == '\n':
        lines.append('')

    before_cursor = lines[index][:user_pos[1]]
    other_lines = lines[stmt.start_pos[0]:index]
    whole = '\n'.join(other_lines + [before_cursor])
    before_bracket = re.match(r'.*\(', whole, re.DOTALL)

    module_path = stmt.get_parent_until().path
    return None if module_path is None else (module_path, before_bracket, stmt.start_pos)
444583
function getRecursivePublishedPutOperations(locals) {
  return rootComponentRef => {
    /**
     * 1) Get reference (could be latest, could be other)
     * 2) Get all references within reference
     * 3) Replace all references with @published (including root reference)
     * 4) Get list of put operations needed
     */
    return components.get(rootComponentRef, locals)
      .then(data => composer.resolveComponentReferences(data, locals))
      .then(data => dbOps.getPutOperations(components.cmptPut, replaceVersion(rootComponentRef, 'published'), data, locals));
  };
}
856539
private Map<String, T> internalGet(long to, TimeUnit unit,
      Collection<Operation> timedoutOps) throws InterruptedException,
      ExecutionException {
    if (!latch.await(to, unit)) {
      for (Operation op : ops) {
        if (op.getState() != OperationState.COMPLETE) {
          MemcachedConnection.opTimedOut(op);
          timedoutOps.add(op);
        } else {
          MemcachedConnection.opSucceeded(op);
        }
      }
    }
    for (Operation op : ops) {
      if (op.isCancelled()) {
        throw new ExecutionException(new CancellationException("Cancelled"));
      }
      if (op.hasErrored()) {
        throw new ExecutionException(op.getException());
      }
    }
    Map<String, T> m = new HashMap<String, T>();
    for (Map.Entry<String, Future<T>> me : rvMap.entrySet()) {
      m.put(me.getKey(), me.getValue().get());
    }
    return m;
  }