Handles compare-basis-sets subcommand
979203
def _bsecurate_cli_compare_basis_sets(args):
    ''''''
    ret = curate.compare_basis_sets(args.basis1, args.basis2, args.version1, args.version2, args.uncontract_general,
          args.data_dir, args.data_dir)
    if ret:
        return "No difference found"
    else:
        return "DIFFERENCES FOUND. SEE ABOVE"
1086585
function(a, b, aParent, bParent, prop, compares, options){
		var subsetCompare = function(a, b, aParent, bParent, prop){
			var compare = compares[prop] === undefined ? compares['*'] : compares[prop];

			if (! loop(a, b, aParent, bParent, prop, compare, options ) ) {
				var subsetCheck;
				if( !(prop in aParent)) {
					subsetCheck = "subsetB";
				}
				if( !(prop in bParent) ) {
					subsetCheck = "subsetA";
				}
				if(subsetCheck) {
					if( !options.subset ) {
						options.subset = subsetCheck;
					}
					return options.subset === subsetCheck ? undefined: false;
				}

				return false;
			}
		};

		var aType = typeof a;
		if(aType === 'object' || aType === 'function') {
			return h.eachInUnique(a, subsetCompare, b, subsetCompare, true);
		}
	}
328148
def arg_comparitor(name):
    
    if name.endswith("__in"):
        return name[:-4], contains
    elif name.endswith("__ge"):
        return name[:-4], ge
    elif name.endswith("__gt"):
        return name[:-4], gt
    elif name.endswith("__le"):
        return name[:-4], le
    elif name.endswith("__lt"):
        return name[:-4], lt
    if name.endswith("__eq"):
        return name[:-4], eq
    if name.endswith("__ne"):
        return name[:-4], ne
    else:
        return name, eq
7722
def handle_substmts(self, stmt, p_elem, pset={}):
        """"""
        for sub in stmt.substmts:
            self.handle_stmt(sub, p_elem, pset)
283368
def _compare_vector(arr1, arr2, rel_tol):
    

    length = len(arr1)
    if len(arr2) != length:
        return False

    for i in range(length):
        element_1 = float(arr1[i])
        element_2 = float(arr2[i])

        diff = abs(abs(element_1) - abs(element_2))
        if diff != 0.0:
            rel = _reldiff(element_1, element_2)

            # For a basis set, a relatively coarse comparison
            # should be acceptible
            if rel > rel_tol:
                return False

    return True
1252210
def load_subcommand(subparsers):
    """"""
    parser_analyze = subparsers.add_parser('echo_conf', help='Echo sample configuration file')
    parser_analyze.set_defaults(func=echo_conf)
307130
private static void compareMaps(Delta delta, Collection deltas, LinkedList stack, ID idFetcher)
    {
        Map<Object, Object> srcMap = (Map<Object, Object>) delta.srcValue;
        Map<Object, Object> targetMap = (Map<Object, Object>) delta.targetValue;

        // Walk source Map keys and see if they exist in target map.  If not, that entry needs to be removed.
        // If the key exists in both, then the value must tested for equivalence.  If !equal, then a PUT command
        // is created to re-associate target value to key.
        final String sysId = "(" + System.identityHashCode(srcMap) + ')';
        for (Map.Entry entry : srcMap.entrySet())
        {
            Object srcKey = entry.getKey();
            Object srcValue = entry.getValue();
            String srcPtr = sysId + "['" + System.identityHashCode(srcKey) + "']";

            if (targetMap.containsKey(srcKey))
            {
                Object targetValue = targetMap.get(srcKey);
                if (srcValue == null || targetValue == null)
                {   // Null value in either source or target
                    if (srcValue != targetValue)
                    {   // Value differed, must create PUT command to overwrite source value associated to key
                        addMapPutDelta(delta, deltas, srcPtr, targetValue, srcKey);
                    }
                }
                else if (isIdObject(srcValue, idFetcher) && isIdObject(targetValue, idFetcher))
                {   // Both source and destination have same object (by id) as the value, add delta to stack (field-by-field check for item).
                    if (idFetcher.getId(srcValue).equals(idFetcher.getId(targetValue)))
                    {
                        stack.push(new Delta(delta.id, delta.fieldName, srcPtr, srcValue, targetValue, null));
                    }
                    else
                    {   // Different ID associated to same key, must create PUT command to overwrite source value associated to key
                        addMapPutDelta(delta, deltas, srcPtr, targetValue, srcKey);
                    }
                }
                else if (!DeepEquals.deepEquals(srcValue, targetValue))
                {   // Non-null, non-ID value associated to key, and the two values are not equal.  Create PUT command to overwrite.
                    addMapPutDelta(delta, deltas, srcPtr, targetValue, srcKey);
                }
            }
            else
            {   // target does not have this Key in it's map, therefore create REMOVE command to remove it from source map.
                Delta removeDelta = new Delta(delta.id, delta.fieldName, srcPtr, srcValue, null, srcKey);
                removeDelta.setCmd(MAP_REMOVE);
                deltas.add(removeDelta);
            }
        }

        for (Map.Entry entry : targetMap.entrySet())
        {
            Object targetKey = entry.getKey();
            String srcPtr = sysId + "['" + System.identityHashCode(targetKey) + "']";

            if (!srcMap.containsKey(targetKey))
            {   // Add Delta command map.put
                Delta putDelta = new Delta(delta.id, delta.fieldName, srcPtr, null, entry.getValue(), targetKey);
                putDelta.setCmd(MAP_PUT);
                deltas.add(putDelta);
            }
        }
        // TODO: If LinkedHashMap, may need to issue commands to reorder...
    }
979505
def compare(all_dict, others, names, module_name):
    """"""
    only_all = set()
    for name in all_dict:
        if name not in names:
            only_all.add(name)

    only_ref = set()
    missing = set()
    for name in names:
        if name not in all_dict:
            for pat in REFGUIDE_ALL_SKIPLIST:
                if re.match(pat, module_name + '.' + name):
                    if name not in others:
                        missing.add(name)
                    break
            else:
                only_ref.add(name)

    return only_all, only_ref, missing
433372
def organize(**kwargs):
    """"""

    # do argument wrangling  before turning it into an obect
    # since namedtuples are immutable
    if len(kwargs['adsorbates']) == 0:
        print("""Warning: no adsorbates specified,
        can't pick up reaction reaction energies.""")
        print("         Enter adsorbates like so --adsorbates CO,O,CO2")
        print("         [Comma-separated list without spaces.]")
    kwargs['adsorbates'] = list(map(
        lambda x: (''.join(sorted(string2symbols(x)))),
        kwargs['adsorbates'].split(','),
    ))
    if kwargs['energy_corrections']:
        e_c_dict = {}
        for e_c in kwargs['energy_corrections'].split(','):
            key, value = e_c.split('=')
            e_c_dict.update({key: float(value)})
        kwargs['energy_corrections'] = e_c_dict

    options = collections.namedtuple(
        'options',
        kwargs.keys()
    )(**kwargs)
    _organize.main(options=options)
888560
def compare_changes(obj, **kwargs):
    '''
    
    '''
    changes = {}
    for key, value in obj.items():
        if key in kwargs:
            if value != kwargs[key]:
                changes[key] = kwargs[key]
    return changes
679758
void difference(IntSet dest, IntSet compared) {
        int i = 0;
        int j = 0;
        while (i < size && j < compared.size) {
            int a = elements[i];
            int b = compared.elements[j];
            if (a < b) {
                // our set has a value that is not in "compared"
                dest.addInt(a);
                i ++;
            } else if (a > b) {
                // "compared" has a value that is not in our set.
                j ++;
            } else {
                // the sets match at this index.
                i ++;
                j ++;
            }
        }
        // anything left in our set is part of the delta and belongs in "dest".
        while (i < size) {
            dest.addInt(elements[i]);
            i ++;
        }
    }
491544
def _cli_check_family(family, data_dir):
    ''''''

    if family is None:
        return None

    family = family.lower()
    if not family in api.get_families(data_dir):
        errstr = "Basis set family '" + family + "' does not exist.\n"
        errstr += "For a complete list of families, use the 'bse list-families' command"
        raise RuntimeError(errstr)

    return family
234199
def assertrepr_compare(config, op, left, right):
    """"""
    width = 80 - 15 - len(op) - 2  # 15 chars indentation, 1 space around op
    left_repr = py.io.saferepr(left, maxsize=int(width//2))
    right_repr = py.io.saferepr(right, maxsize=width-len(left_repr))

    summary = u('%s %s %s') % (ecu(left_repr), op, ecu(right_repr))

    issequence = lambda x: (isinstance(x, (list, tuple, Sequence)) and
                            not isinstance(x, basestring))
    istext = lambda x: isinstance(x, basestring)
    isdict = lambda x: isinstance(x, dict)
    isset = lambda x: isinstance(x, (set, frozenset))

    def isiterable(obj):
        try:
            iter(obj)
            return not istext(obj)
        except TypeError:
            return False

    verbose = config.getoption('verbose')
    explanation = None
    try:
        if op == '==':
            if istext(left) and istext(right):
                explanation = _diff_text(left, right, verbose)
            else:
                if issequence(left) and issequence(right):
                    explanation = _compare_eq_sequence(left, right, verbose)
                elif isset(left) and isset(right):
                    explanation = _compare_eq_set(left, right, verbose)
                elif isdict(left) and isdict(right):
                    explanation = _compare_eq_dict(left, right, verbose)
                if isiterable(left) and isiterable(right):
                    expl = _compare_eq_iterable(left, right, verbose)
                    if explanation is not None:
                        explanation.extend(expl)
                    else:
                        explanation = expl
        elif op == 'not in':
            if istext(left) and istext(right):
                explanation = _notin_text(left, right, verbose)
    except Exception:
        _logger.exception("dessert: representation of details failed.  "
                          "Probably an object has a faulty __repr__.")

    if not explanation:
        return None

    return [summary] + explanation
1003465
def infos_on_basis_set(self):
        
        o = []
        o.append("=========================================")
        o.append("Reading basis set:")
        o.append("")
        o.append(" Basis set for {} atom ".format(str(self.filename)))
        o.append(" Maximum angular momentum = {}".format(self.data['lmax']))
        o.append(" Number of atomics orbitals = {}".format(self.data['n_nlo']))
        o.append(" Number of nlm orbitals = {}".format(self.data['n_nlmo']))
        o.append("=========================================")

        return str(0)
82550
def on_compare(self, node):  # ('left', 'ops', 'comparators')
        """"""
        lval = self.run(node.left)
        out = True
        for op, rnode in zip(node.ops, node.comparators):
            rval = self.run(rnode)
            out = op2func(op)(lval, rval)
            lval = rval
            if self.use_numpy and isinstance(out, numpy.ndarray) and out.any():
                break
            elif not out:
                break
        return out
53068
def _assert_keys_match(keys1, keys2):
  """"""
  if set(keys1) != set(keys2):
    raise ValueError('{} {}'.format(list(keys1), list(keys2)))
1307517
def visit_Compare(self, node):
        """"""

        if len(node.ops) > 1:
            func = Name(id=self._prefix + 'napi_compare', ctx=Load())
            args = [node.left,
                    List(elts=[Str(op.__class__.__name__)
                               for op in node.ops], ctx=Load()),
                    List(elts=node.comparators, ctx=Load())]
            node = Call(func=func, args=args, keywords=self._kwargs)
            fml(node)
        self.generic_visit(node)
        return node