tells if is this contract has sub-contract with expiries/strikes/sides
355117
def isMultiContract(self, contract):
        
        if contract.m_secType == "FUT" and contract.m_expiry == "":
            return True

        if contract.m_secType in ["OPT", "FOP"] and \
                (contract.m_expiry == "" or contract.m_strike == "" or contract.m_right == ""):
            return True

        tickerId = self.tickerId(contract)
        if tickerId in self.contract_details and \
                len(self.contract_details[tickerId]["contracts"]) > 1:
            return True

        return False
357754
def _assert_precondition(contract: Contract, resolved_kwargs: Mapping[str, Any]) -> None:
    
    # Check that all arguments to the condition function have been set.
    missing_args = [arg_name for arg_name in contract.condition_args if arg_name not in resolved_kwargs]
    if missing_args:
        raise TypeError(
            ("The argument(s) of the precondition have not been set: {}. "
             "Does the original function define them? Did you supply them in the call?").format(missing_args))

    condition_kwargs = {
        arg_name: value
        for arg_name, value in resolved_kwargs.items() if arg_name in contract.condition_arg_set
    }

    check = contract.condition(**condition_kwargs)

    if not check:
        if contract.error is not None and (inspect.ismethod(contract.error) or inspect.isfunction(contract.error)):
            assert contract.error_arg_set is not None, "Expected error_arg_set non-None if contract.error a function."
            assert contract.error_args is not None, "Expected error_args non-None if contract.error a function."

            error_kwargs = {
                arg_name: value
                for arg_name, value in resolved_kwargs.items() if arg_name in contract.error_arg_set
            }

            missing_args = [arg_name for arg_name in contract.error_args if arg_name not in resolved_kwargs]
            if missing_args:
                msg_parts = []  # type: List[str]
                if contract.location is not None:
                    msg_parts.append("{}:\n".format(contract.location))

                msg_parts.append(
                    ("The argument(s) of the precondition error have not been set: {}. "
                     "Does the original function define them? Did you supply them in the call?").format(missing_args))

                raise TypeError(''.join(msg_parts))

            raise contract.error(**error_kwargs)

        else:
            msg = icontract._represent.generate_message(contract=contract, condition_kwargs=condition_kwargs)
            if contract.error is None:
                raise ViolationError(msg)
            elif isinstance(contract.error, type):
                raise contract.error(msg)
463320
function hasTicksBar(notWhich, options) {
    return options.needleSide !== notWhich ||
            options.tickSide !== notWhich ||
            options.numberSide !== notWhich;
}
809886
def _get_num_contracts(contracts_list, param_name):
    
    msg = "Argument `*[argument_name]*` is not valid"
    return sum(
        [
            1 if item["msg"] == msg.replace("*[argument_name]*", param_name) else 0
            for item in contracts_list
        ]
    )
256632
public boolean isSubtypesUnchecked(List<Type> ts, List<Type> ss, Warner warn) {
        while (ts.tail != null && ss.tail != null
               /*inlined: ts.nonEmpty() && ss.nonEmpty()*/ &&
               isSubtypeUnchecked(ts.head, ss.head, warn)) {
            ts = ts.tail;
            ss = ss.tail;
        }
        return ts.tail == null && ss.tail == null;
        /*inlined: ts.isEmpty() && ss.isEmpty();*/
    }
1266614
def detect_functions_called(contract):
        
        result = []

        # Obtain all functions reachable by this contract.
        for func in contract.all_functions_called:
            # Loop through all nodes in the function, add all calls to a list.
            for node in func.nodes:
                for ir in node.irs:
                    if isinstance(ir, (InternalCall, SolidityCall)):
                        result.append(ir.function)
        return result
966008
def _detect(self):
        
        results = []
        for c in self.contracts:
            for f in c.functions:
                if f.contract != c:
                    continue
                if f.view or f.pure:
                    if f.contains_assembly:
                        attr = 'view' if f.view else 'pure'
                        info = '{}.{} ({}) is declared {} but contains assembly code\n'
                        info = info.format(f.contract.name, f.name, f.source_mapping_str, attr)
                        json = self.generate_json_result(info)
                        self.add_function_to_json(f, json)
                        json['elements'].append({'type': 'info',
                                                 'contains_assembly' : True})
                        results.append(json)

                    variables_written = f.all_state_variables_written()
                    if variables_written:
                        attr = 'view' if f.view else 'pure'
                        info = '{}.{} ({}) is declared {} but changes state variables:\n'
                        info = info.format(f.contract.name, f.name, f.source_mapping_str, attr)
                        for variable_written in variables_written:
                            info += '\t- {}.{}\n'.format(variable_written.contract.name,
                                                         variable_written.name)


                        json = self.generate_json_result(info)
                        self.add_function_to_json(f, json)
                        self.add_variables_to_json(variables_written, json)
                        json['elements'].append({'type': 'info',
                                                  'contains_assembly' : False})
                        results.append(json)

        return results
640976
def _is_subsequence_of(self, sub, sup):
        
        return bool(re.search(".*".join(sub), sup))
71679
def has_ops_before(self, ts):
        
        spec = {'ts': {'$lt': ts}}
        return bool(self.coll.find_one(spec))
839781
def is_operation(term: Any) -> bool:
    """"""
    return isinstance(term, type) and issubclass(term, Operation)
920379
def is_union(type_: Type[Any]) -> bool:
    '''
    
    '''
    if HAS_UNIONSUBCLASS:
        # Old python
        return _issubclass(type_, Union)
    else:
        return getattr(type_, '__origin__', None) == Union
771438
function isFullyImplementedContract (node) {
  return nodeType(node, exactMatch(nodeTypes.CONTRACTDEFINITION)) && node.attributes.fullyImplemented === true
}
946497
def hasExpired(self):
        
        return (datetime.datetime.utcnow() - self.lastUpdateTime).total_seconds() > self.maxAgeSeconds
1208003
private boolean isWithinSubtree(X500Name other) {
        if (this == other) {
            return true;
        }
        if (other == null) {
            return false;
        }
        if (other.names.length == 0) {
            return true;
        }
        if (this.names.length == 0) {
            return false;
        }
        if (names.length < other.names.length) {
            return false;
        }
        for (int i = 0; i < other.names.length; i++) {
            if (!names[i].equals(other.names[i])) {
                return false;
            }
        }
        return true;
    }
68829
def has_successor(self, graph, orig, dest, branch, turn, tick, *, forward=None):
        
        if forward is None:
            forward = self.db._forward
        return dest in self._get_destcache(graph, orig, branch, turn, tick, forward=forward)
1176905
def is_after(self, ts):
        '''  '''
        if self.timestamp >= int(calendar.timegm(ts.timetuple())):
            return True
        return False
594647
def _detect(self):
        
        results = []
        for c in self.slither.contracts_derived:
            unusedVars = self.detect_unused(c)
            if unusedVars:
                info = ''
                for var in unusedVars:
                    info += "{}.{} ({}) is never used in {}\n".format(var.contract.name,
                                                                      var.name,
                                                                      var.source_mapping_str,
                                                                      c.name)


                json = self.generate_json_result(info)
                self.add_variables_to_json(unusedVars, json)
                results.append(json)

        return results