query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Generate a sequence of filenames that match ``word``. :param word: the word to complete
[ "def gen_filename_completions(self, word, filenames):\n \n if not word:\n return filenames\n else:\n trie = pygtrie.CharTrie()\n for filename in filenames:\n trie[filename] = filename\n return trie.iterkeys(prefix=word)" ]
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Sets key/values based on a mapping. Mapping can be supplied as a single dictionary argument or as kwargs. Cluster impl: Itterate over all items and do SET on each (k,v) pair Operation is no longer atomic.
[ "async def mset(self, *args, **kwargs):\n \n if args:\n if len(args) != 1 or not isinstance(args[0], dict):\n raise RedisError('MSET requires **kwargs or a single dict arg')\n kwargs.update(args[0])\n\n for pair in iteritems(kwargs):\n await self.set(pair[0], pair[1])\n\n return True" ]
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototype link\n :return: Tuple of key/value tuples from the attributes; suitable for hashing\n '''\n computed_rels = [ rel(ctx) if callable(rel) else rel for rel in rels ]\n return computed_rels\n return _values" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Load the data in memory. Args: dataset: string in ['train', 'test']
[ "def _load(self, dataset='train'):\n \n data, labels = None, None\n if dataset is 'train':\n files = [os.path.join(self.cifar10_dir, 'data_batch_%d' % i) for i in range(1, 6)]\n else:\n files = [os.path.join(self.cifar10_dir, 'test_batch')]\n\n for file in files:\n if not os.path.exists(file):\n raise FileNotFoundError('Failed to find file: ' + file)\n\n # Load the data from the batch files\n for file in files:\n with open(file, 'rb') as f:\n cifar10 = pickle.load(f, encoding='latin1')\n\n if labels is None:\n labels = np.array(cifar10['labels'])\n else:\n labels = np.concatenate((labels, cifar10['labels']), axis=0)\n\n if data is None:\n data = cifar10['data']\n else:\n data = np.concatenate((data, cifar10['data']), axis=0)\n\n # Adapt the format of the data to our convnet\n data = np.array(data, dtype=float) / 255.0\n data = data.reshape([-1, self.num_channels, self.img_size, self.img_size])\n data = data.transpose([0, 2, 3, 1])\n\n # One-hot encode labels (see https://stackoverflow.com/a/42874726)\n labels = np.eye(self.num_classes)[np.array(labels).reshape(-1)]\n\n if dataset is 'train':\n self._train_data, self._train_labels = data, labels\n else:\n self._test_data, self._test_labels = data, labels" ]
[ "def get_group(self):\n \n if self.group is None:\n self.group = self.get_field('group')\n if self.group is not None:\n # group data from LightGBM is boundaries data, need to convert to group size\n self.group = np.diff(self.group)\n return self.group" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Sets the application nane. @param applicationNames a {@link java.lang.String} object.
[ "public final void setApplicationName(String... applicationNames) {\n synchronized (lock) {\n if (applicationNames == null) {\n serviceProperties.remove(APPLICATION_NAME);\n } else {\n serviceProperties.put(APPLICATION_NAME, applicationNames);\n }\n\n if (serviceRegistration != null) {\n serviceRegistration.setProperties(serviceProperties);\n }\n }\n }" ]
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the text about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about Documentation:" }
Private functions If steamID is a clan ID, converts to the appropriate chat ID. Otherwise, returns it untouched. @param {SteamID} steamID @returns SteamID
[ "function toChatID(steamID) {\n\tsteamID = Helpers.steamID(steamID);\n\n\tif (steamID.type == SteamID.Type.CLAN) {\n\t\tsteamID.type = SteamID.Type.CHAT;\n\t\tsteamID.instance |= SteamID.ChatInstanceFlags.Clan;\n\t}\n\n\treturn steamID;\n}" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
This is called by the EJB container server code to write a EJB method call postinvoke ends record to the trace log, if enabled.
[ "public static void tracePostInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper)\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())\n {\n StringBuffer sbuf = new StringBuffer();\n\n sbuf\n .append(MthdPostInvokeExit_Type_Str).append(DataDelimiter)\n .append(MthdPostInvokeExit_Type).append(DataDelimiter);\n\n writeDeployedSupportInfo(s, sbuf, wrapper, null);\n\n Tr.debug(tc, sbuf.toString());\n }\n }" ]
[ "@Override\n public void destroy() // PK20881\n {\n if (tc.isEntryEnabled())\n Tr.entry(tc, \"destroy\");\n\n // Dummy transactionWrappers may not be in any table and so\n // will not have a resourceCallback registered to remove them.\n if (_resourceCallback != null)\n _resourceCallback.destroy();\n\n _wrappers.remove(_transaction.getGlobalId());\n\n // Do not remove connection with the TransactionImpl. This will delay garbage\n// collection until the TransactionWrapper is garbage collected.\n// There is a window when an incoming request can access the remoteable object\n// (ie WSCoordinator or CoordinatorResource) and get access to the TransactionWrapper\n// while destroy() is called by another thread as the synchronization is on the\n// TransactionWrapper. When the incoming request gets control, it will find that\n// _transaction is null. Rather than check for this case, we leave the connection\n// to the TransactionImpl and its associated TransactionState. The code above will\n// then check the transaction state and respond appropriately. These checks are\n// already required as the superior may retry requests, etc.\n// _transaction = null;\n\n if (tc.isEntryEnabled())\n Tr.exit(tc, \"destroy\");\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Database management:" }
Create and initialize a `nn.Conv1d` layer with spectral normalization.
[ "def conv1d(ni:int, no:int, ks:int=1, stride:int=1, padding:int=0, bias:bool=False):\n \"\"\n conv = nn.Conv1d(ni, no, ks, stride=stride, padding=padding, bias=bias)\n nn.init.kaiming_normal_(conv.weight)\n if bias: conv.bias.data.zero_()\n return spectral_norm(conv)" ]
[ "def optimizer(self) -> Union[mx.optimizer.Optimizer, SockeyeOptimizer]:\n \n # TODO: Push update to MXNet to expose the optimizer (Module should have a get_optimizer method)\n return self.current_module._optimizer" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// RawDeleteRange implements the RawKV interface.
[ "func (mvcc *MVCCLevelDB) RawDeleteRange(startKey, endKey []byte) {\n\tterror.Log(mvcc.doRawDeleteRange(startKey, endKey))\n}" ]
[ "func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Compose the view. @param \Illuminate\Contracts\View\View $view
[ "public function composeFilters(View $view)\n {\n $roles = $this->cacheResults('roles.filters', function () {\n return $this->role->has('users')->get();\n });\n\n $filters = new Collection;\n $filters->push(link_to_route('admin::auth.users.index', trans('core::generals.all')));\n\n foreach ($roles as $role) {\n /** @var \\Arcanesoft\\Auth\\Models\\Role $role */\n $filters->push(link_to_route('admin::auth.users.roles-filter.index', $role->name, [$role->hashed_id]));\n }\n\n $view->with('rolesFilters', $filters);\n }" ]
[ "public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\\Config\\Repository\\Repository');\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Creates global config file. @since 1.0.0 @access public
[ "public function createGlobalConfig() {\n\t\t$basicConfig = array(\n\t\t\t'actor' => $this->actorSuffix,\n\t\t\t'paths' => array(\n\t\t\t\t'tests' => 'tests',\n\t\t\t\t'log' => $this->logDir,\n\t\t\t\t'data' => $this->dataDir,\n\t\t\t\t'helpers' => $this->helperDir\n\t\t\t),\n\t\t\t'settings' => array(\n\t\t\t\t'bootstrap' => '_bootstrap.php',\n\t\t\t\t'colors' => strtoupper( substr( PHP_OS, 0, 3 ) ) != 'WIN',\n\t\t\t\t'memory_limit' => WP_MAX_MEMORY_LIMIT\n\t\t\t),\n\t\t);\n\n\t\t$str = Yaml::dump( $basicConfig, 4 );\n\t\tif ( $this->namespace ) {\n\t\t\t$str = \"namespace: {$this->namespace} \\n\" . $str;\n\t\t}\n\t\t\n\t\tfile_put_contents( 'codeception.yml', $str );\n\t}" ]
[ "function init(entry, socket, req) { // {{{2\n/**\n * Class constructor\n *\n * @param entry {Object} Entry of xorg kind\n *\n * @method constructor\n */\n\n this.entry = entry;\n\n O.link.open(this, socket);\n}" ]
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Computer Science:" }
Remove a listener laoder from this dispatcher. @param LoaderInterface|string $event The event object or name. @return Dispatcher This method is chainable.
[ "public function removeListenerLoader($loader)\n\t{\n\t\tif ($loader instanceof LoaderInterface)\n\t\t{\n\t\t\t$loader = $loader->getName();\n\t\t}\n\n\t\tif (isset($this->loaders[$loader]))\n\t\t{\n\t\t\tunset($this->loaders[$loader]);\n\t\t}\n\n\t\treturn $this;\n\t}" ]
[ "@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// MonthNarrow returns the locales narrow month given the 'month' provided
[ "func (lg *lg_UG) MonthNarrow(month time.Month) string {\n\treturn lg.monthsNarrow[month]\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class converts multiple language tags into one\n // Otherwise, it assumes that a single name_ tag exists with JSON content, and it will replace\n // it with multiple tags \"name_en\", \"name_fr\", ... depending on the JSON language codes\n this.namePicker = options.namePicker;\n\n // Flag to make requested_name (local_name) form\n this.combineName = options.combineName;\n}" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Takes the detected point along the line and its gradient and converts it into transform space. @param x point in image. @param y point in image. @param derivX gradient of point. @param derivY gradient of point.
[ "public void parameterize( int x , int y , float derivX , float derivY )\n\t{\n\t\t// put the point in a new coordinate system centered at the image's origin\n\t\t// this minimizes error, which is a function of distance from origin\n\t\tx -= originX;\n\t\ty -= originY;\n\n\t\tfloat v = (x*derivX + y*derivY)/(derivX*derivX + derivY*derivY);\n\n\t\t// finds the foot a line normal equation and put the point into image coordinates\n\t\tint x0 = (int)(v*derivX) + originX;\n\t\tint y0 = (int)(v*derivY) + originY;\n\n\t\tif( transform.isInBounds(x0,y0)) {\n\t\t\tint index = transform.startIndex+y0*transform.stride+x0;\n\t\t\t// keep track of candidate pixels so that a sparse search can be done\n\t\t\t// to detect lines\n\t\t\tif( transform.data[index]++ == 1 )\n\t\t\t\tcandidates.add(x0,y0);\n\t\t}\n\t}" ]
[ "@Override\n public int parity() {\n\n // create three vectors, v->u, v->w and u->x\n double[] vu = toVector(v, u);\n double[] vw = toVector(v, w);\n double[] ux = toVector(u, x);\n\n // normal vector (to compare against), the normal vector (n) looks like:\n // x n w\n // \\ |/\n // u = v\n double[] normal = crossProduct(vu, crossProduct(vu, vw));\n\n // compare the dot products of v->w and u->x, if the signs are the same\n // they are both pointing the same direction. if a value is close to 0\n // then it is at pi/2 radians (i.e. unspecified) however 3D coordinates\n // are generally discrete and do not normally represent on unspecified\n // stereo configurations so we don't check this\n int parity = (int) Math.signum(dot(normal, vw)) * (int) Math.signum(dot(normal, ux));\n\n // invert sign, this then matches with Sp2 double bond parity\n return parity * -1;\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Concatenate KM3HDF5 files via pipeline.
[ "def km3h5concat(input_files, output_file, n_events=None, **kwargs):\n \"\"\"\"\"\"\n from km3pipe import Pipeline # noqa\n from km3pipe.io import HDF5Pump, HDF5Sink # noqa\n\n pipe = Pipeline()\n pipe.attach(HDF5Pump, filenames=input_files, **kwargs)\n pipe.attach(StatusBar, every=250)\n pipe.attach(HDF5Sink, filename=output_file, **kwargs)\n pipe.drain(n_events)" ]
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@internal Log debug events in verbose mode @param string $message
[ "private function debug($message)\n {\n if (1 < func_num_args()) {\n $message = call_user_func_array('sprintf', func_get_args());\n }\n $this->logger->addDebug($message);\n }" ]
[ "def doc_uri(self, args, range=None):\n \"\"\"\"\"\"\n self.log.debug('doc_uri: in')\n self.send_at_position(\"DocUri\", False, \"point\")" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
The list of all tags associated with this configuration. @param tags The list of all tags associated with this configuration. @return Returns a reference to this object so that method calls can be chained together.
[ "public Configuration withTags(java.util.Map<String, String> tags) {\n setTags(tags);\n return this;\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 post about Documentation:", "pos": "Represent the code about Documentation:", "neg": "Represent the code about Software development:" }
Auto Generated Code
[ "def netconf_capability_change_changed_by_server_or_user_server_server(self, **kwargs):\n \n config = ET.Element(\"config\")\n netconf_capability_change = ET.SubElement(config, \"netconf-capability-change\", xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-notifications\")\n changed_by = ET.SubElement(netconf_capability_change, \"changed-by\")\n server_or_user = ET.SubElement(changed_by, \"server-or-user\")\n server = ET.SubElement(server_or_user, \"server\")\n server = ET.SubElement(server, \"server\")\n\n callback = kwargs.pop('callback', self._callback)\n return callback(config)" ]
[ "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 summarization about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about File management:" }
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed
[ "public function handle($request, Closure $next)\n {\n if (Auth::admin()->get()) {\n if ($request->ajax()) {\n return response('Authorized.', 403);\n } else {\n return redirect()->route('lara-mvcms.dashboard');\n }\n }\n\n return $next($request);\n }" ]
[ "abstract public function __construct(Request $request, Translator $translator, View $view, GridContract $grid);\n\n /**\n * Extend decoration.\n *\n * @param callable $callback\n *\n * @return $this\n */\n public function extend(callable $callback = null)\n {\n // Run the table designer.\n if (! \\is_null($callback)) {\n \\call_user_func($callback, $this->grid, $this->request, $this->translator);\n }\n\n return $this;\n }" ]
codesearchnet
{ "query": "Represent the sentence about Laravel:", "pos": "Represent the code about Laravel:", "neg": "Represent the code:" }
Compiles an array with order confirmation data to pass to Paymorrow. @return array
[ "public function collectConfirmData()\n {\n $aData = $this->collectEshopData(false);\n\n // Add transaction data from session\n $aData['pm_order_transaction_id'] = oxRegistry::get('OxpsPaymorrowModule')->getPaymentTransactionId();\n $aData['order_id'] = oxRegistry::getSession()->getVariable('pm_order_id');\n\n // Add verification data\n /** @var OxpsPaymorrowGateway $oGateway */\n $oGateway = oxRegistry::get('OxpsOxid2Paymorrow')->getPaymorrowGateway();\n\n $aData['verification_customer_email'] = $this->_findInArray($aData, 'customer_email');\n $aData['verification_shippingHash'] = $oGateway->getAddressHash(\n array(\n 'lastName' => $this->_findInArray($aData, 'customer_lastName'),\n 'street' => $this->_findInArray($aData, 'customer_shippingAddress_street'),\n 'houseNo' => $this->_findInArray($aData, 'customer_shippingAddress_houseNo'),\n 'zip' => $this->_findInArray($aData, 'customer_shippingAddress_postalCode'),\n )\n );\n $aData['verification_billingHash'] = $oGateway->getAddressHash(\n array(\n 'lastName' => $this->_findInArray($aData, 'customer_lastName'),\n 'street' => $this->_findInArray($aData, 'customer_billingAddress_street'),\n 'houseNo' => $this->_findInArray($aData, 'customer_billingAddress_houseNo'),\n 'zip' => $this->_findInArray($aData, 'customer_billingAddress_postalCode'),\n )\n );\n $aData['verification_order_grossAmount'] = $this->_findInArray($aData, 'order_grossAmount');\n\n /** @var OxpsPaymorrowLogger $oLogger */\n $oLogger = oxRegistry::get('OxpsPaymorrowLogger');\n $oLogger->logWithType($aData, 'collectConfirmData');\n\n return $aData;\n }" ]
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// ControllerRevisionName returns the Name for a ControllerRevision in the form prefix-hash. If the length // of prefix is greater than 223 bytes, it is truncated to allow for a name that is no larger than 253 bytes.
[ "func ControllerRevisionName(prefix string, hash string) string {\n\tif len(prefix) > 223 {\n\t\tprefix = prefix[:223]\n\t}\n\n\treturn fmt.Sprintf(\"%s-%s\", prefix, hash)\n}" ]
[ "public FP64 extend(char c) {\n byte b1 = (byte)(c & 0xff);\n extend(b1);\n byte b2 = (byte) (c >>> 8);\n // NOTE pdalbora 23-Jul-2009 -- The following check is intentional. We don't extend the high order byte when it's\n // zero, in order to avoid \"weakening\" the fingerprint of primarily ASCII data by adding unnecessary bits. The\n // tradeoff for doing this is that two characters in the low order byte range (<= 0x00FF) will be\n // indistinguishable from the corresponding character in the high order byte range (> 0x00FF). For example, the\n // character sequence (0x0022, 0x0021) will have the same fingerprint as the character sequence (0x2122). However,\n // it would be highly unlikely for this to happen, as ASCII data and non-ASCII data are unlikely to mix together.\n // Even in the case where such a sequence pair occurred in two strings, the likelihood of it yielding a collision\n // would be very low, when there other characters in the strings.\n if (b2 != 0) {\n extend(b2);\n }\n return this;\n }" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Filter header set against a whitelist of regular expressions. @param string $type
[ "private function filterHeaderSet(Swift_Mime_SimpleHeaderSet $headerSet, $type)\n {\n foreach ($headerSet->getAll($type) as $headers) {\n $headers->setNameAddresses($this->filterNameAddresses($headers->getNameAddresses()));\n }\n }" ]
[ "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 Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Process an object template @param $tpl The object template @param $selectStmt A SelectStatement instance
[ "protected function processObjectTemplate(PersistentObject $tpl, SelectStatement $selectStmt) {\n // avoid infinite recursion\n $oidStr = $tpl->getOID()->__toString();\n if (isset($this->processedNodes[$oidStr])) {\n return;\n }\n\n $mapper = self::getMapper($tpl->getType());\n $tableName = self::processTableName($tpl);\n $this->involvedTypes[$tpl->getType()] = true;\n\n // add condition\n $condition = '';\n $iter = new NodeValueIterator($tpl, false);\n foreach($iter as $valueName => $value) {\n // check if the value was set when building the query\n if (isset($this->conditions[$oidStr][$valueName])) {\n $criterion = $this->conditions[$oidStr][$valueName];\n if ($criterion instanceof Criteria) {\n $attributeDesc = $mapper->getAttribute($valueName);\n if ($attributeDesc) {\n // add the combine operator, if there are already other conditions\n if (strlen($condition) > 0) {\n $condition .= ' '.$criterion->getCombineOperator().' ';\n }\n // because the attributes are not selected with alias, the column name has to be used\n $index = sizeof(array_keys($this->parameterCriteriaMap));\n $placeholder = ':'.$tableName['alias'].'_'.$attributeDesc->getColumn().$index;\n list($criteriaCondition, $criteriaPlaceholder) = $mapper->renderCriteria($criterion,\n $placeholder, $tableName['alias'], $attributeDesc->getColumn());\n $condition .= $criteriaCondition;\n if ($criteriaPlaceholder) {\n $value = $this->getParameterPosition($criterion, $this->conditions);\n if (is_array($criteriaPlaceholder)) {\n $value = array_fill(0, sizeof($criteriaPlaceholder), $value);\n $this->parameterCriteriaMap = array_merge($this->parameterCriteriaMap,\n array_combine($criteriaPlaceholder, $value));\n }\n else {\n $this->parameterCriteriaMap[$criteriaPlaceholder] = $value;\n }\n }\n }\n }\n }\n }\n if (strlen($condition) > 0) {\n $combineOperator = $tpl->getProperty(self::PROPERTY_COMBINE_OPERATOR);\n $selectStmt->where('('.$condition.')', $combineOperator);\n }\n\n // register the node as processed\n $this->processedNodes[$oidStr] = $tpl;\n\n // add relations to children (this includes also many to many relations)\n // and process children\n foreach ($mapper->getRelations() as $relationDescription) {\n $children = $tpl->getValue($relationDescription->getOtherRole());\n if ($children) {\n $children = !is_array($children) ? [$children] : $children;\n for ($i=0, $count=sizeof($children); $i<$count; $i++) {\n $curChild = $children[$i];\n if ($curChild instanceof Node) {\n // process relations\n\n // don't process the relation twice (e.g. in a many to many relation, both\n // ends are child ends)\n if (!isset($this->processedNodes[$curChild->getOID()->__toString()])) {\n // don't join the tables twice\n $childTableName = self::processTableName($curChild);\n $fromPart = $selectStmt->getRawState(SelectStatement::TABLE);\n if (!isset($fromPart[$childTableName['alias']])) {\n $childMapper = self::getMapper($curChild->getType());\n if ($relationDescription instanceof RDBManyToOneRelationDescription) {\n $idAttr = $childMapper->getAttribute($relationDescription->getIdName());\n $fkAttr = $mapper->getAttribute($relationDescription->getFkName());\n $joinCondition = $tpl->getProperty(self::PROPERTY_TABLE_NAME).'.'.$fkAttr->getColumn().' = '.\n $curChild->getProperty(self::PROPERTY_TABLE_NAME).'.'.$idAttr->getColumn();\n $selectStmt->join([$childTableName['alias'] => $childTableName['name']], $joinCondition, []);\n }\n elseif ($relationDescription instanceof RDBOneToManyRelationDescription) {\n $idAttr = $mapper->getAttribute($relationDescription->getIdName());\n $fkAttr = $childMapper->getAttribute($relationDescription->getFkName());\n $joinCondition = $curChild->getProperty(self::PROPERTY_TABLE_NAME).'.'.$fkAttr->getColumn().' = '.\n $tpl->getProperty(self::PROPERTY_TABLE_NAME).'.'.$idAttr->getColumn();\n $selectStmt->join([$childTableName['alias'] => $childTableName['name']], $joinCondition, []);\n }\n elseif ($relationDescription instanceof RDBManyToManyRelationDescription) {\n $thisRelationDescription = $relationDescription->getThisEndRelation();\n $otherRelationDescription = $relationDescription->getOtherEndRelation();\n\n $nmMapper = self::getMapper($thisRelationDescription->getOtherType());\n $otherFkAttr = $nmMapper->getAttribute($otherRelationDescription->getFkName());\n $otherIdAttr = $childMapper->getAttribute($otherRelationDescription->getIdName());\n $thisFkAttr = $nmMapper->getAttribute($thisRelationDescription->getFkName());\n $thisIdAttr = $mapper->getAttribute($thisRelationDescription->getIdName());\n\n $nmAlias = $nmMapper->getRealTableName().ucfirst($childTableName['alias']);\n\n $joinCondition1 = $nmAlias.'.'.$thisFkAttr->getColumn().' = '.\n $tpl->getProperty(self::PROPERTY_TABLE_NAME).'.'.\n $thisIdAttr->getColumn();\n $joinCondition2 = $curChild->getProperty(self::PROPERTY_TABLE_NAME).'.'.$otherIdAttr->getColumn().' = '.\n $nmAlias.'.'.$otherFkAttr->getColumn();\n\n $selectStmt->join([$nmAlias => $nmMapper->getRealTableName()], $joinCondition1, []);\n $selectStmt->join([$childTableName['alias'] => $childTableName['name']], $joinCondition2, []);\n\n // register the nm type\n $this->involvedTypes[$nmMapper->getType()] = true;\n }\n }\n }\n\n // process child\n if (!in_array($curChild->getOID(), $this->groupedOIDs)) {\n $this->processObjectTemplate($curChild, $selectStmt);\n }\n }\n }\n }\n }\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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
@internal @param array $permissions @param string|NULL $type @param array|object|NULL $context @return bool
[ "protected function dispatchArray(array $permissions, $type = NULL, $context = NULL) {\n if(!$permissions) {\n return TRUE;\n }\n\n reset($permissions);\n $key = key($permissions);\n $value = current($permissions);\n\n if(!is_numeric($key)) {\n $keyUpper = strtoupper($key);\n if('NO_BYPASS' === $keyUpper) {\n throw new InvalidArgumentValueException(\"The NO_BYPASS key must be placed highest in the permission hierarchy. Evaluated permissions: \" . print_r($permissions, TRUE));\n }\n if('AND' === $keyUpper) {\n return $this->processAND($value, $type, $context);\n }\n if('NAND' === $keyUpper) {\n return $this->processNAND($value, $type, $context);\n }\n if('OR' === $keyUpper) {\n return $this->processOR($value, $type, $context);\n }\n if('NOR' === $keyUpper) {\n return $this->processNOR($value, $type, $context);\n }\n if('XOR' === $keyUpper) {\n return $this->processXOR($value, $type, $context);\n }\n if('NOT' === $keyUpper) {\n return $this->processNOT($value, $type, $context);\n }\n if('TRUE' === $keyUpper || 'FALSE' === $keyUpper) {\n throw new InvalidArgumentValueException(\"A boolean permission cannot have children. Evaluated permissions: \" . print_r($permissions, TRUE));\n }\n\n if(!is_null($type)) {\n throw new InvalidArgumentValueException(\"You cannot put a permission type as a descendant to another permission type. Existing type: \\\"$type\\\". Evaluated permissions: \" . print_r($permissions, TRUE));\n }\n if(!$this->getPermissionTypeCollection()->has($key)) {\n throw new PermissionTypeNotRegisteredException(\"The permission type \\\"$key\\\" could not be found.\");\n }\n $type = $key;\n }\n\n if(is_array($value)) {\n return $this->processOR($value, $type, $context);\n }\n\n return $this->dispatch($value, $type, $context);\n }" ]
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Tests if specified category matches any category and doesn't match any exception of this subscription. @param string $category @return boolean
[ "public function matchCategory($category)\n {\n $result = empty($this->categories);\n foreach ($this->categories as $allowedCategory) {\n if ($this->categoryContains($allowedCategory, $category)) {\n $result = true;\n }\n }\n foreach ($this->exceptions as $deniedCategory) {\n if ($this->categoryContains($deniedCategory, $category)) {\n $result = false;\n }\n }\n\n return $result;\n }" ]
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Documentation:" }
Initializes head and tail, ensuring invariants hold.
[ "private void initHeadTail(Node<E> h, Node<E> t) {\n if (h == t) {\n if (h == null)\n h = t = new Node<>(null);\n else {\n // Avoid edge case of a single Node with non-null item.\n Node<E> newNode = new Node<>(null);\n t.lazySetNext(newNode);\n newNode.lazySetPrev(t);\n t = newNode;\n }\n }\n head = h;\n tail = t;\n }" ]
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n // from a current position).\n position = position === null ? position : position + count\n // Read chunk is forwarded to a consumer that will return\n // a promise which is delivered once write is complete.\n // In a future we may switch to an approach similar to new\n // streams in node, where buffering watermarks are specified\n // via options and reads can buffer up up to that point in\n // parallel to write.\n when(next(buffer.slice(0, count), state), onDrain, onError)\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about File management:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)\n\t{\n\t\tswitch (featureID)\n\t\t{\n\t\t\tcase XbasePackage.XBASIC_FOR_LOOP_EXPRESSION__EXPRESSION:\n\t\t\t\treturn basicSetExpression(null, msgs);\n\t\t\tcase XbasePackage.XBASIC_FOR_LOOP_EXPRESSION__EACH_EXPRESSION:\n\t\t\t\treturn basicSetEachExpression(null, msgs);\n\t\t\tcase XbasePackage.XBASIC_FOR_LOOP_EXPRESSION__INIT_EXPRESSIONS:\n\t\t\t\treturn ((InternalEList<?>)getInitExpressions()).basicRemove(otherEnd, msgs);\n\t\t\tcase XbasePackage.XBASIC_FOR_LOOP_EXPRESSION__UPDATE_EXPRESSIONS:\n\t\t\t\treturn ((InternalEList<?>)getUpdateExpressions()).basicRemove(otherEnd, msgs);\n\t\t}\n\t\treturn super.eInverseRemove(otherEnd, featureID, msgs);\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 description about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
Returns {@code Stream} with elements that does not satisfy the given predicate. <p>This is an intermediate operation. @param predicate the predicate used to filter elements @return the new stream
[ "@NotNull\n public Stream<T> filterNot(@NotNull final Predicate<? super T> predicate) {\n return filter(Predicate.Util.negate(predicate));\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 description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Render the comments. @param AnCommandContext $context
[ "protected function _actionGetcomments(AnCommandContext $context)\n {\n $this->getCommentController()->getRequest()->remove('get');\n\n $this->getCommentController()\n ->limit($this->getRequest()->get('limit'))\n ->start($this->getRequest()->get('start'));\n\n $this->getCommentController()->view('comments')->execute('get', $context);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Add a child to the child list. <!ELEMENT xsl:apply-templates (xsl:sort|xsl:with-param)*> <!ATTLIST xsl:apply-templates select %expr; "node()" mode %qname; #IMPLIED > @param newChild Child to add to child list @return Child just added to child list
[ "public ElemTemplateElement appendChild(ElemTemplateElement newChild)\n {\n\n int type = ((ElemTemplateElement) newChild).getXSLToken();\n\n if (Constants.ELEMNAME_SORT == type)\n {\n setSortElem((ElemSort) newChild);\n\n return newChild;\n }\n else\n return super.appendChild(newChild);\n }" ]
[ "function parse_drawing(data, rels) {\n\tif(!data) return \"??\";\n\t/*\n\t Chartsheet Drawing:\n\t - 20.5.2.35 wsDr CT_Drawing\n\t - 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor\n\t - 20.5.2.16 graphicFrame CT_GraphicalObjectFrame\n\t - 20.1.2.2.16 graphic CT_GraphicalObject\n\t - 20.1.2.2.17 graphicData CT_GraphicalObjectData\n - chart reference\n\t the actual type is based on the URI of the graphicData\n\t\tTODO: handle embedded charts and other types of graphics\n\t*/\n\tvar id = (data.match(/<c:chart [^>]*r:id=\"([^\"]*)\"/)||[\"\",\"\"])[1];\n\n\treturn rels['!id'][id].Target;\n}" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetDisplayName sets the DisplayName field's value.
[ "func (s *Grantee) SetDisplayName(v string) *Grantee {\n\ts.DisplayName = &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:" }
Shows menu's links as a sortable tree. @param int $id Menu's ID for which render its links tree @return void
[ "public function menu($id)\n {\n $this->loadModel('Menu.Menus');\n $menu = $this->Menus->get($id);\n $links = $this->Menus->MenuLinks->find()\n ->where(['menu_id' => $menu->id])\n ->order(['lft' => 'ASC'])\n ->all()\n ->map(function ($link) {\n $link->set('expanded', true);\n\n return $link;\n })\n ->nest('id', 'parent_id');\n\n if (!empty($this->request->data['tree_order'])) {\n $items = json_decode($this->request->data['tree_order']);\n\n if (!empty($items)) {\n unset($items[0]);\n $entities = [];\n\n foreach ($items as $key => $item) {\n $link = $this->Menus->MenuLinks->get($item->item_id);\n $link = $this->Menus->MenuLinks->patchEntity($link, [\n 'parent_id' => intval($item->parent_id),\n 'lft' => intval(($item->left - 1)),\n 'rght' => intval(($item->right - 1)),\n ], ['validate' => false]);\n $entities[] = $link;\n }\n\n $this->Menus->MenuLinks->connection()->transactional(function () use ($entities) {\n foreach ($entities as $entity) {\n $result = $this->Menus->MenuLinks->save($entity);\n if (!$result) {\n return false;\n }\n }\n\n return true;\n });\n\n // don't trust \"left\" and \"right\" values coming from user's POST\n $this->Menus->MenuLinks->addBehavior('Tree', ['scope' => ['menu_id' => $menu->id]]);\n $this->Menus->MenuLinks->recover();\n $this->Flash->success(__d('menu', 'Menu has been reordered'));\n } else {\n $this->Flash->danger(__d('menu', 'Invalid information, check you have JavaScript enabled'));\n }\n\n $this->redirect($this->referer());\n }\n\n $disabledIds = $links\n ->match(['status' => false])\n ->extract('id')\n ->toArray();\n\n $this->title(__d('menu', 'Menu’s Links'));\n $this->set(compact('menu', 'links', 'disabledIds'));\n $this->Breadcrumb\n ->push('/admin/menu/manage')\n ->push(__d('menu', 'Editing menu'), ['plugin' => 'Menu', 'controller' => 'manage', 'action' => 'edit', $menu->id])\n ->push(__d('menu', 'Links'), '#');\n }" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class converts multiple language tags into one\n // Otherwise, it assumes that a single name_ tag exists with JSON content, and it will replace\n // it with multiple tags \"name_en\", \"name_fr\", ... depending on the JSON language codes\n this.namePicker = options.namePicker;\n\n // Flag to make requested_name (local_name) form\n this.combineName = options.combineName;\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Calculates data tranfer rate values @return int The rate in bytes/second
[ "protected function calulateDataTransferRateValues()\r\n {\r\n $vals = array();\r\n \r\n // Works like this:\r\n // After the server resonded, the socket-buffer is already filled with bytes,\r\n // that means they were received within the server-response-time.\r\n \r\n // To calulate the real data transfer rate, these bytes have to be substractred from the received\r\n // bytes beofre calulating the rate.\r\n if ($this->data_transfer_time > 0 && $this->content_bytes_received > 4 * $this->socket_prefill_size)\r\n {\r\n $vals[\"unbuffered_bytes_read\"] = $this->content_bytes_received + $this->header_bytes_received - $this->socket_prefill_size;\r\n $vals[\"data_transfer_rate\"] = $vals[\"unbuffered_bytes_read\"] / $this->data_transfer_time;\r\n $vals[\"data_transfer_time\"] = $this->data_transfer_time;\r\n }\r\n else\r\n {\r\n $vals = null;\r\n }\r\n \r\n return $vals;\r\n }" ]
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys expected by the\n # objective function\n return objective.run(raw_output, output_files, threads)\n end" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// UpLeftArrow displays an arrow pointing upwards and to the left on the Microbit LEDs
[ "func (b *LEDDriver) UpLeftArrow() (err error) {\n\tbuf := []byte{0x1E, 0x18, 0x14, 0x12, 0x01}\n\terr = b.WriteMatrix(buf)\n\treturn\n}" ]
[ "function jBox(type, options) {\n\n\n // Options (https://stephanwagner.me/jBox/options)\n\n this.options = {\n\n // jBox ID\n id: null, // Choose a unique id, otherwise jBox will set one for you (jBox1, jBox2, ...)\n\n // Dimensions\n width: 'auto', // The width of the content area, e.g. 'auto', 200, '80%'\n height: 'auto', // The height of the content area\n minWidth: null, // Minimal width\n minHeight: null, // Minimal height\n maxWidth: null, // Maximal width\n maxHeight: null, // Maximal height\n\n // Responsive dimensions\n responsiveWidth: true, // Adjusts the width to fit the viewport\n responsiveHeight: true, // Adjusts the height to fit the viewport\n responsiveMinWidth: 100, // Don't adjust width below this value (in pixel)\n responsiveMinHeight: 100, // Don't adjust height below this value (in pixel)\n\n // Attach\n attach: null, // A jQuery selector to elements that will open and close your jBox, e.g. '.tooltip'\n trigger: 'click', // The event to open or close your jBox, use 'click', 'touchclick' or 'mouseenter'\n preventDefault: false, // Prevent the default event when opening jBox, e.g. don't follow the href in a link\n\n // Content\n content: null, // You can use HTML or a jQuery element, e.g. jQuery('#jBox-content'). The elements will be appended to the content element and then made visible, so hide them with style=\"display: none\" beforehand\n getContent: null, // Get the content from an attribute when jBox opens, e.g. getContent: 'data-content'. Use 'html' to get the attached elements HTML as content\n title: null, // Adds a title to your jBox\n getTitle: null, // Get the title from an attribute when jBox opens, e.g. getTitle: 'data-title'\n footer: null, // Adds a footer to your jBox\n isolateScroll: true, // Isolates scrolling to the content container\n\n // AJAX\n ajax: { // Setting an URL will make an AJAX request when jBox opens. Optional you can add any jQuery AJAX option (http://api.jquery.com/jquery.ajax/)\n url: null, // The URL to send the AJAX request to\n data: '', // Data to send with your AJAX request, e.g. {id: 82, limit: 10}\n reload: false, // Resend the AJAX request when jBox opens. Use true to send the AJAX request only once for every attached element or 'strict' to resend every time jBox opens\n getURL: 'data-url', // The attribute in the source element where the AJAX request will look for the URL, e.g. data-url=\"https://reqres.in/api/users\"\n getData: 'data-ajax', // The attribute in the source element where the AJAX request will look for the data, e.g. data-ajax=\"id=82&limit=10\"\n setContent: true, // Automatically set the response as new content when the AJAX request is finished\n loadingClass: true, // Add a class to the wrapper when jBox is loading, set to class name or true to use the default class name 'jBox-loading'\n spinner: true, // Hides the current content and adds a spinner while loading. You can pass HTML content to add your own spinner, e.g. spinner: '<div class=\"mySpinner\"></div>'\n spinnerDelay: 300, // Milliseconds to wait until spinner appears\n spinnerReposition: true // Repositions jBox when the spinner is added or removed\n },\n cancelAjaxOnClose: true, // Cancels the ajax call when jBox closes and it hasn't finished loading yet\n\n // Position\n target: null, // The jQuery selector to the target element where jBox will be opened. If no element is found, jBox will use the attached element as target\n position: {\n x: 'center', // Horizontal position, use a number, 'left', 'right' or 'center'\n y: 'center' // Vertical position, use a number, 'top', 'bottom' or 'center'\n },\n outside: null, // Use 'x', 'y', or 'xy' to move your jBox outside of the target element\n offset: 0, // Offset to final position, you can set different values for x and y with an object, e.g. {x: 20, y: 10}\n attributes: { // Note that attributes can only be 'left' or 'right' when using numbers for position, e.g. {x: 300, y: 20}\n x: 'left', // Horizontal position, use 'left' or 'right'\n y: 'top' // Vertical position, use 'top' or 'bottom'\n },\n fixed: false, // Your jBox will stay on position when scrolling\n adjustPosition: true, // Adjusts your jBoxes position if there is not enough space, use 'flip', 'move' or true for both. This option overrides the reposition options\n adjustTracker: false, // By default jBox adjusts its position when it opens or when the window size changes, set to true to also adjust when scrolling\n adjustDistance: 5, // The minimal distance to the viewport edge while adjusting. Use an object to set different values, e.g. {top: 50, right: 5, bottom: 20, left: 5}\n reposition: true, // Calculates new position when the window-size changes\n repositionOnOpen: true, // Calculates new position each time jBox opens (rather than only when it opens the first time)\n repositionOnContent: true, // Calculates new position when the content changes with .setContent() or .setTitle()\n holdPosition: true, // Keeps current position if space permits. Applies only to 'Modal' type.\n\n // Pointer\n pointer: false, // Your pointer will always point towards the target element, so the option outside needs to be 'x' or 'y'. By default the pointer is centered, set a position to move it to any side. You can also add an offset, e.g. 'left:30' or 'center:-20'\n pointTo: 'target', // Setting something else than 'target' will add a pointer even if there is no target element set or found. Use 'top', 'right', 'bottom' or 'left'\n\n // Animations\n fade: 180, // Fade duration in ms, set to 0 or false to disable\n animation: null, // Animation when opening or closing, use 'pulse', 'zoomIn', 'zoomOut', 'move', 'slide', 'flip', 'tada' (CSS inspired from Daniel Edens Animate.css: http://daneden.me/animate)\n\n // Appearance\n theme: 'Default', // Set a jBox theme class\n addClass: null, // Adds classes to the wrapper\n overlay: false, // Adds an overlay to hide page content when jBox opens (adjust color and opacity with CSS)\n zIndex: 10000, // Use a high z-index, or set to 'auto' to bring to front on open\n\n // Delays\n delayOpen: 0, // Delay opening in ms. Note that the delay will be ignored if your jBox didn't finish closing\n delayClose: 0, // Delay closing in ms. Nnote that there is always a closing delay of at least 10ms to ensure jBox won't be closed when opening right away\n\n // Closing\n closeOnEsc: false, // Close jBox when pressing [esc] key\n closeOnClick: false, // Close jBox with mouseclick. Use true (click anywhere), 'box' (click on jBox itself), 'overlay' (click on the overlay), 'body' (click anywhere but jBox)\n closeOnMouseleave: false, // Close jBox when the mouse leaves the jBox area or the area of the attached element\n closeButton: false, // Adds a close button to your jBox. Use 'title', 'box', 'overlay' or true (true will add the button to the overlay, title or the jBox itself, in that order if any of those elements can be found)\n\n // Other options\n appendTo: jQuery('body'), // The element your jBox will be appended to. Any other element than jQuery('body') is only useful for fixed positions or when position values are numbers\n createOnInit: false, // Creates jBox and makes it available in DOM when it's being initialized, otherwise it will be created when it opens for the first time\n blockScroll: false, // Blocks scrolling when jBox is open\n blockScrollAdjust: true, // Adjust page elements to avoid content jumps when scrolling is blocked. See more here: https://github.com/StephanWagner/unscroll\n draggable: false, // Make your jBox draggable (use 'true', 'title' or provide an element as handle) (inspired from Chris Coyiers CSS-Tricks http://css-tricks.com/snippets/jquery/draggable-without-jquery-ui/)\n dragOver: true, // When you have multiple draggable jBoxes, the one you select will always move over the other ones\n autoClose: false, // Time in ms when jBox will close automatically after it was opened\n delayOnHover: false, // Delay auto-closing while mouse is hovered\n showCountdown: false, // Display a nice progress-indicator when autoClose is enabled\n\n // Audio // You can use the integrated audio function whenever you'd like to play an audio file, e.g. onInit: function () { this.audio('url_to_audio_file_without_file_extension', 75); }\n preloadAudio: true, // Preloads the audio files set in option audio. You can also preload other audio files, e.g. ['src_to_file.mp3', 'src_to_file.ogg']\n audio: null, // The URL to an audio file to play when jBox opens. Set the URL without file extension, jBox will look for an .mp3 and .ogg file. To play audio when jBox closes, use an object, e.g. {open: 'src_to_audio1', close: 'src_to_audio2'}\n volume: 100, // The volume in percent. To have different volumes for opening and closeing, use an object, e.g. {open: 75, close: 100}\n\n // Events // Note that you can use 'this' in all event functions, it refers to your jBox object (e.g. onInit: function () { this.open(); })\n onInit: null, // Fired when jBox is initialized\n onAttach: null, // Fired when jBox attached itself to elements, the attached element will be passed as a parameter, e.g. onAttach: function (element) { element.css({color: 'red'}); }\n onPosition: null, // Fired when jBox is positioned\n onCreated: null, // Fired when jBox is created and availible in DOM\n onOpen: null, // Fired when jBox opens\n onClose: null, // Fired when jBox closes\n onCloseComplete: null, // Fired when jBox is completely closed (when fading is finished)\n onDragStart: null, // Fired when dragging starts\n onDragEnd: null // Fired when dragging finished\n };\n\n\n // Default plugin options\n\n this._pluginOptions = {\n\n // Default options for tooltips\n 'Tooltip': {\n getContent: 'title',\n trigger: 'mouseenter',\n position: {\n x: 'center',\n y: 'top'\n },\n outside: 'y',\n pointer: true\n },\n\n // Default options for mouse tooltips\n 'Mouse': {\n responsiveWidth: false,\n responsiveHeight: false,\n adjustPosition: 'flip',\n target: 'mouse',\n trigger: 'mouseenter',\n position: {\n x: 'right',\n y: 'bottom'\n },\n outside: 'xy',\n offset: 5\n },\n\n // Default options for modal windows\n 'Modal': {\n target: jQuery(window),\n fixed: true,\n blockScroll: true,\n closeOnEsc: true,\n closeOnClick: 'overlay',\n closeButton: true,\n overlay: true,\n animation: 'zoomIn'\n },\n };\n\n\n // Merge options\n\n this.options = jQuery.extend(true, this.options, this._pluginOptions[type] ? this._pluginOptions[type] : jBox._pluginOptions[type], options);\n\n\n // Set the jBox type\n\n jQuery.type(type) == 'string' && (this.type = type);\n\n\n // Checks if the user is on a touch device, borrowed from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js\n\n this.isTouchDevice = (function () {\n var prefixes = ' -webkit- -moz- -o- -ms- '.split(' ');\n var mq = function (query) {\n return window.matchMedia(query).matches;\n }\n\n if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {\n return true;\n }\n\n var query = ['(', prefixes.join('touch-enabled),('), 'heartz', ')'].join('');\n return mq(query);\n })();\n\n\n // Add close event for body click when we are on touch device and jBox triggers on mouseenter\n\n if (this.isTouchDevice && this.options.trigger === 'mouseenter' && this.options.closeOnClick === false) {\n this.options.closeOnClick = 'body';\n }\n\n\n // Local function to fire events\n\n this._fireEvent = function (event, pass)\n {\n this.options['_' + event] && (this.options['_' + event].bind(this))(pass);\n this.options[event] && (this.options[event].bind(this))(pass);\n };\n\n\n // Get a unique jBox ID\n\n this.options.id === null && (this.options.id = 'jBox' + jBox._getUniqueID());\n this.id = this.options.id;\n\n\n // Correct impossible options\n\n ((this.options.position.x == 'center' && this.options.outside == 'x') || (this.options.position.y == 'center' && this.options.outside == 'y')) && (this.options.outside = null);\n this.options.pointTo == 'target' && (!this.options.outside || this.options.outside == 'xy') && (this.options.pointer = false);\n\n\n // Correct multiple choice options\n\n jQuery.type(this.options.offset) != 'object' ? (this.options.offset = {x: this.options.offset, y: this.options.offset}) : (this.options.offset = jQuery.extend({x: 0, y: 0}, this.options.offset));\n jQuery.type(this.options.adjustDistance) != 'object' ? (this.options.adjustDistance = {top: this.options.adjustDistance, right: this.options.adjustDistance, bottom: this.options.adjustDistance, left: this.options.adjustDistance}) : (this.options.adjustDistance = jQuery.extend({top: 5, left: 5, right: 5, bottom: 5}, this.options.adjustDistance));\n\n\n // Save default outside position\n\n this.outside = this.options.outside && this.options.outside != 'xy' ? this.options.position[this.options.outside] : false;\n\n\n // Save where the jBox is aligned to\n\n this.align = this.outside ? this.outside : (this.options.position.y != 'center' && jQuery.type(this.options.position.y) != 'number' ? this.options.position.x : (this.options.position.x != 'center' && jQuery.type(this.options.position.x) != 'number' ? this.options.position.y : this.options.attributes.x));\n\n\n // Adjust option zIndex\n\n jBox.zIndexMax = Math.max(jBox.zIndexMax || 0, this.options.zIndex === 'auto' ? 10000 : this.options.zIndex);\n if (this.options.zIndex === 'auto') {\n this.adjustZIndexOnOpen = true;\n jBox.zIndexMax += 2;\n this.options.zIndex = jBox.zIndexMax;\n this.trueModal = this.options.overlay;\n }\n\n // Internal positioning functions\n\n this._getOpp = function (opp) { return {left: 'right', right: 'left', top: 'bottom', bottom: 'top', x: 'y', y: 'x'}[opp]; };\n this._getXY = function (xy) { return {left: 'x', right: 'x', top: 'y', bottom: 'y', center: 'x'}[xy]; };\n this._getTL = function (tl) { return {left: 'left', right: 'left', top: 'top', bottom: 'top', center: 'left', x: 'left', y: 'top'}[tl]; };\n\n\n // Get a dimension value in integer pixel dependent on appended element\n\n this._getInt = function (value, dimension) {\n if (value == 'auto') return 'auto';\n if (value && jQuery.type(value) == 'string' && value.slice(-1) == '%') {\n return jQuery(window)[dimension == 'height' ? 'innerHeight' : 'innerWidth']() * parseInt(value.replace('%', '')) / 100;\n }\n return value;\n };\n\n\n // Create an svg element\n\n this._createSVG = function (type, options)\n {\n var svg = document.createElementNS('http://www.w3.org/2000/svg', type);\n jQuery.each(options, function (index, item) {\n svg.setAttribute(item[0], (item[1] || ''));\n });\n return svg;\n };\n\n\n // Isolate scrolling in a container\n\n this._isolateScroll = function (el)\n {\n // Abort if element not found\n if (!el || !el.length) return;\n\n el.on('DOMMouseScroll.jBoxIsolateScroll mousewheel.jBoxIsolateScroll', function (ev) {\n var delta = ev.wheelDelta || (ev.originalEvent && ev.originalEvent.wheelDelta) || -ev.detail;\n var overflowBottom = this.scrollTop + el.outerHeight() - this.scrollHeight >= 0;\n var overflowTop = this.scrollTop <= 0;\n ((delta < 0 && overflowBottom) || (delta > 0 && overflowTop)) && ev.preventDefault();\n });\n };\n\n\n // Set the title width to content width\n\n this._setTitleWidth = function ()\n {\n // Abort if there is no title or width of content is auto\n if (!this.titleContainer || (this.content[0].style.width == 'auto' && !this.content[0].style.maxWidth)) return null;\n\n // Expose wrapper to get actual width\n if (this.wrapper.css('display') == 'none') {\n this.wrapper.css('display', 'block');\n var contentWidth = this.content.outerWidth();\n this.wrapper.css('display', 'none');\n } else {\n var contentWidth = this.content.outerWidth();\n }\n\n // Set max-width only\n this.titleContainer.css({maxWidth: (Math.max(contentWidth, parseInt(this.content[0].style.maxWidth)) || null)});\n }\n\n\n // Make jBox draggable\n\n this._draggable = function ()\n {\n // Abort if jBox is not draggable\n if (!this.options.draggable) return false;\n\n // Get the handle where jBox will be dragged with\n var handle = this.options.draggable == 'title' ? this.titleContainer : (this.options.draggable instanceof jQuery ? this.options.draggable : (jQuery.type(this.options.draggable) == 'string' ? jQuery(this.options.draggable) : this.wrapper));\n\n // Abort if no handle or if draggable was set already\n if (!handle || !(handle instanceof jQuery) || !handle.length || handle.data('jBox-draggable')) return false;\n\n // Add mouse events\n handle.addClass('jBox-draggable').data('jBox-draggable', true).on('touchstart mousedown', function (ev)\n {\n if (ev.button == 2 || jQuery(ev.target).hasClass('jBox-noDrag') || jQuery(ev.target).parents('.jBox-noDrag').length) return;\n\n // Store current mouse position\n this.draggingStartX = ev.pageX;\n this.draggingStartY = ev.pageY;\n\n // Adjust z-index when dragging jBox over another draggable jBox\n if (this.options.dragOver && !this.trueModal && parseInt(this.wrapper.css('zIndex'), 10) <= jBox.zIndexMaxDragover) {\n jBox.zIndexMaxDragover += 1;\n this.wrapper.css('zIndex', jBox.zIndexMaxDragover);\n }\n\n var drg_h = this.wrapper.outerHeight();\n var drg_w = this.wrapper.outerWidth();\n var pos_y = this.wrapper.offset().top + drg_h - ev.pageY;\n var pos_x = this.wrapper.offset().left + drg_w - ev.pageX;\n\n jQuery(document).on('touchmove.jBox-draggable-' + this.id + ' mousemove.jBox-draggable-' + this.id, function (ev) {\n // Fire onDragStart event when jBox moves\n if (!this.dragging && this.draggingStartX != ev.pageX && this.draggingStartY != ev.pageY) {\n this._fireEvent('onDragStart');\n this.dragging = true;\n }\n\n // Adjust position\n this.wrapper.offset({\n top: ev.pageY + pos_y - drg_h,\n left: ev.pageX + pos_x - drg_w\n });\n }.bind(this));\n ev.preventDefault();\n\n }.bind(this)).on('touchend mouseup', function () {\n // Remove drag event\n jQuery(document).off('touchmove.jBox-draggable-' + this.id + ' mousemove.jBox-draggable-' + this.id);\n\n // Fire onDragEnd event\n this.dragging && this._fireEvent('onDragEnd');\n\n // Reset dragging reference\n this.dragging = false;\n\n if ((this.type == 'Modal' || this.type == 'Confirm') && this.options.holdPosition) {\n // Drag end captures new position\n var jBoxOffset = jQuery('#' + this.id).offset(),\n pos = {\n x: jBoxOffset.left - jQuery(document).scrollLeft(),\n y: jBoxOffset.top - jQuery(document).scrollTop()\n };\n this.position({position: pos, offset: {x: 0, y: 0}});\n }\n }.bind(this));\n\n // Get highest z-index\n if (!this.trueModal) {\n jBox.zIndexMaxDragover = !jBox.zIndexMaxDragover ? this.options.zIndex : Math.max(jBox.zIndexMaxDragover, this.options.zIndex);\n }\n\n return this;\n };\n\n // Create jBox\n\n this._create = function ()\n {\n // Abort if jBox was created already\n if (this.wrapper) return;\n\n // Create wrapper\n this.wrapper = jQuery('<div/>', {\n id: this.id,\n 'class': 'jBox-wrapper' + (this.type ? ' jBox-' + this.type : '') + (this.options.theme ? ' jBox-' + this.options.theme : '') + (this.options.addClass ? ' ' + this.options.addClass : '')\n }).css({\n position: (this.options.fixed ? 'fixed' : 'absolute'),\n display: 'none',\n opacity: 0,\n zIndex: this.options.zIndex\n\n // Save the jBox instance in the wrapper, so you can get access to your jBox when you only have the element\n }).data('jBox', this);\n\n // Add mouseleave event, only close jBox when the new target is not the source element\n this.options.closeOnMouseleave && this.wrapper.on('mouseleave', function (ev) {\n !this.source || !(ev.relatedTarget == this.source[0] || jQuery.inArray(this.source[0], jQuery(ev.relatedTarget).parents('*')) !== -1) && this.close();\n }.bind(this));\n\n // Add closeOnClick: 'box' events\n (this.options.closeOnClick == 'box') && this.wrapper.on('click', function () { this.close({ignoreDelay: true}); }.bind(this));\n\n // Create container\n this.container = jQuery('<div class=\"jBox-container\"/>').appendTo(this.wrapper);\n\n // Create content\n this.content = jQuery('<div class=\"jBox-content\"/>').appendTo(this.container);\n\n // Create footer\n this.options.footer && (this.footer = jQuery('<div class=\"jBox-footer\"/>').append(this.options.footer).appendTo(this.container));\n\n // Isolate scrolling\n this.options.isolateScroll && this._isolateScroll(this.content);\n\n // Create close button\n if (this.options.closeButton) {\n var closeButtonSVG = this._createSVG('svg', [['viewBox', '0 0 24 24']]);\n closeButtonSVG.appendChild(this._createSVG('path', [['d', 'M22.2,4c0,0,0.5,0.6,0,1.1l-6.8,6.8l6.9,6.9c0.5,0.5,0,1.1,0,1.1L20,22.3c0,0-0.6,0.5-1.1,0L12,15.4l-6.9,6.9c-0.5,0.5-1.1,0-1.1,0L1.7,20c0,0-0.5-0.6,0-1.1L8.6,12L1.7,5.1C1.2,4.6,1.7,4,1.7,4L4,1.7c0,0,0.6-0.5,1.1,0L12,8.5l6.8-6.8c0.5-0.5,1.1,0,1.1,0L22.2,4z']]));\n this.closeButton = jQuery('<div class=\"jBox-closeButton jBox-noDrag\"/>').on('click', function (ev) { this.close({ignoreDelay: true}); }.bind(this)).append(closeButtonSVG);\n\n // Add close button to jBox container\n if (this.options.closeButton == 'box' || (this.options.closeButton === true && !this.options.overlay && !this.options.title && !this.options.getTitle)) {\n this.wrapper.addClass('jBox-closeButton-box');\n this.closeButton.appendTo(this.container);\n }\n }\n\n // Append jBox to DOM\n this.wrapper.appendTo(this.options.appendTo);\n\n // Fix adjustDistance if there is a close button in the box\n this.wrapper.find('.jBox-closeButton').length && jQuery.each(['top', 'right', 'bottom', 'left'], function (index, pos) {\n this.wrapper.find('.jBox-closeButton').css(pos) && this.wrapper.find('.jBox-closeButton').css(pos) != 'auto' && (this.options.adjustDistance[pos] = Math.max(this.options.adjustDistance[pos], this.options.adjustDistance[pos] + (((parseInt(this.wrapper.find('.jBox-closeButton').css(pos)) || 0) + (parseInt(this.container.css('border-' + pos + '-width')) || 0)) * -1)));\n }.bind(this));\n\n // Create pointer\n if (this.options.pointer) {\n\n // Get pointer vars and save globally\n this.pointer = {\n position: (this.options.pointTo != 'target') ? this.options.pointTo : this._getOpp(this.outside),\n xy: (this.options.pointTo != 'target') ? this._getXY(this.options.pointTo) : this._getXY(this.outside),\n align: 'center',\n offset: 0\n };\n\n this.pointer.element = jQuery('<div class=\"jBox-pointer jBox-pointer-' + this.pointer.position + '\"/>').appendTo(this.wrapper);\n this.pointer.dimensions = {\n x: this.pointer.element.outerWidth(),\n y: this.pointer.element.outerHeight()\n };\n\n if (jQuery.type(this.options.pointer) == 'string') {\n var split = this.options.pointer.split(':');\n split[0] && (this.pointer.align = split[0]);\n split[1] && (this.pointer.offset = parseInt(split[1]));\n }\n this.pointer.alignAttribute = (this.pointer.xy == 'x' ? (this.pointer.align == 'bottom' ? 'bottom' : 'top') : (this.pointer.align == 'right' ? 'right' : 'left'));\n\n // Set wrapper CSS\n this.wrapper.css('padding-' + this.pointer.position, this.pointer.dimensions[this.pointer.xy]);\n\n // Set pointer CSS\n this.pointer.element.css(this.pointer.alignAttribute, (this.pointer.align == 'center' ? '50%' : 0)).css('margin-' + this.pointer.alignAttribute, this.pointer.offset);\n this.pointer.margin = {};\n this.pointer.margin['margin-' + this.pointer.alignAttribute] = this.pointer.offset;\n\n // Add a transform to fix centered position\n (this.pointer.align == 'center') && this.pointer.element.css('transform', 'translate(' + (this.pointer.xy == 'y' ? (this.pointer.dimensions.x * -0.5 + 'px') : 0) + ', ' + (this.pointer.xy == 'x' ? (this.pointer.dimensions.y * -0.5 + 'px') : 0) + ')');\n\n this.pointer.element.css((this.pointer.xy == 'x' ? 'width' : 'height'), parseInt(this.pointer.dimensions[this.pointer.xy]) + parseInt(this.container.css('border-' + this.pointer.alignAttribute + '-width')));\n\n // Add class to wrapper for CSS access\n this.wrapper.addClass('jBox-pointerPosition-' + this.pointer.position);\n }\n\n // Set title and content\n this.setContent(this.options.content, true);\n this.setTitle(this.options.title, true);\n\n this.options.draggable && this._draggable();\n\n // Fire onCreated event\n this._fireEvent('onCreated');\n };\n\n\n // Create jBox onInit\n\n this.options.createOnInit && this._create();\n\n\n // Attach jBox\n\n this.options.attach && this.attach();\n\n\n // Attach document and window events\n\n this._attachEvents = function ()\n {\n // Cancel countdown on mouseenter if delayOnHover\n this.options.delayOnHover && jQuery('#' + this.id).on('mouseenter', function (ev) { this.isHovered = true; }.bind(this));\n\n // Resume countdown on mouseleave if delayOnHover\n this.options.delayOnHover && jQuery('#' + this.id).on('mouseleave', function (ev) { this.isHovered = false; }.bind(this));\n\n // Positioning events\n if ((this.options.adjustPosition || this.options.reposition) && !this.fixed && this.outside) {\n\n // Trigger position events when scrolling\n this.options.adjustTracker && jQuery(window).on('scroll.jBox-' + this.id, function (ev) { this.position(); }.bind(this));\n\n // Trigger position events when resizing\n (this.options.adjustPosition || this.options.reposition) && jQuery(window).on('resize.jBox-' + this.id, function (ev) { this.position(); }.bind(this));\n }\n\n // Mousemove events\n this.options.target == 'mouse' && jQuery('body').on('mousemove.jBox-' + this.id, function (ev) { this.position({mouseTarget: {top: ev.pageY, left: ev.pageX}}); }.bind(this));\n };\n\n\n // Detach document and window events\n\n this._detachEvents = function ()\n {\n // Closing event: closeOnEsc\n this.options.closeOnEsc && jQuery(document).off('keyup.jBox-' + this.id);\n\n // Closing event: closeOnClick\n (this.options.closeOnClick === true || this.options.closeOnClick == 'body') && jQuery(document).off('click.jBox-' + this.id);\n\n // Positioning events\n this.options.adjustTracker && jQuery(window).off('scroll.jBox-' + this.id);\n (this.options.adjustPosition || this.options.reposition) && jQuery(window).off('resize.jBox-' + this.id);\n\n // Mousemove events\n this.options.target == 'mouse' && jQuery('body').off('mousemove.jBox-' + this.id);\n };\n\n\n // Show overlay\n\n this._showOverlay = function ()\n {\n // Create the overlay if wasn't created already\n if (!this.overlay) {\n\n // Create element and append to the element where jBox is appended to\n this.overlay = jQuery('<div id=\"' + this.id + '-overlay\"/>').addClass('jBox-overlay' + (this.type ? ' jBox-overlay-' + this.type : '')).css({\n display: 'none',\n opacity: 0,\n zIndex: this.options.zIndex - 1\n }).appendTo(this.options.appendTo);\n\n // Add close button to overlay\n (this.options.closeButton == 'overlay' || this.options.closeButton === true) && this.overlay.append(this.closeButton);\n\n // Add closeOnClick: 'overlay' events\n this.options.closeOnClick == 'overlay' && this.overlay.on('click', function () { this.close({ignoreDelay: true}); }.bind(this));\n\n // Adjust option adjustDistance if there is a close button in the overlay\n jQuery('#' + this.id + '-overlay .jBox-closeButton').length && (this.options.adjustDistance.top = Math.max(jQuery('#' + this.id + '-overlay .jBox-closeButton').outerHeight(), this.options.adjustDistance.top));\n }\n\n // Adjust zIndex\n if (this.adjustZIndexOnOpen === true) {\n this.overlay.css('zIndex', parseInt(this.wrapper.css('zIndex'), 10) - 1);\n }\n\n // Abort if overlay is already visible\n if (this.overlay.css('display') == 'block') return;\n\n // Show overlay\n this.options.fade ? (this.overlay.stop() && this.overlay.animate({opacity: 1}, {\n queue: false,\n duration: this.options.fade,\n start: function () { this.overlay.css({display: 'block'}); }.bind(this)\n })) : this.overlay.css({display: 'block', opacity: 1});\n };\n\n\n // Hide overlay\n\n this._hideOverlay = function ()\n {\n // Abort if the overlay wasn't created yet\n if (!this.overlay) return;\n\n // Hide overlay if no other jBox needs it\n this.options.fade ? (this.overlay.stop() && this.overlay.animate({opacity: 0}, {\n queue: false,\n duration: this.options.fade,\n complete: function () { this.overlay.css({display: 'none'}); }.bind(this)\n })) : this.overlay.css({display: 'none', opacity: 0});\n };\n\n\n // Get the correct jBox dimensions by moving jBox out of viewport\n\n this._exposeDimensions = function ()\n {\n // Move wrapper out of viewport\n this.wrapper.css({\n top: -10000,\n left: -10000,\n right: 'auto',\n bottom: 'auto'\n });\n\n // Get jBox dimensions\n var jBoxDimensions = {\n x: this.wrapper.outerWidth(),\n y: this.wrapper.outerHeight()\n };\n\n // Reset position to viewport\n this.wrapper.css({\n top: 'auto',\n left: 'auto'\n });\n\n return jBoxDimensions;\n };\n\n\n // Generate CSS for animations and append to header\n\n this._generateAnimationCSS = function ()\n {\n // Get open and close animations if none provided\n (jQuery.type(this.options.animation) != 'object') && (this.options.animation = {\n pulse: {open: 'pulse', close: 'zoomOut'},\n zoomIn: {open: 'zoomIn', close: 'zoomIn'},\n zoomOut: {open: 'zoomOut', close: 'zoomOut'},\n move: {open: 'move', close: 'move'},\n slide: {open: 'slide', close: 'slide'},\n flip: {open: 'flip', close: 'flip'},\n tada: {open: 'tada', close: 'zoomOut'}\n }[this.options.animation]);\n\n // Abort if animation not found\n if (!this.options.animation) return null;\n\n // Get direction var\n this.options.animation.open && (this.options.animation.open = this.options.animation.open.split(':'));\n this.options.animation.close && (this.options.animation.close = this.options.animation.close.split(':'));\n this.options.animation.openDirection = this.options.animation.open[1] ? this.options.animation.open[1] : null;\n this.options.animation.closeDirection = this.options.animation.close[1] ? this.options.animation.close[1] : null;\n this.options.animation.open && (this.options.animation.open = this.options.animation.open[0]);\n this.options.animation.close && (this.options.animation.close = this.options.animation.close[0]);\n\n // Add 'Open' and 'Close' to animation names\n this.options.animation.open && (this.options.animation.open += 'Open');\n this.options.animation.close && (this.options.animation.close += 'Close');\n\n // All animations\n var animations = {\n pulse: {\n duration: 350,\n css: [['0%', 'scale(1)'], ['50%', 'scale(1.1)'], ['100%', 'scale(1)']]\n },\n zoomInOpen: {\n duration: (this.options.fade || 180),\n css: [['0%', 'scale(0.9)'], ['100%', 'scale(1)']]\n },\n zoomInClose: {\n duration: (this.options.fade || 180),\n css: [['0%', 'scale(1)'], ['100%', 'scale(0.9)']]\n },\n zoomOutOpen: {\n duration: (this.options.fade || 180),\n css: [['0%', 'scale(1.1)'], ['100%', 'scale(1)']]\n },\n zoomOutClose: {\n duration: (this.options.fade || 180),\n css: [['0%', 'scale(1)'], ['100%', 'scale(1.1)']]\n },\n moveOpen: {\n duration: (this.options.fade || 180),\n positions: {top: {'0%': -12}, right: {'0%': 12}, bottom: {'0%': 12}, left: {'0%': -12}},\n css: [['0%', 'translate%XY(%Vpx)'], ['100%', 'translate%XY(0px)']]\n },\n moveClose: {\n duration: (this.options.fade || 180),\n timing: 'ease-in',\n positions: {top: {'100%': -12}, right: {'100%': 12}, bottom: {'100%': 12}, left: {'100%': -12}},\n css: [['0%', 'translate%XY(0px)'], ['100%', 'translate%XY(%Vpx)']]\n },\n slideOpen: {\n duration: 400,\n positions: {top: {'0%': -400}, right: {'0%': 400}, bottom: {'0%': 400}, left: {'0%': -400}},\n css: [['0%', 'translate%XY(%Vpx)'], ['100%', 'translate%XY(0px)']]\n },\n slideClose: {\n duration: 400,\n timing: 'ease-in',\n positions: {top: {'100%': -400}, right: {'100%': 400}, bottom: {'100%': 400}, left: {'100%': -400}},\n css: [['0%', 'translate%XY(0px)'], ['100%', 'translate%XY(%Vpx)']]\n },\n flipOpen: {\n duration: 600,\n css: [['0%', 'perspective(400px) rotateX(90deg)'], ['40%', 'perspective(400px) rotateX(-15deg)'], ['70%', 'perspective(400px) rotateX(15deg)'], ['100%', 'perspective(400px) rotateX(0deg)']]\n },\n flipClose: {\n duration: (this.options.fade || 300),\n css: [['0%', 'perspective(400px) rotateX(0deg)'], ['100%', 'perspective(400px) rotateX(90deg)']]\n },\n tada: {\n duration: 800,\n css: [['0%', 'scale(1)'], ['10%, 20%', 'scale(0.9) rotate(-3deg)'], ['30%, 50%, 70%, 90%', 'scale(1.1) rotate(3deg)'], ['40%, 60%, 80%', 'scale(1.1) rotate(-3deg)'], ['100%', 'scale(1) rotate(0)']]\n }\n };\n\n // Set Open and Close names for standalone animations\n jQuery.each(['pulse', 'tada'], function (index, item) { animations[item + 'Open'] = animations[item + 'Close'] = animations[item]; });\n\n // Function to generate the CSS for the keyframes\n var generateKeyframeCSS = function (ev, position)\n {\n // Generate keyframes CSS\n keyframe_css = '@keyframes jBox-' + this.id + '-animation-' + this.options.animation[ev] + '-' + ev + (position ? '-' + position : '') + ' {';\n jQuery.each(animations[this.options.animation[ev]].css, function (index, item) {\n var translate = position ? item[1].replace('%XY', this._getXY(position).toUpperCase()) : item[1];\n animations[this.options.animation[ev]].positions && (translate = translate.replace('%V', animations[this.options.animation[ev]].positions[position][item[0]]));\n keyframe_css += item[0] + ' {transform:' + translate + ';}';\n }.bind(this));\n keyframe_css += '}';\n\n // Generate class CSS\n keyframe_css += '.jBox-' + this.id + '-animation-' + this.options.animation[ev] + '-' + ev + (position ? '-' + position : '') + ' {';\n keyframe_css += 'animation-duration: ' + animations[this.options.animation[ev]].duration + 'ms;';\n keyframe_css += 'animation-name: jBox-' + this.id + '-animation-' + this.options.animation[ev] + '-' + ev + (position ? '-' + position : '') + ';';\n keyframe_css += animations[this.options.animation[ev]].timing ? ('animation-timing-function: ' + animations[this.options.animation[ev]].timing + ';') : '';\n keyframe_css += '}';\n\n return keyframe_css;\n }.bind(this);\n\n // Generate css for each event and positions\n this._animationCSS = '';\n jQuery.each(['open', 'close'], function (index, ev)\n {\n // No CSS needed for closing with no fade\n if (!this.options.animation[ev] || !animations[this.options.animation[ev]] || (ev == 'close' && !this.options.fade)) return '';\n\n // Generate CSS\n animations[this.options.animation[ev]].positions ?\n jQuery.each(['top', 'right', 'bottom', 'left'], function (index2, position) { this._animationCSS += generateKeyframeCSS(ev, position); }.bind(this)) :\n this._animationCSS += generateKeyframeCSS(ev);\n }.bind(this));\n\n };\n\n\n // Add css for animations\n\n this.options.animation && this._generateAnimationCSS();\n\n\n // Block body clicks for 10ms to prevent extra event triggering\n\n this._blockBodyClick = function ()\n {\n this.blockBodyClick = true;\n setTimeout(function () { this.blockBodyClick = false; }.bind(this), 10);\n };\n\n\n // Animations\n\n this._animate = function (ev)\n {\n // The event which triggers the animation\n !ev && (ev = this.isOpen ? 'open' : 'close');\n\n // Don't animate when closing with no fade duration\n if (!this.options.fade && ev == 'close') return null;\n\n // Get the current position, use opposite if jBox is flipped\n var animationDirection = (this.options.animation[ev + 'Direction'] || ((this.align != 'center') ? this.align : this.options.attributes.x));\n this.flipped && this._getXY(animationDirection) == (this._getXY(this.align)) && (animationDirection = this._getOpp(animationDirection));\n\n // Add event and position classes\n var classnames = 'jBox-' + this.id + '-animation-' + this.options.animation[ev] + '-' + ev + ' jBox-' + this.id + '-animation-' + this.options.animation[ev] + '-' + ev + '-' + animationDirection;\n this.wrapper.addClass(classnames);\n\n // Get duration of animation\n var animationDuration = parseFloat(this.wrapper.css('animation-duration')) * 1000;\n ev == 'close' && (animationDuration = Math.min(animationDuration, this.options.fade));\n\n // Remove animation classes when animation is finished\n setTimeout(function () { this.wrapper.removeClass(classnames); }.bind(this), animationDuration);\n };\n\n\n // Abort an animation\n\n this._abortAnimation = function ()\n {\n // Remove all animation classes\n var classes = this.wrapper.attr('class').split(' ').filter(function (c) {\n return c.lastIndexOf('jBox-' + this.id + '-animation', 0) !== 0;\n }.bind(this));\n this.wrapper.attr('class', classes.join(' '));\n };\n\n\n // Adjust dimensions when browser is resized\n\n if (this.options.responsiveWidth || this.options.responsiveHeight)\n {\n // Responsive positioning overrides options adjustPosition and reposition\n // TODO: Only add this resize event when the other one from adjustPosition and reposition was not set\n jQuery(window).on('resize.responsivejBox-' + this.id, function (ev) { if (this.isOpen) { this.position(); } }.bind(this));\n }\n\n\n // Fix audio options\n\n jQuery.type(this.options.preloadAudio) === 'string' && (this.options.preloadAudio = [this.options.preloadAudio]);\n jQuery.type(this.options.audio) === 'string' && (this.options.audio = {open: this.options.audio});\n jQuery.type(this.options.volume) === 'number' && (this.options.volume = {open: this.options.volume, close: this.options.volume});\n\n if (this.options.preloadAudio === true && this.options.audio) {\n this.options.preloadAudio = [];\n jQuery.each(this.options.audio, function (index, url) {\n this.options.preloadAudio.push(url + '.mp3');\n this.options.preloadAudio.push(url + '.ogg');\n }.bind(this));\n }\n\n\n // Preload audio files\n\n this.options.preloadAudio.length && jQuery.each(this.options.preloadAudio, function (index, url) {\n var audio = new Audio();\n audio.src = url;\n audio.preload = 'auto';\n });\n\n\n // Fire onInit event\n\n this._fireEvent('onInit');\n\n\n return this;\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Add a child (variable) to this object.
[ "def _add(self, codeobj):\n \"\"\"\"\"\"\n assert isinstance(codeobj, CodeVariable)\n self.variables.append(codeobj)" ]
[ "@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:" }
/* public MysqlUpdateExecutor(SocketChannel ch){ this.channel = ch; }
[ "public OKPacket update(String updateString) throws IOException {\r\n QueryCommandPacket cmd = new QueryCommandPacket();\r\n cmd.setQueryString(updateString);\r\n byte[] bodyBytes = cmd.toBytes();\r\n PacketManager.writeBody(connector.getChannel(), bodyBytes);\r\n\r\n logger.debug(\"read update result...\");\r\n byte[] body = PacketManager.readBytes(connector.getChannel(),\r\n PacketManager.readHeader(connector.getChannel(), 4).getPacketBodyLength());\r\n if (body[0] < 0) {\r\n ErrorPacket packet = new ErrorPacket();\r\n packet.fromBytes(body);\r\n throw new IOException(packet + \"\\n with command: \" + updateString);\r\n }\r\n\r\n OKPacket packet = new OKPacket();\r\n packet.fromBytes(body);\r\n return packet;\r\n }" ]
[ "public void init(ProxyTask proxyTask, RemoteTask remoteTask)\n {\n super.init(null, remoteTask); // TaskHolder doesn't have a parent (BaseHolder).\n m_proxyTask = proxyTask;\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Hide the given parameters. @param array $data @param array $hidden @return mixed
[ "protected function hideParameters($data, $hidden)\n {\n foreach ($hidden as $parameter) {\n if (Arr::get($data, $parameter)) {\n Arr::set($data, $parameter, '********');\n }\n }\n\n return $data;\n }" ]
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n \"on all of the following properties before attempting an insert():\\n> \".implode(\"\\n> \", $missing).\"\\n\");\n }\n\n /** @var self $endpoint */\n $endpoint = self::post($data);\n return $endpoint;\n }" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
This function only needs to be called by the default SQL metadata storage module Other modules should default to calling super.configure(...) alone @param defaultValue default property value
[ "public void createBindingChoices(Binder binder, String defaultValue)\n {\n String prop = PROPERTY;\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataStorageConnector.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataStorageProvider.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(SQLMetadataConnector.class), defaultValue);\n\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataSegmentManager.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataSegmentManagerProvider.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataRuleManager.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataRuleManagerProvider.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataSegmentPublisher.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataSegmentPublisherProvider.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(IndexerMetadataStorageCoordinator.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataStorageActionHandlerFactory.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataStorageUpdaterJobHandler.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(AuditManager.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(AuditManagerProvider.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataSupervisorManager.class), defaultValue);\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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// Connect returns a handler for the pod exec proxy
[ "func (r *ExecREST) Connect(ctx context.Context, name string, opts runtime.Object, responder rest.Responder) (http.Handler, error) {\n\texecOpts, ok := opts.(*api.PodExecOptions)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid options object: %#v\", opts)\n\t}\n\tlocation, transport, err := pod.ExecLocation(r.Store, r.KubeletConn, ctx, name, execOpts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newThrottledUpgradeAwareProxyHandler(location, transport, false, true, true, responder), 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 Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Get the absolute file path for a relative @import like './sub/file.scsss' If the @import is made from a raw data section a best guess path is returned
[ "function getImportAbsolutePath(url, prev, includedFilesMap, includedPaths = []) {\n // Ensure that both @import 'file' and @import 'file.scss' is mapped correctly\n let extension = path.posix.extname(prev);\n if(path.posix.extname(url) !== extension) {\n url += extension;\n }\n\n const absolutePath = findImportedPath(url, prev, includedFilesMap, includedPaths);\n\n if(!absolutePath) {\n throw new Error(`Can not determine imported file for url '${url}' imported in ${prev}`);\n }\n\n return absolutePath;\n}" ]
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"module:\" + cache_path; // since modules return package.json request, distinguish between module requests and actual requests to package.json\n return cache_path;\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Consume GitHub WebHook Capture a GitHub event and publish it via pulse, if it's a push, release or pull request. This method is ``experimental``
[ "def githubWebHookConsumer(self, *args, **kwargs):\n \n\n return self._makeApiCall(self.funcinfo[\"githubWebHookConsumer\"], *args, **kwargs)" ]
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // And then require the slack API via composer and do the code here\n\n // But very simple, we can say Hello World! to the console\n $output->write('Hello World!');\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// SetQuality sets the Quality field's value.
[ "func (s *ComparedFace) SetQuality(v *ImageQuality) *ComparedFace {\n\ts.Quality = v\n\treturn s\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class converts multiple language tags into one\n // Otherwise, it assumes that a single name_ tag exists with JSON content, and it will replace\n // it with multiple tags \"name_en\", \"name_fr\", ... depending on the JSON language codes\n this.namePicker = options.namePicker;\n\n // Flag to make requested_name (local_name) form\n this.combineName = options.combineName;\n}" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// authorizeRemoteUser returns checker based on cert authority roles
[ "func (a *authorizer) authorizeRemoteUser(u RemoteUser) (*AuthContext, error) {\n\tca, err := a.trust.GetCertAuthority(services.CertAuthID{Type: services.UserCA, DomainName: u.ClusterName}, false)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\troleNames, err := ca.CombinedMapping().Map(u.RemoteRoles)\n\tif err != nil {\n\t\treturn nil, trace.AccessDenied(\"failed to map roles for remote user %q from cluster %q\", u.Username, u.ClusterName)\n\t}\n\tif len(roleNames) == 0 {\n\t\treturn nil, trace.AccessDenied(\"no roles mapped for remote user %q from cluster %q\", u.Username, u.ClusterName)\n\t}\n\t// Set \"logins\" trait and \"kubernetes_groups\" for the remote user. This allows Teleport to work by\n\t// passing exact logins and kubernetes groups to the remote cluster. Note that claims (OIDC/SAML)\n\t// are not passed, but rather the exact logins, this is done to prevent\n\t// leaking too much of identity to the remote cluster, and instead of focus\n\t// on main cluster's interpretation of this identity\n\ttraits := map[string][]string{\n\t\tteleport.TraitLogins: u.Principals,\n\t\tteleport.TraitKubeGroups: u.KubernetesGroups,\n\t}\n\tlog.Debugf(\"Mapped roles %v of remote user %q to local roles %v and traits %v.\", u.RemoteRoles, u.Username, roleNames, traits)\n\tchecker, err := services.FetchRoles(roleNames, a.access, traits)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\t// The user is prefixed with \"remote-\" and suffixed with cluster name with\n\t// the hope that it does not match a real local user.\n\tuser, err := services.NewUser(fmt.Sprintf(\"remote-%v-%v\", u.Username, u.ClusterName))\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\tuser.SetTraits(traits)\n\n\t// Set the list of roles this user has in the remote cluster.\n\tuser.SetRoles(roleNames)\n\n\treturn &AuthContext{\n\t\tUser: user,\n\t\tChecker: checker,\n\t}, nil\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:" }
Display a list of all modules. @return View
[ "public function index()\n {\n $coreModules = $this->moduleManager->getCoreModules();\n $thirdPartyModules = $this->moduleManager->getThirdPartyModules();\n\n return view('modules::backend.modules.index', compact('coreModules', 'thirdPartyModules'));\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetResult sets the Result field's value.
[ "func (s *TestEventPatternOutput) SetResult(v bool) *TestEventPatternOutput {\n\ts.Result = &v\n\treturn s\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 description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Extends the validator with custom rules
[ "protected function registerValidator()\n {\n $this->app->resolving('validator', function($validator) {\n /*\n * Allowed file extensions, as opposed to mime types.\n * - extensions: png,jpg,txt\n */\n $validator->extend('extensions', function ($attribute, $value, $parameters) {\n $extension = strtolower($value->getClientOriginalExtension());\n return in_array($extension, $parameters);\n });\n\n $validator->replacer('extensions', function ($message, $attribute, $rule, $parameters) {\n return strtr($message, [':values' => implode(', ', $parameters)]);\n });\n });\n }" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is likely to be in terms of SQL path. Currently we still don't have support multiple function namespaces, nor\n // SQL path. As a result, session is not used here. We still add this to distinguish the two versions of resolveFunction\n // while the refactoring is on-going.\n return staticFunctionNamespace.resolveFunction(name, parameterTypes);\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Parse over the options passed on the command line and determine how to handle them
[ "def run_profile(self, profile, names, vm_overrides=None):\n '''\n \n '''\n if profile not in self.opts['profiles']:\n msg = 'Profile {0} is not defined'.format(profile)\n log.error(msg)\n return {'Error': msg}\n\n ret = {}\n if not vm_overrides:\n vm_overrides = {}\n\n try:\n with salt.utils.files.fopen(self.opts['conf_file'], 'r') as mcc:\n main_cloud_config = salt.utils.yaml.safe_load(mcc)\n if not main_cloud_config:\n main_cloud_config = {}\n except KeyError:\n main_cloud_config = {}\n except IOError:\n main_cloud_config = {}\n\n if main_cloud_config is None:\n main_cloud_config = {}\n\n mapped_providers = self.map_providers_parallel()\n profile_details = self.opts['profiles'][profile]\n vms = {}\n for prov, val in six.iteritems(mapped_providers):\n prov_name = next(iter(val))\n for node in mapped_providers[prov][prov_name]:\n vms[node] = mapped_providers[prov][prov_name][node]\n vms[node]['provider'] = prov\n vms[node]['driver'] = prov_name\n alias, driver = profile_details['provider'].split(':')\n\n provider_details = self.opts['providers'][alias][driver].copy()\n del provider_details['profiles']\n\n for name in names:\n if name in vms:\n prov = vms[name]['provider']\n driv = vms[name]['driver']\n msg = '{0} already exists under {1}:{2}'.format(\n name, prov, driv\n )\n log.error(msg)\n ret[name] = {'Error': msg}\n continue\n\n vm_ = self.vm_config(\n name,\n main_cloud_config,\n provider_details,\n profile_details,\n vm_overrides,\n )\n if self.opts['parallel']:\n process = multiprocessing.Process(\n target=self.create,\n args=(vm_,)\n )\n process.start()\n ret[name] = {\n 'Provisioning': 'VM being provisioned in parallel. '\n 'PID: {0}'.format(process.pid)\n }\n continue\n\n try:\n # No need to inject __active_provider_name__ into the context\n # here because self.create takes care of that\n ret[name] = self.create(vm_)\n if not ret[name]:\n ret[name] = {'Error': 'Failed to deploy VM'}\n if len(names) == 1:\n raise SaltCloudSystemExit('Failed to deploy VM')\n continue\n if self.opts.get('show_deploy_args', False) is False:\n ret[name].pop('deploy_kwargs', None)\n except (SaltCloudSystemExit, SaltCloudConfigError) as exc:\n if len(names) == 1:\n raise\n ret[name] = {'Error': str(exc)}\n\n return ret" ]
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n # must manually close out the current step, so things like result, finish\n # time are set for it. This ensures that the error summary for Taskcluster\n # infra failures actually lists the error that occurs at the\n # end of the log.\n self.end_step(last_lineno_seen)" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Whoops handle exceptions @param MvcEvent $e
[ "public function prepareException(MvcEvent $e)\n {\n if ($e->getRequest() instanceof Request) {\n $error = $e->getError();\n if (!empty($error) && !$e->getResult() instanceof Response) {\n switch ($error) {\n case Application::ERROR_CONTROLLER_NOT_FOUND:\n case Application::ERROR_CONTROLLER_INVALID:\n case Application::ERROR_ROUTER_NO_MATCH:\n // Specifically not handling these\n return;\n\n case Application::ERROR_EXCEPTION:\n default:\n /** @var Exception $exception */\n $exception = $e->getParam('exception');\n // Filter exceptions that we must except\n foreach ($this->whoopsConfig['blacklist'] as $except) {\n if ($exception instanceof $except) {\n return;\n }\n }\n\n if ($this->whoopsConfig['handler']['options_type'] === 'prettyPage') {\n $response = $e->getResponse();\n if (!$response || $response->getStatusCode() === 200) {\n header('HTTP/1.0 500 Internal Server Error', true, 500);\n }\n ob_clean();\n }\n\n $this->run->handleException($e->getParam('exception'));\n break;\n }\n }\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Clears the dict.
[ "def clear(self):\r\n \r\n self.__values.clear()\r\n self.__access_keys = []\r\n self.__modified_times.clear()" ]
[ "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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Generate the new nav based on parent_id @param $model @return \Illuminate\Support\Collection|static
[ "private function generateCompleteUrl($model)\n {\n $row = self::find($model->parent_id);\n\n if ($row) {\n if (strlen($row->slug) > 1) {\n $this->url = $row->slug . (strlen($this->url) ? '/' . $this->url : '');\n }\n\n return $this->generateCompleteUrl($row);\n }\n\n return $row;\n }" ]
[ "protected function map() {return df_map_0(df_sort_a(df_map_r(df_cms_blocks(), function(B $b) {return [\n\t\t$b->getId(), $b->getTitle()\n\t];})), '-- select a CMS block --');}" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Prepare an image This method should prepare an image object from php://input. The method must also figure out the width, height, mime type and extension of the image. @param EventInterface $event The current event @throws ImageException
[ "public function prepareImage(EventInterface $event) {\n $request = $event->getRequest();\n\n // Fetch image data from input\n $imageBlob = $request->getContent();\n\n if (empty($imageBlob)) {\n $e = new ImageException('No image attached', 400);\n $e->setImboErrorCode(Exception::IMAGE_NO_IMAGE_ATTACHED);\n\n throw $e;\n }\n\n // Fetch mime using finfo\n $mime = (new finfo(FILEINFO_MIME_TYPE))->buffer($imageBlob);\n\n if (isset(Image::$mimeTypeMapping[$mime])) {\n $mime = Image::$mimeTypeMapping[$mime];\n }\n\n // The loader for the format determined that the image was borked. We set up the image\n // exception here since we're catching multiple exceptions below\n $invalidImageException = new ImageException('Invalid image', 415);\n $invalidImageException->setImboErrorCode(Exception::IMAGE_INVALID_IMAGE);\n\n // Attempt to load the image through one of the registered loaders\n try {\n $imagick = $event->getInputLoaderManager()->load($mime, $imageBlob);\n\n if ($imagick) {\n $size = $imagick->getImageGeometry();\n }\n } catch (ImagickException $e) {\n throw $invalidImageException;\n } catch (LoaderException $e) {\n throw $invalidImageException;\n }\n\n // Unsupported image type\n if (!$imagick) {\n $e = new ImageException('Unsupported image type: ' . $mime, 415);\n $e->setImboErrorCode(Exception::IMAGE_UNSUPPORTED_MIMETYPE);\n\n throw $e;\n }\n\n // Store relevant information in the image instance and attach it to the request\n $image = new Image();\n $image->setMimeType($mime)\n ->setExtension($event->getInputLoaderManager()->getExtensionFromMimetype($mime))\n ->setBlob($imageBlob)\n ->setWidth($size['width'])\n ->setHeight($size['height'])\n ->setOriginalChecksum(md5($imageBlob));\n\n $request->setImage($image);\n }" ]
[ "public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_payload` is set accordingly.\n return $this;\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Updates the session state. @param state The session state.
[ "private void setState(State state) {\n if (this.state != state) {\n this.state = state;\n log.debug(\"State changed: {}\", state);\n }\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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Template variable getter. Returns paymentlist @return object
[ "public function getPaymentList()\n {\n if ($this->_oPaymentList === null) {\n $this->_oPaymentList = false;\n\n $sActShipSet = \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('sShipSet');\n if (!$sActShipSet) {\n $sActShipSet = \\OxidEsales\\Eshop\\Core\\Registry::getSession()->getVariable('sShipSet');\n }\n\n $oBasket = $this->getSession()->getBasket();\n\n // load sets, active set, and active set payment list\n list($aAllSets, $sActShipSet, $aPaymentList) =\n \\OxidEsales\\Eshop\\Core\\Registry::get(\\OxidEsales\\Eshop\\Application\\Model\\DeliverySetList::class)->getDeliverySetData($sActShipSet, $this->getUser(), $oBasket);\n\n $oBasket->setShipping($sActShipSet);\n\n // calculating payment expences for preview for each payment\n $this->_setValues($aPaymentList, $oBasket);\n $this->_oPaymentList = $aPaymentList;\n $this->_aAllSets = $aAllSets;\n }\n\n return $this->_oPaymentList;\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// UnmarshalJSON sets the object from the provided JSON representation
[ "func (l *OpsWorksInstanceBlockDeviceMappingList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := OpsWorksInstanceBlockDeviceMapping{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = OpsWorksInstanceBlockDeviceMappingList{item}\n\t\treturn nil\n\t}\n\tlist := []OpsWorksInstanceBlockDeviceMapping{}\n\terr := json.Unmarshal(buf, &list)\n\tif err == nil {\n\t\t*l = OpsWorksInstanceBlockDeviceMappingList(list)\n\t\treturn nil\n\t}\n\treturn err\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:" }
Display admin dashboard page @param Request $request @return string
[ "public function slash(Request $request)\n {\n switch ($emailStatus = $request->query->get('email')) {\n case 'sent';\n $emailStatus = $this->app->trans('Mail sent');\n break;\n case 'error':\n $emailStatus = $this->app->trans('Could not send email');\n break;\n }\n\n return $this->render('admin/dashboard.html.twig', [\n 'cache_flushed' => $request->query->get('flush_cache') === 'ok',\n 'admins' => $this->getUserRepository()->findAdmins(),\n 'email_status' => $emailStatus,\n ]);\n }" ]
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Returns an external catalog.
[ "public static ExternalCatalog findAndCreateExternalCatalog(Descriptor descriptor) {\n\t\tMap<String, String> properties = descriptor.toProperties();\n\t\treturn TableFactoryService\n\t\t\t.find(ExternalCatalogFactory.class, properties)\n\t\t\t.createExternalCatalog(properties);\n\t}" ]
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Verify the user for the given token. @param array $credentials @param \Closure $callback @return mixed
[ "public function verify(array $credentials, Closure $callback)\n {\n // If the responses from the validate method is not a user instance, we will\n // assume that it is a redirect and simply return it from this method and\n // the user is properly redirected having an error message on the post.\n $user = $this->validateEmailVerification($credentials);\n\n if (! $user instanceof CanVerifyEmailContract) {\n return $user;\n }\n\n if($callback($user)) {\n\n $this->events->dispatch(new UserVerified($user));\n\n }\n\n return static::VERIFIED;\n }" ]
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n \"on all of the following properties before attempting an insert():\\n> \".implode(\"\\n> \", $missing).\"\\n\");\n }\n\n /** @var self $endpoint */\n $endpoint = self::post($data);\n return $endpoint;\n }" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
////////////////////////////////////////////////////////////////
[ "func (l *Lexer) consumeHTMLLikeCommentToken() bool {\n\tc := l.r.Peek(0)\n\tif c == '<' && l.r.Peek(1) == '!' && l.r.Peek(2) == '-' && l.r.Peek(3) == '-' {\n\t\t// opening HTML-style single line comment\n\t\tl.r.Move(4)\n\t\tl.consumeSingleLineComment()\n\t\treturn true\n\t} else if l.emptyLine && c == '-' && l.r.Peek(1) == '-' && l.r.Peek(2) == '>' {\n\t\t// closing HTML-style single line comment\n\t\t// (only if current line didn't contain any meaningful tokens)\n\t\tl.r.Move(3)\n\t\tl.consumeSingleLineComment()\n\t\treturn true\n\t}\n\treturn false\n}" ]
[ "private void readPacket(Results results) throws SQLException {\n Buffer buffer;\n try {\n buffer = reader.getPacket(true);\n } catch (IOException e) {\n throw handleIoException(e);\n }\n\n switch (buffer.getByteAt(0)) {\n\n //*********************************************************************************************************\n //* OK response\n //*********************************************************************************************************\n case OK:\n readOkPacket(buffer, results);\n break;\n\n //*********************************************************************************************************\n //* ERROR response\n //*********************************************************************************************************\n case ERROR:\n throw readErrorPacket(buffer, results);\n\n //*********************************************************************************************************\n //* LOCAL INFILE response\n //*********************************************************************************************************\n case LOCAL_INFILE:\n readLocalInfilePacket(buffer, results);\n break;\n\n //*********************************************************************************************************\n //* ResultSet\n //*********************************************************************************************************\n default:\n readResultSet(buffer, results);\n break;\n\n }\n\n }" ]
codesearchnet
{ "query": "Represent the Github post about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
add some data to the graph
[ "def add_values(self, values):\n ''''''\n if self.child.is_alive():\n self.parent_pipe.send(values)" ]
[ "@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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param array $item @return \Pressbooks\Entities\Cloner\H5P
[ "protected function createH5PEntity( $item ) {\n\t\t$h5p = new \\Pressbooks\\Entities\\Cloner\\H5P();\n\t\tif ( isset( $item['id'] ) ) {\n\t\t\t$h5p->id = $item['id'];\n\t\t}\n\t\tif ( isset( $item['url'] ) ) {\n\t\t\t$h5p->url = $item['url'];\n\t\t}\n\t\treturn $h5p;\n\t}" ]
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
The ``Bcc`` header.
[ "def bcc(self) -> Optional[Sequence[AddressHeader]]:\n \"\"\"\"\"\"\n try:\n return cast(Sequence[AddressHeader], self[b'bcc'])\n except KeyError:\n return None" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return sql table data. @param string $machine @param string $buildToken @param string $table @param integer $offset @return array
[ "public function actionDataProvider($machine, $buildToken, $table, $offset)\n {\n $build = $this->ensureBuild($machine, $buildToken);\n \n $config = $build->getTableConfig($table);\n \n $offsetNummeric = $offset * $build->rowsPerRequest;\n\n $query = (new Query())\n ->select($config['fields'])\n ->from($config['name'])\n ->offset($offsetNummeric)\n ->limit($build->rowsPerRequest);\n \n if (!empty($config['pks']) && is_array($config['pks'])) {\n $orders = [];\n foreach ($config['pks'] as $pk) {\n $orders[$pk] = SORT_ASC;\n }\n $query->orderBy($orders);\n }\n \n return $query->all();\n }" ]
[ "private function getSent($orderId)\n {\n //Getting connection\n $connection = $this->_resource->getConnection();\n //Getting full table name\n $tableName = $this->_resource->getTableName('pagseguro_orders');\n //Update sales_order_grid query\n $mapsDeleteQuery = \"SELECT sent FROM {$tableName} WHERE order_id={$orderId}\";\n return $connection->query($mapsDeleteQuery)->fetch();\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
TODO: implement test
[ "def members\n NippoCore::User.joins(:group_member_relations)\n .where(nippo_core_group_member_relations: {group_id: self.id})\n .where.not(nippo_core_group_member_relations: {accepted_at: nil})\n end" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
{@inheritDoc} @throws \InvalidArgumentException When the table is unknown.
[ "public function getMappingFor(string $tables, string $sourceLanguage, string $targetLanguage): MappingInterface\n {\n switch ($tables) {\n case 'tl_page':\n return $this->getPageMap($sourceLanguage, $targetLanguage);\n case 'tl_article':\n return $this->getArticleMap($sourceLanguage, $targetLanguage);\n case 'tl_article.tl_content':\n return $this->getArticleContentMap($sourceLanguage, $targetLanguage);\n default:\n }\n throw new \\InvalidArgumentException('Unknown table ' . $tables);\n }" ]
[ "@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 Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
execute command and return execution flags
[ "public int exec(Map<String, Command> references) throws Exception\n\t{\n\t\t// System.out.println(\"in exec() status = \" + translateStatus(status) +\n\t\t// \"...\");\n\t\tif (status < Command.CHILDREN_PROCESSED)\n\t\t{\n\t\t\tif (status < Command.COMMAND_EXECUTED)\n\t\t\t{\n\t\t\t\tif (status < Command.CHILDREN_FILTERED)\n\t\t\t\t{\n\t\t\t\t\tstatus = doBeforeRun(references);\n\t\t\t\t\t// System.out.println(\"after doBeforeRun() status = \" +\n\t\t\t\t\t// translateStatus(status));\n\t\t\t\t}\n\t\t\t\tif (status == Command.CHILDREN_FILTERED)\n\t\t\t\t{\n\t\t\t\t\tstatus = doRun(references);\n\t\t\t\t\t// System.out.println(\"after doRun() status = \" +\n\t\t\t\t\t// translateStatus(status));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (status == Command.COMMAND_EXECUTED)\n\t\t\t{\n\t\t\t\tstatus = doAfterRun(references);\n\t\t\t\t// System.out.println(\"after doAfterRun() status = \" +\n\t\t\t\t// translateStatus(status));\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\"...out of exec() status = \" +\n\t\t// translateStatus(status));\n\t\treturn status;\n\t}" ]
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Returns `content` with consecutive spaces converted to non-break spaces, and linebreak converted into HTML br elements. :param content: text to format :type content: `str` :rtype: `str`
[ "def _format_content(self, content):\n \n content = re.sub(r'\\n', '<br/>\\n', content)\n content = re.sub(r' ', '&#160;&#160;', content)\n content = re.sub(r'&#160; ', '&#160;&#160;', content)\n return content" ]
[ "def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more xpath expressions)\n self.author = OrderedSet()\n\n # Use first matching element as date (0 or more xpath expressions)\n self.date = OrderedSet()\n\n # Put language here. It's not supported in siteconfig syntax,\n # but having it here allows more generic handling in extractor.\n self.language = (\n '//html[@lang]/@lang',\n '//meta[@name=\"DC.language\"]/@content',\n )\n\n # Strip elements matching these xpath expressions (0 or more)\n self.strip = OrderedSet()\n\n # Strip 0 or more elements which contain these\n # strings in the id or class attribute.\n self.strip_id_or_class = OrderedSet()\n\n # Strip 0 or more images which contain\n # these strings in the src attribute.\n self.strip_image_src = OrderedSet()\n\n # Additional HTTP headers to send\n # NOT YET USED\n self.http_header = OrderedSet()\n\n # For those 3, None means that default will be used. But we need\n # None to distinguish from False during multiple configurations\n # merges.\n self.tidy = None\n self.prune = None\n self.autodetect_on_failure = None\n\n # Test URL - if present, can be used to test the config above\n self.test_url = OrderedSet()\n self.test_contains = OrderedSet()\n\n # Single-page link should identify a link element or URL pointing\n # to the page holding the entire article.\n #\n # This is useful for sites which split their articles across\n # multiple pages. Links to such pages tend to display the first\n # page with links to the other pages at the bottom.\n #\n # Often there is also a link to a page which displays the entire\n # article on one page (e.g. 'print view').\n #\n # `single_page_link` should be an XPath expression identifying the\n # link to that single page. If present and we find a match, we will\n # retrieve that page and the rest of the options in this config will\n # be applied to the new page.\n self.single_page_link = OrderedSet()\n\n self.next_page_link = OrderedSet()\n\n # Single-page link in feed? - same as above, but patterns applied\n # to item description HTML taken from feed. XXX\n self.single_page_link_in_feed = OrderedSet()\n\n # Which parser to use for turning raw HTML into a DOMDocument,\n # either `libxml` (PHP) / `lxml` (Python) or `html5lib`. Defaults\n # to `lxml` if None.\n self.parser = None\n\n # Strings to search for in HTML before processing begins. Goes by\n # pairs with `replace_string`. Not a set because we can have more\n # than one of the same, to be replaced by different values.\n self.find_string = []\n\n # Strings to replace those found in `find_string` before HTML\n # processing begins.\n self.replace_string = []" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Return a list of templates usable by a model.
[ "def get_templates(model):\n \n for template_name, template in templates.items():\n if issubclass(template.model, model):\n yield (template_name, template.layout._meta.verbose_name)" ]
[ "@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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Make sure a property is supported by adding prefix. @param {string} property A property to be checked @return {string} the property or its prefixed version
[ "function prefixProperty (property) {\n property = property.replace(camelReg, (match, first, char) => (first ? char : char.toUpperCase()))\n\n if (prefixCache[property]) {\n return prefixCache[property]\n }\n\n let prop\n\n if (!(property in supportElement.style)) {\n for (let i = 0; i < PREFIX_TYPE.length; i++) {\n let prefixedProp = PREFIX_TYPE[i] +\n property.charAt(0).toUpperCase() +\n property.slice(1)\n if (prefixedProp in supportElement.style) {\n prop = prefixedProp\n break\n }\n }\n }\n\n prefixCache[property] = prop || property\n\n return prefixCache[property]\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class converts multiple language tags into one\n // Otherwise, it assumes that a single name_ tag exists with JSON content, and it will replace\n // it with multiple tags \"name_en\", \"name_fr\", ... depending on the JSON language codes\n this.namePicker = options.namePicker;\n\n // Flag to make requested_name (local_name) form\n this.combineName = options.combineName;\n}" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Parse rules, normalizing format into: { attribute: [{ name: 'age', value: 3 }] } @param {object} rules @return {object}
[ "function (rules) {\n\n var parsedRules = {};\n rules = this._flattenObject(rules);\n\n for (var attribute in rules) {\n\n var rulesArray = rules[attribute];\n\n this._parseRulesCheck(attribute, rulesArray, parsedRules);\n }\n return parsedRules;\n\n\n }" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Apply request to appropriate ledger and state. `cons_time` is the UTC epoch at which consensus was reached.
[ "def applyReq(self, request: Request, cons_time: int):\n \n self.execute_hook(NodeHooks.PRE_REQUEST_APPLICATION, request=request,\n cons_time=cons_time)\n req_handler = self.get_req_handler(txn_type=request.operation[TXN_TYPE])\n seq_no, txn = req_handler.apply(request, cons_time)\n ledger_id = self.ledger_id_for_request(request)\n self.execute_hook(NodeHooks.POST_REQUEST_APPLICATION, request=request,\n cons_time=cons_time, ledger_id=ledger_id,\n seq_no=seq_no, txn=txn)" ]
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n # must manually close out the current step, so things like result, finish\n # time are set for it. This ensures that the error summary for Taskcluster\n # infra failures actually lists the error that occurs at the\n # end of the log.\n self.end_step(last_lineno_seen)" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Converts a string containing comma separated email addresses into a list of email addresses.
[ "def split_addresses(email_string_list):\n \n return [f for f in [s.strip() for s in email_string_list.split(\",\")] if f]" ]
[ "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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Update the environments based upon the user's selection +changes+ : Hash with two keys: :new and :obsolete. changed[:/new|obsolete/] is and Array of Strings Returns : Array of Strings containing all record errors
[ "def obsolete_and_new(changes = { })\n return if changes.empty?\n if changes['new'].present?\n changes['new'].each { |name, _| ForemanChef::Environment.create(:name => name, :chef_proxy_id => @chef_proxy.id) }\n end\n if changes['obsolete'].present?\n changes['obsolete'].each { |name, _| ForemanChef::Environment.where(:chef_proxy_id => @chef_proxy.id).find_by_name(name).destroy }\n end\n []\n end" ]
[ "def QA_fetch_index_list_adv(collections=DATABASE.index_list):\n '''\n \n '''\n index_list_items = QA_fetch_index_list(collections)\n if len(index_list_items) == 0:\n print(\"QA Error QA_fetch_index_list_adv call item for item in collections.find() return 0 item, maybe the DATABASE.index_list is empty!\")\n return None\n return index_list_items" ]
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
@param ITypedCollection $collection @param callable $objectLoaderCallback @return ILazyCollection @throws InvalidArgumentException
[ "public static function from(ITypedCollection $collection, callable $objectLoaderCallback) : ILazyCollection\n {\n if (method_exists($collection, 'createLazyCollection')) {\n return $collection->createLazyCollection($objectLoaderCallback);\n }\n\n if ($collection instanceof EntityCollection) {\n return new LazyEntityCollection($collection->getEntityType(), $objectLoaderCallback);\n }\n\n if ($collection instanceof EntityIdCollection) {\n return new LazyEntityIdCollection($objectLoaderCallback);\n }\n\n if ($collection instanceof ValueObjectCollection) {\n return new LazyValueObjectCollection($collection->getObjectType(), $objectLoaderCallback);\n }\n\n if ($collection instanceof ObjectCollection) {\n return new LazyObjectCollection($collection->getObjectType(), $objectLoaderCallback);\n }\n\n throw InvalidArgumentException::format(\n 'Invalid call to %s: unsupported collection type %s given',\n __METHOD__, get_class($collection)\n );\n }" ]
[ "public function objectFromIndex(IObjectSetWithIdentityByIndex $objects) : ObjectFieldBuilder\n {\n return new ObjectFieldBuilder(\n $this->type(new ObjectIdType(new ObjectIndexOptions($objects), $loadAsObjects = true))\n );\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Returns a Span that covers all rows beginning with a prefix.
[ "public static Span prefix(Bytes rowPrefix) {\n Objects.requireNonNull(rowPrefix);\n Bytes fp = followingPrefix(rowPrefix);\n return new Span(rowPrefix, true, fp == null ? Bytes.EMPTY : fp, false);\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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.
[ "func (o *Organization) GetReposURL() string {\n\tif o == nil || o.ReposURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.ReposURL\n}" ]
[ "func (f *RecordFlags) AddFlags(cmd *cobra.Command) {\n\tif f == nil {\n\t\treturn\n\t}\n\n\tif f.Record != nil {\n\t\tcmd.Flags().BoolVar(f.Record, \"record\", *f.Record, \"Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.\")\n\t}\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see retrofit2.Converter.Factory#requestBodyConverter(java.lang.reflect.Type, java.lang.annotation.Annotation[], java.lang.annotation.Annotation[], retrofit2.Retrofit)
[ "@SuppressWarnings(\"rawtypes\")\n\t@Override\n\tpublic Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations,\n\t\t\tAnnotation[] methodAnnotations, Retrofit retrofit) {\n\t\tif (type instanceof Class) {\n\t\t\tClass<?> ct = ((Class) type);\n\t\t\tAnnotation annotation = ct.getAnnotation(BindType.class);\n\n\t\t\tif (annotation != null) {\n\t\t\t\treturn new KriptonRequestBodyConverter<>(binderContext, (Class<?>) type);\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t} else if (type instanceof ParameterizedType) {\n\t\t\tParameterizedType pt = ((ParameterizedType) type);\n\t\t\tif (pt.getActualTypeArguments().length == 1) {\n\t\t\t\treturn new KriptonRequestBodyCollectionConverter<>(binderContext, (ParameterizedType) type);\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\n\t}" ]
[ "public void addInterceptor(ConnectInterceptor<?> interceptor) {\n\t\tClass<?> serviceApiType = GenericTypeResolver.resolveTypeArgument(interceptor.getClass(), ConnectInterceptor.class);\n\t\tconnectInterceptors.add(serviceApiType, interceptor);\n\t}" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
nodejs的require('path').relative有bug,因此自己写
[ "function getRelativePath (from, to) {\n // 去除相同部分\n var i = 0\n while (from[i] === to[i]) {\n i++\n }\n from = from.substr(i)\n to = to.substr(i)\n // 加上..或.\n var l = from.split(/\\/|\\\\/).length - 1\n var s = ''\n if (l) {\n while (l--) {\n s += '../'\n }\n } else {\n s = './'\n }\n return s + to\n}" ]
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n WhereParser只是单纯想调用SqlParser的方法而已\n */\n WhereParser whereParser = new WhereParser(this, query);\n\n /*\n zhongshu-comment 例如sql:select a,sum(b),case when c='a' then 1 else 2 end as my_c from tbl,\n 那findSelect()就是解析这一部分了:a,sum(b),case when c='a' then 1 else 2 end as my_c\n */\n findSelect(query, select, query.getFrom().getAlias()); //zhongshu-comment 看过\n\n select.getFrom().addAll(findFrom(query.getFrom())); //zhongshu-comment 看过\n\n select.setWhere(whereParser.findWhere()); //zhongshu-comment 看过\n\n //zhongshu-comment 这个应该是针对where子查询的,而不是from子查询,貌似又不是解析from子查询的,报错了\n //zhongshu-comment 也许es本身就不支持子查询,所以es-sql就没实现,那这个fillSubQueries是什么啊??\n //todo 看不懂,测试了好几个常见的sql,都没有进去该方法,那就先不理了,看别的\n select.fillSubQueries();\n\n //zhongshu-comment 解析sql语句中的注释:select /*! USE_SCROLL(10,120000) */ * FROM spark_es_table\n //hint单词的意思是提示,即sql中的注释内容\n // /* 和 */之间是sql的注释内容,这是sql本身的语法,然后sql解析器会将注释块之间的内容“! USE_SCROLL(10,120000) ”抽取出来\n // ! USE_SCROLL是es-sql自己定义的一套规则,\n // 在不增加mysql原有语法的情况下,利用注释来灵活地扩展es-sql的功能,这样就能使用druid的mysql语法解析器了,无需自己实现\n // 注意:!叹号和USE_SCROLL之间要空且只能空一格\n select.getHints().addAll(parseHints(query.getHints()));\n\n findLimit(query.getLimit(), select);\n\n //zhongshu-comment 和那个_score有关\n findOrderBy(query, select); //zhongshu-comment 还没看\n\n findGroupBy(query, select); //zhongshu-comment aggregations\n return select;\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value.
[ "func (s *PutBucketEncryptionInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *PutBucketEncryptionInput {\n\ts.ServerSideEncryptionConfiguration = v\n\treturn s\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 Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
[ "func (v *RawMessage) UnmarshalEasyJSON(l *jlexer.Lexer) {\n\t*v = RawMessage(l.Raw())\n}" ]
[ "func (re RawExtension) MarshalJSON() ([]byte, error) {\n\tif re.Raw == nil {\n\t\t// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which\n\t\t// expect to call json.Marshal on arbitrary versioned objects (even those not in\n\t\t// the scheme). pkg/kubectl/resource#AsVersionedObjects and its interaction with\n\t\t// kubectl get on objects not in the scheme needs to be updated to ensure that the\n\t\t// objects that are not part of the scheme are correctly put into the right form.\n\t\tif re.Object != nil {\n\t\t\treturn json.Marshal(re.Object)\n\t\t}\n\t\treturn []byte(\"null\"), nil\n\t}\n\t// TODO: Check whether ContentType is actually JSON before returning it.\n\treturn re.Raw, nil\n}" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Check if a particular space is clear of blockages @param map The map the spaces are being built from @param space The space to check @return True if there are no blockages in the space
[ "public boolean clear(TileBasedMap map, Space space) {\n\t\tif (tileBased) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tfloat x = 0;\n\t\tboolean donex = false;\n\t\t\n\t\twhile (x < space.getWidth()) {\n\t\t\tfloat y = 0;\n\t\t\tboolean doney = false;\n\t\t\t\n\t\t\twhile (y < space.getHeight()) {\n\t\t\t\tsx = (int) (space.getX()+x);\n\t\t\t\tsy = (int) (space.getY()+y);\n\t\t\t\t\n\t\t\t\tif (map.blocked(this, sx, sy)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ty += 0.1f;\n\t\t\t\tif ((y > space.getHeight()) && (!doney)) {\n\t\t\t\t\ty = space.getHeight();\n\t\t\t\t\tdoney = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tx += 0.1f;\n\t\t\tif ((x > space.getWidth()) && (!donex)) {\n\t\t\t\tx = space.getWidth();\n\t\t\t\tdonex = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}" ]
[ "function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory, but simplifies coding.\n options = options || {};\n if ('uniqueLinkId' in options) {\n console.warn(\n 'ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\\n' +\n 'Use `multigraph` option instead\\n',\n '\\n',\n 'Note: there is also change in default behavior: From now on each graph\\n'+\n 'is considered to be not a multigraph by default (each edge is unique).'\n );\n\n options.multigraph = options.uniqueLinkId;\n }\n\n // Dear reader, the non-multigraphs do not guarantee that there is only\n // one link for a given pair of node. When this option is set to false\n // we can save some memory and CPU (18% faster for non-multigraph);\n if (options.multigraph === undefined) options.multigraph = false;\n\n var nodes = typeof Object.create === 'function' ? Object.create(null) : {},\n links = [],\n // Hash of multi-edges. Used to track ids of edges between same nodes\n multiEdges = {},\n nodesCount = 0,\n suspendEvents = 0,\n\n forEachNode = createNodeIterator(),\n createLink = options.multigraph ? createUniqueLink : createSingleLink,\n\n // Our graph API provides means to listen to graph changes. Users can subscribe\n // to be notified about changes in the graph by using `on` method. However\n // in some cases they don't use it. To avoid unnecessary memory consumption\n // we will not record graph changes until we have at least one subscriber.\n // Code below supports this optimization.\n //\n // Accumulates all changes made during graph updates.\n // Each change element contains:\n // changeType - one of the strings: 'add', 'remove' or 'update';\n // node - if change is related to node this property is set to changed graph's node;\n // link - if change is related to link this property is set to changed graph's link;\n changes = [],\n recordLinkChange = noop,\n recordNodeChange = noop,\n enterModification = noop,\n exitModification = noop;\n\n // this is our public API:\n var graphPart = {\n /**\n * Adds node to the graph. If node with given id already exists in the graph\n * its data is extended with whatever comes in 'data' argument.\n *\n * @param nodeId the node's identifier. A string or number is preferred.\n * @param [data] additional data for the node being added. If node already\n * exists its data object is augmented with the new one.\n *\n * @return {node} The newly added node or node with given id if it already exists.\n */\n addNode: addNode,\n\n /**\n * Adds a link to the graph. The function always create a new\n * link between two nodes. If one of the nodes does not exists\n * a new node is created.\n *\n * @param fromId link start node id;\n * @param toId link end node id;\n * @param [data] additional data to be set on the new link;\n *\n * @return {link} The newly created link\n */\n addLink: addLink,\n\n /**\n * Removes link from the graph. If link does not exist does nothing.\n *\n * @param link - object returned by addLink() or getLinks() methods.\n *\n * @returns true if link was removed; false otherwise.\n */\n removeLink: removeLink,\n\n /**\n * Removes node with given id from the graph. If node does not exist in the graph\n * does nothing.\n *\n * @param nodeId node's identifier passed to addNode() function.\n *\n * @returns true if node was removed; false otherwise.\n */\n removeNode: removeNode,\n\n /**\n * Gets node with given identifier. If node does not exist undefined value is returned.\n *\n * @param nodeId requested node identifier;\n *\n * @return {node} in with requested identifier or undefined if no such node exists.\n */\n getNode: getNode,\n\n /**\n * Gets number of nodes in this graph.\n *\n * @return number of nodes in the graph.\n */\n getNodesCount: function () {\n return nodesCount;\n },\n\n /**\n * Gets total number of links in the graph.\n */\n getLinksCount: function () {\n return links.length;\n },\n\n /**\n * Gets all links (inbound and outbound) from the node with given id.\n * If node with given id is not found null is returned.\n *\n * @param nodeId requested node identifier.\n *\n * @return Array of links from and to requested node if such node exists;\n * otherwise null is returned.\n */\n getLinks: getLinks,\n\n /**\n * Invokes callback on each node of the graph.\n *\n * @param {Function(node)} callback Function to be invoked. The function\n * is passed one argument: visited node.\n */\n forEachNode: forEachNode,\n\n /**\n * Invokes callback on every linked (adjacent) node to the given one.\n *\n * @param nodeId Identifier of the requested node.\n * @param {Function(node, link)} callback Function to be called on all linked nodes.\n * The function is passed two parameters: adjacent node and link object itself.\n * @param oriented if true graph treated as oriented.\n */\n forEachLinkedNode: forEachLinkedNode,\n\n /**\n * Enumerates all links in the graph\n *\n * @param {Function(link)} callback Function to be called on all links in the graph.\n * The function is passed one parameter: graph's link object.\n *\n * Link object contains at least the following fields:\n * fromId - node id where link starts;\n * toId - node id where link ends,\n * data - additional data passed to graph.addLink() method.\n */\n forEachLink: forEachLink,\n\n /**\n * Suspend all notifications about graph changes until\n * endUpdate is called.\n */\n beginUpdate: enterModification,\n\n /**\n * Resumes all notifications about graph changes and fires\n * graph 'changed' event in case there are any pending changes.\n */\n endUpdate: exitModification,\n\n /**\n * Removes all nodes and links from the graph.\n */\n clear: clear,\n\n /**\n * Detects whether there is a link between two nodes.\n * Operation complexity is O(n) where n - number of links of a node.\n * NOTE: this function is synonim for getLink()\n *\n * @returns link if there is one. null otherwise.\n */\n hasLink: getLink,\n\n /**\n * Detects whether there is a node with given id\n * \n * Operation complexity is O(1)\n * NOTE: this function is synonim for getNode()\n *\n * @returns node if there is one; Falsy value otherwise.\n */\n hasNode: getNode,\n\n /**\n * Gets an edge between two nodes.\n * Operation complexity is O(n) where n - number of links of a node.\n *\n * @param {string} fromId link start identifier\n * @param {string} toId link end identifier\n *\n * @returns link if there is one. null otherwise.\n */\n getLink: getLink\n };\n\n // this will add `on()` and `fire()` methods.\n eventify(graphPart);\n\n monitorSubscribers();\n\n return graphPart;\n\n function monitorSubscribers() {\n var realOn = graphPart.on;\n\n // replace real `on` with our temporary on, which will trigger change\n // modification monitoring:\n graphPart.on = on;\n\n function on() {\n // now it's time to start tracking stuff:\n graphPart.beginUpdate = enterModification = enterModificationReal;\n graphPart.endUpdate = exitModification = exitModificationReal;\n recordLinkChange = recordLinkChangeReal;\n recordNodeChange = recordNodeChangeReal;\n\n // this will replace current `on` method with real pub/sub from `eventify`.\n graphPart.on = realOn;\n // delegate to real `on` handler:\n return realOn.apply(graphPart, arguments);\n }\n }\n\n function recordLinkChangeReal(link, changeType) {\n changes.push({\n link: link,\n changeType: changeType\n });\n }\n\n function recordNodeChangeReal(node, changeType) {\n changes.push({\n node: node,\n changeType: changeType\n });\n }\n\n function addNode(nodeId, data) {\n if (nodeId === undefined) {\n throw new Error('Invalid node identifier');\n }\n\n enterModification();\n\n var node = getNode(nodeId);\n if (!node) {\n node = new Node(nodeId, data);\n nodesCount++;\n recordNodeChange(node, 'add');\n } else {\n node.data = data;\n recordNodeChange(node, 'update');\n }\n\n nodes[nodeId] = node;\n\n exitModification();\n return node;\n }\n\n function getNode(nodeId) {\n return nodes[nodeId];\n }\n\n function removeNode(nodeId) {\n var node = getNode(nodeId);\n if (!node) {\n return false;\n }\n\n enterModification();\n\n var prevLinks = node.links;\n if (prevLinks) {\n node.links = null;\n for(var i = 0; i < prevLinks.length; ++i) {\n removeLink(prevLinks[i]);\n }\n }\n\n delete nodes[nodeId];\n nodesCount--;\n\n recordNodeChange(node, 'remove');\n\n exitModification();\n\n return true;\n }\n\n\n function addLink(fromId, toId, data) {\n enterModification();\n\n var fromNode = getNode(fromId) || addNode(fromId);\n var toNode = getNode(toId) || addNode(toId);\n\n var link = createLink(fromId, toId, data);\n\n links.push(link);\n\n // TODO: this is not cool. On large graphs potentially would consume more memory.\n addLinkToNode(fromNode, link);\n if (fromId !== toId) {\n // make sure we are not duplicating links for self-loops\n addLinkToNode(toNode, link);\n }\n\n recordLinkChange(link, 'add');\n\n exitModification();\n\n return link;\n }\n\n function createSingleLink(fromId, toId, data) {\n var linkId = makeLinkId(fromId, toId);\n return new Link(fromId, toId, data, linkId);\n }\n\n function createUniqueLink(fromId, toId, data) {\n // TODO: Get rid of this method.\n var linkId = makeLinkId(fromId, toId);\n var isMultiEdge = multiEdges.hasOwnProperty(linkId);\n if (isMultiEdge || getLink(fromId, toId)) {\n if (!isMultiEdge) {\n multiEdges[linkId] = 0;\n }\n var suffix = '@' + (++multiEdges[linkId]);\n linkId = makeLinkId(fromId + suffix, toId + suffix);\n }\n\n return new Link(fromId, toId, data, linkId);\n }\n\n function getLinks(nodeId) {\n var node = getNode(nodeId);\n return node ? node.links : null;\n }\n\n function removeLink(link) {\n if (!link) {\n return false;\n }\n var idx = indexOfElementInArray(link, links);\n if (idx < 0) {\n return false;\n }\n\n enterModification();\n\n links.splice(idx, 1);\n\n var fromNode = getNode(link.fromId);\n var toNode = getNode(link.toId);\n\n if (fromNode) {\n idx = indexOfElementInArray(link, fromNode.links);\n if (idx >= 0) {\n fromNode.links.splice(idx, 1);\n }\n }\n\n if (toNode) {\n idx = indexOfElementInArray(link, toNode.links);\n if (idx >= 0) {\n toNode.links.splice(idx, 1);\n }\n }\n\n recordLinkChange(link, 'remove');\n\n exitModification();\n\n return true;\n }\n\n function getLink(fromNodeId, toNodeId) {\n // TODO: Use sorted links to speed this up\n var node = getNode(fromNodeId),\n i;\n if (!node || !node.links) {\n return null;\n }\n\n for (i = 0; i < node.links.length; ++i) {\n var link = node.links[i];\n if (link.fromId === fromNodeId && link.toId === toNodeId) {\n return link;\n }\n }\n\n return null; // no link.\n }\n\n function clear() {\n enterModification();\n forEachNode(function(node) {\n removeNode(node.id);\n });\n exitModification();\n }\n\n function forEachLink(callback) {\n var i, length;\n if (typeof callback === 'function') {\n for (i = 0, length = links.length; i < length; ++i) {\n callback(links[i]);\n }\n }\n }\n\n function forEachLinkedNode(nodeId, callback, oriented) {\n var node = getNode(nodeId);\n\n if (node && node.links && typeof callback === 'function') {\n if (oriented) {\n return forEachOrientedLink(node.links, nodeId, callback);\n } else {\n return forEachNonOrientedLink(node.links, nodeId, callback);\n }\n }\n }\n\n function forEachNonOrientedLink(links, nodeId, callback) {\n var quitFast;\n for (var i = 0; i < links.length; ++i) {\n var link = links[i];\n var linkedNodeId = link.fromId === nodeId ? link.toId : link.fromId;\n\n quitFast = callback(nodes[linkedNodeId], link);\n if (quitFast) {\n return true; // Client does not need more iterations. Break now.\n }\n }\n }\n\n function forEachOrientedLink(links, nodeId, callback) {\n var quitFast;\n for (var i = 0; i < links.length; ++i) {\n var link = links[i];\n if (link.fromId === nodeId) {\n quitFast = callback(nodes[link.toId], link);\n if (quitFast) {\n return true; // Client does not need more iterations. Break now.\n }\n }\n }\n }\n\n // we will not fire anything until users of this library explicitly call `on()`\n // method.\n function noop() {}\n\n // Enter, Exit modification allows bulk graph updates without firing events.\n function enterModificationReal() {\n suspendEvents += 1;\n }\n\n function exitModificationReal() {\n suspendEvents -= 1;\n if (suspendEvents === 0 && changes.length > 0) {\n graphPart.fire('changed', changes);\n changes.length = 0;\n }\n }\n\n function createNodeIterator() {\n // Object.keys iterator is 1.3x faster than `for in` loop.\n // See `https://github.com/anvaka/ngraph.graph/tree/bench-for-in-vs-obj-keys`\n // branch for perf test\n return Object.keys ? objectKeysIterator : forInIterator;\n }\n\n function objectKeysIterator(callback) {\n if (typeof callback !== 'function') {\n return;\n }\n\n var keys = Object.keys(nodes);\n for (var i = 0; i < keys.length; ++i) {\n if (callback(nodes[keys[i]])) {\n return true; // client doesn't want to proceed. Return.\n }\n }\n }\n\n function forInIterator(callback) {\n if (typeof callback !== 'function') {\n return;\n }\n var node;\n\n for (node in nodes) {\n if (callback(nodes[node])) {\n return true; // client doesn't want to proceed. Return.\n }\n }\n }\n}" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Display the current flair for all users in the subreddit.
[ "def output_current_flair(self, as_json=False):\n \"\"\"\"\"\"\n flair_list = sorted(self.current_flair(), key=lambda x: x['user'].name)\n if as_json:\n print(json.dumps(flair_list, sort_keys=True, indent=4))\n return\n\n for flair in flair_list:\n print(flair['user'])\n print(' Text: {}\\n CSS: {}'.format(flair['flair_text'],\n flair['flair_css_class']))" ]
[ "def note(id, type, options = {})\n # Welguisz: No idea why this is here, but keeping it here because it follows other blocks\n _notes\n # Create a new note and place it in the notes 2-D Hash\n @_notes[id][type] = Note.new(id, type, options)\n end" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
$ANTLR start "AT"
[ "public final void mAT() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = AT;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:152:4: ( '@' )\n\t\t\t// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:152:6: '@'\n\t\t\t{\n\t\t\tmatch('@'); if (state.failed) return;\n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstate.channel = _channel;\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Rename @param string $path Path @param string $newpath New path @param callable $cb Callback @param integer $pri Priority @return resource|boolean
[ "public static function rename($path, $newpath, $cb = null, $pri = EIO_PRI_DEFAULT)\n {\n $cb = CallbackWrapper::forceWrap($cb);\n if (!self::$supported) {\n $r = rename($path, $newpath);\n if ($cb) {\n $cb($path, $newpath, $r);\n }\n return $r;\n }\n return eio_rename($path, $newpath, $pri, $cb, $path);\n }" ]
[ "protected function help()\n {\n $style = new Style(' *** RUN - HELP ***');\n Out::std($style->color('fg', Style::COLOR_GREEN)->get());\n Out::std('');\n\n $help = new Help('...', true);\n $help->addArgument('', 'color', 'Activate colors (do not activate when redirect output in log file, colors are non-printable chars)', false, false);\n $help->addArgument('', 'debug', 'Activate debug mode (trace on exception if script is terminated with an exception)', false, false);\n $help->addArgument('', 'time-limit', 'Specified time limit in seconds (default: 0 - unlimited)', true, false);\n $help->addArgument('', 'error-reporting', 'Specified value for error-reporting (default: -1 - all)', true, false);\n $help->addArgument('', 'error-display', 'Specified value for display_errors setting. Values: 0|1 Default: 1 (display)', true, false);\n $help->addArgument('', 'quiet', 'Force disabled console lib messages (header, footer, timer...)', false, false);\n $help->addArgument('', 'name', 'Console class script to run (Example: \\Eureka\\Component\\Database\\Console', true, true);\n\n $help->display();\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
XML handler for a closing tag. @param resource $parser the resource handler for the xml parser @param string $name the name of the xml element parsed @return void
[ "protected function endElement($parser, string $name): void\n {\n $method = $name . 'EndHandler';\n\n if (method_exists($this, $method)) {\n $this->$method();\n }\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 post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Returns the metric query service scope for this group. @param filter character filter @return query service scope
[ "public QueryScopeInfo getQueryServiceMetricInfo(CharacterFilter filter) {\n\t\tif (queryServiceScopeInfo == null) {\n\t\t\tqueryServiceScopeInfo = createQueryServiceMetricInfo(filter);\n\t\t}\n\t\treturn queryServiceScopeInfo;\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 Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Returns the count of callbacks still listening to 'this'. This method will perform a hard disconnect if 0 is returned. @param criteria @return
[ "public int removeCallback(IConnectionStateCallback criteria) {\n\t\t \n\t\t List<IConnectionStateCallback> listCallbacks = getConnectionDetail().getConnCallbacks();\n\t\t /**\n\t\t * If this method is about to delete the last callback, then\n\t\t * there are no windows left listening, so it is safe to\n\t\t * do a hard disconnect.\n\t\t */\n\t\t if (listCallbacks.size() <= 1) {\n\t\t\t getConnectionDetail().unHappyDisconnect();\n\t\t\t listCallbacks.remove(criteria);\n\t\t\t \n\t\t\t DefaultConnectionList connList = (DefaultConnectionList) DefaultConnectionList.getSingleton();\n\t\t\t connList.remove(this);\n\t\t\t \n\t\t } else {\n\t\t\t//utter a last dying gasp (DISCONNECTED status) before removing the callback.\n\t\t\t //criteria.setConnectionState(ConnectState.DISCONNECTED);\n\t\t\t //broadcastConnectionState(criteria);\n\t\t\t listCallbacks.remove(criteria);\n\t\t }\n\t\t return listCallbacks.size();\n\t }" ]
[ "def getLockByID(self, lockid):\n \n assert isinstance(lockid, (locks.MasterLock, locks.WorkerLock))\n if lockid not in self.locks:\n self.locks[lockid] = lockid.lockClass(lockid)\n # if the master.cfg file has changed maxCount= on the lock, the next\n # time a build is started, they'll get a new RealLock instance. Note\n # that this requires that MasterLock and WorkerLock (marker) instances\n # be hashable and that they should compare properly.\n return self.locks[lockid]" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Runs the current application. @param InputInterface $input An Input instance @param OutputInterface $output An Output instance @return int 0 if everything went fine, or an error code
[ "public function doRun(InputInterface $input, OutputInterface $output)\n {\n $name = $this->getCommandName($input);\n\n // Did the user enter an environment option?\n if (true === $input->hasParameterOption(['--env', '-e'])) {\n $this->environment = $input->getParameterOption(['--env', '-e']);\n }\n\n // Publishing must be in an environment higher than local\n else {\n if ($name === 'publish') {\n $this->environment = 'production';\n }\n }\n\n // Load config\n $this->config = new Config($this->environment);\n\n // Set local timezone\n date_default_timezone_set($this->getSetting('timezone', 'America/New_York'));\n\n // Set default date format\n Carbon::setToStringFormat($this->config->get('date_format', 'Y-m-d H:i:s'));\n\n // Register events\n $this->registerEvents();\n\n return parent::doRun($input, $output);\n }" ]
[ "public function run()\n {\n $this->requestId = uniqid();\n $this->startTime = microtime();\n\n try {\n // Generate a Request object from the data available in the\n // current running environment.\n try {\n $requestFactory = new Requests\\Factories\\Http;\n $request = $requestFactory->get($this);\n // Set the application locale from the request.\n // TODO: Move into the Request constructor?\n $this->setLocale($request->getLocale());\n // Run the process of responding to the request.\n $this->issueResponse($request);\n } catch (\\Throwable $throwable) {\n // There was an error somewhere during the request\n // creation, or somewhere during the response building\n // process.\n $errorRequest = new Requests\\Http\\Error;\n $errorRequest->setThrowable($throwable);\n $this->issueResponse($errorRequest, $throwable);\n }\n } catch (\\Exception $exception) {\n // There was an error while trying to fail gracefully.\n // Little else can be done now.\n $this->fail($exception);\n }\n\n Logger::get()->info($this->getStats());\n\n // Since the application is being run in an HTTP context, and\n // PHP is the scripting language it is, the application cycle\n // just finishes after the response is done with its tasks.\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Set new merge rule for dataset. Some types are available in basis.data.Dataset.Merge @param {function(count:number, sourceCount:number):boolean|string} rule New rule. @return {Object} Delta of member changes.
[ "function(rule){\n rule = basis.getter(rule || UNION);\n\n if (this.rule !== rule)\n {\n var oldRule = this.rule;\n\n this.rule = rule;\n this.emit_ruleChanged(oldRule);\n\n return this.applyRule();\n }\n }" ]
[ "def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param array|null $params @param array|string|null $options @return \Stripe\File The created resource.
[ "public static function create($params = null, $options = null)\n {\n $opts = \\Stripe\\Util\\RequestOptions::parse($options);\n if (is_null($opts->apiBase)) {\n $opts->apiBase = Stripe::$apiUploadBase;\n }\n // Manually flatten params, otherwise curl's multipart encoder will\n // choke on nested arrays.\n // TODO: use array_column() once we drop support for PHP 5.4\n $flatParams = [];\n foreach (\\Stripe\\Util\\Util::flattenParams($params) as $pair) {\n $flatParams[$pair[0]] = $pair[1];\n }\n return static::_create($flatParams, $opts);\n }" ]
[ "public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes\n {\n return new File($data->getResult(), $logger);\n }" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
/* * Performs a raw Select query given a raw query string */
[ "func (c *Connection) SelectRaw(q string) (*SelectResponse, error) {\n\tresp, err := c.CustomSelectRaw(q, \"select\")\n\treturn resp, err\n}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is likely to be in terms of SQL path. Currently we still don't have support multiple function namespaces, nor\n // SQL path. As a result, session is not used here. We still add this to distinguish the two versions of resolveFunction\n // while the refactoring is on-going.\n return staticFunctionNamespace.resolveFunction(name, parameterTypes);\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Write the given bytes (binary string) into the WebHDFS file from constructor.
[ "def write(self, b):\n \n if self._closed:\n raise ValueError(\"I/O operation on closed file\")\n\n if not isinstance(b, six.binary_type):\n raise TypeError(\"input must be a binary string\")\n\n self.lines.append(b)\n self.chunk_bytes += len(b)\n self.total_size += len(b)\n\n if self.chunk_bytes >= self.min_part_size:\n buff = b\"\".join(self.lines)\n logger.info(\n \"uploading part #%i, %i bytes (total %.3fGB)\",\n self.parts, len(buff), self.total_size / 1024.0 ** 3\n )\n self._upload(buff)\n logger.debug(\"upload of part #%i finished\", self.parts)\n self.parts += 1\n self.lines, self.chunk_bytes = [], 0" ]
[ "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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
保存日志 @return bool
[ "public function save()\n\t{\n\t\t$this->db->begin();\n\t\tforeach($this->data as $item)\n\t\t{\n\t\t\t$this->db->insert($this->tableName,$item);\n\t\t}\n\t\t$this->db->commit();\n\t\treturn true;\n\t}" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the summarization about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
// DisconnectFromNetwork disconnects container from network n.
[ "func (daemon *Daemon) DisconnectFromNetwork(container *container.Container, networkName string, force bool) error {\n\tn, err := daemon.FindNetwork(networkName)\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\tif !container.Running || (err != nil && force) {\n\t\tif container.RemovalInProgress || container.Dead {\n\t\t\treturn errRemovalContainer(container.ID)\n\t\t}\n\t\t// In case networkName is resolved we will use n.Name()\n\t\t// this will cover the case where network id is passed.\n\t\tif n != nil {\n\t\t\tnetworkName = n.Name()\n\t\t}\n\t\tif _, ok := container.NetworkSettings.Networks[networkName]; !ok {\n\t\t\treturn fmt.Errorf(\"container %s is not connected to the network %s\", container.ID, networkName)\n\t\t}\n\t\tdelete(container.NetworkSettings.Networks, networkName)\n\t} else if err == nil {\n\t\tif container.HostConfig.NetworkMode.IsHost() && containertypes.NetworkMode(n.Type()).IsHost() {\n\t\t\treturn runconfig.ErrConflictHostNetwork\n\t\t}\n\n\t\tif err := daemon.disconnectFromNetwork(container, n, false); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\treturn err\n\t}\n\n\tif err := container.CheckpointTo(daemon.containersReplica); err != nil {\n\t\treturn err\n\t}\n\n\tif n != nil {\n\t\tdaemon.LogNetworkEventWithAttributes(n, \"disconnect\", map[string]string{\n\t\t\t\"container\": container.ID,\n\t\t})\n\t}\n\n\treturn nil\n}" ]
[ "function TcpStreamConnect () {\n this.simulator.Debug (3, 'Dispatcher connected to %s:%s', simulator.opts.host, simulator.opts.port);\n ActiveClients[this] = this; // register on remote server in active socket list\n }" ]
codesearchnet
{ "query": "Represent the post about Container management:", "pos": "Represent the code about Container management:", "neg": "Represent the code about Computer Science:" }
Call PayPal to check if IPN request originally from PayPal. @param array $requestData data of request. @return \OxidEsales\PayPalModule\Model\Response\Response
[ "protected function doVerifyWithPayPal($requestData)\n {\n $callerService = $this->getCommunicationService();\n $payPalPayPalRequest = $this->getPayPalRequest();\n foreach ($requestData as $requestParameterName => $requestParameterValue) {\n $payPalPayPalRequest->setParameter($requestParameterName, $requestParameterValue);\n }\n $responseDoVerifyWithPayPal = $callerService->doVerifyWithPayPal($payPalPayPalRequest, $requestData['charset']);\n\n return $responseDoVerifyWithPayPal;\n }" ]
[ "public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Add a piece of data to the view. @param string|array $key @param mixed $value @return \Illuminate\View\View
[ "public function with($key, $value = null)\n {\n if (is_array($key)) {\n return parent::with($this->factory->decorate($key));\n }\n\n return parent::with($key, $this->factory->decorate($value));\n }" ]
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
removeByPath @param array $data @param string $path @param string $separator @return bool
[ "public static function removeByPath(array &$data, $path, $separator = '.')\n {\n $nodes = static::getPathNodes($path, $separator);\n\n if (empty($nodes)) {\n return false;\n }\n\n $previous = null;\n $dataTmp = &$data;\n\n foreach ($nodes as $node) {\n if (is_array($dataTmp)) {\n if (empty($dataTmp[$node])) {\n return false;\n }\n\n $previous = &$dataTmp;\n $dataTmp = &$dataTmp[$node];\n } else {\n return false;\n }\n }\n\n // Now, path go to the end, means we get latest node, set value to this node.\n unset($previous[$node]);\n\n return true;\n }" ]
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n \"on all of the following properties before attempting an insert():\\n> \".implode(\"\\n> \", $missing).\"\\n\");\n }\n\n /** @var self $endpoint */\n $endpoint = self::post($data);\n return $endpoint;\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
Module name of the wrapped function.
[ "def _module_name(self) -> str:\n \"\"\"\"\"\"\n name = self.f.__module__\n if name == '__main__':\n return importer.main_module_name()\n return name" ]
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
single variable or dictionary to xml representation
[ "def var_to_xml(val, name, trim_if_too_big=True, additional_in_xml='', evaluate_full_value=True):\n \n\n type_name, type_qualifier, is_exception_on_eval, resolver, value = get_variable_details(\n val, evaluate_full_value)\n\n try:\n name = quote(name, '/>_= ') # TODO: Fix PY-5834 without using quote\n except:\n pass\n\n xml = '<var name=\"%s\" type=\"%s\" ' % (make_valid_xml_value(name), make_valid_xml_value(type_name))\n\n if type_qualifier:\n xml_qualifier = 'qualifier=\"%s\"' % make_valid_xml_value(type_qualifier)\n else:\n xml_qualifier = ''\n\n if value:\n # cannot be too big... communication may not handle it.\n if len(value) > MAXIMUM_VARIABLE_REPRESENTATION_SIZE and trim_if_too_big:\n value = value[0:MAXIMUM_VARIABLE_REPRESENTATION_SIZE]\n value += '...'\n\n xml_value = ' value=\"%s\"' % (make_valid_xml_value(quote(value, '/>_= ')))\n else:\n xml_value = ''\n\n if is_exception_on_eval:\n xml_container = ' isErrorOnEval=\"True\"'\n else:\n if resolver is not None:\n xml_container = ' isContainer=\"True\"'\n else:\n xml_container = ''\n\n return ''.join((xml, xml_qualifier, xml_value, xml_container, additional_in_xml, ' />\\n'))" ]
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys expected by the\n # objective function\n return objective.run(raw_output, output_files, threads)\n end" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns the absolute integer part of the Real number as a Natural @param RoundingMode $rounding_mode Rounding mode of the conversion. Defaults to RoundingMode::HALF_UP. @return Natural
[ "public function toNatural(RoundingMode $rounding_mode = null)\n {\n $integerValue = $this->toInteger($rounding_mode)->toNative();\n $naturalValue = \\abs($integerValue);\n $natural = new Natural($naturalValue);\n\n return $natural;\n }" ]
[ "public static final Function<Number,Float> toFloat(final int scale, final RoundingMode roundingMode) {\r\n return new ToFloat(scale, roundingMode);\r\n }" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return a FilterChain with Filters for postprocessing the image @return FilterChain|null
[ "public function getFilters()\n {\n if ($this->progressive) {\n $fc = new FilterChain();\n $fc->add(new Interlace(ImageInterface::INTERLACE_PLANE));\n return $fc;\n } else {\n return null;\n }\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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Register application with dispatcher
[ "def registerContextEngineId(self, contextEngineId, pduTypes, processPdu):\n \"\"\"\"\"\"\n # 4.3.2 -> no-op\n\n # 4.3.3\n for pduType in pduTypes:\n k = contextEngineId, pduType\n if k in self._appsRegistration:\n raise error.ProtocolError(\n 'Duplicate registration %r/%s' % (contextEngineId, pduType))\n\n # 4.3.4\n self._appsRegistration[k] = processPdu\n\n debug.logger & debug.FLAG_DSP and debug.logger(\n 'registerContextEngineId: contextEngineId %r pduTypes '\n '%s' % (contextEngineId, pduTypes))" ]
[ "@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:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }