query
stringlengths 16
255
| pos
list | neg
list | task
stringclasses 1
value | instruction
dict |
|---|---|---|---|---|
// acquireChan wraps a signal chan with a func that can be used with rateLimit.
// should only be called by rate limiting funcs (that implement deadlock avoidance).
|
[
"func acquireChan(tokenCh <-chan struct{}) func(context.Context, bool) bool {\n\tif tokenCh == nil {\n\t\t// always false: acquire never succeeds; panic if told to block (to avoid deadlock)\n\t\treturn func(ctx context.Context, block bool) bool {\n\t\t\tif block {\n\t\t\t\tselect {\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\tdefault:\n\t\t\t\t\tpanic(\"deadlock detected: block should never be true when the token chan is nil\")\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}\n\treturn func(ctx context.Context, block bool) bool {\n\t\tif block {\n\t\t\tselect {\n\t\t\tcase <-tokenCh:\n\t\t\t\t// tie breaker prefers Done\n\t\t\t\tselect {\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\tdefault:\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\tcase <-ctx.Done():\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tselect {\n\t\tcase <-tokenCh:\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n}"
] |
[
"func (dbcr *DiskBlockCacheRemote) DoesCacheHaveSpace(\n\t_ context.Context, _ DiskBlockCacheType) (bool, error) {\n\t// We won't be kicking off long syncing prefetching via the remote\n\t// cache, so just pretend the cache has space.\n\treturn true, nil\n}"
] |
codesearchnet
|
{
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
}
|
Collects garbage - removes files from the file system.
@return \Zend\Stdlib\ResponseInterface
|
[
"public function collectAction()\n {\n // @todo json\n $service = $this->getGarbageCollector();\n if ($service->collect()) {\n return $this->redirect()->toRoute('sc-admin/content-manager');\n }\n return $this->redirect()\n ->toRoute(\n 'sc-admin/file/delete',\n ['random' => Stdlib::randomKey(6)]\n )\n ->setStatusCode(303);\n }"
] |
[
"public function close()\n {\n $this->started = false;\n \n \\Wslim\\Ioc::logger('session')->debug(sprintf('[%s]close', static::getId()));\n }"
] |
codesearchnet
|
{
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
}
|
// Str2JSType extract a JavaScript type from a string
|
[
"func Str2JSType(s string) JSType {\n\tvar (\n\t\toutput JSType\n\t)\n\ts = strings.TrimSpace(s) // santize the given string\n\tswitch {\n\tcase isBool(s):\n\t\toutput = Bool\n\tcase isFloat(s):\n\t\toutput = Float\n\tcase isInt(s):\n\t\toutput = Int\n\tcase isNull(s):\n\t\toutput = Null\n\tdefault:\n\t\toutput = String // if all alternatives have been eliminated, the input is a string\n\t}\n\treturn output\n}"
] |
[
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] |
codesearchnet
|
{
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
}
|
The parser fires this each time one path has been parsed
@param string $path xml path which parsing has ended
|
[
"public function after_path($path) {\n $toprocess = false;\n // If the path being closed matches (same or parent) the first path in the stack\n // we process pending startend notifications until one matching end is found\n if ($element = reset($this->startendinfo)) {\n $elepath = $element['path'];\n $eleaction = $element['action'];\n if (strpos($elepath, $path) === 0) {\n $toprocess = true;\n }\n\n // Also, if the stack of startend notifications is empty, we can process current end\n // path safely\n } else {\n $toprocess = true;\n }\n if ($this->path_is_selected($path)) {\n $this->startendinfo[] = array('path' => $path, 'action' => 'end');\n }\n // Send all the pending startend notifications if decided to do so\n if ($toprocess) {\n $this->process_pending_startend_notifications($path, 'end');\n }\n }"
] |
[
"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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
}
|
// sendCommand is an auxiliary function to send commands to the AIP1640Driver module
|
[
"func (a *AIP1640Driver) sendCommand(cmd byte) {\n\ta.pinData.Off()\n\ta.send(cmd)\n\ta.pinData.On()\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
}
|
// MULTI-SOURCE - Type D: copy([](f|d...), d) -> []B
// prepareCopyURLsTypeE - prepares target and source clientURLs for copying.
|
[
"func prepareCopyURLsTypeD(sourceURLs []string, targetURL string, isRecursive bool, encKeyDB map[string][]prefixSSEPair) <-chan URLs {\n\tcopyURLsCh := make(chan URLs)\n\tgo func(sourceURLs []string, targetURL string, copyURLsCh chan URLs) {\n\t\tdefer close(copyURLsCh)\n\t\tfor _, sourceURL := range sourceURLs {\n\t\t\tfor cpURLs := range prepareCopyURLsTypeC(sourceURL, targetURL, isRecursive, encKeyDB) {\n\t\t\t\tcopyURLsCh <- cpURLs\n\t\t\t}\n\t\t}\n\t}(sourceURLs, targetURL, copyURLsCh)\n\treturn copyURLsCh\n}"
] |
[
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] |
codesearchnet
|
{
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
}
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceStrategyOptions.
|
[
"func (in *SourceStrategyOptions) DeepCopy() *SourceStrategyOptions {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(SourceStrategyOptions)\n\tin.DeepCopyInto(out)\n\treturn out\n}"
] |
[
"func (resource *Bundle) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Bundle\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Bundle), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*resource)\n}"
] |
codesearchnet
|
{
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
}
|
/*
$order array of the fields and the order
|
[
"public function selectAll($where=false, $order=false, $limit=false) {\n $clause = false;\n $values = array();\n if ( is_array($where) ) {\n $retval = self::extractWhere($where, $clause, $values);\n if ( is_string($retval) ) throw new \\Exception($val);\n }\n $orderby = '';\n if ( is_string($order) ) {\n $orderby = self::extractOrder($order);\n if ( $orderby === false ) throw new \\Exception('Invalid Order value');\n }\n\n $sql = \"SELECT KVS.id AS id, json_body, KVS.created_at, KVS.updated_at\n FROM $this->KVS_TABLE AS KVS\n WHERE $this->KVS_FK_NAME = :foreign_key\";\n if ( $clause ) $sql .= ' AND '.$clause;\n if ( $orderby ) $sql .= ' '.$orderby;\n $values[':foreign_key'] = $this->KVS_FK;\n $rows = $this->PDOX->allRowsDie($sql, $values);\n return $rows;\n }"
] |
[
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated document for the core of the topic search\n return schema"
] |
codesearchnet
|
{
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
}
|
Write current root class hierarchy with resolved generics.
Use custom writer to modify type rendering (on each line).
@param typeWriter custom type writer
@return current hierarchy with resolved generics
|
[
"public String toStringHierarchy(final TypeWriter typeWriter) {\n final StringBuilder res = new StringBuilder(types.size() * 50);\n writeHierarchy(root, \"\", \"\", res, typeWriter);\n return res.toString();\n }"
] |
[
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] |
codesearchnet
|
{
"query": "Represent the instruction about writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code about programming:"
}
|
Start application.
|
[
"def main(args=None):\n \"\"\"\"\"\"\n parser = _parser()\n\n # Python 2 will error 'too few arguments' if no subcommand is supplied.\n # No such error occurs in Python 3, which makes it feasible to check\n # whether a subcommand was provided (displaying a help message if not).\n # argparse internals vary significantly over the major versions, so it's\n # much easier to just override the args passed to it. In this case, print\n # the usage message if there are no args.\n if args is None and len(sys.argv) <= 1:\n sys.argv.append('--help')\n\n options = parser.parse_args(args)\n\n # pass options to subcommand\n options.func(options)\n\n return 0"
] |
[
"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:"
}
|
Displace this atom in place
|
[
"def displace!(x,y,z)\n self.x += x\n self.y += y\n self.z += z\n end"
] |
[
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
}
|
--------------------------------------------------------- private functions /* get message or service definition class
|
[
"function getMessageFromPackage(messageType, type, callback) {\n var packageName = getPackageNameFromMessageType(messageType);\n var messageName = getMessageNameFromMessageType(messageType);\n packages.findPackage(packageName, function(error, directory) {\n var filePath;\n filePath = path.join(directory, type, messageName + '.' + type);\n getMessageFromFile(messageType, filePath, type, callback);\n });\n}"
] |
[
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] |
codesearchnet
|
{
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
}
|
Figure out the sections in drbdadm status
|
[
"def _analyse_status_type(line):\n '''\n \n '''\n spaces = _count_spaces_startswith(line)\n\n if spaces is None:\n return ''\n\n switch = {\n 0: 'RESOURCE',\n 2: {' disk:': 'LOCALDISK', ' role:': 'PEERNODE', ' connection:': 'PEERNODE'},\n 4: {' peer-disk:': 'PEERDISK'}\n }\n\n ret = switch.get(spaces, 'UNKNOWN')\n\n # isinstance(ret, str) only works when run directly, calling need unicode(six)\n if isinstance(ret, six.text_type):\n return ret\n\n for x in ret:\n if x in line:\n return ret[x]\n\n return 'UNKNOWN'"
] |
[
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from\n # the instackenv.json, BUT it may be interesting to add a check.\n return ret.split()"
] |
codesearchnet
|
{
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
}
|
Build the client from a dsn
Examples:
udp+influxdb://username:pass@localhost:4444/databasename
@param string $dsn
@return Client|Database
@throws ClientException
|
[
"public static function fromDSN($dsn)\n {\n $connParams = parse_url($dsn);\n $schemeInfo = explode('+', $connParams['scheme']);\n $modifier = null;\n $scheme = $schemeInfo[0];\n $dbName = isset($connParams['path']) ? substr($connParams['path'], 1) : null;\n\n if (isset($schemeInfo[1])) {\n $modifier = strtolower($schemeInfo[0]);\n $scheme = $schemeInfo[1];\n }\n\n if ($scheme != 'influxdb') {\n throw new ClientException($scheme . ' is not a valid scheme');\n }\n\n if (!in_array($modifier, ['udp'])) {\n throw new ClientException(sprintf(\"%s modifier specified in DSN is not supported\", $modifier));\n }\n\n $driver = null;\n // set the UDP driver when the DSN specifies UDP\n if ($modifier == 'udp') {\n $driver = new UDP($connParams['host'], $connParams['port']);\n }\n\n $client = new self($driver);\n return ($dbName ? $client->selectDB($dbName) : $client);\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
}
|
@param InputInterface $input
@param OutputInterface $output
@return bool|int|null
|
[
"protected function execute(InputInterface $input, OutputInterface $output)\n {\n $this->init($input);\n $function = $input->getArgument('function');\n $idChart = $input->getOption('idChart');\n\n switch ($function) {\n case 'maj-player':\n if ($idChart) {\n $chart = $this->doctrine->getRepository('VideoGamesRecordsCoreBundle:Chart')->find($idChart);\n $this->updateCharts([$chart]);\n } else {\n $this->majPlayer($output);\n }\n break;\n }\n $this->end($output);\n\n return true;\n }"
] |
[
"public function file(string $path, string $md5)\n {\n //==============================================================================\n // Create Event Object\n $event = new ObjectFileEvent($this->getWebserviceId(), $path, $md5);\n //==============================================================================\n // Dispatch Event\n /** @var ObjectFileEvent $response */\n $response = $this->getEventDispatcher()->dispatch(ObjectFileEvent::NAME, $event);\n\n return $response->getContents();\n }"
] |
codesearchnet
|
{
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
}
|
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
[
"@XmlElementDecl(namespace = \"http://www.drugbank.ca\", name = \"rs-id\", scope = SnpAdverseDrugReactionType.class)\n public JAXBElement<String> createSnpAdverseDrugReactionTypeRsId(String value) {\n return new JAXBElement<String>(_SnpAdverseDrugReactionTypeRsId_QNAME, String.class, SnpAdverseDrugReactionType.class, value);\n }"
] |
[
"@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\n }"
] |
codesearchnet
|
{
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
}
|
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated
|
[
"public EClass getGCBEZ() {\n\t\tif (gcbezEClass == null) {\n\t\t\tgcbezEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(488);\n\t\t}\n\t\treturn gcbezEClass;\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 comment about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
}
|
Get a firmware image with provided image_id.
:param str image_id: The firmware ID for the image to retrieve (Required)
:return: FirmwareImage
|
[
"def get_firmware_image(self, image_id):\n \n api = self._get_api(update_service.DefaultApi)\n return FirmwareImage(api.firmware_image_retrieve(image_id))"
] |
[
"def spec(self):\n \"\"\"\"\"\"\n from ambry_sources.sources import SourceSpec\n\n d = self.dict\n d['url'] = self.url\n\n # Will get the URL twice; once as ref and once as URL, but the ref is ignored\n\n return SourceSpec(**d)"
] |
codesearchnet
|
{
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
}
|
/* (non-Javadoc)
@see com.ibm.ws.sib.processor.runtime.SIMPTopicSpaceControllable#deleteLocalSubscriptionControlByID(java.lang.String)
|
[
"public void deleteLocalSubscriptionControlByID(String id) \n throws SIMPInvalidRuntimeIDException, SIMPControllableNotFoundException, SIMPException, \n SIDurableSubscriptionNotFoundException, SIDestinationLockedException, SIResourceException, SIIncorrectCallException\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(tc, \"deleteLocalSubscriptionControlByID\", id);\n \n assertMessageHandlerNotCorrupt();\n\n ControllableSubscription sub = getSubscription(id);\n\n if (!sub.isDurable())\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.exit(\n tc,\n \"deleteLocalSubscriptionControlByID\",\n \"SIMPIncorrectCallException\");\n \n throw new SIMPIncorrectCallException(\n nls.getFormattedMessage(\n \"SUBSCRIPTION_DELETE_ERROR_CWSIP0272\",\n new Object[]{id},\n null)); \n }\n \n HashMap durableSubs = destinationManager.getDurableSubscriptionsTable(); \n\n synchronized (durableSubs)\n {\n // Look up the consumer dispatcher for this subId in the system durable subs list\n ConsumerDispatcher cd = \n (ConsumerDispatcher) durableSubs.get(sub.getConsumerDispatcherState().getSubscriberID());\n \n // Does the subscription exist, if it doesn't, throw a \n // SIDestinationNotFoundException\n if (cd == null)\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) \n SibTr.exit(tc, \"deleteSubscription\", \"SIMPControllableNotFoundException\");\n \n throw new SIMPControllableNotFoundException( \n nls.getFormattedMessage(\n \"SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0146\",\n new Object[] { sub.getConsumerDispatcherState().getSubscriberID(),\n messageProcessor.getMessagingEngineName() },\n null));\n } \n\n // Obtain the destination from the queueing points\n DestinationHandler destination = cd.getDestination();\n\n // Call the deleteDurableSubscription method on the destination\n // NOTE: this assumes the durable subscription is always local\n destination.deleteDurableSubscription(sub.getConsumerDispatcherState().getSubscriberID(), \n messageProcessor.getMessagingEngineName());\n }\n\n \n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.exit(tc, \"deleteLocalSubscriptionControlByID\");\n }"
] |
[
"protected InvokerExtensionProcessor getInvokerExtensionProcessor(com.ibm.ws.webcontainer.webapp.WebApp app)\n {\n return new com.ibm.ws.webcontainer.osgi.extension.InvokerExtensionProcessor(app, config.getInvokerAttributes());\n }"
] |
codesearchnet
|
{
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
}
|
使用账号密码方式登录授权
@param string $username 用户名
@param string $password 密码
@return void
|
[
"public function login($username, $password)\n\t{\n\t\t$response = $this->http->get($this->getUrl('oauth2/access_token'), array(\n\t\t\t'grant_type'\t=>\t'password ',\n\t\t\t'username'\t\t=>\t$username,\n\t\t\t'password'\t\t=>\t$password,\n\t\t\t'client_id'\t\t=>\t$this->appid,\n\t\t\t'client_secret'\t=>\t$this->appSecret,\n\t\t));\n\t\t$this->result = $response->json(true);\n\t\tif(!isset($this->result['error_code']))\n\t\t{\n\t\t\treturn $this->accessToken = $this->result['access_token'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new ApiException(isset($this->result['error']) ? $this->result['error'] : '', $this->result['error_code']);\n\t\t}\n\t}"
] |
[
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城市\tString\t用户注册时填写的城市, 如果没有数据的时候不会返回该数据,请做好容错\t可空\t杭州\n gender\t用户性别\tString\tM为男性,F为女性, 如果没有数据的时候不会返回该数据,请做好容错\t可空\tM\n user_type_value\t用户类型\tString\t(1/2),1代表公司账户;2代表个人账户\t不可空\t1\n is_licence_auth\t是否经过营业执照认证\tString\tT为通过营业执照认证,F为没有通过\t不可空\tT\n is_certified\t是否通过实名认证\tString\tT是通过;F是没有实名认证\t不可空\tF\n is_certify_grade_a\t是否A类认证\tString\tT表示是A类认证,F表示非A类认证,A类认证用户是指上传过身份证照片并且通过审核的支付宝用户\t不可空\tT\n is_student_certified\t是否是学生\tString\tT表示是学生,F表示不是学生\t不可空\tT\n is_bank_auth\t是否经过银行卡认证\tString\tT为经过银行卡认证,F为未经过银行卡认证\t不可空\tT\n is_mobile_auth\t是否经过手机认证\tString\tT为经过手机认证,F为未经过手机认证\t不可空\tT\n alipay_user_id\t当前用户的userId\tString\t支付宝用户的userId\t不可空\t2088411964574197\n user_id\t已废弃,请勿使用\tString\t已废弃,请勿使用\t不可空\t已废弃,请勿使用\n user_status\t用户状态(Q/T/B/W)\tString\tQ代表快速注册用户;T代表已认证用户;B代表被冻结账户;W代表已注册,未激活的账户\t不可空\tT\n is_id_auth\t是否身份证认证\tString\tT为是身份证认证,F为非身份证认证\t不可空\tT\n */\n $user = (new OAuth())->info($this->get('access_token'));\n if (!is_array($user) || $user['code'] != 10000) {\n return false;\n }\n $user['username'] = $user['nick_name'];\n $user['sex'] = $user['gender'];\n $this->set($user);\n return $user;\n }"
] |
codesearchnet
|
{
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
}
|
Automatically generated run method
@param Request $request
@return Response
|
[
"public function run(Request $request) {\n\t\t$id = $this->getParam('id');\n\t\t$sport = SportQuery::create()\n\t\t\t->leftJoinGroup()\n\t\t\t->leftJoinSkill()\n\t\t\t->findOneById($id);\n\n\t\t$pictures = PictureQuery::create()\n\t\t\t->useSkillQuery()\n\t\t\t\t->filterBySportId($id)\n\t\t\t->endUse()\n\t\t\t->count();\n\n\t\t$videos = VideoQuery::create()\n\t\t\t->useSkillQuery()\n\t\t\t\t->filterBySportId($id)\n\t\t\t->endUse()\n\t\t\t->count();\n\n\t\t$references = ReferenceQuery::create()\n\t\t\t->useSkillReferenceQuery()\n\t\t\t\t->useSkillQuery()\n\t\t\t\t\t->filterBySportId($id)\n\t\t\t\t->endUse()\n\t\t\t->endUse()\n\t\t\t->count();\n\n\t\t$statistics = [\n\t\t\t'skills' => $sport->countSkills(),\n\t\t\t'groups' => $sport->countGroups(),\n\t\t\t'pictures' => $pictures,\n\t\t\t'videos' => $videos,\n\t\t\t'references' => $references\n\t\t];\n\n\t\treturn $this->responder->run($request, new Blank($statistics));\n\t}"
] |
[
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] |
codesearchnet
|
{
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
}
|
把资源存放到当前上下文
@param IPoolResource $resource
@return void
|
[
"private static function pushResourceToRequestContext(IPoolResource $resource)\n {\n $poolResources = RequestContext::get('poolResources', []);\n $instance = $resource->getInstance();\n $poolResources[spl_object_hash($instance)] = $resource;\n RequestContext::set('poolResources', $poolResources);\n }"
] |
[
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] |
codesearchnet
|
{
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
}
|
Emit an alert monitor.down, which is in the OK state.
@param ctx Rule evaluation context.
|
[
"@Override\n public void transform(Context<MutableTimeSeriesCollectionPair> ctx) {\n DateTime now = ctx.getTSData().getCurrentCollection().getTimestamp();\n\n ctx.getTSData().getCurrentCollection().addMetrics(MONITOR_GROUP, get_metrics_(now, ctx));\n\n ctx.getAlertManager().accept(new Alert(now, MONITOR_DOWN_ALERT, () -> \"builtin rule\", Optional.of(false), Duration.ZERO, \"builtin rule: monitor is not running for some time\", EMPTY_MAP));\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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
}
|
MySQL SELECT Query/Statement.
@param string $table
@param array $column
@param array $arrayWhere
@param string $other
@return self type: array/error
|
[
"public function select($table = '', $column = [], $arrayWhere = [], $other = '')\n {\n // handle column array data\n if (!is_array($column)) {\n $column = [];\n }\n // get field if pass otherwise use *\n $sField = count($column) > 0 ? implode(', ', $column) : '*';\n // check if table name not empty\n if (!empty($table)) {\n // if more then 0 array found in where array\n if (count($arrayWhere) > 0 && is_array($arrayWhere)) {\n // set class where array\n $this->data = $arrayWhere;\n // parse where array and get in temp var with key name and val\n if (strstr(key($arrayWhere), ' ')) {\n $tmp = $this->customWhere($this->data);\n // get where syntax with namespace\n $where = $tmp['where'];\n } else {\n $tmp = [];\n foreach ($arrayWhere as $k => $v) {\n $tmp[] = \"$k = :s_$k\";\n }\n // join temp array with AND condition\n $where = implode(' AND ', $tmp);\n }\n // unset temp var\n unset($tmp);\n // set class sql property\n $this->sql = \"SELECT $sField FROM `$table` WHERE $where $other;\";\n } else {\n $this->sql = \"SELECT $sField FROM `$table` $other;\"; // if no where condition pass by user\n }\n\n // pdo prepare statement with sql query\n $this->STH = $this->prepare($this->sql);\n // if where condition has valid array number\n\n if (count($arrayWhere) > 0 && is_array($arrayWhere)) {\n $this->_bindPdoNameSpace($arrayWhere); // bind pdo param\n }\n\n // use try catch block to get pdo error\n try {\n // check if pdo execute\n if ($this->STH->execute()) {\n // set class property with affected rows\n $this->affectedRows = $this->STH->rowCount();\n // set class property with sql result\n $this->results = $this->STH->fetchAll();\n // close pdo\n $this->STH->closeCursor();\n // return self object\n return $this;\n } else {\n self::error($this->STH->errorInfo()); // catch pdo error\n }\n } catch (\\PDOException $e) {\n // get pdo error and pass on error method\n self::error($e->getMessage() . ': ' . __LINE__);\n } // end try catch block to get pdo error\n } else { // if table name empty\n self::error('Table name not found..');\n }\n }"
] |
[
"public static function MakeInsertRow (array $merge_row = [], $forced_obtain = false, $options = []) {\n\t\t$options += $options + static::GetDefaultOptions();\n\t\treturn DBI::MakeInsertRow($options, static::GetName(), $merge_row, $forced_obtain);\n\t}"
] |
codesearchnet
|
{
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
}
|
Is required to repaint the control or its snippet?
@param string snippet name
@return bool
|
[
"public function isControlInvalid($snippet = NULL)\n\t{\n\t\tif ($snippet === NULL) {\n\t\t\tif (count($this->invalidSnippets) > 0) {\n\t\t\t\treturn TRUE;\n\n\t\t\t} else {\n\t\t\t\t$queue = [$this];\n\t\t\t\tdo {\n\t\t\t\t\tforeach (array_shift($queue)->getComponents() as $component) {\n\t\t\t\t\t\tif ($component instanceof IRenderable) {\n\t\t\t\t\t\t\tif ($component->isControlInvalid()) {\n\t\t\t\t\t\t\t\t// $this->invalidSnippets['__child'] = TRUE; // as cache\n\t\t\t\t\t\t\t\treturn TRUE;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ($component instanceof Nette\\ComponentModel\\IContainer) {\n\t\t\t\t\t\t\t$queue[] = $component;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} while ($queue);\n\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t} elseif (isset($this->invalidSnippets[$snippet])) {\n\t\t\treturn $this->invalidSnippets[$snippet];\n\t\t} else {\n\t\t\treturn isset($this->invalidSnippets[\"\\0\"]);\n\t\t}\n\t}"
] |
[
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] |
codesearchnet
|
{
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
}
|
This method removes the option-bar widget from DOM and re-attaches it at it's original position.<p>
Use to avoid mouse-over and mouse-down malfunction.<p>
|
[
"private void resetOptionbar() {\n\n if (m_elementOptionBar != null) {\n if (getWidgetIndex(m_elementOptionBar) >= 0) {\n m_elementOptionBar.removeFromParent();\n }\n updateOptionBarPosition();\n insert(m_elementOptionBar, 0);\n }\n }"
] |
[
"public void discardHeaderClick(ClickEvent event) {\n if (event == null) return;\n\n // Example: we use radioset on collapsible header, so stopPropagation() is needed\n // to suppress collapsible open/close behavior.\n // But preventDefault() is not needed, otherwise radios won't switch.\n // event.preventDefault(); // For example, clicked anchors will not take the browser to a new URL\n\n event.stopPropagation();\n makeHeaderInactive(header.getElement());\n }"
] |
codesearchnet
|
{
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
}
|
// GetBucketNotification - get bucket notification at a given path.
|
[
"func (c Client) GetBucketNotification(bucketName string) (bucketNotification BucketNotification, err error) {\n\t// Input validation.\n\tif err := s3utils.CheckValidBucketName(bucketName); err != nil {\n\t\treturn BucketNotification{}, err\n\t}\n\tnotification, err := c.getBucketNotification(bucketName)\n\tif err != nil {\n\t\treturn BucketNotification{}, err\n\t}\n\treturn notification, nil\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 text about AWS S3:",
"pos": "Represent the code about AWS S3:",
"neg": "Represent the code about Programming:"
}
|
Get the documentation name.
@return string
|
[
"protected function getDocName()\n {\n $name = $this->option('name') ?: $this->name;\n\n if (! $name) {\n $this->comment('A name for the documentation was not supplied. Use the --name option or set a default in the configuration.');\n\n exit;\n }\n\n return $name;\n }"
] |
[
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] |
codesearchnet
|
{
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
}
|
run all patterns in the playbook
|
[
"def run(self):\n ''' '''\n plays = []\n matched_tags_all = set()\n unmatched_tags_all = set()\n\n # loop through all patterns and run them\n self.callbacks.on_start()\n for (play_ds, play_basedir) in zip(self.playbook, self.play_basedirs):\n play = Play(self, play_ds, play_basedir)\n matched_tags, unmatched_tags = play.compare_tags(self.only_tags)\n matched_tags_all = matched_tags_all | matched_tags\n unmatched_tags_all = unmatched_tags_all | unmatched_tags\n\n # if we have matched_tags, the play must be run.\n # if the play contains no tasks, assume we just want to gather facts\n if (len(matched_tags) > 0 or len(play.tasks()) == 0):\n plays.append(play)\n\n # if the playbook is invoked with --tags that don't exist at all in the playbooks\n # then we need to raise an error so that the user can correct the arguments.\n unknown_tags = set(self.only_tags) - (matched_tags_all | unmatched_tags_all)\n unknown_tags.discard('all')\n\n if len(unknown_tags) > 0:\n unmatched_tags_all.discard('all')\n msg = 'tag(s) not found in playbook: %s. possible values: %s'\n unknown = ','.join(sorted(unknown_tags))\n unmatched = ','.join(sorted(unmatched_tags_all))\n raise errors.AnsibleError(msg % (unknown, unmatched))\n\n for play in plays:\n if not self._run_play(play):\n break\n\n # summarize the results\n results = {}\n for host in self.stats.processed.keys():\n results[host] = self.stats.summarize(host)\n return results"
] |
[
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from\n # the instackenv.json, BUT it may be interesting to add a check.\n return ret.split()"
] |
codesearchnet
|
{
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
}
|
Calls jsonrpc service's method and returns its return value in a JSON
string or None if there is none.
Arguments:
jsondata -- remote method call in jsonrpc format
|
[
"def call(self, jsondata):\n \n result = yield self.call_py(jsondata)\n if result is None:\n defer.returnValue(None)\n else:\n defer.returnValue(json.dumps(result))"
] |
[
"def coerce_one(schema=str):\n \n def validate(val):\n \"\"\"Unpack a single item from the inputs sequence and run validation.\n\n NOTE(larsbutler): This code is highly opinionated for bottle, since\n bottle query params are wrapped in a list, even if there is just a\n single value for a given parameter.\n \"\"\"\n [value] = val\n return volup.Coerce(schema)(value)\n return validate"
] |
codesearchnet
|
{
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
}
|
// RemoveAllBlocksForController removes all the blocks for the controller.
// It does not prevent new blocks from being added during / after
// removal.
|
[
"func (st *State) RemoveAllBlocksForController() error {\n\tblocks, err := st.AllBlocksForController()\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\n\tops := []txn.Op{}\n\tfor _, blk := range blocks {\n\t\tops = append(ops, txn.Op{\n\t\t\tC: blocksC,\n\t\t\tId: blk.Id(),\n\t\t\tRemove: true,\n\t\t})\n\t}\n\n\t// Use runRawTransaction as we might be removing docs across\n\t// multiple models.\n\treturn st.runRawTransaction(ops)\n}"
] |
[
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] |
codesearchnet
|
{
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
}
|
/*
(non-Javadoc)
@see org.mobicents.isup.messages.ISUPMessage#decodeOptionalBody(byte[], byte)
|
[
"protected void decodeOptionalBody(ISUPParameterFactory parameterFactory, byte[] parameterBody, byte parameterCode)\n throws ParameterException {\n\n switch (parameterCode & 0xFF) {\n case CauseIndicators._PARAMETER_CODE:\n CauseIndicators cpn = parameterFactory.createCauseIndicators();\n ((AbstractISUPParameter) cpn).decode(parameterBody);\n this.setCauseIndicators(cpn);\n break;\n default:\n throw new ParameterException(\"Unrecognized parameter index for optional part: \" + parameterCode);\n }\n\n }"
] |
[
"protected void sendMergeResponse(Address sender, View view, Digest digest, MergeId merge_id) {\n Message msg=new Message(sender).setBuffer(GMS.marshal(view, digest)).setFlag(Message.Flag.OOB,Message.Flag.INTERNAL)\n .putHeader(gms.getId(), new GMS.GmsHeader(GMS.GmsHeader.MERGE_RSP).mergeId(merge_id));\n gms.getDownProtocol().down(msg);\n }"
] |
codesearchnet
|
{
"query": "Represent the instruction about Java programming:",
"pos": "Represent the code about Java programming:",
"neg": "Represent the code:"
}
|
handle layout command
|
[
"def cmd_layout(self, args):\n ''''''\n from MAVProxy.modules.lib import win_layout\n if len(args) < 1:\n print(\"usage: layout <save|load>\")\n return\n if args[0] == \"load\":\n win_layout.load_layout(self.mpstate.settings.vehicle_name)\n elif args[0] == \"save\":\n win_layout.save_layout(self.mpstate.settings.vehicle_name)"
] |
[
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
}
|
Get the filename and key of the config name
@param $name
@return array
|
[
"public function getInfo($name)\n {\n $keys = explode('.', $name);\n if (is_array($keys)) {\n $file = array_shift($keys);\n $key = implode('.', $keys);\n } else {\n $file = $name;\n $key = null;\n }\n\n return ['file' => $file, 'key' => $key];\n }"
] |
[
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] |
codesearchnet
|
{
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
}
|
// SetOptions sets the Options field's value.
|
[
"func (s *IndexFieldStatus) SetOptions(v *IndexField) *IndexFieldStatus {\n\ts.Options = 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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
}
|
Checks if a logged event is to be muted for debugging purposes.
Also goes through the solo list - only items in there will be logged!
:param what:
:return:
|
[
"def is_muted(what):\n \n\n state = False\n\n for item in solo:\n if item not in what:\n state = True\n else:\n state = False\n break\n\n for item in mute:\n if item in what:\n state = True\n break\n\n return state"
] |
[
"def is_active(self):\n \n if not self._multiplexer:\n return False\n\n if self._index_cached is not None:\n # If we already have computed the index, use it to determine whether\n # the plugin should be active, and if so, return immediately.\n if any(self._index_cached.values()):\n return True\n\n if self._multiplexer.PluginRunToTagToContent(metadata.PLUGIN_NAME):\n # Text data is present in the multiplexer. No need to further check for\n # data stored via the outdated plugin assets method.\n return True\n\n # We haven't conclusively determined if the plugin should be active. Launch\n # a thread to compute index_impl() and return False to avoid blocking.\n self._maybe_launch_index_impl_thread()\n\n return False"
] |
codesearchnet
|
{
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
}
|
// Validate inspects the fields of the type to determine if they are valid.
|
[
"func (s *JobOperation) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"JobOperation\"}\n\tif s.LambdaInvoke != nil {\n\t\tif err := s.LambdaInvoke.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"LambdaInvoke\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.S3PutObjectAcl != nil {\n\t\tif err := s.S3PutObjectAcl.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"S3PutObjectAcl\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.S3PutObjectCopy != nil {\n\t\tif err := s.S3PutObjectCopy.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"S3PutObjectCopy\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.S3PutObjectTagging != nil {\n\t\tif err := s.S3PutObjectTagging.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"S3PutObjectTagging\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
}
|
Differential cross section
dsigma/dEg = Amax(Tp) * F(Tp,Egamma)
|
[
"def _diffsigma(self, Ep, Egamma):\n \n Tp = Ep - self._m_p\n\n diffsigma = self._Amax(Tp) * self._F(Tp, Egamma)\n\n if self.nuclear_enhancement:\n diffsigma *= self._nuclear_factor(Tp)\n\n return diffsigma"
] |
[
"def plogdet(K):\n \n \"\"\"\n egvals = eigvalsh(K)\n return npsum(log(egvals[egvals > epsilon]))"
] |
codesearchnet
|
{
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
}
|
// MarshalBinary implements encoding BinaryMarshaler interface
|
[
"func (l *Locale) MarshalBinary() ([]byte, error) {\n\tobj := new(LocaleEncoding)\n\tobj.DefaultDomain = l.defaultDomain\n\tobj.Domains = make(map[string][]byte)\n\tfor k, v := range l.Domains {\n\t\tvar err error\n\t\tobj.Domains[k], err = v.MarshalBinary()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tobj.Lang = l.lang\n\tobj.Path = l.path\n\n\tvar buff bytes.Buffer\n\tencoder := gob.NewEncoder(&buff)\n\terr := encoder.Encode(obj)\n\n\treturn buff.Bytes(), err\n}"
] |
[
"func (pl *Payload) Decode(data []byte) error {\n\t// Note that this method can't be named UnmarshalBinary, because the gob encoder would call\n\t// this method, resulting in infinite recursion.\n\treturn pl.ReadBinary(bytes.NewBuffer(data))\n}"
] |
codesearchnet
|
{
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
}
|
Function to publish staging or prod version from local tree,
or to promote staging to prod, per passed arg.
@param {string} pubScope the scope to publish to.
|
[
"function mdlPublish(pubScope) {\n let cacheTtl = null;\n let src = null;\n let dest = null;\n\n if (pubScope === 'staging') {\n // Set staging specific vars here.\n cacheTtl = 0;\n src = 'dist/*';\n dest = bucketStaging;\n } else if (pubScope === 'prod') {\n // Set prod specific vars here.\n cacheTtl = 60;\n src = 'dist/*';\n dest = bucketProd;\n } else if (pubScope === 'promote') {\n // Set promote (essentially prod) specific vars here.\n cacheTtl = 60;\n src = `${bucketStaging}/*`;\n dest = bucketProd;\n }\n\n let infoMsg = `Publishing ${pubScope}/${pkg.version} to GCS (${dest})`;\n if (src) {\n infoMsg += ` from ${src}`;\n }\n console.log(infoMsg);\n\n // Build gsutil commands:\n // The gsutil -h option is used to set metadata headers.\n // The gsutil -m option requests parallel copies.\n // The gsutil -R option is used for recursive file copy.\n const cacheControl = `-h \"Cache-Control:public,max-age=${cacheTtl}\"`;\n const gsutilCacheCmd = `gsutil -m setmeta ${cacheControl} ${dest}/**`;\n const gsutilCpCmd = `gsutil -m cp -r -z html,css,js,svg ${src} ${dest}`;\n\n gulp.src('').pipe($.shell([gsutilCpCmd, gsutilCacheCmd]));\n}"
] |
[
"def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants --changed-parent=HEAD list` (w/ no changes) returning an empty result.\n return self.context.target_roots"
] |
codesearchnet
|
{
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
}
|
Generates chunks of audio that represent the wakeword stream
|
[
"def generate_wakeword_pieces(self, volume):\n \"\"\"\"\"\"\n while True:\n target = 1 if random() > 0.5 else 0\n it = self.pos_files_it if target else self.neg_files_it\n sample_file = next(it)\n yield self.layer_with(self.normalize_volume_to(load_audio(sample_file), volume), target)\n yield self.layer_with(np.zeros(int(pr.sample_rate * (0.5 + 2.0 * random()))), 0)"
] |
[
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluator polynomial, etc. but not the errors positions).\n # This is not necessary as anyway syndromes are defined such as there are only non-zero coefficients (the only 0 is the shift of the constant here) and subsequent computations will/must account for the shift by skipping the first iteration (eg, the often seen range(1, n-k+1)), but you can also avoid prepending the 0 coeff and adapt every subsequent computations to start from 0 instead of 1.\n return [0] + [gf_poly_eval(msg, gf_pow(generator, i+fcr)) for i in xrange(nsym)]"
] |
codesearchnet
|
{
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
}
|
Called by TransitionManager to play the transition. This calls
createAnimators() to set things up and create all of the animations and then
runAnimations() to actually start the animations.
|
[
"void playTransition(@NonNull ViewGroup sceneRoot) {\n mStartValuesList = new ArrayList<TransitionValues>();\n mEndValuesList = new ArrayList<TransitionValues>();\n matchStartAndEnd(mStartValues, mEndValues);\n\n ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators();\n synchronized (sRunningAnimators) {\n int numOldAnims = runningAnimators.size();\n Object windowId = ViewUtils.getWindowId(sceneRoot);\n for (int i = numOldAnims - 1; i >= 0; i--) {\n Animator anim = runningAnimators.keyAt(i);\n if (anim != null) {\n AnimationInfo oldInfo = runningAnimators.get(anim);\n if (oldInfo != null && oldInfo.view != null && oldInfo.windowId == windowId) {\n TransitionValues oldValues = oldInfo.values;\n View oldView = oldInfo.view;\n TransitionValues startValues = getTransitionValues(oldView, true);\n TransitionValues endValues = getMatchedTransitionValues(oldView, true);\n if (startValues == null && endValues == null) {\n endValues = mEndValues.viewValues.get(oldView);\n }\n boolean cancel = (startValues != null || endValues != null) &&\n oldInfo.transition.isTransitionRequired(oldValues, endValues);\n if (cancel) {\n if (anim.isRunning() || AnimatorUtils.isAnimatorStarted(anim)) {\n if (DBG) {\n Log.d(LOG_TAG, \"Canceling anim \" + anim);\n }\n anim.cancel();\n } else {\n if (DBG) {\n Log.d(LOG_TAG, \"removing anim from info list: \" + anim);\n }\n runningAnimators.remove(anim);\n }\n }\n }\n }\n }\n }\n\n createAnimators(sceneRoot, mStartValues, mEndValues, mStartValuesList, mEndValuesList);\n runAnimators();\n }"
] |
[
"function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element is currently being animated by Velocity.\n This is used to ensure that property values are not transferred between non-consecutive (stale) calls. */\n isAnimating: false,\n /* A reference to the element's live computedStyle object. Learn more here: https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle */\n computedStyle: null,\n /* Tween data is cached for each animation on the element so that data can be passed across calls --\n in particular, end values are used as subsequent start values in consecutive Velocity calls. */\n tweensContainer: null,\n /* The full root property values of each CSS hook being animated on this element are cached so that:\n 1) Concurrently-animating hooks sharing the same root can have their root values' merged into one while tweening.\n 2) Post-hook-injection root values can be transferred over to consecutively chained Velocity calls as starting root values. */\n rootPropertyValueCache: {},\n /* A cache for transform updates, which must be manually flushed via CSS.flushTransformCache(). */\n transformCache: {}\n });\n }"
] |
codesearchnet
|
{
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
}
|
Gets the after advice result.
@param <T> the generic type
@param aspectId the aspect id
@return the after advice result
|
[
"@SuppressWarnings(\"unchecked\")\n public <T> T getAfterAdviceResult(String aspectId) {\n return (aspectAdviceResult != null ? (T)aspectAdviceResult.getAfterAdviceResult(aspectId) : null);\n }"
] |
[
"def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n return\n # After getting the analysis' method we have to get all Reflex Rules\n # related to that method.\n all_rrs = a_method.getBackReferences('ReflexRuleMethod')\n if not all_rrs:\n return\n # Once we have all the Reflex Rules with the same method as the\n # analysis has, it is time to get the rules that are bound to the\n # same analysis service that is using the analysis.\n for rule in all_rrs:\n if not api.is_active(rule):\n continue\n # Getting the rules to be done from the reflex rule taking\n # in consideration the analysis service, the result and\n # the state change\n action_row = rule.getActionReflexRules(self, wf_action)\n # Once we have the rules, the system has to execute its\n # instructions if the result has the expected result.\n doReflexRuleAction(self, action_row)"
] |
codesearchnet
|
{
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
}
|
将Json转换成对象.
@param json
@param valueType
@return
|
[
"@Override\r\n\tpublic <T> T toObject(String json, Class<T> clazz) {\r\n\t\treturn toObject(json, clazz, false);\r\n\t}"
] |
[
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] |
codesearchnet
|
{
"query": "Represent the Github instruction about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code:"
}
|
Adds a command to the library
@return Application
|
[
"public function add($command)\n {\n $tasks = $this->prepper\n ->load(get_class($command))\n ->describe();\n\n $this->library->add(['task' => $tasks, 'class' => $command]);\n\n return $this;\n }"
] |
[
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] |
codesearchnet
|
{
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
}
|
Warn等级日志,小于Error
@param log 日志对象
@param format 格式文本,{} 代表变量
@param arguments 变量对应的参数
|
[
"public static void warn(Log log, String format, Object... arguments) {\r\n\t\twarn(log, null, format, arguments);\r\n\t}"
] |
[
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //--------------------------------------------------------------------\n //The delimiter \"--\"\n changeDelimiterPOS(linkedArray);\n\n //--------------------------------------------------------------------\n //如果前一个词是数字,当前词以“-”或“-”开始,并且不止这一个字符,\n //那么将此“-”符号从当前词中分离出来。\n //例如 “3 / -4 / 月”需要拆分成“3 / - / 4 / 月”\n splitMiddleSlashFromDigitalWords(linkedArray);\n\n //--------------------------------------------------------------------\n //1、如果当前词是数字,下一个词是“月、日、时、分、秒、月份”中的一个,则合并,且当前词词性是时间\n //2、如果当前词是可以作为年份的数字,下一个词是“年”,则合并,词性为时间,否则为数字。\n //3、如果最后一个汉字是\"点\" ,则认为当前数字是时间\n //4、如果当前串最后一个汉字不是\"∶·./\"和半角的'.''/',那么是数\n //5、当前串最后一个汉字是\"∶·./\"和半角的'.''/',且长度大于1,那么去掉最后一个字符。例如\"1.\"\n checkDateElements(linkedArray);\n }"
] |
codesearchnet
|
{
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about text processing:"
}
|
sets paragraph format
@param PHPRtfLite_ParFormat $parFormat
|
[
"public function setParFormat(PHPRtfLite_ParFormat $parFormat)\n {\n $this->_rtf->registerParFormat($parFormat);\n $this->_parFormat = $parFormat;\n }"
] |
[
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] |
codesearchnet
|
{
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
}
|
Performs a pre-processing operation on the input string in the given input language
@param input The input text
@param inputLanguage The language of the input
@return The post-processed text
|
[
"public final String apply(String input, Language inputLanguage) {\n if (input != null && Config.get(this.getClass(), inputLanguage, \"apply\").asBoolean(true)) {\n return performNormalization(input, inputLanguage);\n }\n return input;\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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
}
|
Requests permissions immediately, <b>must be invoked during initialization phase of your application</b>.
|
[
"@Override @NonNull @CheckReturnValue public Observable<Permission> requestEach(@NonNull final String... permissions) {\n return Observable.just(TRIGGER)\n .compose(ensureEach(permissions));\n }"
] |
[
"@Deprecated\n public void startTask(String taskId, String callbackUrl) {\n if (taskId==null || callbackUrl == null) {\n if (FacesContext.getCurrentInstance().isPostback()) {\n // if this is an AJAX request ignore it, since we will receive multiple calls to this bean if it is added\n // as preRenderView event\n // see http://stackoverflow.com/questions/2830834/jsf-fevent-prerenderview-is-triggered-by-fajax-calls-and-partial-renders-some\n return;\n }\n // return it anyway but log an info message\n log.log(Level.INFO, \"Called startTask method without proper parameter (taskId='\"+taskId+\"'; callbackUrl='\"+callbackUrl+\"') even if it seems we are not called by an AJAX Postback. Are you using the camundaTaskForm bean correctly?\");\n return;\n }\n // Note that we always run in a conversation\n this.url = callbackUrl;\n businessProcess.startTask(taskId, true);\n }"
] |
codesearchnet
|
{
"query": "Represent the Github sentence about Access control:",
"pos": "Represent the Github code about Access control:",
"neg": "Represent the Github code about programming:"
}
|
Retrieve the information for a zone entity.
|
[
"def get(self, zone_id):\n \"\"\"\"\"\"\n path = '/'.join(['zone', zone_id])\n return self.rachio.get(path)"
] |
[
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated document for the core of the topic search\n return schema"
] |
codesearchnet
|
{
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
}
|
Counts additional occurrences of a property as property in references.
@param usageStatistics
statistics object where count is stored
@param property
the property to count
@param count
the number of times to count the property
|
[
"private void countPropertyReference(UsageStatistics usageStatistics,\n\t\t\tPropertyIdValue property, int count) {\n\t\taddPropertyCounters(usageStatistics, property);\n\t\tusageStatistics.propertyCountsReferences.put(property,\n\t\t\t\tusageStatistics.propertyCountsReferences.get(property) + count);\n\t}"
] |
[
"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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
}
|
Retrieve all data of repository, paginated
@param int $per_page
@param array $columns
@param string $page_name
@param int|null $page
@return \Illuminate\Contracts\Pagination\Paginator
|
[
"public function simplePaginate($per_page = null, $columns = ['*'], $page_name = 'page', $page = null)\n {\n $this->newQuery();\n\n // Get the default per page when not set\n $per_page = $per_page ?: config('repositories.per_page', 15);\n\n return $this->query->simplePaginate($per_page, $columns, $page_name, $page);\n }"
] |
[
"abstract public function __construct(DataAccessInterface $dataSource);\n \n /**\n * Returns an array with all entities for the given data request.\n * \n * @param \\Zepi\\DataSource\\Core\\DataRequest $dataRequest\n * @return false|array\n */\n public function find(DataRequest $dataRequest)\n {\n return $this->dataSource->find($dataRequest);\n }"
] |
codesearchnet
|
{
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
}
|
Private function to get the common type from the information of the field
@param string $fieldName
@param string $nativeType
@return string
|
[
"private function getCommonType($fieldName, $nativeType)\n {\n static $types = [\n // integers\n 'int' => CommonTypes::TINT,\n 'tinyint' => CommonTypes::TINT,\n 'smallint' => CommonTypes::TINT,\n 'bigint' => CommonTypes::TINT,\n // floats\n 'float' => CommonTypes::TNUMBER,\n 'real' => CommonTypes::TNUMBER,\n 'decimal' => CommonTypes::TNUMBER,\n 'numeric' => CommonTypes::TNUMBER,\n 'money' => CommonTypes::TNUMBER,\n 'smallmoney' => CommonTypes::TNUMBER,\n // dates\n 'date' => CommonTypes::TDATE,\n 'time' => CommonTypes::TTIME,\n 'datetime' => CommonTypes::TDATETIME,\n 'smalldatetime' => CommonTypes::TDATETIME,\n // bool\n 'bit' => CommonTypes::TBOOL,\n // text\n 'char' => CommonTypes::TTEXT,\n 'varchar' => CommonTypes::TTEXT,\n 'text' => CommonTypes::TTEXT,\n ];\n if (isset($this->overrideTypes[$fieldName])) {\n return $this->overrideTypes[$fieldName];\n }\n $nativeType = strtolower($nativeType);\n $type = CommonTypes::TTEXT;\n if (array_key_exists($nativeType, $types)) {\n $type = $types[$nativeType];\n }\n return $type;\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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
}
|
Filters a context
This will return a new context with only the resources that
are actually available for use. Uses tags and command line
options to make determination.
|
[
"def filtered_context(context):\n \"\"\"\"\"\"\n\n ctx = Context(context.opt)\n for resource in context.resources():\n if resource.child:\n continue\n\n if resource.filtered():\n ctx.add(resource)\n\n return ctx"
] |
[
"def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # Content type can no longer be cached as public and tenant schemas\n # have different models. If someone wants to change this, the cache\n # needs to be separated between public and shared schemas. If this\n # cache isn't cleared, this can cause permission problems. For example,\n # on public, a particular model has id 14, but on the tenants it has\n # the id 15. if 14 is cached instead of 15, the permissions for the\n # wrong model will be fetched.\n ContentType.objects.clear_cache()"
] |
codesearchnet
|
{
"query": "Represent the summarization about Go programming language:",
"pos": "Represent the code about Go programming language:",
"neg": "Represent the code:"
}
|
Runs this {@see DayEnumExample}.
@param integer $argc The number of arguments.
@param string[] $argv The arguments.
@return integer Always `0`.
|
[
"public static function main($argc, array $argv = [])\n {\n $firstDay = new self(DayEnum::MONDAY());\n $firstDay->tellItLikeItIs();\n $thirdDay = new self(DayEnum::WEDNESDAY());\n $thirdDay->tellItLikeItIs();\n $fifthDay = new self(DayEnum::FRIDAY());\n $fifthDay->tellItLikeItIs();\n $sixthDay = new self(DayEnum::SATURDAY());\n $sixthDay->tellItLikeItIs();\n $seventhDay = new self(DayEnum::SUNDAY());\n $seventhDay->tellItLikeItIs();\n\n return 0;\n }"
] |
[
"public void help() {\n p(\"\");\n p(\"Command Description\");\n p(\"======= ===========\");\n p(\"help() Display usage and help messages. \");\n p(\"defineClass(className) Define an extension using the Java class\");\n p(\" named with the string argument. \");\n p(\" Uses ScriptableObject.defineClass(). \");\n p(\"load(['foo.js', ...]) Load JavaScript source files named by \");\n p(\" string arguments. \");\n p(\"loadClass(className) Load a class named by a string argument.\");\n p(\" The class must be a script compiled to a\");\n p(\" class file. \");\n p(\"print([expr ...]) Evaluate and print expressions. \");\n p(\"quit() Quit the shell. \");\n p(\"version([number]) Get or set the JavaScript version number.\");\n p(\"\");\n }"
] |
codesearchnet
|
{
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
}
|
@param int $level
@throws \OutOfBoundsException
|
[
"private function checkLevel(int $level)\n {\n if ($level <= 0 || $level > self::MAX_LEVEL_DEPTH) {\n throw new OutOfBounds(\n sprintf('Administrative level should be an integer in [1,%d], %d given', self::MAX_LEVEL_DEPTH, $level)\n );\n }\n }"
] |
[
"final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }"
] |
codesearchnet
|
{
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
}
|
Filters out boolish items that resemble none "truthy" values.
@return array
|
[
"public static function compact($array, $reindex = false)\n {\n $out = array_filter($array, function ($item) {\n return false !== (bool)$item;\n });\n\n return false !== $reindex && self::isList($out) ? array_values($out) : $out;\n }"
] |
[
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] |
codesearchnet
|
{
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
}
|
Handles adding a contact.
@param int $userid The id of the user who requested to be a contact
@param int $contactid The id of the contact
|
[
"public static function add_contact(int $userid, int $contactid) {\n global $DB;\n\n $messagecontact = new \\stdClass();\n $messagecontact->userid = $userid;\n $messagecontact->contactid = $contactid;\n $messagecontact->timecreated = time();\n $messagecontact->id = $DB->insert_record('message_contacts', $messagecontact);\n\n $eventparams = [\n 'objectid' => $messagecontact->id,\n 'userid' => $userid,\n 'relateduserid' => $contactid,\n 'context' => \\context_user::instance($userid)\n ];\n $event = \\core\\event\\message_contact_added::create($eventparams);\n $event->add_record_snapshot('message_contacts', $messagecontact);\n $event->trigger();\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'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'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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
}
|
Marshall the given parameter object.
|
[
"public void marshall(ExportSnapshotRecord exportSnapshotRecord, ProtocolMarshaller protocolMarshaller) {\n\n if (exportSnapshotRecord == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(exportSnapshotRecord.getName(), NAME_BINDING);\n protocolMarshaller.marshall(exportSnapshotRecord.getArn(), ARN_BINDING);\n protocolMarshaller.marshall(exportSnapshotRecord.getCreatedAt(), CREATEDAT_BINDING);\n protocolMarshaller.marshall(exportSnapshotRecord.getLocation(), LOCATION_BINDING);\n protocolMarshaller.marshall(exportSnapshotRecord.getResourceType(), RESOURCETYPE_BINDING);\n protocolMarshaller.marshall(exportSnapshotRecord.getState(), STATE_BINDING);\n protocolMarshaller.marshall(exportSnapshotRecord.getSourceInfo(), SOURCEINFO_BINDING);\n protocolMarshaller.marshall(exportSnapshotRecord.getDestinationInfo(), DESTINATIONINFO_BINDING);\n } catch (Exception e) {\n throw new SdkClientException(\"Unable to marshall request to JSON: \" + e.getMessage(), e);\n }\n }"
] |
[
"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:"
}
|
Validates that x is a multiple of the reference (`x % ref == 0`)
|
[
"def is_multiple_of(ref):\n \n def is_multiple_of_ref(x):\n if x % ref == 0:\n return True\n else:\n raise IsNotMultipleOf(wrong_value=x, ref=ref)\n # raise Failure('x % {ref} == 0 does not hold for x={val}'.format(ref=ref, val=x))\n\n is_multiple_of_ref.__name__ = 'is_multiple_of_{}'.format(ref)\n return is_multiple_of_ref"
] |
[
"def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value"
] |
codesearchnet
|
{
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
}
|
// AddFunc takes a function and runs it repeatedly, adding the return values
// as fields.
// The function should return error when it has exhausted its values
|
[
"func (f *fieldHolder) AddFunc(fn func() (string, interface{}, error)) error {\n\tfor {\n\t\tkey, rawVal, err := fn()\n\t\tif err != nil {\n\t\t\t// fn is done giving us data\n\t\t\tbreak\n\t\t}\n\t\tf.AddField(key, rawVal)\n\t}\n\treturn nil\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
}
|
Deregister removed documents.
@param RemoveEvent $event
|
[
"public function handleRemove(RemoveEvent $event)\n {\n $document = $event->getDocument();\n $this->documentRegistry->deregisterDocument($document);\n }"
] |
[
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] |
codesearchnet
|
{
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
}
|
// CheckAddresses returns the uri scheme if the address is valid.
|
[
"func CheckAddresses(uriList []string, schemes []string) (scheme string) {\n\tcount := len(uriList)\n\tif count < 1 {\n\t\tpanic(ErrURIListEmpty)\n\t}\n\tu, err := url.Parse(uriList[0])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tscheme = u.Scheme\n\tif sort.SearchStrings(schemes, scheme) == len(schemes) {\n\t\tpanic(errors.New(\"This client desn't support \" + scheme + \" scheme.\"))\n\t}\n\tfor i := 1; i < count; i++ {\n\t\tu, err := url.Parse(uriList[i])\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif scheme != u.Scheme {\n\t\t\tpanic(ErrNotSupportMultpleProtocol)\n\t\t}\n\t}\n\treturn\n}"
] |
[
"def uri_from(url)\n # This will raise an InvalidURIError if the URL is very wrong. It will\n # still pass for strings like \"foo\", though.\n url = URI(url)\n\n # We need to check if the URL was either http://, https:// or ftp://,\n # because these are the only ones we can download from. open-uri will add\n # the #open method only to these ones, so this is a good check.\n raise Error, 'url was invalid' unless url.respond_to?(:open)\n\n url\n end"
] |
codesearchnet
|
{
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
}
|
// SetBudgetName sets the BudgetName field's value.
|
[
"func (s *Budget) SetBudgetName(v string) *Budget {\n\ts.BudgetName = &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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
}
|
redis key: records:tablename: id1 | id2 | id3...
eg: the user has three primarykeys id1=1,id2=2,id3=3, so the redisKey is 'records:user:1|2|3'.
@return redis key
|
[
"private String redisKey(ModelExt<?> m) {\n\t\tTable table = m.table();\n\t\tStringBuilder key = new StringBuilder();\n\t\tkey.append(RECORDS);\n\t\tkey.append(table.getName());\n\t\tkey.append(\":\");\n\t\t//fetch primary keys' values\n\t\tString[] primaryKeys = table.getPrimaryKey();\n\t\t//format key\n\t\tfor (int idx = 0; idx < primaryKeys.length; idx++) {\n\t\t\tObject primaryKeyVal = m.get(primaryKeys[idx]);\n\t\t\tif (null != primaryKeyVal) {\n\t\t\t\tif (idx > 0) {\n\t\t\t\t\tkey.append(\"|\");\n\t\t\t\t}\n\t\t\t\tkey.append(primaryKeyVal);\n\t\t\t}\n\t\t}\n\t\treturn key.toString();\n\t}"
] |
[
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
}
|
Return a deferred.
|
[
"def delete(self, **params):\n \"\"\"\"\"\"\n d = self.request('delete', self.instance_url(), params)\n return d.addCallback(self.refresh_from).addCallback(lambda _: self)"
] |
[
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] |
codesearchnet
|
{
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
}
|
file can be null, meaning stdin
|
[
"function readSpecFile(file, options) {\n if (options.verbose > 1) {\n file ? console.error('GET ' + file) : console.error('GET <stdin>');\n }\n if (!file) {\n // standard input\n return readFileStdinAsync();\n } else if (file && file.startsWith('http')) {\n // remote file\n return fetch(file).then(res => {\n if (res.status !== 200) {\n throw new Error(`Received status code ${res.status}`);\n }\n return res.text();\n })\n } else {\n // local file\n // TODO error handlers?\n return readFileAsync(file, 'utf8');\n }\n}"
] |
[
"def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()"
] |
codesearchnet
|
{
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
}
|
Returns the renderer for the given format.
@param string $format
@throws \AltThree\Badger\Exceptions\InvalidRendererException
@return \AltThree\Badger\Render\RenderInterface
|
[
"protected function getRendererForFormat(string $format)\n {\n if (!isset($this->renderers[$format])) {\n throw new InvalidRendererException('No renders found for the given format: '.$format);\n }\n\n return $this->renderers[$format];\n }"
] |
[
"public function PrepareTheDefaultParametersForGeneration() {\n $this->params = array(\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\BaseClassGenerator::NameSpaceKey => null,\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\BaseClassGenerator::ClassNameKey => null,\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\BaseClassGenerator::DestinationDirKey => null,\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\BaseClassGenerator::ClassDescriptionKey => null,\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\BaseClassGenerator::CultureKey => null,\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\BaseClassGenerator::ClassDerivation => null,\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\ConstantsClassGeneratorBase::DoGenerateConstantKeysKey => true,\n \\Puzzlout\\Framework\\GeneratorEngine\\Core\\ConstantsClassGeneratorBase::DoGenerateGetListMethodKey => true,\n );\n }"
] |
codesearchnet
|
{
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
}
|
Preprocess string to transform all diacritics and remove other special characters than appropriate
:param string:
:return:
|
[
"def preprocess(string):\n \n string = unicode(string, encoding=\"utf-8\")\n # convert diacritics to simpler forms\n string = regex1.sub(lambda x: accents[x.group()], string)\n # remove all rest of the unwanted characters\n return regex2.sub('', string).encode('utf-8')"
] |
[
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ...\" as python\n # tries to convert the str to a unicode. To avoid that happening within\n # the problem reporter convert all unicode attributes to utf-8.\n # Currently valid utf-8 fields are converted to unicode in _ReadCsvDict.\n # Perhaps all fields should be left as utf-8.\n d[k] = util.EncodeUnicode(v)\n return d"
] |
codesearchnet
|
{
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
}
|
Build a summary list of all the methods in this context
|
[
"def build_method_summary_list(path_prefix=\"\")\n collect_methods unless @methods\n meths = @methods.sort\n res = []\n meths.each do |meth|\n\tres << {\n \"name\" => CGI.escapeHTML(meth.name),\n \"aref\" => \"#{path_prefix}\\##{meth.aref}\" \n }\n end\n res\n end"
] |
[
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
}
|
Returns the first subset of a given set in this UBTree.
@param set the set to search for
@return the first subset which is found for the given set or {@code null} if there is none
|
[
"public SortedSet<T> firstSubset(SortedSet<T> set) {\n if (this.rootNodes.isEmpty() || set == null || set.isEmpty()) {\n return null;\n }\n return firstSubset(set, this.rootNodes);\n }"
] |
[
"public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxSize entries and each entry has zero\n * or one nodes which can have zero, one or multiple\n * successors.\n */\n if ($list->containsValue($value)) {\n return true;\n }\n }\n /*\n * If no bucket contains the value then return false because\n * the searched value is not in the list.\n */\n return false;\n }"
] |
codesearchnet
|
{
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
}
|
Extracts task enterprise column values.
@param id task unique ID
@param task task instance
@param taskVarData task var data
@param metaData2 task meta data
|
[
"private void processTaskEnterpriseColumns(Integer id, Task task, Var2Data taskVarData, byte[] metaData2)\n {\n if (metaData2 != null)\n {\n int bits = MPPUtility.getInt(metaData2, 29);\n task.set(TaskField.ENTERPRISE_FLAG1, Boolean.valueOf((bits & 0x0000800) != 0));\n task.set(TaskField.ENTERPRISE_FLAG2, Boolean.valueOf((bits & 0x0001000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG3, Boolean.valueOf((bits & 0x0002000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG4, Boolean.valueOf((bits & 0x0004000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG5, Boolean.valueOf((bits & 0x0008000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG6, Boolean.valueOf((bits & 0x0001000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG7, Boolean.valueOf((bits & 0x0002000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG8, Boolean.valueOf((bits & 0x0004000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG9, Boolean.valueOf((bits & 0x0008000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG10, Boolean.valueOf((bits & 0x0010000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG11, Boolean.valueOf((bits & 0x0020000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG12, Boolean.valueOf((bits & 0x0040000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG13, Boolean.valueOf((bits & 0x0080000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG14, Boolean.valueOf((bits & 0x0100000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG15, Boolean.valueOf((bits & 0x0200000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG16, Boolean.valueOf((bits & 0x0400000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG17, Boolean.valueOf((bits & 0x0800000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG18, Boolean.valueOf((bits & 0x1000000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG19, Boolean.valueOf((bits & 0x2000000) != 0));\n task.set(TaskField.ENTERPRISE_FLAG20, Boolean.valueOf((bits & 0x4000000) != 0));\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 Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
}
|
Parse service name from request
@return string|boolean
|
[
"protected function fetchService()\n\t{\n $service = $this->getRouteParam('service');\n $service = $this->parseCanonicalName($service, true);\n \n if (preg_match($this->servicePattern, $service)) {\n return $service;\n } else {\n return false;\n }\n }"
] |
[
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] |
codesearchnet
|
{
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
}
|
// SetIdentityAttributeValues sets the IdentityAttributeValues field's value.
|
[
"func (s *TypedLinkSpecifier) SetIdentityAttributeValues(v []*AttributeNameAndValue) *TypedLinkSpecifier {\n\ts.IdentityAttributeValues = v\n\treturn s\n}"
] |
[
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadContext\n // in order to re-establish the thread context based on the metadata identity if not defaulted.\n }"
] |
codesearchnet
|
{
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
}
|
This is more expensive than normal.
|
[
"@Override\r\n public void clear() {\r\n // iterate over all keys in originalMap and set them to null in deltaMap\r\n for (K key : originalMap.keySet()) {\r\n deltaMap.put(key, ErasureUtils.<Collection<V>>uncheckedCast(removedValue));\r\n }\r\n }"
] |
[
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \"never\" be used. It will be added\n\t// as soon as a case for it exists.\n\t//\n\t// The GetE extension is an addition that only rend supports. This chunked handler\n\t// is pretty explicitly for talking to memcached since it is a complex workaround\n\t// for pathological behavior when data size rapidly changes that only happens in\n\t// memcached. The chunked handler will not work well with the L2 the EVCache team\n\t// uses.\n\tpanic(\"GetE not supported in Rend chunked mode\")\n}"
] |
codesearchnet
|
{
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
}
|
// removeOpcode will remove any opcode matching ``opcode'' from the opcode
// stream in pkscript
|
[
"func removeOpcode(pkscript []parsedOpcode, opcode byte) []parsedOpcode {\n\tretScript := make([]parsedOpcode, 0, len(pkscript))\n\tfor _, pop := range pkscript {\n\t\tif pop.opcode.value != opcode {\n\t\t\tretScript = append(retScript, pop)\n\t\t}\n\t}\n\treturn retScript\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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
}
|
Set language.
@param \BlackForest\PiwikBundle\Entity\PiwikLanguage|null $language
@return PiwikVisit
|
[
"public function setLanguage(\\BlackForest\\PiwikBundle\\Entity\\PiwikLanguage $language = null)\n {\n $this->language = $language;\n\n return $this;\n }"
] |
[
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] |
codesearchnet
|
{
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
}
|
:nocov:
@visibility private
|
[
"def inspect\n ['{config', *each.map{|key, value| \" \"+qualified_key(*key)+\" => \"+value.inspect },'}'].join(\"\\n\")\n end"
] |
[
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] |
codesearchnet
|
{
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
}
|
// SetBudgetName sets the BudgetName field's value.
|
[
"func (s *DeleteSubscriberInput) SetBudgetName(v string) *DeleteSubscriberInput {\n\ts.BudgetName = &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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
}
|
Get the extension that matches given mimetype.
@param string $mimetype
@return mixed null when not found, extension (string) when found.
|
[
"public function getExtension($mimetype)\n {\n if (!($extension = array_search($mimetype, $this->mainMimeTypes))) {\n $extension = array_search($mimetype, $this->mimeTypes);\n }\n\n return !$extension ? null : $extension;\n }"
] |
[
"private function guardValidModelAndIdentifier($model, $identifier)\n {\n if (empty($model) || (!is_object($model) && (null === $identifier || '' === $identifier))) {\n throw new ResolveComponentDataException('Model has to be an object or (a scalar + an identifier in 2nd argument)');\n }\n }"
] |
codesearchnet
|
{
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
}
|
Public API for generating a URL pathname from a path and parameters.
|
[
"function generatePath(path = \"/\", params = {}) {\n return path === \"/\" ? path : compilePath(path)(params, { pretty: true });\n}"
] |
[
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated document for the core of the topic search\n return schema"
] |
codesearchnet
|
{
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
}
|
// SetScheduleTimezone sets the ScheduleTimezone field's value.
|
[
"func (s *GetMaintenanceWindowOutput) SetScheduleTimezone(v string) *GetMaintenanceWindowOutput {\n\ts.ScheduleTimezone = &v\n\treturn s\n}"
] |
[
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadContext\n // in order to re-establish the thread context based on the metadata identity if not defaulted.\n }"
] |
codesearchnet
|
{
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
}
|
Get a dimension.
@param Image $image The source image.
@param string $field The requested field.
@return double|null The dimension.
|
[
"public function getDimension(Image $image, $field)\n {\n if ($this->{$field}) {\n return (new Dimension($image, $this->getDpr()))->get($this->{$field});\n }\n }"
] |
[
"function parseFormulaData (nulls, operation, result) {\n /**\n * @description\n * Object containing formula data\n *\n * @typedef {object} carto.dataview.FormulaData\n * @property {number} nulls - Number of null values in the column\n * @property {string} operation - Operation used\n * @property {number} result - Result of the operation\n * @api\n */\n return {\n nulls: nulls,\n operation: operation,\n result: result\n };\n}"
] |
codesearchnet
|
{
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
}
|
Remove HashTable item
@param PHPExcel_IComparable $pSource Item to remove
@throws PHPExcel_Exception
|
[
"public function remove(PHPExcel_IComparable $pSource = null) {\n\t\t$hash = $pSource->getHashCode();\n\t\tif (isset($this->_items[$hash])) {\n\t\t\tunset($this->_items[$hash]);\n\n\t\t\t$deleteKey = -1;\n\t\t\tforeach ($this->_keyMap as $key => $value) {\n\t\t\t\tif ($deleteKey >= 0) {\n\t\t\t\t\t$this->_keyMap[$key - 1] = $value;\n\t\t\t\t}\n\n\t\t\t\tif ($value == $hash) {\n\t\t\t\t\t$deleteKey = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($this->_keyMap[count($this->_keyMap) - 1]);\n\t\t}\n\t}"
] |
[
"public function isImplemented($pFunction = '')\n {\n $pFunction = strtoupper($pFunction);\n if (isset(self::$PHPExcelFunctions[$pFunction])) {\n return (self::$PHPExcelFunctions[$pFunction]['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY');\n } else {\n return false;\n }\n }"
] |
codesearchnet
|
{
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
}
|
Loop forever, pushing out stats.
|
[
"def run(self):\n \"\"\"\"\"\"\n self.graphite.start()\n while True:\n log.debug('Graphite pusher is sleeping for %d seconds', self.period)\n time.sleep(self.period)\n log.debug('Pushing stats to Graphite')\n try:\n self.push()\n log.debug('Done pushing stats to Graphite')\n except:\n log.exception('Exception while pushing stats to Graphite')\n raise"
] |
[
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] |
codesearchnet
|
{
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
}
|
// CheckShell checks that a shell is supported, and returns the correct command name
|
[
"func CheckShell(shell string) (string, error) {\n\tif _, ok := ValidShells[shell]; !ok {\n\t\treturn \"\", fmt.Errorf(\"unsupported shell: %q\", shell)\n\t}\n\tswitch shell {\n\tcase \"powershell\":\n\t\tif _, err := exec.LookPath(\"powershell\"); err == nil {\n\t\t\treturn \"powershell\", nil\n\t\t} else if _, err := exec.LookPath(\"pwsh\"); err == nil {\n\t\t\treturn \"pwsh\", nil\n\t\t} else {\n\t\t\treturn \"\", fmt.Errorf(\"powershell/pwsh not on path\")\n\t\t}\n\tcase \"modd\":\n\t\t// When testing, we're running under a special compiled test executable,\n\t\t// so we look for an instance of modd on our path.\n\t\tif shellTesting {\n\t\t\treturn exec.LookPath(\"modd\")\n\t\t}\n\t\treturn os.Executable()\n\tdefault:\n\t\treturn exec.LookPath(shell)\n\t}\n}"
] |
[
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll get false ambiguity.\n for t in sequence.unique(g.target_types()):\n __type_to_generators.setdefault(t, []).append(g)\n\n # Update the set of generators for toolset\n\n # TODO: should we check that generator with this id\n # is not already registered. For example, the fop.jam\n # module intentionally declared two generators with the\n # same id, so such check will break it.\n\n # Some generators have multiple periods in their name, so the\n # normal $(id:S=) won't generate the right toolset name.\n # e.g. if id = gcc.compile.c++, then\n # .generators-for-toolset.$(id:S=) will append to\n # .generators-for-toolset.gcc.compile, which is a separate\n # value from .generators-for-toolset.gcc. Correcting this\n # makes generator inheritance work properly.\n # See also inherit-generators in module toolset\n base = id.split ('.', 100) [0]\n\n __generators_for_toolset.setdefault(base, []).append(g)\n\n # After adding a new generator that can construct new target types, we need\n # to clear the related cached viable source target type information for\n # constructing a specific target type or using a specific generator. Cached\n # viable source target type lists affected by this are those containing any\n # of the target types constructed by the new generator or any of their base\n # target types.\n #\n # A more advanced alternative to clearing that cached viable source target\n # type information would be to expand it with additional source types or\n # even better - mark it as needing to be expanded on next use.\n #\n # For now we just clear all the cached viable source target type information\n # that does not simply state 'all types' and may implement a more detailed\n # algorithm later on if it becomes needed.\n\n invalidate_extendable_viable_source_target_type_cache()"
] |
codesearchnet
|
{
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
}
|
// Roll updates the checksum of the window from the entering byte. You
// MUST initialize a window with Write() before calling this method.
|
[
"func (d *Adler32) Roll(b byte) {\n\t// This check costs 10-15% performance. If we disable it, we crash\n\t// when the window is empty. If we enable it, we are always correct\n\t// (an empty window never changes no matter how much you roll it).\n\t//if len(d.window) == 0 {\n\t//\treturn\n\t//}\n\t// extract the entering/leaving bytes and update the circular buffer.\n\tenter := uint32(b)\n\tleave := uint32(d.window[d.oldest])\n\td.window[d.oldest] = b\n\td.oldest += 1\n\tif d.oldest >= len(d.window) {\n\t\td.oldest = 0\n\t}\n\n\t// See http://stackoverflow.com/questions/40985080/why-does-my-rolling-adler32-checksum-not-work-in-go-modulo-arithmetic\n\td.a = (d.a + Mod + enter - leave) % Mod\n\td.b = (d.b + (d.n*leave/Mod+1)*Mod + d.a - (d.n * leave) - 1) % Mod\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
}
|
Delete a single item with the given ID
|
[
"def delete(self, id):\n ''''''\n if not self._item_path:\n raise AttributeError('delete is not available for %s' % self._item_name)\n target = self._item_path % id\n self._redmine.delete(target)\n return None"
] |
[
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
}
|
// Refer to the Mailgun documentation for more information.
|
[
"func (m *Message) SetTrackingOpens(trackingOpens bool) {\n\tm.trackingOpens = trackingOpens\n\tm.trackingOpensSet = true\n}"
] |
[
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
}
|
// Not reverses the results of its given child matcher.
//
// Example usage:
// Not(Eq(5)).Matches(4) // returns true
// Not(Eq(5)).Matches(5) // returns false
|
[
"func Not(x interface{}) Matcher {\n\tif m, ok := x.(Matcher); ok {\n\t\treturn notMatcher{m}\n\t}\n\treturn notMatcher{Eq(x)}\n}"
] |
[
"@SuppressWarnings(\"GoodTime\") // false positive; b/122617528\n public void containsAnyOf(int first, int second, int... rest) {\n check().that(actualList).containsAnyOf(first, second, box(rest));\n }"
] |
codesearchnet
|
{
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
}
|
Set limit on the number of propagations.
|
[
"def prop_budget(self, budget):\n \n\n if self.minisat:\n pysolvers.minisatgh_pbudget(self.minisat, budget)"
] |
[
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] |
codesearchnet
|
{
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
}
|
设置缓存
@param string $key
@param mixed $value
@param int $expire -1 永不过期 0默认配置
@throws \Error
|
[
"public static function set($key, $value, $expire = 0) {\n try {\n self::getCache()->set($key, $value, $expire);\n self::release();\n } catch (\\RuntimeException $e) {\n self::release();\n throw $e;\n } catch (\\Error $e) {\n self::release();\n throw $e;\n }\n }"
] |
[
"protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}"
] |
codesearchnet
|
{
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
}
|
Outputs the FontAwesomeText object as an HTML string
@access protected
@return string HTML string of text element
|
[
"protected function output()\n {\n $attrs = '';\n $classes = 'fa-layers-text';\n $transforms = '';\n\n if (!empty($this->classes) && count($this->classes) > 0) {\n $classes .= ' ' . implode(' ', $this->classes);\n }\n\n if (!empty($this->attributes) && count($this->attributes) > 0) {\n foreach ($this->attributes as $attr => $val) {\n $attrs .= ' ' . $attr . '=\"' . $val . '\"';\n }\n }\n\n if (!empty($this->transforms) && count($this->transforms) > 0) {\n $transformList = array();\n foreach ($this->transforms as $transform) {\n $transformList[] = implode('-', $transform);\n }\n $transforms = ' data-fa-transform=\"' . implode(' ', $transformList) . '\"';\n }\n\n return sprintf(self::TEXT_HTML, $classes, $attrs, $transforms, $this->text);\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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
}
|
Return a single frame.
|
[
"@SuppressWarnings(\"unused\") // called through reflection by RequestServer\n public FramesV3 fetch(int version, FramesV3 s) {\n FramesV3 frames = doFetch(version, s);\n\n // Summary data is big, and not always there: null it out here. You have to call columnSummary\n // to force computation of the summary data.\n for (FrameBaseV3 a_frame: frames.frames) {\n ((FrameV3)a_frame).clearBinsField();\n }\n\n return frames;\n }"
] |
[
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] |
codesearchnet
|
{
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
}
|
Performs all data validation that is appicable to the data value itself
@param object - the data value
@throws DataValidationException if any of the data constraints are violated
|
[
"@SuppressWarnings(\"unchecked\")\r\n public void postValidate(Object object) throws DataValidationException {\r\n if (_values != null || _ranges != null) {\r\n if (_values != null) for (Object value: _values) {\r\n if (value.equals(object)) return;\r\n }\r\n\r\n if (_ranges != null) for (@SuppressWarnings(\"rawtypes\") Range r: _ranges) {\r\n @SuppressWarnings(\"rawtypes\")\r\n Comparable o = (Comparable)object;\r\n if (r.inclusive) {\r\n if ((r.min == null || r.min.compareTo(o) <= 0) && (r.max == null || o.compareTo(r.max) <= 0)) {\r\n return;\r\n }\r\n } else {\r\n if ((r.min == null || r.min.compareTo(o) < 0) && (r.max == null || o.compareTo(r.max) < 0)) {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n throw new DataValidationException(\"VALUES/RANGES\", _name, object);\r\n }\r\n }"
] |
[
"def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n return\n # After getting the analysis' method we have to get all Reflex Rules\n # related to that method.\n all_rrs = a_method.getBackReferences('ReflexRuleMethod')\n if not all_rrs:\n return\n # Once we have all the Reflex Rules with the same method as the\n # analysis has, it is time to get the rules that are bound to the\n # same analysis service that is using the analysis.\n for rule in all_rrs:\n if not api.is_active(rule):\n continue\n # Getting the rules to be done from the reflex rule taking\n # in consideration the analysis service, the result and\n # the state change\n action_row = rule.getActionReflexRules(self, wf_action)\n # Once we have the rules, the system has to execute its\n # instructions if the result has the expected result.\n doReflexRuleAction(self, action_row)"
] |
codesearchnet
|
{
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
}
|
@param ContentInterface $content
@return array
|
[
"protected function extractMediasFromContentType(ContentTypeInterface $contentType)\n {\n $mediaIds = array();\n $fields = $contentType->getFields();\n\n foreach ($fields as $field) {\n if ($this->isMediaAttribute($field->getDefaultValue())) {\n $mediaIds[] = $field->getDefaultValue()['id'];\n }\n }\n\n return $mediaIds;\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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
}
|
Setter for **self.__splitters** attribute.
:param value: Attribute value.
:type value: tuple or list
|
[
"def splitters(self, value):\n \n\n if value is not None:\n assert type(value) in (tuple, list), \"'{0}' attribute: '{1}' type is not 'tuple' or 'list'!\".format(\n \"splitters\", value)\n for element in value:\n assert type(element) is unicode, \"'{0}' attribute: '{1}' type is not 'unicode'!\".format(\n \"splitters\", element)\n assert len(element) == 1, \"'{0}' attribute: '{1}' has multiples characters!\".format(\n \"splitter\", element)\n assert not re.search(r\"\\w\", element), \"'{0}' attribute: '{1}' is an alphanumeric character!\".format(\n \"splitter\", element)\n self.__splitters = value"
] |
[
"def start_index(self, value):\n \"\"\"\"\"\"\n # TODO: Validate contents? (May want to set before adding the data.)\n if not isinstance(value, dict):\n raise TypeError('start_index attribute must be a dict.')\n self._start_index = value"
] |
codesearchnet
|
{
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
}
|
Assign float value to inputOutput SFFloat field named speed.
Note that our implementation with ExoPlayer that pitch and speed will be set to the same value.
@param newValue
|
[
"public void setSpeed(float newValue) {\n if (newValue < 0) newValue = 0;\n this.pitch.setValue( newValue );\n this.speed.setValue( newValue );\n }"
] |
[
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(whence=whence)"
] |
codesearchnet
|
{
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
}
|
set loglevel based on NODE_DEBUG env variable and create exported methods
|
[
"function initialize() {\n var flags = [];\n\n Object.keys( levels ).forEach(function( type, level ) {\n var method = type.toLowerCase();\n exports[ method ] = log.bind( exports, type, level, false );\n exports[ method ].json = log.bind( exports, type, level, true );\n if ( new RegExp( '\\\\b' + type + '\\\\b', 'i' ).test( env ) ) {\n flags.push( level );\n }\n });\n\n loglevel = Math.min.apply( Math, flags );\n}"
] |
[
"def get_project() -> Optional[str]:\n \n project = SETTINGS.project\n if not project:\n require_test_mode_enabled()\n raise RunError('Missing project name; for test mode, please set PULUMI_NODEJS_PROJECT')\n return project"
] |
codesearchnet
|
{
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software Development:"
}
|
Create presets of an image
@param string $path
|
[
"public static function createPresets($path = null, $callback = null) {\n $moufManager = MoufManager::getMoufManager();\n $instances = $moufManager->findInstances('Mouf\\\\Utils\\\\Graphics\\\\MoufImagine\\\\Controller\\\\ImagePresetController');\n foreach ($instances as $instanceName) {\n $instance = $moufManager->getInstance($instanceName);\n if ($path && strpos($path, $instance->originalPath) !== false && $instance->createPresetsEnabled === true) {\n $imagePath = substr($path, strlen($instance->originalPath) + 1);\n $instance->image($imagePath);\n\n if(is_callable($callback)) {\n $finalPath = ROOT_PATH . $instance->url . DIRECTORY_SEPARATOR . $imagePath;\n $callback($finalPath);\n }\n }\n }\n }"
] |
[
"def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)"
] |
codesearchnet
|
{
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.