query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
<p> In some cases, the job launcher will be early stopped.
It can be due to the large volume of input source data.
In such case, we need to re-launch the same job until
the job launcher determines it is safe to stop. | [
"private void runJobLauncherLoop() throws JobException {\n try {\n while (true) {\n currentJobLauncher = this.jobScheduler.buildJobLauncher(jobProps);\n // in \"run once\" case, job scheduler will remove current job from the scheduler\n boolean isEarlyStopped = this.jobScheduler.runJob(... | [
"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 #... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get the cast and crew information for a specific movie id.
@param movieId
@return
@throws MovieDbException | [
"public MediaCreditList getMovieCredits(int movieId) throws MovieDbException {\n TmdbParameters parameters = new TmdbParameters();\n parameters.add(Param.ID, movieId);\n\n URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.CREDITS).buildUrl(parameters);\n String webpage =... | [
"public List<Audit> getAllNotifications(JPAEntity entity) {\n\t\treturn _auditService.findByEntityHostnameMessage(entity.getId(), null, \"Triggering event value:\");\n\t}"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Documentation:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public EClass getIfcStructuralSteelProfileProperties() {\r\n\t\tif (ifcStructuralSteelProfilePropertiesEClass == null) {\r\n\t\t\tifcStructuralSteelProfilePropertiesEClass = (EClass) EPackage.Registry.INSTANCE\r\n\t\t\t\t\t.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(564);\r\n\t\t}\r\n\t\treturn if... | [
"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... | codesearchnet | {
"query": "Represent the text about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Forward an Event to Push Server.
@param Event $event
@param string $name | [
"public function forwardEvent(Event $event, $name)\n {\n if (!$this->enabled) {\n return;\n }\n\n $this->pushServer->send($this->eventSerializer->serializeEvent($name, $event));\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 instruction about getstream.io:",
"pos": "Represent the code about getstream.io:",
"neg": "Represent the code:"
} |
Modelled on the getChangedFields of DataObject, with the addition of the variable's type
@param \SilverStripe\ORM\DataObject $obj
@return array The before/after changes of each field | [
"protected function getChangedFields($obj)\n {\n $changedFields = $obj->getChangedFields(true, 2);\n foreach ($changedFields as $key => $value) {\n $changedFields[$key]['before'] = '(' . gettype($value['before']) . ') ' . $value['before'];\n $changedFields[$key]['after'] = '('... | [
"public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
Tells if a class is one of the "accept all" classes as the left hand side of an
assignment.
@param node the classnode to test
@return true if it's an Object, String, boolean, Boolean or Class. | [
"public static boolean isWildcardLeftHandSide(final ClassNode node) {\n if (OBJECT_TYPE.equals(node) ||\n STRING_TYPE.equals(node) ||\n boolean_TYPE.equals(node) ||\n Boolean_TYPE.equals(node) ||\n CLASS_Type.equals(node)) {\n return true... | [
"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 diff... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Add build to the list
@param Build $build | [
"public function addBuild(Build $build)\n {\n $this->getBuilds();\n $build->setRepositoryId($this->getId());\n $this->builds[$build->getId()] = $build;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Set the, pre-defined, sorting mode.
@param string|null $mode The sorting mode.
@throws InvalidArgumentException If the mode is not a string or invalid.
@return self | [
"public function setMode($mode)\n {\n if ($mode === null) {\n $this->mode = $mode;\n return $this;\n }\n\n if (!is_string($mode)) {\n throw new InvalidArgumentException(\n 'Order Mode must be a string.'\n );\n }\n\n $mo... | [
"public function initializeArguments()\n {\n $this->registerArgument('value', 'string', 'The input value. If not given, the evaluated child nodes will be used', false, null);\n $this->registerArgument('mode', 'string', 'The case to apply, must be one of this\\' CASE_* constants. Defaults to upperca... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Initialize max heap with first k points.
Python does not support a max heap; thus we can use the default min heap where the keys (distance) are negated. | [
"def k_closest(points, k, origin=(0, 0)):\n # Time: O(k+(n-k)logk)\n # Space: O(k)\n \n heap = [(-distance(p, origin), p) for p in points[:k]]\n heapify(heap)\n\n \"\"\"\n For every point p in points[k:],\n check if p is smaller than the root of the max heap;\n if it is, add p to heap and... | [
"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 evaluato... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
<pre>
Platform-specific data about device that may be useful
for supporting efficient data transfers.
</pre>
<code>optional .tensorflow.DeviceLocality locality = 5;</code> | [
"public org.tensorflow.framework.DeviceLocality getLocality() {\n return locality_ == null ? org.tensorflow.framework.DeviceLocality.getDefaultInstance() : locality_;\n }"
] | [
"def setConfiguration(self, configuration):\n \n \"\"\"\n if isinstance(configuration, Configuration):\n configuration = configuration.value\n\n self.dev.set_configuration(configuration)"
] | codesearchnet | {
"query": "Represent the instruction about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code about programming:"
} |
Check to see if the file exists on the device
:return: | [
"def md5sum(self):\n \n cmd = 'show file {dir}:{bin} md5sum'.format(\n dir=self.DESTDIR, bin=self.image)\n\n run = self.device.api.exec_opcmd\n try:\n got = run(cmd)\n return got.get('file_content_md5sum').strip()\n except: # NOQA\n ret... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetCharmProfiles indicates an expected call of SetCharmProfiles | [
"func (mr *MockMutaterMachineMockRecorder) SetCharmProfiles(arg0 interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"SetCharmProfiles\", reflect.TypeOf((*MockMutaterMachine)(nil).SetCharmProfiles), arg0)\n}"
] | [
"public final void setTemplateMode(final TemplateMode templateMode) {\n Validate.notNull(templateMode, \"Cannot set a null template mode value\");\n // We re-parse the specified template mode so that we make sure we get rid of deprecated values\n this.templateMode = TemplateMode.parse(templateM... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
----------------------------------------------------------------------- | [
"@Override\n public Task createTask(Task task) throws NameConflictException {\n try {\n return taskDao.createTask(task);\n } catch (DuplicateKeyException e) {\n throw new NameConflictException(\"Task name is already in use\", e);\n }\n }"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the post about language and writing:",
"pos": "Represent the code about language and writing:",
"neg": "Represent the code:"
} |
Conver a path string to a list of path elements. | [
"def path_to_list(pathstr):\n \"\"\"\"\"\"\n return [elem for elem in pathstr.split(os.path.pathsep) if elem]"
] | [
"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... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Display message on error output
@param string $message
@param string $endLine
@return void | [
"public static function err($message, $endLine = PHP_EOL)\n {\n if (! Argument::getInstance()->has('quiet')) {\n fwrite(STDERR, $message . $endLine);\n }\n }"
] | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Replaces all terminators with space or dots. The final string will contain only
alphanumerics and dots.
@param text
@return | [
"public static String unifyTerminators(String text) {\n text = text.replaceAll(\"[\\\",:;()\\\\-]+\", \" \"); // Replace commas, hyphens, quotes etc (count them as spaces)\n text = text.replaceAll(\"[\\\\.!?]\", \".\"); // Unify terminators\n text = text.replaceAll(\"\\\\.[\\\\. ]+\", \".\"); /... | [
"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 PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
// SetTimestamps sets the Timestamps field's value. | [
"func (s *MetricDataResult) SetTimestamps(v []*time.Time) *MetricDataResult {\n\ts.Timestamps = v\n\treturn s\n}"
] | [
"function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set orderStatusDetail.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Order\OrderStatusDetail $orderStatusDetail
@return Order | [
"public function setOrderStatusDetail(\\Gpupo\\CommonSchema\\ORM\\Entity\\Trading\\Order\\OrderStatusDetail $orderStatusDetail = null)\n {\n $this->order_status_detail = $orderStatusDetail;\n\n return $this;\n }"
] | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
assignment: logical_or_expr ['=' logical_or_expr] | [
"def assignment(self):\n \n node = self.logical_or_expr()\n if self.token.nature == Nature.ASSIGN:\n token = self.token\n self._process(Nature.ASSIGN)\n right = self.logical_or_expr()\n return Assignment(left=node, op=token, right=right)\n else... | [
"def p_notplus_assignment(self, t):\n ''''''\n self.accu.add(Term('obs_vlabel', [self.name,\"gen(\\\"\"+t[1]+\"\\\")\",\"notPlus\"]))"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Set path.
@param Path $path
@return Step | [
"public function setPath(Path $path = null)\n {\n if (!empty($this->path)) {\n $this->path->removeStep($this);\n }\n\n $this->path = $path;\n\n if (!empty($path)) {\n $path->addStep($this);\n }\n\n return $this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Construct an exception for the current context.
@param message The error message. | [
"private SAXParseException makeException (String message)\n {\n if (locator != null) {\n return new SAXParseException(message, locator);\n } else {\n return new SAXParseException(message, null, null, -1, -1);\n }\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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Generate a variable size thumbnail on an img or canvas, returning a promise that is fulfilled when the attempt completes. Thumbnail can either be based off of a URL for an image returned by the server in the upload response, or the associated `Blob`. | [
"function(fileId, imgOrCanvas, maxSize, fromServer, customResizeFunction) {\n var promiseToReturn = new qq.Promise(),\n fileOrUrl, options;\n\n if (this._imageGenerator) {\n fileOrUrl = this._thumbnailUrls[fileId];\n options = {\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 ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about File management:"
} |
Get only blog IDs.
@return array | [
"function getBookIds() {\n\n\t\t/** @var $wpdb \\wpdb */\n\t\tglobal $wpdb;\n\n\t\t$sql = \"SELECT blogs_id FROM {$this->dbTable} WHERE users_id = %d AND deleted = 0 \";\n\n\t\treturn $wpdb->get_col( $wpdb->prepare( $sql, $this->userId ) ); // @codingStandardsIgnoreLine\n\t}"
] | [
"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 summarization about database:",
"pos": "Represent the code about database:",
"neg": "Represent the code about programming:"
} |
Return a new ``<Default>`` element with attributes set to parameter
values. | [
"def new(ext, content_type):\n \n xml = '<Default xmlns=\"%s\"/>' % nsmap['ct']\n default = parse_xml(xml)\n default.set('Extension', ext)\n default.set('ContentType', content_type)\n return default"
] | [
"def visit_rule(self, node, rule):\n \"\"\"\"\"\"\n label, equals, expression = rule\n expression.name = label # Assign a name to the expr.\n return expression"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Try to get some rate limiting info from the response, and store it if it is
available.
@param Response $response | [
"function parseRateLimit(Response $response) {\n $newRateLimit = \\GithubService\\RateLimit::createFromResponse($response);\n if ($newRateLimit != null) {\n $this->rateLimit = $newRateLimit;\n }\n }"
] | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Enable buffering for the frame from that point onwards. | [
"def buffer(self, frame):\n \"\"\"\"\"\"\n frame.buffer = self.temporary_identifier()\n self.writeline('%s = []' % frame.buffer)"
] | [
"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 ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about File management:"
} |
// SetGte sets the Gte field's value. | [
"func (s *Condition) SetGte(v int64) *Condition {\n\ts.Gte = &v\n\treturn s\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Shortcut to get the value of the given attribute name. | [
"public UnprotectedStringBuffer getAttributeValueWithPrefix(CharSequence prefix, CharSequence name) {\r\n\t\tfor (Attribute attr : event.attributes)\r\n\t\t\tif (attr.localName.equals(name) && attr.namespacePrefix.equals(prefix))\r\n\t\t\t\treturn attr.value;\r\n\t\treturn null;\r\n\t}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about CSS:",
"pos": "Represent the Github code about CSS:",
"neg": "Represent the Github code:"
} |
Assign filesystem to use for non-public files
@param Filesystem $filesystem
@throws InvalidArgumentException
@return $this | [
"public function setProtectedFilesystem(Filesystem $filesystem)\n {\n if (!$filesystem->getAdapter() instanceof ProtectedAdapter) {\n throw new InvalidArgumentException(\"Configured adapter must implement ProtectedAdapter\");\n }\n $this->protectedFilesystem = $filesystem;\n ... | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Save data item
@param DataItem|array $item Data item
@param bool $autoUpdate Create item if doesn't exists
@return DataItem
@throws \Exception | [
"public function save($item, $autoUpdate = true)\n {\n $result = null;\n $this->allowSave = true;\n if (isset($this->events[ self::EVENT_ON_BEFORE_SAVE ])) {\n $this->secureEval($this->events[ self::EVENT_ON_BEFORE_SAVE ], array(\n 'item' => &$item\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 Aimeos:",
"pos": "Represent the Github code about Aimeos:",
"neg": "Represent the Github code:"
} |
Send the current Crazyflie X, Y, Z position. This is going to be
forwarded to the Crazyflie's position estimator. | [
"def send_extpos(self, pos):\n \n\n pk = CRTPPacket()\n pk.port = CRTPPort.LOCALIZATION\n pk.channel = self.POSITION_CH\n pk.data = struct.pack('<fff', pos[0], pos[1], pos[2])\n self._cf.send_packet(pk)"
] | [
"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 # CAR... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Fallback: ask conda in PATH for its prefix | [
"def conda_prefix():\n \"\"\"\"\"\"\n try:\n out = subprocess.check_output(['conda', 'info', '--json'])\n return json.loads(out.decode())[\"default_prefix\"]\n except (subprocess.CalledProcessError, json.JSONDecodeError, OSError):\n return False"
] | [
"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... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Technology:"
} |
Returns all the commerce discount user segment rels where commerceDiscountId = ?.
@param commerceDiscountId the commerce discount ID
@return the matching commerce discount user segment rels | [
"@Override\n\tpublic List<CommerceDiscountUserSegmentRel> findByCommerceDiscountId(\n\t\tlong commerceDiscountId) {\n\t\treturn findByCommerceDiscountId(commerceDiscountId, QueryUtil.ALL_POS,\n\t\t\tQueryUtil.ALL_POS, null);\n\t}"
] | [
"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... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Convert_kops_AccessSpec_To_v1alpha1_AccessSpec is an autogenerated conversion function. | [
"func Convert_kops_AccessSpec_To_v1alpha1_AccessSpec(in *kops.AccessSpec, out *AccessSpec, s conversion.Scope) error {\n\treturn autoConvert_kops_AccessSpec_To_v1alpha1_AccessSpec(in, out, s)\n}"
] | [
"func NewProtoWrapperWithSerializer(db keyval.CoreBrokerWatcher, serializer keyval.Serializer) *ProtoWrapper {\n\t// OBSOLETE, use NewProtoWrapper\n\treturn NewProtoWrapper(db, serializer)\n}"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Sets the {@link IGeneratorParameter} for the active {@link IRenderer}.
@param <T>
@param paramType {@link IGeneratorParameter} to set the value of.
@param value new {@link IGeneratorParameter} value | [
"public <T extends IGeneratorParameter<S>, S, U extends S> void set(Class<T> paramType, U value) {\n T parameter = getParameter(paramType);\n parameter.setValue(value);\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// DeleteDisk implements Volumes.DeleteDisk | [
"func (c *Cloud) DeleteDisk(volumeName KubernetesVolumeID) (bool, error) {\n\tawsDisk, err := newAWSDisk(c, volumeName)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tavailable, err := c.checkIfAvailable(awsDisk, \"deleting\", \"\")\n\tif err != nil {\n\t\tif isAWSErrorVolumeNotFound(err) {\n\t\t\tklog.V(2).Info... | [
"@Override\n public void performFileBasedAction(Collection<File> files) {\n Tr.audit(tc, \"LTPA_KEYS_TO_LOAD\", keyImportFile);\n submitTaskToCreateLTPAKeys();\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Removes files with EXPTIME==0 from filelist. | [
"def check_exptime(filelist):\n \n toclose = False\n removed_files = []\n for f in filelist:\n if isinstance(f, str):\n f = fits.open(f)\n toclose = True\n\n try:\n exptime = f[0].header['EXPTIME']\n except KeyError:\n removed_files.append... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// KeepAliveNode updates node keep alive information | [
"func (c *Client) KeepAliveNode(ctx context.Context, keepAlive services.KeepAlive) error {\n\treturn trace.BadParameter(\"not implemented, use StreamKeepAlives instead\")\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the description about Networking:",
"pos": "Represent the code about Networking:",
"neg": "Represent the code:"
} |
Modular square
@see protectedSlidingWindow()
@access private
@param Array $x
@param Array $n
@param Integer $mode
@return Array | [
"public function protectedSquareReduce($x, $n, $mode)\n {\n if ($mode == MATH_BIGINTEGER_MONTGOMERY) {\n return $this->protectedMontgomeryMultiply($x, $x, $n);\n }\n return $this->protectedReduce($this->protectedSquare($x), $n, $mode);\n }"
] | [
"function resolve(){\n\t\tLRState::clear_index();\n\t\tLRStation::clear_index();\n\t\t// create Root Set\n\t\t// we SHOULD have a single etransition to an intial state\n\t\treturn LRStateSet::init( $this->etransitions[0], $this->Grammar );\n\t}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
// RegisterAuthServerStaticFromParams creates and registers a new
// AuthServerStatic, loaded for a JSON file or string. If file is set,
// it uses file. Otherwise, load the string. It log.Exits out in case
// of error. | [
"func RegisterAuthServerStaticFromParams(file, str string) {\n\tauthServerStatic := NewAuthServerStatic()\n\n\tauthServerStatic.loadConfigFromParams(file, str)\n\n\tif len(authServerStatic.Entries) <= 0 {\n\t\tlog.Exitf(\"Failed to populate entries from file: %v\", file)\n\t}\n\tauthServerStatic.installSignalHandle... | [
"func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
* simple map. calls recursive function as return statement | [
"function findRequiredFieldsProps(requiredFields){\n\treturn requiredFields.map((item) => {\n\t\treturn { \n\t\t\tprops: findValueOfChildren(item.value, item.fieldToBeValidated), \n\t\t\t...item \n\t\t};\n\t});\n}"
] | [
"def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Check if a column exists in an SFrame with error message. | [
"def _raise_error_if_column_exists(dataset, column_name = 'dataset',\n dataset_variable_name = 'dataset',\n column_name_error_message_name = 'column_name'):\n \n err_msg = 'The SFrame {0} must contain the column {1}.'.format(\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the column identifier.
@return string $identifier | [
"public function identifier($identifier = null)\n {\n if (null === $identifier) {\n return $this->identifier;\n }\n\n $this->identifier = $identifier;\n return $this;\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Get a subset of the items from the input data.
@param {Array|String} key
@return {Array} | [
"function (key) {\n var keys = Array.isArray(key) ? key : arguments;\n\n var input = self.input.all();\n var results = {};\n\n for (var i = 0; i < keys.length; i++) {\n results[keys[i]] = input[keys[i]];\n }\n\n return results;\n ... | [
"public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Documentation:"
} |
Process the Lte operator.
@return boolean|null Whether the first sub-expression is numerically less than or equal to the second or NULL if either sub-expression is NULL.
@throws \qtism\runtime\expressions\operators\OperatorProcessingException | [
"public function process()\n {\n $operands = $this->getOperands();\n\n if ($operands->containsNull() === true) {\n return null;\n }\n\n if ($operands->exclusivelySingle() === false) {\n $msg = \"The Lte operator only accepts operands with a single cardinality.\";... | [
"public function setMaxComparison(ComparisonExpression $maxComparison)\n {\n if($maxComparison->getField() != $this->getField()) {\n throw new \\InvalidArgumentException('Field of Minimum Comparison is not equal to field of Range.');\n } else if($maxComparison->getValue()->isNull() && !(... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// GetStatusCode will return the status code associated with an error, and
// default_code if none is found. | [
"func GetStatusCode(err error, default_code int) int {\n\trv := errors.GetData(err, statusCode)\n\tsc, ok := rv.(int)\n\tif ok {\n\t\treturn sc\n\t}\n\treturn default_code\n}"
] | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Generate an image of the specified page in the PDF
@param int $pageno the page to generate the image of
@throws \moodle_exception
@throws \coding_exception
@return string the filename of the generated image | [
"public function get_image($pageno) {\n global $CFG;\n\n if (!$this->filename) {\n throw new \\coding_exception('Attempting to generate a page image without first setting the PDF filename');\n }\n\n if (!$this->imagefolder) {\n throw new \\coding_exception('Attempti... | [
"public function setOutputDestination(string $destination): PdfInterface\n {\n /**\n * Destinations can be sent to the following:\n * - I/B [Inline] - Sends output to browser (browser plug-in is used if avaialble)\n * If a $filename is given, the browser'... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Prepare for insert or update.
@param array $input
@return mixed | [
"public function prepare($input)\n {\n foreach ($input as $key => $record) {\n $this->setFieldOriginalValue($key);\n $input[$key] = $this->prepareValue($key, $record);\n }\n\n return $input;\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 summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
@param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event
@throws \Exception | [
"public function onKernelExceptionView(GetResponseForExceptionEvent $event)\n {\n if (!$event->getRequest()->attributes->get('is_rest_request')) {\n return;\n }\n\n $event->setResponse(\n $this->viewDispatcher->dispatch(\n $event->getRequest(),\n ... | [
"protected function beforeDispatch(RequestInterface $request, ResponseInterface $response)\n {\n RequestContext::setRequest($request);\n RequestContext::setResponse($response);\n\n // Trigger 'Before Request' event\n App::trigger(HttpServerEvent::BEFORE_REQUEST);\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about PHP:"
} |
Helper method for generating the instance of a handler from its string
definition in config. Ie. No mapped values for setters, or list of
constructor fields. To note: It could either implement HttpHandler, or
HandlerProvider.
@param handler | [
"private static void initStringDefinedHandler(String handler) {\n\t\t// split the class name and its label, if defined\n\t\tTuple<String, Class> namedClass = splitClassAndName(handler);\n\n\t\t// create an instance of the handler\n\t\tObject handlerOrProviderObject = null;\n\t\ttry {\n\t\t\thandlerOrProviderObject ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Publish to a location. | [
"public <T> void publisher(Class<T> api,\n Result<T> result)\n {\n String path = api.getName();\n \n String address = address(path);\n \n ServicesAmp manager = ServicesAmp.current();\n ServiceRefAmp pubRef = manager.service(address);\n \n result.ok(pubRef.as(a... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Support the json-server fulltext search with a broad LIKE filter. | [
"def _create_fulltext_query(self):\n \"\"\"\"\"\"\n filter_by = []\n\n if 'q' in request.args:\n columns = flat_model(model_tree(self.__class__.__name__, self.model_cls))\n for q in request.args.getlist('q'):\n filter_by += ['{col}::like::%{q}%'.format(col=c... | [
"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... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Technology:"
} |
// SetStartDateTime sets the StartDateTime field's value. | [
"func (s *InstanceGroupDetail) SetStartDateTime(v time.Time) *InstanceGroupDetail {\n\ts.StartDateTime = &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.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Apply a decoration to given range, with given props | [
"function callback (start, end, props) {\n if (props === undefined) {\n props = {};\n }\n key = blockKey + KEY_SEPARATOR + decorationId;\n decorated[blockKey][decorationId] = props;\n decorateRange(decorations, start, end, key);\n decorationId++;\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 co... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Creates a new AIT command with the given arguments. | [
"def create(self, name, *args, **kwargs):\n \"\"\"\"\"\"\n tokens = name.split()\n\n if len(tokens) > 1 and (len(args) > 0 or len(kwargs) > 0):\n msg = 'A Cmd may be created with either positional arguments '\n msg += '(passed as a string or a Python list) or keyword '\n ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return a tree of nested nodes. If no ID is provided, the top level root will be used.
@param int $id
@return array | [
"public function getTree($id = null) {\n $parent = $this->getConfig('parentField');\n $left = $this->getConfig('leftField');\n $right = $this->getConfig('rightField');\n\n $query = $this->getRepository()->select()->orderBy($left, 'asc');\n\n if ($id) {\n if ($parentNode... | [
"@Override\n public IEntityGroup find(String key) throws GroupsException {\n\n if (isTreeRefreshRequired()) {\n refreshTree();\n }\n\n log.debug(\"Invoking find() for key: {}\", key);\n\n // All of our groups (incl. ROOT_GROUP)\n // are indexed in the 'groups' map b... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Returns the number of lines in the log file.
@param array|null $filter
@return int | [
"public function countLines($filter = null)\n {\n if ($filter !== null) {\n return count($this->getLines(null, 0, $filter));\n }\n\n return $this->lines->count();\n }"
] | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Save keywords to the layer.
It will write out the keywords for the current layer.
This method is based on the KeywordsDialog class. | [
"def save_current_keywords(self):\n \n current_keywords = self.get_keywords()\n try:\n self.keyword_io.write_keywords(\n layer=self.layer, keywords=current_keywords)\n except InaSAFEError as e:\n error_message = get_error_message(e)\n # noi... | [
"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 co... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Detect CSS pointer-events support. | [
"function checkCssPointerEventsSupported() {\n\n // Check for existence of CSS property.\n var style = document.createElement('a').style;\n style.cssText = 'pointer-events:auto';\n var hasCssProperty = style.pointerEvents === 'auto';\n\n // The above result is spurious on emulation mode for IE 8-10.\n var isO... | [
"function () {\n if (__autoresizes == null) {\n __autoresizes = [];\n ariaUtilsAriaWindow.attachWindow();\n eventUtils.addListener(Aria.$window, \"resize\", {\n fn : __onResize\n });\n // PTR 08127833 - it updates the viewport sizes the fi... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// IndexSelector returns the position of the first element within the
// Selection object relative to the elements matched by the selector, or -1 if
// not found. | [
"func (s *Selection) IndexSelector(selector string) int {\n\tif len(s.Nodes) > 0 {\n\t\tsel := s.document.Find(selector)\n\t\treturn indexInSlice(sel.Nodes, s.Nodes[0])\n\t}\n\treturn -1\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 diff... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Parse a WebSocket URL.
@example Parse
url = LibWebSocket::URL.new
url.parse('wss://example.com:3000')
url.host # => example.com
url.port # => 3000
url.secure # => true | [
"def parse(string)\n return nil unless string.is_a?(String)\n\n uri = Addressable::URI.parse(string)\n\n scheme = uri.scheme\n return nil unless scheme\n\n self.secure = true if scheme.match(/ss\\Z/m)\n\n host = uri.host\n host = '/' unless host && host != ''\n self.host = ho... | [
"def cd(url)\n new_uri = @uri.merge(url)\n if new_uri.host != @uri.host || new_uri.port != @uri.port || new_uri.scheme != @uri.scheme\n raise Exception , \"uri must have same scheme, host and port\"\n end\n @uri = new_uri\n end"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Convenience helper for generating new random value | [
"func (c SimpleFSClient) SimpleFSMakeOpid(ctx context.Context) (res OpID, err error) {\n\terr = c.Cli.Call(ctx, \"keybase.1.SimpleFS.simpleFSMakeOpid\", []interface{}{SimpleFSMakeOpidArg{}}, &res)\n\treturn\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
Marshal Multi-Object Delete request body from object names.
:param object_names: List of object keys to be deleted.
:return: Serialized XML string for multi-object delete request body. | [
"def xml_marshal_delete_objects(object_names):\n \n root = s3_xml.Element('Delete')\n\n # use quiet mode in the request - this causes the S3 Server to\n # limit its response to only object keys that had errors during\n # the delete operation.\n quiet = s3_xml.SubElement(root, 'Quiet')\n quiet.t... | [
"def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about AWS S3:"
} |
Write the attribute to a file-like object | [
"def dump(self, f, name):\n \"\"\"\"\"\"\n array = self.get()\n # print the header line\n print(\"% 40s kind=%s shape=(%s)\" % (\n name,\n array.dtype.kind,\n \",\".join([str(int(size_axis)) for size_axis in array.shape]),\n ), file=f)\n #... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github post about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code:"
} |
Replace each target node with the set of matched nodes.
@param Node|Node[]|NodeCollection $targets Targets to replace.
@return $this | [
"public function replaceAll($targets) {\n if ($targets instanceof Node) {\n $targets->replaceWith($this->nodes);\n }\n elseif ($targets instanceof NodeCollection || is_array($targets)) {\n $first = TRUE;\n /** @var Node $target */\n foreach ($targets as $target) {\n $target->repl... | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Take JSON, revert back to ical
@param {Object} object
@return {String} | [
"function revert(object) {\n let lines = [];\n\n for (let key in object) {\n let value = object[key];\n if (Array.isArray(value)) {\n value.forEach((item) => {\n lines.push(`BEGIN:${key}`);\n lines.push(revert(item));\n lines.push(`END:${key}`);\n });\n } else {\n let ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the text about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code:"
} |
Marks a callback as wanting to receive the current context
object as first argument. | [
"def pass_context(f):\n \n def new_func(*args, **kwargs):\n return f(get_current_context(), *args, **kwargs)\n return update_wrapper(new_func, f)"
] | [
"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 l... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// NewInts returns a *Ints with customized less func and initial capacity. | [
"func NewInts(less func(x, y int) bool, cap int) *Ints {\n\th := &Ints{}\n\n\tif less != nil {\n\t\th.less = func(i, j int) bool {\n\t\t\treturn less(h.list[i], h.list[j])\n\t\t}\n\t}\n\tif cap > 0 {\n\t\th.list = make(sort.IntSlice, 0, cap)\n\t}\n\n\treturn h\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Syntactic sugar for Handle("PATCH", path, handler) | [
"func (g *Group) PATCH(path string, handler HandlerFunc) {\n\tg.Handle(\"PATCH\", path, handler)\n}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
flatten -> execute {@code op} -> set values back.
<pre>
<code>
f.flattOp(a, t -> N.sort(t));
</code>
</pre>
@param a
@param op
@throws E | [
"public static <T, E extends Exception> void flattOp(final T[][] a, Try.Consumer<T[], E> op) throws E {\r\n if (N.isNullOrEmpty(a)) {\r\n return;\r\n }\r\n\r\n final T[] tmp = flattenn(a);\r\n\r\n op.accept(tmp);\r\n\r\n int idx = 0;\r\n\r\n for (T[] e : a) {\r\n... | [
"public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> mapDoubles(DoubleUnaryOperator b){\n\n return a->a.doubles(i->i,s->s.map(b));\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
// NewDialer creates a new Dialer instance.
//
// If dial is not nil, it will be used to create new underlying connections.
// Otherwise net.DialContext is used. | [
"func NewDialer(dial DialFunc) *Dialer {\n\treturn &Dialer{\n\t\tdial: dial,\n\t\tconns: make(map[*closableConn]struct{}),\n\t}\n}"
] | [
"func (e *endpoint) Attach(dispatcher stack.NetworkDispatcher) {\n\te.dispatcher = dispatcher\n\t// Link endpoints are not savable. When transportation endpoints are\n\t// saved, they stop sending outgoing packets and all incoming packets\n\t// are rejected.\n\tgo e.dispatchLoop()\n}"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Initialisation function.
@param ZoneInterface $zone | [
"public function init(ZoneInterface $zone)\n {\n $this->zone = $zone;\n $this->components = $zone->getComponents()->indexBy('id');\n\n return $this;\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:"
} |
Returns an array of all folder names within the source folder or FALSE
if SourceFolder does not exist.
@param string $SourceFolder
@todo Documentation and variable type is needed for $SourceFolder. | [
"public static function Folders($SourceFolders) {\n if(!is_array($SourceFolders))\n $SourceFolders = array($SourceFolders);\n \n $BlackList = Gdn::Config('Garden.FolderBlacklist');\n if (!is_array($BlackList))\n $BlackList = array('.', '..');\n \n $Result = array();\n ... | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// ReadElements deserializes a variable number of elements into the passed
// io.Reader, with each element being deserialized according to the ReadElement
// function. | [
"func ReadElements(r io.Reader, elements ...interface{}) error {\n\tfor _, element := range elements {\n\t\terr := ReadElement(r, element)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Register user-defined swoole tables. | [
"protected function registerTables()\n {\n $tables = $this->container->make('config')->get('swoole.tables', []);\n\n foreach ($tables as $key => $value) {\n $table = new SwooleTable($value['size']);\n $columns = $value['columns'] ?? [];\n foreach ($columns as $col... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Edit an item with option to create if it doesn't exist
@param int $id
@param array $parameters
@param bool $createIfNotExists = false
@return array|mixed | [
"public function edit($id, array $parameters, $createIfNotExists = false)\n {\n $method = $createIfNotExists ? 'PUT' : 'PATCH';\n $supported = $this->isSupported('edit');\n\n return (true === $supported) ? $this->makeRequest($this->endpoint.'/'.$id.'/edit', $parameters, $method) : $suppor... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the description about Aimeos:",
"pos": "Represent the code about Aimeos:",
"neg": "Represent the code about Software development:"
} |
get the collection of status returned by Wirecard's Payment Processing Gateway
@return StatusCollection
@throws MalformedResponseException | [
"private function generateStatusCollection()\n {\n $collection = new StatusCollection();\n\n /**\n * @var $statuses \\SimpleXMLElement\n */\n if (!isset($this->simpleXml->{'statuses'})) {\n throw new MalformedResponseException('Missing statuses in response.');\n ... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Search the locale for specified language, specified country and
specified variant. | [
"private Locale searchLocale(String language, String country,\n String variant) {\n Locale[] locales = Locale.getAvailableLocales();\n for (int i = 0; i < locales.length; i++) {\n if (locales[i].getLanguage().equals(language) &&\n (country == nul... | [
"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... | codesearchnet | {
"query": "Represent the text about Language and programming:",
"pos": "Represent the code about Language and programming:",
"neg": "Represent the code:"
} |
Rejects arbitrary session ids.
@SuppressWarnings(PHPMD.Superglobals)
@see http://php.net/manual/en/features.session.security.management.php#features.session.security.management.non-adaptive-session Why this security measure is important.
@return void | [
"private function handleStrict(): void\n {\n if (!ini_get('session.use_strict_mode') || headers_sent()) {\n return;\n }\n\n $cookieName = session_name();\n if (empty($_COOKIE[$cookieName])) {\n return;\n }\n\n $sessionId = $_COOKIE[$cookieName];\n\n... | [
"public function isValidSource(?string $id): bool\n {\n if ($id == '') {\n return false;\n }\n\n if ($this->saveHandler != null && method_exists($this->saveHandler, 'isValidSource')) {\n return $this->saveHandler->isValidSource($id);\n }\n\n // for 'sess_'... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Retrieve a simple csrf token for to prevent cross site request forgery. | [
"def get_csrf_token():\n \"\"\"\"\"\"\n url = get_url(\"/simplecsrf/token.json\")\n r = s.get(url=url, headers=DEFAULT_ORIGIN)\n return r.json()[\"token\"]"
] | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Add page_contents for enterprisecontent type
@param \Haven\CmsBundle\Entity\PageContent $pageContents
@return Page | [
"public function addEnterpriseContent(\\Haven\\CmsBundle\\Entity\\PageContent $pageContents) {\n\n $this->addPageContent($pageContents);\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
queue an emission of a message for all output plugins | [
"def queue_emission(self, msg):\n \n if not msg:\n return\n for _emitter in self._emit:\n if not hasattr(_emitter, 'emit'):\n continue\n def emit(emitter=_emitter):\n self.log.debug(\"emit to {}\".format(emitter.name))\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 ... | codesearchnet | {
"query": "Represent the Github post about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about File management:"
} |
Set/get actor's color.
If None is passed as input, will use colors from active scalars.
Same as `c()`. | [
"def color(self, c=False):\n \n if c is False:\n return np.array(self.GetProperty().GetColor())\n elif c is None:\n self.GetMapper().ScalarVisibilityOn()\n return self\n else:\n self.GetMapper().ScalarVisibilityOff()\n self.GetProper... | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Renders detailed service information about one service | [
"protected function outputService(OutputInterface $output, $serviceId)\n {\n $definition = $this->resolveServiceDefinition($serviceId);\n\n $label = sprintf('Information for service <info>%s</info>', $serviceId);\n $output->writeln($this->getHelper('formatter')->formatSection('container', $l... | [
"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... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns discharge_capacity (in mAh/g), and voltage. | [
"def get_dcap(self, cycle=None, dataset_number=None):\n \"\"\"\"\"\"\n\n # TODO: should return a DataFrame as default\n # but remark that we then have to update e.g. batch_helpers.py\n\n dataset_number = self._validate_dataset_number(dataset_number)\n if dataset_number is None:\... | [
"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 evaluato... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
control the PS shape of 2-d instances | [
"double psfunc2(double x, double t1, int dim, int type, int css) {\n // type: the type of curve \n // css: the class of index\n double beta;\n beta = 0.0;\n\n dim++;\n\n if (type == 21) {\n double xy = 2 * (x - 0.5);\n beta = xy - Math.pow(t1, 0.5 * (nvar + 3 * dim - 8) / (nvar - 2));... | [
"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(wh... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Write the call info to file | [
"def write(_filename, _long, enter=True):\n \"\"\"\"\"\"\n def method(*arg, **kw): # pylint: disable=W0613\n \"\"\"Reference to the advice in order to facilitate argument support.\"\"\"\n def get_short(_fname):\n \"\"\"Get basename of the file. If file is __init__.py, get its directo... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Adding article to accessories article list | [
"public function addArticleAcc()\n {\n $oArticle = oxNew(\\OxidEsales\\Eshop\\Application\\Model\\Article::class);\n $aChosenArt = $this->_getActionIds('oxarticles.oxid');\n $soxId = \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('synchoxid');\n\n // adding\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Parse an array of tokens into a syntax tree
@param {object[]} tokens
@returns {object} | [
"function parser(tokens) {\n // add Close token before each Else\n const toks = tokens.reduce((prev, tok) => {\n if (tok.tokenType === 'Else') {\n return [...prev, new Close(), tok];\n }\n\n return [...prev, tok];\n }, []);\n\n const [body] = parse(toks, '', 1);\n return body;\n}"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// autopilotCommands will return the set of commands to enable for autopilotrpc
// builds. | [
"func autopilotCommands() []cli.Command {\n\treturn []cli.Command{\n\t\t{\n\t\t\tName: \"autopilot\",\n\t\t\tCategory: \"Autopilot\",\n\t\t\tUsage: \"Interact with a running autopilot.\",\n\t\t\tDescription: \"\",\n\t\t\tSubcommands: []cli.Command{\n\t\t\t\tgetStatusCommand,\n\t\t\t\tenableCommand,\... | [
"def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Stops the thread that fetches data from the Streams view server. | [
"def stop_data_fetch(self):\n \n if self._data_fetcher:\n self._data_fetcher.stop.set()\n self._data_fetcher = None"
] | [
"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 # CAR... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
根据用户名获取STU日志.
@param string $username 目标用户名,NETID账号
@return string | [
"public function getStuPppoeByUsername(string $username) {\n try {\n $response = $this->http()->get('check_stu_pppoe_log_utf8.php', [\n 'query' => [\n 'username' => $username\n ]\n ]);\n return $this->parseResponse($response);\... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Check if `obj` is a sequence, but not a string or bytes. | [
"def is_sequence(obj):\n \"\"\"\"\"\"\n return isinstance(obj, Sequence) and not (\n isinstance(obj, str) or BinaryClass.is_valid_type(obj))"
] | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
callback from flash that executes a local JS function used mostly when setting js functions as callbacks on events | [
"function(funcID, args)\r\n {\r\n var result;\r\n var func = this.localFunctionCache[funcID];\r\n\r\n if(func != undefined)\r\n {\r\n result = this.serialize(func.apply(null, this.deserialize(args)));\r\n }\r\n\r\n return result;\r\n }"
] | [
"function (message) {\n if ('string' !== typeof message) {\n callFunc(WebViewBridge.onError, \"message is type '\" + typeof message + \"', and it needs to be string\");\n return;\n }\n\n //we queue the messages to make sure that native can collects all of them in one shot.\n sendQu... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Maps an SplObjectStorage proxy record back to an SplObjectStorage
@param array $objectStorageValues
@param boolean $createLazySplObjectStorage
@return \SplObjectStorage
@todo restore information attached to objects? | [
"protected function mapSplObjectStorage(array $objectStorageValues = null, $createLazySplObjectStorage = false)\n {\n if ($objectStorageValues === null) {\n return new \\SplObjectStorage();\n }\n\n if ($createLazySplObjectStorage) {\n $objectIdentifiers = [];\n ... | [
"private void checkSchemaFields(ZooClassDef schema, Collection<ZooClassDef> cachedSchemata, \n\t\t\tSet<String> missingSchemas) {\n\t\t//do this only now, because only now we can check which field types\n\t\t//are really persistent!\n\t\t//TODO check for field types that became persistent only now -> error!!\n\t\t/... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Returns shops order execution link
@return string | [
"public function getExeOrderLink()\n {\n if (($sValue = $this->getViewConfigParam('exeorderlink')) === null) {\n $sValue = $this->getConfig()->getShopSecureHomeUrl() . 'cl=order&fnc=execute';\n $this->setViewConfigParam('exeorderlink', $sValue);\n }\n\n return $sVal... | [
"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 summarization about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about Software development:"
} |
// XTOI2 converts the next two hex digits of s into a byte.
// If s is longer than 2 bytes then the third byte must be e.
// If the first two bytes of s are not hex digits or the third byte
// does not match e, false is returned. | [
"func XTOI2(s string, e byte) (byte, bool) {\n\tif len(s) > 2 && s[2] != e {\n\t\treturn 0, false\n\t}\n\tn, ei, ok := XTOI(s[:2], 0)\n\treturn byte(n), ok && ei == 2\n}"
] | [
"def encode_streaming(self, data):\n \n # Buffer value and size\n buffer = 0\n size = 0\n for s in data:\n b, v = self._table[s]\n # Shift new bits in the buffer\n buffer = (buffer << b) + v\n size += b\n while size >= 8:\n ... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Get the concrete target the specified target was (directly or indirectly) derived from.
The returned target is guaranteed to not have been derived from any other target.
:API: public | [
"def get_concrete_derived_from(self, address):\n \n current_address = address\n next_address = self._derived_from_by_derivative.get(current_address, current_address)\n while next_address != current_address:\n current_address = next_address\n next_address = self._derived_from_by_derivative.get(... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// NewChainCredentials returns a pointer to a new Credentials object
// wrapping a chain of providers. | [
"func NewChainCredentials(providers []Provider) *Credentials {\n\treturn New(&Chain{\n\t\tProviders: append([]Provider{}, providers...),\n\t})\n}"
] | [
"@SuppressWarnings(\"OptionalGetWithoutIsPresent\")\n public Token<DelegationTokenIdentifier> getBoundOrNewDT(String renewer) throws IOException {\n logger.atFine().log(\"Delegation token requested\");\n if (isBoundToDT()) {\n // the FS was created on startup with a token, so return it.\n logger.at... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
called on a timeout. | [
"public synchronized RPC<V> call() {\n // Any Completer will not be carried over to remote; add it to the RPC call\n // so completion is signaled after the remote comes back.\n CountedCompleter cc = _dt.getCompleter();\n if( cc != null ) handleCompleter(cc);\n\n // If running on self, just submi... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.