query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
implements the visitor to actually iterate twice over this class, once for compareTo and once for compare.
@param classContext
the currently parsed class | [
"@Override\n public void visitClassContext(ClassContext classContext) {\n try {\n JavaClass cls = classContext.getJavaClass();\n for (CompareSpec entry : compareClasses) {\n if (cls.implementationOf(entry.getCompareClass())) {\n methodInfo = entry.ge... | [
"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:"
} |
*************************************************************************** *************************************************************************** | [
"function() {\n this.filterParser = new FilterParser();\n this.urlTokenizer = µb.urlTokenizer;\n this.noTokenHash = this.urlTokenizer.noTokenHash;\n this.dotTokenHash = this.urlTokenizer.dotTokenHash;\n this.anyTokenHash = this.urlTokenizer.anyTokenHash;\n this.anyHTTPSTokenHash = this.urlTokenize... | [
"protected function prepareResponseHeaders()\n {\n $this->getResponse(true)->headers->set('Content-Type', 'text/html');\n $this->getResponse()->setCharset('utf-8');\n\n\n // FIX FOR IE SESSION COOKIE\n // CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\n //... | codesearchnet | {
"query": "Represent the sentence about N/A:",
"pos": "Represent the code about N/A:",
"neg": "Represent the code about PHP programming:"
} |
Creates a social profile from a HybridAuth adapter profile
@param \Hybrid_User_Profile $adapter_profile
@param User $user
@return Profile | [
"protected function createProfileFromAdapterProfile($adapter_profile, $user)\n\t{\n\t\t$ProfileModel = $this->config['db']['profilemodel'];\n\t\t$attributes['provider'] = $this->provider;\n\n\t\t// @todo use config value for foreign key name\n\t\t$attributes['user_id'] = $user->id;\n\n\t\t$profile = new $ProfileMod... | [
"public static function GetTabsStatus(\\Puzzlout\\Framework\\Core\\User $user, $sessionKey) {\n return $user->getAttribute($sessionKey);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Display the shadow object, given the position of the menu itself | [
"function (x, y, e) {\n var cmenu = this;\n if (cmenu.shadow) {\n cmenu.shadowObj.css({\n width: (cmenu.menu.width() + cmenu.shadowWidthAdjust) + \"px\",\n height: (cmenu.menu.height() + cmenu.shadowHeightAdjust) + \"px\",\n ... | [
"function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Factory method to fetch API objects.
@param string $name Name of the API object to retrieve
@return ApiConnector
@throws Exception\UnknownApiConnectorException | [
"public function get(string $name): ApiConnector\n {\n return $this->apiFactory->createApiConnector($name, $this->options);\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Splits a String into substrings along the provided char delimiter and returns
the result as a List of Substrings.<p>
@param source the String to split
@param delimiter the delimiter to split at
@return the List of splitted Substrings | [
"public static List<String> splitAsList(String source, char delimiter) {\n\n return splitAsList(source, delimiter, false);\n }"
] | [
"def structureChunk(keywords, resultDict, lines):\n \n chunks = pt.chunk(keywords, lines)\n\n # Parse chunks associated with each key\n for key, chunkList in iteritems(chunks):\n # Parse each chunk in the chunk list\n for chunk in chunkList:\n # Strip and split the line (only on... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get the key for this item in the cache
@param type $perm
@return string | [
"public function permCacheKey(DataObject $node)\n {\n if ($node && $node->ID) {\n return self::ITEM_PREFIX . $this->idStr($node);\n }\n }"
] | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Decode OffsetFetchResponse to OffsetFetchResponsePayloads
Arguments:
response: OffsetFetchResponse | [
"def decode_offset_fetch_response(cls, response):\n \n return [\n kafka.structs.OffsetFetchResponsePayload(\n topic, partition, offset, metadata, error\n )\n for topic, partitions in response.topics\n for partition, offset, metadata, error in ... | [
"def DeserializeExclusiveData(self, reader):\n \n\n self.Type = TransactionType.IssueTransaction\n\n if self.Version > 1:\n raise Exception('Invalid TX Type')"
] | codesearchnet | {
"query": "Represent the Github text about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code:"
} |
On the first call to this method, close the log file. Set the flag so no
more logging calls will be accepted. | [
"@Override\n public synchronized void shutdown() {\n try {\n if (open) {\n open = false;\n writer.close();\n }\n } catch (IOException e) {\n logger.error(\"Error shutting down journal log\", e);\n }\n }"
] | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Estimate how many bytes this transaction will be by countng inputs
and outputs.
Formula taken from: http://bitcoin.stackexchange.com/a/3011/18150 | [
"def estimate_size(self):\n \n # if there are no outs use 1 (because the change will be an out)\n outs = len(self.outs) or 1\n return outs * 34 + 148 * len(self.ins) + 10"
] | [
"function add(fn) {\n if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {\n // this is run inside of a webworker\n } else {\n /**\n * for normal browser-windows, we use the beforeunload-event\n */\n window.addEventListener('beforeunload', ()... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get the values to index from an object | [
"def get_values_to_index_from(obj)\n\n # if it's an array, we collect the values for its elements recursive\n if obj.is_a? Array\n return obj.map { |element| get_values_to_index_from element }.flatten.compact\n end\n\n # if the object responds to attributes and attributes is a hash,\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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Add debian/control Conflicts field.
@param name
@param version
@param dependency
@return | [
"@Override\r\n public DEBBuilder addConflict(String name, String version, Condition... dependency)\r\n {\r\n control.addConflict(release, version, dependency);\r\n return this;\r\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// makeWalkFunc creates a function which verifies that the route passed
// to it both exists in the router under test and has a handler attached. | [
"func makeWalkFunc(router *mux.Router) mux.WalkFunc {\n\treturn mux.WalkFunc(func(r *mux.Route, _ *mux.Router, _ []*mux.Route) error {\n\t\t// Does a route with this name exist in router?\n\t\troute := router.Get(r.GetName())\n\t\tif route == nil {\n\t\t\treturn fmt.Errorf(\"no route by name %q in router\", r.GetNa... | [
"function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Processes the options set by the command-line arguments,
and runs the CSS compiler appropriately. | [
"def process_result\n require 'sass'\n\n if @options[:recursive]\n process_directory\n return\n end\n\n super\n input = @options[:input]\n if File.directory?(input)\n raise \"Error: '#{input.path}' is a directory (did you mean to use --recursive?)\"\n end\n ... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Error returns a summarized string version of ReadyError. More details about
// the failed instance can be accessed through the struct. | [
"func (e ReadyError) Error() string {\n\treturn fmt.Sprintf(\n\t\t\"failed waiting for instance (%s) to be ready, reason was: %s\",\n\t\te.InstanceID,\n\t\te.StateReason,\n\t)\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 text about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
---------------------------------------------------------------- ICE action handers ---------------------------------------------------------------- | [
"function (opts, candidate) {\n this._log('info', 'Discovered new ICE candidate', candidate.jingle);\n this.send('transport-info', candidate.jingle);\n if (opts.signalEndOfCandidates) {\n this.lastCandidate = candidate;\n }\n }"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Unset unsets the bit at index i. If all bits for a given pointer have are
// unset, the pointer is removed from the map, and future calls to Get will
// return false for all bits from this pointer. | [
"func (s Sparse) Unset(i int) {\n\tptrKey := int(uint(i) >> ptrShift)\n\tptr, ok := s[ptrKey]\n\tif !ok {\n\t\treturn\n\t}\n\tptr &^= 1 << (uint(i) & ptrModMask)\n\tif ptr == 0 {\n\t\tdelete(s, ptrKey)\n\t} else {\n\t\ts[ptrKey] = ptr\n\t}\n}"
] | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
creates a random String in given length
@param length length of the string to create
@return | [
"public static String randomString(int length) {\n\tStringBuilder sb = new StringBuilder();\n\tfor (int i = 0; i < length; i++) {\n\t sb.append(chars[AbstractCaptcha.rnd(0, chars.length - 1)]);\n\t}\n\treturn sb.toString();\n }"
] | [
"public static String getSummary(String document, int max_length, String sentence_separator)\n {\n // Parameter size in this method refers to the string length of the summary required;\n // The actual length of the summary generated may be short than the required length, but never longer;\n ... | codesearchnet | {
"query": "Represent the Github comment about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about programming:"
} |
Get the param __VIEWSTATE
@param string $url
@param bool $force
@param string $selector
@return string
@throws HttpException | [
"protected function getViewsState($url = '', $force = false, $selector = '__VIEWSTATE')\n {\n $url = $url ?: Config::get('url.main_page');\n $cacheKey = 'view_state-' . $this->getUserName() . '-' . md5($url);\n if ($force || !$viewState = $this->getCache()->fetch($cacheKey)) {\n $... | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the sentence about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about programming:"
} |
in seconds, how long between two a relative points (nanoTime) | [
"@Trivial\n public static double relativeSeconds(long relativePointA, long relativePointB) {\n long diff = relativePointB - relativePointA;\n double seconds = toSeconds(diff);\n return seconds;\n }"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns true if the Cache-Control directive is defined.
@param string $key The Cache-Control directive
@return bool true if the directive exists, false otherwise | [
"public function hasCacheControlDirective($key)\n {\n return isset($this->computedCacheControl[$key]) || \\array_key_exists($key, $this->computedCacheControl);\n }"
] | [
"function (options) {\n _.isString(options) && (options = { mode: 'raw', raw: options });\n if (!options.mode) { return; } // need a valid mode @todo raise error?\n\n var mode = RequestBody.MODES[options.mode.toString().toLowerCase()] || RequestBody.MODES.raw,\n urlencoded = options.... | codesearchnet | {
"query": "Represent the summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about PHP:"
} |
Create a single Bootstrap radio input.
@param string $name
@param string $label
@param string $value
@param bool $checked
@param bool $inline
@param array $options
@return string | [
"public function radioElement($name, $label = null, $value = null, $checked = null, $inline = false, array $options = [])\n {\n $label = $label === false ? null : $this->getLabelTitle($label, $name);\n\n $value = is_null($value) ? $label : $value;\n\n $labelOptions = $inline ? ['class' => 'r... | [
"public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerTagAttribute('disabled', 'boolean', 'Specifies that the input element should be disabled when the page loads', false, false);\n $this->registerArgument('errorClass', 'string', 'CSS class to set if th... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Executes parent method parent::render(), creates oxvoucherserie object,
passes data to Smarty engine and returns name of template file
"voucherserie_list.tpl".
@return string | [
"public function render()\n {\n parent::render();\n\n $soxId = $this->_aViewData[\"oxid\"] = $this->getEditObjectId();\n if (isset($soxId) && $soxId != \"-1\") {\n // load object\n $oVoucherSerie = oxNew(\\OxidEsales\\Eshop\\Application\\Model\\VoucherSerie::class);\n ... | [
"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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Overloading render() function to inject the layout. | [
"public function render($template, $data = array()) {\n\t\tif(!is_null($this->layout) && $this->enabled === TRUE) { // Render the layout!!\n\t\t\t$this->setLayoutData('content', parent::render($template, array_merge($this->layoutData, (array)$data)));\n\t\t\t$this->setLayoutData('js', $this->jsAssets->render());\n\... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Find one document
@param mixed $criteria
@return array | [
"public function findOne($criteria = null, $projection = null) {\n\n $items = $this->find($criteria, $projection)->limit(1)->toArray();\n\n return isset($items[0]) ? $items[0]:null;\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Sets the commerce price list remote service.
@param commercePriceListService the commerce price list remote service | [
"public void setCommercePriceListService(\n\t\tcom.liferay.commerce.price.list.service.CommercePriceListService commercePriceListService) {\n\t\tthis.commercePriceListService = commercePriceListService;\n\t}"
] | [
"@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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
remove duplicate Entries and Count
@param array $arrDev list of HWDevices
@see HWDevice
@return array | [
"public static function removeDupsAndCount($arrDev)\n {\n $result = array();\n foreach ($arrDev as $dev) {\n if (count($result) === 0) {\n array_push($result, $dev);\n } else {\n $found = false;\n foreach ($result as $tmp) {\n ... | [
"function resolve(){\n\t\tLRState::clear_index();\n\t\tLRStation::clear_index();\n\t\t// create Root Set\n\t\t// we SHOULD have a single etransition to an intial state\n\t\treturn LRStateSet::init( $this->etransitions[0], $this->Grammar );\n\t}"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Computer Science:"
} |
移动用户到指定分组
@param string $openid 用户ID,to_groupid 指定分组ID
@return bool. | [
"public function moveUser($openid, $to_groupid)\n {\n if (!is_numeric($to_groupid) || !is_string($openid)) {\n $this->setError('参数错误,用户ID格式不正确或组ID不是数字');\n\n return false;\n }\n\n $queryStr = ['openid' => $openid, 'to_groupid' => $to_groupid];\n\n $res = $this->_... | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Execute computation of blobs on input eopatch
:param eopatch: Input eopatch
:type eopatch: eolearn.core.EOPatch
:return: EOPatch instance with new key holding the blob image.
:rtype: eolearn.core.EOPatch | [
"def execute(self, eopatch):\n \n for feature_type, feature_name, new_feature_name in self.feature:\n eopatch[feature_type][new_feature_name] = self._compute_blob(\n eopatch[feature_type][feature_name].astype(np.float64)).astype(np.float32)\n\n return eopatch"
] | [
"def run_metadata_impl(self, run, tag):\n \"\"\"\"\"\"\n try:\n run_metadata = self._multiplexer.RunMetadata(run, tag)\n except ValueError:\n # TODO(stephanwlee): Should include whether FE is fetching for v1 or v2 RunMetadata\n # so we can remove this try/except.\n tensor_events = self.... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Return the channel mode of the mpeg in string form.
Ex: Joint Stereo (STEREO)
@return the channel mode of the mpeg | [
"public String getChannelMode()\n\t{\n\t\tString str = null;\n\n\t\tif ((channelMode >= 0) && (channelMode < channelLabels.length))\n\t\t{\n\t\t\tstr = channelLabels[channelMode];\n\t\t}\n\n\t\treturn str;\n\t}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Wraps a transaction with a SOAP envelope
@param DOMDocument $xml The current DOMDocument object
@param DOMElement $transaction The current transaction to wrap
@return DOMElement | [
"protected function buildEnvelope(DOMDocument $xml, DOMElement $transaction)\n {\n $soapEnvelope = $xml->createElement('soapenv:Envelope');\n $soapEnvelope->setAttribute(\n 'xmlns:soapenv',\n 'http://schemas.xmlsoap.org/soap/envelope/'\n );\n $soapEnvelope->setAt... | [
"protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n ... | codesearchnet | {
"query": "Represent the instruction about Transaction Management:",
"pos": "Represent the code about Transaction Management:",
"neg": "Represent the code about programming:"
} |
/*
deep assign
@param {Object} oldData oldData
@param {Object} newData newData | [
"function assign (oldData, newData) {\n Object.keys(newData).forEach(k => {\n if (isObject(newData[k]) && oldData[k] && isObject(oldData[k])) {\n assign(oldData[k], newData[k])\n let obj = JSON.parse(JSON.stringify({\n [k]: oldData[k]\n }))\n Object.assign(oldData, obj)\n } else {\... | [
"function initCreate (args) {\n // method name is moduleNameCreate\n var methodName = `${this.name}Create`\n // method signature is moduleName.methodname\n var methodSignature = `${this.moduleName}.${methodName}`\n // capture model to pass to function\n var model = this\n // add create method t... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Get list of cluster admins. | [
"def get_list_cluster_admins(self):\n \"\"\"\"\"\"\n response = self.request(\n url=\"cluster_admins\",\n method='GET',\n expected_response_code=200\n )\n\n return response.json()"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github description about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code about Technology:"
} |
// Goroutine that runs the feed | [
"func (feed *UprFeed) run() {\n\tretryInterval := initialRetryInterval\n\tbucketOK := true\n\tfor {\n\t\t// Connect to the UPR feed of each server node:\n\t\tif bucketOK {\n\t\t\t// Run until one of the sub-feeds fails:\n\t\t\tselect {\n\t\t\tcase <-feed.killSwitch:\n\t\t\tcase <-feed.quit:\n\t\t\t\treturn\n\t\t\t}... | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Is the given address a p2wsh address? | [
"def btc_is_p2wsh_address( address ):\n \n wver, whash = segwit_addr_decode(address)\n if whash is None:\n return False\n \n if len(whash) != 32:\n return False\n\n return True"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the PSR log level based on the common log level.
@param string $level
@return string The PSR log level.
@throws Exception When invalid level was presented. | [
"public static function getPsrLevelFromCommon($level)\n {\n if (empty(self::$reverseMap[$level])) {\n throw new Exception('Invalid error level in PSR to Common level conversion: ' . $level);\n }\n\n return self::$reverseMap[$level];\n }"
] | [
"public function initializeArguments()\n {\n $this->registerArgument('value', 'string', 'The input value. If not given, the evaluated child nodes will be used', false, null);\n $this->registerArgument('mode', 'string', 'The case to apply, must be one of this\\' CASE_* constants. Defaults to upperca... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Spins around an element until it exists
@throws ExpectationException
@param string $element
@param string $selectortype
@return void | [
"protected function ensure_element_exists($element, $selectortype) {\n\n // Getting the behat selector & locator.\n list($selector, $locator) = $this->transform_selector($selectortype, $element);\n\n // Exception if it timesout and the element is still there.\n $msg = 'The \"' . $element... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
/*
Remove a container. | [
"function(cid, opts) {\n\n // Some option handling.\n opts = opts || {};\n opts.v = _.get(opts, 'v', true);\n opts.force = _.get(opts, 'force', false);\n\n // Find a container or throw an error.\n return findContainerThrows(cid)\n\n // Do stuff with the container\n // @todo: this is kind of ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github description about Container management:",
"pos": "Represent the Github code about Container management:",
"neg": "Represent the Github code:"
} |
Post all updates in the parent transaction to the database. | [
"private void commitTransaction() {\r\n Tenant tenant = Tenant.getTenant(m_tableDef);\r\n DBTransaction dbTran = DBService.instance(tenant).startTransaction();\r\n m_parentTran.applyUpdates(dbTran);\r\n DBService.instance(tenant).commit(dbTran);\r\n m_parentTran.clear();\r\n }"... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
判断指定路径是否是需要忽略解码的路径
使用配置文件router中的_ignore配置数组
@param string $path URI 去除了 协议,端口,站点,以首个/
@return boolean | [
"static public function ignore(string $path): bool\n {\n // 取配置\n $all = configDefault(false,'router', '_ignore');\n\n // 如果没有配置,或为空\n if (!$all) {\n return false;\n }\n\n // 逐个配置查看\n foreach ($all as $case) {\n // 是否正则匹配\n if (pre... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// ListRequest builds the ListNetworks request | [
"func (network Network) ListRequest() (ListCommand, error) {\n\t//TODO add tags support\n\treq := &ListNetworks{\n\t\tID: network.ID,\n\t\tKeyword: network.Name, // this is a hack as listNetworks doesn't support to search by name.\n\t\tPhysicalNetworkID: network.PhysicalNetworkID,\n\t\tTraf... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Turn permissions into text. | [
"public static List<String> transformText(Context context, String... permissions) {\n return transformText(context, Arrays.asList(permissions));\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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public void setVSChar(Integer newVSChar) {\n\t\tInteger oldVSChar = vsChar;\n\t\tvsChar = newVSChar;\n\t\tif (eNotificationRequired())\n\t\t\teNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.CPC__VS_CHAR, oldVSChar, vsChar));\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the instruction about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Is called when a write timeout was detected | [
"protected void writeTimedOut(ChannelHandlerContext ctx) throws Exception {\n if (!closed) {\n ctx.fireExceptionCaught(WriteTimeoutException.INSTANCE);\n ctx.close();\n closed = true;\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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Initialize class fields. | [
"public void init(Record record, String strName, int iDataLength, String strDesc, Object strDefault)\n {\n m_recVendor = null;\n m_recProfile = null;\n VENDOR_CONTACT_TYPE_ID = \"\";\n PROFILE_CONTACT_TYPE_ID = \"\";\n super.init(record, strName, iDataLength, strDesc, strDefaul... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Get all Packages.
@return array | [
"protected function getPackages($type)\n {\n $packages = $this->packages->all();\n\n if (! is_null($type)) {\n $packages = $packages->where('type', $type);\n }\n\n $results = array();\n\n foreach ($packages->sortBy('basename') as $package) {\n $results[] =... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Creates an Pdftohtml driver.
@param LoggerInterface $logger
@param array|Configuration $configuration
@return Pdftohtml | [
"public static function create(LoggerInterface $logger = null, $configuration = array())\n {\n if (!$configuration instanceof ConfigurationInterface) {\n $configuration = new Configuration($configuration);\n }\n\n $binaries = $configuration->get('pdftohtml.binaries', 'pdftohtml');... | [
"protected function setGeneratorImages()\n {\n $this->logger->debug('Base:setGeneratorImages');\n $this->setParam('generator', 'images');\n $this->setParam('gimlimit', $this->getLimit());\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:"
} |
Add a locale to the dom body element as a <template> element.
@param [String] locale, locale id of strings.
@param [Hash] strings, a hash holding localized strings.
@return [Boolean] returns true if template added succesfully | [
"def add_locale(locale, strings)\n if locale.to_s != '' && strings.is_a?(Hash) && strings.length > 0\n _add_locale(locale, strings)\n true\n else\n false\n end\n end"
] | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns the creation date/time as a Java Date object.
@return | [
"public Date getCreationDateTime() {\n\n\t\tlong time = 0;\n\n\t\tif (createtime != null) {\n\t\t\ttime = createtime.longValue() * 1000;\n\t\t}\n\n\t\tif (createtime_nano != null) {\n\t\t\ttime += (createtime_nano.longValue() / 1000000);\n\t\t}\n\t\treturn new Date(time);\n\t}"
] | [
"public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Set expire timestamp on key, timestamp in milliseconds.
:raises TypeError: if timeout is not int | [
"def pexpireat(self, key, timestamp):\n \n if not isinstance(timestamp, int):\n raise TypeError(\"timestamp argument must be int, not {!r}\"\n .format(timestamp))\n fut = self.execute(b'PEXPIREAT', key, timestamp)\n return wait_convert(fut, bool)"
] | [
"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:"
} |
Initialize inputs patch and report success
=== Parameters
node(ChefNode):: Chef node used to converge, can be nil (patch is empty in this case)
=== Return
true:: Always return true | [
"def report_success(node)\n ChefState.merge_attributes(node.normal_attrs) if node\n remove_right_script_params_from_chef_state\n patch = ::RightSupport::Data::HashTools.deep_create_patch(@inputs, ChefState.attributes)\n # We don't want to send back new attributes (ohai etc.)\n patch[:right_... | [
"def end(resource)\n @logger.operation(:metadata_parsing) do\n if @read_blk\n metadata = ::JSON.parse(@read_blk.call)\n resource.metadata = metadata\n\n # check for undefined cookbook name.\n #\n # note that many specs in right_scraper use badly formed metada... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Takes a generic build and returns a type-specific build model.
@param Build $build The build from which to get a more specific build type.
@return Build | [
"public static function getBuild(Build $build)\n {\n $project = $build->getProject();\n\n if (!empty($project)) {\n switch ($project->getType()) {\n case 'remote':\n $type = 'RemoteGitBuild';\n break;\n case 'local':\n ... | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Gets the input stream for a given file (for tar archives)
@param f
File
@return InputStream
@throws FileNotFoundException
When the file's not found | [
"private static InputStream getInputStream(File f) throws FileNotFoundException\n\t{\n\t\tInputStream is = new FileInputStream(f);\n\t\ttry\n\t\t{\n\t\t\treturn new GZIPInputStream(is);\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\treturn new FileInputStream(f);\n\t\t}\n\t}"
] | [
"public static Dir fromURL(final URL url, final List<UrlType> urlTypes) {\n for (UrlType type : urlTypes) {\n try {\n if (type.matches(url)) {\n Dir dir = type.createDir(url);\n if (dir != null) return dir;\n }\n } catc... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Development logger. | [
"function dev() {\n return function logger(ctx, next) {\n // request\n const start = new Date();\n /* eslint no-console: 0 */\n console.log(` ${chalk.gray('<--')} ${chalk.bold(ctx.method)} ${chalk.gray(ctx.originalUrl)}`);\n\n\n // calculate the length of a streaming response\n // by interceptin... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
For a given swipe fraction (percentage of the element's swipe target's height), return the distance of the vertical translation we should apply to the swipe target. | [
"function getTranslationForSwipeFraction(element) {\n\n const {\n swipeFraction,\n scrollPullDistance,\n scrollPullMaxReached\n } = element.state;\n\n // When damping, we halve the swipe fraction so the user has to drag twice as\n // far to get the usual damping. This produces the feel of a tighter, le... | [
"@Override\n public void onGestureBegin(TransformGestureDetector detector) {\n FLog.v(TAG, \"onGestureBegin\");\n mPreviousTransform.set(mActiveTransform);\n onTransformBegin();\n // We only received a touch down event so far, and so we don't know yet in which direction a\n // future move event will... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Converts the model's data to an array before it's saved to a YAML file.
@return array | [
"protected function modelToYamlArray()\n {\n $fileMenus = [];\n\n foreach ($this->menus as $mainMenuItem) {\n $mainMenuItem = $this->trimMenuProperties($mainMenuItem);\n\n if (!isset($mainMenuItem['code'])) {\n throw new ApplicationException('Cannot save menus -... | [
"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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
//Warnf calls Warnf function of underlying logger | [
"func (l *Logger) Warnf(format string, args ...interface{}) {\n\tl.logger().Warnf(format, args...)\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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
breakLine (lineOfText: string, maxLength: number): string[] | [
"function breakLine (lineOfText, maxLength) {\n const lines = []\n let currText = lineOfText\n\n while (currText) {\n if (currText.length <= maxLength) {\n lines.push(currText)\n break\n } else {\n let line = ''\n const words = currText.split(/\\b/g)\n while (words.length && line.l... | [
"function getMarkerLines(\n loc: NodeLocation,\n source: Array<string>,\n opts: Object,\n): { start: number, end: number, markerLines: Object }"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Start some new particles from the emitters. We roll the dice
starts_at_once times, seeing if we can start each particle based
on starts_prob. If we start, the particle gets a color form
the palette and a velocity from the vel list. | [
"def start_new_particles(self):\n \n for e_pos, e_dir, e_vel, e_range, e_color, e_pal in self.emitters:\n for roll in range(self.starts_at_once):\n if random.random() < self.starts_prob: # Start one?\n p_vel = self.vel[random.choice(len(self.vel))]\n ... | [
"def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
------------------------------------------------------ binding methods | [
"public static <T extends Event> HandlerRegistration bind(EventTarget target, EventType<T, ?> type,\n EventCallbackFn<T> listener) {\n return bind(target, type.name, e -> listener.onEvent(Js.cast(e)));\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 Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Resolves the ID of the language in which the response must be drafted. | [
"private function resolveLanId(): void\n {\n $codes = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? null);\n\n // If HTTP_ACCEPT_LANGUAGE is not set or empty return the default language.\n if (empty($codes)) $this->lanIdDefault;\n\n $map = Abc::$babel->getInternalLanguageMap();\n\n // Try to find... | [
"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 sentence about writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code about Language and programming:"
} |
Parses the file at filename and returns a PythonFile.
If root is specified, it will open the file with root prepended to the path. The idea is to
allow for errors to contain a friendlier file path than the full absolute path. | [
"def parse(cls, filename, root=None):\n \n if root is not None:\n if os.path.isabs(filename):\n raise ValueError(\"filename must be a relative path if root is specified\")\n full_filename = os.path.join(root, filename)\n else:\n full_filename = filename\n\n with io.open(full_filena... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Loop over all list item children calling render on each
@return [String] compiled string of all the rendered list item children | [
"def render_children\n children = ''\n\n list_item.children.each do |child|\n children += self.class.render(child, opts)\n end\n\n children\n end"
] | [
"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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Get the definition of a model and format the result in a way that's similar to a LoopBack model definition file | [
"function getModelInfo (modelName) {\n debug('getModelInfo: ' + modelName)\n\n // Get the model\n const model = Meta.app.models[ modelName ]\n\n // Create the base return object\n const result = {\n id: model.definition.name,\n name: model.definition.name,\n properties: formatPropertie... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetKeywords defines the keywords of the document. keywordStr is a
// space-delimited string, for example "invoice August". isUTF8 indicates if
// the string is encoded | [
"func (f *Fpdf) SetKeywords(keywordsStr string, isUTF8 bool) {\n\tif isUTF8 {\n\t\tkeywordsStr = utf8toutf16(keywordsStr)\n\t}\n\tf.keywords = keywordsStr\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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SendRequest sends a request to the server | [
"func (c *Client) SendRequest(route string, data []byte) (uint, error) {\n\treturn c.sendMsg(message.Request, route, data)\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Recursive copier for the above copy method. It calls recursively for subdirectories to ensure a full copy
@param input the directory to copy from
@param output the directory to copy to
@throws IOException if the copy could not complete. | [
"private void copyLibraryRecursive(Path input, Path output) throws IOException {\n for (Path dirItem : Files.list(input).collect(Collectors.toList())) {\n Path outputName = output.resolve(dirItem.getFileName());\n if (Files.isDirectory(dirItem)) {\n if(!Files.exists(outpu... | [
"def is_multifile_object_without_children(self, location: str) -> bool:\n \n # (1) Find the base directory and base name\n if isdir(location): # special case: parent location is the root folder where all the files are.\n return len(self.find_multifile_object_children(location)) == 0... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Remove HTML tag in input text and format the texts
accordingly. | [
"def dehtml(text):\n ''' '''\n try:\n parser = _DeHTMLParser()\n parser.feed(text)\n parser.close()\n return parser.text()\n except Exception as e:\n env.logger.warning(f'Failed to dehtml text: {e}')\n return text"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
demux an object into server params and pass them into a function (obj, fn) -> null | [
"function demuxSsa (params, cb) {\n assert.equal(typeof params, 'object')\n assert.equal(typeof params._ssa, 'object')\n assert.equal(typeof cb, 'function')\n const req = params._ssa.req\n const res = params._ssa.res\n const nw = xtend(params)\n delete nw._ssa\n cb(req, res, nw)\n}"
] | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Extend what Pipeline can serialize.
Args:
object_type: type of the object.
encoder: a function that takes in an object and returns
a dict of json primitives.
decoder: inverse function of encoder. | [
"def _register_json_primitive(object_type, encoder, decoder):\n \n global _TYPE_TO_ENCODER\n global _TYPE_NAME_TO_DECODER\n if object_type not in _TYPE_TO_ENCODER:\n _TYPE_TO_ENCODER[object_type] = encoder\n _TYPE_NAME_TO_DECODER[object_type.__name__] = decoder"
] | [
"def coerce_one(schema=str):\n \n def validate(val):\n \"\"\"Unpack a single item from the inputs sequence and run validation.\n\n NOTE(larsbutler): This code is highly opinionated for bottle, since\n bottle query params are wrapped in a list, even if there is just a\n single value... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Auto reports any metrics that are missing a value from the current iteration
@param autoMetrics The metrics that need to me auto reported as zero | [
"public void autoReportZero(final Set<MetricIdentity> autoMetrics) {\n\t\tPreconditions.checkNotNull(autoMetrics);\n\t\t\n\t\tfor (MetricIdentity identity : autoMetrics) {\n\t\t\tif (!aggregateExistsForCurrentMinute(identity)) {\n\t\t\t\tMetricAggregate aggregate = getAggregate(identity);\n\t\t\t\t\n\t\t\t\taggrega... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Retourne une instance
@param string $p_file
@retuen \Static | [
"public static function getInstance($p_file)\n {\n if (self::$instance === null) {\n self::$instance = new static($p_file);\n }\n \n return self::$instance;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Ask a question where some auto-completion help is provided.
@param string $question
@param array $autoCompletion
@param mixed|null $default
@return mixed | [
"public function anticipate($question, array $autoCompletion, $default = null)\n {\n $helper = $this->getHelper('question');\n\n $question = new Question($question, $default);\n\n $question->setAutocompleterValues($autoCompletion);\n\n return $helper->ask($this->input, $this->getOutpu... | [
"function openTable()\n {\n $this->examples = [];\n $this->markdown = ''; // Clear table\n $this->declareAbstraction = true;\n $this->add('| Visibility | Function |');\n $this->add('|:-----------|:---------|');\n }"
] | codesearchnet | {
"query": "Represent the comment about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
Can be called early in the request processing cycle to cache a single multipart handler for the request. | [
"static void preHandleMultipartRequest(HttpServletRequest request)\n throws ServletException\n {\n MultipartRequestHandler multipartHandler = getCachedMultipartHandler(request);\n \n if (multipartHandler == null)\n {\n multipartHandler = getMultipartHandler(request);... | [
"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 Web development:",
"pos": "Represent the code about Web development:",
"neg": "Represent the code about Software development:"
} |
Return the value for option or default if defined. | [
"def getenv(option, default=undefined, cast=undefined):\n \n\n # We can't avoid __contains__ because value may be empty.\n if option in os.environ:\n value = os.environ[option]\n else:\n if isinstance(default, Undefined):\n raise UndefinedValueError('{} not found. Declare it as ... | [
"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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
resize an <img> to 200*100 | [
"function resize(url, type) {\n var img = new Image();\n display.innerHTML = '';\n img.onload= function () {\n var data = resizeImage.resize(img, 200, 100, type);\n var smallImg = new Image();\n display.appendChild(smallImg);\n smallImg.src = data;\n };\n display.appendChild(img);\n img.src = url;... | [
"def resize_frame!\n screenshot_width = self.screenshot.portrait? ? screenshot.size[0] : screenshot.size[1]\n\n multiplicator = (screenshot_width.to_f / offset['width'].to_f) # by how much do we have to change this?\n new_frame_width = multiplicator * frame.width # the new width for the frame\n ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
foldR implementation. Reduce a list down to a single value.
@pram {Function} fn (rightEval, curVal) -> result | [
"function foldR1(fn, list) {\n \n return tail(list) \n ? fn(foldR1(fn, tail(list)), head(list))\n : head(list)\n ;\n}"
] | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Refactors a file. | [
"def refactor_file(self, filename, write=False, doctests_only=False):\n \"\"\"\"\"\"\n input, encoding = self._read_python_source(filename)\n if input is None:\n # Reading the file failed.\n return\n input += u\"\\n\" # Silence certain parse errors\n if docte... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// MonthNarrow returns the locales narrow month given the 'month' provided | [
"func (en *en_HK) MonthNarrow(month time.Month) string {\n\treturn en.monthsNarrow[month]\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Remove the panels and so hide the fields named. | [
"def _removeContentPanels(cls, remove):\n \n if type(remove) is str:\n remove = [remove]\n cls.content_panels = [panel for panel in cls.content_panels\n if getattr(panel, \"field_name\", None) not in remove]"
] | [
"def add_device(self, device, container):\n \n # There is a size tag which the JSS manages for us, so we can\n # ignore it.\n if self.findtext(\"is_smart\") == \"false\":\n self.add_object_to_path(device, container)\n else:\n # Technically this isn't true. It... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Delivers {@code error} to {@code callback} on the next game tick (on the PlayN thread). | [
"public void notifyFailure(final Callback<?> callback, final Throwable error) {\n invokeLater(new Runnable() {\n public void run() {\n callback.onFailure(error);\n }\n });\n }"
] | [
"private void onDataSetStaleEvent(@Observes DataSetStaleEvent event) {\n checkNotNull(\"event\",\n event);\n String uuid = event.getDataSetDef().getUUID();\n\n // Remove any stale data existing on the client.\n // This will force next lookup requests to push a refresh... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/*
Get content of a resource from provided url or a valid cached item
Parameters:
- url (string): url to the resource
- bubbleError (boolean): if true, throw and generated error | [
"function get(url, bubbleError) {\n\n /* use url as key for the cache */\n var value = cache.fetch(url)\n var defer = $.Deferred()\n\n if (value) {\n return defer.resolve(value) /* return a resolved promise with the cached value */\n } else {\n try {\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// GetPrivacy returns the Privacy field if it's non-nil, zero value otherwise. | [
"func (t *TeamLDAPMapping) GetPrivacy() string {\n\tif t == nil || t.Privacy == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Privacy\n}"
] | [
"func (f *RecordFlags) AddFlags(cmd *cobra.Command) {\n\tif f == nil {\n\t\treturn\n\t}\n\n\tif f.Record != nil {\n\t\tcmd.Flags().BoolVar(f.Record, \"record\", *f.Record, \"Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
export function nodeBackwards (link) { if (link.source.direction === 'l') { return link.target.direction === 'l' ? 1 : 0 } else { return link.target.direction === 'l' ? 0 : 1 } } | [
"function addTemporaryEdges (GG) {\n // Add temporary edges between Smin and sources\n GG.sources().forEach(u => {\n if (u !== '0') {\n GG.setEdge('0', u, { temp: true, delta: 0 })\n }\n })\n\n // XXX Should also add edges from sinks to Smax\n\n // G.nodes().forEach(u => {\n // if (!nodeSets.has(... | [
"function neighbourhoodSorter (a, b) {\n a = a.join(',');\n b = b.join(',');\n return a > b ? 1 : a < b ? -1 : 0;\n}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Renders with {"name", obj}.
@param name the specified name
@param obj the specified object
@return this context | [
"public RequestContext renderJSONValue(final String name, final Object obj) {\n if (renderer instanceof JsonRenderer) {\n final JsonRenderer r = (JsonRenderer) renderer;\n\n final JSONObject ret = r.getJSONObject();\n ret.put(name, obj);\n }\n\n return this;\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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
createPage
@param SiteEntity $site
@param array $pageData
@param bool $publishPage
@param bool $doFlush
@return PageEntity
@throws PageException | [
"public function createPage(\n SiteEntity $site,\n $pageData,\n $publishPage = false,\n $doFlush = true\n ) {\n if (empty($pageData['createdByUserId'])) {\n throw new PageException('CreatedByUserId is required to create a page.');\n }\n if (empty($pageD... | [
"public function onDelete()\n {\n $this->validateRequestTheme();\n\n $type = Request::input('templateType');\n\n $this->loadTemplate($type, trim(Request::input('templatePath')))->delete();\n\n /*\n * Extensibility - documented above\n */\n $this->fireSystemEvent... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Gets the timestamp that DateTieredCompactionStrategy considers to be the "current time".
@return the maximum timestamp across all SSTables.
@throws java.util.NoSuchElementException if there are no SSTables. | [
"private long getNow()\n {\n return Collections.max(cfs.getSSTables(), new Comparator<SSTableReader>()\n {\n public int compare(SSTableReader o1, SSTableReader o2)\n {\n return Long.compare(o1.getMaxTimestamp(), o2.getMaxTimestamp());\n }\n }).... | [
"private void triggerFutureReads(Collection<FutureReadResultEntry> futureReads) {\n for (FutureReadResultEntry r : futureReads) {\n ReadResultEntry entry = getSingleReadResultEntry(r.getStreamSegmentOffset(), r.getRequestedReadLength());\n assert entry != null : \"Serving a StorageReadR... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetFromAddress sets the FromAddress field's value. | [
"func (s *EmailChannelRequest) SetFromAddress(v string) *EmailChannelRequest {\n\ts.FromAddress = &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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
/* Build Day Table
----------------------------------------------------------------------- | [
"function buildDayTable() {\n\t\tvar html = buildDayTableHTML();\n\n\t\tif (dayTable) {\n\t\t\tdayTable.remove();\n\t\t}\n\t\tdayTable = $(html).appendTo(element);\n\n\t\tdayHead = dayTable.find('thead');\n\t\tdayHeadCells = dayHead.find('th').slice(1, -1); // exclude gutter\n\t\tdayBody = dayTable.find('tbody');\n... | [
"function openTable()\n {\n $this->examples = [];\n $this->markdown = ''; // Clear table\n $this->declareAbstraction = true;\n $this->add('| Visibility | Function |');\n $this->add('|:-----------|:---------|');\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
The url to the resource. This is created by swiching the base path
of the source file with the base url. | [
"def url\n url = source_path.to_s.sub(/^#{Regexp.escape(self.class.path)}/, '')\n url = url.sub(/\\..+$/, extension)\n url = File.join(self.class.url, url) unless url.starts_with? self.class.url\n url = url.dasherize\n url\n end"
] | [
"def get_docs_url(self, role, name):\n \n\n # Expand partial names to full names\n name = self.get_full_name(role, name)\n # Look up domain corresponding to role\n dom = IntersphinxInventory.roledomain[role]\n # Get the inventory entry tuple corresponding to the name\n ... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Show materialize confirmation message to delete specified resource.
@param string $title
@param string $message
@param string $link
@return string | [
"public function mtDeleting($title, $message, $link)\n {\n $modal = new MaterializeDeleteConfirmationMessage();\n\n $modal = $this->modalDirector->build($title, 'Delete', $message, $link, $modal);\n\n return $modal->modalHead.$modal->modalBody.$modal->modalFooter;\n }"
] | [
"public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Metadata management:",
"pos": "Represent the Github code about Metadata management:",
"neg": "Represent the Github code about Software development:"
} |
Convert an node response to a standard sdk response object
@param {Object} request {url, method, headers, retries}
@param {http.IncomingMessage} response
@param {String} body
@return {Object} response | [
"function createResponse(request, response, body){\n return {\n statusCode: response.statusCode,\n statusText: response.statusMessage,\n headers: response.headers,\n originalUrl: request.url,\n effectiveUrl: request.url,\n redirected: false,\n requestMethod: request.method,\n requestHeaders... | [
"function (jobName, param, customParams, callback) {\n [jobName, param, customParams, callback] = doArgs(arguments, ['string', ['string', 'id,timestamp,result,duration'], ['object', {}], 'function']);\n\n // TODO better name and handle the \"param\" ???\n doRequest({\n urlPattern: [ALL_BUILDS,... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Remove a user's API authentication key, removing that user's access to query the SoftLayer API. | [
"func (r User_Customer_OpenIdConnect) RemoveApiAuthenticationKey(keyId *int) (resp bool, err error) {\n\tparams := []interface{}{\n\t\tkeyId,\n\t}\n\terr = r.Session.DoRequest(\"SoftLayer_User_Customer_OpenIdConnect\", \"removeApiAuthenticationKey\", params, &r.Options, &resp)\n\treturn\n}"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Pass through to provider ResourceBinSession.use_comparative_bin_view | [
"def use_comparative_bin_view(self):\n \"\"\"\"\"\"\n self._bin_view = COMPARATIVE\n # self._get_provider_session('resource_bin_session') # To make sure the session is tracked\n for session in self._get_provider_sessions():\n try:\n session.use_comparative_bin_v... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Set (overwrite) template map
@param array $templateMap | [
"public function setTemplateMap(array $templateMap)\n {\n $this->templateMap = [];\n foreach ($templateMap as $name => $filename) {\n $this->addTemplate($name, $filename);\n }\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
To facilitate the management of what could be many nodes found by a single query,
we forward off any unknown methods to each node in the results query.
We assume that if one node accepts the method, then all of them will. | [
"def method_missing(name, *args)\n if self[0].respond_to?(name)\n self.inject(QueryResult.new) do |memo, node|\n ret = node.send(name, *args)\n memo << ret if ret\n memo\n end\n else\n super\n end\n end"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
forward navigator through the sons of Union nodes. | [
"private static <A> ForwardNavigator<RegExp<A>> unionNav() {\n\treturn new ForwardNavigator<RegExp<A>>() {\n\t private Visitor<A,List<RegExp<A>>> unionVis = new Visitor<A,List<RegExp<A>>>() {\n\t\tpublic List<RegExp<A>> visit(Union<A> ure) {\n\t\t return Arrays.<RegExp<A>>asList(ure.left, ure.right);\n\t\t}\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Switches the maximum height of the phone image for optimal display in landscape mode
@param {sap.ui.base.Event} oEvent Device orientation change event
@private | [
"function(oEvent) {\n\t\t\t\tvar oImage = this.byId(\"phoneImage\");\n\n\t\t\t\tif (Device.system.phone && oImage) {\n\t\t\t\t\toImage.toggleStyleClass(\"phoneHeaderImageLandscape\", oEvent.landscape);\n\t\t\t\t}\n\t\t\t}"
] | [
"function () {\n this._proxyFixSize();\n\n if (!this._sInitialFocusId) {\n var sInitFocusId = _fnGetInitialFocus(this);\n\n // Compare the initial focus id with the current focus that is\n // stored in the FocusHandler in the cor... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Find all the post records associated with a tag
@param int $id id
@return array | [
"public function countAllPostsThatHaveUserId($id) {\n // How many posts did this user create (created_by)?\n $results = DB::table('posts')->where('created_by', '=', $id)->get();\n\n if ( (count($results)) == 0 || (empty($results)) ) {\n $created_by = 0;\n } else {\n ... | [
"def QA_fetch_index_list_adv(collections=DATABASE.index_list):\n '''\n \n '''\n index_list_items = QA_fetch_index_list(collections)\n if len(index_list_items) == 0:\n print(\"QA Error QA_fetch_index_list_adv call item for item in collections.find() return 0 item, maybe the DATABASE.index_list ... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Serializes a protocol buffer that might not have all of the required fields
set.
@return string The serialized protocol buffer. | [
"public function serializePartialToString() {\n $enc = new Encoder();\n $this->outputPartial($enc);\n $res = $enc->toString();\n\n # Continue to be a little paranoid about the correctness of the protocol\n # buffer implementation.\n if (mt_rand(0, 99) === 0 && $this->byteSizePartial() !== strlen($... | [
"public static RpcRequest rpcRequest(MethodDescriptor<?, ?> method, Object message) {\n // We don't actually use the RpcRequest for request processing since it doesn't fit well with streaming.\n // We still populate it with a reasonable method name for use in logging. The service type is currently\n ... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.