query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Adapt weights according one desired value and its input. **Args:** * `d` : desired value (float) * `x` : input array (1-dimensional array)
[ "def adapt(self, d, x):\n \n y = np.dot(self.w, x)\n e = d - y\n nu = self.mu / (self.eps + np.dot(x, x))\n self.w += nu * x * e**3" ]
[ "def get_gates(self, x):\n \n\n # The balance loss don't propagate to the rest of the network\n x = tf.stop_gradient(x)\n # [length, depth] * [depth, nb_vectors * replicat]\n x = tf.matmul(x, self.t_vectors)\n # [length, nb_vector * replicat]\n x = tf.sign(x) # Get on which side of the hyperpl...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about AWS S3:" }
Given a scan ID goes to the index and tries to find a mapping. @throws umich.ms.fileio.exceptions.FileParsingException in case the mapping can't be done
[ "protected int mapIdRefToInternalScanNum(CharArray id) throws FileParsingException {\n String idStr = id.toString();\n MZMLIndexElement byId = index.getById(idStr);\n if (byId == null) {\n String msg = String.format(\"Could not find a mapping from spectrum id\"\n + \" ref to an internal scan ...
[ "def parse(self, ident_str):\n # type: (bytes) -> None\n '''\n \n '''\n if self._initialized:\n raise pycdlibexception.PyCdlibInternalError('This File or Text identifier is already initialized')\n self.text = ident_str\n\n # FIXME: we do not support a file...
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about File management:" }
Register assets.
[ "protected function registerAssets()\n {\n // If we have to hide the deleted comments, we will define the javascript\n // to destroy the comment instead of the default functionality.\n if ($this->showDeletedComments === FALSE)\n {\n $this->clientOptions['deleteComment'] = T...
[ "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:" }
Handles CRUD calls to individual UIDMeta data entries @param tsdb The TSDB from the RPC router @param query The query for this request
[ "private void handleUIDMeta(final TSDB tsdb, final HttpQuery query) {\n\n final HttpMethod method = query.getAPIMethod();\n // GET\n if (method == HttpMethod.GET) {\n \n final String uid = query.getRequiredQueryStringParam(\"uid\");\n final UniqueIdType type = UniqueId.stringToUniqueIdType(\...
[ "@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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Adds a bind variable value to the statement. @param key the value key @param value the bind variable value @return a reference to this object
[ "public StatementBuilder withBindVariableValue(String key, Value value) {\n queryBuilder.withBindVariableValue(key, value);\n return this;\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Responsible for setting the tick labels on a given axis @param string $axis @param array $ticks @return \Altamira\JsWriter\Flot
[ "public function setAxisTicks($axis, array $ticks = array() )\n {\n if ( in_array($axis, array('x', 'y') ) ) {\n\n $isString = false;\n $alternateTicks = array();\n $cnt = 1;\n\n foreach ($ticks as $tick) {\n if (!(ctype_digit($tick) || is_int($ti...
[ "public function setStyle($cssStyle) {\n\t\treturn $this->setMemberCtrl($this->style,CssRef::getStyle($cssStyle, \"progress-bar\"), CssRef::Styles(\"progress-bar\"));\n\t}" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// DeleteOne deletes an individual message by storage ID
[ "func (mongo *MongoDB) DeleteOne(id string) error {\n\t_, err := mongo.Collection.RemoveAll(bson.M{\"id\": id})\n\treturn err\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
将导航项加入到分类中 @param array $categories @param array $subCategories @param array $navs @return array
[ "protected function combine(array $categories, array $subCategories, array $navs)\n {\n // 将导航项加入到子分类中\n foreach ($navs as $nav) {\n $nav += $this->navDefaults;\n $subCategories[$nav['parentId']]['navs'][] = $nav;\n }\n\n // 将子分类加到父分类中\n foreach ($subCateg...
[ "static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Sets the html-tags from which to extract/find links from. @param array $tag_array Numeric array containing the tags, i.g. array("href", "src", "url", ...) @return bool
[ "public function setLinkExtractionTags($tag_array)\r\n {\r\n if (!is_array($tag_array)) return false;\r\n \r\n $this->LinkFinder->extract_tags = $tag_array;\r\n return true;\r\n }" ]
[ "public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Perform the insertions of place-holding rows and cols for insertions.
[ "def intersperse_hs_in_std_res(slice_, hs_dims, res):\n \"\"\"\"\"\"\n for dim, inds in enumerate(slice_.inserted_hs_indices()):\n if dim not in hs_dims:\n continue\n for i in inds:\n res = np.insert(res, i, np.nan, axis=(dim - slice_.ndim))\n return res" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
simple subscribe/query with filter string
[ "public void subscribe(int subsId, String tableName, String filter, String reducedFields[], Callback<ChangeMessage> changeReceiver) {\n if (filter == null || filter.trim().length() == 0 || filter.trim().equals(\"true\"))\n filter = \"1\";\n ChangeStream table = tableFactory.apply(tableName)...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Look through the buckets cache file for a match. If the field is found, it is retrieved from S3 only if its cached version is missing, or if the MD5 does not match.
[ "def find_file(path, saltenv='base', **kwargs):\n '''\n \n '''\n if 'env' in kwargs:\n # \"env\" is not supported; Use \"saltenv\".\n kwargs.pop('env')\n\n fnd = {'bucket': None,\n 'path': None}\n\n metadata = _init()\n if not metadata or saltenv not in metadata:\n ...
[ "def modified?(path)\n return true if disabled?\n\n # objects that don't have a path are always regenerated\n return true if path.nil?\n\n # Check for path in cache\n return cache[path] if cache.key? path\n\n if metadata[path]\n # If we have seen this file before,\n # che...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Returns ServiceAccountCredentials from give file.
[ "def _GetServiceAccountCredentials(\n client_info, service_account_name=None, service_account_keyfile=None,\n service_account_json_keyfile=None, **unused_kwds):\n \"\"\"\"\"\"\n if ((service_account_name and not service_account_keyfile) or\n (service_account_keyfile and not service_ac...
[ "@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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Pobranie referera @return string
[ "private function _getReferrer()\n {\n //powoływanie przestrzeni nazw\n $space = new \\Mmi\\Session\\SessionSpace(self::SESSION_SPACE_PREFIX . $this->originalId);\n //pobranie referera\n $referer = $space->referer;\n //usunięcie\n $space->unsetAll();\n return $ref...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Get a list of supported locales. @return Locale[]
[ "public function getSupportedLocales()\n {\n $return = [];\n $process = new Process(['locale', '-a']);\n $process->run();\n $installedLocales = explode(PHP_EOL, trim($process->getOutput()));\n foreach ($this->supportedLocales as $supportedLocale) {\n if (in_array($su...
[ "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 Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Documentation:" }
Python2 accumulate implementation taken from https://docs.python.org/3/library/itertools.html#itertools.accumulate
[ "def _accumulate(sequence, func):\n \n iterator = iter(sequence)\n total = next(iterator)\n yield total\n for element in iterator:\n total = func(total, element)\n yield total" ]
[ "def iter_walk_menus(self):\n \n yield self\n for item in self.name_to_command.values():\n if isinstance(item, _Menu):\n # \"Generator delegation\" ;)\n # https://docs.python.org/3/whatsnew/3.3.html#pep-380\n yield from item.iter_walk_menu...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// StatusCode returns HTTP status code embedded inside the annotated error. // // Returns http.StatusOK if err is nil and 0 if the error doesn't have a status // code.
[ "func StatusCode(err error) int {\n\tif err == nil {\n\t\treturn http.StatusOK\n\t}\n\tif val, ok := errors.TagValueIn(statusCodeTagKey, err); ok {\n\t\treturn val.(int)\n\t}\n\treturn 0\n}" ]
[ "func (c *UsersController) DeleteBy(id int64) interface{} {\n\twasDel := c.Service.DeleteByID(id)\n\tif wasDel {\n\t\t// return the deleted user's ID\n\t\treturn map[string]interface{}{\"deleted\": id}\n\t}\n\t// right here we can see that a method function\n\t// can return any of those two types(map or int),\n\t//...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Associate the data cell with header cell of row. :param element: The table body or table footer. :type element: hatemile.util.html.htmldomelement.HTMLDOMElement
[ "def _associate_data_cells_with_header_cells_of_row(self, element):\n \n\n table = self._get_model_table(element)\n for row in table:\n headers_ids = []\n for cell in row:\n if cell.get_tag_name() == 'TH':\n self.id_generator.generate_id(c...
[ "def find_id(self, element_id):\n \n element = _transform.FigureElement.find_id(self, element_id)\n return Element(element.root)" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// newISTag initializes an image stream tag from an image stream and image. The allowEmptyEvent will create a tag even // in the event that the status tag does does not exist yet (no image has successfully been tagged) or the image is nil.
[ "func newISTag(tag string, imageStream *imageapi.ImageStream, image *imageapi.Image, allowEmptyEvent bool) (*imageapi.ImageStreamTag, error) {\n\tistagName := imageapi.JoinImageStreamTag(imageStream.Name, tag)\n\n\tevent := imageapi.LatestTaggedImage(imageStream, tag)\n\tif event == nil || len(event.Image) == 0 {\n...
[ "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n // Get default form\n in.defaultReadObject();\n\n // Create new Archive\n final String name = this.name;\n final ZipImporter archive = ShrinkWrap.create(ZipImporter.class, name);\n\...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Many of collectl's data values are cumulative (monotonically increasing), so subtract the previous value to determine the value for the current interval.
[ "def calc_deltas(data_frame, series=None):\n \n series = series or []\n data_frame = data_frame.sort_index(ascending=True)\n\n for s in series:\n prev_values = iter(data_frame[s])\n # Burn the first value, so the first row we call delta_from_prev()\n # for gets its previous value fr...
[ "def normalize_mapping_line(mapping_line, previous_source_column=0):\n \n\n if not mapping_line:\n return [], previous_source_column\n\n # Note that while the local record here is also done as a 4-tuple,\n # element 1 and 2 are never used since they are always provided by\n # the segments in t...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Computer Science:" }
Returns a command-line help. return a command-line help.
[ "private static String getHelp()\n\t{\n\t\tStringBuffer sb = new StringBuffer();\n\n\t\t// SRE\n\t\tsb.append(\"\\njSRE: Simple Relation Extraction V1.10\\t 30.08.06\\n\");\n\t\tsb.append(\"developed by Claudio Giuliano (giuliano@itc.it)\\n\\n\");\n\n\t\t// License\n\t\tsb.append(\"Copyright 2005 FBK-irst (http://w...
[ "def help_content(self):\n \n help_message = m.Message()\n help_message.add(m.Text(tr('No help text for this wizard step, yet.')))\n return help_message" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Configure reporting.
[ "async def configure_reporting(self, attribute, min_interval,\n max_interval, reportable_change):\n \"\"\"\"\"\"\n result = await super().configure_reporting(\n PowerConfigurationCluster.BATTERY_VOLTAGE_ATTR,\n self.FREQUENCY,\n self.FR...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Read and sort lines from the file sorted by decreasing length. Args: filename: String name of file to read inputs from. Returns: Sorted list of inputs, and dictionary mapping original index->sorted index of each element.
[ "def _get_sorted_inputs(filename):\n \n with tf.gfile.Open(filename) as f:\n records = f.read().split(\"\\n\")\n inputs = [record.strip() for record in records]\n if not inputs[-1]:\n inputs.pop()\n\n input_lens = [(i, len(line.split())) for i, line in enumerate(inputs)]\n sorted_input_lens = sort...
[ "def _append(lst, indices, value):\n \n for i, idx in enumerate(indices):\n # We need to loop because sometimes indices can increment by more than 1 due to missing tokens.\n # Example: Sentence with no words after filtering words.\n while len(lst) <= idx:\n # Update max counts ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Factory method for creating a source line annotation describing an entire method. @param methodGen the method being visited @return the SourceLineAnnotation, or null if we do not have line number information for the method
[ "public static SourceLineAnnotation fromVisitedMethod(MethodGen methodGen, String sourceFile) {\n LineNumberTable lineNumberTable = methodGen.getLineNumberTable(methodGen.getConstantPool());\n String className = methodGen.getClassName();\n int codeSize = methodGen.getInstructionList().getLength...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Action for rendering related items of a provided content.
[ "public function viewRelatedItems(Request $request, Content $content, string $fieldDefinitionIdentifier, string $template): Response\n {\n return $this->render(\n $template,\n [\n 'content' => $content,\n 'location' => $content->mainLocation,\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...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param Criteria $criteria @return array
[ "public function getFacetsByCriteria(Criteria $criteria)\n {\n $qb = $this->createCriteriaQueryBuilder($criteria, 'm');\n\n $channelsQb = clone $qb;\n $channels = $channelsQb->select('DISTINCT m.channel')->getQuery()->getScalarResult();\n\n $typeQb = clone $qb;\n $types = $type...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
@param mixed $itemID @return bool|\Colibri\Database\Model @throws \Colibri\Database\DbException @throws \Colibri\Database\Exception\SqlException @throws \InvalidArgumentException @throws \OutOfBoundsException @throws \UnexpectedValueException
[ "public function remove($itemID)\n {\n if ($this->items === null) {\n if ( ! $this->fillItems()) {\n return false;\n }\n }\n\n $this->delFromDb($itemID);\n\n return $this->delItem($itemID);\n }" ]
[ "protected function addSql($sql, array $params = [], array $types = [])\n {\n $message = 'Calling method \"addSql\" is not allowed. Use \"sql\" method instead';\n throw new \\Shopsys\\MigrationBundle\\Component\\Doctrine\\Migrations\\Exception\\MethodIsNotAllowedException($message);\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Perform a DELETE operation on an LDP Resource. @param response the async response @param uriInfo the URI info @param secContext the security context @param headers the HTTP headers @param request the request
[ "@DELETE\n @Timed\n public void deleteResource(@Suspended final AsyncResponse response, @Context final Request request,\n @Context final UriInfo uriInfo, @Context final HttpHeaders headers,\n @Context final SecurityContext secContext) {\n final TrellisRequest req = new TrellisRequ...
[ "def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Computer Science:" }
Returns option value with associated disabled flag.
[ "private function buildOptionValue(\\DOMElement $node): array\n {\n $option = array();\n\n $defaultDefaultValue = 'select' === $this->node->nodeName ? '' : 'on';\n $defaultValue = (isset($node->nodeValue) && !empty($node->nodeValue)) ? $node->nodeValue : $defaultDefaultValue;\n $optio...
[ "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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Synchronize from objects to records
[ "def sync_out(self, file_name=None, force=False):\n \"\"\"\"\"\"\n self.log('---- Sync Out ----')\n from ambry.bundle.files import BuildSourceFile\n\n self.dstate = self.STATES.BUILDING\n\n for f in self.build_source_files.list_records():\n\n if (f.sync_dir() == BuildSo...
[ "@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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Set the TextAllowOverlap property <p> If true, the text will be visible even if it collides with other previously drawn symbols. </p> @param value property wrapper value around Boolean
[ "public void setTextAllowOverlap( Boolean value) {\n PropertyValue propertyValue = textAllowOverlap(value);\n constantPropertyUsageMap.put(PROPERTY_TEXT_ALLOW_OVERLAP, propertyValue);\n layer.setProperties(propertyValue);\n }" ]
[ "function () {\n \n Overlay.superclass.initDefaultConfig.call(this);\n\n var cfg = this.cfg;\n\n // Add overlay config properties //\n \n /**\n * The absolute x-coordinate position of the Overlay\n * @config x\n * @type Numbe...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Checks if executables already contain a "-MAJOR.MINOR" suffix.
[ "def remove_major_minor_suffix(scripts):\n \n minor_major_regex = re.compile(\"-\\d.?\\d?$\")\n return [x for x in scripts if not minor_major_regex.search(x)]" ]
[ "def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Box draws a box with a given style.
[ "func (d draw) Box(r Renderer, b Box, s Style) {\n\ts.GetFillAndStrokeOptions().WriteToRenderer(r)\n\tdefer r.ResetStyle()\n\n\tr.MoveTo(b.Left, b.Top)\n\tr.LineTo(b.Right, b.Top)\n\tr.LineTo(b.Right, b.Bottom)\n\tr.LineTo(b.Left, b.Bottom)\n\tr.LineTo(b.Left, b.Top)\n\tr.FillStroke()\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(wh...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SpendMultiSig generates the witness stack required to redeem the 2-of-2 p2wsh // multi-sig output.
[ "func SpendMultiSig(witnessScript, pubA, sigA, pubB, sigB []byte) [][]byte {\n\twitness := make([][]byte, 4)\n\n\t// When spending a p2wsh multi-sig script, rather than an OP_0, we add\n\t// a nil stack element to eat the extra pop.\n\twitness[0] = nil\n\n\t// When initially generating the witnessScript, we sorted ...
[ "def _hash_sequence(self, sighash_type, anyone_can_pay):\n '''\n '''\n if anyone_can_pay or sighash_type == shared.SIGHASH_SINGLE:\n # If any of ANYONECANPAY, SINGLE sighash type is set,\n # hashSequence is a uint256 of 0x0000......0000.\n return b'\\x00' * 32\n...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Blockchain:" }
为 index 创建 code 反向索引 @param bool $force
[ "private function indexCode($force = false) {\n if (!$this->index_code || $force) {\n foreach ($this->index as $word => $code) {\n $this->index_code[$code] = $word;\n }\n }\n }" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Creates \Google\Protobuf\SourceCodeInfo object from serialized Protocol Buffers message. @param string $input @param SourceCodeInfo $object @param int $start @param int $end @throws \Exception @return SourceCodeInfo
[ "public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)\n\t{\n\t\tif ($object === null) {\n\t\t\t$object = new SourceCodeInfo();\n\t\t}\n\n\t\tif ($end === null) {\n\t\t\t$end = strlen($input);\n\t\t}\n\n\t\twhile ($start < $end) {\n\t\t\t$tag = Binary::decodeVarint($input, $start);\n...
[ "public static function RegisterAbstractDaftObjectType(string $maybe) : string\n {\n /**\n * @var array<int, string>\n */\n $props = $maybe::DaftObjectProperties();\n\n /**\n * @psalm-var class-string<A>\n */\n $maybe = static::RegisterDaftObjectTypeFromTyp...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software Development:" }
Create the form.
[ "public function aForm($id, $parentid)\n {\n $this->form->create(\n [\"id\" => __CLASS__, \"legend\" => \"Gör ett inlägg\",],\n [\n \"title\" => [\"type\" => \"text\", \"label\" => \"Titel\",\"validation\" => [\"not_empty\"]],\n \"id\" => [\"type\" => ...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the comment about Writing:", "pos": "Represent the code about Writing:", "neg": "Represent the code about File management:" }
/* (non-Javadoc) @see tuwien.auto.calimero.dptxlator.DPTXlator#getData(byte[], int)
[ "public byte[] getData(byte[] dst, int offset)\r\n\t{\r\n\t\tfinal int end = Math.min(data.length, dst.length - offset) / 3 * 3;\r\n\t\tfor (int i = 0; i < end; ++i)\r\n\t\t\tdst[offset + i] = (byte) data[i];\r\n\t\treturn dst;\r\n\t}\r\n\r\n\t/* (non-Javadoc)\r\n\t * @see tuwien.auto.calimero.dptxlator.DPTXlator#g...
[ "public final static void addAnnotationToConnection(final int position, final String annotation,\r\n\t\t\tfinal HELM2Notation helm2notation) {\r\n\t\thelm2notation.getListOfConnections().get(position).setAnnotation(annotation);\r\n\t}" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Creates a deferred tap iterable for the specified iterable. @since 6.0
[ "public static <T> LazyIterable<T> tap(Iterable<T> iterable, Procedure<? super T> procedure)\n {\n return new TapIterable<T>(iterable, procedure);\n }" ]
[ "def map(self, fn: Callable[[Any], Any]) -> 'Cont':\n \n \"\"\"\n return Cont(lambda c: self.run(compose(c, fn)))" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Attaches a persistent disk to this instance given its configuration. @return a zone operation if the attach request was issued correctly, {@code null} if the instance was not found @throws ComputeException upon failure
[ "public Operation attachDisk(\n PersistentDiskConfiguration configuration, OperationOption... options) {\n return compute.attachDisk(getInstanceId(), configuration, options);\n }" ]
[ "public boolean isASGEnabled(InstanceInfo instanceInfo) {\n CacheKey cacheKey = new CacheKey(getAccountId(instanceInfo, accountId), instanceInfo.getASGName());\n Boolean result = asgCache.getIfPresent(cacheKey);\n if (result != null) {\n return result;\n } else {\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Receive until predicate returns a positive integer. The returned number is the size to return.
[ "def _recv_predicate(self, predicate, timeout='default', raise_eof=True):\n \n\n if timeout == 'default':\n timeout = self._timeout\n\n self.timed_out = False\n\n start = time.time()\n try:\n while True:\n cut_at = predicate(self.buf)\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
************************************************************************************************************************
[ "public function enregistreCommentaire()\n {\n $auth = new archiAuthentification();\n $fieldsCommentaires=$this->getCommentairesFields();\n $formulaire = new formGenerator();\n\n\n if ($auth->estConnecte()) {\n unset($fieldsCommentaires['captcha']);\n }\n\n $e...
[ "public static function protect()\n\t{\n\t\t$eye = \\Cli::color(\"*\", 'green');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"PROTECT ALL HUMANS\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::color(\"\t\t\t ____[\\\\\", 'blue').$eye.\\Cli::color('---', 'blue').$eye.\\Cli:...
codesearchnet
{ "query": "Represent the instruction about N/A:", "pos": "Represent the code about N/A:", "neg": "Represent the code about Programming:" }
Specify how values are URL encoded @param string|bool $type One of 'RFC1738', 'RFC3986', or false to disable encoding @return self @throws \InvalidArgumentException
[ "public function setEncodingType($type)\n {\n if ($type === false || $type === self::RFC1738 || $type === self::RFC3986) {\n $this->encoding = $type;\n } else {\n throw new \\InvalidArgumentException('Invalid URL encoding type');\n }\n\n return $this;\n }" ]
[ "public static function configureInput(InputDefinition $definition)\n {\n $definition->addOption(new InputOption(\n 'date-fmt',\n null,\n InputOption::VALUE_REQUIRED,\n 'The date format (as a PHP date format string)',\n // @todo refactor so this can b...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
attr method get or set an attribute @param {string} attr - attribute name @param {string} [val] - attribute value @return {(string|object)} attribute value or this
[ "function(attr, val) {\n return val === undefined ? (this.length ? this[0].getAttribute(attr) : null) : this.each(function(index, el) {\n el.setAttribute(attr, val);\n });\n }" ]
[ "function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// Write writes p to the writer w. The only errors returned are ones // encountered while writing to the underlying output stream.
[ "func (w *Writer) Write(p []byte) (n int, err error) {\n\tvar linelen int\n\tvar lastWasColon bool\n\tfor i, c := range p {\n\t\tw.buf = append(w.buf, c)\n\t\tlinelen++\n\t\tif c == '\\t' {\n\t\t\tw.buf[len(w.buf)-1] = ' '\n\t\t\tfor linelen%tab != 0 {\n\t\t\t\tw.buf = append(w.buf, ' ')\n\t\t\t\tlinelen++\n\t\t\t}...
[ "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 description about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code about File management:" }
Convert a mapping of attr classes to primitive equivalents.
[ "def _unstructure_mapping(self, mapping):\n \"\"\"\"\"\"\n\n # We can reuse the mapping class, so dicts stay dicts and OrderedDicts\n # stay OrderedDicts.\n dispatch = self._unstructure_func.dispatch\n return mapping.__class__(\n (dispatch(k.__class__)(k), dispatch(v.__...
[ "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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// And implements And with other conditions
[ "func (lte Lte) And(conds ...Cond) Cond {\n\treturn And(lte, And(conds...))\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
在指定输入框发送回回车键 @note: key event -> enter
[ "def Enter(cls):\r\n ''' \r\n '''\r\n \r\n element = cls._element() \r\n action = ActionChains(Web.driver)\r\n action.send_keys_to_element(element, Keys.ENTER)\r\n action.perform()" ]
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Submit the transfer and wait until the transfer completes or fails. Inspect {#status} to check for transfer errors.
[ "def submit_and_wait\n raise ArgumentError, \"#{self.class}#dev_handle not set\" unless @dev_handle\n\n @completion_flag.completed = false\n submit! do |tr2|\n @completion_flag.completed = true\n end\n\n until @completion_flag.completed?\n begin\n @dev_handle.device.c...
[ "func NewTarTimeoutError() error {\n\treturn Error{\n\t\tMessage: fmt.Sprintf(\"timeout waiting for tar stream\"),\n\t\tDetails: nil,\n\t\tErrorCode: TarTimeoutError,\n\t\tSuggestion: \"check the Source-To-Image scripts if it accepts tar stream for assemble and sends for save-artifacts\",\n\t}\n}" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get a nested array representation of the response doc @return array
[ "public function toArray() {\n\t\tif ($this->_array) {\n\t\t\treturn $this->_array;\n\t\t}\n\t\t$root = $this->documentElement;\n\t\tif ($root == 'error') {\n\t\t\treturn array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'id' => $root->getAttribute('id'),\n\t\t\t\t\t'code' => $root->getAttribute('code'),\n\t\t\t\t\t'auxCode' ...
[ "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_...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.IMM__MMP_NAME:\n\t\t\t\tsetMMPName(MMP_NAME_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.IMM__TRIPLETS:\n\t\t\t\tgetTriplets().clear();\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the instruction about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
Get connection @return
[ "public static Connection getconnnection() {\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tcon = DriverManager.getConnection(url, userName, password);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn con;\n\t}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Gets string. @param name the name @param defaultValue the default value @return the string
[ "public String getString(String name, String defaultValue) {\n return getAs(name, String.class, defaultValue);\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Set the given name/value pair as a property. The process flag determines whether to check for and handle unicode characters in the provided value. @param name @param value @param processEscapeSequences @return Object - value stored
[ "public Object setProperty(String name, String value, boolean processEscapeSequences) {\n String newVal = value;\n\n if (newVal != null && processEscapeSequences) {\n // Check for Unicode characters in the value\n int idx = newVal.indexOf(\"\\\\u\");\n while (idx != -1...
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Return a string containing dashes (optional) and GO ID.
[ "def _str_dash(self, depth, no_repeat, obj):\n \"\"\"\"\"\"\n if self.indent:\n # '-' is default character indicating hierarchy level\n # '=' is used to indicate a hierarchical path printed in detail previously.\n single_or_double = not no_repeat or not obj.children\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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param $key @param null $default @return mixed
[ "public function data(string $key, $default = null)\n {\n if (is_null($this->data)) {\n return $default;\n }\n\n return data_get($this->data, $key, $default);\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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
@param ranges in-out argument TODO: o expensive, the list is modified ... * states that touch each other are not merged
[ "public static void normalizeRanges(List<Range> ranges) {\n int i, todo, max;\n Range current, op, and;\n\n todo = 0;\n while (todo < ranges.size()) {\n // take the first range, and-it with all others and\n // append fractions to the end.\n current = (Ran...
[ "def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Event listener for HTTP server "listening" event.
[ "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.error('Listening on ' + bind);\n}" ]
[ "public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Removes Objects from Sport @param mixed $id @param mixed $data @return PayloadInterface
[ "public function removeObjects($id, $data) {\n\t\t// find\n\t\t$model = $this->get($id);\n\n\t\tif ($model === null) {\n\t\t\treturn new NotFound(['message' => 'Sport not found.']);\n\t\t}\n\n\t\t// pass remove to internal logic\n\t\ttry {\n\t\t\t$this->doRemoveObjects($model, $data);\n\t\t} catch (ErrorsException ...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Run the polling loop for the email inbox connection
[ "def polling_loop(connection)\n if polling?\n polling_msg = \"Polling enabled. Checking every #{config.poll_interval} seconds.\"\n else\n polling_msg = \"Polling disabled. Checking for messages once.\"\n end\n Mailman.logger.info(polling_msg)\n\n tries ||= 5\n loop do\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 # CAR...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Returns the delivery address. @param AccountInterface|Contact $entity @param bool $force Forces function to return an address if any address is defined if no delivery address is defined it will first return the main address then any @return mixed
[ "public function getDeliveryAddress($entity, $force = false)\n {\n /* @var Address $address */\n $conditionCallback = function($address) {\n return $address->getDeliveryAddress();\n };\n\n return $this->getAddressByCondition($entity, $conditionCallback, $force);\n }" ]
[ "protected function getSingleFieldValue($value, FieldDefinition $fieldDefinition, $contentTypeIdentifier, array $context = array())\n {\n // booleans were handled here. They are now handled as complextypes\n\n // q: do we really want this to happen by default on all scalar field values?\n //...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Sets the number of loops, with the specified delays for this {@link Transformation}. @param loops the loops @param startDelay the start delay @param resetDelay the reset delay @return the t
[ "public T loop(int loops, int startDelay, int resetDelay)\n\t{\n\t\tif (loops == 0)\n\t\t\treturn self();\n\n\t\tthis.loops = loops;\n\t\tthis.loopStartDelay = Timer.tickToTime(startDelay);\n\t\tthis.loopResetDelay = Timer.tickToTime(resetDelay);\n\t\treturn self();\n\t}" ]
[ "public void changeComplete (float complete)\n {\n // Store the new state\n _complete = complete;\n\n // Determine the percentage difference between the \"actual\"\n // completion state and the completion amount to render during\n // the smooth interpolation\n _renderOff...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets the matcher for the comma and/or space separated patterns. <p> Any null or empty pattern matches none. </p>
[ "public static WildcardPatternMatcher compile(String patterns) {\n\t\tif(patterns == null || patterns.isEmpty()) {\n\t\t\treturn matchNone;\n\t\t} else {\n\t\t\tList<String> list = StringUtility.splitStringCommaSpace(patterns);\n\t\t\t// Match none shortcut\n\t\t\tif(list.isEmpty()) return matchNone;\n\n\t\t\t// Pa...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Documentation:" }
@param mixed $data @return Media
[ "public function createNew($data)\n {\n $result = null;\n if (is_string($data)) {\n if (strpos($data, 'http') !== 0) {\n $data = 'http://'.$data;\n }\n $parsedUrl = parse_url($data);\n switch ($parsedUrl['host']) {\n case 'ww...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github sentence about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
Allows admin users to manually confirm a user.
[ "public function saveManualEmailValidation($value)\n {\n if ($value === 'confirm') {\n $this->owner->NeedsValidation = false;\n } elseif ($value === 'resend') {\n $email = MemberConfirmationEmail::create($this->owner->ProfilePage(), $this->owner);\n $email->send();\...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns an instance of this class. @param int $type the type of the session to use; either TYPE_USER (persistent) or TYPE_TEMPORARY (only for the lifetime of the session cookie) @return \Tx_Oelib_Session the current Singleton instance for the given type
[ "public static function getInstance($type)\n {\n self::checkType($type);\n\n if (!isset(self::$instances[$type])) {\n self::$instances[$type] = new \\Tx_Oelib_Session($type);\n }\n\n return self::$instances[$type];\n }" ]
[ "final public function create()\n {\n\n $self = $this;\n\n $splash = $self->getSplash();\n $sessId = $this->generateId($splash);\n\n session_id($sessId); //Must be called before the sesion start to generate the Id\n session_cache_limiter('none');\n\n session_name(md5($se...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Edit campaign and change its name to the specified one. @param string $campaign name of the campaign @return XiboCampaign
[ "public function edit($campaign)\n {\n $this->getLogger()->debug('Getting Resource Owner');\n $this->ownerId = $this->getEntityProvider()->getMe()->getId();\n $this->campaign = $campaign;\n\n // Rewrite parameter mismatch\n $array = $this->toArray();\n $array['name'] = $...
[ "public static function all($params = null, $opts = null)\n {\n $msg = \"Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. \" .\n \"List those using \\$schedule->allRevisions('revision_id') instead.\";\n throw new Error\\InvalidRequest($msg, null);\n...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about PHP:" }
Generate HttpResponse based on the HttpStatusCodeError.
[ "def _get_error_response(self, exc):\n \n if exc.has_code(codes.UNAUTHORIZED):\n return self._get_auth_challenge(exc)\n else:\n if exc.has_code(codes.INTERNAL_SERVER_ERROR):\n logging.getLogger('devil').error('devil caught http error: ' + str(exc), exc_info=...
[ "@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 instruction about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about programming:" }
Gets the relations methods. @param array $relationships @param array $fields @return array
[ "protected function getRelationMethods(array $relations, array $fields)\n {\n $methods = [];\n\n foreach ($fields as $field) {\n if ($field->hasForeignRelation()) {\n $relation = $field->getForeignRelation();\n $methods[$relation->name] = $this->getRelations...
[ "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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Create the Service @throws ConsoleException @return$this
[ "private function createService(): self\n {\n $aFields = $this->getArguments();\n $aCreated = [];\n\n try {\n\n $aToCreate = [];\n $aServices = array_filter(\n array_map(function ($sService) {\n return implode('/', array_map('ucfirst',...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Merge two revisions together, creating a new revision file
[ "def merge(directory, message, branch_label, rev_id, revisions):\n \"\"\"\"\"\"\n _merge(directory, revisions, message, branch_label, rev_id)" ]
[ "function customizer(destination, source) {\n // If we're not working with a plain object, copy the value as is\n // If source is an array, for instance, it will replace destination\n if (!isPlain(source)) {\n return source;\n }\n\n // If the new value is a plain object but the first object value is not\n ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Creates a special {@link ImmutableMap} builder that creates case-insensitive maps, as required for headers. @return a header map builder
[ "public static ImmutableListMultimap.Builder<String, String> headerMapBuilder() {\n return ImmutableListMultimap.<String, String> builder()\n .orderKeysBy(String.CASE_INSENSITIVE_ORDER);\n }" ]
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
base method for prepareUpdate @param queryLanguage @param queryString @param baseURI @return MarkLogicUpdateQuery @throws RepositoryException @throws MalformedQueryException
[ "@Override\n public MarkLogicUpdateQuery prepareUpdate(QueryLanguage queryLanguage, String queryString, String baseURI) throws RepositoryException, MalformedQueryException {\n if (QueryLanguage.SPARQL.equals(queryLanguage)) {\n return new MarkLogicUpdateQuery(this.client, new SPARQLQueryBinding...
[ "@Override\n public synchronized List<Map<String, ResultColumn>> query(final String query) throws DatabaseEngineException {\n return processResultIterator(iterator(query));\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// ClearOptions clear SSL options. See // https://www.openssl.org/docs/ssl/SSL_CTX_set_options.html
[ "func (s *SSL) ClearOptions(options Options) Options {\n\treturn Options(C.X_SSL_clear_options(s.ssl, C.long(options)))\n}" ]
[ "function peerResolved (ip, addressType) {\n // Possible cancelation during DNS lookup.\n if (!socket._connecting) return;\n\n socket._peer = { address: ip || '127.0.0.1', port: options.port };\n\n // Generate random bytes used to set randomized socket properties.\n // `crypto.randomBytes` calls Open...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns a list of names identifying the plug classes in the plug's MRO. For example: ['openhtf.plugs.user_input.UserInput'] Or: ['openhtf.plugs.user_input.UserInput', 'my_module.advanced_user_input.AdvancedUserInput']
[ "def get_plug_mro(self, plug_type):\n \n ignored_classes = (BasePlug, FrontendAwareBasePlug)\n return [\n self.get_plug_name(base_class) for base_class in plug_type.mro()\n if (issubclass(base_class, BasePlug) and\n base_class not in ignored_classes)\n ]" ]
[ "def setup():\n \n if None in [RTs._rt, RTs._rtp]:\n RTs._rt = RefactoringTool(myfixes)\n RTs._rtp = RefactoringTool(myfixes, {'print_function': True})" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Construct command line strings for a single node. Handles shards and stand-alones.
[ "def _construct_single(self, basedir, port, name=None, extra=''):\n \n datapath = self._create_paths(basedir, name)\n self._construct_mongod(os.path.join(datapath, 'db'),\n os.path.join(datapath, 'mongod.log'), port,\n replset=None, ex...
[ "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 ...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// SetExecutionResult sets the ExecutionResult field's value.
[ "func (s *ActionExecutionOutput) SetExecutionResult(v *ActionExecutionResult) *ActionExecutionOutput {\n\ts.ExecutionResult = 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 text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Applies parameters to the text. @param str the str @return the string
[ "public String applyParameters(String str)\n\t{\n\t\tMatcher matcher = pattern.matcher(str);\n\t\tStringBuffer sb = new StringBuffer();\n\t\twhile (matcher.find())\n\t\t\tmatcher.appendReplacement(sb, resolveParameter(matcher.group(\"key\")));\n\t\tmatcher.appendTail(sb);\n\t\tstr = sb.toString();\n\t\treturn trans...
[ "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 comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
Serialize all the children of given node into PHP @param DOMElement $ir Internal representation @return string
[ "protected function serializeChildren(DOMElement $ir)\n\t{\n\t\t$php = '';\n\t\tforeach ($ir->childNodes as $node)\n\t\t{\n\t\t\tif ($node instanceof DOMElement)\n\t\t\t{\n\t\t\t\t$methodName = 'serialize' . ucfirst($node->localName);\n\t\t\t\t$php .= $this->$methodName($node);\n\t\t\t}\n\t\t}\n\n\t\treturn $php;\n...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
For commands that directly obtain information from zk
[ "void noZeroOrOneOrAddress(String command) {\n if (isZeroCommand || isOneCommand) {\n throwException(CMD + command + \" (zero|one) should not be specified\");\n }\n if (isAddressCommand) {\n throwException(CMD + command + \" address should not be specified\");\n }\n }" ]
[ "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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
// Map converts a StringSlice into a map to check quickly if words exist within // it.
[ "func (s StringSlice) Map() map[string]struct{} {\n\tm := map[string]struct{}{}\n\tfor _, w := range s {\n\t\tm[w] = struct{}{}\n\t}\n\treturn m\n}" ]
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
get data and save it for the overview @param AnalyticsOverview $overview The overview
[ "public function getData(&$overview)\n {\n // visitor types\n $this->output->writeln(\"\\t\" . 'Fetching visitor types..');\n\n // execute the query\n $metrics = 'ga:percentNewSessions';\n $rows = $this->executeQuery($overview, $metrics);\n\n // new sessions\n $ne...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* if only then only - excepts if excepts then set - excepts
[ "function (set, excepts, onlys) {\n debug(\"~ #filterOut\");\n var hasExcepts = excepts && excepts.length > 0;\n if (onlys) {\n if (hasExcepts) {\n return onlys.filter(function (oel){\n return !excepts.some(function (eel) { return eel === oel;});\n });\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
The l2 norm of an array is is defined as: sqrt(||x||), where ||x|| is the dot product of the vector.
[ "def l2_norm(arr):\n \n arr = np.asarray(arr)\n return np.sqrt(np.dot(arr.ravel().squeeze(), arr.ravel().squeeze()))" ]
[ "def rsdl_s(self, Yprev, Y):\n \"\"\"\"\"\"\n\n # Since s = rho A^T B (y^(k+1) - y^(k)) and B = -(I I I ...)^T,\n # the correct calculation here would involve replicating (Yprev - Y)\n # on the axis on which the blocks of X are stacked. Since this would\n # require allocating addi...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create an ingredient from an dictionary. This object will be deserialized from yaml
[ "def ingredient_from_validated_dict(ingr_dict, selectable):\n \n\n validator = IngredientValidator(schema=ingr_dict['kind'])\n if not validator.validate(ingr_dict):\n raise Exception(validator.errors)\n ingr_dict = validator.document\n\n kind = ingr_dict.pop('kind', 'Metric')\n IngredientCl...
[ "def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns json for JavaScript class @return string
[ "public function getJson()\n {\n $json = array(\n 'urlKeyParam' => $this->getUrlKeyParam(),\n 'inputFieldName' => $this->getTokenInputName(),\n 'observedCssRules' => $this->getObservedCssRules(),\n 'requestUrl' => $this->getTokenUrl(),\n 'cookieName' ...
[ "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:" }
// evaluateConditions replaces each condition in the template with its corresponding // value
[ "func evaluateConditions(input interface{}, options *ProcessorOptions) {\n\tif template, ok := input.(map[string]interface{}); ok {\n\t\t// Check there is a conditions section\n\t\tif uconditions, ok := template[\"Conditions\"]; ok {\n\t\t\t// Check the conditions section is a map\n\t\t\tif conditions, ok := ucondi...
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Update a controlled object based on the given authorization state. @param controlledObject Object being controlled @param authorized state that has been installed on controlledObject
[ "protected void updateControlledObject(Authorizable controlledObject, boolean authorized) {\n if( logger.isDebugEnabled() ) {\n logger.debug( \"setAuthorized( \" + authorized + \") on: \" + controlledObject );\n }\n controlledObject.setAuthorized( authorized );\n runPostProces...
[ "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 ...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Calculate the supply of coins for a given time (in either datetime, or block height) for coins that use the "standard" method of halfing.
[ "def _standard_supply(self, block_height):\n \n start_coins_per_block = self.supply_data['start_coins_per_block']\n minutes_per_block = self.supply_data['minutes_per_block']\n blocks_per_era = self.supply_data['blocks_per_era']\n full_cap = self.supply_data.get('full_cap')\n\n ...
[ "func LockTimeToSequence(isSeconds bool, locktime uint32) uint32 {\n\t// If we're expressing the relative lock time in blocks, then the\n\t// corresponding sequence number is simply the desired input age.\n\tif !isSeconds {\n\t\treturn locktime\n\t}\n\n\t// Set the 22nd bit which indicates the lock time is in secon...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return a new |Image| object loaded from *image_file*, which can be either a path (string) or a file-like object.
[ "def from_file(cls, image_file):\n \n if is_string(image_file):\n # treat image_file as a path\n with open(image_file, 'rb') as f:\n blob = f.read()\n filename = os.path.basename(image_file)\n else:\n # assume image_file is a file-like ...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
HParams for training languagemodel_lm1b32k_packed. 1470M Params.
[ "def lmx_h4k_f16k():\n \"\"\"\"\"\"\n hparams = lmx_base()\n hparams.hidden_size = 4096\n hparams.filter_size = 16384\n hparams.batch_size = 1024\n hparams.weight_dtype = \"bfloat16\"\n return hparams" ]
[ "def forward_word(self, e): # (M-f)\r\n \"\"\"\r\n self.l_buffer.forward_word(self.argument_reset)\r\n self.finalize()" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Trigger the hooks and returns the {{luya\base\HookEvent}} objects. @param string $name The hook name. @return array An array with {{luya\base\HookEvent}} objects. @throws Exception
[ "protected static function trigger($name)\n {\n if (isset(static::$_hooks[$name])) {\n $events = [];\n \n foreach (static::$_hooks[$name] as $hookEvent) {\n if ($hookEvent->isHandled) {\n continue;\n }\n \n ...
[ "public function initialize()\n {\n //The global dispatcher\n\n //state the application is initialized;\n //register aliases as class mocks such that static calls on mock map to instance calls;\n $this->createAliasMock(\n array_merge(\n $this->aliases, [\n ...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Write members to a MwsWriter. @param w The writer to write to.
[ "@Override\n public void writeFragmentTo(MwsWriter w) {\n w.write(\"NextToken\", nextToken);\n w.write(\"AmazonOrderId\", amazonOrderId);\n w.writeList(\"OrderItems\", \"OrderItem\", orderItems);\n }" ]
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the Github description about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code:" }
Get the version from package itself.
[ "def _get_version():\n \"\"\"\"\"\"\n with open(\"../waliki/__init__.py\") as fh:\n for line in fh:\n if line.startswith(\"__version__ = \"):\n return line.split(\"=\")[-1].strip().strip(\"'\").strip('\"')" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the post about Logistics:", "pos": "Represent the code about Logistics:", "neg": "Represent the code:" }
// Removes a watch instance from the EventManager's watchers map
[ "func (self *events) StopWatch(watchId int) {\n\tself.watcherLock.Lock()\n\tdefer self.watcherLock.Unlock()\n\t_, ok := self.watchers[watchId]\n\tif !ok {\n\t\tlog.Errorf(\"Could not find watcher instance %v\", watchId)\n\t}\n\tclose(self.watchers[watchId].eventChannel.GetChannel())\n\tdelete(self.watchers, watchId...
[ "function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // th...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return true if all JIDs are allowed to exchange cross domain messages.
[ "def cross_domain?(*jids)\n !jids.flatten.index do |jid|\n !vhost(jid.domain).cross_domain_messages?\n end\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 l...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Closes all resources/backends associated with this queue manager.
[ "def close(self):\n \n self.log.info(\"Shutting down queue manager.\")\n if hasattr(self.store, 'close'):\n self.store.close()\n\n if hasattr(self.subscriber_scheduler, 'close'):\n self.subscriber_scheduler.close()\n\n if hasattr(self.queue_scheduler, 'close'...
[ "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 comment about Computer Networking:", "pos": "Represent the Github code about Computer Networking:", "neg": "Represent the Github code about programming:" }
Obtain the appropriate tagset according to language and postag. @param postag the postag @param lang the language @return the mapped tag
[ "public static String getNAFTagSet(final String postag, final String lang) {\n\n String tag = null;\n if (lang.equalsIgnoreCase(\"de\")) {\n tag = mapGermanCoNLL09TagSetToNAF(postag);\n } else if (lang.equalsIgnoreCase(\"en\")) {\n tag = mapEnglishPennTagSetToNAF(postag);\n } else if (lang.equ...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// PurgeState deletes stored task state
[ "func (b *Backend) PurgeState(taskUUID string) error {\n\t_, ok := b.tasks[taskUUID]\n\tif !ok {\n\t\treturn NewErrTasknotFound(taskUUID)\n\t}\n\n\tdelete(b.tasks, taskUUID)\n\treturn nil\n}" ]
[ "public void unload() {\n Map<String, String> settings = CACHE.get();\n CACHE.remove();\n // update cache of settings to be used in case of DB connectivity error\n this.getPropertyDbFailureCache = settings;\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
// NewPocketBeagleAdaptor creates a new Adaptor for the PocketBeagle
[ "func NewPocketBeagleAdaptor() *PocketBeagleAdaptor {\n\ta := NewAdaptor()\n\ta.SetName(gobot.DefaultName(\"PocketBeagle\"))\n\ta.pinMap = pocketBeaglePinMap\n\ta.pwmPinMap = pocketBeaglePwmPinMap\n\ta.analogPinMap = pocketBeagleAnalogPinMap\n\n\treturn &PocketBeagleAdaptor{\n\t\tAdaptor: a,\n\t}\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }