query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Retrieve cwlkeys from inputs, handling defaults which can be null.
When inputs are null in some and present in others, this creates unequal
keys in each sample, confusing decision making about which are primary and extras. | [
"def _get_all_cwlkeys(items, default_keys=None):\n \n if default_keys:\n default_keys = set(default_keys)\n else:\n default_keys = set([\"metadata__batch\", \"config__algorithm__validate\",\n \"config__algorithm__validate_regions\",\n \"co... | [
"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 Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Validates the client configuration.
@param array $config | [
"static public function validateClientConfig(array $config)\n {\n $tags = [static::T8700, static::T8915, static::T8914];\n\n foreach ($tags as $tag) {\n if (!array_key_exists($tag, $config) || empty($config[$tag])) {\n throw new InvalidArgumentException(\"Please configure ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Persist the patches_applied to the package extra section.
@param \Composer\Package\PackageInterface $package
@param array $patchesAppliedData | [
"protected function setPatchedPackageData(PackageInterface $package, array $patchesAppliedData)\n {\n $extra = $package->getExtra();\n $extra['patches_applied'] = $patchesAppliedData;\n $package->setExtra($extra);\n $this->composer->getRepositoryManager()->getLocalRepository()->write(... | [
"public function Upgrade183to184()\n {\n $this->_batch->addTask('Db_CreateNewTables');\n $this->_batch->addTask('Db_AddPatches', 62);\n $this->_batch->addTask('Updates_CompileTemplates');\n\n // Use AddTask task to execute after patches\n $this->_batch->addTask('AddTask', 'Echo... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Process the drop table base on the given table name.
Foreign key checks disable before processing the drop action and
enable it back again after the process.
@param string $tableName
@return void | [
"public function dropTable($tableName)\n {\n $this->db->query('SET FOREIGN_KEY_CHECKS = 0;');\n $this->db->query(\"DROP TABLE IF EXISTS `{$this->getTableNamePrefix($tableName)}`;\");\n $this->db->query('SET FOREIGN_KEY_CHECKS = 1;'); \n }"
] | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about AWS Auto Scaling:"
} |
Get a Mongo connection instance.
@param string $name
@return Flatline\Mongol\Client | [
"public function connection($name = null)\n {\n if ( ! isset($this->connections[$name]))\n {\n $this->connections[$name] = $this->createConnection($name);\n }\n\n return $this->connections[$name];\n }"
] | [
"def createConnection(self):\n \"\"\"\"\"\"\n uri = self.reader.createConnection()\n return Pyro.core.getAttrProxyForURI(uri)"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get an item from the cache, or store the default value forever.
:param key: The cache key
:type key: str
:param callback: The default function
:type callback: mixed
:rtype: mixed | [
"def remember_forever(self, key, callback):\n \n # If the item exists in the cache we will just return this immediately\n # otherwise we will execute the given callback and cache the result\n # of that execution forever.\n val = self.get(key)\n if val is not None:\n ... | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
======================================================================= | [
"protected int subscribe_data_ready_event(String attr_name, String[] filters, boolean stateless)\n throws DevFailed {\n return event_supplier.subscribe_event(attr_name,\n DATA_READY_EVENT, this, filters, stateless);\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 text about N/A:",
"pos": "Represent the code about N/A:",
"neg": "Represent the code:"
} |
Hydrate the public properties
@param $data | [
"public function hydrate($data)\n {\n parent::hydrate($data);\n $this->values = ValueAs::arr($this->values);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Override Ruby's method_missing in order to provide `On#let` interface.
@api private
@since 0.11.0
@raise [NoMethodError] If doesn't respond to the given method. | [
"def method_missing(name, *args, &block)\n helpers.key?(name) ? helpers.fetch(name).call : super\n end"
] | [
"def serialize_function_from_method(meth)\n if pry?\n meth = Pry::Method.new(meth)\n end\n\n {type: 'method', name: meth.name, content: meth.source}\n rescue\n raise Spark::SerializeError, 'Method can not be serialized. Use full path or Proc.'\n end"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
{@inheritDoc} using curl. | [
"public function send()\n {\n $allowed_status_codes = array_merge(array(200), $this->ignoredStatusCodes);\n $this->ignoredStatusCodes = array();\n\n try {\n $this->_setupCurl();\n $response = curl_exec($this->curl);\n\n if (!in_array(curl_getinfo($this->curl,... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the Github text about writing:",
"pos": "Represent the Github code about writing:",
"neg": "Represent the Github code:"
} |
Write property database to an OutputStream. The OutputStream is
guaranteed to be closed, even if an exception is thrown.
@param out
the OutputStream
@throws IOException | [
"public void write(@WillClose OutputStream out) throws IOException {\n BufferedWriter writer = null;\n boolean missingClassWarningsSuppressed = AnalysisContext.currentAnalysisContext().setMissingClassWarningsSuppressed(true);\n\n try {\n writer = new BufferedWriter(new OutputStreamWr... | [
"@Override\n public XMLStreamReader2 createXMLStreamReader(File f)\n throws XMLStreamException\n {\n /* true for auto-close, since caller has no access to the underlying\n * input stream created from the File\n */\n return createSR(f, false, true);\n }"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// SetBlocks sets the Blocks field's value. | [
"func (s *GetDocumentAnalysisOutput) SetBlocks(v []*Block) *GetDocumentAnalysisOutput {\n\ts.Blocks = 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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Eval locale from language string
@param language
@return new Locale constructed from the language | [
"public static Locale locale(String language) {\n if (language.contains(\"_\")) {\n String[] sa = language.split(\"_\");\n if (sa.length > 2) {\n return new Locale(sa[0], sa[1], sa[2]);\n } else if (sa.length > 1) {\n return new Locale(sa[0], sa[... | [
"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:"
} |
Returns frequent item sets only.
@param mixed[][] $samples
@return mixed[][] | [
"private function frequent(array $samples): array\n {\n return array_values(array_filter($samples, function ($entry) {\n return $this->support($entry) >= $this->support;\n }));\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Method to set numeric collation to its default value.
@see #getNumericCollation
@see #setNumericCollation | [
"public void setNumericCollationDefault() {\n checkNotFrozen();\n CollationSettings defaultSettings = getDefaultSettings();\n if(settings.readOnly() == defaultSettings) { return; }\n CollationSettings ownedSettings = getOwnedSettings();\n ownedSettings.setFlagDefault(CollationSett... | [
"public Builder newCopyBuilder() {\n\t\treturn new Builder(getInputFormat(), getOutputFormat(), getActivity()).locale(getLocale()).setRequiredOptions(keys);\n\t}"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetResult sets the Result field's value. | [
"func (s *CompleteWorkflowExecutionDecisionAttributes) SetResult(v string) *CompleteWorkflowExecutionDecisionAttributes {\n\ts.Result = &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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// SetServerName sets the ServerName field's value. | [
"func (s *Endpoint) SetServerName(v string) *Endpoint {\n\ts.ServerName = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Use this API to fetch filtered set of xen_health_monitor_misc resources.
filter string should be in JSON format.eg: "vm_state:DOWN,name:[a-z]+" | [
"public static xen_health_monitor_misc[] get_filtered(nitro_service service, String filter) throws Exception\r\n\t{\r\n\t\txen_health_monitor_misc obj = new xen_health_monitor_misc();\r\n\t\toptions option = new options();\r\n\t\toption.set_filter(filter);\r\n\t\txen_health_monitor_misc[] response = (xen_health_mon... | [
"def get_object(self, group_id, mask=None):\n \n if mask is None:\n mask = \"mask[id, name, createDate, rule, backendRouter[id, hostname],\" \\\n \"guests[activeTransaction[id,transactionStatus[name,friendlyName]]]]\"\n return self.client.call('SoftLayer_Virtual_Pla... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Checks if the table exists.
Returns:
True if the table exists; False otherwise.
Raises:
Exception if there was an error requesting information about the table. | [
"def exists(self):\n \n try:\n info = self._api.tables_get(self._name_parts)\n except google.datalab.utils.RequestException as e:\n if e.status == 404:\n return False\n raise e\n except Exception as e:\n raise e\n self._info = info\n return True"
] | [
"function DataModelMigration() {\n /**\n * Gets an array that contains the definition of fields that are going to be added\n * @type {Array}\n */\n this.add = [];\n /**\n * Gets an array that contains a collection of constraints which are going to be added\n * @type {Array}\n */\n ... | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Form query filter to remove articles from category.
@param string $categoryID
@param string $prodIds
@return string | [
"protected function getRemoveCategoryArticlesQueryFilter($categoryID, $prodIds)\n {\n $db = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb();\n $where = \"where oxcatnid=\" . $db->quote($categoryID);\n\n $whereProductIdIn = \" oxobjectid in ( {$prodIds} )\";\n if (!\\OxidEsales\\E... | [
"public function delete($id)\n {\n $this->innerHandler->delete($id);\n // Delete by primary key will remove the object, so we don't need to clear `ez-language-code-` here.\n $this->cache->deleteMulti(['ez-language-' . $id, 'ez-language-list']);\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
Detect features in image | [
"function() {\n if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {\n return;\n }\n\n var _this = this,\n imageData = this.getImageData();\n\n this._waitForWorkers++;\n\n if (window.Worker) {\n // I... | [
"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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Given a uri return the qname if it exists, otherwise return the uri. | [
"def qname(self, uri, generate=False):\n \n try:\n prefix, namespace, name = self.g.namespace_manager.compute_qname(uri, generate=generate)\n qname = ':'.join((prefix, name))\n return qname\n except (KeyError, ValueError) as e:\n return uri.toPython()... | [
"def uri_from(url)\n # This will raise an InvalidURIError if the URL is very wrong. It will\n # still pass for strings like \"foo\", though.\n url = URI(url)\n\n # We need to check if the URL was either http://, https:// or ftp://,\n # because these are the only ones we can download from. o... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetSucceeded sets the Succeeded field's value. | [
"func (s *ObjectiveStatusCounters) SetSucceeded(v int64) *ObjectiveStatusCounters {\n\ts.Succeeded = &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:"
} |
// clientAlloc takes in the task states and returns an Allocation populated
// with Client specific fields | [
"func (ar *allocRunner) clientAlloc(taskStates map[string]*structs.TaskState) *structs.Allocation {\n\tar.stateLock.Lock()\n\tdefer ar.stateLock.Unlock()\n\n\t// store task states for AllocState to expose\n\tar.state.TaskStates = taskStates\n\n\ta := &structs.Allocation{\n\t\tID: ar.id,\n\t\tTaskStates: tas... | [
"@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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Deletes a given task by name. | [
"def delete_task(self, task=None):\n \n # Iterate over the list of tasks\n for t in self.grindstone['tasks']:\n # If they key of the task matches the task given\n if key_of(t) == task:\n # Remove that task\n self.grindstone['tasks'].remove(t)\... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// GetOrDefaultSecond returns the given environment variable value as an time.Duration (second).
// Returns the default if the envvar cannot be coopered to an int, or is not found. | [
"func GetOrDefaultSecond(envVar string, defaultValue time.Duration) time.Duration {\n\tv := GetOrDefaultInt(envVar, -1)\n\tif v < 0 {\n\t\treturn defaultValue\n\t}\n\n\treturn time.Duration(v) * time.Second\n}"
] | [
"def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Check if fields are valid
@param array $fields
@throws InvalidArgumentException | [
"private function assertValidFields($fields)\n {\n if(!isset($fields)) {\n throw new InvalidArgumentException(\"Fields are empty\");\n }\n\n foreach($fields as $field) {\n if(count(explode('.', $field['key'])) != 2) {\n throw new InvalidArgumentException(... | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Get raw message headers.
@return string | [
"public function getRawHeaders(): string\n {\n if (null === $this->rawHeaders) {\n $rawHeaders = \\imap_fetchheader($this->resource->getStream(), $this->getNumber(), \\FT_UID);\n\n if (false === $rawHeaders) {\n throw new ImapFetchheaderException('imap_fetchheader fail... | [
"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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Initialize SecondaryNameNode. | [
"private void initialize(Configuration conf) throws IOException {\n // initiate Java VM metrics\n JvmMetrics.init(\"SecondaryNameNode\", conf.get(\"session.id\"));\n \n // Create connection to the namenode.\n shouldRun = true;\n nameNodeAddr = NameNode.getClientProtocolAddress(conf);\n\n this.c... | [
"@Override\n public void performFileBasedAction(Collection<File> files) {\n Tr.audit(tc, \"LTPA_KEYS_TO_LOAD\", keyImportFile);\n submitTaskToCreateLTPAKeys();\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software Development:"
} |
Get the name of the custom vendor folder as set in `composer.json`.
@return string|false Name of the custom vendor folder or false if none. | [
"protected function get_custom_vendor_folder() {\n\t\t$maybe_composer_json = WP_CLI_ROOT . '/../../../composer.json';\n\t\tif ( ! is_readable( $maybe_composer_json ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$composer = json_decode( file_get_contents( $maybe_composer_json ) );\n\n\t\tif ( ! empty( $composer->config )\... | [
"public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key.... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// NewSetFontSizesArgs initializes SetFontSizesArgs with the required arguments. | [
"func NewSetFontSizesArgs(fontSizes FontSizes) *SetFontSizesArgs {\n\targs := new(SetFontSizesArgs)\n\targs.FontSizes = fontSizes\n\treturn 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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Detect the application's current environment.
@param array|string $environments
@param array|null $consoleArgs
@return string | [
"public function detect($environments, $consoleArgs = null)\n {\n if ($consoleArgs && $env = $this->detectConsoleEnvironment($environments, $consoleArgs)) {\n return $env;\n } elseif ($env = $this->detectClosureEnvironment($environments)) {\n return $env;\n } elseif ($e... | [
"public function help()\n {\n $style = new Eurekon\\Style(' *** RUN - HELP ***');\n Eurekon\\Out::std($style->color('fg', Eurekon\\Style::COLOR_GREEN)->get());\n Eurekon\\Out::std('');\n\n $help = new Eurekon\\Help('...', true);\n $help->addArgument('', 'directory', 'Config dir... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about NLP:"
} |
Generate a mock class and return the source code.
@param MockDefinition $definition The definition.
@param string $className The class name.
@return string The source code. | [
"public function generate(\n MockDefinition $definition,\n string $className = ''\n ): string {\n if ('' === $className) {\n $className = $this->generateClassName($definition);\n }\n\n $source = $this->generateHeader($definition, $className) .\n $this->gen... | [
"public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key.... | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
stack up the middleware.
converts normal Application into middleware.
@param ApplicationInterface $handler
@return $this | [
"public function push($handler)\n {\n if (!$handler) {\n return $this;\n }\n if ($this->next) {\n return $this->next->push($handler);\n }\n if (!$handler instanceof MiddlewareInterface) {\n $handler = new Middleware($handler);\n }\n ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
CANVAS //
FUNCTION: Canvas( figure )
Canvas constructor. Creates a new canvas instance.
@constructor
@param {object} figure - parent figure instance
@returns {object} canvas instance | [
"function Canvas( figure ) {\n\n\t// INSTANCE ATTRIBUTES //\n\n\tthis._parent = figure;\n\tthis._root = undefined;\n\tthis._children = {};\n\tthis._config = {\n\t\t'width': 500,\n\t\t'height': 500,\n\t\t\"background\": false\n\t};\n\n\t// REGISTER //\n\tif ( figure._config.hasOwnProperty( 'canvas' ) ) {\n\t\tfigur... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Handles setting pages that are always to be revalidated for freshness by any cache.
@param int $last_modified Timestamp in seconds | [
"public static function exitIfNotModifiedSince($last_modified)\n {\n if (self::isModified($last_modified)) {\n self::sendNotModified();\n exit(0);\n }\n\n $last_modified = gmdate('D, d M Y H:i:s', $last_modified) . ' GMT';\n header(\"Cache-Control: must-revalidat... | [
"def handleHeader(self, key, value):\n \"\"\n key_lower = key.lower()\n if key_lower == 'location':\n value = self.modLocationPort(value)\n self._response.headers[key_lower] = value\n if key_lower != 'cache-control':\n # This causes us to not pass on the 'cac... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Displays the voxels and the control points. | [
"def render(self, **kwargs):\n \n # Calling parent function\n super(VisVoxel, self).render(**kwargs)\n\n # Initialize variables\n legend_proxy = []\n legend_names = []\n\n # Start plotting of the surface and the control points grid\n fig = plt.figure(figsize=s... | [
"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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Parses POST data into array of JSON-PRC batch requests
@return array
@throws \yii\web\BadRequestHttpException | [
"protected function getRequestArray()\n {\n $requestArray = Yii::$app->request->getBodyParams();\n if (!is_array($requestArray)) {\n throw new \\yii\\web\\BadRequestHttpException('Invalid JSON-RPC request.');\n }\n\n if (!ArrayHelper::isIndexed($requestArray)) {\n ... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
// Equal tests for the equality of two Bloom filters | [
"func (f *BloomFilter) Equal(g *BloomFilter) bool {\n\treturn f.m == g.m && f.k == g.k && f.b.Equal(g.b)\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns a list of statements of the given method. Modifications to the returned list
will affect the method's statements.
@param method a method (node)
@return a list of statements of the given method | [
"@SuppressWarnings(\"unchecked\")\n public static List<Statement> getStatements(MethodNode method) {\n Statement code = method.getCode();\n if (!(code instanceof BlockStatement)) { // null or single statement\n BlockStatement block = new BlockStatement();\n if (code != null) block.addStatement(code... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github description about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code:"
} |
Temporarily borrow a user's credentials to run an opportunistic user data refresh
@param username
@param password | [
"public synchronized void opportunisticallyRefreshUserData(final String username, final String password)\n\t{\n\t\tif (shouldOpportunisticallyRefreshUserData())\n\t\t{\n\t\t\tthis.lastOpportunisticUserDataRefresh = System.currentTimeMillis();\n\t\t\tThread thread = new Thread(() -> refreshAllUserData(ldap.parseUser... | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
Handles outgoing packets. | [
"private function handleSend()\n {\n $flow = null;\n if ($this->writtenFlow !== null) {\n $flow = $this->writtenFlow;\n $this->writtenFlow = null;\n }\n\n if (count($this->sendingFlows) > 0) {\n $this->writtenFlow = array_shift($this->sendingFlows);\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 sentence about Web development:",
"pos": "Represent the Github code about Web development:",
"neg": "Represent the Github code:"
} |
// Handle processes a container to pair (exchange keys) with an accessory. | [
"func (setup *SetupClientController) Handle(in util.Container) (util.Container, error) {\n\tmethod := PairMethodType(in.GetByte(TagPairingMethod))\n\n\t// It is valid that method is not sent\n\t// If method is sent then it must be 0x00\n\tif method != PairingMethodDefault {\n\t\treturn nil, errInvalidPairMethod(met... | [
"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 sentence about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code about programming:"
} |
Removes a DOM node out of the original DOM
@param {Node} node The node to remove
@param {Node} parentNode The nodes parent
@param {Boolean} skipKeyedNodes If true then elements with keys will be skipped and not discarded.
@return {undefined} | [
"function removeNode(node, parentNode, skipKeyedNodes) {\n if (onBeforeNodeDiscarded(node) === false) {\n return;\n }\n\n if (parentNode) {\n parentNode.removeChild(node);\n }\n\n onNodeDiscarded(node);\n walkDiscardedCh... | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Fill the types by the passed ([$type] => ['ext1','ext2'].
@param array
@return self | [
"public function fillByArray(array $types)\n {\n foreach ($types as $mimeType => $extensions) {\n $this->extensionsByType[$mimeType] = $extensions;\n foreach ($extensions as $extension) {\n $this->typeByExtension[$extension] = $mimeType;\n }\n }\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 PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
Return the length of this message in byte. | [
"def get_byte_length(self, decoded=True) -> int:\n \n end = len(self.decoded_bits) if decoded else len(self.__plain_bits)\n end = self.convert_index(end, 0, 2, decoded=decoded)[0]\n return int(end)"
] | [
"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 post about 32-bit integers:",
"pos": "Represent the Github code about 32-bit integers:",
"neg": "Represent the Github code:"
} |
{@inheritDoc}
<p/>
<p>This version also clamps the scrolling to the bounds of our child. | [
"public void scrollTo(int x, int y) {\n // we rely on the fact the View.scrollBy calls scrollTo.\n if (getChildCount() > 0) {\n View child = getChildAt(0);\n x = clamp(x, getWidth() - getPaddingRight() - getPaddingLeft(), child.getWidth());\n y = clamp(y, getHeight() -... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description about writing:",
"pos": "Represent the Github code about writing:",
"neg": "Represent the Github code:"
} |
Used internally.
Cleans up the sched references in the proactor. If you use this don't use
it while the :class:`Scheduler` (:func:`run`) is still running. | [
"def cleanup(self):\r\n \r\n\r\n if hasattr(self, 'proactor'):\r\n if hasattr(self.proactor, 'scheduler'):\r\n del self.proactor.scheduler\r\n if hasattr(self.proactor, 'close'):\r\n self.proactor.close()"
] | [
"def push(self):\r\n \"\"\"\"\"\"\r\n print `request.body`\r\n yield request.environ['cogen.call'](pubsub.publish)(\r\n \"%s: %s\" % (session['client'].name, request.body)\r\n )\r\n # the request.environ['cogen.*'] objects are the the asynchronous\r\n # make the ... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Technology:"
} |
Sends a controll command to server and returns servers response.
@throws ClientException
@param string $command
@return string | [
"public function sendCommand(string $command) : string\n {\n try {\n $this->socket->send(json_encode([\n 'action' => 'command',\n 'command' => [\n 'name' => $command,\n ]\n ]));\n $result = $this->socket->recv... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Programming:"
} |
Count Message
@return int | [
"public function countMessages()\n {\n $count = 0; // \"Declare\" variable before first usage.\n $octets = 0; // \"Declare\" variable since it's passed by reference\n $this->_protocol->status($count, $octets);\n return (int)$count;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code:"
} |
Gets the metadata for the current request
@return the request metadata | [
"public static RequestMetadata getRequestMetadata() {\n RequestMetadata metadata = threadLocal.get();\n if (metadata == null)\n metadata = getNoMetadata();\n return metadata;\n }"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the sentence about Metadata management:",
"pos": "Represent the code about Metadata management:",
"neg": "Represent the code about Programming:"
} |
%prog translate cdsfasta
Translate CDS to proteins. The tricky thing is that sometimes the CDS
represents a partial gene, therefore disrupting the frame of the protein.
Check all three frames to get a valid translation. | [
"def translate(args):\n \n transl_tables = [str(x) for x in xrange(1,25)]\n p = OptionParser(translate.__doc__)\n p.add_option(\"--ids\", default=False, action=\"store_true\",\n help=\"Create .ids file with the complete/partial/gaps \"\n \"label [default: %default]\"... | [
"def guess_fill_char( left_comp, right_comp ):\n \n # No left component, obiously new\n return \"*\"\n # First check that the blocks have the same src (not just species) and \n # orientation\n if ( left_comp.src == right_comp.src and left_comp.strand != right_comp.strand ): \n # Are they co... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) IPCIAddresssetBus(request *IPCIAddresssetBus) (*IPCIAddresssetBusResponse, error) {\n\tresponse := new(IPCIAddresssetBusResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response, nil\n}"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Get the raw $_POST value of a field
@return string | [
"public function getRawValue()\n\t{\n\t\t$name = $this->name;\n\t\treturn !empty($_POST[$name]) ? $_POST[$name] : null;\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 instruction about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
Auto Generated Code | [
"def get_vnetwork_portgroups_input_vcenter(self, **kwargs):\n \n config = ET.Element(\"config\")\n get_vnetwork_portgroups = ET.Element(\"get_vnetwork_portgroups\")\n config = get_vnetwork_portgroups\n input = ET.SubElement(get_vnetwork_portgroups, \"input\")\n vcenter = ET... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the instruction about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about File management:"
} |
// SetMaxResults sets the MaxResults field's value. | [
"func (s *ListFragmentsInput) SetMaxResults(v int64) *ListFragmentsInput {\n\ts.MaxResults = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// cmpAsc returns wehther the given priority level is higher than the
// current priority level based on descending order. | [
"func (pq *PriorityQueue) cmpDesc(priority uint8) bool {\n\treturn pq.order == DESC && priority > pq.curLevel\n}"
] | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Check if cmap is one of the colorbrewer maps | [
"def check_colormap(cmap):\n \n names = set(['BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',\n 'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu',\n 'PuBuGn', 'PuRd', 'Purples', 'RdPu', 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Is reallocation of the msg required on its postcommit callback
@return boolean | [
"public boolean isReallocationRequired()\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n {\n SibTr.entry(this, tc, \"isReallocationRequired\");\n SibTr.exit(tc, \"isReallocationRequired\", Boolean.valueOf(reallocateOnCommit));\n }\n\n return reallocateOnCommit;\n }"
... | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Get the {@link DataSource} that hosts the specified {@link Connection}.
@param conn
@return
@since 0.8.2 | [
"public static DataSource getDataSource(Connection conn) {\n if (conn == null) {\n return null;\n }\n String dsName = openConnDsName.get().get(conn);\n return getJdbcDataSource(dsName);\n }"
] | [
"@Override\n public final EJSWrapperCommon getWrapper(BeanId id) // f111627\n throws CSIException,\n RemoteException\n {\n homeEnabled();\n return wrapperManager.getWrapper(id); // d156807.1\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Get the specified path to the files.
@return string|null | [
"protected function getPath(): ?string\n {\n $path = $this->input->getOption('path');\n\n // First we will check for an explicitly specified path from the user. If one\n // exists we will use that as the path to the assets. This allows the free\n // storage of assets wherever is best ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Sets up live server, and then loops over handling http requests. | [
"def run(self):\n \n try:\n # Go through the list of possible ports, hoping we can find\n # one that is free to use for the WSGI server.\n for index, port in enumerate(self.possible_ports):\n try:\n self.httpd = self._create_server(por... | [
"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 Web development:",
"pos": "Represent the Github code about Web development:",
"neg": "Represent the Github code about programming:"
} |
Finds covering matches from the remainder. | [
"private List<Filter<S>> findCoveringMatches() {\r\n List<Filter<S>> coveringFilters = null;\r\n\r\n boolean check = !mRemainderFilters.isEmpty()\r\n && (mIdentityFilters.size() > 0\r\n || mRangeStartFilters.size() > 0 \r\n || mRangeEndFilters.size() > 0);\r\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.EAG__AEG_NAME:\n\t\t\t\tsetAEGName(AEG_NAME_EDEFAULT);\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the Github description about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
计算<tt>str</tt>长度,如果<tt>str</tt>中包含中文字符,中文字符按两个字符算
@param str | [
"public static int length(String str) {\n\t\tif (StringUtils.isEmpty(str))\n\t\t\treturn 0;\n\t\tstr = str.replaceAll(\"([\\u4e00-\\u9fa5]|[,¥!?%&@#^。“”;《》‘’|【】—…·+-×、()])\", \" \");\n\t\treturn str.length();\n\t}"
] | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the Github comment about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about text processing:"
} |
Servicio que parsea el fichero de log seleccionado
@param string|null $selectedLog
@return array | [
"public function formatLogFile($selectedLog)\n {\n $monthOpen = null;\n $files = new Finder();\n $files->files()->in(LOG_DIR)->name($selectedLog);\n $file = $match = null;\n $log = array();\n foreach($files as $item) {\n $file = $item;\n $match = $i... | [
"private function init(){\n //Load Archivos de Funciones\n $this->loadFunctionsFiles();\n //Instancio el sistema de Cache\n $this->cache= new Support\\Cache\\Cache();\n //EnolaContext->init(): Cargo las configuraciones de contexto faltante\n $this->context->init();\n ... | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
@param string $setting
@param array $data
@return array | [
"private function get_detail_setting( $setting, $data ) {\n\t\t$data['key'] = $setting;\n\t\t$type = $this->app->utility->array_get( $data, 'type', '' );\n\t\t$default = $this->app->utility->array_get( $data, 'default', '' );\n\t\tif ( is_callable( $default ) ) {\n\t\t\t$default = $default( $this->app );... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
returns the population variance of a set of numbers after discarding the nulls in this set.
@param expr argument
@return var_pop(expr) | [
"public static <T extends Number> WindowOver<T> varPop(Expression<T> expr) {\n return new WindowOver<T>(expr.getType(), SQLOps.VARPOP, expr);\n }"
] | [
"def BIF_templates(self):\n \n network_template = Template('network $name {\\n}\\n')\n # property tag may or may not be present in model,and since no of properties\n # can be more than one , will replace them accoriding to format otherwise null\n variable_template = Template(\"\"\... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
You have to pass in true to confirm you really want to do it
@param bool $sure
@return Database
@throws \InvalidArgumentException
@throws DoctrineStaticMetaException | [
"public function drop($sure): Database\n {\n if (true !== $sure) {\n $this->throwUnsure();\n }\n $link = $this->connect();\n $sql = \"DROP DATABASE IF EXISTS `{$this->config->get(ConfigInterface::PARAM_DB_NAME)}`\";\n if (true !== mysqli_query($link, $sql)) {\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 comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Sort variables before extracting data from uri.
We have to sort vars by non-explode to explode.
@param array $vars
@return array | [
"protected function sortVariables(array $vars)\n {\n usort($vars, function($a, $b) {\n return $a->options['modifier'] >= $b->options['modifier'] ? 1 : -1;\n });\n\n return $vars;\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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Takes the properties supplied and updates the dependency-check settings.
Additionally, this sets the system properties required to change the
proxy server, port, and connection timeout.
@throws BuildException thrown when an invalid setting is configured. | [
"@Override\n protected void populateSettings() throws BuildException {\n super.populateSettings();\n getSettings().setBooleanIfNotNull(Settings.KEYS.AUTO_UPDATE, autoUpdate);\n getSettings().setArrayIfNotEmpty(Settings.KEYS.SUPPRESSION_FILE, suppressionFiles);\n getSettings().setStrin... | [
"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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
获取token,当操作有权限的行为时,需要token | [
"private function get_token(){\n\n if(self::$token==null){\n $config = $this->get_config();\n $file = $config['TOKEN_PATH'];\n if( Storage::disk()->exists($file) && TIMESTAMP - ( $createTime = Storage::disk()->lastModified($file) ) <= 7200 ){\n $token = Storage... | [
"protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
/* @Override
protected int defStyleAttr() {
return R.attr.decorTypefaceAsset;
} | [
"@Override\n protected void apply(TextView view, TypedArray typedArray) {\n String typefacePath = typedArray.getString(R.styleable.FontDecorator_decorTypefaceAsset);\n if(typefacePath == null) return;\n view.setTypeface(Typeface.createFromAsset(\n view.getResources().getAssets... | [
"private void obtainShowButtonBar() {\n boolean showButtonBar = ThemeUtil.getBoolean(this, R.attr.showButtonBar, false);\n showButtonBar(showButtonBar);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
used to collect json objects that are sent by the js-side of the application by using the send() method | [
"def handle_aladin_event(self, _, content, buffers):\n \n if content.get('event', '').startswith('callback'):\n if content.get('type') == 'objectHovered':\n result= self.listener_callback_source_hover(content.get('data'))\n elif content.get('type') == 'objectClicke... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@inheritdoc
Additionally, tracks attached behaviors to allow iterating over them. | [
"public function detachBehavior($name)\n {\n if (isset($this->_behaviors[$name])) {\n unset($this->_behaviors[$name]);\n }\n unset(self::$_names[get_class($this)]);\n\n return parent::detachBehavior($name);\n }"
] | [
"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 Github summarization about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
Get the instantiated object for this job that will be performing work.
@return object Instance of the object that this job belongs to. | [
"public function getInstance()\n\t{\n\t\tif (!is_null($this->instance)) {\n\t\t\treturn $this->instance;\n\t\t}\n\n\t\tif (class_exists('Resque_Job_Creator')) {\n\t\t\t$this->instance = Resque_Job_Creator::createJob($this->payload['class'], $this->getArguments());\n\t\t} else {\n\t\t\tif(!class_exists($this->payloa... | [
"def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param View $view
@return void
@internal | [
"public function process(View $view): void\n {\n if ($this->request === null) {\n throw new MissingRequestException('Cannot process a view without a request set. This method should be called from the callback passed to Pipeline::withRequest');\n }\n\n call_user_func($this->middlew... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// sendGenMsg sends a /b_gen command. | [
"func (buffer *Buffer) sendGenMsg(routine string, flags int, args ...float32) error {\n\tmsg := osc.Message{\n\t\tAddress: bufferGenAddress,\n\t\tArguments: osc.Arguments{\n\t\t\tosc.Int(buffer.Num),\n\t\t\tosc.String(routine),\n\t\t\tosc.Int(int32(flags)),\n\t\t},\n\t}\n\tfor _, arg := range args {\n\t\tmsg.Argume... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// GetBucketInfo - returns bucket info from one of the erasure coded set. | [
"func (s *xlSets) GetBucketInfo(ctx context.Context, bucket string) (bucketInfo BucketInfo, err error) {\n\treturn s.getHashedSet(bucket).GetBucketInfo(ctx, bucket)\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 AWS S3:",
"pos": "Represent the Github code about AWS S3:",
"neg": "Represent the Github code:"
} |
Check if the response is valid or not
@param array $validCodes
@return boolean True if it's valid, false if not | [
"public function isValid(array $validCodes = null)\n {\n if ($validCodes === null) {\n return $this->getHttpCode() === 200;\n }\n\n return in_array($this->getHttpCode(), $validCodes, true);\n }"
] | [
"protected function parseAllowCredentials(ServerRequestInterface $request) : bool\n {\n // read in the current setting\n $item = $this->settings['allowCredentials'];\n // we allow callables to be set (along with strings) so we can vary things upon requests.\n if (true === is_callable(... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about PHP:"
} |
<code>
.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata image_bounding_poly_details = 11;
</code> | [
"public com.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadataOrBuilder\n getImageBoundingPolyDetailsOrBuilder() {\n if (detailsCase_ == 11) {\n return (com.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata)\n details_;\n }\n return com.goog... | [
"def _normalize_projection(projection):\n \"\"\"\"\"\"\n if projection is not None:\n\n fields = list(projection.fields)\n\n if not fields:\n field_ref = query_pb2.StructuredQuery.FieldReference(\n field_path=\"__name__\"\n )\n ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
------------------------------------------------------ event handler | [
"private void toggle() {\n if (toggle.checked) {\n element().classList.add(\"completed\");\n } else {\n element().classList.remove(\"completed\");\n }\n repository().complete(item(), toggle.checked);\n application().update();\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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
For the given interface, get the stub implementation.
If this service has no port for the given interface,
then ServiceException is thrown. | [
"public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {\n try {\n if (com.google.api.ads.admanager.axis.v201902.ActivityGroupServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {\n com.google.api.ads.admanager.axis.v2019... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Drop all views from the database | [
"protected function dropViews()\n {\n $views = $this->db->query(\n 'SHOW FULL TABLES WHERE TABLE_TYPE LIKE \"VIEW\"',\n DbAdapter::QUERY_MODE_EXECUTE\n );\n\n foreach ($views as $view) {\n $this->db->query(\n 'DROP VIEW '.reset($view),\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Handles response after the redirect to GitHub. This response
determines if the user has allowed the this application access. If we
were then we send a POST request for the access_key used to
authenticate requests to GitHub. | [
"def _handle_response(self):\n \n _logger.debug(\"Handling response from GitHub\")\n params = {\n 'code': request.args.get('code'),\n 'client_id': self.client_id,\n 'client_secret': self.client_secret\n }\n url = self.auth_url + 'access_token'\n ... | [
"def get_entity(ent_type, **kwargs):\n '''\n \n '''\n try:\n func = 'keystoneng.{}_get'.format(ent_type)\n ent = __salt__[func](**kwargs)\n except OpenStackCloudException as e:\n # NOTE(SamYaple): If this error was something other than Forbidden we\n # reraise the issue si... | codesearchnet | {
"query": "Represent the Github post about Access control:",
"pos": "Represent the Github code about Access control:",
"neg": "Represent the Github code:"
} |
Подмешивание темы модуля в ключ кеша.
Returns a full path for a given file.
@param TemplateReferenceInterface $template A template
@return string The full path for the file | [
"protected function getCacheKey($template)\n {\n $name = $template->getLogicalName();\n\n if ($this->activeTheme) {\n $name .= '|module_theme='.$this->getLocator()->getModuleTheme().'|active_theme'.$this->activeTheme->getName();\n }\n\n return $name;\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Show a user's SSH public key from their LDAP entry. | [
"def show(config, username): # pragma: no cover\n \"\"\"\"\"\"\n client = Client()\n client.prepare_connection()\n key_api = API(client)\n for key, value in key_api.get_keys_from_ldap(username).items():\n print(value)"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Get user details of specified user.
:param str user_id: the ID of the user to get (Required)
:returns: the user object with details about the user.
:rtype: User | [
"def get_user(self, user_id):\n \n api = self._get_api(iam.AccountAdminApi)\n return User(api.get_user(user_id))"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
@param string $champion_id
@param string $locale
@param string|null $version
@return array
@throws ArgumentException
@throws SettingsException
@see getStaticChampion | [
"public static function getStaticChampionById( string $champion_id, string $locale = 'en_US', string $version = null ) : array\n\t{\n\t\t$data = self::getStaticChampions($locale, $version);\n\t\tif (isset($data['data'][$champion_id]) == false)\n\t\t\tthrow new ArgumentException('Champion with given ID was not found... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Creates a queue with the specified length as its size filled with all zeros | [
"public static GrowQueue_F32 zeros( int length ) {\n\t\tGrowQueue_F32 out = new GrowQueue_F32(length);\n\t\tout.size = length;\n\t\treturn out;\n\t}"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about File management:"
} |
// You should always use this function to get a new AuthorizeSecurityGroupEgressParams instance,
// as then you are sure you have configured all required params | [
"func (s *SecurityGroupService) NewAuthorizeSecurityGroupEgressParams() *AuthorizeSecurityGroupEgressParams {\n\tp := &AuthorizeSecurityGroupEgressParams{}\n\tp.p = make(map[string]interface{})\n\treturn p\n}"
] | [
"function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Pads the value with units to a given width.
// padUnits(14, 0.22, 2, "µs") = "0.22µs " | [
"func padUnits(width int, value float64, precision int, units string) string {\n\tformat1 := fmt.Sprintf(\"%%-%ds\", width)\n\tformat2 := fmt.Sprintf(\"%%.%df%%s\", precision)\n\treturn fmt.Sprintf(format1, fmt.Sprintf(format2, value, units))\n}"
] | [
"def check_p_equals_zero(text):\n \"\"\"\"\"\"\n err = \"psychology.p_equals_zero\"\n msg = \"Unless p really equals zero, you should use more decimal places.\"\n\n list = [\n \"p = 0.00\",\n \"p = 0.000\",\n \"p = 0.0000\",\n ]\n\n return existence_check(text, list, err, msg,... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return a Yoti Attribute.
@param ProtobufAttribute $protobufAttribute
@return null|Attribute | [
"public static function convertToYotiAttribute(ProtobufAttribute $protobufAttribute)\n {\n $yotiAttribute = null;\n\n // Application Logo can be empty, return NULL when this occurs.\n if ($protobufAttribute->getName() == ApplicationProfile::ATTR_APPLICATION_LOGO &&\n empty($protobuf... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Called while serializing a temporal proposition. It optimizes for when
the temporal proposition's interval is a {@link SimpleInterval}.
@param s an {@link ObjectOutputStream}.
@throws IOException when an error occurs during serialization. | [
"protected void writeTemporalProposition(ObjectOutputStream s)\n throws IOException {\n if (this.interval instanceof SimpleInterval) {\n long start = this.interval.getMinStart();\n long finish = this.interval.getMinFinish();\n Granularity startGran = this.interval.... | [
"NullnessPropagationTransfer setContext(@Nullable Context context) {\n // This is a best-effort check (similar to ArrayList iterators, for instance), no guarantee\n Preconditions.checkArgument(\n context == null || this.context == null,\n \"Context already set: reset after use and don't use this... | codesearchnet | {
"query": "Represent the instruction about Java programming:",
"pos": "Represent the code about Java programming:",
"neg": "Represent the code about Programming:"
} |
Load data fixtures with the passed EntityManager.
@param ObjectManager $manager | [
"public function load(ObjectManager $manager)\n {\n /**\n * @var ObjectDirector $manufacturerDirector\n */\n $manufacturerDirector = $this->getDirector('manufacturer');\n\n $manufacturer = $manufacturerDirector\n ->create()\n ->setName('manufacturer')\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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Convert_core_CSIPersistentVolumeSource_To_v1_CSIPersistentVolumeSource is an autogenerated conversion function. | [
"func Convert_core_CSIPersistentVolumeSource_To_v1_CSIPersistentVolumeSource(in *core.CSIPersistentVolumeSource, out *v1.CSIPersistentVolumeSource, s conversion.Scope) error {\n\treturn autoConvert_core_CSIPersistentVolumeSource_To_v1_CSIPersistentVolumeSource(in, out, s)\n}"
] | [
"func Convert_build_CommonSpec_To_v1_CommonSpec(in *build.CommonSpec, out *v1.CommonSpec, s conversion.Scope) error {\n\treturn autoConvert_build_CommonSpec_To_v1_CommonSpec(in, out, s)\n}"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Add the respondent name as a caclulated field to the model
@param \Gems_Model_JoinModel $model
@param string $label | [
"public static function addNameToModel(\\Gems_Model_JoinModel $model, $label)\n {\n $nameExpr[] = \"COALESCE(grs_last_name, '-')\";\n $fieldList[] = 'grs_last_name';\n if ($model->has('grs_partner_last_name')) {\n if ($model->has('grs_partner_surname_prefix')) {\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:"
} |
Delete translation by key .
@param $key
@param null $group
@param null $locale
@param null $driver
@return mixed
@throws TranslatorException | [
"public function delete($key, $group = null, $locale = null, $driver = null) {\n $driver = ! is_null($driver) ? $this->getDriver($driver) : $this->driver();\n\n return $driver->delete(\n $key, $group, $locale\n );\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 summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
Analyses $linkUri when generating a link to a route, in order to have the siteaccess part back in the URI.
@param string $linkUri
@return string The modified link URI | [
"public function analyseLink($linkUri)\n {\n // Joining slash between uriElements and actual linkUri must be present, except if $linkUri is empty or is just the slash root.\n $joiningSlash = empty($linkUri) || ($linkUri === '/') ? '' : '/';\n $linkUri = ltrim($linkUri, '/');\n // Remo... | [
"@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Register the error and exception handlers.
@return void | [
"public function register()\n {\n $level = -1;\n if (isset($this->_options['errorLevel'])) {\n $level = $this->_options['errorLevel'];\n }\n error_reporting($level);\n set_error_handler([$this, 'handleError'], $level);\n set_exception_handler([$this, 'wrapAndH... | [
"public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about N/A:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.