Helper function to expand (blast) str -> int map into str ->
    bool map. This is used to send word level inputs to aiger.
490806
def _blast(bvname2vals, name_map):
    """"""
    if len(name_map) == 0:
        return dict()
    return fn.merge(*(dict(zip(names, bvname2vals[bvname]))
                      for bvname, names in name_map))
178541
function expandKey(key) {
	let tempWord = new Array(WORD_LENGTH);
	let rounds = getRoundsCount(key);
	let wordsCount = key.length / WORD_LENGTH;
	let keySchedule = new Array(COLUMNS * (rounds + 1));
	
	for (let i = 0; i < wordsCount; i++) {
		keySchedule[i] = key.slice(WORD_LENGTH * i, WORD_LENGTH * i + WORD_LENGTH);
	}
	for (let i = wordsCount; i < keySchedule.length; i++) {
		tempWord = keySchedule[i - 1];
		if (i % wordsCount === 0) {
			tempWord = a_u.xorWords(a_u.subWord(a_u.rotWordLeft(tempWord)), a_u.R_CON[i / wordsCount]);
		} else if (wordsCount > 6 && i % wordsCount === 4) {
			tempWord = a_u.subWord(tempWord);
		}
		keySchedule[i] = a_u.xorWords(keySchedule[i - wordsCount], tempWord);
	}
	return keySchedule;
}
428782
function map(str, props, fn) {
  var re = /\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;
  return str.replace(re, function(_){
    if ('(' == _[_.length - 1]) return fn(_);
    if (!~props.indexOf(_)) return _;
    return fn(_);
  });
}
1221200
def convert_bool(string):
    
    if string == 'True':
        return True, True
    elif string == 'False':
        return True, False
    else:
        return False, False
700102
def _map(value, istart, istop, ostart, ostop):
    
    return ostart + (ostop - ostart) * ((value - istart) / (istop - istart))
1149179
def expand_variables(template_str, value_map, transformer=None):
  
  if template_str is None:
    return None
  else:
    if transformer is None:
      transformer = lambda v: v
    try:
      # Don't bother iterating items for Python 2+3 compatibility.
      transformed_value_map = {k: transformer(value_map[k]) for k in value_map}
      return Template(template_str).substitute(transformed_value_map)
    except Exception as e:
      raise ValueError("could not expand variable names in command '%s': %s" % (template_str, e))
1258013
def expand(self, expand):
        '''
        
        '''
        self._expand = expand
        cmd = self._original_cmd
        if len(cmd) == 1:
            if not type(cmd[0]) in (str, unicode):
                cmd = cmd[0]
            else:
                cmd = shlex.split(cmd[0])
        cmd = [os.path.expanduser(os.path.expandvars(arg)) for arg in cmd]
        self._cmd, self._args = cmd[0], cmd[1:]
        return self
771141
private Map<String, List<Integer>> createExpandedCustomIdIndexMapping(final boolean expandedOnly) {
		TreeItemIdNode custom = getCustomTree();
		if (custom == null) {
			return Collections.EMPTY_MAP;
		}

		Set<String> expanded = null;
		if (expandedOnly) {
			expanded = getExpandedRows();
		}

		Map<String, List<Integer>> map = new HashMap<>();
		processExpandedCustomIdIndexMapping(custom, expanded, map);
		return Collections.unmodifiableMap(map);
	}
425984
def map_plus(target: Callable, mi, ma, a, mk, k):
    """"""
    if a is None:
        a = []
    if k is None:
        k = {}

    if mi is None and ma is None and mk is None:
        return []
    elif mi is None and ma is None:
        return [target(*a, **mki, **k) for mki in mk]
    elif ma is None and mk is None:
        return [target(mii, *a, **k) for mii in mi]
    elif mk is None and mi is None:
        return [target(*mai, *a, **k) for mai in ma]
    elif mi is None:
        return [target(*mai, *a, **mki, **k) for mai, mki in zip(ma, mk)]
    elif ma is None:
        return [target(mii, *a, **mki, **k) for mii, mki in zip(mi, mk)]
    elif mk is None:
        return [target(mii, *mai, *a, **k) for mii, mai in zip(mi, ma)]
    else:
        return [target(mii, *mai, *a, **mki, **k) for mii, mai, mki in zip(mi, ma, mk)]
374757
static private void astifyMap(StringBuilder strb, java.util.Map<?,?> map) {
    strb.append("{");
    if (map != null && map.size() > 0) {
      boolean isFirst = true;
      for (java.util.Map.Entry<?, ?> entry: map.entrySet()) {
        if (isFirst) {
          isFirst = false;
        } else {
          strb.append(", ");
        }
        strb.append("\"");
        strb.append(entry.getKey().toString());
        strb.append("\"");
        strb.append(":");
        astifyObject(strb, entry.getValue());
      }
    }
    strb.append("}");
  }
1113405
def blast(args):
    
    p = OptionParser(blast.__doc__)

    opts, args = p.parse_args(args)

    if len(args) != 1:
        sys.exit(not p.print_help())

    btabfile, = args
    btab = Btab(btabfile)
    for b in btab:
        print(b.blastline)
685930
function Expand(mapper, sink, source) {
	this.error = null;
	this.items = [];
	this.mapper = mapper || identity;
	this.selectPending = false;
	this.sink = sink;
	this.sink.source = this;
	this.state = Asyncplify.states.RUNNING;
    this.source = null;
	this.subscribables = [];
	this.value = undefined;

    source._subscribe(this);
}
795318
function buildMap( map, part ){

    var name =          makeName( part.fileName );

    if ( map[name] ){
        map[name].parts.push( part );
    } else {
        map[name] = {
            name:       name,
            parts:      [ part ],
        };
    }

    return map;
}
668177
function (id, length) {
            length = length || 8;

            id = id || words.generate(length);

            while (this.mapValues[id] !== undefined) {
                id = words.generate(length);
                length += 1;
            }

            return id.toString();
        }
1214741
def expand(behavior = nil, values = {})
      raise NotImplementedError, 'expanding not supported' unless respond_to? :expand
      @expander ||= Mustermann::Expander.new(self) { combined_ast }
      @expander.expand(behavior, values)
    end
629563
public static Map<String, String> performMapping(final Map<String, String> input,
                                                      final Map<String, String> mapping, final boolean skip) {

        final Map<String, String> props = new HashMap<String, String>();

        for (final Map.Entry<String, String> entry : input.entrySet()) {
            if (null != mapping.get(entry.getKey())) {
                props.put(mapping.get(entry.getKey()), entry.getValue());
            } else if(!skip) {
                props.put(entry.getKey(), entry.getValue());
            }

        }
        return props;
    }
541663
void buildMapEntry(LinkedHashMap<Object, Expr> map) {
		Expr keyExpr = expr();
		Object key;
		if (keyExpr instanceof Id) {
			key = ((Id)keyExpr).getId();
		} else if (keyExpr instanceof Const) {
			key = ((Const)keyExpr).getValue();
		} else {
			throw new ParseException("Expression error: the value of map key must be identifier, String, Boolean, null or Number", location);
		}
		
		match(Sym.COLON);
		Expr value = expr();
		if (value == null) {
			throw new ParseException("Expression error: the value on the right side of map entry can not be blank", location);
		}
		map.put(key, value);
	}