return the contract's ABI, marshaled into python dict
        :param contract_name: string - name of the contract to load
        :return: ABI, None - if successful
                 None, error - if error
324685
def get(contract_name):
        '''
        
        '''

        if not Catalog.path:
            return None, "path to catalog must be set before searching it"
        if not contract_name:
            return None, "contract name missing"

        abi_file = "{}/{}.abi".format(Catalog.path, contract_name)

        try:
            with open(abi_file, "r") as file:
                abi = file.read()
        except Exception as e:
            return None, "Catalog.get error: {}".format(e)
        return abi, None
290336
def get_operator(name):
    
    sep = name.index('/')
    provider_name = name[:sep]
    operator_name = name[sep + 1:]

    provider = OPERATOR_PROVIDERS[provider_name]
    return provider[operator_name]
943316
def get(self, method_name):
        
        proto = get_um(method_name)
        if proto is None:
            return None
        message = proto()
        self._data[message] = method_name
        return message
653560
def contractString(self, contract, seperator="_"):
        

        localSymbol = ""
        contractTuple = contract

        if type(contract) != tuple:
            localSymbol = contract.m_localSymbol
            contractTuple = self.contract_to_tuple(contract)

        # build identifier
        try:
            if contractTuple[1] in ("OPT", "FOP"):
                # if contractTuple[5]*100 - int(contractTuple[5]*100):
                #     strike = contractTuple[5]
                # else:
                #     strike = "{0:.2f}".format(contractTuple[5])
                strike = '{:0>5d}'.format(int(contractTuple[5])) + \
                    format(contractTuple[5], '.3f').split('.')[1]

                contractString = (contractTuple[0] + str(contractTuple[4]) +
                                  contractTuple[6][0] + strike, contractTuple[1])
                                  # contractTuple[6], str(strike).replace(".", ""))

            elif contractTuple[1] == "FUT":
                exp = ' ' # default

                # round expiry day to expiry month
                if localSymbol != "":
                    # exp = localSymbol[2:3]+str(contractTuple[4][:4])
                    exp = localSymbol[2:3] + self.localSymbolExpiry[localSymbol][:4]

                if ' ' in exp:
                    exp = str(contractTuple[4])[:6]
                    exp = dataTypes["MONTH_CODES"][int(exp[4:6])] + str(int(exp[:4]))

                contractString = (contractTuple[0] + exp, contractTuple[1])

            elif contractTuple[1] == "CASH":
                contractString = (contractTuple[0] + contractTuple[3], contractTuple[1])

            else:  # STK
                contractString = (contractTuple[0], contractTuple[1])

            # construct string
            contractString = seperator.join(
                str(v) for v in contractString).replace(seperator + "STK", "")

        except Exception:
            contractString = contractTuple[0]

        return contractString.replace(" ", "_").upper()
454679
def get_contracts_deployment_info(
        chain_id: int,
        version: Optional[str] = None,
        module: DeploymentModule = DeploymentModule.ALL,
) -> Optional[DeployedContracts]:
    
    if module not in DeploymentModule:
        raise ValueError(f'Unknown module {module} given to get_contracts_deployment_info()')

    def module_chosen(to_be_added: DeploymentModule):
        return module == to_be_added or module == DeploymentModule.ALL

    files: List[Path] = []

    if module_chosen(DeploymentModule.RAIDEN):
        files.append(contracts_deployed_path(
            chain_id=chain_id,
            version=version,
            services=False,
        ))

    if module == DeploymentModule.SERVICES and not version_provides_services(version):
        raise ValueError(
            f'SERVICES module queried for version {version}, but {version} '
            'does not provide service contracts.',
        )

    if module_chosen(DeploymentModule.SERVICES) and version_provides_services(version):
        files.append(contracts_deployed_path(
            chain_id=chain_id,
            version=version,
            services=True,
        ))

    deployment_data: DeployedContracts = {}  # type: ignore

    for f in files:
        deployment_data = merge_deployment_data(
            deployment_data,
            _load_json_from_path(f),
        )

    if not deployment_data:
        deployment_data = None
    return deployment_data
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
        ]
    )
1164784
def _parse_new_contract_args(*args, **kwargs):
    """"""
    # No arguments
    if (not args) and (not kwargs):
        return [
            {
                "name": "argument_invalid",
                "msg": "Argument `*[argument_name]*` is not valid",
                "type": RuntimeError,
            }
        ]
    # Process args
    if (len(args) > 1) or ((len(args) == 1) and kwargs):
        raise TypeError("Illegal custom contract exception definition")
    if len(args) == 1:
        return [dict([("name", "default")] + list(_format_arg(args[0]).items()))]
    # Process kwargs
    return [
        dict([("name", name)] + list(_format_arg(kwargs[name]).items()))
        for name in sorted(list(kwargs.keys()))
    ]
1340997
def verify_contracts():
        
        artifacts_path = ConfigProvider.get_config().keeper_path
        logger.info(f'Keeper contract artifacts (JSON abi files) at: {artifacts_path}')

        if os.environ.get('KEEPER_NETWORK_NAME'):
            logger.warning(f'The `KEEPER_NETWORK_NAME` env var is set to '
                           f'{os.environ.get("KEEPER_NETWORK_NAME")}. '
                           f'This enables the user to override the method of how the network name '
                           f'is inferred from network id.')

        # try to find contract with this network name
        contract_name = Diagnostics.TEST_CONTRACT_NAME
        network_id = Keeper.get_network_id()
        network_name = Keeper.get_network_name(network_id)
        logger.info(f'Using keeper contracts from network {network_name}, '
                    f'network id is {network_id}')
        logger.info(f'Looking for keeper contracts ending with ".{network_name}.json", '
                    f'e.g. "{contract_name}.{network_name}.json".')
        existing_contract_names = os.listdir(artifacts_path)
        try:
            ContractHandler.get(contract_name)
        except Exception as e:
            logger.error(e)
            logger.error(f'Cannot find the keeper contracts. \n'
                         f'Current network id is {network_id} and network name is {network_name}.'
                         f'Expected to find contracts ending with ".{network_name}.json",'
                         f' e.g. "{contract_name}.{network_name}.json"')
            raise OceanKeeperContractsNotFound(
                f'Keeper contracts for keeper network {network_name} were not found '
                f'in {artifacts_path}. \n'
                f'Found the following contracts: \n\t{existing_contract_names}'
            )

        keeper = Keeper.get_instance()
        contracts = [keeper.dispenser, keeper.token, keeper.did_registry,
                     keeper.agreement_manager, keeper.template_manager, keeper.condition_manager,
                     keeper.access_secret_store_condition, keeper.sign_condition,
                     keeper.lock_reward_condition, keeper.escrow_access_secretstore_template,
                     keeper.escrow_reward_condition, keeper.hash_lock_condition
                     ]
        addresses = '\n'.join([f'\t{c.name}: {c.address}' for c in contracts])
        logging.info('Finished loading keeper contracts:\n'
                     '%s', addresses)
217800
def _register_custom_contracts(contract_name, contract_exceptions):
    """"""
    # pylint: disable=W0602,W0603
    global _CUSTOM_CONTRACTS
    # Validate arguments and homogenize contract exceptions
    if not isinstance(contract_name, str):
        raise TypeError("Argument `contract_name` is of the wrong type")
    # A contract exception can be a string (only one exception, default
    # exception type) or a dictionary of exception definitions, if there is
    # more than one or if the type if different than the default
    if (
        (not isinstance(contract_exceptions, list))
        and (not isinstance(contract_exceptions, str))
        and (not isinstance(contract_exceptions, dict))
    ):
        raise TypeError("Argument `contract_exceptions` is of the wrong type")
    if isinstance(contract_exceptions, dict):
        contract_exceptions = [contract_exceptions]
    if isinstance(contract_exceptions, list) and any(
        [
            not isinstance(key, str)
            for item in contract_exceptions
            for key in item.keys()
        ]
    ):
        raise TypeError("Contract exception definition is of the wrong type")
    # Validate individual exception definitions
    if isinstance(contract_exceptions, list) and any(
        [
            not (
                (set(item.keys()) == set(["name", "msg"]))
                or (set(item.keys()) == set(["name", "msg", "type"]))
            )
            for item in contract_exceptions
        ]
    ):
        raise TypeError("Contract exception definition is of the wrong type")
    extype = type(ValueError)
    if isinstance(contract_exceptions, list) and any(
        [
            (not isinstance(item["name"], str))
            or (not isinstance(item["msg"], str))
            or (not isinstance(item.get("type", extype), extype))
            for item in contract_exceptions
        ]
    ):
        raise TypeError("Contract exception definition is of the wrong type")
    # Homogenize exception definitions
    if isinstance(contract_exceptions, list):
        homogenized_exdict = dict(
            (
                exdict["name"],
                {
                    "num": exnum,
                    "msg": exdict["msg"],
                    "type": exdict.get("type", RuntimeError),
                    "field": _get_replacement_token(exdict["msg"]),
                },
            )
            for exnum, exdict in enumerate(contract_exceptions)
        )
    else:
        homogenized_exdict = {
            "default": {
                "num": 0,
                "msg": contract_exceptions,
                "type": RuntimeError,
                "field": _get_replacement_token(contract_exceptions),
            }
        }
    # Verify exception names are unique
    if isinstance(contract_exceptions, list) and (
        len(homogenized_exdict) != len(contract_exceptions)
    ):
        raise ValueError("Contract exception names are not unique")
    # Verify that exception messages are unique
    msgs = [exvalue["msg"] for exvalue in homogenized_exdict.values()]
    if len(set(msgs)) != len(msgs):
        raise ValueError("Contract exception messages are not unique")
    # Verify that a custom contract is not being redefined
    if (contract_name in _CUSTOM_CONTRACTS) and (
        _CUSTOM_CONTRACTS[contract_name] != contract_exceptions
    ):
        raise RuntimeError(
            "Attempt to redefine custom contract `{0}`".format(contract_name)
        )
    # Verify that there are at most only two replacement fields, and one of
    # them should be argument_name
    fields = [
        exdict["field"]
        for exdict in homogenized_exdict.values()
        if exdict["field"] is not None
    ]
    if (len(fields) > 2) or (
        (len(fields) == 2)
        and (fields[0] != "argument_name")
        and (fields[1] != "argument_name")
    ):
        raise ValueError(
            "Multiple replacement fields to be substituted by argument value"
        )
    # Register new contract
    _CUSTOM_CONTRACTS[contract_name] = homogenized_exdict
    return contract_exceptions
290509
def getConId(self, contract_identifier):
        
        details = self.contractDetails(contract_identifier)
        if len(details["contracts"]) > 1:
            return details["m_underConId"]
        return details["m_summary"]["m_conId"]
671865
def get_contract(self, contract_name: str) -> Dict:
        
        assert self.contracts, 'ContractManager should have contracts compiled'
        return self.contracts[contract_name]
887525
def registerContract(self, contract):
        

        if contract.m_exchange == "":
            return

        """
        if contract not in self.contracts.values():
            contract_tuple = self.contract_to_tuple(contract)
            self.createContract(contract_tuple)

        if self.tickerId(contract) not in self.contracts.keys():
            contract_tuple = self.contract_to_tuple(contract)
            self.createContract(contract_tuple)
        """

        if self.getConId(contract) == 0:
            contract_tuple = self.contract_to_tuple(contract)
            self.createContract(contract_tuple)
987692
def get_project(self, name):
        
        uri = '{base}/{project}'.format(base=self.BASE_URI, project=name)
        resp = self._client.get(uri, model=models.Project)

        return resp
374868
function (methodName, args) {
    const oThis = this
      , btAddress = oThis.contractAddress
      , scope = oThis.currContract.methods
      , transactionObject = scope[methodName].apply(scope, (args || []))
      , encodeABI = transactionObject.encodeABI()
      , transactionOutputs = contractInteractHelper.getTransactionOutputs(transactionObject)
      , resultData = {};

    return contractInteractHelper.call(web3Provider, btAddress, encodeABI, {}, transactionOutputs)
      .then(function (decodedResponse) {
        return decodedResponse[0];
      })
      .then(function (response) {
        resultData[methodName] = response;
        return responseHelper.successWithData(resultData);
      })
      .catch(function (err) {
        logger.error(err);
        return responseHelper.error({
          internal_error_identifier: 'l_ci_bt_callMethod_' + methodName + '_1',
          api_error_identifier: 'something_went_wrong',
          error_config: basicHelper.fetchErrorConfig()
        });
      })
      ;

  }
397234
def get_contract_dict_by_name(contract_name):
        

        network_name = Keeper.get_network_name(Keeper.get_network_id()).lower()
        artifacts_path = ConfigProvider.get_config().keeper_path

        # file_name = '{}.{}.json'.format(contract_name, network_name)
        # path = os.path.join(keeper.artifacts_path, file_name)
        path = ContractHandler._get_contract_file_path(
            artifacts_path, contract_name, network_name)
        if not (path and os.path.exists(path)):
            path = ContractHandler._get_contract_file_path(
                artifacts_path, contract_name, network_name.lower())

        if not (path and os.path.exists(path)):
            path = ContractHandler._get_contract_file_path(
                artifacts_path, contract_name, Keeper.DEFAULT_NETWORK_NAME)

        if not (path and os.path.exists(path)):
            raise FileNotFoundError(
                f'Keeper contract {contract_name} file '
                f'not found in {artifacts_path} '
                f'using network name {network_name}'
            )

        with open(path) as f:
            contract_dict = json.loads(f.read())
            return contract_dict
1211384
def new_contract_proxy(self, contract_interface, contract_address: Address):
        
        return ContractProxy(
            self,
            contract=self.new_contract(contract_interface, contract_address),
        )
464658
def contract_to_dict(contract):
    """"""
    default = Contract()
    return {field: val for field, val in vars(contract).items() if val != getattr(default, field, None)}