query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Get the value of a named field on the given record.
Use of this method ensures that any special rules around the data for this gridfield are
followed.
@param DataObject $record
@param string $fieldName
@return mixed | [
"public function getDataFieldValue($record, $fieldName)\n {\n if (isset($this->customDataFields[$fieldName])) {\n $callback = $this->customDataFields[$fieldName];\n\n return $callback($record);\n }\n\n if ($record->hasMethod('relField')) {\n return $record->r... | [
"@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Mark calculation as complete.
@param int $calcId
@return int|void | [
"public function markComplete($calcId)\n {\n $dateEnded = $this->hlpDate->getUtcNowForDb();\n $bind = [\n ECalculation::A_DATE_ENDED => $dateEnded,\n ECalculation::A_STATE => Cfg::CALC_STATE_COMPLETE\n ];\n $result = $this->updateById($calcId, $bind);\n re... | [
"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 text about invoice calculation:",
"pos": "Represent the Github code about invoice calculation:",
"neg": "Represent the Github code about programming:"
} |
Check requested files for problematic TODO comments
@return exit code 0 for success, 1 for failure
@api private | [
"def lint_codebase\n finder = FileFinder.new(path, options)\n files = load_files(finder)\n files_count = files.count\n reports = files.map do |file|\n Todo.within(File.open(file), :config => @options).map do |todo|\n reporter = Reporter.new(todo,\n ... | [
"def main_as_cli(argv=None):\n ''''''\n try:\n result = main(argv)\n except Exception as e:\n result = __pretty_print_fc_exception(e)\n # FIXME: we should invert True/False return values to 0/1 here, to comply\n # with UNIX exit code semantics (and avoid problems with make, scripts, etc... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
React to a component resize event. | [
"@Override\n public void componentResized(ComponentEvent e) {\n if (e.getComponent() == component) {\n double newRatio = getCurrentRatio();\n if (Math.abs(newRatio - activeRatio) > threshold) {\n activeRatio = newRatio;\n executeResize(newRatio);\n }\n }\n }"
] | [
"function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Builds a field on a source table and associated entities
@param string $name
@param string $type
@param bool $indexed
@param string $tableName
@param NodeTypeContract $nodeType | [
"public function buildField($name, $type, $indexed, $tableName, NodeTypeContract $nodeType)\n {\n $this->modelBuilder->build($tableName, $nodeType->getFields());\n $this->buildForm($nodeType);\n $migration = $this->migrationBuilder->buildFieldMigrationForTable($name, $type, $indexed, $tableN... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
11.4 Unary Operators | [
"function parseUnaryExpression() {\n var token, expr;\n\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!'... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Must provides a hook for foreign functions using 'io.Reader's or
// 'io.Writer's. | [
"func (rw ReadWriter) Must(n int64, err error) {\n\t// Check iff there were no errors\n\tif rw.Err == nil {\n\t\treturn\n\t}\n\n\trw.N += n\n\trw.Err = err\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Sets the default terms of the Dignities
table. | [
"def setTerms(variant):\n \n global TERMS\n if variant == EGYPTIAN_TERMS:\n TERMS = tables.EGYPTIAN_TERMS\n elif variant == TETRABIBLOS_TERMS:\n TERMS = tables.TETRABIBLOS_TERMS\n elif variant == LILLY_TERMS:\n TERMS = tables.LILLY_TERMS"
] | [
"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:"
} |
Attempts to execute the goal's tasks in installed order.
:param bool explain: If ``True`` then the goal plan will be explained instead of being
executed. | [
"def attempt(self, explain):\n \n goal_workdir = os.path.join(self._context.options.for_global_scope().pants_workdir,\n self._goal.name)\n with self._context.new_workunit(name=self._goal.name, labels=[WorkUnitLabel.GOAL]):\n for name, task_type in reversed(list(self._tas... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// WeekdayShort returns the locales short weekday given the 'weekday' provided | [
"func (en *en_SB) WeekdayShort(weekday time.Weekday) string {\n\treturn en.daysShort[weekday]\n}"
] | [
"func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about datetime:"
} |
返回包装后不可修改的Map.
如果尝试修改,会抛出UnsupportedOperationException
@see java.util.Collections#unmodifiableMap(Map) | [
"public static <K, V> Map<K, V> unmodifiableMap(final Map<? extends K, ? extends V> m) {\n\t\treturn Collections.unmodifiableMap(m);\n\t}"
] | [
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Writes RFC2445 VTIMEZONE data for this time zone
@param writer A <code>Writer</code> used for the output
@throws IOException If there were problems creating a buffered writer or writing to it. | [
"public void write(Writer writer) throws IOException {\n BufferedWriter bw = new BufferedWriter(writer);\n if (vtzlines != null) {\n for (String line : vtzlines) {\n if (line.startsWith(ICAL_TZURL + COLON)) {\n if (tzurl != null) {\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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Initiates a graceful stop of the processes | [
"def stop(self, timeout=None):\n \n\n self.stopping = True\n\n for process in list(self.processes):\n self.stop_process(process, timeout=timeout)"
] | [
"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 about technology:",
"pos": "Represent the Github code about technology:",
"neg": "Represent the Github code about programming:"
} |
Returns a string representation of the tracker object for the given item.
Args:
item: object to get tracker for.
fqdn (str): fully-qualified domain name of the object. | [
"def _tracker_str(item):\n \n instance = tracker(item)\n if instance is not None:\n if isinstance(instance, str):\n return instance\n elif isinstance(instance, tuple):\n return instance\n else:\n return instance.uuid\n else:\n #Must be a simpl... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *DescribeTargetGroupAttributesInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DescribeTargetGroupAttributesInput\"}\n\tif s.TargetGroupArn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TargetGroupArn\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn in... | [
"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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Returns whether an address is known to connect to a client with our own ID. | [
"func (cl *Client) dopplegangerAddr(addr string) bool {\n\t_, ok := cl.dopplegangerAddrs[addr]\n\treturn ok\n}"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
To Array
@author WN
@param bool $recursively If set to `true` then toArray(true) will be called on each `Arrayable` property
@return array | [
"public function toArray($recursively = false)\n {\n $ar = parent::toArray($recursively);\n\n if ($recursively) {\n foreach ($this->getProducts() as $product) {\n $ar['products'][] = $product->toArray();\n }\n }\n\n return $ar;\n }"
] | [
"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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Return a flat list of routes
@return Route[] | [
"public function getRoutes()\n {\n $out = [];\n foreach($this->routes as $route) {\n $out[] = $route;\n }\n\n foreach ($this->children as $child) {\n foreach ($child->getRoutes() as $route) {\n $out[] = $route;\n }\n }\n\n ... | [
"public void setStaticRoute(NodesMap nm, Map<Link, Boolean> links) {\n routes.put(nm, links); // Only one route between two nodes (replace the old route)\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Stores hash configuration | [
"def store_hash_configuration(self, lshash):\n \n self.mongo_object.insert_one(\n {'hash_conf_name': lshash.hash_name+'_conf',\n 'hash_configuration': pickle.dumps(lshash.get_config())\n }\n )"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Modify a record in a zone.
CLI example::
salt myminion boto_route53.delete_record test.example.org example.org A | [
"def delete_record(name, zone, record_type, identifier=None, all_records=False,\n region=None, key=None, keyid=None, profile=None,\n wait_for_sync=True, split_dns=False, private_zone=False,\n retry_on_rate_limit=None, rate_limit_retries=None,\n ret... | [
"def setup_dns(domain)\n# TODO should we just use the ID instead of the full href?\n owner=@deployment.href\n @dns = SharedDns.new(domain)\n raise \"Unable to reserve DNS\" unless @dns.reserve_dns(owner)\n @dns.set_dns_inputs(@deployment)\n end"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Check if $date is after $earliest.
@param $date
@param $earliest
@return bool | [
"public function checkAfter($date, $earliest)\n {\n try {\n return $this->toTimestamp($date) > $this->toTimestamp($earliest);\n } catch (InvalidArgumentException $e) {\n return false;\n }\n }"
] | [
"final function isActive() {return /** @var int $y1 */ /** @var int $y2 */\n\t\t($y1 = df_year()) < ($y2 = $this->expYear()) || ($y1 === $y2 && df_month() <= $this->expMonth())\n\t;}"
] | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Gets the dropped indexes according to the old/new tables.
@param \Fridge\DBAL\Schema\Table $oldTable The old table.
@param \Fridge\DBAL\Schema\Table $newTable The new table.
@return array The dropped indexes. | [
"private function getDroppedIndexes(Table $oldTable, Table $newTable)\n {\n $droppedIndexes = array();\n\n foreach ($oldTable->getFilteredIndexes() as $index) {\n if (!$newTable->hasIndex($index->getName())\n || $this->compareIndexes($index, $newTable->getIndex($index->get... | [
"private function getChangedForeignKeys($tableName, TableDiff $diff)\n {\n foreach ($diff->changedForeignKeys as $foreignKey) {\n $this->addForeignKeysMessage($tableName, $foreignKey, 'changed foreign key on `%s`, it is now related to `%s.%s`');\n }\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
卡券(注意图文消息的card_id需要通过上述方法来得到)
@param string $card_id card_id
@param array $card_ext 签名
@param string $openid 接收消息用户对应该公众号的openid
@param string $kf_account 客服账号
@return int msg_id 发送出去的消息ID | [
"public function customWxcard($card_id = '', $card_ext = [], $openid, $kf_account = '')\n {\n $queryStr = [];\n $queryStr['touser'] = $openid;\n $queryStr['msgtype'] = 'wxcard';\n $queryStr['wxcard']['card_id'] = $card_id;\n $queryS... | [
"def _build_msg_content(self, msgtype='text', **kwargs):\n \n data = {'msgtype': msgtype}\n if msgtype == 'text':\n data[msgtype] = {'content': kwargs.get('content')}\n elif msgtype == 'image' or msgtype == 'voice' or msgtype == 'file':\n data[msgtype] = {'media_id'... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// SetCredentials sets the Credentials field's value. | [
"func (s *InstanceAccess) SetCredentials(v *InstanceCredentials) *InstanceAccess {\n\ts.Credentials = 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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// GetNamespace returns namespace | [
"func (a *AuthServer) GetNamespace(name string) (*services.Namespace, error) {\n\treturn a.GetCache().GetNamespace(name)\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
// Option gets the first value for the given option ID. | [
"func (m Message) Option(o OptionID) interface{} {\n\tfor _, v := range m.opts {\n\t\tif o == v.ID {\n\t\t\treturn v.Value\n\t\t}\n\t}\n\treturn nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Defined by Zend\Filter\FilterInterface
Decrypts $value with the defined settings
@param string $value Content to decrypt
@return string The decrypted content | [
"public function decrypt($value)\n {\n $decrypted = $this->blockCipher->decrypt($value);\n\n // decompress after decryption\n if (!empty($this->compression)) {\n $decompress = new Decompress($this->compression);\n $decrypted = $decompress($decrypted);\n }\n\n ... | [
"public function getData()\n {\n // The application has the option of passing the query parameter\n // in, perhaps using its own middleware, or allowing Omnipay to\n // provide it.\n\n $crypt = $this->getCrypt() ?: $this->httpRequest->query->get('crypt');\n\n // Make sure we ha... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Encryption:"
} |
Grants access if any voter returns an affirmative response.
If all voters abstained from voting, the decision will be based on the
allowIfAllAbstainDecisions property value (defaults to false). | [
"private function decideAffirmative(TokenInterface $token, array $attributes, $object = null)\n {\n $deny = 0;\n foreach ($this->voters as $voter) {\n $result = $voter->vote($token, $object, $attributes);\n switch ($result) {\n case VoterInterface::ACCESS_GRANTE... | [
"function ImmutableAccessControlAudit (args) {\n // require access control id\n assert.ok(defined(args.accessControlId), 'accessControlId required')\n // require valid allow type\n assert.ok(defined(validAllowTypes[args.allowType]), `invalid allowType ${args.allowType}`)\n // initialize aduit record\... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Render the row-set
@param bool $bodyOnly
@return string | [
"public function render( $bodyOnly = false )\n {\n $this->parseRequest();\n\n $result = $this->view->render( 'rowSet/layout', array(\n 'rowSet' => $this,\n ) );\n\n if ( $bodyOnly )\n {\n return $result;\n }\n\n if ( $this->hasFlags( self::FL... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// cmd is a helper function to execute a command and check for the expected FTP
// return code | [
"func (c *ServerConn) cmd(expected int, format string, args ...interface{}) (int, string, error) {\n\t_, err := c.conn.Cmd(format, args...)\n\tif err != nil {\n\t\treturn 0, \"\", err\n\t}\n\n\treturn c.conn.ReadResponse(expected)\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 summarization about File management:",
"pos": "Represent the code about File management:",
"neg": "Represent the code about programming:"
} |
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"func (in *Policy) DeepCopyInto(out *Policy) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tin.ObjectMeta.DeepCopyInto(&out.ObjectMeta)\n\tif in.Rules != nil {\n\t\tin, out := &in.Rules, &out.Rules\n\t\t*out = make([]PolicyRule, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n... | [
"func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
A specialized version of `_.sampleSize` for arrays.
@private
@param {Array} array The array to sample.
@param {number} n The number of elements to sample.
@returns {Array} Returns the random elements. | [
"function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }"
] | [
"function shuffle_in_place(sample, randomSource) {\n\n // a custom random number source can be provided if you want to use\n // a fixed seed or another random number generator, like\n // [random-js](https://www.npmjs.org/package/random-js)\n randomSource = randomSource || Math.random;\n\... | codesearchnet | {
"query": "Represent the Github sentence about Signal Processing:",
"pos": "Represent the Github code about Signal Processing:",
"neg": "Represent the Github code:"
} |
InternalSARL.g:14416:1: entryRuleXBasicForLoopExpression returns [EObject current=null] : iv_ruleXBasicForLoopExpression= ruleXBasicForLoopExpression EOF ; | [
"public final EObject entryRuleXBasicForLoopExpression() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleXBasicForLoopExpression = null;\n\n\n try {\n // InternalSARL.g:14416:64: (iv_ruleXBasicForLoopExpression= ruleXBasicForLoopExpression EOF )\n ... | [
"def visitLexerElement(self, ctx: jsgParser.LexerElementContext):\n \n self.visitChildren(ctx)\n if ctx.ebnfSuffix():\n self._rulePattern += ctx.ebnfSuffix().getText()"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
@param string $sourcePath
@return ReactJS
@throws \Exception | [
"private function createReactJs($sourcePath)\n {\n $reactSource = $this->loader->getSource($sourcePath);\n $reactJs = new ReactJS($reactSource, '');\n $reactJs->setErrorHandler($this->errorHandler);\n return $reactJs;\n }"
] | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
download a file or all files in a directory | [
"def download(name, options):\n \n dire = os.path.dirname(name) # returns the directory name\n fName = os.path.basename(name) # returns the filename\n fNameOnly, fExt = os.path.splitext(fName)\n\n dwn = 0\n\n if fileExists(fName, dire) and not fileExists((fNameOnly + '.srt'), dire): # skip if alre... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get the total number of seconds in the interval
@return DecimalValue | [
"public function getTotalSeconds()\r\n\t{\r\n\t\t$dt = new \\DateTimeImmutable();\r\n\t\t$seconds = $dt->getTimestamp();\r\n\t\t$result = new DecimalValue( $dt->add( $this->Value )->getTimestamp() - $seconds );\r\n\t\t$result = $result->Add( ( $this->Value->invert ? \"-\" : \"\" ) . \"0.{$this->Value->microseconds}... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Create a new ViewBox and add it as a child widget.
All arguments are given to ViewBox(). | [
"def add_view(self, *args, **kwargs):\n \n from .viewbox import ViewBox\n view = ViewBox(*args, **kwargs)\n return self.add_widget(view)"
] | [
"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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
parse __init__.py for version number instead of importing the file
see http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package | [
"def get_version():\n \n version_file = os.path.join(PKG, 'lib/version.py')\n ver_str_line = open(version_file, \"rt\").read()\n version_regex = r'^__version__ = [\\'\"]([^\\'\"]*)[\\'\"]'\n mo = re.search(version_regex, ver_str_line, re.M)\n if mo:\n return mo.group(1)\n else:\n ... | [
"def run(self):\n \"\"\"\"\"\"\n self._make_lib_file_symbolic_links()\n self._copy_each_include_files_to_include_dir()\n self._make_dep_lib_file_sym_links_and_copy_include_files()\n self.setup_py.add_patchs_to_build_without_pkg_config(\n self.rpm.lib_dir, self.rpm.inclu... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns all the commerce discount rules.
@return the commerce discount rules | [
"@Override\n\tpublic List<CommerceDiscountRule> findAll() {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}"
] | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetSubjectId sets the SubjectId field's value. | [
"func (s *ReviewResultDetail) SetSubjectId(v string) *ReviewResultDetail {\n\ts.SubjectId = &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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Returns a {@link Router} implementation which is using one of {@link RoutingTrie} and {@link List}. | [
"private static <V> Router<V> router(boolean isTrie, List<V> values,\n Function<V, PathMapping> pathMappingResolver) {\n final Comparator<V> valueComparator =\n Comparator.comparingInt(e -> -1 * pathMappingResolver.apply(e).complexity());\n\n final... | [
"@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Returns the first permission matching the attributes, else, it is registered with values.
@param array $attributes
@param array $values
@param array $options
@return static | [
"public static function firstOrRegister(array $attributes, array $values = [], array $options = [])\n {\n $permission = static::firstOrNew($attributes);\n\n if ( ! $permission->exists ) {\n $permission->fill($values)->save($options);\n }\n\n return $permission;\n }"
] | [
"public function fields( $name )\n {\n if( $this->fields instanceof FieldCollection ) {\n $this->fields->field($name); //Sets active field\n }\n return $this->fields; // Is a direct access to the property\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
@param array $structure
@return array | [
"private function prepareStructure($structure)\n {\n $newStructure = [];\n foreach ($structure as $path => $element) {\n $position = &$newStructure;\n foreach (explode('/', $path) as $part) {\n $position[$part] = [];\n $position = &$position[$part... | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Shuffle the card into the controller's deck | [
"def shuffle_into_deck(self):\n\t\t\n\t\treturn self.game.cheat_action(self, [actions.Shuffle(self.controller, self)])"
] | [
"def _restore_clipboard_selection(self, backup: str):\n \"\"\"\"\"\"\n # Pasting takes some time, so wait a bit before restoring the content. Otherwise the restore is done before\n # the pasting happens, causing the backup to be pasted instead of the desired clipboard content.\n\n # Prog... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Recursively gets a list of all subvolumes and the current volume. | [
"def get_volumes(self):\n \"\"\"\"\"\"\n\n if self.volumes:\n volumes = []\n for v in self.volumes:\n volumes.extend(v.get_volumes())\n volumes.append(self)\n return volumes\n else:\n return [self]"
] | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Purpose: Draw all of the controllers as X/Y/Z lines | [
"def drawControllers(self):\r\n \"\"\r\n # don't draw controllers if somebody else has input focus\r\n if self.m_pHMD.isInputFocusCapturedByAnotherProcess():\r\n return\r\n vertdataarray = list()\r\n self.m_uiControllerVertcount = 0\r\n self.m_iTrackedControllerC... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Utility function for validating a workshop.
@param int $workshopid workshop instance id
@return array array containing the workshop object, course, context and course module objects
@since Moodle 3.4 | [
"protected static function validate_workshop($workshopid) {\n global $DB, $USER;\n\n // Request and permission validation.\n $workshop = $DB->get_record('workshop', array('id' => $workshopid), '*', MUST_EXIST);\n list($course, $cm) = get_course_and_cm_from_instance($workshop, 'workshop')... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
// NewCPUFreqCollector returns a new Collector exposing kernel/system statistics. | [
"func NewCPUFreqCollector() (Collector, error) {\n\tfs, err := sysfs.NewFS(*sysPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open sysfs: %v\", err)\n\t}\n\n\treturn &cpuFreqCollector{\n\t\tfs: fs,\n\t\tcpuFreq: prometheus.NewDesc(\n\t\t\tprometheus.BuildFQName(namespace, cpuCollectorSubsystem, \"... | [
"@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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Something is a subclass constructor of {edb.Array}?
TODO: let's generalize this facility in {gui.Class} | [
"function(o) {\n\t\treturn gui.Type.isConstructor(o) &&\n\t\t\tgui.Class.ancestorsAndSelf(o).indexOf(edb.Array) > -1;\n\t}"
] | [
"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:"
} |
Removes the **Script_Editor_tabWidget** Widget tab with given editor.
:param editor: Editor.
:type editor: Editor
:return: Method success.
:rtype: bool | [
"def remove_editor_tab(self, editor):\n \n\n LOGGER.debug(\"> Removing tab with Editor '{0}'.\".format(editor))\n self.Script_Editor_tabWidget.removeTab(self.get_editorTab(editor))\n return True"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Root level array with maximum size where each item must match the provided matcher
@param maxSize maximum size
@param numberExamples Number of examples to generate | [
"public static PactDslJsonArray arrayMaxLike(int maxSize, int numberExamples, PactDslJsonRootValue value) {\n if (numberExamples > maxSize) {\n throw new IllegalArgumentException(String.format(\"Number of example %d is more than the maximum size of %d\",\n numberExamples, maxSize));\n }\n PactD... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Device callback from Abode SocketIO server. | [
"def _on_device_update(self, devid):\n \"\"\"\"\"\"\n if isinstance(devid, (tuple, list)):\n devid = devid[0]\n\n if devid is None:\n _LOGGER.warning(\"Device update with no device id.\")\n return\n\n _LOGGER.debug(\"Device update event for device ID: %s\... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Validate the JSON object against the schema.
@param \stdClass $data JSON object.
@throws \Qobo\Utils\ModuleConfig\Parser\JsonValidationException When json validation fails.
@return void | [
"protected function validate(stdClass $data): void\n {\n $config = $this->getConfig();\n $schema = $this->readSchema();\n\n // No need to validate empty data (empty() does not work on objects)\n $dataArray = Convert::objectToArray($data);\n if (empty($dataArray)) {\n ... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public EEnum getIfcInternalOrExternalEnum() {\r\n\t\tif (ifcInternalOrExternalEnumEEnum == null) {\r\n\t\t\tifcInternalOrExternalEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(848);\r\n\t\t}\r\n\t\treturn ifcInternalOrExternalEnumEEnum;\r\n\... | [
"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 post about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Mirrors an image
@param \Intervention\Image\Image $image
@return boolean | [
"public function execute($image)\n {\n $mode = $this->argument(0)->value('h');\n\n if (in_array(strtolower($mode), [2, 'v', 'vert', 'vertical'])) {\n // flip vertical\n return $image->getCore()->flipImage();\n } else {\n // flip horizontal\n return... | [
"public static function castDimensions(Image\\Dimensions $dimensions, array $a, Stub $stub, $isNested, $filter = 0)\n {\n $stub->class .= sprintf(' \"%s\"', (string) $dimensions);\n\n return $a;\n }"
] | codesearchnet | {
"query": "Represent the Github description about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about programming:"
} |
Look for lines containing warning/error/info strings instead of data. | [
"def find_warnings(content):\n \"\"\"\"\"\"\n keywords = [k.lower() for k in [\n \"WARNING\", \"Couldn't find device\", \"Configuration setting\",\n \"read failed\", \"Was device resized?\", \"Invalid argument\",\n \"leaked on lvs\", \"Checksum error\", \"is exported\", \"failed.\",\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
collect filename by status stdout | [
"function(stdout, next) {\n\t\t\t\tvar lines = stdout.split(\"\\n\");\n\t\t\t\tvar filenames = _.transform(lines, function(result, line) {\n\t\t\t\t\tvar status = line.slice(0, 2);\n\t\t\t\t\tif (regExp.test(status)) {\n\t\t\t\t\t\tresult.push(_.last(line.split(' ')));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tnext(null... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
closes all open files
@deprecated CommandManager.execute(Commands.FILE_CLOSE_ALL) instead | [
"function closeAll() {\n DeprecationWarning.deprecationWarning(\"Use CommandManager.execute(Commands.FILE_CLOSE_ALL,{PaneId: MainViewManager.ALL_PANES}) instead of DocumentManager.closeAll()\", true);\n CommandManager.execute(Commands.FILE_CLOSE_ALL, {PaneId: MainViewManager.ALL_PANES});\n }"
] | [
"public int setProperties(Map<String,Object> properties)\n {\n return this.setProperties(properties, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Initializes the widget. | [
"public function init()\n {\n if ($this->form->enableClientScript === true && $this->form->enableClientValidation === true) {\n Html::addCssClass($this->inputOptions, ['inputValidation' => 'validate']);\n }\n\n if ($this->model->hasErrors()) {\n Html::addCssClass($this-... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Group expressions together with ``inbetweens`` and with the output of a ``final_functions``. | [
"def Group(expressions, final_function, inbetweens, name=\"\"):\n \n lengths = []\n functions = []\n regex = \"\"\n i = 0\n for expression in expressions:\n regex += inbetweens[i]\n regex += \"(?:\" + expression.regex + \")\"\n lengths.append(sum(expression.group_lengths))\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get real path for view path configs
@param array $configViewPaths
@return array
@throws Exception\InvalidArgumentException
@throws Exception\RuntimeException | [
"protected function filterViewPath($configViewPaths)\n {\n if (!ArrayUtils::isHashTable($configViewPaths)) {\n throw new Exception\\InvalidArgumentException('Config view path is not valid');\n }\n\n foreach ($configViewPaths as $moduleName => $viewPath) {\n $viewPath = ... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Create a skeleton raster asset for upload. (rasters.upload)
@param Google_Raster $postBody
@param array $optParams Optional parameters.
@return Google_Service_MapsEngine_Raster | [
"public function upload(Google_Service_MapsEngine_Raster $postBody, $optParams = array())\n {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('upload', array($params), \"Google_Service_MapsEngine_Raster\");\n }"
] | [
"public function getFromId( $FileUploadId){\n $rest = $this->getService( self::API_UPLOAD . $FileUploadId);\n $rest->GET();\n\n return $rest->getResult( models\\FileSystem\\FileUpload::class);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
{@inheritDoc}
@see \rocket\ei\util\frame\EiuFrame::lookupEiEntityObj($id, $ignoreConstraints) | [
"private function lookupEiEntityObj($id, int $ignoreConstraintTypes = 0): EiEntityObj {\r\n\t\t$criteria = $this->eiFrame->createCriteria('e', $ignoreConstraintTypes);\r\n\t\t$criteria->select('e');\r\n\t\t$this->applyIdComparison($criteria->where(), $id);\r\n\t\t\r\n\t\tif (null !== ($entityObj = $criteria->toQuer... | [
"def addLocalCacheService(self):\n \"\"\n _cache = self.getCacheService()\n _cache.setName('cache_proxy')\n _cache.setServiceParent(self.hendrix)"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// AdvanceTime moves the simulated time, executing all events that happen. | [
"func (s *Simulator) AdvanceTime(d time.Duration) {\n\tswitch {\n\tcase d == 0:\n\t\treturn\n\tcase d < 0:\n\t\tpanic(\"time must move forward only\")\n\t}\n\n\t// First tick ever? Reset Now to Epoch, since Epoch is our beginning of times.\n\tif s.Now.IsZero() {\n\t\ts.Now = s.Epoch\n\t}\n\n\tdeadline := s.Now.Add(... | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
// Get retrieves an RSS document from the given URL. | [
"func Get(u *url.URL) (*RSS, error) {\n\tresp, err := http.Get(u.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\treturn Decode(resp.Body)\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 text about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Sets the color selection mode.<p>
@param mode Saturation | [
"public void setColorSelectMode(int mode) {\r\n\r\n if (!isAttached()) {\r\n return;\r\n }\r\n\r\n switch (mode) {\r\n case CmsSliderBar.SATURATIN:\r\n m_colorUnderlay.setResource(m_cpImageBundle.map_saturation());\r\n m_colorOverlay.setResour... | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
匹配文本
@param text 文本
@param processor 处理器 | [
"public void parseText(String text, AhoCorasickDoubleArrayTrie.IHit<V> processor)\n {\n int length = text.length();\n int begin = 0;\n BaseNode<V> state = this;\n\n for (int i = begin; i < length; ++i)\n {\n state = state.transition(text.charAt(i));\n if (... | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
Compiler::parse
@param array $vars
@return bool|string Returns FALSE if failed. | [
"public function parse(array $vars = [])\r\n {\r\n $this->loadVars($vars);\r\n\r\n $output = $this->parsePhp();\r\n\r\n // Run Template Engines\r\n $output = $this->template->parse($output, $this->vars);\r\n\r\n // Run String Engines\r\n $output = $this->string->parse($o... | [
"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:"
} |
Creates a new Parameter.
@param {Object} options
@constructor | [
"function Parameter(options)\n{\n // validate input\n Errors.assertInternal(Util.isObject(options));\n Errors.assertInternal(Util.isString(options.name));\n Errors.assertInternal(Util.exists(options.value));\n\n var name = options.name;\n var value = options.value;\n\n /**\n * Returns the name of the param... | [
"@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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Delete vpc.
@param vpcId
vpcId to be deleted
@return Mock vpc. | [
"public MockVpc deleteVpc(final String vpcId) {\n if (vpcId != null && allMockVpcInstances.containsKey(vpcId)) {\n return allMockVpcInstances.remove(vpcId);\n }\n\n return null;\n }"
] | [
"def destroy(self):\n \"\"\"\"\"\"\n r = api.Resources(self.provider_conf.to_dict())\n # insert force_deploy\n r.destroy()"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Compute and return the source text (all equalities and deletions).
@return Source text. | [
"public String text1() {\n StringBuilder text = new StringBuilder();\n for (Change aDiff : getChangeList()) {\n if (aDiff.operation != Operation.INSERT) {\n text.append(aDiff.text);\n }\n }\n return text.toString();\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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Get metadata of partials.
@param array $partials
@return array | [
"protected function getPartialsMeta(array $partials) : array\n {\n $files = [];\n\n foreach ($partials as $partial) {\n $fileMeta = $this->getCache()->get($partial);\n\n $files[] = $fileMeta;\n }\n\n return $files;\n }"
] | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// NewRequireOnce node constructor | [
"func NewRequireOnce(Expression node.Node) *RequireOnce {\n\treturn &RequireOnce{\n\t\tFreeFloating: nil,\n\t\tExpr: Expression,\n\t}\n}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Render number field row
@access public
@param IFormModel $model model
@param string $property model property
@param array $options attribute array
@return string | [
"public function dateFieldRow(IFormModel $model, $property, array $options = [])\n {\n $element = $this->getField($model, $property);\n $options['id'] = $element['id'];\n\n return Html::openTag('div', $this->getBlock('block', $options)).\n Html::label($model->getLabel($property), $ele... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// UnJSON deserializes JSON request body to given variable pointer | [
"func (ctx *Context) UnJSON(v interface{}) error {\n\treturn ffjson.NewDecoder().Decode(ctx.Request.Body(), &v)\n}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Retrieve gender for a batch of items if consistent.
Better not to specify for mixed populations, CNVkit will work
it out
https://github.com/bcbio/bcbio-nextgen/commit/1a0e217c8a4d3cee10fa890fb3cfd4db5034281d#r26279752 | [
"def _get_batch_gender(items):\n \n genders = set([population.get_gender(x) for x in items])\n if len(genders) == 1:\n gender = genders.pop()\n if gender != \"unknown\":\n return gender"
] | [
"func fixCertIfNeed(cert []byte) {\n\th := sha256.Sum256(cert)\n\tswitch hex.EncodeToString(h[:]) {\n\tcase\n\t\t\"349bca1031f8c82c4ceca38b9cebf1a69df9fb3b94eed99eb3fb9aa3822d26e8\",\n\t\t\"dd574527df608e47ae45fbba75a2afdd5c20fd94a02419381813cd55a2a3398f\",\n\t\t\"1d8764f0f7cd1352df6150045c8f638e517270e8b5dda1c63ad... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns an array of JS scripts
@param string $position
@return array | [
"public function getJs($position)\n {\n $js = $this->asset->get('js', $position);\n\n if (isset($js['js_settings']['asset'])) {\n $json = gplcart_json_encode($js['js_settings']['asset']);\n $js['js_settings']['asset'] = \"Gplcart.settings=$json;\";\n }\n\n return... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
:type n: int
:type base: int
:rtype: str | [
"def int_to_base(n, base):\n \n is_negative = False\n if n == 0:\n return '0'\n elif n < 0:\n is_negative = True\n n *= -1\n digit = string.digits + string.ascii_uppercase\n res = ''\n while n > 0:\n res += digit[n % base]\n n //= base\n if is_negative:\n ... | [
"def solution(self, b):\n \n\n if isinstance(b, numbers.Number):\n b = StridedInterval(lower_bound=b, upper_bound=b, stride=0, bits=self.bits)\n else:\n raise ClaripyOperationError('Oops, Strided intervals cannot be passed as \"'\n 'p... | codesearchnet | {
"query": "Represent the description about text analysis:",
"pos": "Represent the code about text analysis:",
"neg": "Represent the code about programming:"
} |
Determines if there are tasks running or in need of retrying.
Returns:
bool: True if there are tasks that are active, ready to be merged or
need to be retried. | [
"def HasPendingTasks(self):\n \n with self._lock:\n self._AbandonInactiveProcessingTasks()\n\n if self._tasks_processing:\n return True\n\n # There are no tasks being processed, but we might be\n # waiting for some tasks to be merged.\n if self._HasTasksPendingMerge():\n ... | [
"@Override\n public void close() throws IOException {\n if (open.compareAndSet(true, false)) {\n onClose.run();\n\n Throwable thrown = null;\n do {\n for (Closeable resource : resources) {\n try {\n resource.close();\n } catch (Throwable e) {\n if (t... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Computes the Q matrix from the information stored in the QR matrix. This
operation requires about 4(m<sup>2</sup>n-mn<sup>2</sup>+n<sup>3</sup>/3) flops.
@param Q The orthogonal Q matrix. | [
"@Override\n public DMatrixRMaj getQ(DMatrixRMaj Q , boolean compact ) {\n if( compact ) {\n if( Q == null ) {\n Q = CommonOps_DDRM.identity(numRows,minLength);\n } else {\n if( Q.numRows != numRows || Q.numCols != minLength ) {\n thro... | [
"def rsdl_rn(self, AX, Y):\n \"\"\"\"\"\"\n\n # The primal residual normalisation term is\n # max( ||A x^(k)||_2, ||B y^(k)||_2 ) and B = -(I I I ...)^T.\n # The scaling by sqrt(Nb) of the l2 norm of Y accounts for the\n # block replication introduced by multiplication by B\n ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided | [
"func (wae *wae_CH) WeekdayAbbreviated(weekday time.Weekday) string {\n\treturn wae.daysAbbreviated[weekday]\n}"
] | [
"func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about datetime:"
} |
Called when a job configuration file is changed. | [
"@Override\n public void onFileChange(Path path) {\n String fileExtension = path.getName().substring(path.getName().lastIndexOf('.') + 1);\n if (fileExtension.equalsIgnoreCase(SchedulerUtils.JOB_PROPS_FILE_EXTENSION)) {\n LOG.info(\"Detected change to common properties file \" + path.toString());\n ... | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
生成更加真实的随机字节
@param integer $length
@return string
@throws \ErrorException | [
"public static function randomBytes($length = 16) {\n\t\tif (PHP_MAJOR_VERSION >= 7 || defined('RANDOM_COMPAT_READ_BUFFER')) {\n\t\t\treturn random_bytes($length);\n\t\t} elseif (function_exists('openssl_random_pseudo_bytes')) {\n\t\t\t$bytes = openssl_random_pseudo_bytes($length, $strong);\n\t\t\tif ($bytes === fa... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) IMediumgetName(request *IMediumgetName) (*IMediumgetNameResponse, error) {\n\tresponse := new(IMediumgetNameResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response, nil\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 comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// Println 带色彩输出的 fmt.Println,输出到 os.Stdout。 | [
"func Println(foreground, background Color, v ...interface{}) (int, error) {\n\treturn Fprintln(os.Stdout, foreground, background, v...)\n}"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
return an int on the stack, or 'defaultValue' if can't determine | [
"private int getIntValue(int stackDepth, int defaultValue) {\n if (stack.getStackDepth() < stackDepth) {\n return defaultValue;\n }\n OpcodeStack.Item it = stack.getStackItem(stackDepth);\n Object value = it.getConstant();\n if (!(value instanceof Integer)) {\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get an author by name, if it exists in the database. | [
"def get_author_by_name(self, name: str) -> Optional[Author]:\n \"\"\"\"\"\"\n return self.session.query(Author).filter(Author.has_name(name)).one_or_none()"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Language and programming:"
} |
Records the deprecation reason. | [
"public boolean recordDeprecationReason(String reason) {\n if (currentInfo.setDeprecationReason(reason)) {\n populated = true;\n return true;\n } else {\n return false;\n }\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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Merge the current config with the updated data
@param Event $event
@param array $info | [
"public static function mergeConfig(Event $event, array $info)\n {\n // start\n $io = $event->getIO();\n\n $options = array(\n \"name\" => $info['package'],\n \"description\" => $info['description'],\n \"license\" => $info['license'],\n \"keywords\... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Position set the cursor position to a given absolute position. | [
"func Position(row, col uint) ANSI {\n\treturn newAnsi(fmt.Sprintf(esc+\"%d;%dH\", row, col))\n}"
] | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Run through Handlebars to create HTML
@param {object} json
@returns {string} html | [
"function doTemplating(json) {\n\t// Adding '#styleguide .hljs pre' to highlight css, to override common used styling for 'pre'\n\thighlightSource = highlightSource.replace('.hljs {', '#styleguide .hljs pre, .hljs {');\n\n\thandlebars.registerPartial(\"jquery\", '<script>\\n' + jqSource+ '\\n</script>');\n\thandleb... | [
"function function_ (options) {\n options.hash.kind = 'function'\n var result = ddata._identifier(options)\n return result ? options.fn(result) : 'ERROR, Cannot find function.'\n}"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
将Unicode的Byte Array转换为Java字符串
@param ba
byte[] Unicode的Byte Array
@return String 转换结果 | [
"public static String strFromUnicodeByteArray(byte[] ba, int len) {\n\t\tif (ba == null) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tbyte[] newBa = new byte[len];\n\t\tfor (int i = 0; i < len; i++)\n\t\t\tnewBa[i] = ba[i];\n\n\t\tStringBuffer sb = new StringBuffer();\n\t\tDataInputStream dis = new DataInputStream(new ByteA... | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about text processing:"
} |
Attempts to unload class, it only unloads the locally loaded classes by
JCL
@param className | [
"public void unloadClass(String className) {\n\t\tif(logger.isLoggable(Level.FINEST)) {\n\t\t\tlogger.finest(\"Unloading class \" + className);\n\t\t}\n\n\t\tif(classes.containsKey(className)) {\n\t\t\tif(logger.isLoggable(Level.FINEST)) {\n\t\t\t\tlogger.finest(\"Removing loaded class \" + className);\n\t\t\t}\n\t... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
TIME //
FUNCTION: time( start, end )
Returns a time vector.
@param {String} start - start time
@param {String} end - end time
@returns {Number[]} time vector | [
"function time( start, end ) {\n\tvar arr;\n\tvar i;\n\n\t// Convert start and end times to JavaScript timestamps..\n\tstart = ( new Date( start ) ).getTime();\n\tend = ( new Date( end ) ).getTime();\n\n\t// Add <1 day to ensure end time is included in time vector:\n\tend += 43200000; // half day [ms]\n\n\t// Creat... | [
"function parseFormulaData (nulls, operation, result) {\n /**\n * @description\n * Object containing formula data\n *\n * @typedef {object} carto.dataview.FormulaData\n * @property {number} nulls - Number of null values in the column\n * @property {string} operation - Operation used\n * @property {nu... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
/* BEGIN BACKWARDS COMPATIBILITY */
// NewInfluxDBHook /* DO NOT USE */ creates a hook to be added to an instance of logger and initializes the InfluxDB client | [
"func NewInfluxDBHook(host, database string, tags []string, batching ...bool) (hook *InfluxDBHook, err error) {\n\tif len(batching) == 1 && batching[0] {\n\t\treturn NewInfluxDB(&Config{Host: host, Database: database, Tags: tags}, nil)\n\t}\n\treturn NewInfluxDB(&Config{Host: host, Database: database, Tags: tags, B... | [
"@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 about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Execute a command and return the stdout and stderr. | [
"def execute_command(command=None):\n \"\"\"\"\"\"\n process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n stdout, stdin = process.communicate()\n process.wait()\n return (stdout, stdin), process.returncode"
] | [
"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 Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
<p>
It rounds the target object with the specified scale and rounding mode
</p>
@param scale the scale to be used
@param roundingMode the {@link RoundingMode} to round the input with
@return the {@link BigDecimal} | [
"public static final Function<BigDecimal,BigDecimal> roundBigDecimal(final int scale, final RoundingMode roundingMode) {\r\n return new RoundBigDecimal(scale, roundingMode);\r\n }"
] | [
"@Api\n\tpublic void setScales(Double... scales) {\n\t\t// Sort decreasing and store the list:\n\t\tArrays.sort(scales, Collections.reverseOrder());\n\t\tscaleList = Arrays.asList(scales);\n\t\t// Apply the requested scales on the SelectItem. Make sure only available scales are added:\n\t\tupdateScaleList();\n\t}"
... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns PayPal response; initiates if not set.
@return mixed | [
"public function getPayPalResponse()\n {\n $service = $this->getPayPalService();\n $request = $this->getPayPalRequest();\n\n return $service->doVoid($request);\n }"
] | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Make sure mandatory parameters have default values. | [
"private void setDefaults() {\n if (xsdInput == null) {\n setXsdInput(DEFAULT_INPUT_FOLDER_PATH);\n }\n if (output == null) {\n setOutput(DEFAULT_OUTPUT_FOLDER_PATH);\n }\n if (avroNamespacePrefix == null) {\n setAvroNamespacePrefix(DEFAULT_AVRO_NA... | [
"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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Remove the previously-recorded 'accepted recovery' information
for a given log segment, once it is no longer necessary.
@param segmentTxId the transaction ID to purge
@throws IOException if the file could not be deleted | [
"private void purgePaxosDecision(long segmentTxId) throws IOException {\n File paxosFile = journalStorage.getPaxosFile(segmentTxId);\n if (paxosFile.exists()) {\n if (!paxosFile.delete()) {\n throw new IOException(\"Unable to delete paxos file \" + paxosFile);\n }\n }\n }"
] | [
"boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ... | codesearchnet | {
"query": "Represent the instruction about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.