query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Calls the specified handler when this promise is fulfilled. If the handler returns a promise, @param callable $handler @return PromiseInterface
[ "public function to($handler /*, $args… */)\n {\n $args = array_slice(func_get_args(), 1);\n\n return $this->then(\n function (Allocation $allocation) use ($handler, $args) {\n try {\n $result = call_user_func_array($handler, $args);\n $result = \\React\\Promise\\resolve($result);\n $result->then(array($allocation, 'releaseAll'), array($allocation, 'releaseAll'));\n } catch (\\Exception $e) {\n $result = new RejectedPromise($e);\n $allocation->releaseAll();\n }\n\n return $result;\n }\n );\n }" ]
[ "function run(booleanOrString, anyDataType, functionOrObject, aNumber, anArray) {\n /*\n * if expectations aren't met, args checker will throw appropriate exceptions\n * notifying the user regarding the errors of the arguments.\n * */\n \targs.expect(arguments, ['boolean|string', '*', 'function|object', 'number', 'array']);\n\n // do something here...\n console.log(\"\\n\\nfunction `run` arguments passed!\");\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Make JsonResponse :param rv: Response: the object to encode, or tuple (response, status, headers) :type rv: tuple|* :rtype: JsonResponse
[ "def make_json_response(rv):\n \n # Tuple of (response, status, headers)\n rv, status, headers = normalize_response_value(rv)\n\n # JsonResponse\n if isinstance(rv, JsonResponse):\n return rv\n\n # Data\n return JsonResponse(rv, status, headers)" ]
[ "def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(message.content, key)\n return value_from_content_function" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Computes the bounding circle @param geometry @return
[ "public static Geometry computeBoundingCircle(Geometry geometry) {\n if (geometry == null) {\n return null;\n }\n return new MinimumBoundingCircle(geometry).getCircle();\n }" ]
[ "def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)" ]
codesearchnet
{ "query": "Represent the comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
// NewMockClientFacade creates a new mock instance
[ "func NewMockClientFacade(ctrl *gomock.Controller) *MockClientFacade {\n\tmock := &MockClientFacade{ctrl: ctrl}\n\tmock.recorder = &MockClientFacadeMockRecorder{mock}\n\treturn mock\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true,writeDirectory);\n \n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Describes tget_grades_table return value. @return external_single_structure @since Moodle 2.9
[ "public static function get_grades_table_returns() {\n return new external_single_structure(\n array(\n 'tables' => new external_multiple_structure(\n new external_single_structure(\n array(\n 'courseid' => new external_value(PARAM_INT, 'course id'),\n 'userid' => new external_value(PARAM_INT, 'user id'),\n 'userfullname' => new external_value(PARAM_TEXT, 'user fullname'),\n 'maxdepth' => new external_value(PARAM_INT, 'table max depth (needed for printing it)'),\n 'tabledata' => new external_multiple_structure(\n new external_single_structure(\n array(\n 'itemname' => new external_single_structure(\n array (\n 'class' => new external_value(PARAM_RAW, 'class'),\n 'colspan' => new external_value(PARAM_INT, 'col span'),\n 'content' => new external_value(PARAM_RAW, 'cell content'),\n 'celltype' => new external_value(PARAM_RAW, 'cell type'),\n 'id' => new external_value(PARAM_ALPHANUMEXT, 'id')\n ), 'The item returned data', VALUE_OPTIONAL\n ),\n 'leader' => new external_single_structure(\n array (\n 'class' => new external_value(PARAM_RAW, 'class'),\n 'rowspan' => new external_value(PARAM_INT, 'row span')\n ), 'The item returned data', VALUE_OPTIONAL\n ),\n 'weight' => new external_single_structure(\n self::grades_table_column(), 'weight column', VALUE_OPTIONAL\n ),\n 'grade' => new external_single_structure(\n self::grades_table_column(), 'grade column', VALUE_OPTIONAL\n ),\n 'range' => new external_single_structure(\n self::grades_table_column(), 'range column', VALUE_OPTIONAL\n ),\n 'percentage' => new external_single_structure(\n self::grades_table_column(), 'percentage column', VALUE_OPTIONAL\n ),\n 'lettergrade' => new external_single_structure(\n self::grades_table_column(), 'lettergrade column', VALUE_OPTIONAL\n ),\n 'rank' => new external_single_structure(\n self::grades_table_column(), 'rank column', VALUE_OPTIONAL\n ),\n 'average' => new external_single_structure(\n self::grades_table_column(), 'average column', VALUE_OPTIONAL\n ),\n 'feedback' => new external_single_structure(\n self::grades_table_column(), 'feedback column', VALUE_OPTIONAL\n ),\n 'contributiontocoursetotal' => new external_single_structure(\n self::grades_table_column(), 'contributiontocoursetotal column', VALUE_OPTIONAL\n ),\n ), 'table'\n )\n )\n )\n )\n ),\n 'warnings' => new external_warnings()\n )\n );\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
/* getWsagObject receives in serializedData the object information in xml must returns a eu.atos.sla.parser.data.wsag.Agreement
[ "@Override\n public Agreement getWsagObject(String serializedData) throws ParserException{\n Agreement agreementXML = null;\n try{\n logger.info(\"Will parse {}\", serializedData);\n JAXBContext jaxbContext = JAXBContext.newInstance(Agreement.class);\n Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();\n jaxbUnmarshaller.setEventHandler(new ValidationHandler());\n agreementXML = (Agreement)jaxbUnmarshaller.unmarshal(new StringReader(serializedData));\n logger.info(\"Agreement parsed {}\", agreementXML);\n }catch(JAXBException e){\n throw new ParserException(e);\n }\n return agreementXML;\n }" ]
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Visit the given $query parameters into hash representation.
[ "private function visitParameters(Query $query, VisitorInterface $subVisitor): array\n {\n $parametersByLanguage = [\n $query->getLocale() => iterator_to_array(\n $this->visitTranslationParameters($query, $subVisitor)\n ),\n ];\n\n foreach ($query->getAvailableLocales() as $availableLocale) {\n if ($availableLocale === $query->getLocale()) {\n continue;\n }\n\n $translatedQuery = $this->collectionService->loadQuery(\n $query->getId(),\n [$availableLocale],\n false\n );\n\n $parametersByLanguage[$availableLocale] = iterator_to_array(\n $this->visitTranslationParameters(\n $translatedQuery,\n $subVisitor\n )\n );\n }\n\n ksort($parametersByLanguage);\n\n return $parametersByLanguage;\n }" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Try to restore user from data in session. @return void
[ "protected static function restoreFromSession()\n {\n $session = Http\\Session::getInstance();\n\n try {\n $mapper = new UserMapper(Database::get());\n $user = $mapper->findFromSession($session);\n } catch (\\Exception $exception) {\n $user = new Data\\User\\User();\n }\n\n static::$user = $user;\n }" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// Init will initialize or reset a StringTree.
[ "func (t *StringTree) Init(flags byte) *StringTree {\n\tt.Tree.Init(stringCompare, flags)\n\treturn t\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true,writeDirectory);\n \n }" ]
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Resize the given BufferedImage. @param originalImage the original image @param formatName the format name @param targetWidth the target width @param targetHeight the target height @return the byte[]
[ "public static byte[] resize(final BufferedImage originalImage, final String formatName,\n\t\tfinal int targetWidth, final int targetHeight)\n\t{\n\t\treturn resize(originalImage, Scalr.Method.QUALITY, Scalr.Mode.FIT_EXACT, formatName,\n\t\t\ttargetWidth, targetHeight);\n\t}" ]
[ "@SuppressWarnings(\"deprecation\")\n @Override\n public RenderedImage create(ParameterBlock paramBlock, RenderingHints renderHints) {\n ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);\n\n RenderedImage source = paramBlock.getRenderedSource(0);\n double scaleX = paramBlock.getDoubleParameter(0);\n double scaleY = paramBlock.getDoubleParameter(1);\n\n // Check and see if we are scaling by 1.0 in both x and y and no\n // translations. If so return the source directly. \n if (scaleX == 1.0 && scaleY == 1.0) {\n return source;\n }\n\n return new LanczosOpImage(source, layout, renderHints, scaleX, scaleY);\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Close a ResultSet @param rs a database ResultSet object
[ "public static void closeResultSet(final ResultSet rs) {\n if (rs == null) {\n return;\n }\n\n try {\n rs.close();\n } catch (Exception e) {\n if (LOG.isWarnEnabled()) LOG.warn(\"Error closing ResultSet: \" + rs, e);\n }\n }" ]
[ "public void open() throws DBException\n {\n if (this.isOpen())\n return; // Ignore if already open\n this.getRecord().handleInitialKey(); // Set up the smaller key\n this.getRecord().handleEndKey(); // Set up the larger key\n // You can't process a QueryRecord using tables, use special table logic.\n ((QueryRecord)m_record).openTableQuery();\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Recurse through the data tree and fill an array of paths that reference the nodes in the decoded JSON data structure. @param mixed $s Decoded JSON data (decoded with json_decode) @param string $r The current path key (for example: '#children.0').
[ "private function getPaths(&$s, $r = \"#\")\n {\n $this->paths[$r] = &$s;\n if (is_array($s) || is_object($s)) {\n foreach ($s as $k => &$v) {\n if ($k !== \"\\$ref\") {\n $this->getPaths($v, $r == \"#\" ? \"#{$k}\" : \"{$r}.{$k}\");\n }\n }\n }\n }" ]
[ "function(json_data){\n bbop_rest_response.json.call(this, json_data);\n //console.log('_is_a', this._is_a);\n this._is_a = 'bbop-response-golr';\n //console.log('_is_a', this._is_a);\n\n // The setting of:\n // this._raw (as JSON)\n // this._raw_string (incoming arg)\n // this._okay (parsability)\n // are left to the superclass.\n\n // Cache for repeated calls to success().\n this._success = null;\n\n // Cache for repeated calls to get_doc* functions.\n // These are non-incremental indices--they are either full formed\n // (the first time they are hit) or they are null.\n this._doc_id2index = null;\n this._doc_index2_id = null;\n\n // Cache for repeated calls to resolve labels.\n // This cache is incremental--the more it's used the larger it gets.\n this._doc_label_maps = {}; // {<field_1>: <parsed_json_map_1>, ...}\n\n // For highlight stripping, I just want to compile this once.\n this._hl_regexp = new RegExp(\"\\<\\[\\^\\>\\]\\*\\>\", \"g\");\n\n}" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
TODO handler.addTo
[ "function (name, HandlerClass) {\n\t\tif (!HandlerClass) { return this; }\n\n\t\tvar handler = this[name] = new HandlerClass(this);\n\n\t\tthis._handlers.push(handler);\n\n\t\tif (this.options[name]) {\n\t\t\thandler.enable();\n\t\t}\n\n\t\treturn this;\n\t}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
expression : LNOT expression %prec ULNOT
[ "def p_expression_ulnot(self, p):\n ''\n p[0] = Ulnot(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD CAP\n}" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Checks if the current user has the specified role. @param roleNames the names of the required roles @return true iff the current user has the specified role
[ "public static boolean hasRoles(List<String> roleNames) throws Throwable\n {\n DEADBOLT_HANDLER.beforeRoleCheck();\n\n RoleHolder roleHolder = getRoleHolder();\n\n return roleHolder != null &&\n roleHolder.getRoles() != null &&\n hasAllRoles(roleHolder,\n roleNames.toArray(new String[roleNames.size()]));\n }" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n * (Optional)Callback function to receive the result of the _delete operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~_deleteCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UsersResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Removes users account privileges.\n * This closes one or more user records in the account. Users are never deleted from an account, but closing a user prevents them from using account functions.\n\nThe response returns whether the API execution was successful (200 - OK) or if it failed. The response contains a user structure similar to the request and includes the user changes. If an error occurred during the DELETE operation for any of the users, the response for that user contains an `errorDetails` node with `errorCode` and `message` properties.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback._delete \n * @param {module:model/UserInfoList} optsOrCallback.userInfoList \n * @param {module:api/UsersApi~_deleteCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UsersResponse}\n */\n this._delete = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userInfoList'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling _delete\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n 'delete': optsOrCallback['_delete']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UsersResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the create operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~createCallback\n * @param {String} error Error message, if any.\n * @param {module:model/NewUsersSummary} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds news user to the specified account.\n * Adds new users to your account. Set the `userSettings` property in the request to specify the actions the users can perform on the account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/NewUsersDefinition} optsOrCallback.newUsersDefinition \n * @param {module:api/UsersApi~createCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/NewUsersSummary}\n */\n this.create = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['newUsersDefinition'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling create\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = NewUsersSummary;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'POST',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the createSignatures operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~createSignaturesCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignaturesInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds user Signature and initials images to a Signature.\n * Adds a user signature image and/or user initials image to the specified user. \n\nThe userId property specified in the endpoint must match the authenticated user's userId and the user must be a member of the account.\n\nThe rules and processes associated with this are:\n\n* If Content-Type is set to application/json, then the default behavior for creating a default signature image, based on the name and a DocuSign font, is used.\n* If Content-Type is set to multipart/form-data, then the request must contain a first part with the user signature information, followed by parts that contain the images.\n\nFor each Image part, the Content-Disposition header has a \"filename\" value that is used to map to the `signatureName` and/or `signatureInitials` properties in the JSON to the image. \n\nFor example: \n`Content-Disposition: file; filename=\"Ron Test20121127083900\"`\n\nIf no matching image (by filename value) is found, then the image is not set. One, both, or neither of the signature and initials images can be set with this call.\n\nThe Content-Transfer-Encoding: base64 header, set in the header for the part containing the image, can be set to indicate that the images are formatted as base64 instead of as binary.\n\nIf successful, 200-OK is returned, and a JSON structure containing the signature information is provided, note that the signatureId can change with each API POST, PUT, or DELETE since the changes to the signature structure cause the current signature to be closed, and a new signature record to be created.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserSignaturesInformation} optsOrCallback.userSignaturesInformation \n * @param {module:api/UsersApi~createSignaturesCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignaturesInformation}\n */\n this.createSignatures = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSignaturesInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling createSignatures\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling createSignatures\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignaturesInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures', 'POST',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteContactWithId operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteContactWithIdCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Replaces a particular contact associated with an account for the DocuSign service.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} contactId The unique identifier of a person in the contacts address book.\n * @param {module:api/UsersApi~deleteContactWithIdCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.deleteContactWithId = function(accountId, contactId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteContactWithId\");\n }\n\n // verify the required parameter 'contactId' is set\n if (contactId == undefined || contactId == null) {\n throw new Error(\"Missing the required parameter 'contactId' when calling deleteContactWithId\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'contactId': contactId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts/{contactId}', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteContacts operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteContactsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Delete contacts associated with an account for the DocuSign service.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/ContactModRequest} optsOrCallback.contactModRequest \n * @param {module:api/UsersApi~deleteContactsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.deleteContacts = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['contactModRequest'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteContacts\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteCustomSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteCustomSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/CustomSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Deletes custom user settings for a specified user.\n * Deletes the specified custom user settings for a single user.\n\n###Deleting Grouped Custom User Settings###\n\nIf the custom user settings you want to delete are grouped, you must include the following information in the header, after Content-Type, in the request:\n\n`X-DocuSign-User-Settings-Key:group_name`\n\nWhere the `group_name` is your designated name for the group of customer user settings.\n\nIf the extra header information is not included, only the custom user settings that were added without a group are deleted.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/CustomSettingsInformation} optsOrCallback.customSettingsInformation \n * @param {module:api/UsersApi~deleteCustomSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/CustomSettingsInformation}\n */\n this.deleteCustomSettings = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['customSettingsInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteCustomSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteCustomSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = CustomSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/custom_settings', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteProfileImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteProfileImageCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Deletes the user profile image for the specified user.\n * Deletes the user profile image from the specified user's profile.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~deleteProfileImageCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.deleteProfileImage = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteProfileImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteProfileImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile/image', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteSignature operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteSignatureCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Removes removes signature information for the specified user.\n * Removes the signature information for the user.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {module:api/UsersApi~deleteSignatureCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.deleteSignature = function(accountId, userId, signatureId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteSignature\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteSignature\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling deleteSignature\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteSignatureImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteSignatureImageCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Deletes the user initials image or the user signature image for the specified user.\n * Deletes the specified initials image or signature image for the specified user.\n\nThe function deletes one or the other of the image types, to delete both the initials image and signature image you must call the endpoint twice.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {String} imageType One of **signature_image** or **initials_image**.\n * @param {module:api/UsersApi~deleteSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.deleteSignatureImage = function(accountId, userId, signatureId, imageType, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteSignatureImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteSignatureImage\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling deleteSignatureImage\");\n }\n\n // verify the required parameter 'imageType' is set\n if (imageType == undefined || imageType == null) {\n throw new Error(\"Missing the required parameter 'imageType' when calling deleteSignatureImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId,\n 'imageType': imageType\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getContactById operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getContactByIdCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactGetResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets a particular contact associated with the user&#39;s account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} contactId The unique identifier of a person in the contacts address book.\n * @param {module:api/UsersApi~getContactByIdCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactGetResponse}\n */\n this.getContactById = function(accountId, contactId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getContactById\");\n }\n\n // verify the required parameter 'contactId' is set\n if (contactId == undefined || contactId == null) {\n throw new Error(\"Missing the required parameter 'contactId' when calling getContactById\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'contactId': contactId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactGetResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts/{contactId}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getInformation operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getInformationCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets the user information for a specified user.\n * Retrieves the user information for the specified user. \n\nTo return additional user information that details the last login date, login status, and the user's password expiration date, set the optional `additional_info` query string parameter to **true**.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.additionalInfo When set to **true**, the full list of user information is returned for each user in the account.\n * @param {String} optsOrCallback.email \n * @param {module:api/UsersApi~getInformationCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformation}\n */\n this.getInformation = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getInformation\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getInformation\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n 'additional_info': optsOrCallback['additionalInfo'],\n 'email': optsOrCallback['email']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getProfile operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getProfileCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserProfile} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the user profile for a specified user.\n * Retrieves the user profile information, the privacy settings and personal information (address, phone number, etc.) for the specified user.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~getProfileCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserProfile}\n */\n this.getProfile = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getProfile\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getProfile\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserProfile;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getProfileImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getProfileImageCallback\n * @param {String} error Error message, if any.\n * @param {Object} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the user profile image for the specified user.\n * Retrieves the user profile picture for the specified user. The image is returned in the same format as uploaded.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.\n\nIf successful, the response returns a 200 - OK and the user profile image.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.encoding \n * @param {module:api/UsersApi~getProfileImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link Object}\n */\n this.getProfileImage = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getProfileImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getProfileImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n 'encoding': optsOrCallback['encoding']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['image/gif'];\n var returnType = Object;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile/image', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets the user account settings for a specified user.\n * Retrieves a list of the account settings and email notification information for the specified user.\n\nThe response returns the account setting name/value information and the email notification settings for the specified user. For more information about the different user settings, see the [ML:userSettings list].\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~getSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSettingsInformation}\n */\n this.getSettings = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/settings', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getSignature operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getSignatureCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets the user signature information for the specified user.\n * Retrieves the structure of a single signature with a known signature name.\n\nThe userId specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {module:api/UsersApi~getSignatureCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.getSignature = function(accountId, userId, signatureId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getSignature\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getSignature\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling getSignature\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getSignatureImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getSignatureImageCallback\n * @param {String} error Error message, if any.\n * @param {Object} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the user initials image or the user signature image for the specified user.\n * Retrieves the specified initials image or signature image for the specified user. The image is returned in the same format as uploaded. In the request you can specify if the chrome (the added line and identifier around the initial image) is returned with the image.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n\n###### Note: Older envelopes might only have chromed images. If getting the non-chromed image fails, try getting the chromed image.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {String} imageType One of **signature_image** or **initials_image**.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.includeChrome \n * @param {module:api/UsersApi~getSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link Object}\n */\n this.getSignatureImage = function(accountId, userId, signatureId, imageType, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getSignatureImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getSignatureImage\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling getSignatureImage\");\n }\n\n // verify the required parameter 'imageType' is set\n if (imageType == undefined || imageType == null) {\n throw new Error(\"Missing the required parameter 'imageType' when calling getSignatureImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId,\n 'imageType': imageType\n };\n var queryParams = {\n 'include_chrome': optsOrCallback['includeChrome']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['image/gif'];\n var returnType = Object;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the list operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~listCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformationList} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the list of users for the specified account.\n * Retrieves the list of users for the specified account.\n\nThe response returns the list of users for the account along with the information about the result set. If the `additional_info` query was added to the endpoint and set to **true**, the full user information is returned for each user\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.additionalInfo When set to **true**, the full list of user information is returned for each user in the account.\n * @param {String} optsOrCallback.count Number of records to return. The number must be greater than 0 and less than or equal to 100. \n * @param {String} optsOrCallback.email \n * @param {String} optsOrCallback.emailSubstring Filters the returned user records by the email address or a sub-string of email address.\n * @param {String} optsOrCallback.groupId Filters user records returned by one or more group Id&#39;s.\n * @param {String} optsOrCallback.loginStatus \n * @param {String} optsOrCallback.notGroupId \n * @param {String} optsOrCallback.startPosition Starting value for the list. \n * @param {String} optsOrCallback.status \n * @param {String} optsOrCallback.userNameSubstring Filters the user records returned by the user name or a sub-string of user name.\n * @param {module:api/UsersApi~listCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformationList}\n */\n this.list = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling list\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n 'additional_info': optsOrCallback['additionalInfo'],\n 'count': optsOrCallback['count'],\n 'email': optsOrCallback['email'],\n 'email_substring': optsOrCallback['emailSubstring'],\n 'group_id': optsOrCallback['groupId'],\n 'login_status': optsOrCallback['loginStatus'],\n 'not_group_id': optsOrCallback['notGroupId'],\n 'start_position': optsOrCallback['startPosition'],\n 'status': optsOrCallback['status'],\n 'user_name_substring': optsOrCallback['userNameSubstring']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformationList;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the listCustomSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~listCustomSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/CustomSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the custom user settings for a specified user.\n * Retrieves a list of custom user settings for a single user.\n\nCustom settings provide a flexible way to store and retrieve custom user information that can be used in your own system.\n\n###### Note: Custom user settings are not the same as user account settings.\n\n###Getting Grouped Custom User Settings###\n\nIf the custom user settings you want to retrieve are grouped, you must include the following information in the header, after Content-Type, in the request:\n\n`X-DocuSign-User-Settings-Key:group_name`\n\nWhere the `group_name` is your designated name for the group of customer user settings.\n\nIf the extra header information is not included, only the custom user settings that were added without a group are retrieved.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~listCustomSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/CustomSettingsInformation}\n */\n this.listCustomSettings = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling listCustomSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling listCustomSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = CustomSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/custom_settings', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the listSignatures operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~listSignaturesCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignaturesInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves a list of user signature definitions for a specified user.\n * Retrieves the signature definitions for the specified user.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.stampType \n * @param {module:api/UsersApi~listSignaturesCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignaturesInformation}\n */\n this.listSignatures = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling listSignatures\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling listSignatures\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n 'stamp_type': optsOrCallback['stampType']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignaturesInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the postContacts operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~postContactsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Imports multiple new contacts into the contacts collection from CSV, JSON, or XML (based on content type).\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/ContactModRequest} optsOrCallback.contactModRequest \n * @param {module:api/UsersApi~postContactsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.postContacts = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['contactModRequest'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling postContacts\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts', 'POST',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the putContacts operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~putContactsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Replaces contacts associated with an account for the DocuSign service.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/ContactModRequest} optsOrCallback.contactModRequest \n * @param {module:api/UsersApi~putContactsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.putContacts = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['contactModRequest'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling putContacts\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateCustomSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateCustomSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/CustomSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds or updates custom user settings for the specified user.\n * Adds or updates custom user settings for the specified user.\n\n###### Note: Custom user settings are not the same as user account settings.\n\nCustom settings provide a flexible way to store and retrieve custom user information that you can use in your own system.\n\n**Important**: There is a limit on the size for all the custom user settings for a single user. The limit is 4,000 characters, which includes the XML and JSON structure for the settings.\n\n### Grouping Custom User Settings ###\n\nYou can group custom user settings when adding them. Grouping allows you to retrieve settings that are in a specific group, instead of retrieving all the user custom settings.\n\nTo group custom user settings, add the following information in the header, after Content-Type:\n\n`X-DocuSign-User-Settings-Key:group_name`\n\nWhere the `group_name` is your designated name for the group of customer user settings. Grouping is shown in the Example Request Body below.\n\nWhen getting or deleting grouped custom user settings, you must include the extra header information.\n\nGrouping custom user settings is not required and if the extra header information is not included, the custom user settings are added normally and can be retrieved or deleted without including the additional header.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/CustomSettingsInformation} optsOrCallback.customSettingsInformation \n * @param {module:api/UsersApi~updateCustomSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/CustomSettingsInformation}\n */\n this.updateCustomSettings = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['customSettingsInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateCustomSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateCustomSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = CustomSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/custom_settings', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateProfile operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateProfileCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user profile information for the specified user.\n * Updates the user's detail information, profile information, privacy settings, and personal information in the user ID card.\n\nYou can also change a user's name by changing the information in the `userDetails` property. When changing a user's name, you can either change the information in the `userName` property OR change the information in `firstName`, `middleName`, `lastName, suffixName`, and `title` properties. Changes to `firstName`, `middleName`, `lastName`, `suffixName`, and `title` properties take precedence over changes to the `userName` property.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserProfile} optsOrCallback.userProfile \n * @param {module:api/UsersApi~updateProfileCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.updateProfile = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userProfile'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateProfile\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateProfile\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateProfileImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateProfileImageCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user profile image for a specified user.\n * Updates the user profile image by uploading an image to the user profile.\n\nThe supported image formats are: gif, png, jpeg, and bmp. The file must be less than 200K. For best viewing results, DocuSign recommends that the image is no more than 79 pixels wide and high.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~updateProfileImageCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.updateProfileImage = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateProfileImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateProfileImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = ['image/gif'];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile/image', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSettingsCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user account settings for a specified user.\n * Updates the account settings list and email notification types for the specified user.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserSettingsInformation} optsOrCallback.userSettingsInformation \n * @param {module:api/UsersApi~updateSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.updateSettings = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSettingsInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/settings', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSignature operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSignatureCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user signature for a specified user.\n * Creates, or updates, the signature font and initials for the specified user. When creating a signature, you use this resource to create the signature name and then add the signature and initials images into the signature.\n\n###### Note: This will also create a default signature for the user when one does not exist.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.closeExistingSignature When set to **true**, closes the current signature.\n * @param {module:model/UserSignatureDefinition} optsOrCallback.userSignatureDefinition \n * @param {module:api/UsersApi~updateSignatureCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.updateSignature = function(accountId, userId, signatureId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSignatureDefinition'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSignature\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSignature\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling updateSignature\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId\n };\n var queryParams = {\n 'close_existing_signature': optsOrCallback['closeExistingSignature']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSignatureImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSignatureImageCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user signature image or user initials image for the specified user.\n * Updates the user signature image or user initials image for the specified user. The supported image formats for this file are: gif, png, jpeg, and bmp. The file must be less than 200K.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {String} imageType One of **signature_image** or **initials_image**.\n * @param {module:api/UsersApi~updateSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.updateSignatureImage = function(accountId, userId, signatureId, imageType, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSignatureImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSignatureImage\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling updateSignatureImage\");\n }\n\n // verify the required parameter 'imageType' is set\n if (imageType == undefined || imageType == null) {\n throw new Error(\"Missing the required parameter 'imageType' when calling updateSignatureImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId,\n 'imageType': imageType\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = ['image/gif'];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSignatures operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSignaturesCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignaturesInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds/updates a user signature.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserSignaturesInformation} optsOrCallback.userSignaturesInformation \n * @param {module:api/UsersApi~updateSignaturesCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignaturesInformation}\n */\n this.updateSignatures = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSignaturesInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSignatures\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSignatures\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignaturesInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateUser operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateUserCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the specified user information.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserInformation} optsOrCallback.userInformation \n * @param {module:api/UsersApi~updateUserCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformation}\n */\n this.updateUser = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateUser\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateUser\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateUsers operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateUsersCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformationList} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Change one or more user in the specified account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserInformationList} optsOrCallback.userInformationList \n * @param {module:api/UsersApi~updateUsersCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformationList}\n */\n this.updateUsers = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userInformationList'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateUsers\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformationList;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
Create an instance of {@link JAXBElement }{@code <}{@link ArithType }{@code >}}
[ "@XmlElementDecl(namespace = \"http://www.w3.org/1998/Math/MathML\", name = \"abs\")\n public JAXBElement<ArithType> createAbs(ArithType value) {\n return new JAXBElement<ArithType>(_Abs_QNAME, ArithType.class, null, value);\n }" ]
[ "@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// SetStatus sets the completion status of the Package.
[ "func (p *Package) SetStatus(inc JobStatus) {\n\tp.statusLock.Lock()\n\tdefer p.statusLock.Unlock()\n\n\tp.status = inc\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true,writeDirectory);\n \n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns warning according to GetSystemPowerStatus().BatteryLifeTime/BatteryLifePercent @raise WindowsError if any underlying error occures.
[ "def get_low_battery_warning_level(self):\n \n power_status = SYSTEM_POWER_STATUS()\n if not GetSystemPowerStatus(pointer(power_status)):\n raise WinError()\n\n if POWER_TYPE_MAP[power_status.ACLineStatus] == common.POWER_TYPE_AC:\n return common.LOW_BATTERY_WARNING_NONE\n else:\n if power_status.BatteryLifeTime != -1 and power_status.BatteryLifeTime <= 600:\n return common.LOW_BATTERY_WARNING_FINAL\n elif power_status.BatteryLifePercent <= 22:\n return common.LOW_BATTERY_WARNING_EARLY\n else:\n return common.LOW_BATTERY_WARNING_NONE" ]
[ "public DeviceData command_inout(TacoTangoDevice tacoDevice, String command, DeviceData argin) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about N/A:" }
Create a CryptKey instance without permissions check. @param string $key @return \League\OAuth2\Server\CryptKey
[ "protected function makeCryptKey($type)\n {\n $key = str_replace('\\\\n', \"\\n\", $this->app->make(Config::class)->get('passport.'.$type.'_key'));\n\n if (! $key) {\n $key = 'file://'.Passport::keyPath('oauth-'.$type.'.key');\n }\n\n return new CryptKey($key, null, false);\n }" ]
[ "private function registerOAuthApp()\n {\n $oauth = new OAuthApp();\n $this->app->instance(\\Acacha\\LaravelSocial\\Services\\OAuthApp::class, $oauth);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets a configuration. @param key the configuration key @return a map, or null if the key is not found
[ "public synchronized Map<String, Object> getConfiguration(String key) {\n\t\treturn Optional.ofNullable(inventory.get(key))\n\t\t\t\t.flatMap(v->v.getConfiguration())\n\t\t\t\t.map(v->v.getMap())\n\t\t\t\t.orElse(null);\n\t}" ]
[ "function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ref that was requested, and the value is a\n // promise for the content of that schema.\n this._refsRequested = {};\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// Start starts the scheduler
[ "func (s *scheduler) Start() error {\n\tif s.metricManager == nil {\n\t\tschedulerLogger.WithFields(log.Fields{\n\t\t\t\"_block\": \"start-scheduler\",\n\t\t\t\"_error\": ErrMetricManagerNotSet.Error(),\n\t\t}).Error(\"error on scheduler start\")\n\t\treturn ErrMetricManagerNotSet\n\t}\n\ts.state = schedulerStarted\n\tschedulerLogger.WithFields(log.Fields{\n\t\t\"_block\": \"start-scheduler\",\n\t}).Info(\"scheduler started\")\n\n\t//Autodiscover\n\tautoDiscoverPaths := s.metricManager.GetAutodiscoverPaths()\n\tif autoDiscoverPaths != nil && len(autoDiscoverPaths) != 0 {\n\t\tschedulerLogger.WithFields(log.Fields{\n\t\t\t\"_block\": \"start-scheduler\",\n\t\t}).Info(\"auto discover path is enabled\")\n\t\tfor _, pa := range autoDiscoverPaths {\n\t\t\tfullPath, err := filepath.Abs(pa)\n\t\t\tif err != nil {\n\t\t\t\tschedulerLogger.WithFields(log.Fields{\n\t\t\t\t\t\"_block\": \"start-scheduler\",\n\t\t\t\t\t\"autodiscoverpath\": pa,\n\t\t\t\t}).Fatal(err)\n\t\t\t}\n\t\t\tschedulerLogger.WithFields(log.Fields{\n\t\t\t\t\"_block\": \"start-scheduler\",\n\t\t\t}).Info(\"autoloading tasks from: \", fullPath)\n\t\t\tfiles, err := ioutil.ReadDir(fullPath)\n\t\t\tif err != nil {\n\t\t\t\tschedulerLogger.WithFields(log.Fields{\n\t\t\t\t\t\"_block\": \"start-scheduler\",\n\t\t\t\t\t\"autodiscoverpath\": pa,\n\t\t\t\t}).Fatal(err)\n\t\t\t}\n\t\t\tvar taskFiles []os.FileInfo\n\t\t\tfor _, file := range files {\n\t\t\t\tif file.IsDir() {\n\t\t\t\t\tschedulerLogger.WithFields(log.Fields{\n\t\t\t\t\t\t\"_block\": \"start-scheduler\",\n\t\t\t\t\t\t\"autodiscoverpath\": pa,\n\t\t\t\t\t}).Warning(\"Ignoring subdirectory: \", file.Name())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// tasks files (JSON and YAML)\n\t\t\t\tfname := strings.ToLower(file.Name())\n\t\t\t\tif !strings.HasSuffix(fname, \".json\") && !strings.HasSuffix(fname, \".yaml\") && !strings.HasSuffix(fname, \".yml\") {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttaskFiles = append(taskFiles, file)\n\t\t\t}\n\t\t\tautoDiscoverTasks(taskFiles, fullPath, s.CreateTask)\n\t\t}\n\t} else {\n\t\tschedulerLogger.WithFields(log.Fields{\n\t\t\t\"_block\": \"start-scheduler\",\n\t\t}).Info(\"auto discover path is disabled\")\n\t}\n\n\treturn nil\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAREFUL : doesnt make sense if this node only run a one-time task...\n # TODO: futures and ThreadPoolExecutor (so we dont need to manage the pool ourselves)\n else:\n return False" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
A specific, existing tag can be deleted by making a DELETE request on the URL for that tag. Returns an empty data record. @param tag The tag to delete. @return response
[ "public function delete($tag, $params = array(), $options = array())\n {\n $path = sprintf(\"/tags/%s\", $tag);\n return $this->client->delete($path, $params, $options);\n }" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n * (Optional)Callback function to receive the result of the _delete operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~_deleteCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UsersResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Removes users account privileges.\n * This closes one or more user records in the account. Users are never deleted from an account, but closing a user prevents them from using account functions.\n\nThe response returns whether the API execution was successful (200 - OK) or if it failed. The response contains a user structure similar to the request and includes the user changes. If an error occurred during the DELETE operation for any of the users, the response for that user contains an `errorDetails` node with `errorCode` and `message` properties.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback._delete \n * @param {module:model/UserInfoList} optsOrCallback.userInfoList \n * @param {module:api/UsersApi~_deleteCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UsersResponse}\n */\n this._delete = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userInfoList'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling _delete\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n 'delete': optsOrCallback['_delete']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UsersResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the create operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~createCallback\n * @param {String} error Error message, if any.\n * @param {module:model/NewUsersSummary} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds news user to the specified account.\n * Adds new users to your account. Set the `userSettings` property in the request to specify the actions the users can perform on the account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/NewUsersDefinition} optsOrCallback.newUsersDefinition \n * @param {module:api/UsersApi~createCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/NewUsersSummary}\n */\n this.create = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['newUsersDefinition'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling create\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = NewUsersSummary;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'POST',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the createSignatures operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~createSignaturesCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignaturesInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds user Signature and initials images to a Signature.\n * Adds a user signature image and/or user initials image to the specified user. \n\nThe userId property specified in the endpoint must match the authenticated user's userId and the user must be a member of the account.\n\nThe rules and processes associated with this are:\n\n* If Content-Type is set to application/json, then the default behavior for creating a default signature image, based on the name and a DocuSign font, is used.\n* If Content-Type is set to multipart/form-data, then the request must contain a first part with the user signature information, followed by parts that contain the images.\n\nFor each Image part, the Content-Disposition header has a \"filename\" value that is used to map to the `signatureName` and/or `signatureInitials` properties in the JSON to the image. \n\nFor example: \n`Content-Disposition: file; filename=\"Ron Test20121127083900\"`\n\nIf no matching image (by filename value) is found, then the image is not set. One, both, or neither of the signature and initials images can be set with this call.\n\nThe Content-Transfer-Encoding: base64 header, set in the header for the part containing the image, can be set to indicate that the images are formatted as base64 instead of as binary.\n\nIf successful, 200-OK is returned, and a JSON structure containing the signature information is provided, note that the signatureId can change with each API POST, PUT, or DELETE since the changes to the signature structure cause the current signature to be closed, and a new signature record to be created.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserSignaturesInformation} optsOrCallback.userSignaturesInformation \n * @param {module:api/UsersApi~createSignaturesCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignaturesInformation}\n */\n this.createSignatures = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSignaturesInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling createSignatures\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling createSignatures\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignaturesInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures', 'POST',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteContactWithId operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteContactWithIdCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Replaces a particular contact associated with an account for the DocuSign service.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} contactId The unique identifier of a person in the contacts address book.\n * @param {module:api/UsersApi~deleteContactWithIdCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.deleteContactWithId = function(accountId, contactId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteContactWithId\");\n }\n\n // verify the required parameter 'contactId' is set\n if (contactId == undefined || contactId == null) {\n throw new Error(\"Missing the required parameter 'contactId' when calling deleteContactWithId\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'contactId': contactId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts/{contactId}', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteContacts operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteContactsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Delete contacts associated with an account for the DocuSign service.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/ContactModRequest} optsOrCallback.contactModRequest \n * @param {module:api/UsersApi~deleteContactsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.deleteContacts = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['contactModRequest'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteContacts\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteCustomSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteCustomSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/CustomSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Deletes custom user settings for a specified user.\n * Deletes the specified custom user settings for a single user.\n\n###Deleting Grouped Custom User Settings###\n\nIf the custom user settings you want to delete are grouped, you must include the following information in the header, after Content-Type, in the request:\n\n`X-DocuSign-User-Settings-Key:group_name`\n\nWhere the `group_name` is your designated name for the group of customer user settings.\n\nIf the extra header information is not included, only the custom user settings that were added without a group are deleted.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/CustomSettingsInformation} optsOrCallback.customSettingsInformation \n * @param {module:api/UsersApi~deleteCustomSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/CustomSettingsInformation}\n */\n this.deleteCustomSettings = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['customSettingsInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteCustomSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteCustomSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = CustomSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/custom_settings', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteProfileImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteProfileImageCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Deletes the user profile image for the specified user.\n * Deletes the user profile image from the specified user's profile.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~deleteProfileImageCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.deleteProfileImage = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteProfileImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteProfileImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile/image', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteSignature operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteSignatureCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Removes removes signature information for the specified user.\n * Removes the signature information for the user.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {module:api/UsersApi~deleteSignatureCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.deleteSignature = function(accountId, userId, signatureId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteSignature\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteSignature\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling deleteSignature\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteSignatureImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteSignatureImageCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Deletes the user initials image or the user signature image for the specified user.\n * Deletes the specified initials image or signature image for the specified user.\n\nThe function deletes one or the other of the image types, to delete both the initials image and signature image you must call the endpoint twice.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {String} imageType One of **signature_image** or **initials_image**.\n * @param {module:api/UsersApi~deleteSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.deleteSignatureImage = function(accountId, userId, signatureId, imageType, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteSignatureImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteSignatureImage\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling deleteSignatureImage\");\n }\n\n // verify the required parameter 'imageType' is set\n if (imageType == undefined || imageType == null) {\n throw new Error(\"Missing the required parameter 'imageType' when calling deleteSignatureImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId,\n 'imageType': imageType\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getContactById operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getContactByIdCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactGetResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets a particular contact associated with the user&#39;s account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} contactId The unique identifier of a person in the contacts address book.\n * @param {module:api/UsersApi~getContactByIdCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactGetResponse}\n */\n this.getContactById = function(accountId, contactId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getContactById\");\n }\n\n // verify the required parameter 'contactId' is set\n if (contactId == undefined || contactId == null) {\n throw new Error(\"Missing the required parameter 'contactId' when calling getContactById\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'contactId': contactId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactGetResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts/{contactId}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getInformation operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getInformationCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets the user information for a specified user.\n * Retrieves the user information for the specified user. \n\nTo return additional user information that details the last login date, login status, and the user's password expiration date, set the optional `additional_info` query string parameter to **true**.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.additionalInfo When set to **true**, the full list of user information is returned for each user in the account.\n * @param {String} optsOrCallback.email \n * @param {module:api/UsersApi~getInformationCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformation}\n */\n this.getInformation = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getInformation\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getInformation\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n 'additional_info': optsOrCallback['additionalInfo'],\n 'email': optsOrCallback['email']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getProfile operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getProfileCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserProfile} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the user profile for a specified user.\n * Retrieves the user profile information, the privacy settings and personal information (address, phone number, etc.) for the specified user.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~getProfileCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserProfile}\n */\n this.getProfile = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getProfile\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getProfile\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserProfile;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getProfileImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getProfileImageCallback\n * @param {String} error Error message, if any.\n * @param {Object} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the user profile image for the specified user.\n * Retrieves the user profile picture for the specified user. The image is returned in the same format as uploaded.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.\n\nIf successful, the response returns a 200 - OK and the user profile image.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.encoding \n * @param {module:api/UsersApi~getProfileImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link Object}\n */\n this.getProfileImage = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getProfileImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getProfileImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n 'encoding': optsOrCallback['encoding']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['image/gif'];\n var returnType = Object;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile/image', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets the user account settings for a specified user.\n * Retrieves a list of the account settings and email notification information for the specified user.\n\nThe response returns the account setting name/value information and the email notification settings for the specified user. For more information about the different user settings, see the [ML:userSettings list].\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~getSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSettingsInformation}\n */\n this.getSettings = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/settings', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getSignature operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getSignatureCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets the user signature information for the specified user.\n * Retrieves the structure of a single signature with a known signature name.\n\nThe userId specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {module:api/UsersApi~getSignatureCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.getSignature = function(accountId, userId, signatureId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getSignature\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getSignature\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling getSignature\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getSignatureImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getSignatureImageCallback\n * @param {String} error Error message, if any.\n * @param {Object} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the user initials image or the user signature image for the specified user.\n * Retrieves the specified initials image or signature image for the specified user. The image is returned in the same format as uploaded. In the request you can specify if the chrome (the added line and identifier around the initial image) is returned with the image.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n\n###### Note: Older envelopes might only have chromed images. If getting the non-chromed image fails, try getting the chromed image.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {String} imageType One of **signature_image** or **initials_image**.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.includeChrome \n * @param {module:api/UsersApi~getSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link Object}\n */\n this.getSignatureImage = function(accountId, userId, signatureId, imageType, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getSignatureImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getSignatureImage\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling getSignatureImage\");\n }\n\n // verify the required parameter 'imageType' is set\n if (imageType == undefined || imageType == null) {\n throw new Error(\"Missing the required parameter 'imageType' when calling getSignatureImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId,\n 'imageType': imageType\n };\n var queryParams = {\n 'include_chrome': optsOrCallback['includeChrome']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['image/gif'];\n var returnType = Object;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the list operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~listCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformationList} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the list of users for the specified account.\n * Retrieves the list of users for the specified account.\n\nThe response returns the list of users for the account along with the information about the result set. If the `additional_info` query was added to the endpoint and set to **true**, the full user information is returned for each user\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.additionalInfo When set to **true**, the full list of user information is returned for each user in the account.\n * @param {String} optsOrCallback.count Number of records to return. The number must be greater than 0 and less than or equal to 100. \n * @param {String} optsOrCallback.email \n * @param {String} optsOrCallback.emailSubstring Filters the returned user records by the email address or a sub-string of email address.\n * @param {String} optsOrCallback.groupId Filters user records returned by one or more group Id&#39;s.\n * @param {String} optsOrCallback.loginStatus \n * @param {String} optsOrCallback.notGroupId \n * @param {String} optsOrCallback.startPosition Starting value for the list. \n * @param {String} optsOrCallback.status \n * @param {String} optsOrCallback.userNameSubstring Filters the user records returned by the user name or a sub-string of user name.\n * @param {module:api/UsersApi~listCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformationList}\n */\n this.list = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling list\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n 'additional_info': optsOrCallback['additionalInfo'],\n 'count': optsOrCallback['count'],\n 'email': optsOrCallback['email'],\n 'email_substring': optsOrCallback['emailSubstring'],\n 'group_id': optsOrCallback['groupId'],\n 'login_status': optsOrCallback['loginStatus'],\n 'not_group_id': optsOrCallback['notGroupId'],\n 'start_position': optsOrCallback['startPosition'],\n 'status': optsOrCallback['status'],\n 'user_name_substring': optsOrCallback['userNameSubstring']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformationList;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the listCustomSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~listCustomSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/CustomSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the custom user settings for a specified user.\n * Retrieves a list of custom user settings for a single user.\n\nCustom settings provide a flexible way to store and retrieve custom user information that can be used in your own system.\n\n###### Note: Custom user settings are not the same as user account settings.\n\n###Getting Grouped Custom User Settings###\n\nIf the custom user settings you want to retrieve are grouped, you must include the following information in the header, after Content-Type, in the request:\n\n`X-DocuSign-User-Settings-Key:group_name`\n\nWhere the `group_name` is your designated name for the group of customer user settings.\n\nIf the extra header information is not included, only the custom user settings that were added without a group are retrieved.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~listCustomSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/CustomSettingsInformation}\n */\n this.listCustomSettings = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling listCustomSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling listCustomSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = CustomSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/custom_settings', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the listSignatures operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~listSignaturesCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignaturesInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves a list of user signature definitions for a specified user.\n * Retrieves the signature definitions for the specified user.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.stampType \n * @param {module:api/UsersApi~listSignaturesCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignaturesInformation}\n */\n this.listSignatures = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling listSignatures\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling listSignatures\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n 'stamp_type': optsOrCallback['stampType']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignaturesInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the postContacts operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~postContactsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Imports multiple new contacts into the contacts collection from CSV, JSON, or XML (based on content type).\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/ContactModRequest} optsOrCallback.contactModRequest \n * @param {module:api/UsersApi~postContactsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.postContacts = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['contactModRequest'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling postContacts\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts', 'POST',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the putContacts operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~putContactsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Replaces contacts associated with an account for the DocuSign service.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/ContactModRequest} optsOrCallback.contactModRequest \n * @param {module:api/UsersApi~putContactsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.putContacts = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['contactModRequest'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling putContacts\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateCustomSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateCustomSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/CustomSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds or updates custom user settings for the specified user.\n * Adds or updates custom user settings for the specified user.\n\n###### Note: Custom user settings are not the same as user account settings.\n\nCustom settings provide a flexible way to store and retrieve custom user information that you can use in your own system.\n\n**Important**: There is a limit on the size for all the custom user settings for a single user. The limit is 4,000 characters, which includes the XML and JSON structure for the settings.\n\n### Grouping Custom User Settings ###\n\nYou can group custom user settings when adding them. Grouping allows you to retrieve settings that are in a specific group, instead of retrieving all the user custom settings.\n\nTo group custom user settings, add the following information in the header, after Content-Type:\n\n`X-DocuSign-User-Settings-Key:group_name`\n\nWhere the `group_name` is your designated name for the group of customer user settings. Grouping is shown in the Example Request Body below.\n\nWhen getting or deleting grouped custom user settings, you must include the extra header information.\n\nGrouping custom user settings is not required and if the extra header information is not included, the custom user settings are added normally and can be retrieved or deleted without including the additional header.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/CustomSettingsInformation} optsOrCallback.customSettingsInformation \n * @param {module:api/UsersApi~updateCustomSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/CustomSettingsInformation}\n */\n this.updateCustomSettings = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['customSettingsInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateCustomSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateCustomSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = CustomSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/custom_settings', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateProfile operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateProfileCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user profile information for the specified user.\n * Updates the user's detail information, profile information, privacy settings, and personal information in the user ID card.\n\nYou can also change a user's name by changing the information in the `userDetails` property. When changing a user's name, you can either change the information in the `userName` property OR change the information in `firstName`, `middleName`, `lastName, suffixName`, and `title` properties. Changes to `firstName`, `middleName`, `lastName`, `suffixName`, and `title` properties take precedence over changes to the `userName` property.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserProfile} optsOrCallback.userProfile \n * @param {module:api/UsersApi~updateProfileCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.updateProfile = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userProfile'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateProfile\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateProfile\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateProfileImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateProfileImageCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user profile image for a specified user.\n * Updates the user profile image by uploading an image to the user profile.\n\nThe supported image formats are: gif, png, jpeg, and bmp. The file must be less than 200K. For best viewing results, DocuSign recommends that the image is no more than 79 pixels wide and high.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~updateProfileImageCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.updateProfileImage = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateProfileImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateProfileImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = ['image/gif'];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile/image', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSettingsCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user account settings for a specified user.\n * Updates the account settings list and email notification types for the specified user.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserSettingsInformation} optsOrCallback.userSettingsInformation \n * @param {module:api/UsersApi~updateSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.updateSettings = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSettingsInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/settings', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSignature operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSignatureCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user signature for a specified user.\n * Creates, or updates, the signature font and initials for the specified user. When creating a signature, you use this resource to create the signature name and then add the signature and initials images into the signature.\n\n###### Note: This will also create a default signature for the user when one does not exist.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.closeExistingSignature When set to **true**, closes the current signature.\n * @param {module:model/UserSignatureDefinition} optsOrCallback.userSignatureDefinition \n * @param {module:api/UsersApi~updateSignatureCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.updateSignature = function(accountId, userId, signatureId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSignatureDefinition'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSignature\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSignature\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling updateSignature\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId\n };\n var queryParams = {\n 'close_existing_signature': optsOrCallback['closeExistingSignature']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSignatureImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSignatureImageCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user signature image or user initials image for the specified user.\n * Updates the user signature image or user initials image for the specified user. The supported image formats for this file are: gif, png, jpeg, and bmp. The file must be less than 200K.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {String} imageType One of **signature_image** or **initials_image**.\n * @param {module:api/UsersApi~updateSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.updateSignatureImage = function(accountId, userId, signatureId, imageType, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSignatureImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSignatureImage\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling updateSignatureImage\");\n }\n\n // verify the required parameter 'imageType' is set\n if (imageType == undefined || imageType == null) {\n throw new Error(\"Missing the required parameter 'imageType' when calling updateSignatureImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId,\n 'imageType': imageType\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = ['image/gif'];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSignatures operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSignaturesCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignaturesInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds/updates a user signature.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserSignaturesInformation} optsOrCallback.userSignaturesInformation \n * @param {module:api/UsersApi~updateSignaturesCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignaturesInformation}\n */\n this.updateSignatures = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSignaturesInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSignatures\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSignatures\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignaturesInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateUser operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateUserCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the specified user information.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserInformation} optsOrCallback.userInformation \n * @param {module:api/UsersApi~updateUserCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformation}\n */\n this.updateUser = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateUser\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateUser\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateUsers operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateUsersCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformationList} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Change one or more user in the specified account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserInformationList} optsOrCallback.userInformationList \n * @param {module:api/UsersApi~updateUsersCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformationList}\n */\n this.updateUsers = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userInformationList'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateUsers\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformationList;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n }" ]
codesearchnet
{ "query": "Represent the Github description about Metadata management:", "pos": "Represent the Github code about Metadata management:", "neg": "Represent the Github code about Software development:" }
Validate a value @param mixed $value Value to be validated @return bool True when the variable is valid
[ "public function validate($value)\n {\n $result = false;\n\n if (is_string($value) && strlen($value))\n {\n if ($value[0] == '/' || $value[0] == '\\\\'\n || (strlen($value) > 3 && ctype_alpha($value[0])\n && $value[1] == ':'\n && ($value[2] == '\\\\' || $value[2] == '/')\n )\n || null !== parse_url($value, PHP_URL_SCHEME)\n ) {\n $result = true;\n }\n }\n\n return $result;\n }" ]
[ "public function validate( $input )\n {\n // Check if passed input is an object and instance of phpillowDocument\n // at all, otherwise we can exit immediately\n if ( !is_object( $input ) ||\n !( $input instanceof phpillowDocument ) )\n {\n throw new phpillowValidationException( 'Invalid document type provided.', array() );\n }\n\n // If a specific document class is required, check this type is passed,\n // otherwise throw an exception.\n if ( ( $this->documentClass !== false ) &&\n !( $input instanceof $this->documentClass ) )\n {\n throw new phpillowValidationException( 'Invalid document type provided.', array() );\n }\n\n // Check if the document already has an ID assigned, otherwise it has\n // not yet been stored in the database and though is invalid.\n if ( $input->_id === null )\n {\n throw new phpillowValidationException( 'Invalid document type provided.', array() );\n }\n\n // If all above checks has been passed just return the document ID,\n // because that is all we need to store in database.\n return $input->_id;\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about PHP programming:" }
Saves the service and types php code to file @param PhpClass $service @param array $types
[ "public function save(PhpClass $service, array $types)\n {\n $this->setOutputDirectory();\n\n $this->saveClassToFile($service);\n foreach ($types as $type) {\n $this->saveClassToFile($type);\n }\n\n $classes = array_merge(array($service), $types);\n $this->saveAutoloader($service->getIdentifier(), $classes);\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the instruction about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
Gets the list of entries in the specified directory. @param directory the directory to get the entries of. @return the list of entries (never <code>null</code>). @since 1.0
[ "private synchronized List<Entry> getEntriesList( DirectoryEntry directory )\n {\n List<Entry> entries = contents.get( directory );\n if ( entries == null )\n {\n entries = new ArrayList<Entry>();\n contents.put( directory, entries );\n }\n return entries;\n }" ]
[ "function (parameters) {\n\n /**\n * Job identifier.\n * @type {string}\n */\n this.hash = parameters.hash;\n\n /**\n * Array of hashes to {@link Artifact}s containing each requested result.\n * @type {string[]}\n */\n this.resultHashes = parameters.resultHashes || [];\n\n /**\n * Hash to an {@link Artifact} containing the union of all requests results.\n * @type {string}\n */\n this.resultSuperSet = parameters.resultSuperSet || null;\n\n this.userId = parameters.userId || [];\n\n /**\n * Current status of the job.\n * @type {string}\n */\n this.status = parameters.status || null;\n\n /**\n * Timestamp of when the job was created.\n * @type {string}\n */\n this.createTime = parameters.createTime || null;\n\n /**\n * Timestamp of when the job execution started by a worker.\n * @type {string}\n */\n this.startTime = parameters.startTime || null;\n\n /**\n * Timestamp of when the job execution finished on the worker.\n * @type {string}\n */\n this.finishTime = parameters.finishTime || null;\n\n /**\n * Id/label of the worker processing the job.\n * @type {string}\n */\n this.worker = parameters.worker || null;\n\n /**\n * Array of labels for the job.\n * @type {string[]}\n */\n this.labels = parameters.labels || [];\n\n /**\n * The (id) outputNumber (0, 1, 2, ...) of the latest {@link OutputInfo} (for this job) available on the server.\n * When no output is available the number is <b>null</b>.\n * @type {number}\n */\n this.outputNumber = typeof parameters.outputNumber === 'number' ? parameters.outputNumber : null;\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Checks, that option exists in config. @param string $name Option name. @return void @throws ConfigException Thrown when option with a given name doesn't exist.
[ "protected function assertOptionName($name)\n\t{\n\t\tif ( !isset($this->options[$name]) ) {\n\t\t\tthrow new ConfigException(\n\t\t\t\t'Option \"' . $name . '\" doesn\\'t exist in configuration',\n\t\t\t\tConfigException::TYPE_NOT_FOUND\n\t\t\t);\n\t\t}\n\t}" ]
[ "public function get($key, $default = null)\n {\n $this->hydrate();\n\n // Create an Element instance using the data for the key\n if ($this->has($key)) {\n return new $this->model(array_merge($this->items[$key], ['key' => $key]));\n }\n\n // If the key doesn't exist but a default was passed in, return it\n if ($default) {\n return $default;\n }\n\n // if the key doesn't exist, but running locally, throw an exception\n if (App::isLocal()) {\n throw new Exception(\"Element key '{$key}' is not declared in elements.yaml.\");\n }\n\n // Otherwise, like if key doesn't exist and running on production,\n // return an empty Element, whose ->toString() will return an empty string.\n Log::error(\"Element key '{$key}' is not declared in elements.yaml.\");\n return new $this->model();\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
// WeekdayShort returns the locales short weekday given the 'weekday' provided
[ "func (kkj *kkj_CM) WeekdayShort(weekday time.Weekday) string {\n\treturn kkj.daysShort[weekday]\n}" ]
[ "func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\treturn syslogparser.Parse2Digits(buff, cursor, l, 1, 31, ErrDayInvalid)\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about datetime:" }
// For any index defined by IndexFields, if a matcher can match only (a subset) // of objects that return <value> for a given index, a pair (<index name>, <value>) // wil be returned. // TODO: Consider supporting also labels.
[ "func (s *SelectionPredicate) MatcherIndex() []MatchValue {\n\tvar result []MatchValue\n\tfor _, field := range s.IndexFields {\n\t\tif value, ok := s.Field.RequiresExactMatch(field); ok {\n\t\t\tresult = append(result, MatchValue{IndexName: field, Value: value})\n\t\t}\n\t}\n\treturn result\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetId sets the Id field's value.
[ "func (s *GetBucketAnalyticsConfigurationInput) SetId(v string) *GetBucketAnalyticsConfigurationInput {\n\ts.Id = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are different than the class name\n this.type = \"\";\n // Used to provide access to the name of the class \n this.className = \"Rule\";\n // Indicates whether generated nodes should be added to the abstract syntax tree\n this._createAstNode = false;\n // A parser function, computed in a rule's constructor. If successful returns either the original or a new \n // ParseState object. If it fails it returns null.\n this.parser = null;\n // A lexer function, computed in a rule's constructor. The lexer may update the ParseState if successful.\n // If it fails it is required that the lexer restore the ParseState index to the previous state. \n // Lexers should only update the index. \n this.lexer = null;\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Overloaded to display the correctly formatted value for this data type @param array $properties @return string
[ "public function Field($properties = array())\n {\n if ($this->value) {\n $val = Convert::raw2xml($this->value);\n $val = DBCurrency::config()->get('currency_symbol')\n . number_format(preg_replace('/[^0-9.-]/', '', $val), 2);\n $valforInput = Convert::raw2att($val);\n } else {\n $valforInput = '';\n }\n return \"<input class=\\\"text\\\" type=\\\"text\\\" disabled=\\\"disabled\\\"\"\n . \" name=\\\"\" . $this->name . \"\\\" value=\\\"\" . $valforInput . \"\\\" />\";\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
分词时查询到一个用户词典中的词语,此处控制是否接受它 @param begin 起始位置 @param end 终止位置 @param value 词性 @return true 表示接受 @deprecated 自1.6.7起废弃,强制模式下为最长匹配,否则按分词结果合并
[ "protected boolean acceptCustomWord(int begin, int end, CoreDictionary.Attribute value)\n {\n return config.forceCustomDictionary || (end - begin >= 4 && !value.hasNatureStartsWith(\"nr\") && !value.hasNatureStartsWith(\"ns\") && !value.hasNatureStartsWith(\"nt\"));\n }" ]
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //--------------------------------------------------------------------\n //The delimiter \"--\"\n changeDelimiterPOS(linkedArray);\n\n //--------------------------------------------------------------------\n //如果前一个词是数字,当前词以“-”或“-”开始,并且不止这一个字符,\n //那么将此“-”符号从当前词中分离出来。\n //例如 “3 / -4 / 月”需要拆分成“3 / - / 4 / 月”\n splitMiddleSlashFromDigitalWords(linkedArray);\n\n //--------------------------------------------------------------------\n //1、如果当前词是数字,下一个词是“月、日、时、分、秒、月份”中的一个,则合并,且当前词词性是时间\n //2、如果当前词是可以作为年份的数字,下一个词是“年”,则合并,词性为时间,否则为数字。\n //3、如果最后一个汉字是\"点\" ,则认为当前数字是时间\n //4、如果当前串最后一个汉字不是\"∶·./\"和半角的'.''/',那么是数\n //5、当前串最后一个汉字是\"∶·./\"和半角的'.''/',且长度大于1,那么去掉最后一个字符。例如\"1.\"\n checkDateElements(linkedArray);\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about text processing:" }
是否可以删除缓存 @param cacheDeleteKey CacheDeleteKey注解 @param arguments 参数 @param retVal 结果值 @return Can Delete @throws Exception 异常
[ "public boolean isCanDelete(CacheDeleteKey cacheDeleteKey, Object[] arguments, Object retVal) throws Exception {\r\n boolean rv = true;\r\n if (null != arguments && arguments.length > 0 && null != cacheDeleteKey.condition()\r\n && cacheDeleteKey.condition().length() > 0) {\r\n rv = this.getElValue(cacheDeleteKey.condition(), null, arguments, retVal, true, Boolean.class);\r\n }\r\n return rv;\r\n }" ]
[ "public static IPool getPool(String host, Integer port, String database, String... userPwd) {\n //暂未启用\n throw new RuntimeException(\"未找到指定的数据库连接池\");\n }" ]
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Factory function that creates a value. :param value_id: id of the value, used to reference the value within this list.BaseException :param value_class: The class of the value that should be created with this function.
[ "def add(self, value_id, name, value_class):\n \n item = value_class(\n name,\n value_id=self.controller.component_id + \".\" + value_id,\n is_input=self.is_input,\n index=self.count,\n spine = self.controller.spine\n )\n\n #if self._inject and self.controller:\n # setattr(self.controller, value_id, item)\n #setattr(self, value_id, item)\n\n self.count += 1\n self._items[value_id] = item\n if self.is_input and self.controller:\n item.add_observer(self.controller)\n return item" ]
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types\n __suffixes_to_types = {}\n\n # A map with all the registered types, indexed by the type name\n # Each entry is a dictionary with following values:\n # 'base': the name of base type or None if type has no base\n # 'derived': a list of names of type which derive from this one\n # 'scanner': the scanner class registered for this type, if any\n __types = {}\n\n # Caches suffixes for targets with certain properties.\n __target_suffixes_cache = {}" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Updates the state machine context.
[ "void update(long index, Instant instant, Type type) {\n this.index = index;\n this.type = type;\n clock.set(instant);\n }" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadContext\n // in order to re-establish the thread context based on the metadata identity if not defaulted.\n }" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Creates a {@link UTF8StreamJsonParser} from the inputstream with the supplied buf {@code inBuffer} to use.
[ "public static UTF8StreamJsonParser newJsonParser(InputStream in, byte[] buf,\r\n int offset, int limit) throws IOException\r\n {\r\n return newJsonParser(in, buf, offset, limit, false,\r\n new IOContext(DEFAULT_JSON_FACTORY._getBufferRecycler(), in,\r\n false));\r\n }" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadContext\n // in order to re-establish the thread context based on the metadata identity if not defaulted.\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// LoadGopmfile loads and returns given gopmfile.
[ "func LoadGopmfile(fileName string) (*goconfig.ConfigFile, error) {\n\tif !base.IsFile(fileName) {\n\t\treturn goconfig.LoadFromData([]byte(\"\"))\n\t}\n\n\tgf, err := goconfig.LoadConfigFile(fileName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Fail to load gopmfile: %v\", err)\n\t}\n\treturn gf, nil\n}" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github sentence about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
Loads a collection from the database @param array|int|string $condition @return array
[ "public function get($condition)\n {\n $result = null;\n $this->hook->attach('collection.get.before', $condition, $result, $this);\n\n if (isset($result)) {\n return $result;\n }\n\n if (!is_array($condition)) {\n $condition = array('collection_id' => $condition);\n }\n\n $condition['limit'] = array(0, 1);\n $list = (array) $this->getList($condition);\n $result = empty($list) ? array() : reset($list);\n\n $this->hook->attach('collection.get.after', $condition, $result, $this);\n return $result;\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Performs a forward pass using multiple GPUs. This is a simplification of torch.nn.parallel.data_parallel to support the allennlp model interface.
[ "def data_parallel(batch_group: List[TensorDict],\n model: Model,\n cuda_devices: List) -> Dict[str, torch.Tensor]:\n \n assert len(batch_group) <= len(cuda_devices)\n\n moved = [nn_util.move_to_device(batch, device)\n for batch, device in zip(batch_group, cuda_devices)]\n\n used_device_ids = cuda_devices[:len(moved)]\n # Counterintuitively, it appears replicate expects the source device id to be the first element\n # in the device id list. See torch.cuda.comm.broadcast_coalesced, which is called indirectly.\n replicas = replicate(model, used_device_ids)\n\n # We pass all our arguments as kwargs. Create a list of empty tuples of the\n # correct shape to serve as (non-existent) positional arguments.\n inputs = [()] * len(batch_group)\n outputs = parallel_apply(replicas, inputs, moved, used_device_ids)\n\n # Only the 'loss' is needed.\n # a (num_gpu, ) tensor with loss on each GPU\n losses = gather([output['loss'].unsqueeze(0) for output in outputs], used_device_ids[0], 0)\n return {'loss': losses.mean()}" ]
[ "def get_variables(self, *args, **kwargs):\n \"\"\"\"\"\"\n tf.logging.warning(\n \"Calling Sequential.get_variables, which will always return an empty \"\n \"tuple. get_variables() can only return variables created directly by \"\n \"a Module, or created by submodules directly created inside the \"\n \"Module. Sequential is constructed from already constructed submodules \"\n \"and so this will always be empty. See the documentation for more \"\n \"details, but tl;dr if you need to connect some modules sequentially \"\n \"and call get_variables on the result, writing a simple custom module \"\n \"is the simplest way. Another option is to call get_all_variables().\")\n return super(Sequential, self).get_variables(*args, **kwargs)" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Randomly augment a single image tensor. # Arguments sample: 3D or 4D tensor, single sample. seed: random seed. # Returns A randomly transformed version of the input (same shape).
[ "def random_transform(self, sample, seed=None):\n \n img_row_axis = self.row_axis - 1\n img_col_axis = self.col_axis - 1\n img_channel_axis = self.channel_axis - 1\n\n transform_matrix = self.get_random_transform_matrix(sample, seed)\n\n if transform_matrix is not None:\n h, w = sample.shape[img_row_axis], sample.shape[img_col_axis]\n transform_matrix = transform_matrix_offset_center(transform_matrix, h, w)\n sample = apply_transform(sample, transform_matrix, img_channel_axis,\n fill_mode=self.fill_mode, cval=self.cval)\n\n if self.channel_shift_range != 0:\n sample = random_channel_shift(sample,\n self.channel_shift_range,\n img_channel_axis)\n if self.horizontal_flip:\n if np.random.random() < 0.5:\n sample = flip_axis(sample, img_col_axis)\n\n if self.vertical_flip:\n if np.random.random() < 0.5:\n sample = flip_axis(sample, img_row_axis)\n\n return sample" ]
[ "def _default_hparams():\n \"\"\"\"\"\"\n return hparam.HParams(\n # Use this parameter to get comparable perplexity numbers with different\n # tokenizations. This value should be set to the ratio of the number of\n # tokens in the test set according to the tokenization used to the number\n # of tokens in the test set in the \"official\" tokenization. For\n # example, if we are using a word-piece based model and we want to\n # compute per-word perplexity, then we set loss_multiplier to the number\n # of wordpieces per word in the test set.\n loss_multiplier=1.0,\n\n # Use this parameter to allow for larger sequences in the batch. Without\n # the use of this parameter, the size of the inner two dimensions will\n # be used to judge the sequence length.\n batch_size_multiplier=1,\n\n # During inference for autoregressive problems, if the batch_size is 1,\n # the inference will stop when the model predict a text_encoder.EOS_ID\n # token.\n stop_at_eos=False,\n\n # Modalities used to map from features to a space compatible with\n # chosen model architecture. It comprises key-value pairs of a feature\n # name (str) and its modality type.\n modality={},\n vocab_size={},\n\n # Identifiers used to tell the model which input/target space will be\n # expected. For example, it can tell that we expect French as characters\n # as output, or Spanish as sound. Spaces defined as constants in SpaceID\n # class.\n input_space_id=SpaceID.GENERIC,\n target_space_id=SpaceID.GENERIC)" ]
codesearchnet
{ "query": "Represent the Github text about Image processing:", "pos": "Represent the Github code about Image processing:", "neg": "Represent the Github code:" }
Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;ResourceSkuInner&gt; object
[ "public Observable<Page<ResourceSkuInner>> listAsync() {\n return listWithServiceResponseAsync()\n .map(new Func1<ServiceResponse<Page<ResourceSkuInner>>, Page<ResourceSkuInner>>() {\n @Override\n public Page<ResourceSkuInner> call(ServiceResponse<Page<ResourceSkuInner>> response) {\n return response.body();\n }\n });\n }" ]
[ "@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Machine provides access to methods of a state.Machine through the facade.
[ "func (st *State) Machine(tag names.MachineTag) (*Machine, error) {\n\tlife, err := st.machineLife(tag)\n\tif err != nil {\n\t\treturn nil, errors.Annotate(err, \"can't get life for machine\")\n\t}\n\treturn &Machine{\n\t\ttag: tag,\n\t\tlife: life,\n\t\tst: st,\n\t}, nil\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true,writeDirectory);\n \n }" ]
codesearchnet
{ "query": "Represent the text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__OBJ_TYPE:\n\t\t\t\tsetObjType(OBJ_TYPE_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__ARCH_VRSN:\n\t\t\t\tsetArchVrsn(ARCH_VRSN_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__DCA_FN_SET:\n\t\t\t\tsetDCAFnSet(DCA_FN_SET_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__OCA_FN_SET:\n\t\t\t\tsetOCAFnSet(OCA_FN_SET_EDEFAULT);\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license />\n <channel />\n <extends />\n <summary />\n <description />\n <notes />\n <authors />\n <date />\n <time />\n <contents />\n <compatible />\n <dependencies />\n</package>\nEND;\n $this->_packageXml = simplexml_load_string($packageXmlStub);\n }\n return $this;\n }" ]
codesearchnet
{ "query": "Represent the Github description about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
Tries to find a directory with a .git repository
[ "def find_git_repository(self, path):\n \n while path is not None:\n git_path = os.path.join(path,'.git')\n if os.path.exists(git_path) and os.path.isdir(git_path):\n return path\n path = os.path.dirname(path)\n return None" ]
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wtype" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
指定したK値、対象点、データセットを基に局所外れ係数スコアを算出する。<br> 本メソッド呼び出しによってデータセットの更新は行われない。<br> 学習データの更新を伴わないため、高速に処理が可能となっている。 @param kn K値 @param targetPoint 対象点 @param dataSet 学習データセット @return LOFスコア
[ "public static double calculateLofWithoutUpdate(int kn, LofPoint targetPoint, LofDataSet dataSet)\n {\n // 対象点のK距離、K距離近傍を算出する。\n KDistanceResult kResult = calculateKDistance(kn, targetPoint, dataSet);\n\n LofPoint tmpPoint = targetPoint.deepCopy();\n tmpPoint.setkDistance(kResult.getkDistance());\n tmpPoint.setkDistanceNeighbor(kResult.getkDistanceNeighbor());\n\n updateLrd(tmpPoint, dataSet);\n\n // 対象の局所外れ係数を算出する。\n double lof = calculateLof(tmpPoint, dataSet);\n return lof;\n }" ]
[ "func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.ServeHTTP(w, r)\n}" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Sets the time zone for which this <code>Calendar</code> will be resolved. @param \DateTimeZone $timeZone The time zone to use for this Calendar, null if default should be used
[ "public function setTimeZone(\\DateTimeZone $timeZone = null)\n {\n if ($timeZone) {\n $value = $timeZone->getName();\n } else {\n $value = null;\n }\n\n $this->setValue('timezone', $value);\n }" ]
[ "private function to8601Utc(\\DateTimeInterface $dateTime): string\n {\n // Convert to UTC if we can\n if ($dateTime instanceof DateTime) {\n $dateTime->setTimezone(new \\DateTimeZone('UTC'));\n } elseif ($dateTime instanceof \\DateTimeImmutable && $dateTime->getOffset() > 0) {\n // Some implementations will be wrong since we're effectively dropping the offset from the datetime format\n // and this interface doesn't allow us to make modifications so we reject the timestamp altogether to ensure\n // only correct timestamps make it through.\n throw new InvalidArgumentException('Timestamp must be UTC');\n }\n\n // PHP's default 8601 format contains a portion that includes the timezone offset. The Mailbox API doesn't\n // like the offset and requires a timestamp without it, thus requiring all inbound timestamps to be UTC\n return $dateTime->format('Y-m-d\\TH:i:s\\Z');\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Builds thumb uploader @param string $dir Target directory @param integer $quality Desired quality for thumbs @param array $options @return \Krystal\Image\Tool\Upload\Plugin\ThumbFactory
[ "public function build($dir, $quality, array $options = array())\n {\n // Alter default quality on demand\n if (isset($options['quality'])) {\n $quality = $options['quality'];\n }\n\n return new Thumb($dir, $options['dimensions'], $quality);\n }" ]
[ "protected function setGeneratorImages()\n {\n $this->logger->debug('Base:setGeneratorImages');\n $this->setParam('generator', 'images');\n $this->setParam('gimlimit', $this->getLimit());\n }" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Parses a PHP File and returns nested Array of collected Information. @access public @param string $fileName File Name of PHP File to parse @param string $innerPath Base Path to File to be removed in Information @return array
[ "public function parseFile( $fileName, $innerPath )\n\t{\n\t\t$content\t\t= FS_File_Reader::load( $fileName );\n\t\tif( !Alg_Text_Unicoder::isUnicode( $content ) )\n\t\t\t$content\t\t= Alg_Text_Unicoder::convertToUnicode( $content );\n\n\n\t\t$lines\t\t\t= explode( \"\\n\", $content );\n\t\t$fileBlock\t\t= NULL;\n\t\t$openClass\t\t= FALSE;\n\t\t$function\t\t= NULL;\n\t\t$functionBody\t= array();\n\t\t$file\t\t\t= new ADT_PHP_File;\n\t\t$file->setBasename( basename( $fileName ) );\n\t\t$file->setPathname( substr( str_replace( \"\\\\\", \"/\", $fileName ), strlen( $innerPath ) ) );\n\t\t$file->setUri( str_replace( \"\\\\\", \"/\", $fileName ) );\n\t\n\t\t$level\t= 0;\n\t\t$class\t= NULL;\n\t\tdo\n\t\t{\n\t\t\t$line\t= trim( array_shift( $lines ) );\n#\t\t\tremark( ( $openClass ? \"I\" : \"O\" ).\" :: \".$level.\" :: \".$this->lineNumber.\" :: \".$line );\n\t\t\t$this->lineNumber ++;\n\t\t\tif( preg_match( \"@^(<\\?(php)?)|((php)?\\?>)$@\", $line ) )\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif( preg_match( '@}$@', $line ) )\n\t\t\t\t$level--;\n\n\t\t\tif( $line == \"/**\" && $level < 2 )\n\t\t\t{\n\t\t\t\t$list\t= array();\n\t\t\t\twhile( !preg_match( \"@\\*?\\*/\\s*$@\", $line ) )\n\t\t\t\t{\n\t\t\t\t\t$list[]\t= $line;\n\t\t\t\t\t$line\t= trim( array_shift( $lines ) );\n\t\t\t\t\t$this->lineNumber ++;\n\t\t\t\t}\n\t\t\t\tarray_unshift( $lines, $line );\n\t\t\t\t$this->lineNumber --;\n\t\t\t\tif( $list )\n\t\t\t\t{\n\t\t\t\t\t$this->openBlocks[]\t= $this->parseDocBlock( $list );\n\t\t\t\t\tif( !$fileBlock && !$class )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fileBlock\t= array_shift( $this->openBlocks );\n\t\t\t\t\t\tarray_unshift( $this->openBlocks, $fileBlock );\n\t\t\t\t\t\t$this->decorateCodeDataWithDocData( $file, $fileBlock );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif( !$openClass )\n\t\t\t{\n\t\t\t\tif( preg_match( $this->regexClass, $line, $matches ) )\n\t\t\t\t{\n\t\t\t\t\t$parts\t= array_slice( $matches, -1 );\n\t\t\t\t\twhile( !trim( array_pop( $parts ) ) )\n\t\t\t\t\t\tarray_pop( $matches );\n\t\t\t\t\t$class\t= $this->parseClassOrInterface( $file, $matches );\n\t\t\t\t\t$openClass\t= TRUE;\n\t\t\t\t}\n\t\t\t\telse if( preg_match( $this->regexMethod, $line, $matches ) )\n\t\t\t\t{\n\t\t\t\t\t$openClass\t= FALSE;\n\t\t\t\t\t$function\t= $this->parseFunction( $file, $matches );\n\t\t\t\t\t$file->setFunction( $function );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( preg_match( $this->regexClass, $line, $matches ) )\n\t\t\t\t{\n\t\t\t\t\tif( $class instanceof ADT_PHP_Class )\n\t\t\t\t\t\t$file->addClass( $class );\n\t\t\t\t\telse if( $class instanceof ADT_PHP_Interface )\n\t\t\t\t\t\t$file->addInterface( $class );\n\t\t\t\t\tarray_unshift( $lines, $line );\n\t\t\t\t\t$this->lineNumber --;\n\t\t\t\t\t$openClass\t= FALSE;\n\t\t\t\t\t$level\t\t= 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif( preg_match( $this->regexMethod, $line, $matches ) )\n\t\t\t\t{\n\t\t\t\t\t$method\t\t= $this->parseMethod( $class, $matches );\n\t\t\t\t\t$function\t= $matches[6];\n\t\t\t\t\t$class->setMethod( $method );\n\t\t\t\t}\n\t\t\t\telse if( $level <= 1 )\n\t\t\t\t{\n\t\t\t\t\tif( preg_match( $this->regexDocVariable, $line, $matches ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( $openClass && $class )\n\t\t\t\t\t\t\t$this->varBlocks[$class->getName().\"::\".$matches[2]]\t= $this->parseDocMember( $matches );\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->varBlocks[$matches[2]]\t= $this->parseDocVariable( $matches );\n\t\t\t\t\t}\n\t\t\t\t\telse if( preg_match( $this->regexVariable, $line, $matches ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$name\t\t= $matches[4];\n\t\t\t\t\t\tif( $openClass && $class )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$key\t\t= $class->getName().\"::\".$name;\n\t\t\t\t\t\t\t$varBlock\t= isset( $this->varBlocks[$key] ) ? $this->varBlocks[$key] : NULL;\n\t\t\t\t\t\t\t$variable\t= $this->parseMember( $class, $matches, $varBlock ); \n\t\t\t\t\t\t\t$class->setMember( $variable );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tremark( \"Parser Error: found var after class -> not handled yet\" );\n/*\t\t\t\t\t\t\t$key\t\t= $name;\n\t\t\t\t\t\t\t$varBlock\t= isset( $this->varBlocks[$key] ) ? $this->varBlocks[$key] : NULL;\n\t\t\t\t\t\t\t$variable\t= $this->parseMember( $matches, $varBlock );*/\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if( $level > 1 && $function )\n\t\t\t\t{\n\t\t\t\t\t$functionBody[$function][]\t= $line;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( preg_match( '@{$@', $line ) )\n\t\t\t\t$level++;\n\t\t\tif( $level < 1 && !preg_match( $this->regexClass, $line, $matches ) )\n\t\t\t\t$openClass\t= FALSE;\n\t\t}\n\t\twhile( $lines );\n\n\t\t$file->setSourceCode( $content );\n\t\tif( $class )\n\t\t{\n\t\t\tforeach( $class->getMethods() as $methodName => $method )\n\t\t\t\tif( isset( $functionBody[$methodName] ) )\n\t\t\t\t\t$method->setSourceCode( $functionBody[$methodName] );\n\t\t\tif( $class instanceof ADT_PHP_Class )\n\t\t\t\t$file->addClass( $class );\n\t\t\telse if( $class instanceof ADT_PHP_Interface )\n\t\t\t\t$file->addInterface( $class );\n\t\t}\n\t\treturn $file;\n\t}" ]
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, OpenSSL keys & certificates - created success!\".\n \"\\n Location: \".$this->configKeyPath.\"\\n\\n\";\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Determine whether an array value is empty, taking into account casting. @param string $key @param array $value @return mixed
[ "private function nullIfEmptyArray($key, $value)\n {\n if ($this->isJsonCastable($key) && ! empty($value)) {\n return $this->setJsonCastValue($value);\n }\n\n return empty($value) ? null : $value;\n }" ]
[ "private function isArrayConstraint(Constraint $constraint): bool\n {\n return $constraint instanceof Assert\\All // << Applied only on array\n || ($constraint instanceof Assert\\Choice\n && true === $constraint->multiple // << expect an array multiple choices\n );\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Parse an input stream containing a Fortran namelist.
[ "def _readstream(self, nml_file, nml_patch_in=None):\n \"\"\"\"\"\"\n nml_patch = nml_patch_in if nml_patch_in is not None else Namelist()\n\n tokenizer = Tokenizer()\n f90lex = []\n for line in nml_file:\n toks = tokenizer.parse(line)\n while tokenizer.prior_delim:\n new_toks = tokenizer.parse(next(nml_file))\n\n # Skip empty lines\n if not new_toks:\n continue\n\n # The tokenizer always pre-tokenizes the whitespace (leftover\n # behaviour from Fortran source parsing) so this must be added\n # manually.\n if new_toks[0].isspace():\n toks[-1] += new_toks.pop(0)\n\n # Append the rest of the string (if present)\n if new_toks:\n toks[-1] += new_toks[0]\n\n # Attach the rest of the tokens\n toks.extend(new_toks[1:])\n\n toks.append('\\n')\n f90lex.extend(toks)\n\n self.tokens = iter(f90lex)\n\n nmls = Namelist()\n\n # Attempt to get first token; abort on empty file\n try:\n self._update_tokens(write_token=False)\n except StopIteration:\n return nmls\n\n # TODO: Replace \"while True\" with an update_token() iterator\n while True:\n try:\n # Check for classic group terminator\n if self.token == 'end':\n self._update_tokens()\n\n # Ignore tokens outside of namelist groups\n while self.token not in ('&', '$'):\n self._update_tokens()\n\n except StopIteration:\n break\n\n # Create the next namelist\n self._update_tokens()\n g_name = self.token\n\n g_vars = Namelist()\n v_name = None\n\n # TODO: Edit `Namelist` to support case-insensitive `get` calls\n grp_patch = nml_patch.get(g_name.lower(), Namelist())\n\n # Populate the namelist group\n while g_name:\n\n if self.token not in ('=', '%', '('):\n self._update_tokens()\n\n # Set the next active variable\n if self.token in ('=', '(', '%'):\n\n v_name, v_values = self._parse_variable(\n g_vars,\n patch_nml=grp_patch\n )\n\n if v_name in g_vars:\n v_prior_values = g_vars[v_name]\n v_values = merge_values(v_prior_values, v_values)\n\n g_vars[v_name] = v_values\n\n # Deselect variable\n v_name = None\n v_values = []\n\n # Finalise namelist group\n if self.token in ('/', '&', '$'):\n\n # Append any remaining patched variables\n for v_name, v_val in grp_patch.items():\n g_vars[v_name] = v_val\n v_strs = nmls._var_strings(v_name, v_val)\n for v_str in v_strs:\n self.pfile.write(\n '{0}{1}\\n'.format(nml_patch.indent, v_str)\n )\n\n # Append the grouplist to the namelist\n if g_name in nmls:\n g_update = nmls[g_name]\n\n # Update to list of groups\n if not isinstance(g_update, list):\n g_update = [g_update]\n\n g_update.append(g_vars)\n\n else:\n g_update = g_vars\n\n nmls[g_name] = g_update\n\n # Reset state\n g_name, g_vars = None, None\n\n try:\n self._update_tokens()\n except StopIteration:\n break\n\n return nmls" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Initializes curl resource with options. @param string $url @param string $postString @param array $headers @return $this
[ "protected function init($url, $postString, $headers)\n {\n $this->headers = $headers;\n\n $this->curl = curl_init($url);\n\n if (empty($this->cookieJar)) {\n $this->loadCookies();\n }\n\n curl_setopt_array($this->curl, $this->makeHttpOptions($postString));\n\n return $this;\n }" ]
[ "public function curlGETauth($curlUrl)\n {\n\n // Remove authentication until POST to /api/v1/auth/login is resolved\n if (!isset($this->auth)) {\n $this->authenticate();\n }\n\n $results = $this->curlGET($curlUrl, true);\n $this->statHat->ezCount('MB_Toolbox: MB_Toolbox_cURL: curlGETauth', 1);\n\n return $results;\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Load executable code from a URL or a path
[ "def load_code(name, base_path=None, recurse=False):\n \"\"\"\"\"\"\n if '/' in name:\n return load_location(name, base_path, module=False)\n\n return importer.import_code(name, base_path, recurse=recurse)" ]
[ "function useRequest() {\n var request = Module['memoryInitializerRequest'];\n var response = request.response;\n if (request.status !== 200 && request.status !== 0) {\n var data = tryParseAsDataURI(Module['memoryInitializerRequestURL']);\n if (data) {\n response = data.buffer;\n } else {\n // If you see this warning, the issue may be that you are using locateFile or memoryInitializerPrefixURL, and defining them in JS. That\n // means that the HTML file doesn't know about them, and when it tries to create the mem init request early, does it to the wrong place.\n // Look in your browser's devtools network console to see what's going on.\n console.warn('a problem seems to have happened with Module.memoryInitializerRequest, status: ' + request.status + ', retrying ' + memoryInitializer);\n doBrowserLoad();\n return;\n }\n }\n applyMemoryInitializer(response);\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NextMatcher gets the immediately following sibling of each element in the // Selection filtered by a matcher. It returns a new Selection object // containing the matched elements.
[ "func (s *Selection) NextMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), m)\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are different than the class name\n this.type = \"\";\n // Used to provide access to the name of the class \n this.className = \"Rule\";\n // Indicates whether generated nodes should be added to the abstract syntax tree\n this._createAstNode = false;\n // A parser function, computed in a rule's constructor. If successful returns either the original or a new \n // ParseState object. If it fails it returns null.\n this.parser = null;\n // A lexer function, computed in a rule's constructor. The lexer may update the ParseState if successful.\n // If it fails it is required that the lexer restore the ParseState index to the previous state. \n // Lexers should only update the index. \n this.lexer = null;\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
_Really_ obtain the config for a named class @param string $class The class to get the config for @return \Weasel\JsonMarshaller\Config\ClassMarshaller The config, or null if not found
[ "protected function _getConfig($class)\n {\n $rClass = new \\ReflectionClass($class);\n\n // Delegate actually loading the config for the class to the ClassAnnotationDriver\n $classDriver = new ClassAnnotationDriver($rClass, $this->annotationReaderFactory, $this->annotationNamespace);\n\n return $classDriver->getConfig();\n\n }" ]
[ "private function _init()\n {\n // TODO: check if self::$instance is required here or if we can only set\n // decorated object\n\n // initialize and store the instance of template engine for further access\n self::$instance = Doozr_Loader_Serviceloader::load($this->library, $this->resource);\n\n // set this instance as decorated object of our generic Facade and\n // so we can access all the base methods of any lib easily!\n $this->setDecoratedObject(self::$instance);\n }" ]
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// SetCacheLength sets the CacheLength field's value.
[ "func (s *RtmpGroupSettings) SetCacheLength(v int64) *RtmpGroupSettings {\n\ts.CacheLength = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadContext\n // in order to re-establish the thread context based on the metadata identity if not defaulted.\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Initialize grid lines.
[ "private void initGridLines() {\n gridLines = new Line[base.getDimension() - 1][linesSlicing.length];\n\n int i2 = 0;\n\n for (int i = 0; i < base.getDimension() - 1; i++) {\n if (i2 == index) {\n i2++;\n }\n\n for (int j = 0; j < gridLines[i].length; j++) {\n double[] originBase = new double[base.getDimension()];\n double[] endBase = new double[base.getDimension()];\n\n System.arraycopy(origin, 0, originBase, 0, base.getDimension());\n System.arraycopy(origin, 0, endBase, 0, base.getDimension());\n\n endBase[i2] = base.getCoordinateSpace()[i2 + 1][i2];\n originBase[index] = linesSlicing[j];\n endBase[index] = linesSlicing[j];\n\n if (j == 0 || j == gridLines[i].length - 1) {\n gridLines[i][j] = new Line(originBase, endBase);\n } else {\n gridLines[i][j] = new Line(Line.Style.DOT, Color.lightGray, originBase, endBase);\n }\n }\n i2++;\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Modifies the given N1QL query (as a {@link JsonObject}) to reflect these {@link N1qlParams}. @param queryJson the N1QL query
[ "public void injectParams(JsonObject queryJson) {\n if (this.serverSideTimeout != null) {\n queryJson.put(\"timeout\", this.serverSideTimeout);\n }\n if (this.consistency != null) {\n queryJson.put(\"scan_consistency\", this.consistency.n1ql());\n }\n if (this.scanWait != null\n && (ScanConsistency.REQUEST_PLUS == this.consistency\n || ScanConsistency.STATEMENT_PLUS == this.consistency)) {\n queryJson.put(\"scan_wait\", this.scanWait);\n }\n if (this.clientContextId != null) {\n queryJson.put(\"client_context_id\", this.clientContextId);\n }\n if (this.maxParallelism != null) {\n queryJson.put(\"max_parallelism\", this.maxParallelism.toString());\n }\n if (this.pipelineCap != null) {\n queryJson.put(\"pipeline_cap\", this.pipelineCap.toString());\n }\n if (this.pipelineBatch != null) {\n queryJson.put(\"pipeline_batch\", this.pipelineBatch.toString());\n }\n if (this.scanCap != null) {\n queryJson.put(\"scan_cap\", this.scanCap.toString());\n }\n if (this.disableMetrics) {\n queryJson.put(\"metrics\", false);\n }\n\n if (this.mutationState != null) {\n if (this.consistency != null) {\n throw new IllegalArgumentException(\"`consistency(...)` cannot be used \"\n + \"together with `consistentWith(...)`\");\n }\n queryJson.put(\"scan_vectors\", mutationState.export());\n queryJson.put(\"scan_consistency\", \"at_plus\");\n }\n\n if (!this.credentials.isEmpty()) {\n JsonArray creds = JsonArray.create();\n for (Map.Entry<String, String> c : credentials.entrySet()) {\n if (c.getKey() != null && !c.getKey().isEmpty()) {\n creds.add(JsonObject.create()\n .put(\"user\", c.getKey())\n .put(\"pass\", c.getValue()));\n }\n }\n if (!creds.isEmpty()) {\n queryJson.put(\"creds\", creds);\n }\n }\n\n if (!this.pretty) {\n queryJson.put(\"pretty\", false);\n }\n\n if (this.readonly) {\n queryJson.put(\"readonly\", true);\n }\n\n if (this.profile != null) {\n queryJson.put(\"profile\", this.profile.toString());\n }\n\n if (this.rawParams != null) {\n for (Map.Entry<String, Object> entry : rawParams.entrySet()) {\n queryJson.put(entry.getKey(), entry.getValue());\n }\n }\n }" ]
[ "@Override\n public List find(List<IndexClause> ixClause, EntityMetadata m, boolean isRelation, List<String> relations,\n int maxResult, List<String> columns) {\n throw new UnsupportedOperationException(\"Support available only for thrift/pelops.\");\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Send stat command to Memcached Server and return response lines. @param cmd: Command string. @return: Array of strings.
[ "def _sendStatCmd(self, cmd):\n \n try:\n self._conn.write(\"%s\\r\\n\" % cmd)\n regex = re.compile('^(END|ERROR)\\r\\n', re.MULTILINE)\n (idx, mobj, text) = self._conn.expect([regex,], self._timeout) #@UnusedVariable\n except:\n raise Exception(\"Communication with %s failed\" % self._instanceName)\n if mobj is not None:\n if mobj.group(1) == 'END':\n return text.splitlines()[:-1]\n elif mobj.group(1) == 'ERROR':\n raise Exception(\"Protocol error in communication with %s.\"\n % self._instanceName)\n else:\n raise Exception(\"Connection with %s timed out.\" % self._instanceName)" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
<p>readContent.</p> @param in a {@link java.io.Reader} object. @return a {@link java.lang.String} object. @throws java.io.IOException if any.
[ "public static String readContent( Reader in ) throws IOException\n {\n char[] buffer = new char[2048];\n StringBuilder sb = new StringBuilder();\n int read;\n while ((read = in.read( buffer )) != -1)\n {\n sb.append( buffer, 0, read );\n }\n\n return sb.toString();\n }" ]
[ "public void call(String method, Object[] args)\n throws IOException\n {\n startCall(method);\n\n if (args != null) {\n for (int i = 0; i < args.length; i++)\n writeObject(args[i]);\n }\n\n completeCall();\n }\n\n /**\n * Starts the method call. Clients would use <code>startCall</code>\n * instead of <code>call</code> if they wanted finer control over\n * writing the arguments, or needed to write headers.\n *\n * <code><pre>\n * &lt;burlap:call>\n * &lt;method>method-name&lt;/method>\n * </pre></code>\n *\n * @param method the method name to call.\n */\n public void startCall(String method)\n throws IOException\n {\n print(\"<burlap:call><method>\");\n print(method);\n print(\"</method>\");\n }\n\n /**\n * Starts the method call. Clients would use <code>startCall</code>\n * instead of <code>call</code> if they wanted finer control over\n * writing the arguments, or needed to write headers.\n *\n * <code><pre>\n * &lt;method>method-name&lt;/method>\n * </pre></code>\n *\n * @param method the method name to call.\n */\n public void startCall()\n throws IOException\n {\n print(\"<burlap:call>\");\n }\n\n /**\n * Writes the method for a call.\n *\n * <code><pre>\n * &lt;method>value&lt;/method>\n * </pre></code>\n *\n * @param method the method name to call.\n */\n public void writeMethod(String method)\n throws IOException\n {\n print(\"<method>\");\n print(method);\n print(\"</method>\");\n }\n\n /**\n * Completes.\n *\n * <code><pre>\n * &lt;/burlap:call>\n * </pre></code>\n */\n public void completeCall()\n throws IOException\n {\n print(\"</burlap:call>\");\n }\n\n /**\n * Starts the reply\n *\n * <p>A successful completion will have a single value:\n *\n * <pre>\n * r\n * </pre>\n */\n public void startReply()\n throws IOException\n {\n print(\"<burlap:reply>\");\n }\n\n /**\n * Completes reading the reply\n *\n * <p>A successful completion will have a single value:\n *\n * <pre>\n * &lt;/burlap:reply>\n * </pre>\n */\n public void completeReply()\n throws IOException\n {\n print(\"</burlap:reply>\");\n }\n\n /**\n * Writes a header name. The header value must immediately follow.\n *\n * <code><pre>\n * &lt;header>foo&lt;/header>&lt;int>value&lt;/int>\n * </pre></code>\n */\n public void writeHeader(String name)\n throws IOException\n {\n print(\"<header>\");\n printString(name);\n print(\"</header>\");\n }\n\n /**\n * Writes a fault. The fault will be written\n * as a descriptive string followed by an object:\n *\n * <code><pre>\n * &lt;fault>\n * &lt;string>code\n * &lt;string>the fault code\n *\n * &lt;string>message\n * &lt;string>the fault mesage\n *\n * &lt;string>detail\n * &lt;map>t\\x00\\xnnjavax.ejb.FinderException\n * ...\n * &lt;/map>\n * &lt;/fault>\n * </pre></code>\n *\n * @param code the fault code, a three digit\n */\n public void writeFault(String code, String message, Object detail)\n throws IOException\n {\n print(\"<fault>\");\n writeString(\"code\");\n writeString(code);\n\n writeString(\"message\");\n writeString(message);\n\n if (detail != null) {\n writeString(\"detail\");\n writeObject(detail);\n }\n print(\"</fault>\");\n }\n\n /**\n * Writes any object to the output stream.\n */\n public void writeObject(Object object)\n throws IOException\n {\n if (object == null) {\n writeNull();\n return;\n }\n\n Serializer serializer;\n\n serializer = _serializerFactory.getSerializer(object.getClass());\n\n serializer.writeObject(object, this);\n }\n\n /**\n * Writes the list header to the stream. List writers will call\n * <code>writeListBegin</code> followed by the list contents and then\n * call <code>writeListEnd</code>.\n *\n * <code><pre>\n * &lt;list>\n * &lt;type>java.util.ArrayList&lt;/type>\n * &lt;length>3&lt;/length>\n * &lt;int>1&lt;/int>\n * &lt;int>2&lt;/int>\n * &lt;int>3&lt;/int>\n * &lt;/list>\n * </pre></code>\n */\n public boolean writeListBegin(int length, String type)\n throws IOException\n {\n print(\"<list><type>\");\n\n if (type != null)\n print(type);\n\n print(\"</type><length>\");\n print(length);\n print(\"</length>\");\n\n return true;\n }\n\n /**\n * Writes the tail of the list to the stream.\n */\n public void writeListEnd()\n throws IOException\n {\n print(\"</list>\");\n }\n\n /**\n * Writes the map header to the stream. Map writers will call\n * <code>writeMapBegin</code> followed by the map contents and then\n * call <code>writeMapEnd</code>.\n *\n * <code><pre>\n * &lt;map>\n * &lt;type>type&lt;/type>\n * (&lt;key> &lt;value>)*\n * &lt;/map>\n * </pre></code>\n */\n public void writeMapBegin(String type)\n throws IOException\n {\n print(\"<map><type>\");\n if (type != null)\n print(type);\n\n print(\"</type>\");\n }\n\n /**\n * Writes the tail of the map to the stream.\n */\n public void writeMapEnd()\n throws IOException\n {\n print(\"</map>\");\n }\n\n /**\n * Writes a remote object reference to the stream. The type is the\n * type of the remote interface.\n *\n * <code><pre>\n * &lt;remote>\n * &lt;type>test.account.Account&lt;/type>\n * &lt;string>http://caucho.com/foo;ejbid=bar&lt;/string>\n * &lt;/remote>\n * </pre></code>\n */\n public void writeRemote(String type, String url)\n throws IOException\n {\n print(\"<remote><type>\");\n print(type);\n print(\"</type><string>\");\n print(url);\n print(\"</string></remote>\");\n }\n\n /**\n * Writes a boolean value to the stream. The boolean will be written\n * with the following syntax:\n *\n * <code><pre>\n * &lt;boolean>0&lt;/boolean>\n * &lt;boolean>1&lt;/boolean>\n * </pre></code>\n *\n * @param value the boolean value to write.\n */\n public void writeBoolean(boolean value)\n throws IOException\n {\n if (value)\n print(\"<boolean>1</boolean>\");\n else\n print(\"<boolean>0</boolean>\");\n }\n\n /**\n * Writes an integer value to the stream. The integer will be written\n * with the following syntax:\n *\n * <code><pre>\n * &lt;int>int value&lt;/int>\n * </pre></code>\n *\n * @param value the integer value to write.\n */\n public void writeInt(int value)\n throws IOException\n {\n print(\"<int>\");\n print(value);\n print(\"</int>\");\n }\n\n /**\n * Writes a long value to the stream. The long will be written\n * with the following syntax:\n *\n * <code><pre>\n * &lt;long>int value&lt;/long>\n * </pre></code>\n *\n * @param value the long value to write.\n */\n public void writeLong(long value)\n throws IOException\n {\n print(\"<long>\");\n print(value);\n print(\"</long>\");\n }\n\n /**\n * Writes a double value to the stream. The double will be written\n * with the following syntax:\n *\n * <code><pre>\n * &lt;double>value&lt;/double>\n * </pre></code>\n *\n * @param value the double value to write.\n */\n public void writeDouble(double value)\n throws IOException\n {\n print(\"<double>\");\n print(value);\n print(\"</double>\");\n }\n\n /**\n * Writes a date to the stream.\n *\n * <code><pre>\n * &lt;date>iso8901&lt;/date>\n * </pre></code>\n *\n * @param time the date in milliseconds from the epoch in UTC\n */\n public void writeUTCDate(long time)\n throws IOException\n {\n print(\"<date>\");\n if (utcCalendar == null) {\n utcCalendar = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n date = new Date();\n }\n\n date.setTime(time);\n utcCalendar.setTime(date);\n\n printDate(utcCalendar);\n print(\"</date>\");\n }\n\n /**\n * Writes a null value to the stream.\n * The null will be written with the following syntax\n *\n * <code><pre>\n * &lt;null>&lt;/null>\n * </pre></code>\n *\n * @param value the string value to write.\n */\n public void writeNull()\n throws IOException\n {\n print(\"<null></null>\");\n }\n\n /**\n * Writes a string value to the stream using UTF-8 encoding.\n * The string will be written with the following syntax:\n *\n * <code><pre>\n * &lt;string>string-value&lt;/string>\n * </pre></code>\n *\n * If the value is null, it will be written as\n *\n * <code><pre>\n * &lt;null>&lt;/null>\n * </pre></code>\n *\n * @param value the string value to write.\n */\n public void writeString(String value)\n throws IOException\n {\n if (value == null) {\n print(\"<null></null>\");\n }\n else {\n print(\"<string>\");\n printString(value);\n print(\"</string>\");\n }\n }\n\n /**\n * Writes a string value to the stream using UTF-8 encoding.\n * The string will be written with the following syntax:\n *\n * <code><pre>\n * S b16 b8 string-value\n * </pre></code>\n *\n * If the value is null, it will be written as\n *\n * <code><pre>\n * N\n * </pre></code>\n *\n * @param value the string value to write.\n */\n public void writeString(char[] buffer, int offset, int length)\n throws IOException\n {\n if (buffer == null) {\n print(\"<null></null>\");\n }\n else {\n print(\"<string>\");\n printString(buffer, offset, length);\n print(\"</string>\");\n }\n }\n\n /**\n * Writes a byte array to the stream.\n * The array will be written with the following syntax:\n *\n * <code><pre>\n * &lt;base64>bytes&lt;/base64>\n * </pre></code>\n *\n * If the value is null, it will be written as\n *\n * <code><pre>\n * &lt;null>&lt;/null>\n * </pre></code>\n *\n * @param value the string value to write.\n */\n public void writeBytes(byte[] buffer)\n throws IOException\n {\n if (buffer == null)\n print(\"<null></null>\");\n else\n writeBytes(buffer, 0, buffer.length);\n }\n\n /**\n * Writes a byte array to the stream.\n * The array will be written with the following syntax:\n *\n * <code><pre>\n * &lt;base64>bytes&lt;/base64>\n * </pre></code>\n *\n * If the value is null, it will be written as\n *\n * <code><pre>\n * &lt;null>&lt;/null>\n * </pre></code>\n *\n * @param value the string value to write.\n */\n public void writeBytes(byte[] buffer, int offset, int length)\n throws IOException\n {\n if (buffer == null) {\n print(\"<null></null>\");\n }\n else {\n print(\"<base64>\");\n\n int i = 0;\n for (; i + 2 < length; i += 3) {\n if (i != 0 && (i & 0x3f) == 0)\n print('\\n');\n\n int v = (((buffer[offset + i] & 0xff) << 16) +\n ((buffer[offset + i + 1] & 0xff) << 8) +\n (buffer[offset + i + 2] & 0xff));\n\n print(encode(v >> 18));\n print(encode(v >> 12));\n print(encode(v >> 6));\n print(encode(v));\n }\n\n if (i + 1 < length) {\n int v = (((buffer[offset + i] & 0xff) << 8) +\n (buffer[offset + i + 1] & 0xff));\n\n print(encode(v >> 10));\n print(encode(v >> 4));\n print(encode(v << 2));\n print('=');\n }\n else if (i < length) {\n int v = buffer[offset + i] & 0xff;\n\n print(encode(v >> 2));\n print(encode(v << 4));\n print('=');\n print('=');\n }\n\n print(\"</base64>\");\n }\n }\n\n /**\n * Writes a byte buffer to the stream.\n */\n public void writeByteBufferStart()\n throws IOException\n {\n throw new UnsupportedOperationException();\n }\n\n /**\n * Writes a byte buffer to the stream.\n *\n * <code><pre>\n * b b16 b18 bytes\n * </pre></code>\n */\n public void writeByteBufferPart(byte[] buffer, int offset, int length)\n throws IOException\n {\n throw new UnsupportedOperationException();\n }\n\n /**\n * Writes a byte buffer to the stream.\n *\n * <code><pre>\n * b b16 b18 bytes\n * </pre></code>\n */\n public void writeByteBufferEnd(byte[] buffer, int offset, int length)\n throws IOException\n {\n throw new UnsupportedOperationException();\n }\n\n /**\n * Encodes a digit\n */\n private char encode(int d)\n {\n d &= 0x3f;\n if (d < 26)\n return (char) (d + 'A');\n else if (d < 52)\n return (char) (d + 'a' - 26);\n else if (d < 62)\n return (char) (d + '0' - 52);\n else if (d == 62)\n return '+';\n else\n return '/';\n }\n\n /**\n * Writes a reference.\n *\n * <code><pre>\n * &lt;ref>int&lt;/ref>\n * </pre></code>\n *\n * @param value the integer value to write.\n */\n public void writeRef(int value)\n throws IOException\n {\n print(\"<ref>\");\n print(value);\n print(\"</ref>\");\n }\n\n /**\n * If the object has already been written, just write its ref.\n *\n * @return true if we're writing a ref.\n */\n public boolean addRef(Object object)\n throws IOException\n {\n if (_refs == null)\n _refs = new IdentityHashMap();\n\n Integer ref = (Integer) _refs.get(object);\n\n if (ref != null) {\n int value = ref.intValue();\n\n writeRef(value);\n return true;\n }\n else {\n _refs.put(object, new Integer(_refs.size()));\n\n return false;\n }\n }\n\n @Override\n public int getRef(Object obj)\n {\n if (_refs == null)\n return -1;\n\n Integer ref = (Integer) _refs.get(obj);\n\n if (ref != null)\n return ref;\n else\n return -1;\n }\n\n /**\n * Removes a reference.\n */\n public boolean removeRef(Object obj)\n throws IOException\n {\n if (_refs != null) {\n _refs.remove(obj);\n\n return true;\n }\n else\n return false;\n }\n\n /**\n * Replaces a reference from one object to another.\n */\n public boolean replaceRef(Object oldRef, Object newRef)\n throws IOException\n {\n Integer value = (Integer) _refs.remove(oldRef);\n\n if (value != null) {\n _refs.put(newRef, value);\n return true;\n }\n else\n return false;\n }\n\n /**\n * Prints a string to the stream, encoded as UTF-8\n *\n * @param v the string to print.\n */\n public void printString(String v)\n throws IOException\n {\n printString(v, 0, v.length());\n }\n\n /**\n * Prints a string to the stream, encoded as UTF-8\n *\n * @param v the string to print.\n */\n public void printString(String v, int offset, int length)\n throws IOException\n {\n for (int i = 0; i < length; i++) {\n char ch = v.charAt(i + offset);\n\n if (ch == '<') {\n os.write('&');\n os.write('#');\n os.write('6');\n os.write('0');\n os.write(';');\n }\n else if (ch == '&') {\n os.write('&');\n os.write('#');\n os.write('3');\n os.write('8');\n os.write(';');\n }\n else if (ch < 0x80)\n os.write(ch);\n else if (ch < 0x800) {\n os.write(0xc0 + ((ch >> 6) & 0x1f));\n os.write(0x80 + (ch & 0x3f));\n }\n else {\n os.write(0xe0 + ((ch >> 12) & 0xf));\n os.write(0x80 + ((ch >> 6) & 0x3f));\n os.write(0x80 + (ch & 0x3f));\n }\n }\n }\n\n /**\n * Prints a string to the stream, encoded as UTF-8\n *\n * @param v the string to print.\n */\n public void printString(char[] v, int offset, int length)\n throws IOException\n {\n for (int i = 0; i < length; i++) {\n char ch = v[i + offset];\n\n if (ch < 0x80)\n os.write(ch);\n else if (ch < 0x800) {\n os.write(0xc0 + ((ch >> 6) & 0x1f));\n os.write(0x80 + (ch & 0x3f));\n }\n else {\n os.write(0xe0 + ((ch >> 12) & 0xf));\n os.write(0x80 + ((ch >> 6) & 0x3f));\n os.write(0x80 + (ch & 0x3f));\n }\n }\n }\n\n /**\n * Prints a date.\n *\n * @param date the date to print.\n */\n public void printDate(Calendar calendar)\n throws IOException\n {\n int year = calendar.get(Calendar.YEAR);\n\n os.write((char) ('0' + (year / 1000 % 10)));\n os.write((char) ('0' + (year / 100 % 10)));\n os.write((char) ('0' + (year / 10 % 10)));\n os.write((char) ('0' + (year % 10)));\n\n int month = calendar.get(Calendar.MONTH) + 1;\n os.write((char) ('0' + (month / 10 % 10)));\n os.write((char) ('0' + (month % 10)));\n\n int day = calendar.get(Calendar.DAY_OF_MONTH);\n os.write((char) ('0' + (day / 10 % 10)));\n os.write((char) ('0' + (day % 10)));\n\n os.write('T');\n\n int hour = calendar.get(Calendar.HOUR_OF_DAY);\n os.write((char) ('0' + (hour / 10 % 10)));\n os.write((char) ('0' + (hour % 10)));\n\n int minute = calendar.get(Calendar.MINUTE);\n os.write((char) ('0' + (minute / 10 % 10)));\n os.write((char) ('0' + (minute % 10)));\n\n int second = calendar.get(Calendar.SECOND);\n os.write((char) ('0' + (second / 10 % 10)));\n os.write((char) ('0' + (second % 10)));\n\n int ms = calendar.get(Calendar.MILLISECOND);\n os.write('.');\n os.write((char) ('0' + (ms / 100 % 10)));\n os.write((char) ('0' + (ms / 10 % 10)));\n os.write((char) ('0' + (ms % 10)));\n\n os.write('Z');\n }\n\n /**\n * Prints a char to the stream.\n *\n * @param v the char to print.\n */\n protected void print(char v)\n throws IOException\n {\n os.write(v);\n }\n\n /**\n * Prints an integer to the stream.\n *\n * @param v the integer to print.\n */\n protected void print(int v)\n throws IOException\n {\n print(String.valueOf(v));\n }\n\n /**\n * Prints a long to the stream.\n *\n * @param v the long to print.\n */\n protected void print(long v)\n throws IOException\n {\n print(String.valueOf(v));\n }\n\n /**\n * Prints a double to the stream.\n *\n * @param v the double to print.\n */\n protected void print(double v)\n throws IOException\n {\n print(String.valueOf(v));\n }\n\n /**\n * Prints a string as ascii to the stream. Used for tags, etc.\n * that are known to the ascii.\n *\n * @param s the ascii string to print.\n */\n protected void print(String s)\n throws IOException\n {\n int len = s.length();\n for (int i = 0; i < len; i++) {\n int ch = s.charAt(i);\n\n os.write(ch);\n }\n }\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about writing:" }
// AddNode add new node to directory (name must be unique in directory)
[ "func (d *Dir) AddNode(newNode os.FileInfo) error {\n\tfor _, node := range d.nodes {\n\t\tif newNode.Name() == node.Name() {\n\t\t\treturn fmt.Errorf(\"node named \" + newNode.Name() + \" exists\")\n\t\t}\n\t}\n\td.nodes = append(d.nodes, newNode)\n\treturn nil\n}" ]
[ "function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n // these are defined in the upward direction rather than down (e.g. child)\n // because we need to go up in Selector.filter()\n parent: null, // parent query obj\n ancestor: null, // ancestor query obj\n subject: null, // defines subject in compound query (subject query obj; points to self if subject)\n\n // use these only when subject has been defined\n child: null,\n descendant: null\n };\n }" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Load image from path. @param path Path to image. @return Image @throws java.io.IOException @throws NullPointerException if {@code path} is null.
[ "private Image loadImage(Resource path) throws IOException {\n\t\tURL url = path.getURL();\n\t\tif (url == null) {\n\t\t\tlogger.warn(\"Unable to locate splash screen in classpath at: \" + path);\n\t\t\treturn null;\n\t\t}\n\t\treturn Toolkit.getDefaultToolkit().createImage(url);\n\t}" ]
[ "protected void checkNull( Object... objects ) {\n for( Object object : objects ) {\n if (object == null) {\n throw new ModelsIllegalargumentException(\"Mandatory input argument is missing. Check your syntax...\",\n this.getClass().getSimpleName(), pm);\n }\n }\n }" ]
codesearchnet
{ "query": "Represent the text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
/* (non-Javadoc) @see javax.persistence.EntityManager#createQuery(java.lang.String)
[ "@Override\n public Query createQuery(String qlString)\n {\n try\n {\n return ivEm.createQuery(qlString);\n } finally\n {\n if (!inJTATransaction())\n {\n ivEm.clear();\n }\n }\n }" ]
[ "@Bean\n\tpublic JpaModule jpaModule() {\n\t\tJpaModule module = JpaModule.newServerModule(em, transactionRunner);\n\n\t\t// directly expose entity\n\t\tmodule.addRepository(JpaRepositoryConfig.builder(ScheduleEntity.class).build());\n\n\t\t// additionally expose entity as a mapped dto\n\t\tmodule.addRepository(JpaRepositoryConfig.builder(ScheduleEntity.class, ScheduleDto.class, new ScheduleMapper()).build());\n\t\tJpaCriteriaQueryFactory queryFactory = (JpaCriteriaQueryFactory) module.getQueryFactory();\n\n\t\t// register a computed a attribute\n\t\t// you may consider QueryDSL or generating the Criteria query objects.\n\t\tqueryFactory.registerComputedAttribute(ScheduleEntity.class, \"upperName\", String.class,\n\t\t\t\tnew JpaCriteriaExpressionFactory<From<?, ScheduleEntity>>() {\n\n\t\t\t\t\t@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic Expression<String> getExpression(From<?, ScheduleEntity> entity, CriteriaQuery<?> query) {\n\t\t\t\t\t\tCriteriaBuilder builder = em.getCriteriaBuilder();\n\t\t\t\t\t\treturn builder.upper((Expression) entity.get(\"name\"));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\treturn module;\n\t}" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Software Development:" }
// NewService creates an instance of a Service.
[ "func NewService() *Service {\n\ts := &Service{\n\t\tTokenGenerator: rand.NewTokenGenerator(64),\n\t\tIDGenerator: snowflake.NewIDGenerator(),\n\t\ttime: time.Now,\n\t}\n\ts.initializeSources(context.TODO())\n\treturn s\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true,writeDirectory);\n \n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Loads PHPExcel from file @param string $pFilename @return PHPExcel @throws PHPExcel_Reader_Exception
[ "public function load($pFilename)\r\n\t{\r\n\t\t// Read the OLE file\r\n\t\t$this->_loadOLE($pFilename);\r\n\r\n\t\t// Initialisations\r\n\t\t$this->_phpExcel = new PHPExcel;\r\n\t\t$this->_phpExcel->removeSheetByIndex(0); // remove 1st sheet\r\n\t\tif (!$this->_readDataOnly) {\r\n\t\t\t$this->_phpExcel->removeCellStyleXfByIndex(0); // remove the default style\r\n\t\t\t$this->_phpExcel->removeCellXfByIndex(0); // remove the default style\r\n\t\t}\r\n\r\n\t\t// Read the summary information stream (containing meta data)\r\n\t\t$this->_readSummaryInformation();\r\n\r\n\t\t// Read the Additional document summary information stream (containing application-specific meta data)\r\n\t\t$this->_readDocumentSummaryInformation();\r\n\r\n\t\t// total byte size of Excel data (workbook global substream + sheet substreams)\r\n\t\t$this->_dataSize = strlen($this->_data);\r\n\r\n\t\t// initialize\r\n\t\t$this->_pos\t\t\t\t\t= 0;\r\n\t\t$this->_codepage\t\t\t= 'CP1252';\r\n\t\t$this->_formats\t\t\t\t= array();\r\n\t\t$this->_objFonts\t\t\t= array();\r\n\t\t$this->_palette\t\t\t\t= array();\r\n\t\t$this->_sheets\t\t\t\t= array();\r\n\t\t$this->_externalBooks\t\t= array();\r\n\t\t$this->_ref\t\t\t\t\t= array();\r\n\t\t$this->_definedname\t\t\t= array();\r\n\t\t$this->_sst\t\t\t\t\t= array();\r\n\t\t$this->_drawingGroupData\t= '';\r\n\t\t$this->_xfIndex\t\t\t\t= '';\r\n\t\t$this->_mapCellXfIndex\t\t= array();\r\n\t\t$this->_mapCellStyleXfIndex\t= array();\r\n\r\n\t\t// Parse Workbook Global Substream\r\n\t\twhile ($this->_pos < $this->_dataSize) {\r\n\t\t\t$code = self::_GetInt2d($this->_data, $this->_pos);\r\n\r\n\t\t\tswitch ($code) {\r\n\t\t\t\tcase self::XLS_Type_BOF:\t\t\t$this->_readBof();\t\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_FILEPASS:\t\t$this->_readFilepass();\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_CODEPAGE:\t\t$this->_readCodepage();\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_DATEMODE:\t\t$this->_readDateMode();\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_FONT:\t\t\t$this->_readFont();\t\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_FORMAT:\t\t\t$this->_readFormat();\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_XF:\t\t\t\t$this->_readXf();\t\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_XFEXT:\t\t\t$this->_readXfExt();\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_STYLE:\t\t\t$this->_readStyle();\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_PALETTE:\t\t$this->_readPalette();\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_SHEET:\t\t\t$this->_readSheet();\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_EXTERNALBOOK:\t$this->_readExternalBook();\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_EXTERNNAME:\t\t$this->_readExternName();\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_EXTERNSHEET:\t$this->_readExternSheet();\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_DEFINEDNAME:\t$this->_readDefinedName();\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_MSODRAWINGGROUP:\t$this->_readMsoDrawingGroup();\tbreak;\r\n\t\t\t\tcase self::XLS_Type_SST:\t\t\t$this->_readSst();\t\t\t\tbreak;\r\n\t\t\t\tcase self::XLS_Type_EOF:\t\t\t$this->_readDefault();\t\t\tbreak 2;\r\n\t\t\t\tdefault:\t\t\t\t\t\t\t$this->_readDefault();\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Resolve indexed colors for font, fill, and border colors\r\n\t\t// Cannot be resolved already in XF record, because PALETTE record comes afterwards\r\n\t\tif (!$this->_readDataOnly) {\r\n\t\t\tforeach ($this->_objFonts as $objFont) {\r\n\t\t\t\tif (isset($objFont->colorIndex)) {\r\n\t\t\t\t\t$color = self::_readColor($objFont->colorIndex,$this->_palette,$this->_version);\r\n\t\t\t\t\t$objFont->getColor()->setRGB($color['rgb']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->_phpExcel->getCellXfCollection() as $objStyle) {\r\n\t\t\t\t// fill start and end color\r\n\t\t\t\t$fill = $objStyle->getFill();\r\n\r\n\t\t\t\tif (isset($fill->startcolorIndex)) {\r\n\t\t\t\t\t$startColor = self::_readColor($fill->startcolorIndex,$this->_palette,$this->_version);\r\n\t\t\t\t\t$fill->getStartColor()->setRGB($startColor['rgb']);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isset($fill->endcolorIndex)) {\r\n\t\t\t\t\t$endColor = self::_readColor($fill->endcolorIndex,$this->_palette,$this->_version);\r\n\t\t\t\t\t$fill->getEndColor()->setRGB($endColor['rgb']);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// border colors\r\n\t\t\t\t$top = $objStyle->getBorders()->getTop();\r\n\t\t\t\t$right = $objStyle->getBorders()->getRight();\r\n\t\t\t\t$bottom = $objStyle->getBorders()->getBottom();\r\n\t\t\t\t$left = $objStyle->getBorders()->getLeft();\r\n\t\t\t\t$diagonal = $objStyle->getBorders()->getDiagonal();\r\n\r\n\t\t\t\tif (isset($top->colorIndex)) {\r\n\t\t\t\t\t$borderTopColor = self::_readColor($top->colorIndex,$this->_palette,$this->_version);\r\n\t\t\t\t\t$top->getColor()->setRGB($borderTopColor['rgb']);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isset($right->colorIndex)) {\r\n\t\t\t\t\t$borderRightColor = self::_readColor($right->colorIndex,$this->_palette,$this->_version);\r\n\t\t\t\t\t$right->getColor()->setRGB($borderRightColor['rgb']);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isset($bottom->colorIndex)) {\r\n\t\t\t\t\t$borderBottomColor = self::_readColor($bottom->colorIndex,$this->_palette,$this->_version);\r\n\t\t\t\t\t$bottom->getColor()->setRGB($borderBottomColor['rgb']);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isset($left->colorIndex)) {\r\n\t\t\t\t\t$borderLeftColor = self::_readColor($left->colorIndex,$this->_palette,$this->_version);\r\n\t\t\t\t\t$left->getColor()->setRGB($borderLeftColor['rgb']);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isset($diagonal->colorIndex)) {\r\n\t\t\t\t\t$borderDiagonalColor = self::_readColor($diagonal->colorIndex,$this->_palette,$this->_version);\r\n\t\t\t\t\t$diagonal->getColor()->setRGB($borderDiagonalColor['rgb']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// treat MSODRAWINGGROUP records, workbook-level Escher\r\n\t\tif (!$this->_readDataOnly && $this->_drawingGroupData) {\r\n\t\t\t$escherWorkbook = new PHPExcel_Shared_Escher();\r\n\t\t\t$reader = new PHPExcel_Reader_Excel5_Escher($escherWorkbook);\r\n\t\t\t$escherWorkbook = $reader->load($this->_drawingGroupData);\r\n\r\n\t\t\t// debug Escher stream\r\n\t\t\t//$debug = new Debug_Escher(new PHPExcel_Shared_Escher());\r\n\t\t\t//$debug->load($this->_drawingGroupData);\r\n\t\t}\r\n\r\n\t\t// Parse the individual sheets\r\n\t\tforeach ($this->_sheets as $sheet) {\r\n\r\n\t\t\tif ($sheet['sheetType'] != 0x00) {\r\n\t\t\t\t// 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// check if sheet should be skipped\r\n\t\t\tif (isset($this->_loadSheetsOnly) && !in_array($sheet['name'], $this->_loadSheetsOnly)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// add sheet to PHPExcel object\r\n\t\t\t$this->_phpSheet = $this->_phpExcel->createSheet();\r\n\t\t\t//\tUse false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula\r\n\t\t\t//\t\tcells... during the load, all formulae should be correct, and we're simply bringing the worksheet\r\n\t\t\t//\t\tname in line with the formula, not the reverse\r\n\t\t\t$this->_phpSheet->setTitle($sheet['name'],false);\r\n\t\t\t$this->_phpSheet->setSheetState($sheet['sheetState']);\r\n\r\n\t\t\t$this->_pos = $sheet['offset'];\r\n\r\n\t\t\t// Initialize isFitToPages. May change after reading SHEETPR record.\r\n\t\t\t$this->_isFitToPages = false;\r\n\r\n\t\t\t// Initialize drawingData\r\n\t\t\t$this->_drawingData = '';\r\n\r\n\t\t\t// Initialize objs\r\n\t\t\t$this->_objs = array();\r\n\r\n\t\t\t// Initialize shared formula parts\r\n\t\t\t$this->_sharedFormulaParts = array();\r\n\r\n\t\t\t// Initialize shared formulas\r\n\t\t\t$this->_sharedFormulas = array();\r\n\r\n\t\t\t// Initialize text objs\r\n\t\t\t$this->_textObjects = array();\r\n\r\n\t\t\t// Initialize cell annotations\r\n\t\t\t$this->_cellNotes = array();\r\n\t\t\t$this->textObjRef = -1;\r\n\r\n\t\t\twhile ($this->_pos <= $this->_dataSize - 4) {\r\n\t\t\t\t$code = self::_GetInt2d($this->_data, $this->_pos);\r\n\r\n\t\t\t\tswitch ($code) {\r\n\t\t\t\t\tcase self::XLS_Type_BOF:\t\t\t\t\t$this->_readBof();\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_PRINTGRIDLINES:\t\t\t$this->_readPrintGridlines();\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_DEFAULTROWHEIGHT:\t\t$this->_readDefaultRowHeight();\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_SHEETPR:\t\t\t\t$this->_readSheetPr();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_HORIZONTALPAGEBREAKS:\t$this->_readHorizontalPageBreaks();\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_VERTICALPAGEBREAKS:\t\t$this->_readVerticalPageBreaks();\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_HEADER:\t\t\t\t\t$this->_readHeader();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_FOOTER:\t\t\t\t\t$this->_readFooter();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_HCENTER:\t\t\t\t$this->_readHcenter();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_VCENTER:\t\t\t\t$this->_readVcenter();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_LEFTMARGIN:\t\t\t\t$this->_readLeftMargin();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_RIGHTMARGIN:\t\t\t$this->_readRightMargin();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_TOPMARGIN:\t\t\t\t$this->_readTopMargin();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_BOTTOMMARGIN:\t\t\t$this->_readBottomMargin();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_PAGESETUP:\t\t\t\t$this->_readPageSetup();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_PROTECT:\t\t\t\t$this->_readProtect();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_SCENPROTECT:\t\t\t$this->_readScenProtect();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_OBJECTPROTECT:\t\t\t$this->_readObjectProtect();\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_PASSWORD:\t\t\t\t$this->_readPassword();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_DEFCOLWIDTH:\t\t\t$this->_readDefColWidth();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_COLINFO:\t\t\t\t$this->_readColInfo();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_DIMENSION:\t\t\t\t$this->_readDefault();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_ROW:\t\t\t\t\t$this->_readRow();\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_DBCELL:\t\t\t\t\t$this->_readDefault();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_RK:\t\t\t\t\t\t$this->_readRk();\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_LABELSST:\t\t\t\t$this->_readLabelSst();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_MULRK:\t\t\t\t\t$this->_readMulRk();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_NUMBER:\t\t\t\t\t$this->_readNumber();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_FORMULA:\t\t\t\t$this->_readFormula();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_SHAREDFMLA:\t\t\t\t$this->_readSharedFmla();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_BOOLERR:\t\t\t\t$this->_readBoolErr();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_MULBLANK:\t\t\t\t$this->_readMulBlank();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_LABEL:\t\t\t\t\t$this->_readLabel();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_BLANK:\t\t\t\t\t$this->_readBlank();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_MSODRAWING:\t\t\t\t$this->_readMsoDrawing();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_OBJ:\t\t\t\t\t$this->_readObj();\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_WINDOW2:\t\t\t\t$this->_readWindow2();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_PAGELAYOUTVIEW:\t$this->_readPageLayoutView();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_SCL:\t\t\t\t\t$this->_readScl();\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_PANE:\t\t\t\t\t$this->_readPane();\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_SELECTION:\t\t\t\t$this->_readSelection();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_MERGEDCELLS:\t\t\t$this->_readMergedCells();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_HYPERLINK:\t\t\t\t$this->_readHyperLink();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_DATAVALIDATIONS:\t\t$this->_readDataValidations();\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_DATAVALIDATION:\t\t\t$this->_readDataValidation();\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_SHEETLAYOUT:\t\t\t$this->_readSheetLayout();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_SHEETPROTECTION:\t\t$this->_readSheetProtection();\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_RANGEPROTECTION:\t\t$this->_readRangeProtection();\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_NOTE:\t\t\t\t\t$this->_readNote();\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t//case self::XLS_Type_IMDATA:\t\t\t\t$this->_readImData();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_TXO:\t\t\t\t\t$this->_readTextObject();\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_CONTINUE:\t\t\t\t$this->_readContinue();\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase self::XLS_Type_EOF:\t\t\t\t\t$this->_readDefault();\t\t\t\t\tbreak 2;\r\n\t\t\t\t\tdefault:\t\t\t\t\t\t\t\t\t$this->_readDefault();\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// treat MSODRAWING records, sheet-level Escher\r\n\t\t\tif (!$this->_readDataOnly && $this->_drawingData) {\r\n\t\t\t\t$escherWorksheet = new PHPExcel_Shared_Escher();\r\n\t\t\t\t$reader = new PHPExcel_Reader_Excel5_Escher($escherWorksheet);\r\n\t\t\t\t$escherWorksheet = $reader->load($this->_drawingData);\r\n\r\n\t\t\t\t// debug Escher stream\r\n\t\t\t\t//$debug = new Debug_Escher(new PHPExcel_Shared_Escher());\r\n\t\t\t\t//$debug->load($this->_drawingData);\r\n\r\n\t\t\t\t// get all spContainers in one long array, so they can be mapped to OBJ records\r\n\t\t\t\t$allSpContainers = $escherWorksheet->getDgContainer()->getSpgrContainer()->getAllSpContainers();\r\n\t\t\t}\r\n\r\n\t\t\t// treat OBJ records\r\n\t\t\tforeach ($this->_objs as $n => $obj) {\r\n//\t\t\t\techo '<hr /><b>Object</b> reference is ',$n,'<br />';\r\n//\t\t\t\tvar_dump($obj);\r\n//\t\t\t\techo '<br />';\r\n\r\n\t\t\t\t// the first shape container never has a corresponding OBJ record, hence $n + 1\r\n\t\t\t\tif (isset($allSpContainers[$n + 1]) && is_object($allSpContainers[$n + 1])) {\r\n\t\t\t\t\t$spContainer = $allSpContainers[$n + 1];\r\n\r\n\t\t\t\t\t// we skip all spContainers that are a part of a group shape since we cannot yet handle those\r\n\t\t\t\t\tif ($spContainer->getNestingLevel() > 1) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// calculate the width and height of the shape\r\n\t\t\t\t\tlist($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($spContainer->getStartCoordinates());\r\n\t\t\t\t\tlist($endColumn, $endRow) = PHPExcel_Cell::coordinateFromString($spContainer->getEndCoordinates());\r\n\r\n\t\t\t\t\t$startOffsetX = $spContainer->getStartOffsetX();\r\n\t\t\t\t\t$startOffsetY = $spContainer->getStartOffsetY();\r\n\t\t\t\t\t$endOffsetX = $spContainer->getEndOffsetX();\r\n\t\t\t\t\t$endOffsetY = $spContainer->getEndOffsetY();\r\n\r\n\t\t\t\t\t$width = PHPExcel_Shared_Excel5::getDistanceX($this->_phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX);\r\n\t\t\t\t\t$height = PHPExcel_Shared_Excel5::getDistanceY($this->_phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY);\r\n\r\n\t\t\t\t\t// calculate offsetX and offsetY of the shape\r\n\t\t\t\t\t$offsetX = $startOffsetX * PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, $startColumn) / 1024;\r\n\t\t\t\t\t$offsetY = $startOffsetY * PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $startRow) / 256;\r\n\r\n\t\t\t\t\tswitch ($obj['otObjType']) {\r\n\t\t\t\t\t\tcase 0x19:\r\n\t\t\t\t\t\t\t// Note\r\n//\t\t\t\t\t\t\techo 'Cell Annotation Object<br />';\r\n//\t\t\t\t\t\t\techo 'Object ID is ',$obj['idObjID'],'<br />';\r\n//\r\n\t\t\t\t\t\t\tif (isset($this->_cellNotes[$obj['idObjID']])) {\r\n\t\t\t\t\t\t\t\t$cellNote = $this->_cellNotes[$obj['idObjID']];\r\n\r\n\t\t\t\t\t\t\t\tif (isset($this->_textObjects[$obj['idObjID']])) {\r\n\t\t\t\t\t\t\t\t\t$textObject = $this->_textObjects[$obj['idObjID']];\r\n\t\t\t\t\t\t\t\t\t$this->_cellNotes[$obj['idObjID']]['objTextData'] = $textObject;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase 0x08:\r\n//\t\t\t\t\t\t\techo 'Picture Object<br />';\r\n\t\t\t\t\t\t\t// picture\r\n\r\n\t\t\t\t\t\t\t// get index to BSE entry (1-based)\r\n\t\t\t\t\t\t\t$BSEindex = $spContainer->getOPT(0x0104);\r\n\t\t\t\t\t\t\t$BSECollection = $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection();\r\n\t\t\t\t\t\t\t$BSE = $BSECollection[$BSEindex - 1];\r\n\t\t\t\t\t\t\t$blipType = $BSE->getBlipType();\r\n\r\n\t\t\t\t\t\t\t// need check because some blip types are not supported by Escher reader such as EMF\r\n\t\t\t\t\t\t\tif ($blip = $BSE->getBlip()) {\r\n\t\t\t\t\t\t\t\t$ih = imagecreatefromstring($blip->getData());\r\n\t\t\t\t\t\t\t\t$drawing = new PHPExcel_Worksheet_MemoryDrawing();\r\n\t\t\t\t\t\t\t\t$drawing->setImageResource($ih);\r\n\r\n\t\t\t\t\t\t\t\t// width, height, offsetX, offsetY\r\n\t\t\t\t\t\t\t\t$drawing->setResizeProportional(false);\r\n\t\t\t\t\t\t\t\t$drawing->setWidth($width);\r\n\t\t\t\t\t\t\t\t$drawing->setHeight($height);\r\n\t\t\t\t\t\t\t\t$drawing->setOffsetX($offsetX);\r\n\t\t\t\t\t\t\t\t$drawing->setOffsetY($offsetY);\r\n\r\n\t\t\t\t\t\t\t\tswitch ($blipType) {\r\n\t\t\t\t\t\t\t\t\tcase PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG:\r\n\t\t\t\t\t\t\t\t\t\t$drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG);\r\n\t\t\t\t\t\t\t\t\t\t$drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_JPEG);\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\t\tcase PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG:\r\n\t\t\t\t\t\t\t\t\t\t$drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG);\r\n\t\t\t\t\t\t\t\t\t\t$drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_PNG);\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$drawing->setWorksheet($this->_phpSheet);\r\n\t\t\t\t\t\t\t\t$drawing->setCoordinates($spContainer->getStartCoordinates());\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t// other object type\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// treat SHAREDFMLA records\r\n\t\t\tif ($this->_version == self::XLS_BIFF8) {\r\n\t\t\t\tforeach ($this->_sharedFormulaParts as $cell => $baseCell) {\r\n\t\t\t\t\tlist($column, $row) = PHPExcel_Cell::coordinateFromString($cell);\r\n\t\t\t\t\tif (($this->getReadFilter() !== NULL) && $this->getReadFilter()->readCell($column, $row, $this->_phpSheet->getTitle()) ) {\r\n\t\t\t\t\t\t$formula = $this->_getFormulaFromStructure($this->_sharedFormulas[$baseCell], $cell);\r\n\t\t\t\t\t\t$this->_phpSheet->getCell($cell)->setValueExplicit('=' . $formula, PHPExcel_Cell_DataType::TYPE_FORMULA);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!empty($this->_cellNotes)) {\r\n\t\t\t\tforeach($this->_cellNotes as $note => $noteDetails) {\r\n\t\t\t\t\tif (!isset($noteDetails['objTextData'])) {\r\n\t\t\t\t\t\tif (isset($this->_textObjects[$note])) {\r\n\t\t\t\t\t\t\t$textObject = $this->_textObjects[$note];\r\n\t\t\t\t\t\t\t$noteDetails['objTextData'] = $textObject;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$noteDetails['objTextData']['text'] = '';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n//\t\t\t\t\techo '<b>Cell annotation ',$note,'</b><br />';\r\n//\t\t\t\t\tvar_dump($noteDetails);\r\n//\t\t\t\t\techo '<br />';\r\n\t\t\t\t\t$cellAddress = str_replace('$','',$noteDetails['cellRef']);\r\n\t\t\t\t\t$this->_phpSheet->getComment( $cellAddress )\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t->setAuthor( $noteDetails['author'] )\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t->setText($this->_parseRichText($noteDetails['objTextData']['text']) );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// add the named ranges (defined names)\r\n\t\tforeach ($this->_definedname as $definedName) {\r\n\t\t\tif ($definedName['isBuiltInName']) {\r\n\t\t\t\tswitch ($definedName['name']) {\r\n\r\n\t\t\t\tcase pack('C', 0x06):\r\n\t\t\t\t\t// print area\r\n\t\t\t\t\t//\tin general, formula looks like this: Foo!$C$7:$J$66,Bar!$A$1:$IV$2\r\n\t\t\t\t\t$ranges = explode(',', $definedName['formula']); // FIXME: what if sheetname contains comma?\r\n\r\n\t\t\t\t\t$extractedRanges = array();\r\n\t\t\t\t\tforeach ($ranges as $range) {\r\n\t\t\t\t\t\t// $range should look like one of these\r\n\t\t\t\t\t\t//\t\tFoo!$C$7:$J$66\r\n\t\t\t\t\t\t//\t\tBar!$A$1:$IV$2\r\n\r\n\t\t\t\t\t\t$explodes = explode('!', $range);\t// FIXME: what if sheetname contains exclamation mark?\r\n\t\t\t\t\t\t$sheetName = trim($explodes[0], \"'\");\r\n\r\n\t\t\t\t\t\tif (count($explodes) == 2) {\r\n\t\t\t\t\t\t\tif (strpos($explodes[1], ':') === FALSE) {\r\n\t\t\t\t\t\t\t\t$explodes[1] = $explodes[1] . ':' . $explodes[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$extractedRanges[] = str_replace('$', '', $explodes[1]); // C7:J66\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($docSheet = $this->_phpExcel->getSheetByName($sheetName)) {\r\n\t\t\t\t\t\t$docSheet->getPageSetup()->setPrintArea(implode(',', $extractedRanges)); // C7:J66,A1:IV2\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase pack('C', 0x07):\r\n\t\t\t\t\t// print titles (repeating rows)\r\n\t\t\t\t\t// Assuming BIFF8, there are 3 cases\r\n\t\t\t\t\t// 1. repeating rows\r\n\t\t\t\t\t//\t\tformula looks like this: Sheet!$A$1:$IV$2\r\n\t\t\t\t\t//\t\trows 1-2 repeat\r\n\t\t\t\t\t// 2. repeating columns\r\n\t\t\t\t\t//\t\tformula looks like this: Sheet!$A$1:$B$65536\r\n\t\t\t\t\t//\t\tcolumns A-B repeat\r\n\t\t\t\t\t// 3. both repeating rows and repeating columns\r\n\t\t\t\t\t//\t\tformula looks like this: Sheet!$A$1:$B$65536,Sheet!$A$1:$IV$2\r\n\r\n\t\t\t\t\t$ranges = explode(',', $definedName['formula']); // FIXME: what if sheetname contains comma?\r\n\r\n\t\t\t\t\tforeach ($ranges as $range) {\r\n\t\t\t\t\t\t// $range should look like this one of these\r\n\t\t\t\t\t\t//\t\tSheet!$A$1:$B$65536\r\n\t\t\t\t\t\t//\t\tSheet!$A$1:$IV$2\r\n\r\n\t\t\t\t\t\t$explodes = explode('!', $range);\r\n\r\n\t\t\t\t\t\tif (count($explodes) == 2) {\r\n\t\t\t\t\t\t\tif ($docSheet = $this->_phpExcel->getSheetByName($explodes[0])) {\r\n\r\n\t\t\t\t\t\t\t\t$extractedRange = $explodes[1];\r\n\t\t\t\t\t\t\t\t$extractedRange = str_replace('$', '', $extractedRange);\r\n\r\n\t\t\t\t\t\t\t\t$coordinateStrings = explode(':', $extractedRange);\r\n\t\t\t\t\t\t\t\tif (count($coordinateStrings) == 2) {\r\n\t\t\t\t\t\t\t\t\tlist($firstColumn, $firstRow) = PHPExcel_Cell::coordinateFromString($coordinateStrings[0]);\r\n\t\t\t\t\t\t\t\t\tlist($lastColumn, $lastRow) = PHPExcel_Cell::coordinateFromString($coordinateStrings[1]);\r\n\r\n\t\t\t\t\t\t\t\t\tif ($firstColumn == 'A' and $lastColumn == 'IV') {\r\n\t\t\t\t\t\t\t\t\t\t// then we have repeating rows\r\n\t\t\t\t\t\t\t\t\t\t$docSheet->getPageSetup()->setRowsToRepeatAtTop(array($firstRow, $lastRow));\r\n\t\t\t\t\t\t\t\t\t} elseif ($firstRow == 1 and $lastRow == 65536) {\r\n\t\t\t\t\t\t\t\t\t\t// then we have repeating columns\r\n\t\t\t\t\t\t\t\t\t\t$docSheet->getPageSetup()->setColumnsToRepeatAtLeft(array($firstColumn, $lastColumn));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// Extract range\r\n\t\t\t\t$explodes = explode('!', $definedName['formula']);\r\n\r\n\t\t\t\tif (count($explodes) == 2) {\r\n\t\t\t\t\tif (($docSheet = $this->_phpExcel->getSheetByName($explodes[0])) ||\r\n\t\t\t\t\t\t($docSheet = $this->_phpExcel->getSheetByName(trim($explodes[0],\"'\")))) {\r\n\t\t\t\t\t\t$extractedRange = $explodes[1];\r\n\t\t\t\t\t\t$extractedRange = str_replace('$', '', $extractedRange);\r\n\r\n\t\t\t\t\t\t$localOnly = ($definedName['scope'] == 0) ? false : true;\r\n\r\n\t\t\t\t\t\t$scope = ($definedName['scope'] == 0) ?\r\n\t\t\t\t\t\t\tnull : $this->_phpExcel->getSheetByName($this->_sheets[$definedName['scope'] - 1]['name']);\r\n\r\n\t\t\t\t\t\t$this->_phpExcel->addNamedRange( new PHPExcel_NamedRange((string)$definedName['name'], $docSheet, $extractedRange, $localOnly, $scope) );\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//\tNamed Value\r\n\t\t\t\t\t//\tTODO Provide support for named values\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $this->_phpExcel;\r\n\t}" ]
[ "public static function newDocumentPHP($markup = null, $contentType = \"text/html\") \n {\n // TODO pass charset to phpToMarkup if possible (use DOMDocumentWrapper function)\n $markup = phpQuery::phpToMarkup($markup, self::$defaultCharset);\n return self::newDocument($markup, $contentType);\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Commit an http request. @param string $method @param string $url @param array $params @param array $options @return \Shoperti\PayMe\Contracts\ResponseInterface
[ "public function commit($method, $url, $params = [], $options = [])\n {\n if (empty($this->connectionToken)) {\n $this->loginApplication();\n }\n\n $request = [\n 'exceptions' => false,\n 'timeout' => '80',\n 'connect_timeout' => '30',\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer '.$this->connectionToken,\n ],\n ];\n\n if (!empty($params)) {\n $request[$method === 'get' ? 'query' : 'json'] = $params;\n }\n\n $raw = $this->getHttpClient()->{$method}($url, $request);\n $statusCode = $raw->getStatusCode();\n\n $response = $statusCode == 200\n ? $this->parseResponse($raw->getBody())\n : $this->responseError($raw->getBody(), $statusCode);\n\n return $this->respond($response);\n }" ]
[ "public function create( models\\Call\\ContactUrl $ContactUrl){\n $rest = $this->getService( self::API_URL);\n $rest->POST( $ContactUrl);\n\n return $rest->getResult( models\\Call\\ContactUrl::class);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Compares the two Git trees (with caching).
[ "private List<DiffEntry> blockingCompareTrees(RevTree treeA, RevTree treeB) {\n if (cache == null) {\n return blockingCompareTreesUncached(treeA, treeB, TreeFilter.ALL);\n }\n\n final CacheableCompareTreesCall key = new CacheableCompareTreesCall(this, treeA, treeB);\n CompletableFuture<List<DiffEntry>> existingFuture = cache.getIfPresent(key);\n if (existingFuture != null) {\n final List<DiffEntry> existingDiffEntries = existingFuture.getNow(null);\n if (existingDiffEntries != null) {\n // Cached already.\n return existingDiffEntries;\n }\n }\n\n // Not cached yet. Acquire a lock so that we do not compare the same tree pairs simultaneously.\n final List<DiffEntry> newDiffEntries;\n final Lock lock = key.coarseGrainedLock();\n lock.lock();\n try {\n existingFuture = cache.getIfPresent(key);\n if (existingFuture != null) {\n final List<DiffEntry> existingDiffEntries = existingFuture.getNow(null);\n if (existingDiffEntries != null) {\n // Other thread already put the entries to the cache before we acquire the lock.\n return existingDiffEntries;\n }\n }\n\n newDiffEntries = blockingCompareTreesUncached(treeA, treeB, TreeFilter.ALL);\n cache.put(key, newDiffEntries);\n } finally {\n lock.unlock();\n }\n\n logger.debug(\"Cache miss: {}\", key);\n return newDiffEntries;\n }" ]
[ "def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants --changed-parent=HEAD list` (w/ no changes) returning an empty result.\n return self.context.target_roots" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Rewrite references to `local_path` with `remote_path` in job inputs.
[ "def rewrite_paths(self, local_path, remote_path):\n \n self.__rewrite_command_line(local_path, remote_path)\n self.__rewrite_config_files(local_path, remote_path)" ]
[ "def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns the initial of given name. For standard names: "First [Midddles] Last", returns capital "FL"; For others, returns substr(0, 2). @param {string} name - @return {string} - initial
[ "function getNameInitial(name) {\n\t\tvar namePart = name.split(' ');\n\t\tif (namePart.length >= 2) {\n\t\t\treturn (namePart[0].charAt(0) + namePart[namePart.length - 1].charAt(0)).toUpperCase();\n\t\t} else {\n\t\t\treturn name.substr(0, 2);\n\t\t}\n\t}" ]
[ "def lastname(self, value, case, gender=None):\n \n \"\"\"\n if not value:\n raise ValueError('Lastname cannot be empty.')\n\n return self.__inflect(value, case, 'lastname', gender)" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Sets the variables to the selected stage using cap rbenv set
[ "def set_vars_to_stage(stage, variables)\n # convert to array using VAR=value\n vars_array = variables.map{|k,v| \"#{k}=#{v}\" }\n Capistrano::Application.invoke(stage)\n Capistrano::Application.invoke(\"rbenv:vars:set\", *vars_array)\n end" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create a 500 response. @param \Exception $exception The exception to log. @return JsonResponse
[ "private function createInternalServerError(\\Exception $exception)\n {\n $message = sprintf(\n '%s: %s (uncaught exception) at %s line %s',\n get_class($exception),\n $exception->getMessage(),\n $exception->getFile(),\n $exception->getLine()\n );\n\n $this->logger->error($message, array('exception' => $exception));\n\n $response = [\n 'status' => 'ERROR',\n 'message' => JsonResponse::$statusTexts[JsonResponse::HTTP_INTERNAL_SERVER_ERROR]\n ];\n\n if ($this->debug) {\n $response['exception'] = $this->formatException($exception);\n }\n\n return new JsonResponse($response, JsonResponse::HTTP_INTERNAL_SERVER_ERROR);\n }" ]
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
// SetAmznClientToken sets the AmznClientToken field's value.
[ "func (s *CreateConnectorDefinitionVersionInput) SetAmznClientToken(v string) *CreateConnectorDefinitionVersionInput {\n\ts.AmznClientToken = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadContext\n // in order to re-establish the thread context based on the metadata identity if not defaulted.\n }" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// SetApplicationVersionId sets the ApplicationVersionId field's value.
[ "func (s *AddApplicationInputProcessingConfigurationOutput) SetApplicationVersionId(v int64) *AddApplicationInputProcessingConfigurationOutput {\n\ts.ApplicationVersionId = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadContext\n // in order to re-establish the thread context based on the metadata identity if not defaulted.\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Writes out headers for $this->part and follows them with an empty line. @param StreamInterface $stream
[ "public function writePartHeadersTo(StreamInterface $stream)\n {\n foreach ($this->getPartHeadersIterator() as $header) {\n $stream->write(\"${header[0]}: ${header[1]}\\r\\n\");\n }\n $stream->write(\"\\r\\n\");\n }" ]
[ "public function render($renderer)\n {\n $renderer->setCurrentStyle('footnotenum');\n $renderer->Write($renderer->getCurrentStyleHeight(), $this->numText, $this->addlink); //source link numbers after name\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Add all additional defined and undefined symbols.
[ "def __add_symbols(self, cmd):\n \n\n if self.__config.define_symbols:\n symbols = self.__config.define_symbols\n cmd.append(''.join(\n [' -D\"%s\"' % def_symbol for def_symbol in symbols]))\n\n if self.__config.undefine_symbols:\n un_symbols = self.__config.undefine_symbols\n cmd.append(''.join(\n [' -U\"%s\"' % undef_symbol for undef_symbol in un_symbols]))\n\n return cmd" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// CanCastle returns true if the given color and side combination // can castle, otherwise returns false.
[ "func (cr CastleRights) CanCastle(c Color, side Side) bool {\n\tchar := \"k\"\n\tif side == QueenSide {\n\t\tchar = \"q\"\n\t}\n\tif c == White {\n\t\tchar = strings.ToUpper(char)\n\t}\n\treturn strings.Contains(string(cr), char)\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are different than the class name\n this.type = \"\";\n // Used to provide access to the name of the class \n this.className = \"Rule\";\n // Indicates whether generated nodes should be added to the abstract syntax tree\n this._createAstNode = false;\n // A parser function, computed in a rule's constructor. If successful returns either the original or a new \n // ParseState object. If it fails it returns null.\n this.parser = null;\n // A lexer function, computed in a rule's constructor. The lexer may update the ParseState if successful.\n // If it fails it is required that the lexer restore the ParseState index to the previous state. \n // Lexers should only update the index. \n this.lexer = null;\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Finds all nodes that are after the ``min_line_number``
[ "def filter_assert_nodes(nodes: List[ast.stmt], min_line_number: int) -> List[ast.stmt]:\n \n return [node for node in nodes if node.lineno > min_line_number]" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github description about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Checks for valid uploaded file. @param array $package @return bool
[ "protected function isUploadedFile($package)\n {\n if (isset($package['name'], $package['tmp_name'], $package['type'], $package['size'])) {\n if (in_array($package['type'], ['application/zip', 'application/x-zip-compressed'])) {\n return true;\n }\n }\n\n return false;\n }" ]
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about File management:" }
Compare two attributes @param control @param test @param listener @throws DifferenceFoundException
[ "protected void compareRecognizedXMLSchemaInstanceAttribute(Attr control,\n Attr test,\n DifferenceListener listener)\n throws DifferenceFoundException {\n Attr nonNullNode = control != null ? control : test;\n Difference d = \n XMLConstants.W3C_XML_SCHEMA_INSTANCE_SCHEMA_LOCATION_ATTR\n .equals(nonNullNode.getLocalName())\n ? SCHEMA_LOCATION : NO_NAMESPACE_SCHEMA_LOCATION;\n\n if (control != null) {\n controlTracker.visited(control);\n }\n if (test != null) {\n testTracker.visited(test);\n }\n \n compare(control != null ? control.getValue() : ATTRIBUTE_ABSENT,\n test != null ? test.getValue() : ATTRIBUTE_ABSENT,\n control, test, listener, d);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Export this data so it can be used as the context for a mustache template. @param \renderer_base $output @return stdClass
[ "public function export_for_template(renderer_base $output) {\n global $USER, $OUTPUT;\n\n $data = new \\stdClass();\n\n if (!isset($this->config->display_picture) || $this->config->display_picture == 1) {\n $data->userpicture = $OUTPUT->user_picture($USER, array('class' => 'userpicture'));\n }\n\n $data->userfullname = fullname($USER);\n\n if (!isset($this->config->display_country) || $this->config->display_country == 1) {\n $countries = get_string_manager()->get_list_of_countries(true);\n if (isset($countries[$USER->country])) {\n $data->usercountry = $countries[$USER->country];\n }\n }\n\n if (!isset($this->config->display_city) || $this->config->display_city == 1) {\n $data->usercity = $USER->city;\n }\n\n if (!isset($this->config->display_email) || $this->config->display_email == 1) {\n $data->useremail = obfuscate_mailto($USER->email, '');\n }\n\n if (!empty($this->config->display_icq) && !empty($USER->icq)) {\n $data->usericq = s($USER->icq);\n }\n\n if (!empty($this->config->display_skype) && !empty($USER->skype)) {\n $data->userskype = s($USER->skype);\n }\n\n if (!empty($this->config->display_yahoo) && !empty($USER->yahoo)) {\n $data->useryahoo = s($USER->yahoo);\n }\n\n if (!empty($this->config->display_aim) && !empty($USER->aim)) {\n $data->useraim = s($USER->aim);\n }\n\n if (!empty($this->config->display_msn) && !empty($USER->msn)) {\n $data->usermsn = s($USER->msn);\n }\n\n if (!empty($this->config->display_phone1) && !empty($USER->phone1)) {\n $data->userphone1 = s($USER->phone1);\n }\n\n if (!empty($this->config->display_phone2) && !empty($USER->phone2)) {\n $data->userphone2 = s($USER->phone2);\n }\n\n if (!empty($this->config->display_institution) && !empty($USER->institution)) {\n $data->userinstitution = format_string($USER->institution);\n }\n\n if (!empty($this->config->display_address) && !empty($USER->address)) {\n $data->useraddress = format_string($USER->address);\n }\n\n if (!empty($this->config->display_firstaccess) && !empty($USER->firstaccess)) {\n $data->userfirstaccess = userdate($USER->firstaccess);\n }\n\n if (!empty($this->config->display_lastaccess) && !empty($USER->lastaccess)) {\n $data->userlastaccess = userdate($USER->lastaccess);\n }\n\n if (!empty($this->config->display_currentlogin) && !empty($USER->currentlogin)) {\n $data->usercurrentlogin = userdate($USER->currentlogin);\n }\n\n if (!empty($this->config->display_lastip) && !empty($USER->lastip)) {\n $data->userlastip = $USER->lastip;\n }\n\n return $data;\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// AddMultiple adds a list of cookies.
[ "func AddMultiple(cookies []*http.Cookie) p.Plugin {\n\treturn p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {\n\t\tfor _, cookie := range cookies {\n\t\t\tctx.Request.AddCookie(cookie)\n\t\t}\n\t\th.Next(ctx)\n\t})\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the post about App development:", "pos": "Represent the code about App development:", "neg": "Represent the code:" }
Gets the next match_temp_var.
[ "def get_temp_var(self):\n \"\"\"\"\"\"\n tempvar = match_temp_var + \"_\" + str(self.var_index)\n self.var_index += 1\n return tempvar" ]
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_response(response, bin=self)))" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns true if the associate PushMode was selected in the configuration @param Configuration $configuration @return bool
[ "public function isMode( Configuration $configuration ) {\n\t\tif( $this->inServiceChecker->isInService($configuration) )\n\t\t\treturn false;\n\n\t\tif( $this->replaceUpgradeChecker->isReplaceUpgrade($configuration) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Start healthcheck (status monitoring) for a peer It also whitelists the address to answer invites and listen for messages
[ "def start_health_check(self, node_address):\n \n if self._stop_event.ready():\n return\n\n with self._health_lock:\n if self._address_mgr.is_address_known(node_address):\n return # already healthchecked\n\n node_address_hex = to_normalized_address(node_address)\n self.log.debug('Healthcheck', peer_address=node_address_hex)\n\n candidates = [\n self._get_user(user)\n for user in self._client.search_user_directory(node_address_hex)\n ]\n user_ids = {\n user.user_id\n for user in candidates\n if validate_userid_signature(user) == node_address\n }\n self.whitelist(node_address)\n self._address_mgr.add_userids_for_address(node_address, user_ids)\n\n # Ensure network state is updated in case we already know about the user presences\n # representing the target node\n self._address_mgr.refresh_address_presence(node_address)" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Custom error handler that will throw an exception on any errors
[ "public function handleError()\n {\n // get error info\n list ($errno, $message, $file, $line) = func_get_args();\n\n // construct error message\n $msg = \"ERROR ($errno): $message\";\n if ($line !== null) {\n $file = \"$file:$line\";\n }\n\n if ($file !== null) {\n $msg .= \" [$file]\";\n }\n\n static::$lastErrno = $errno;\n\n // throw the exception\n throw new RuntimeException($msg, $errno);\n }" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAREFUL : doesnt make sense if this node only run a one-time task...\n # TODO: futures and ThreadPoolExecutor (so we dont need to manage the pool ourselves)\n else:\n return False" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// details outputs details for a single transaction.
[ "func (w *walletAPIHandler) details(ctx context.Context, c Call, wr io.Writer) error {\n\tvar opts txIDOptions\n\tif err := unmarshalOptions(c, &opts); err != nil {\n\t\treturn w.encodeErr(c, err, wr)\n\t}\n\tdetail, err := w.cli.PaymentDetailCLILocal(ctx, opts.TxID)\n\tif err != nil {\n\t\treturn w.encodeErr(c, err, wr)\n\t}\n\treturn w.encodeResult(c, detail, wr)\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the text about Database Management:", "pos": "Represent the code about Database Management:", "neg": "Represent the code:" }
Set dotted attr (like "a.b.c") on obj to val.
[ "def setattrdeep(obj, attr, val):\n ''\n attrs = attr.split('.')\n\n for a in attrs[:-1]:\n obj = getattr(obj, a)\n setattr(obj, attrs[-1], val)" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(whence=whence)" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
---------------------------------------------------------------------------
[ "function replaceInFile (filename, regex, replacement) {\n let contents = fs.readFileSync (filename, 'utf8')\n const parts = contents.split (regex)\n const newContents = parts[0] + replacement + parts[1]\n fs.truncateSync (filename)\n fs.writeFileSync (filename, newContents)\n}" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD CAP\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
Check so Locale settings (country, currency, language) are set. @throws KlarnaException @return void
[ "private function _checkLocale()\n {\n if (!is_int($this->_country)\n || !is_int($this->_language)\n || !is_int($this->_currency)\n ) {\n throw new Klarna_InvalidLocaleException;\n }\n }" ]
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
@param \PHP_CodeSniffer\Files\File $phpCsFile @param int $stackPointer @return bool
[ "protected function hasMethodAnnotation(File $phpCsFile, int $stackPointer): bool\n {\n $position = $phpCsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, $stackPointer);\n $tokens = $phpCsFile->getTokens();\n\n while ($position !== false) {\n $position = $phpCsFile->findPrevious(T_DOC_COMMENT_TAG, $position);\n\n if ($position !== false) {\n if (strpos($tokens[$position + 2]['content'], $this->getMethodName() . '()') !== false) {\n return true;\n }\n\n $position--;\n }\n }\n\n return false;\n }" ]
[ "public function apply(AbstractNode $node)\n {\n /** @var \\PDepend\\Source\\AST\\ASTClass $node */\n if ($node->isAbstract()) {\n return;\n }\n\n if (empty($this->classRegex) || preg_match($this->classRegex, $node->getFullQualifiedName()) === 0) {\n return;\n }\n\n /** @var \\PHPMD\\Node\\ClassNode $node */\n $this->applyImplementsInterfaceWithSameNameAndSuffix($node);\n }" ]
codesearchnet
{ "query": "Represent the Github post about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
Remove a parser from the render queue. @param \Ems\Contracts\Core\TextParser $parser @return self
[ "public function remove(TextParser $parser)\n {\n $parserHash = $this->objectHash($parser);\n\n $this->parsers = array_filter($this->parsers, function ($known) use ($parserHash) {\n return $this->objectHash($known) != $parserHash;\n });\n\n if (isset($this->parserIds[$parserHash])) {\n unset($this->parserIds[$parserHash]);\n }\n\n return $this;\n }" ]
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// GetZone returns the Zone containing the current availability zone and locality region that the program is running in. // If the node is not running with availability zones, then it will fall back to fault domain.
[ "func (az *Cloud) GetZone(ctx context.Context) (cloudprovider.Zone, error) {\n\tif az.UseInstanceMetadata {\n\t\tmetadata, err := az.metadata.GetMetadata()\n\t\tif err != nil {\n\t\t\treturn cloudprovider.Zone{}, err\n\t\t}\n\n\t\tif metadata.Compute == nil {\n\t\t\treturn cloudprovider.Zone{}, fmt.Errorf(\"failure of getting compute information from instance metadata\")\n\t\t}\n\n\t\tzone := \"\"\n\t\tif metadata.Compute.Zone != \"\" {\n\t\t\tzoneID, err := strconv.Atoi(metadata.Compute.Zone)\n\t\t\tif err != nil {\n\t\t\t\treturn cloudprovider.Zone{}, fmt.Errorf(\"failed to parse zone ID %q: %v\", metadata.Compute.Zone, err)\n\t\t\t}\n\t\t\tzone = az.makeZone(zoneID)\n\t\t} else {\n\t\t\tklog.V(3).Infof(\"Availability zone is not enabled for the node, falling back to fault domain\")\n\t\t\tzone = metadata.Compute.FaultDomain\n\t\t}\n\n\t\treturn cloudprovider.Zone{\n\t\t\tFailureDomain: zone,\n\t\t\tRegion: az.Location,\n\t\t}, nil\n\t}\n\t// if UseInstanceMetadata is false, get Zone name by calling ARM\n\thostname, err := os.Hostname()\n\tif err != nil {\n\t\treturn cloudprovider.Zone{}, fmt.Errorf(\"failure getting hostname from kernel\")\n\t}\n\treturn az.vmSet.GetZoneByNodeName(strings.ToLower(hostname))\n}" ]
[ "func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identity provider\n\t// * A single race is possible on user creation between two instances of the same provider\n\t// * A single race is possible on identity creation between two instances of the same provider\n\t//\n\t// A race condition between three conflicting identity providers *and* multiple instances of the same identity provider\n\t// seems like a reasonable situation to return an error (you would get an AlreadyExists error on either the user or the identity)\n\treturn p.userForWithRetries(info, 3)\n}" ]
codesearchnet
{ "query": "Represent the Github comment about Networking:", "pos": "Represent the Github code about Networking:", "neg": "Represent the Github code about Software development:" }
Decode sensor data. Returns: dict: Sensor values
[ "def decode_data(self, encoded):\n '''\n \n '''\n try:\n identifier = None\n data_format = 2\n if len(encoded) > 8:\n data_format = 4\n identifier = encoded[8:]\n encoded = encoded[:8]\n decoded = bytearray(base64.b64decode(encoded, '-_'))\n return {\n 'data_format': data_format,\n 'temperature': self._get_temperature(decoded),\n 'humidity': self._get_humidity(decoded),\n 'pressure': self._get_pressure(decoded),\n 'identifier': identifier\n }\n except:\n log.exception('Encoded value: %s not valid', encoded)\n return None" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated document for the core of the topic search\n return schema" ]
codesearchnet
{ "query": "Represent the summarization about Data processing:", "pos": "Represent the code about Data processing:", "neg": "Represent the code:" }
<p> A list of the configuration options and their values in this configuration set. </p> @return A list of the configuration options and their values in this configuration set.
[ "public java.util.List<ConfigurationOptionSetting> getOptionSettings() {\n if (optionSettings == null) {\n optionSettings = new com.amazonaws.internal.SdkInternalList<ConfigurationOptionSetting>();\n }\n return optionSettings;\n }" ]
[ "function(terria) {\n CatalogGroup.call(this, terria, \"csw\");\n\n /**\n * Gets or sets the URL of the CSW server. This property is observable.\n * @type {String}\n */\n this.url = \"\";\n\n /**\n * Gets or sets the template XML string to POST to the CSW server to query for catalog items. If this property is undefined,\n * {@link CswCatalogGroup.defaultGetRecordsTemplate} is used. The XML string should have a `{startPosition}` placeholder to be\n * replaced with the next start position in order to allow incremental paging of results.\n * This property is observable.\n * @type {String}\n */\n this.getRecordsTemplate = undefined;\n\n /**\n * True to allow WMS resources to be added to the catalog; otherwise, false.\n * @type {Boolean}\n * @default true\n */\n this.includeWms = true;\n\n /**\n * Gets or sets a regular expression that, when it matches the protocol attribute of a URI element of a record, indicates that the URI is a WMS resource.\n * @type {RegExp}\n */\n this.wmsResourceFormat = /\\bwms\\b/i;\n\n /**\n * True to allow KML resources to be added to the catalog; otherwise, false.\n * @type {Boolean}\n * @default false\n */\n this.includeKml = false;\n\n /**\n * Gets or sets a regular expression that, when it matches the protocol attribute of a URI element of a record, indicates that the resource is a KML resource.\n * @type {RegExp}\n */\n this.kmlResourceFormat = /\\bkml\\b/i;\n\n /**\n * True to allow CSV resources to be added to the catalog; otherwise, false.\n * @type {Boolean}\n */\n this.includeCsv = false;\n\n /**\n * Gets or sets a regular expression that, when it matches the protocol attribute of a URI element of a record, indicates that the resource is a CSV resource.\n * @type {RegExp}\n */\n this.csvResourceFormat = /\\bcsv-geo-/i;\n\n /**\n * True to allow ESRI Map resources to be added to the catalog; otherwise, false.\n * @type {Boolean}\n * @default false\n */\n this.includeEsriMapServer = false;\n\n /**\n * Gets or sets a regular expression that, when it matches the protocol attribute of a URI element of a record, indicates that the resource is an Esri MapServer resource.\n * @type {RegExp}\n */\n this.esriMapServerResourceFormat = /\\besri rest\\b/i;\n\n /**\n * True to allow GeoJSON resources to be added to the catalog; otherwise, false.\n * @type {Boolean}\n * @default false\n */\n this.includeGeoJson = false;\n\n /**\n * Gets or sets a regular expression that, when it matches the protocol attribute of a URI element of a record, indicates that the resource is a GeoJSON resource.\n * @type {RegExp}\n */\n this.geoJsonResourceFormat = /\\bgeojson\\b/i;\n\n /**\n * Gets or sets a list of key value pairs that will be used to group resources returned from the catalog. The keys are used to match elements in the metadata and the values are used as names for the groups of resources to be created.\n * @type {RegExp}\n */\n this.metadataGroups = [];\n\n /**\n * Gets or sets a description of a domain that will be pulled from the CSW service and used to define the metadataGroups. The domain is obtained by querying the CSW server for a particular property - the values of the property form the domain, the values are assumed to define a hierarchy eg. Wave Models | Wave Energy Flux - which is a two level hierarchy of groups that will be used to classify metadata records.\n * @type {Object}\n */\n this.domainSpecification = undefined;\n\n /**\n * True to allow OGC:WPS service resources to be added to the catalog; otherwise, false.\n * @type {Boolean}\n * @default false\n */\n this.includeWps = false;\n\n /**\n * Gets or sets a regular expression that, when it matches the protocol attribute of a URI element of a record, indicates that the resource is a WPS resource.\n * @type {RegExp}\n */\n this.wpsResourceFormat = /\\bwps\\b/i;\n\n /**\n * Gets or sets a hash of properties that will be set on the item created from the CKAN resource.\n * For example, { \"treat404AsError\": false }\n * @type {Object}\n */\n this.itemProperties = undefined;\n\n knockout.track(this, [\n \"url\",\n \"getRecordsParameters\",\n \"includeWms\",\n \"includeKml\",\n \"includeCsv\",\n \"includeEsriMapServer\",\n \"includeGeoJson\",\n \"includeWps\",\n \"itemProperties\"\n ]);\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about Documentation:", "pos": "Represent the Github code about Documentation:", "neg": "Represent the Github code about AWS Redshift:" }
// SetDeadline implements the net.PacketConn SetDeadline method.
[ "func (c *Conn) SetDeadline(t time.Time) error {\n\treturn c.p.SetDeadline(t)\n}" ]
[ "func (*protocol) NewEndpoint(stack *stack.Stack, netProto tcpip.NetworkProtocolNumber, waiterQueue *waiter.Queue) (tcpip.Endpoint, *tcpip.Error) {\n\treturn newEndpoint(stack, netProto, waiterQueue), nil\n}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// Reset cleans up the request queue
[ "func (s *BulkService) Reset() {\n\ts.requests = make([]BulkableRequest, 0)\n\ts.sizeInBytes = 0\n\ts.sizeInBytesCursor = 0\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Registers a named object in the store.
[ "function(obj, type, name, nameIsUnique, oldName) {\n var nameMap, objList\n\n this._store[type] = nameMap = this._store[type] || {}\n nameMap[name] = objList = nameMap[name] || []\n\n // Adding new mapping\n if (objList.indexOf(obj) === -1) {\n if (nameIsUnique && objList.length > 0)\n throw new Error('there is already a ' + type + ' with name \"' + name + '\"')\n objList.push(obj)\n }\n\n // Removing old mapping\n if (oldName) {\n objList = nameMap[oldName]\n objList.splice(objList.indexOf(obj), 1)\n }\n\n exports.emitter.emit('namedObjects:registered:' + type, obj)\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about software development:", "pos": "Represent the Github code about software development:", "neg": "Represent the Github code:" }
Function creating an iterator of edges for the given type. @param {Graph} graph - Target Graph instance. @param {string} type - Type of edges to retrieve. @return {Iterator}
[ "function createEdgeIterator(graph, type) {\n if (graph.size === 0)\n return Iterator.empty();\n\n let iterator;\n\n if (type === 'mixed') {\n iterator = graph._edges.values();\n\n return new Iterator(function next() {\n const step = iterator.next();\n\n if (step.done)\n return step;\n\n const data = step.value;\n\n const value = [\n data.key,\n data.attributes,\n data.source.key,\n data.target.key,\n data.source.attributes,\n data.target.attributes\n ];\n\n return {value, done: false};\n });\n }\n\n iterator = graph._edges.values();\n\n return new Iterator(function next() {\n const step = iterator.next();\n\n if (step.done)\n return step;\n\n const data = step.value;\n\n if ((data instanceof UndirectedEdgeData) === (type === 'undirected')) {\n const value = [\n data.key,\n data.attributes,\n data.source.key,\n data.target.key,\n data.source.attributes,\n data.target.attributes\n ];\n\n return {value, done: false};\n }\n\n return next();\n });\n}" ]
[ "function NDDBIndex(idx, nddb) {\n // The name of the index.\n this.idx = idx;\n // Reference to the whole nddb database.\n this.nddb = nddb;\n // Map indexed-item to a position in the original database.\n this.resolve = {};\n // List of all keys in `resolve` object.\n this.keys = [];\n // Map indexed-item to a position in `keys` array (for fast deletion).\n this.resolveKeys = {};\n }" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetFIFOCompactionOptions sets the options for FIFO compaction style. // Default: nil
[ "func (opts *Options) SetFIFOCompactionOptions(value *FIFOCompactionOptions) {\n\tC.rocksdb_options_set_fifo_compaction_options(opts.c, value.c)\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Method to create the blank transaction nodes as a dict. If bic is True, the BIC node will also be created.
[ "def _create_TX_node(self, bic=True):\n \n ED = dict()\n ED['DrctDbtTxInfNode'] = ET.Element(\"DrctDbtTxInf\")\n ED['PmtIdNode'] = ET.Element(\"PmtId\")\n ED['EndToEndIdNode'] = ET.Element(\"EndToEndId\")\n ED['InstdAmtNode'] = ET.Element(\"InstdAmt\")\n ED['DrctDbtTxNode'] = ET.Element(\"DrctDbtTx\")\n ED['MndtRltdInfNode'] = ET.Element(\"MndtRltdInf\")\n ED['MndtIdNode'] = ET.Element(\"MndtId\")\n ED['DtOfSgntrNode'] = ET.Element(\"DtOfSgntr\")\n ED['DbtrAgtNode'] = ET.Element(\"DbtrAgt\")\n ED['FinInstnId_DbtrAgt_Node'] = ET.Element(\"FinInstnId\")\n if bic:\n ED['BIC_DbtrAgt_Node'] = ET.Element(\"BIC\")\n ED['DbtrNode'] = ET.Element(\"Dbtr\")\n ED['Nm_Dbtr_Node'] = ET.Element(\"Nm\")\n ED['DbtrAcctNode'] = ET.Element(\"DbtrAcct\")\n ED['Id_DbtrAcct_Node'] = ET.Element(\"Id\")\n ED['IBAN_DbtrAcct_Node'] = ET.Element(\"IBAN\")\n ED['RmtInfNode'] = ET.Element(\"RmtInf\")\n ED['UstrdNode'] = ET.Element(\"Ustrd\")\n return ED" ]
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization to avoid errors\n # in test tools that show the object with repr().\n assert isinstance(path, CIMClassName) or path is None" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic Object eGet(int featureID, boolean resolve, boolean coreType) {\n\t\tswitch (featureID) {\n\t\t\tcase BpsimPackage.NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT:\n\t\t\t\treturn getCurrencyUnit();\n\t\t\tcase BpsimPackage.NUMERIC_PARAMETER_TYPE__TIME_UNIT:\n\t\t\t\treturn getTimeUnit();\n\t\t\tcase BpsimPackage.NUMERIC_PARAMETER_TYPE__VALUE:\n\t\t\t\treturn getValue();\n\t\t}\n\t\treturn super.eGet(featureID, resolve, coreType);\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license />\n <channel />\n <extends />\n <summary />\n <description />\n <notes />\n <authors />\n <date />\n <time />\n <contents />\n <compatible />\n <dependencies />\n</package>\nEND;\n $this->_packageXml = simplexml_load_string($packageXmlStub);\n }\n return $this;\n }" ]
codesearchnet
{ "query": "Represent the Github text about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
@param GitUserInterface $user @param FilePath $relativeFilePath @param string $commitMessage @throws \Exception
[ "public function removeFile(GitUserInterface $user, FilePath $relativeFilePath, $commitMessage)\n {\n $this->assertCommitMessageExists($commitMessage);\n $this->createLock($user, $relativeFilePath);\n $this->gitService->removeAndCommit($user, $relativeFilePath, $commitMessage);\n $this->removeLock($user, $relativeFilePath);\n }" ]
[ "public function execute(Config $config, IO $io, Repository $repository, Config\\Action $action) : void\n {\n $options = $action->getOptions();\n $oldMsg = $repository->getCommitMsg();\n\n if (!$repository->isMerging()) {\n $repository->setCommitMsg(new CommitMessage($options->get('message', ''), $oldMsg->getCommentCharacter()));\n }\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }