query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
检查值是否在指定范围内
@param value 值
@param min 最小值(包含)
@param max 最大值(包含)
@return 检查后的长度值
@since 4.1.10 | [
"public static int checkBetween(int value, int min, int max) {\r\n\t\tif (value < min || value > max) {\r\n\t\t\tthrow new IllegalArgumentException(StrUtil.format(\"Length must be between {} and {}.\", min, max));\r\n\t\t}\r\n\t\treturn value;\r\n\t}"
] | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
overrides the visitor capture source lines for the method
@param obj
the method object for the currently parsed method | [
"@Override\n public void visitMethod(final Method obj) {\n methodName = obj.getName();\n if (Values.STATIC_INITIALIZER.equals(methodName) || Values.CONSTRUCTOR.equals(methodName)) {\n return;\n }\n\n List<String> parms = SignatureUtils.getParameterSignatures(obj.getSignatur... | [
"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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// SetMaximumOverCapacity sets the maximum amount of pod instances above the instance count, expressed as a fraction of instance count | [
"func (p *PodUpgrade) SetMaximumOverCapacity(capacity float64) *PodUpgrade {\n\tp.MaximumOverCapacity = &capacity\n\treturn p\n}"
] | [
"def setupJobAfterFailure(self, config):\n \n self.remainingRetryCount = max(0, self.remainingRetryCount - 1)\n logger.warn(\"Due to failure we are reducing the remaining retry count of job %s with ID %s to %s\",\n self, self.jobStoreID, self.remainingRetryCount)\n # S... | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Create Registration ID.
@return string Registration ID | [
"public function createRegistrationId()\n {\n $registration = new GcmRegistration();\n // build uri\n $uri = $this->endpoint.$this->hubPath.'/registrationIDs/';\n\n $token = $this->generateSasToken($uri);\n $headers = array_merge(['Authorization: '.$token], $registration->getHe... | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// UpdateHost provides a mock function with given fields: ctx, entity | [
"func (_m *FacadeInterface) UpdateHost(ctx datastore.Context, entity *host.Host) error {\n\tret := _m.Called(ctx, entity)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(datastore.Context, *host.Host) error); ok {\n\t\tr0 = rf(ctx, entity)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\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 about host:",
"pos": "Represent the Github code about host:",
"neg": "Represent the Github code about programming:"
} |
Internal method to get a specific alias. | [
"def _get(self, target, alias):\n \n if target not in self._aliases:\n return\n return self._aliases[target].get(alias)"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Data management:",
"pos": "Represent the Github code about Data management:",
"neg": "Represent the Github code:"
} |
Return a json dictionary representing this model. | [
"def _to_dict(self):\n \"\"\"\"\"\"\n _dict = {}\n if hasattr(self, 'label') and self.label is not None:\n _dict['label'] = self.label\n if hasattr(self, 'score') and self.score is not None:\n _dict['score'] = self.score\n return _dict"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Execute method.
@return void | [
"public function execute()\n {\n $attribute = $this->getRequest()->getParam('attribute');\n $conditionName = $this->getRequest()->getParam('condition');\n $valueName = $this->getRequest()->getParam('value');\n if ($attribute && $conditionName && $valueName) {\n $type = $thi... | [
"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:"
} |
Performs REST request to moodle.net (using GET method)
@param string $token
@param string $function
@param array $data
@return mixed
@throws moodle_exception | [
"protected static function call_rest($token, $function, array $data) {\n $params = [\n 'wstoken' => $token,\n 'wsfunction' => $function,\n 'moodlewsrestformat' => 'json'\n ] + $data;\n\n $curl = new curl();\n $serverurl = HUB_MOODLEORGHUBU... | [
"public function startHarvesting($privateKey) \n {\n $params = [\"value\" => $privateKey];\n\n $apiUrl = $this->getPath('unlock', $params);\n $response = $this->api->post($apiUrl, []);\n\n //XXX include Error checks\n $object = json_decode($response);\n return $this->cre... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Same as cropImage() for transparent images
@param resource $imageResource Image to crop
@return bool|resource Cropped image | [
"public function cropTransparentImage($imageResource)\n {\n /** @var int $imageTransparency Transparent color */\n $imageTransparency = imagecolorallocatealpha($imageResource, 255, 255, 255, 127);\n /** @var resource $croppedImage Cropped image resource */\n $croppedImage = imagecreat... | [
"public function isSmall() :bool {\n // Invoke cropToStyle, to get info about the size.\n $this->cropToStyle($this->configFactory->get('social_group.settings')->get('default_hero'));\n // Return info about the size.\n return $this->isSmall;\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about NLP:"
} |
Object.is/sameValueZero polyfill.
@api private
@param {*} value1
@param {*} value2
@return {boolean}
TODO: Move to library | [
"function sameValueZero(value1, value2) {\n // Normal values and check for 0 / -0\n if (value1 === value2) {\n return value1 !== 0 || 1 / value1 === 1 / value2;\n }\n // NaN\n return value1 !== value1 && value2 !== value2;\n}"
] | [
"function run(booleanOrString, anyDataType, functionOrObject, aNumber, anArray) {\n /*\n * if expectations aren't met, args checker will throw appropriate exceptions\n * notifying the user regarding the errors of the arguments.\n * */\n \targs.expect(arguments, ['boolean|string', '*',... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// miloBuildStep converts a logdog/milo step to a BuildComponent struct.
// buildCompletedTime must be zero if build did not complete yet. | [
"func miloBuildStep(c context.Context, ub URLBuilder, anno *miloProto.Step, includeChildren bool) ui.BuildComponent {\n\n\tcomp := ui.BuildComponent{\n\t\tLabel: ui.NewLink(anno.Name, \"\", anno.Name),\n\t}\n\tswitch anno.Status {\n\tcase miloProto.Status_RUNNING:\n\t\tcomp.Status = model.Running\n\n\tcase miloProt... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
getAllUsers List all users for an application
@access public
@return array array of user associative arrays | [
"public function getAllUsers($count=1000, $offset=0, $searchToken=null) {\n global $logger;\n $path = 'users';\n $request = $this->_remoteServer->get($path);\n if(!empty($searchToken)) {\n $request->getQuery()->set('searchToken', $searchToken);\n }\n $request-... | [
"@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Assign items
@param string $id
@return array | [
"public function actionRevoke($id)\n {\n $items = Yii::$app->getRequest()->post('items', []);\n $model = new AdminAssignment($id);\n $success = $model->revoke($items);\n Yii::$app->getResponse()->format = Response::FORMAT_JSON;\n return array_merge($model->getItems(), ['success... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@example
foo = rmq(view).has_style?(:style_name_here)
@return true if all selected views has the style | [
"def has_style?(style_name)\n selected.each do |view|\n return false unless view.rmq_data.has_style?(style_name)\n end\n true\n end"
] | [
"def grid_filter(grid, filter_key)\n unless grid.is_a? WiceGrid\n raise WiceGridArgumentError.new('grid_filter: the parameter must be a WiceGrid instance.')\n end\n if grid.output_buffer.nil?\n raise WiceGridArgumentError.new(\"grid_filter: You have attempted to run 'grid_filter' before... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Refresh the document from the database. | [
"def refresh(self):\n '''\n \n '''\n d = self.rr.table(self.table).get(self.pk_value).run()\n if d is None:\n raise KeyError\n for k in d:\n dict.__setitem__(\n self, k, watch(d[k], callback=self._updated, field=k))"
] | [
"@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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Check if is a content view and if content_id is visible
@param ViewCheckEvent $event
@param string $eventName
@param EventDispatcherInterface $dispatcher | [
"public function viewCheck(ViewCheckEvent $event, $eventName, EventDispatcherInterface $dispatcher)\n {\n if ($event->getView() == 'content') {\n $content = ContentQuery::create()\n ->filterById($event->getViewId())\n ->filterByVisible(1)\n ->count()... | [
"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:"
} |
The key to be displayed to user, doesn't contain information on branches | [
"public String getKey() {\n List<String> split = BRANCH_OR_PULL_REQUEST_SPLITTER.splitToList(kee);\n return split.size() == 2 ? split.get(0) : kee;\n }"
] | [
"func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Groups retrieves the list of child Groups of the L2Domain | [
"func (o *L2Domain) Groups(info *bambou.FetchingInfo) (GroupsList, *bambou.Error) {\n\n\tvar list GroupsList\n\terr := bambou.CurrentSession().FetchChildren(o, GroupIdentity, &list, info)\n\treturn list, err\n}"
] | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the description about Agent Identity Management:",
"pos": "Represent the code about Agent Identity Management:",
"neg": "Represent the code about Natural Language Processing:"
} |
Generate a list of exportable columns.
@return array | [
"protected function exportableColumns(): array\n {\n if (method_exists($this->module, 'exportableColumns')) {\n return $this->module->exportableColumns();\n }\n\n /**\n * @var Model\n */\n $model = $this->module->model();\n\n return collect($model->ge... | [
"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 summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Documentation:"
} |
Generate a link to a JavaScript file.
@param string $url
@param array $attributes
@param bool $secure
@return string | [
"public function script($url, $attributes = [], $secure = null)\n {\n $attributes['src'] = $this->url->asset($url, $secure);\n return '<script' . $this->attributes($attributes) . '></script>' . PHP_EOL;\n }"
] | [
"public function Code(Environment $environment, $name, $type, $version = 'latest', $params = null)\n {\n $type = strtolower($type);\n\n //Gets type for local file\n $local = false;\n if ('local' == $type) {\n $local = true;\n $type = strtolower(substr($name, strr... | codesearchnet | {
"query": "Represent the sentence about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about text processing:"
} |
// SetValue sets the Value field's value. | [
"func (s *Text) SetValue(v string) *Text {\n\ts.Value = &v\n\treturn s\n}"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Returns details on a specific table. | [
"def describe_table(cls,\n db: DATABASE_SUPPORTER_FWD_REF,\n table: str) -> List[List[Any]]:\n \"\"\"\"\"\"\n raise RuntimeError(_MSG_NO_FLAVOUR)"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Set the network vehicle quality.
Only available to Admin.
Requires a map restart to be taken into account.
@param int $quality 0: fast, 1: high
@param bool $multicall
@return bool
@throws InvalidArgumentException | [
"function setVehicleNetQuality($quality, $multicall = false)\n {\n if ($quality !== 0 && $quality !== 1) {\n throw new InvalidArgumentException('quality = ' . print_r($quality, true));\n }\n\n return $this->execute(ucfirst(__FUNCTION__), array($quality), $multicall);\n }"
] | [
"def cancel_link_unlink_mode(self):\n \"\"\"\"\"\"\n self.logger.info(\"cancel_link_unlink_mode\")\n self.scene_command('08')\n # should send http://0.0.0.0/0?08=I=0\n\n ## TODO check return status\n status = self.hub.get_buffer_status()\n return status"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// state functions | [
"func lexItem(l *lexer) stateFn {\nLoop:\n\tfor {\n\t\tswitch r := l.next(); {\n\t\tcase r == '{':\n\t\t\tl.emit(itemLeftBrace)\n\t\tcase r == '}':\n\t\t\tl.emit(itemRightBrace)\n\t\tcase r == '[':\n\t\t\tl.emit(itemLeftBracket)\n\t\tcase r == ']':\n\t\t\tl.emit(itemRightBracket)\n\t\tcase r == '=':\n\t\t\tl.emit(i... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Return path to product metadata XML file. | [
"def product_metadata_path(self):\n \"\"\"\"\"\"\n data_object_section = self._manifest_safe.find(\"dataObjectSection\")\n for data_object in data_object_section:\n # Find product metadata XML.\n if data_object.attrib.get(\"ID\") == \"S2_Level-1C_Product_Metadata\":\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Contains returns true if this multimap contains at least one key-value pair with the key key and the value value. | [
"func (m *MultiMap) Contains(key interface{}, value interface{}) bool {\n\tset, found := m.m[key]\n\tif _, ok := set[value]; ok {\n\t\treturn true && found\n\t}\n\treturn false && found\n}"
] | [
"function NDDBIndex(idx, nddb) {\n // The name of the index.\n this.idx = idx;\n // Reference to the whole nddb database.\n this.nddb = nddb;\n // Map indexed-item to a position in the original database.\n this.resolve = {};\n // List of all keys in `resolve` object.... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Debugf log content as Debug and format | [
"func (s *SyslogLogger) Debugf(format string, v ...interface{}) {\n\ts.w.Debug(fmt.Sprintf(format, v...))\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Reduz as strings de uma lista em strings de até 3 caracteres
@param array $date
@return array | [
"private function reduzDateFormat(array $date): array\n {\n $data = [];\n foreach ($date as $item) {\n $data[] = substr($item, 0, 3);\n }\n return $data;\n }"
] | [
"def bloquear_sat(retorno):\n \n resposta = analisar_retorno(forcar_unicode(retorno),\n funcao='BloquearSAT')\n if resposta.EEEEE not in ('16000',):\n raise ExcecaoRespostaSAT(resposta)\n return resposta"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// execute delete | [
"func (o *querySet) Delete() (int64, error) {\n\treturn o.orm.alias.DbBaser.DeleteBatch(o.orm.db, o, o.mi, o.cond, o.orm.alias.TZ)\n}"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// MD5FromReader creates a MD5 hash from the given reader. | [
"func MD5FromReader(r io.Reader) (string, error) {\n\th := md5.New()\n\tif _, err := io.Copy(h, r); err != nil {\n\t\treturn \"\", nil\n\t}\n\treturn hex.EncodeToString(h.Sum(nil)), nil\n}"
] | [
"func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Computes the SVD of A and extracts the homography matrix from its null space | [
"protected boolean computeH(DMatrixRMaj A, DMatrixRMaj H) {\n\n\t\tif( !solverNullspace.process(A.copy(),1,H) )\n\t\t\treturn true;\n\n\t\tH.numRows = 3;\n\t\tH.numCols = 3;\n\n\t\treturn false;\n\t}"
] | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Add sets a value to the trie at a particular route. The route is typically
// a URL path, with or without host, e.g. "example.com/foo" or just
// "/foo". Routes can contain :param placeholders and *wildcard placeholders. | [
"func (t *RouteTrie) Add(route string, value interface{}) error {\n\troute = normalize(route)\n\n\t// If the end has been reached, save the value to the node.\n\tif route == \"\" {\n\t\tt.value = value\n\t\treturn nil\n\t}\n\n\t// Split off the head path from the route.\n\t// For example: 'foo/bar/baz' => 'foo', 'b... | [
"def GetPathFromLink(resource_link, resource_type=''):\n \n resource_link = TrimBeginningAndEndingSlashes(resource_link)\n \n if IsNameBased(resource_link):\n # Replace special characters in string using the %xx escape. For example, space(' ') would be replaced by %20\n # This function... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
//Adds a NATURAL JOIN clause. See examples. | [
"func (me *Dataset) NaturalJoin(table Expression) *Dataset {\n\treturn me.joinTable(NATURAL_JOIN, table, nil)\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:"
} |
Add an Icon to the Icon list.
@param iIndex The icon's index.
@param icon The icon at this index. | [
"public void addIcon(Object icon, int iIndex)\n {\n m_rgIcons[iIndex] = icon;\n if (this.getScreenFieldView().getControl() instanceof ExtendedComponent)\t// Always\n ((ExtendedComponent)this.getScreenFieldView().getControl()).addIcon(icon, iIndex);\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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns whether a plain settings array has a key.
If no settings array is given, the internal settings array
is assumed.
@param string $key
@param array $cfg
@return bool | [
"protected function has($key, $cfg = null) {\n if (!$cfg)\n $cfg = $this->cfg;\n return array_key_exists($key, $cfg);\n }"
] | [
"final public function get($varname, $namespace = 'default')\n {\n //gets a registry var, stored in a namespace of this session id\n $session = $this;\n\n if (!isset($namespace) || empty($namespace)) {\n //@TODO Throw an exception, we need a name or use the default;\n r... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
Insert keys into a table which assigns an ID | [
"def insert_keys(self, keys):\n \"\"\"\"\"\"\n start = 0\n bulk_insert = self.bulk_insert\n keys_len = len(keys)\n query = 'INSERT IGNORE INTO gauged_keys (namespace, `key`) VALUES '\n execute = self.cursor.execute\n while start < keys_len:\n rows = keys[s... | [
"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 comment about SQL:",
"pos": "Represent the Github code about SQL:",
"neg": "Represent the Github code:"
} |
Duplicate a node
:param source_node_id: Source node identifier
:param destination_node_id: Destination node identifier
:returns: New node instance | [
"def duplicate_node(self, source_node_id, destination_node_id):\n \n source_node = self.get_node(source_node_id)\n destination_node = self.get_node(destination_node_id)\n\n # Some node don't have working dir like switch\n if not hasattr(destination_node, \"working_dir\"):\n ... | [
"def node_iterator(self):\n \n return iter(self._node_attributes)\n\n\tdef has_hypernode(self, hypernode):\n \"\"\"Determines if a specific hypernode is present in the hypergraph.\n\n :param node: reference to hypernode whose presence is being checked.\n :returns: bool -- true iff... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
finds all the records belonging to s in data | [
"def findrec(s, data):\n \n datablock = []\n for rec in data:\n if s == rec[0]:\n datablock.append([rec[1], rec[2], rec[3], rec[4]])\n return datablock"
] | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/* (non-Javadoc)
@see com.pogofish.jadt.emitter.ClassBodyEmitter#emitEquals(com.pogofish.jadt.emitter.Sink, com.pogofish.jadt.ast.Constructor) | [
"@Override\n public void emitEquals(final Sink sink, final String indent, Constructor constructor, List<String> typeArguments) {\n \tlogger.finest(\"Generating equals() for \" + constructor.name);\n sink.write(indent + \"@Override\\n\");\n sink.write(indent + \"public boolean equals(Object obj) ... | [
"public Class<? extends org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor> bindIParseTreeConstructor() {\n\t\treturn org.eclipse.xtext.generator.parser.antlr.debug.parseTreeConstruction.SimpleAntlrParsetreeConstructor.class;\n\t}"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
:param projection_model: sklearn unsupervised model (e.g., PCA) by default the recommended model is umap.UMAP,
which requires UMAP in to be installed
:return: array, shape (num dimension, vocab size) | [
"def project(self, projection_model=None):\n '''\n \n '''\n if self.embeddings_ is None:\n raise Exception(\"Run set_embeddings_model or set_embeddings to get embeddings\")\n if projection_model is None:\n try:\n import umap\n except... | [
"def input_sensitivity(self, summarize=True):\n \n if not summarize:\n num_params = [0]\n parts = []\n def sum_params(x):\n if (not isinstance(x, CombinationKernel)) and isinstance(x, Kern):\n num_params[0] += 1\n pa... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Generates a new builder from the given xml data and then
loads its information.
:param xdata | <xml.etree.ElementTree.Element>
:return <Builder> || None | [
"def fromXml(cls, xdata, filepath=''):\n \n builder = cls()\n builder.loadXml(xdata, filepath=filepath)\n return builder"
] | [
"def _type_description(self):\n \"\"\"\"\"\"\n #This is a little tricker because the docstring is housed\n #inside of the module that contains the actual executable.\n #These TypeExecutables are just pointers.\n iexec = self._element.target\n if iexec is not None:\n ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Error implements the error interface. | [
"func (e *ErrorWithStacks) Error() string {\n\tmsg := e.Err.Error()\n\tfor _, s := range e.Stacks {\n\t\tmsg += \"\\n at \" + s\n\t}\n\treturn msg\n}"
] | [
"func (_ *NilFormatter) Format(_ string, _ LogLevel, _ int, _ ...interface{}) {\n\t// noop\n}"
] | codesearchnet | {
"query": "Represent the Github instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Computer Science:"
} |
Returns the HTML for a start tag | [
"function startTag(tag, attr) {\n let attrStr = \"\";\n if (attr) {\n attrStr = \" \" + Object.keys(attr).map(function(k) { \n return k + ' = \"' + attr[k] + '\"';\n }).join(\" \");\n }\n return \"<\" + tag + attrStr + \">\";\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 comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
{@inheritDoc}
Will poll the interface on a regular basis until at least one element is present. | [
"@Override\n public List<WebElement> findElements() {\n SlowLoadingElementList list = new SlowLoadingElementList(clock, timeOutInSeconds);\n try {\n return list.get().getElements();\n } catch (NoSuchElementError e) {\n return new ArrayList<>();\n }\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 description about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about File management:"
} |
Get the default phases at which restrictions should be applied, by looking for a @RestrictAtPhase on a matching
@param viewId
@return default phases for a view
@ViewPattern, falling back on global defaults if none are found | [
"public PhaseIdType[] getDefaultPhases(String viewId) {\n PhaseIdType[] defaultPhases = null;\n RestrictAtPhase restrictAtPhase = viewConfigStore.getAnnotationData(viewId, RestrictAtPhase.class);\n if (restrictAtPhase != null) {\n defaultPhases = restrictAtPhase.value();\n }\n... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Adds from-table to SQL statement.
@param string $from
@return void | [
"public function addFrom(string $from): void\n {\n $from = $this->quoteName($from);\n $this->statement .= ' FROM ' . $from . PHP_EOL;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
This method sets the Locale value for the repository based on input.
@param locale - object that represents a specific geographical, political, or cultural region | [
"public static void setLocale(Locale locale) {\n if (RepositoryUtils.locale == null) {\n RepositoryUtils.locale = locale;\n } else {\n if (RepositoryUtils.locale != locale) {\n RepositoryUtils.locale = locale;\n messages = null;\n inst... | [
"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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Language and programming:"
} |
// Install registers the API group and adds types to a scheme | [
"func Install(scheme *runtime.Scheme) {\n\tutilruntime.Must(sdnapiv1.Install(scheme))\n\tutilruntime.Must(scheme.SetVersionPriority(networkv1.GroupVersion))\n}"
] | [
"def ready(self):\n \"\"\"\"\"\"\n # Initialize the type extension composer.\n from . composer import composer\n composer.discover_extensions()\n\n is_migrating = sys.argv[1:2] == ['migrate']\n if is_migrating:\n # Do not register signals and ES indices when:\n ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Will render the slot with the given name, only if the slot is found.
@inheritdoc | [
"public static function renderStatic(array $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)\n {\n /** @var FieldViewHelperService $fieldService */\n $fieldService = Core::instantiate(FieldViewHelperService::class);\n\n if (false === $fieldService->fiel... | [
"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 sentence about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
Loads a tag info object from its $tagId.
@param mixed $tagId
@throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If the specified tag is not found
@return \Netgen\TagsBundle\SPI\Persistence\Tags\TagInfo | [
"public function loadTagInfo($tagId)\n {\n $row = $this->gateway->getBasicTagData($tagId);\n\n return $this->mapper->createTagInfoFromRow($row);\n }"
] | [
"protected function getLimitationByIdentifier($identifier)\n {\n switch ($identifier) {\n case APILimitation::CONTENTTYPE:\n return new \\eZ\\Publish\\API\\Repository\\Values\\User\\Limitation\\ContentTypeLimitation();\n\n case APILimitation::LANGUAGE:\n ... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Apply min-max scaling to a specific output, overriding the global output strategy if any
@param output the index of the input
@param rangeFrom lower bound of the target range
@param rangeTo upper bound of the target range
@return the normalizer | [
"public MultiNormalizerHybrid minMaxScaleOutput(int output, double rangeFrom, double rangeTo) {\n perOutputStrategies.put(output, new MinMaxStrategy(rangeFrom, rangeTo));\n return this;\n }"
] | [
"def set_prop(self, prop, value, ef=None):\n \n if ef:\n # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF.\n # value is restricted to the corresponding enrichment factor and should be a float\n self.ef[prop] = value\n ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Validate the target environment | [
"def validate(self):\n \n self.phase = PHASE.VALIDATE\n self.logger.info(\"Validating %s...\" % self.namespace)\n self.instantiate_features()\n context_dict = {}\n if self.target:\n for s in self.target.formula_sections():\n context_dict[\"%s:root_... | [
"@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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Leave this group
@param completionListener A listener to receive a notification on the success of the asynchronous operation | [
"public void leave(final Respoke.TaskCompletionListener completionListener) {\n if (isJoined()) {\n if ((null != groupID) && (groupID.length() > 0)) {\n String urlEndpoint = \"/v1/groups\";\n\n JSONArray groupList = new JSONArray();\n groupList.put(grou... | [
"function (message) {\n if ('string' !== typeof message) {\n callFunc(WebViewBridge.onError, \"message is type '\" + typeof message + \"', and it needs to be string\");\n return;\n }\n\n //we queue the messages to make sure that native can collects all of them in one shot.\n sendQu... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Optional migrations.
Upgrade tags table from Redminportal 0.1 to 0.2/0.3
Not included by default, read UPGRADE.md for instructions.
@return void | [
"public function up()\n {\n // Check if the 2 tables exist\n if (Schema::hasTable('tags') && Schema::hasTable('taggables')) {\n if (Schema::hasColumn('tags', 'tagable_id') && Schema::hasColumn('tags', 'tagable_type')) {\n $tags = DB::select('select * from tags');\n ... | [
"public function Upgrade182to183()\n {\n $this->_batch->addTask('Db_CreateNewTables');\n $this->_batch->addTask('Db_AddPatches', 61);\n\n // Use AddTask task to execute after patches\n $this->_batch->addTask('AddTask', 'Echo', $this->_('Make sure to read the changelog as it contains i... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Read GO IDs from a file. | [
"def _rdtxt_gos(self, ret, go_file):\n \"\"\"\"\"\"\n if not os.path.exists(go_file):\n raise RuntimeError(\"CAN NOT READ: {FILE}\\n\".format(FILE=go_file))\n goids = set()\n go2color = {}\n with open(go_file) as ifstrm:\n for line in ifstrm:\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:"
} |
// GetFactory returns just the Factory for a given Facade name and version.
// See also GetType for getting the type information instead of the creation factory. | [
"func (f *Registry) GetFactory(name string, version int) (Factory, error) {\n\trecord, err := f.lookup(name, version)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn record.factory, nil\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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Returns the total count of all characters in all params passed
@return integer | [
"public function charCount()\n {\n $count = 0;\n\n foreach ($this->getParameters() as $value)\n $count += strlen(strip_tags($value));\n\n return $count;\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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Randomly select n document from query result set. If no query specified,
then from entire collection.
**中文文档**
从collection中随机选择 ``n`` 个样本。 | [
"def random_sample(col, n=5, filters=None):\n \n pipeline = list()\n if filters is not None:\n pipeline.append({\"$match\": filters})\n pipeline.append({\"$sample\": {\"size\": n}})\n return list(col.aggregate(pipeline))"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Return the tuple of field names of key fields. | [
"def keys(self):\n \"\"\"\"\"\"\n keys = self._keys\n if keys is None:\n keys = tuple(self[i].name for i in self.key_indices)\n return keys"
] | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Callback handler for trying to move a file or directory.
@param string $from The URL to the current file
@param string $to The URL of the new file location
@return bool | [
"public function rename($from, $to)\n {\n $url = (array) parse_url($to) + [\n 'path' => '',\n 'host' => ''\n ];\n\n $destinationBucket = $url['host'];\n $destinationPath = substr($url['path'], 1);\n\n $this->dir_opendir($from, []);\n foreach ($this-... | [
"function mkcol($path) {\n $this->_path = $this->translate_uri($path);\n $this->header_unset();\n $this->create_basic_request('MKCOL');\n $this->send_request();\n $this->get_respond();\n $response = $this->process_respond();\n // validate the response ...\n //... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
alleged_utf8 must be null-terminated bytes. | [
"def validate_utf8(alleged_utf8, error = None) :\n \"\"\n error, my_error = _get_error(error)\n result = dbus.dbus_validate_utf8(alleged_utf8, error._dbobj) != 0\n my_error.raise_if_set()\n return \\\n result"
] | [
"def get_token(self, lineno, col_offset):\n \n # TODO: add test for multibyte unicode. We need to translate offsets from ast module (which\n # are in utf8) to offsets into the unicode text. tokenize module seems to use unicode offsets\n # but isn't explicit.\n return self.get_token_from_offset(self._... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
queueActionLocked appends to the delta list for the object. Caller must hold the lock. | [
"private void queueActionLocked(DeltaType actionType, Object obj) {\n String id = this.keyOf(obj);\n\n // If object is supposed to be deleted (last event is Deleted),\n // then we should ignore Sync events, because it would result in\n // recreation of this object.\n if (actionType == DeltaType.Sync ... | [
"def getLockByID(self, lockid):\n \n assert isinstance(lockid, (locks.MasterLock, locks.WorkerLock))\n if lockid not in self.locks:\n self.locks[lockid] = lockid.lockClass(lockid)\n # if the master.cfg file has changed maxCount= on the lock, the next\n # time a build is... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Test if left > right.
@param left
first value
@param right
second value
@return test result. | [
"public boolean greaterThan(Object left, Object right) {\n if ((left == right) || left == null || right == null) {\n return false;\n }\n else {\n return compare(left, right, \">\") > 0;\n }\n }"
] | [
"def diff_values(value_a, value_b, raw=False):\n \n\n if not raw:\n value_a = _process_value(value_a)\n value_b = _process_value(value_b)\n\n # No changes\n if value_a == value_b:\n return None\n\n diffs = []\n # N.B.: the choice for the tuple data structure is to enable in th... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get domain
@since 1.1
@param string $tldLength Length of Top Level Domain. (by default 1)
@return string Return domain. | [
"public function getDomain($tldLength = 1)\n {\n $segmentList = explode('.', $this->getHost());\n $domain = array_slice($segmentList, -1 * ($tldLength + 1));\n return implode('.', $domain);\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:"
} |
Rollback the active database transaction.
@return void | [
"public function rollBack($toLevel = null)\n {\n if ($this->transactions == 1)\n {\n $this->transactions = 0;\n\n $this->transaction->rollBack();\n }\n else\n {\n --$this->transactions;\n }\n\n $this->fireConnectionEvent('rollingBa... | [
"public void doAddNew() throws DBException\n {\n if (this.lockOnDBTrxType(null, DBConstants.ADD_TYPE, false)) // ADD_TYPE = Add new; Should I do the unlock in my code?\n this.unlockIfLocked(this.getRecord(), null); // Release any locks\n }"
] | codesearchnet | {
"query": "Represent the comment about Database management:",
"pos": "Represent the code about Database management:",
"neg": "Represent the code:"
} |
Whether all bins have the same width.
Parameters
----------
rtol, atol : numpy tolerance parameters | [
"def is_regular(self, rtol: float = 1.e-5, atol: float = 1.e-8) -> bool:\n \n return np.allclose(np.diff(self.bins[1] - self.bins[0]), 0.0, rtol=rtol, atol=atol)"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Build the email as a multipart message containing
a multipart alternative for text (plain, HTML) plus
all the attached files. | [
"def send_mail(subject, message_plain, message_html, email_from, email_to,\n custom_headers={}, attachments=()):\n \n if not message_plain and not message_html:\n raise ValueError(_(\"Either message_plain or message_html should be not None\"))\n\n if not message_plain:\n message_... | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// ReadCfg reads and unmarshals the specified json file into a Cfg struct. | [
"func ReadCfg(cfgPath string) (*Cfg, error) {\n\tb, err := ioutil.ReadFile(cfgPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar cfg Cfg\n\tif err := json.Unmarshal(b, &cfg); err != nil {\n\t\treturn nil, err\n\t}\n\tdefaultCfg(&cfg)\n\treturn &cfg, nil\n}"
] | [
"func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Reset the Quantum Abstract Machine to its initial state, which is particularly useful
when it has gotten into an unwanted state. This can happen, for example, if the QAM
is interrupted in the middle of a run. | [
"def reset(self):\n \n self._variables_shim = {}\n self._executable = None\n self._bitstrings = None\n\n self.status = 'connected'"
] | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Получает список highload-блоков
@param array $filter
@return array
@throws \Bitrix\Main\ArgumentException | [
"public function getHlblocks($filter = array()) {\n $dbres = HL\\HighloadBlockTable::getList(\n array(\n 'select' => array('*'),\n 'filter' => $filter,\n )\n );\n\n $result = [];\n while ($hlblock = $dbres->fetch()) {\n $hlbl... | [
"final protected function v($name = null) {return dfak($this, function() {\n\t\t$result = dfa($this->_data, 'value', []);\n\t\t/**\n\t\t * 2016-06-29\n\t\t * Что интересно, при смене области действия настроек с глобальной на другую (сайт или магазин)\n\t\t * поле «value» может почему-то содержать не массив,\n\t\t *... | codesearchnet | {
"query": "Represent the comment about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code about programming:"
} |
Get cache index info
@return array | [
"public function get_index()\n {\n if (!$this->indexes) {\n $this->indexes = array();\n if ($json = $this->get_cache('index')) {\n $this->indexes = json_decode($json, true);\n }\n }\n\n return $this->indexes;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Specifies a custom comparator function to order parameters.
@param parameterOrdering parameter ordering
@return this builder | [
"public Swagger2MarkupConfigBuilder withParameterOrdering(Comparator<Parameter> parameterOrdering) {\n Validate.notNull(parameterOrdering, \"%s must not be null\", \"parameterOrdering\");\n\n config.parameterOrderBy = OrderBy.CUSTOM;\n config.parameterOrdering = parameterOrdering;\n retu... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns the template object from the template registry for the file name
in $this->templateFileName.
@return \Tx_Oelib_Template the template object for the template file name
in $this->templateFileName | [
"protected function getTemplate()\n {\n if ($this->template === null) {\n $this->template = \\Tx_Oelib_TemplateRegistry::get(\n $this->templateFileName\n );\n }\n\n return $this->template;\n }"
] | [
"public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerUniversalTagAttributes();\n $this->registerTagAttribute('name', 'string', 'Specifies the name of an anchor');\n $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Computer Science:"
} |
Read the directory, making sure we close the file if the format
is bad. | [
"def _GetContents(self):\n \"\"\"\"\"\"\n try:\n self._RealGetContents()\n except BadZipfile:\n if not self._filePassed:\n self.fp.close()\n self.fp = None\n raise"
] | [
"def has_bom(self, filestream):\n \"\"\"\"\"\"\n\n content = filestream.read(4)\n if content == b'PK\\x03\\x04':\n # Zip file found.\n # Return `BINARY_ENCODE` as content is binary type,\n # but don't return None which means we don't know what we have.\n ... | codesearchnet | {
"query": "Represent the Github description about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code:"
} |
If the inode has the IF_HASH_INDEX bit set,
then the first directory block is to be interpreted as the root of an HTree index. | [
"def globEntriesByHashTree\n ents_by_name = {}\n offset = 0\n # Chomp fake '.' and '..' directories first\n 2.times do\n de = DirectoryEntry.new(@data[offset..-1], @sb.isNewDirEnt?)\n ents_by_name[de.name] ||= []\n ents_by_name[de.name] << de\n offset += 12\n end... | [
"public static long createFileId(long containerId) {\n long id = BlockId.createBlockId(containerId, BlockId.getMaxSequenceNumber());\n if (id == INVALID_FILE_ID) {\n // Right now, there's not much we can do if the file id we're returning is -1, since the file\n // id is completely determined by the ... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Returns attributes suitable for the API
@return array | [
"public function getAPIAttributes($params=array(), $relations = false)\r\n {\r\n $attributes = array();\r\n foreach ($this->attributes as $k=>$v)\r\n {\r\n \tif (in_array($k, $params))\r\n \t\tcontinue;\r\n\r\n $attributes[$k] = $v;\r\n }\r\n\r\n if ($r... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Parse from a token, regexp or string, and move forward if match | [
"function $(tok) {\n var match, length, c, endIndex;\n\n // Non-terminal\n if (tok instanceof Function) {\n return tok.call(parser.parsers);\n // Terminal\n // Either match a single character in the input,\n // or match a regexp in the current chunk (chunk[j]).\n... | [
"private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
This function starts the brokers interaction with the kafka stream | [
"def start(self):\n \n self.loop.run_until_complete(self._consumer.start())\n self.loop.run_until_complete(self._producer.start())\n self._consumer_task = self.loop.create_task(self._consume_event_callback())"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Create a {@link SimpleFeatureCollection FeatureCollection} from the current tin triangles
with information about the vertexes elevation.
@return the feature collection of the tin. | [
"public SimpleFeatureCollection toFeatureCollection() {\n checkTinGeometries();\n SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();\n b.setName(\"triangle\");\n b.setCRS(crs);\n\n DefaultFeatureCollection newCollection = new DefaultFeatureCollection();\n b.add(\"... | [
"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:"
} |
It is possible to define unicode characters in the config either as the
actual utf-8 character or using escape sequences the following all will
show the Greek delta character.
Δ \N{GREEK CAPITAL LETTER DELTA} \U00000394 \u0394 | [
"def unicode_escape_sequence_fix(self, value):\n \n\n def fix_fn(match):\n # we don't escape an escaped backslash\n if match.group(0) == r\"\\\\\":\n return r\"\\\\\"\n return match.group(0).encode(\"utf-8\").decode(\"unicode-escape\")\n\n return ... | [
"protected function cleanFileName($identifier) {\n\n // Convert or strip certain special characters, by convention.\n $filter = [\n ' ' => '-',\n '_' => '-',\n '/' => '-',\n '[' => '-',\n ']' => '',\n ];\n $identifier = strtr($identifier, $filter);\n\n // Valid characters in ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Initialize cache.
If you need to set configuration options, do so before calling this method. | [
"public function init()\n {\n if ($this->config()->isDryRunMode()) {\n $this->log('Dry run mode is on. Live content is displayed, no cached output.');\n }\n\n $this->log(__METHOD__ . ' uri:' . $_SERVER['REQUEST_URI']\n . '; script:' . $_SERVER['SCRIPT_NAME'] . '; query:... | [
"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 Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Commits and closes the current connection
@author: Nick Verbeck
@since: 5/12/2008 | [
"def Close(self):\n\t\t\n\t\tif self.connection is not None:\n\t\t\ttry:\n\t\t\t\tself.connection.commit()\n\t\t\t\tself.connection.close()\n\t\t\t\tself.connection = None\n\t\t\texcept Exception, e:\n\t\t\t\tpass"
] | [
"public static void main(String[] args) {\n\t\tSystem.out.println(\"Jaguar \" + MAJOR + \".\" + MINER + BUILD);\n\t\tSystem.out.println(\"Copyright (C) 2009-2011 Eiichiro Uchiumi. All Rights Reserved.\");\n\t}"
] | codesearchnet | {
"query": "Represent the Github sentence about Computer Networking:",
"pos": "Represent the Github code about Computer Networking:",
"neg": "Represent the Github code:"
} |
Parse binary header.
@data - bytearray, contains binary header of file opened in 'rb' mode
@return - parsed binary header | [
"def read_machine_header(data):\n \n if isinstance(data, (bytes, bytearray)):\n stream = io.BytesIO(data)\n elif isinstance(data, io.BufferedReader):\n stream = data\n else:\n raise ValueError(\"data should be either bytearray or file 'rb' mode.\")\n\n header = dict()\n header... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the description about File management:",
"pos": "Represent the code about File management:",
"neg": "Represent the code:"
} |
Set number of spaces per tab.
@param numberOfSpacesPerTab number of spaces, must be greater than zero
@return the context | [
"public JBBPTextWriter SetTabSpaces(final int numberOfSpacesPerTab) {\n if (numberOfSpacesPerTab <= 0) {\n throw new IllegalArgumentException(\"Tab must contains positive number of space chars [\" + numberOfSpacesPerTab + ']');\n }\n final int currentIdentSteps = this.indent / this.spacesInTab;\n t... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Override the base implementation so that when a class is instantiated
it is done so as a CDI managed bean. | [
"@Override\n protected <T> T instantiateClass(Class<T> clazz) throws Throwable {\n // Get the current BeanManager for this module. If one doesn't exist it is because \n // the module isn't CDI enabled and we fall back to the original behavior.\n\n ManagedObject<T> mo = null;\n if (rel... | [
"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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Shortcut for add_route with method PATCH | [
"def add_patch(self, path: str, handler: _WebHandler,\n **kwargs: Any) -> AbstractRoute:\n \n return self.add_route(hdrs.METH_PATCH, path, handler, **kwargs)"
] | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Run command with arguments. Wait for command to complete.
same as:
1. :meth:`start`
2. :meth:`wait`
3. :meth:`stop`
:rtype: self | [
"def call(self, timeout=None):\n \n self.start().wait(timeout=timeout)\n if self.is_alive():\n self.stop()\n return self"
] | [
"def terminal(self, confirmation=True):\n\n '''\n \n '''\n\n title = '%s.terminal' % self.__class__.__name__\n\n # construct ssh command\n if confirmation:\n override_cmd = ' '\n else:\n override_cmd = ' -o CheckHostIP=no '\n sys_command ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Converts a list of warnings and symbol shortcuts for warnings to just a
list of warnings. | [
"def convert_warning_list(list)\n list.map do |list|\n case list\n when :all then Warning.all_warnings\n when :whitespace\n [ExtraBlankLinesWarning, ExtraWhitespaceWarning,\n OperatorSpacing, MisalignedUnindentationWarning]\n else list\n end\n end.fl... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
TODO Always validate changes against Tomcat AbsCadiValve and Jaspi CadiSAM functions | [
"public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {\n\t\tHttpServletRequest hreq = (HttpServletRequest)request;\n\t\tHttpServletResponse hresp = (HttpServletResponse)response;\n\t\tString perm = aaf_type+hreq.getPathInfo()+'|'+hreq.getMet... | [
"public Descriptor replaceAllAcls(PSequence<ServiceAcl> acls) {\n return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Virtually call Get an item for each line in input. So, you can have a ticket, an user in the same query.
@param array $items
@param array $queryString
@return array | [
"public function getMultipleItems(array $items, array $queryString = []) {\n foreach ($items as $item) {\n if (!key_exists('itemtype', $item) || !key_exists('items_id', $item)) {\n throw new InsufficientArgumentsException(ErrorHandler::getMessage('ERROR_APILIB_ARGS_MANDATORY', \"'itemtype' a... | [
"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 Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Current Slf4j trace context.
@return Slf4j trace context | [
"@Requires(classes = {MDC.class, CurrentTraceContext.class})\n @Context\n CurrentTraceContext currentTraceContext() {\n return ThreadLocalCurrentTraceContext.newBuilder().addScopeDecorator(new Slf4jScopeDecorator()).build();\n }"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Setter for singular attribute values by name.
@param string $name The attribute name.
@param mixed $data The attribute data.
@return mixed | [
"public function setAttribute($name, $data)\n {\n // new fields are detected to *prevent the order of fields*\n // from changing during data processes.\n\n $attributes = array_keys($this->attributes);\n $cntAttribs = count($attributes);\n if (! in_array($name, $attributes)) {\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Deserializes Workspace data into entities.
@param array $data
@param array $options
@return Workspace | [
"public function deserialize(array $data, Workspace $workspace, array $options = [], FileBag $bag = null)\n {\n $data = $this->replaceResourceIds($data);\n\n $defaultRole = $data['registration']['defaultRole'];\n unset($data['registration']['defaultRole']);\n //we don't want new works... | [
"@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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Equivalent to openDatabase(path, factory, CREATE_IF_NECESSARY). | [
"public static SQLiteDatabase openOrCreateDatabase(String path, CursorFactory factory) {\n return openDatabase(path, factory, CREATE_IF_NECESSARY, null);\n }"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param string $parentId
@param string $language
@param string $siteId
@param int $order
@return NodeInterface | [
"public function initializeNode($parentId, $language, $siteId, $order = 0)\n {\n /** @var NodeInterface $node */\n $node = new $this->nodeClass();\n $node->setSiteId($siteId);\n $node->setLanguage($language);\n $node->setMaxAge(NodeInterface::MAX_AGE);\n $node->setParent... | [
"public function LinkingMode()\n {\n /** @var Page_Controller $controller */\n $controller = Controller::curr();\n $params = $controller->getURLParams();\n\n return $params['ID'] === $this->URLSegment ? 'current' : 'link';\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
Get ofitial international travles for a senator (obj, num, bool) -> arr | [
"function getViajesExtranjeros (senador, periodo, incluyeSenador) {\n let url = URL_VIAJES_INTERNACIONALES.replace(/:year:/, periodo)\n\n return scraperjs.StaticScraper.create()\n .get(url)\n .catch(ex => {\n console.log('Some srioues problem happened!\\n\\n\\n')\n return new Promise()\n })\n ... | [
"def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Checks if the visitor ip is in the excluded list
@return bool | [
"protected function isVisitorIpExcluded()\n {\n $excludedIps = $this->getAttributes('excluded_ips', 'global_excluded_ips');\n\n if (!empty($excludedIps)) {\n $ip = IP::fromBinaryIP($this->ip);\n if ($ip->isInRanges($excludedIps)) {\n Common::printDebug('Visitor ... | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
Helper function for generating output for one stack-trace entry.
@access private
@param array $entry
@return string The generated string | [
"function generateTraceEntry( $entry )\n {\n if ( isset( $entry['file'] ) )\n {\n $stackText = $entry['file'];\n }\n else\n {\n $stackText = \"???\";\n }\n $stackText .= \":\";\n if ( isset( $entry['line'] ) )\n {\n $... | [
"def append_line(self, new_line):\n \"\"\"\"\"\"\n # TODO: The user still has to write the raw line, this is error prone.\n self._write(('PGM', [Integer, String]), self.idx, new_line)"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Command returns the named command on App. Returns nil if the command does not exist | [
"func (a *App) Command(name string) *Command {\n\tfor _, c := range a.Commands {\n\t\tif c.HasName(name) {\n\t\t\treturn &c\n\t\t}\n\t}\n\n\treturn nil\n}"
] | [
"function Request(conn, cmd, args) {\n\n // current connection\n this.conn = conn;\n\n // command name\n this.cmd = cmd;\n\n // command arguments may be modified\n // during validation\n this.args = args;\n\n // raw command arguments, injected by the server\n this.raw = null;\n\n // server will inject thi... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.