query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
GetVOffsetTSlot retrieves the VOffsetT that the given vtable location
points to. If the vtable value is zero, the default value `d`
will be returned. | [
"def GetVOffsetTSlot(self, slot, d):\n \n\n N.enforce_number(slot, N.VOffsetTFlags)\n N.enforce_number(d, N.VOffsetTFlags)\n\n off = self.Offset(slot)\n if off == 0:\n return d\n return off"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Write HTML documentation to a file in the current directory. | [
"def _writedoc(doc, thing, forceload=0):\n \n try:\n object, name = pydoc.resolve(thing, forceload)\n page = pydoc.html.page(pydoc.describe(object), pydoc.html.document(object, name))\n fname = os.path.join(doc, name + '.html')\n file = open(fname, 'w')\n file.write(page)\n ... | [
"public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A... | codesearchnet | {
"query": "Represent the Github comment about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code about programming:"
} |
// Occurrences implements the Schedule interface. | [
"func (w Week) Occurrences(tr TimeRange) chan time.Time {\n\treturn occurrencesFor(w, tr)\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:"
} |
# ================================================ | [
"public function param( $param_name, $callback )\n\t{\n\t\tif( is_callable($callback) )\n\t\t{\n\t\t\t$this->_params[$param_name] = $callback( new request() );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_params[$param_name] = $callback;\n\t\t}\n\t}"
] | [
"function GroupProfile(_id, _owner) {\n this._id = _id;\n this._owner = _owner;\n this._parent = null; //!< 親 GroupProfile インスタンス\n this._children = []; //!< 子 GroupProfile インスタンス\n this._expanded = false; //!< 開閉情報\n this._st... | codesearchnet | {
"query": "Represent the Github post about Language and Writing:",
"pos": "Represent the Github code about Language and Writing:",
"neg": "Represent the Github code about programming:"
} |
// Clear clears all caching from Request s. | [
"func (r *Request) Clear() {\n\tr.name = \"\"\n\tr.ip = \"\"\n\tr.localIP = \"\"\n\tr.port = \"\"\n\tr.localPort = \"\"\n\tr.family = 0\n}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
增加有序集合score值
@param string $key key
@param int $increment 增长的数值
@param string $value value值
@return mixed | [
"public function zIncrBy($key, $increment, $value) {\n return $this->getHandler($this->judge(__FUNCTION__))->zIncrBy($key, $increment, $value);\n }"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the text about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
Returns a Section object matching the requested reference. If reference
is not found, an empty Section object is returned instead
@param string $reference
@return Section
@throws UnexepectedValueException if reference does not exist | [
"public function getSection($reference)\n {\n $reference = Section::trimReference($reference);\n $reference = strtolower(Section::normalizeReference($reference));\n\n foreach ($this->sections as $sectionKey => $section) {\n $potentialMatch = strtolower(Section::normalizeReference(... | [
"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 comment about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about programming:"
} |
GET /authentications | [
"def index\n respond_to do |format|\n format.html do\n render :index, locals: { authentications: current_user.services }\n end\n end\n end"
] | [
"public JSONObject find(HashMap<String, String> params) throws JSONException { \n return oClient.get(\"/profiles/v2/search/providers\", params);\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about text processing:"
} |
Converts this object to a map in JSON format.
@return \stdClass The map in JSON format corresponding to this object. | [
"function jsonSerialize(): \\stdClass {\n return (object) [\n 'lineNumber' => $this->getLineNumber(),\n 'blockNumber' => $this->getBlockNumber(),\n 'branchNumber' => $this->getBranchNumber(),\n 'taken' => $this->getTaken()\n ];\n }"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns a dictonary that associates the integer representation of each candidate with the
score they recieved in the profile.
:ivar Profile profile: A Profile object that represents an election profile. | [
"def getCandScoresMap(self, profile):\n \n\n # Currently, we expect the profile to contain complete ordering over candidates.\n elecType = profile.getElecType()\n if elecType != \"soc\" and elecType != \"toc\":\n print(\"ERROR: unsupported election type\")\n exit()\... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Adds an experimental property to this component.
@param name the property name (e.g. "X-ALT-DESC")
@param value the property value
@return the property object that was created | [
"public RawProperty addExperimentalProperty(String name, String value) {\n\t\treturn addExperimentalProperty(name, null, value);\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// Clean unwanted fields from metadata | [
"func cleanMetadata(metadata map[string]string) map[string]string {\n\t// Remove STANDARD StorageClass\n\tmetadata = removeStandardStorageClass(metadata)\n\t// Clean meta etag keys 'md5Sum', 'etag', \"expires\".\n\treturn cleanMetadataKeys(metadata, \"md5Sum\", \"etag\", \"expires\")\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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Listener tags attributes. | [
"protected void registerListenerAttributes() {\n addAttributeProcessor(new ConditionLmlAttribute(), \"if\");\n addAttributeProcessor(new KeepListenerLmlAttribute(), \"keep\");\n addAttributeProcessor(new ListenerIdsLmlAttribute(), \"ids\");\n // InputListener:\n addAttributeProces... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Execute is a proxy to the underlying template's Execute function | [
"func (t *Template) Execute(w io.Writer, data interface{}) error {\n\treturn t.tmpl.Execute(w, data)\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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Constructs the stack trace message.
@return the stack trace message. | [
"public String getStackMessage() {\n if (lineNumberEnd.longValue() > 0 && !lineNumberStart.equals(lineNumberEnd)) {\n return \"at \" + testFilePath + \"(\" + actionName + \":\" + lineNumberStart + \"-\" + lineNumberEnd + \")\";\n } else {\n return \"at \" + testFilePath + \"(\" +... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@param string $host
@param int $port
@return string | [
"protected function command($host, $port): string\n {\n $php = (new PhpExecutableFinder)->find(false);\n\n return vsprintf('%s -S %s:%s index.html', [\n $php, $host, $port,\n ]);\n }"
] | [
"protected function configureApp ()\n {\n $this->envData['APP_ENV'] = $this->choice (\"Choose environment. [local|production]\", ['local', 'production'], 0);\n $this->envData['APP_KEY'] = \"\";\n $this->envData['APP_DEBUG'] = $this->confirm (\"Enable debugging?\", 'yes') ? \"true\" : \"f... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Returns {@code true} if {@code path} ends with {@code other}.
@see java.nio.file.Path#endsWith(java.nio.file.Path) | [
"public boolean endsWith(UnixPath other) {\n UnixPath me = removeTrailingSeparator();\n other = other.removeTrailingSeparator();\n if (other.path.length() > me.path.length()) {\n return false;\n } else if (!me.path.isEmpty() && other.path.isEmpty()) {\n return false;\n } else if (other.isAb... | [
"private List<SourceFile> findJavaScriptFiles(ResourceCollection rc) {\n List<SourceFile> files = new ArrayList<>();\n Iterator<Resource> iter = rc.iterator();\n while (iter.hasNext()) {\n FileResource fr = (FileResource) iter.next();\n // Construct path to file, relative to current working direc... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Check if the user has a permission.
@param string $slug
@return bool | [
"public function may($slug)\n {\n return ! $this->permissions->filter(function (PermissionContract $permission) use ($slug) {\n return $permission->hasSlug($slug);\n })->isEmpty();\n }"
] | [
"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 comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// UpgradeCharmProfileCharmURL indicates an expected call of UpgradeCharmProfileCharmURL | [
"func (mr *MockProfileMachineMockRecorder) UpgradeCharmProfileCharmURL(arg0 interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"UpgradeCharmProfileCharmURL\", reflect.TypeOf((*MockProfileMachine)(nil).UpgradeCharmProfileCharmURL), arg0)\n}"
] | [
"func NewVolumeAttachmentsWatcher(caller base.APICaller, result params.MachineStorageIdsWatchResult) watcher.MachineStorageIdsWatcher {\n\treturn newMachineStorageIdsWatcher(\"VolumeAttachmentsWatcher\", caller, result)\n}"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
<p>Evaluate I18N overseas sales invoice lines query.</p>
@param pItsOwnerId ID of sales invoice
@param pLang lang
@return query
@throws Exception - an exception | [
"public final String evalSalesInvOverseaseLinesSql(\n final String pItsOwnerId, final String pLang) throws Exception {\n if (this.salesInvOverseaseLinesSql == null) {\n synchronized (this) {\n if (this.salesInvOverseaseLinesSql == null) {\n String flName = \"/accounting/trade/salesInvOver... | [
"@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift... | codesearchnet | {
"query": "Represent the Github instruction about invoice calculation:",
"pos": "Represent the Github code about invoice calculation:",
"neg": "Represent the Github code about programming:"
} |
Set a field data
@param integer $field_id | [
"protected function setFieldFieldValue($field_id)\n {\n $this->data_field = $this->field->get($field_id);\n\n if (empty($this->data_field)) {\n $this->outputHttpStatus(404);\n }\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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetExcludedMembers sets the ExcludedMembers field's value. | [
"func (s *ModifyDBClusterEndpointInput) SetExcludedMembers(v []*string) *ModifyDBClusterEndpointInput {\n\ts.ExcludedMembers = 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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// used internally for GetKites() and WatchKites() | [
"func (k *Kite) getKites(args protocol.GetKitesArgs) ([]*Client, error) {\n\t<-k.kontrol.readyConnected\n\n\tresponse, err := k.kontrol.TellWithTimeout(\"getKites\", k.Config.Timeout, args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar result = new(protocol.GetKitesResult)\n\terr = response.Unmarshal(&resul... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Rewrites Lexi's structure openings into PHP structure openings.
@param string $value
@return string | [
"protected function compile_default_structures($value) {\n\n $value = preg_replace('/(?(R)\\((?:[^\\(\\)]|(?R))*\\)|(?<!\\w)(\\s*)@(if|foreach|for|while)(\\s*(?R)+))/', '$1<?php $2 $3 { ?>', $value);\n $value = preg_replace('/(\\s*)@elseif(\\s*\\(.*\\))/', '$1<?php } elseif$2 { ?>', $value);\n ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
given year, month and day of Gregorian returns JDN
@param {Number} year
@param {Number} month
@param {Number} day
@param {Number} JD_OFFSET
@return {Number} | [
"function gregorianToJDN(year = 1, month = 1, day = 1, JD_OFFSET = JD_EPOCH_OFFSET_GREGORIAN) {\n const s = Math.floor(year / 4)\n - Math.floor((year - 1) / 4)\n - Math.floor(year / 100)\n + Math.floor((year - 1) / 100)\n + Math.floor(year / 400)\n - Math.floor((year - ... | [
"def _evalDateStd(self, datetimeString, sourceTime):\n \n s = datetimeString.strip()\n sourceTime = self._evalDT(datetimeString, sourceTime)\n\n # Given string is in the format 07/21/2006\n return self.parseDate(s, sourceTime)"
] | codesearchnet | {
"query": "Represent the description about datetime:",
"pos": "Represent the code about datetime:",
"neg": "Represent the code:"
} |
Creates directory with write permissions
@param string $directoryPath
@param int $permissions | [
"public function createDirectory($directoryPath, $permissions = 0777)\n {\n $current = '';\n $parts = array_filter(explode('/', $directoryPath));\n foreach ($parts as $part) {\n $current = \"$current/$part\";\n if (!empty($part) && !file_exists($current)) {\n ... | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Return the child loader with the given name
@param name
name of the child to get
@return the child loader with the given name | [
"private final CClassLoader getLoaderByName(final String name) {\n\t\ttry {\n\n\t\t\tCClassLoader loader = (CClassLoader) this.childrenMap.get(name);\n\n\t\t\tif (loader == null) {\n\t\t\t\tloader = CClassLoader.createLoader(this, name);\n\t\t\t\tthis.childrenMap.put(name, loader);\n\t\t\t}\n\n\t\t\treturn loader;\... | [
"function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Set a vport's upcall port ID. This generates a OVS_VPORT_CMD_NEW
// (not a OVS_VPORT_CMD_SET), leading to a call of the New method
// below. So we need to record which vports we already processed in
// order to avoid a vicious circle. | [
"func (c *missVportConsumer) setVportUpcallPortId(vport VportID) error {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\n\tif _, doneAlready := c.vportsDone[vport]; doneAlready {\n\t\treturn nil\n\t}\n\n\tif err := c.dp.setVportUpcallPortId(vport, c.upcallPortId); err != nil {\n\t\treturn err\n\t}\n\n\tc.vportsDone[vp... | [
"boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Deposit Address
@param string $symbol Asset symbol
@param string $method Asset name?? If not set, find a method from the API
@return mixed | [
"public function depositAddress($symbol, $method=false) {\n if(!$method) {\n $result = $this->queryPrivate(\"DepositMethods\", ['asset' => $symbol]);\n $method = $result['result'][0]['method'];\n }\n return $this->queryPrivate(\"DepositAddresses\", ['asset' => $s... | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided | [
"func (sr *sr_Latn_RS) WeekdayNarrow(weekday time.Weekday) string {\n\treturn sr.daysNarrow[weekday]\n}"
] | [
"func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about datetime:"
} |
/*
Get thumbnail from a File path. | [
"public static Observable<Bitmap> getThumbnail(String filePath) {\n return getFileType(filePath).filter(new Func1<String, Boolean>() {\n @Override\n public Boolean call(String s) {\n return s != null;\n }\n }).flatMap(new Func1<String, Observable<Bitmap>>() {\n @Override\n publ... | [
"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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Put message
@param $bundle
@param $key
@param $language
@param $message
@param $projectId
@return array | [
"public function putMessage($bundle, $key, $language, $message, $projectId = null)\n {\n $projectId = $projectId ?: $this->project_id;\n\n return $this->callService($this->url_plan['put_message'], array(\n 'project_id' => $projectId,\n 'bundle' => $bundle,\n ... | [
"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 Github post about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about Programming:"
} |
addons:services
list all available add-on services | [
"def services\n if current_command == \"addons:list\"\n deprecate(\"`heroku #{current_command}` has been deprecated. Please use `heroku addons:services` instead.\")\n end\n\n display_table(get_services, %w[name human_name state], %w[Slug Name State])\n display \"\\nSee plans with `heroku ... | [
"def addGlobalServices(self):\n \n if self.options.get('global_cache') and self.options.get('cache'):\n # only add the cache service here if the global_cache and cache\n # options were set to True\n _cache = self.getCacheService()\n _cache.startService()"
] | codesearchnet | {
"query": "Represent the instruction about App development:",
"pos": "Represent the code about App development:",
"neg": "Represent the code:"
} |
TODO: add progress bar, duration, ETA and file size | [
"async function progressBar(plugin, context, { skip } = { skip : false }) {\n const cols = [];\n const index = await plugin.currentSlideIndex();\n cols.push(`${skip ? 'Skipping' : 'Printing'} slide `);\n cols.push(`#${index}`.padEnd(8));\n cols.push(' (');\n cols.push(`${context.currentSlide}`.padStart(contex... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Persist and Flush
@return $this | [
"public function persistAndFlush()\n {\n if (0 === func_num_args()) {\n throw new \\LogicException('Missing arguments');\n }\n\n $persists = [];\n $entities = func_get_args();\n\n foreach ($entities as $entity) {\n if (true === is_array($entity)) {\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return the names of all locally defined fields on the model class. | [
"def _get_local_fields(self, model):\n \"\"\n local = [f for f in model._meta.fields]\n m2m = [f for f in model._meta.many_to_many]\n fields = local + m2m\n names = tuple([x.name for x in fields])\n\n return {\n ':local': dict(list(zip(names, fields))),\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns field's value prepared for saving into a database. | [
"def get_db_prep_save(self, value, connection=None):\n \n ## convert to settings.TIME_ZONE\n if value is not None:\n if value.tzinfo is None:\n value = default_tz.localize(value)\n else:\n value = value.astimezone(default_tz)\n return s... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Write a table cell using the `TCPDF::writeHTMLCell()` method
This function add page break, if needed.
@param array $cells Array of cells.
@return void | [
"protected function _writeMulticellsHtml($cells = []) {\n\t\tif (empty($cells) || !is_array($cells)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$maxHeight = 0;\n\t\t$copyTcpdf = TCPDF_STATIC::objclone($this->tcpdf);\n\t\t$copyTcpdf->setAutoPageBreak(false);\n\t\t$copyTcpdf->AddPage();\n\t\tforeach ($cells as $row) {\n\t\t\tlis... | [
"function parse_drawing(data, rels) {\n\tif(!data) return \"??\";\n\t/*\n\t Chartsheet Drawing:\n\t - 20.5.2.35 wsDr CT_Drawing\n\t - 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor\n\t - 20.5.2.16 graphicFrame CT_GraphicalObjectFrame\n\t - 20.1.2.2.16 graphic CT_GraphicalObject\n\t - 20.1.2.2.17 gr... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Disconnects a user.
@param UserInterface $user
@param UserResponseInterface $response | [
"public function disconnect(UserInterface $user, UserResponseInterface $response)\n {\n $property = $this->getProperty($response);\n\n $this->accessor->setValue($user, $property, null);\n $this->userManager->updateUser($user);\n }"
] | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// Get returns the item in the Store that matches i, or nil if no such item
// exists. | [
"func (c *Collection) Get(i gtreap.Item) gtreap.Item {\n\troot := c.currentRoot()\n\tif root == nil {\n\t\treturn nil\n\t}\n\treturn root.Get(i)\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Asserts that provided resource has required 'data' or 'meta' node.
@param resource resource | [
"public static void ensureValidResource(JsonNode resource) {\n\t\tif (!resource.has(JSONAPISpecConstants.DATA) && !resource.has(JSONAPISpecConstants.META)) {\n\t\t\tthrow new InvalidJsonApiResourceException();\n\t\t}\n\t}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// helper function which converts a small endian []byte to a uint64 | [
"func FromUint64(data [8]byte) uint64 {\n\tui64 := binary.LittleEndian.Uint64(data[:])\n\treturn ui64\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 description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Render JSON
inline example:
return $this->get('jbuilder')->render('AcmeBlogBundle:Post:index.json.php', array('posts' => $posts));
@param $view
@param array $parameters
@param Response $response
@return Response | [
"public function render($view, array $parameters = array(), Response $response = null)\n {\n if ($response === null) {\n $response = new Response();\n }\n\n $json = Encoder::encodeFromFile($this->getPath($view), $parameters);\n $response->setContent($json);\n\n retur... | [
"public function generate(array $requests, ParametersManager $parManager)\n {\n $twig = new TwigEngine(__DIR__);\n $param = array('routes' => RoutingRequest::filter($requests));\n $this->create('src/Config/', 'routes.php', $twig->render('routes.php.twig', $param));\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Initializes the constant tables. | [
"function _init() {\r\n // create padding\r\n _padding = String.fromCharCode(128);\r\n _padding += forge.util.fillString(String.fromCharCode(0x00), 128);\r\n\r\n // create K table for SHA-512\r\n _k = [\r\n [0x428a2f98, 0xd728ae22], [0x71374491, 0x23ef65cd],\r\n [0xb5c0fbcf, 0xec4d3b2f], [0xe9b5dba5, 0x8... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Combine submission type checkboxes into integer values for the database.
@param stdClass $data The submitted form data. | [
"public function data_postprocessing($data) {\n parent::data_postprocessing($data);\n\n foreach (['text', 'file'] as $type) {\n $field = 'submissiontype' . $type;\n $available = $field . 'available';\n $required = $field . 'required';\n if ($data->$required)... | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the text about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
Returns the key's parent. | [
"@Override\n public Key getParent() {\n List<PathElement> ancestors = getAncestors();\n if (ancestors.isEmpty()) {\n return null;\n }\n PathElement parent = ancestors.get(ancestors.size() - 1);\n Key.Builder keyBuilder;\n if (parent.hasName()) {\n keyBuilder = Key.newBuilder(getProjectI... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Add hubWindowMaker
@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since 2012-10-25
@param HarvestCloud\CoreBundle\Entity\HubWindowMaker $hubWindowMaker | [
"public function addHubWindowMaker(\\HarvestCloud\\CoreBundle\\Entity\\HubWindowMaker $hubWindowMaker)\n {\n $this->hubWindowMakers[] = $hubWindowMaker;\n\n $hubWindowMaker->setHub($this);\n }"
] | [
"public function init()\n {\n $this->buildStore = b8\\Store\\Factory::getStore('Build');\n $this->buildService = new BuildService($this->buildStore);\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
convert Date as yyyy-mm-dd hh:mm:ss | [
"function formatTime(date) {\n\tvar n = date.getFullYear(); \n\tvar y = date.getMonth() + 1;\n\tvar r = date.getDate(); \n\tvar mytime = date.toLocaleTimeString(); \n\tvar mytimes = n+ \"-\" + y + \"-\" + r + \" \" + mytime;\n return mytimes;\n}"
] | [
"def validate_format_iso8601(validator, fieldname, value, format_option):\n \n try:\n iso8601.parse_date(value)\n except ValueError:\n raise ValidationError(\n \"Value %(value)r of field '%(fieldname)s' is not in \"\n \"'iso8601 YYYY-MM-DDThh:mm:ss(+/-)hh:mm' format\" % ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Tries to fulfill with the given allocated slot a pending slot request or add the
allocated slot to the set of available slots if no matching request is available.
@param allocatedSlot which shall be returned | [
"private void tryFulfillSlotRequestOrMakeAvailable(AllocatedSlot allocatedSlot) {\n\t\tPreconditions.checkState(!allocatedSlot.isUsed(), \"Provided slot is still in use.\");\n\n\t\tfinal PendingRequest pendingRequest = pollMatchingPendingRequest(allocatedSlot);\n\n\t\tif (pendingRequest != null) {\n\t\t\tlog.debug(... | [
"boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Parse will tell the Parser to parse all settings from the config | [
"func (parser *Parser) Parse() error {\n\terr := parser.parse()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(parser.previous) > 0 {\n\t\treturn parser.syntaxError(\"expected end of section, instead found EOF\")\n\t}\n\n\treturn nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Returns the table's alias
@param array $tokens
@return null|string | [
"public static function alias(array $tokens) {\n HashMap::assert($tokens, 'tokens');\n\n $operation = SqlOperation::create($tokens);\n if ($operation === SqlOperations::INSERT) return null;\n if ($operation === SqlOperations::UPDATE) return $tokens['UPDATE'][0]['alias']['name'];\n ... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Parse an XML from the given XML Stream reader.
Closes the {@code in} stream.
@param in the XMLStreamReader
@return the parsed XElement tree
@throws XMLStreamException if an error occurs | [
"public static XNElement parseXML(XMLStreamReader in) throws XMLStreamException {\n XNElement root = parseXMLFragment(in);\n in.close();\n return root;\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:"
} |
/*
Reads GZIP member header and returns the total byte number
of this member header. | [
"private int readHeader(InputStream this_in) throws IOException {\n CheckedInputStream in = new CheckedInputStream(this_in, crc);\n crc.reset();\n // Check header magic\n if (readUShort(in) != GZIP_MAGIC) {\n throw new ZipException(\"Not in GZIP format\");\n }\n ... | [
"def messages(self):\n ''''''\n\n # The file contains the fixed-size file header followed by\n # fixed-size message structures, followed by minimal message\n # information (subject, from, to). Start after the file\n # header and then simply return the message structures in\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Helper method to add operator to a set of existing changes ready to be sent to Mongo
@param $changes
@param $operator
@param $kvp | [
"private function addOperatorToChange(&$changes,$operator,$kvp)\n {\n if (!isset($changes[$operator]) || !is_array($changes[$operator]))\n {\n $changes[$operator] = array();\n }\n foreach($kvp as $key=>$value)\n {\n if (isset($changes[$operator][$key]))\n ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Called by {@link #run(String...)} to add the standard "server" and "check" commands
@param bootstrap the bootstrap instance | [
"protected void addDefaultCommands(Bootstrap<T> bootstrap) {\n bootstrap.addCommand(new ServerCommand<>(this));\n bootstrap.addCommand(new CheckCommand<>(this));\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Set a value in the params section of the request
@param string $name Name of parameter
@param mixed $value Value of parameter
@return mixed $value | [
"public function setParam($name, $value) {\n\t\t$this->payload['params'][$name] = Trustly_Data::ensureUTF8($value);\n\t\treturn $value;\n\t}"
] | [
"@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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Set the title of the page.
@param {String} title
@return {String} Actual title of the page. If no argument is provided, it represents the actual title of
the page
@private | [
"function (title) {\n var document = window.document;\n if (ariaUtilsType.isString(title)) {\n document.title = title;\n } else {\n title = document.title;\n }\n return title;\n }"
] | [
"function Entry (content, name, parent) {\n if (!(this instanceof Entry)) return new Entry(content, name, parent);\n\n this._parent = parent; // parent can be a Document or ArrayField\n this._schema = parent._schema; // the root Document\n this._name = name; // the field name supplied by the user\n this._hidde... | codesearchnet | {
"query": "Represent the sentence about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about Software development:"
} |
// UnmarshalJSON sets the object from the provided JSON representation | [
"func (l *CodeDeployDeploymentGroupEC2TagFilterList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := CodeDeployDeploymentGroupEC2TagFilter{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = CodeDeployDeploymentGroupEC2TagFilt... | [
"@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:"
} |
Generates configuration file from config specifications | [
"def config(config, skip_defaults):\n \n\n configurator = ClickConfigurator(\n vodka.plugin,\n skip_defaults=skip_defaults\n )\n\n configurator.configure(vodka.config.instance, vodka.config.InstanceHandler)\n\n try:\n dst = munge_config.parse_url(config)\n except ValueError:\n... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Sets the rfs export work Path after normalizing.<p>
@param exportWorkPath the rfs export Work Path to set | [
"public void setExportWorkPath(String exportWorkPath) {\n\n if (exportWorkPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) {\n // not allowed because a full static export would delete the opencms directory\n throw new CmsIllegalArgumentException(Messages.get().container(... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetBasePath sets the BasePath field's value. | [
"func (s *UpdateBasePathMappingInput) SetBasePath(v string) *UpdateBasePathMappingInput {\n\ts.BasePath = &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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Validate the current URI from the instance variables. Returns true if and only if all
parts pass validation.
@return boolean | [
"public function valid()\n {\n // Return true if and only if all parts of the URI have passed validation\n return $this->validateUsername()\n && $this->validatePassword()\n && $this->validateHost()\n && $this->validatePort()\n && $... | [
"def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Only these properties of a message are sent and received. | [
"function transport(message) {\n return {\n header: message.header,\n request: message.request,\n response: message.response\n }\n }"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Get instance of BuildPagination
@return BuildPagination | [
"public function getBuildPagination()\n\t{\n\t\t$buildPost = $this->getBuildPost();\n\t\t$buildPost->build();\n\t\treturn new BuildPagination($this->config, $buildPost->getNodes());\n\t}"
] | [
"public <V> Function<Cursor, V> cursorToBean(Class<V> api)\n {\n return (FindDataVault<ID,T,V>) _valueBeans.get(api);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Revisions returns all the revisions of the message | [
"func (post *UserPost) Revisions() (modifications []string) {\n\tDb().Model(UserPostRevision{}).Where(&UserPostRevision{Hpid: post.ID()}).Pluck(\"message\", &modifications)\n\treturn\n}"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github post about Messaging:",
"pos": "Represent the Github code about Messaging:",
"neg": "Represent the Github code:"
} |
Gets the first result.
@param query
the query
@param field
the field
@param hits
the hits
@param clazz
the clazz
@param metaModel
the meta model
@param entityMetadata
the entity metadata
@return the first | [
"private Object getFirstResult(KunderaQuery query, String field, SearchHits hits, Class clazz, Metamodel metaModel,\n EntityMetadata entityMetadata)\n {\n Object entity;\n\n if (query.getEntityAlias().equals(field))\n {\n entity = getEntityObjects(clazz, entityMetadata,... | [
"private Document indexDocument(EntityMetadata metadata, final MetamodelImpl metaModel, Object object,\n String parentId, Class<?> clazz)\n {\n\n if (log.isDebugEnabled())\n {\n log.debug(\"Indexing @Entity[{}],{} \", metadata.getEntityClazz().getName(), object);\n }\n\... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Metadata management:"
} |
Resolve all aliases.
@param string $alias
@return bool | [
"public function resolve(string $alias) : bool\n {\n // return false if alias already resolved.\n if (in_array($alias, $this->resolved)) {\n return false;\n }\n\n $this->resolved[] = $alias;\n\n // Resolve class alias if set.\n if ($this->has($alias)) {\n ... | [
"final static function f($op) {return dfcf(function(OP $op) {\n\t\t$c = df_con_hier($m = df_ar(dfpm($op), M::class), __CLASS__); /** @var string $c */ /** @var M $m */\n\t\treturn new $c($m);\n\t}, [dfp($op)]);}"
] | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public IfcBSplineCurveForm createIfcBSplineCurveFormFromString(EDataType eDataType, String initialValue) {\r\n\t\tIfcBSplineCurveForm result = IfcBSplineCurveForm.get(initialValue);\r\n\t\tif (result == null)\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"The value '\" + initialValue + \"' is not a va... | [
"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 Github instruction about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
serialize the index to a cache file | [
"def cache_index(index)\n # TODO: atomic rename. Right now we just hope.\n File.open(CACHE_PATH, 'w' ) do |out|\n YAML::dump( index, out )\n end\n end"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
The distance between the layers of two neural networks. | [
"def layers_distance(list_a, list_b):\n \"\"\"\"\"\"\n len_a = len(list_a)\n len_b = len(list_b)\n f = np.zeros((len_a + 1, len_b + 1))\n f[-1][-1] = 0\n for i in range(-1, len_a):\n f[i][-1] = i + 1\n for j in range(-1, len_b):\n f[-1][j] = j + 1\n for i in range(len_a):\n ... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Simple wrapper around sacreBLEU's BLEU without tokenization and smoothing.
:param hypotheses: Hypotheses stream.
:param references: Reference stream.
:param offset: Smoothing constant.
:return: BLEU score as float between 0 and 1. | [
"def raw_corpus_bleu(hypotheses: Iterable[str], references: Iterable[str], offset: Optional[float] = 0.01) -> float:\n \n return sacrebleu.raw_corpus_bleu(hypotheses, [references], smooth_floor=offset).score / 100.0"
] | [
"def get_tokenizer(fhp # type: Optional[field_formats.FieldHashingProperties]\n ):\n # type: (...) -> Callable[[Text, Optional[Text]], Iterable[Text]]\n \n\n def dummy(word, ignore=None):\n # type: (Text, Optional[Text]) -> Iterable[Text]\n \"\"\"\n Null tokenizer ret... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get script tag with a callback function.
@param array $captchas
@param string $callbackName
@return \Illuminate\Support\HtmlString | [
"public function scriptWithCallback(array $captchas, $callbackName = 'captchaRenderCallback')\n {\n $script = $this->script($callbackName)->toHtml();\n\n if ( ! empty($script) && ! empty($captchas)) {\n $script = implode(PHP_EOL, [\n $this->getApiScript()->toHtml(),\n ... | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Return (self - b, b - self) | [
"def two_way_difference(self, b, extra_add = (), extra_remove = ()):\n \n if self is b:\n return ((), ())\n if isinstance(b, DiffRef_):\n extra_remove = extra_remove + b.add\n b = b.origin\n if extra_add == extra_remove:\n extra_add = extra_rem... | [
"final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Set the max attribute.
@param number|string $max A numeric value or a variableRef.
@throws \InvalidArgumentException If $max is not a numeric value nor a variableRef. | [
"public function setMax($max)\n {\n if (is_numeric($max) || Format::isVariableRef($max)) {\n $this->max = $max;\n } else {\n $msg = \"'Max must be a numeric value or a variableRef, '\" . gettype($max) . \"' given.\";\n throw new InvalidArgumentException($msg);\n ... | [
"private function guardValidModelAndIdentifier($model, $identifier)\n {\n if (empty($model) || (!is_object($model) && (null === $identifier || '' === $identifier))) {\n throw new ResolveComponentDataException('Model has to be an object or (a scalar + an identifier in 2nd argument)');\n }... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Datatable fields.
@param $modelName
@param $modelData
@return $this | [
"private function addDatatableFields($modelName, $modelData)\n {\n $fields = '';\n $firstIteration = true;\n\n foreach ($modelData->fields as $field)\n {\n if ($field->hideInListings === false)\n {\n if ($firstIteration)\n {\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Serializes the given instance.<p>
@param streamWriter the writer
@param instance the instance to serialize
@throws SerializationException if something goes wrong | [
"public static void serialize(SerializationStreamWriter streamWriter, CmsUUID instance)\n throws SerializationException {\n\n streamWriter.writeString(instance.toString());\n }"
] | [
"public static JsonValue serializeAsJson(Object o) throws IOException {\n try {\n return findFieldsToSerialize(o).mainObject;\n } catch (IllegalStateException ise) {\n // the reflective attempt to build the object failed.\n throw new IOException(\"Unable to build JSON ... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// sendEvent does the actual handoff to libhoney | [
"func sendEvent(ev event.Event) {\n\tif ev.SampleRate == -1 {\n\t\t// drop the event!\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"event\": ev,\n\t\t}).Debug(\"droppped event due to sampling\")\n\t\treturn\n\t}\n\tlibhEv := libhoney.NewEvent()\n\tlibhEv.Metadata = ev\n\tlibhEv.Timestamp = ev.Timestamp\n\tlibhEv.S... | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Answers a list of field objects for the CMS interface.
@return FieldList | [
"public function getCMSFields()\n {\n // Obtain Field Objects (from parent):\n \n $fields = parent::getCMSFields();\n \n // Create Main Fields:\n \n $fields->addFieldsToTab(\n 'Root.Main',\n [\n TextField::create(\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
@param array $mediaQueryRules
@param array $objects
@return Rule[] | [
"public function convertArrayToObjects(array $mediaQueryRules, array $objects = array())\n {\n foreach ($mediaQueryRules as $order => $ruleSet) {\n foreach (reset($ruleSet) as $rule) {\n $objects = array_merge($objects, $this->convertToObjects(key($ruleSet), $rule, $order));\n ... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *FunctionCode) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"FunctionCode\"}\n\tif s.S3Bucket != nil && len(*s.S3Bucket) < 3 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"S3Bucket\", 3))\n\t}\n\tif s.S3Key != nil && len(*s.S3Key) < 1 {\n\t\tinvalidParams.Add(request.NewE... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// savePredicatesMorphism tags either forward or reverse predicates from current node
// without affecting path. | [
"func savePredicatesMorphism(isIn bool, tag string) morphism {\n\treturn morphism{\n\t\tReversal: func(ctx *pathContext) (morphism, *pathContext) {\n\t\t\treturn savePredicatesMorphism(isIn, tag), ctx\n\t\t},\n\t\tApply: func(in shape.Shape, ctx *pathContext) (shape.Shape, *pathContext) {\n\t\t\treturn shape.SavePr... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Build HPL data from basic parameters | [
"def _build_data(self):\n \"\"\"\"\"\"\n\n def baseN(nodes, mpn):\n return int(math.sqrt(mpn * 0.80 * nodes * 1024 * 1024 / 8))\n\n def nFromNb(baseN, nb):\n factor = int(baseN / nb)\n if factor % 2 != 0:\n factor -= 1\n return nb * fac... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
<p>
Escapes the specified target text as required for JavaScript code.
</p>
@param target the text to be escaped
@return the escaped text.
@since 2.0.11 | [
"public static String escapeJavaScript(final Object target) {\n if (target == null) {\n return null;\n }\n return JavaScriptEscape.escapeJavaScript(target.toString());\n }"
] | [
"public static String escapeIllegalCharacters(String documentation) {\n if (documentation == null) {\n return \"\";\n }\n\n /*\n * this specifically handles a case where a '* /' sequence may\n * be present in documentation and inadvertently terminate that Java\n ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Stores the link settings in persisted storage.
@param settings the {@link com.groundupworks.wings.facebook.FacebookSettings}. | [
"private void storeSettings(FacebookSettings settings) {\n int destinationId = settings.getDestinationId();\n String accountName = settings.getAccountName();\n String albumName = settings.getAlbumName();\n String albumGraphPath = settings.getAlbumGraphPath();\n String pageAccessTo... | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
One of ways of creating builder. This is possibly the least verbose way where compiler should be able to guess the generic parameters. | [
"@Nonnull\n\tpublic static LSrtToDblFunction srtToDblFunctionFrom(Consumer<LSrtToDblFunctionBuilder> buildingFunction) {\n\t\tLSrtToDblFunctionBuilder builder = new LSrtToDblFunctionBuilder();\n\t\tbuildingFunction.accept(builder);\n\t\treturn builder.build();\n\t}"
] | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Fetches all the messages in an inbox and put them in the emails array
@return returns the array of all email objects found | [
"public function fetchMessages()\n {\n\n //count the messages\n $this->countMessages();\n\n //if there are zero emails report this to the user\n if ($this->email_count == 0) {\n\n $this->log('There are no emails to process!');\n\n return false;\n }\n\n ... | [
"function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(CreateFleetRequest createFleetRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (createFleetRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(createFleet... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Factory class to instantiate a StageClass | [
"private function getStageInstance(string $stageClass): StageInterface\n {\n if (!class_exists($stageClass)) {\n throw new RuntimeException('Error: Could not find requested stage class.');\n }\n if (in_array(\"Zikula\\\\Component\\\\Wizard\\\\InjectContainerInterface\", class_impl... | [
"@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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
{@inhericDoc}
@see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() | [
"protected function renderContent() {\n ?>\n <div id=\"maj-sosa-missing-page\" class=\"center\">\n \t\t\t<h2><?= $this->data->get('title') ?></h2>\n \t\t\t\n \t\t\t<?php if($this->data->get('is_setup')) { \n \t\t\t $this->renderSosaHeader();\n \t\t\t if($this->data->get('has_... | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Route request by router obtained by default by calling:
`\MvcCore\Router::GetInstance();`.
Store requested route inside configured
router class to get it later by calling:
`\MvcCore\Router::GetCurrentRoute();`
@return bool | [
"public function RouteRequest () {\n\t\t$router = $this->GetRouter()->SetRequest($this->GetRequest());\n\t\ttry {\n\t\t\t/**\n\t\t\t * `Route()` method could throws those exceptions:\n\t\t\t * @throws \\LogicException Route configuration property is missing.\n\t\t\t * @throws \\InvalidArgumentException Wrong route ... | [
"public function bootstrap()\n {\n\n // register the default autoloader\n require SERVER_AUTOLOADER;\n\n // synchronize the application instance and register the class loaders\n $application = $this->application;\n $application->registerClassLoaders();\n\n // register th... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Closes the given client socket.
@param clientSocket
The client socket to close.
@return Returns true if the client socket is closed otherwise false. | [
"public static boolean closeClientSocket(final Socket clientSocket)\r\n\t{\r\n\t\tboolean closed = true;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tclose(clientSocket);\r\n\t\t}\r\n\t\tcatch (final IOException e)\r\n\t\t{\r\n\t\t\tLOGGER.error(\"IOException occured by trying to close the client socket.\", e);\r\n\t\t\tclosed = f... | [
"def process_request_thread(self, request, client_address):\n \"\"\"\"\"\"\n # Instantiate the request handler.\n handler = self.RequestHandlerClass(request, client_address, self)\n try:\n # Attempt to handle a request with the handler.\n handler.handle_request()\n self.request_complete_c... | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Logs the user out.
@param array $options Optional parameters
@return array | [
"public function logout(array $options = [])\n {\n $response = $this->query(\n $this->buildQueryArgs('auth', 'logout'),\n [],\n $options\n );\n\n $this->jwtToken = null;\n\n return $response['result'];\n }"
] | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Returns an active user that matches the payload's user id and email. | [
"def authenticate_credentials(self, payload):\n \n User = get_user_model() # noqa\n username = jwt_get_username_from_payload_handler(payload)\n\n if not username:\n msg = _('Invalid payload.')\n raise exceptions.AuthenticationFailed(msg)\n\n try:\n ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// writeTo is an efficient, private function for string-formatting a multiaddr.
// Trust me, we tend to allocate a lot when doing this. | [
"func (c *Component) writeTo(b *strings.Builder) {\n\tb.WriteByte('/')\n\tb.WriteString(c.protocol.Name)\n\tvalue := c.Value()\n\tif len(value) == 0 {\n\t\treturn\n\t}\n\tif !(c.protocol.Path && value[0] == '/') {\n\t\tb.WriteByte('/')\n\t}\n\tb.WriteString(value)\n}"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the instruction about writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code about Software development:"
} |
// SortTags turns a map[string]string into a slice of key/values, sorted by key. | [
"func SortTags(tags map[string]string) [][]string {\n\tkeys := make([]string, len(tags))\n\tresult := make([][]string, len(tags))\n\ti := 0\n\tfor k := range tags {\n\t\tkeys[i] = k\n\t\ti++\n\t}\n\tsort.Strings(keys)\n\tfor i, k := range keys {\n\t\tresult[i] = []string{k, tags[k]}\n\t}\n\treturn result\n}"
] | [
"function _parseVertex(line) {\n var vertex = JSON.parse(line);\n assert.ok(_smellsLikeAnElement(vertex));\n // A vertex is an object, i.e. a key,value map.\n // We don't sort the keys of the object, leaving that to jsonStableStringify below.\n // But a vertex values contain `prop... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
// RenderTemplateFile is a shortcut and renders a template file directly. | [
"func (set *TemplateSet) RenderTemplateFile(fn string, ctx Context) (string, error) {\n\tset.firstTemplateCreated = true\n\n\ttpl := Must(set.FromFile(fn))\n\tresult, err := tpl.Execute(ctx)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn result, 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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// SetVersions sets the Versions field's value. | [
"func (s *ListGroupVersionsOutput) SetVersions(v []*VersionInformation) *ListGroupVersionsOutput {\n\ts.Versions = v\n\treturn s\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Draws tooltip unless a plugin returns `false` to the `beforeTooltipDraw`
hook, in which case, plugins will not be called on `afterTooltipDraw`.
@private | [
"function(easingValue) {\n\t\tvar me = this;\n\t\tvar tooltip = me.tooltip;\n\t\tvar args = {\n\t\t\ttooltip: tooltip,\n\t\t\teasingValue: easingValue\n\t\t};\n\n\t\tif (core_plugins.notify(me, 'beforeTooltipDraw', [args]) === false) {\n\t\t\treturn;\n\t\t}\n\n\t\ttooltip.draw();\n\n\t\tcore_plugins.notify(me, 'aft... | [
"function (evt) {\n var domEvent = evt.domEvent;\n if (domEvent.target == this.getTextInputField()) {\n // Clicking on the input should directly give the focus to the input.\n // Setting this boolean to false prevents the focus from being given\n //... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Retrieve command
@return CommandInterface | [
"public function getCommand()\n {\n $payload = $this->getContent();\n \n $command = new Command(\n $payload['service'], \n $payload['operation'], \n $payload['params'], \n $payload['context']);\n \n $payloadIdentity = $payload['identi... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Retrieves the current value for any option
@param string $option
@return bool|int|string
@throws Exception if option does not exist | [
"function getOption( $option )\n {\n if ( !in_array( $option, $this->Options ) )\n {\n throw new Exception( \"Option $option not supported\" );\n }\n\n switch( $option )\n {\n case 'timeout':\n return $this->Timeout;\n case 'login... | [
"public function getStoreValue($data = null)\n {\n\n // If Overrite Value\n if (isset($this->value) && $this->overwriteValue) {\n return $this->value;\n }\n\n // If user have user input value\n if ($data != null && isset($data[$this->getName()])) {\n\n // ... | codesearchnet | {
"query": "Represent the Github comment 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.