query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
commit processing data to database. | [
"protected function CommitProcessData()\n {\n TdbShopSearchFieldWeight::AddQueryBlock(false, null, null);\n $sTmp = serialize($this->aTablesToProcess);\n $aData = $this->sqlData;\n $aData['processdata'] = $sTmp;\n $this->LoadFromRow($aData);\n $this->AllowEditByAll(true)... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Check if license can be activated on a given number of production and localhost sites.
@author Vova Feldman (@svovaf)
@since 2.0.0
@param int $production_count
@param int $localhost_count
@return bool | [
"function can_activate_bulk( $production_count, $localhost_count ) {\n if ( $this->is_unlimited() ) {\n return true;\n }\n\n /**\n * For simplicity, the logic will work as following: when given X sites to activate the license on, if it's\n * po... | [
"public function run()\n {\n // Base configuration data\n // This configuration will be saved as \"global\" -- for all websites\n // and environments.\n SiteConfigSaver::set('site.sysadmin.page_title', 'System Administrator Dashboard');\n SiteConfigSaver::set('site.sysadmin.des... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
Set string value
:params value: string data
:params max_size: max possible string size | [
"def set_string(_bytearray, byte_index, value, max_size):\n \n if six.PY2:\n assert isinstance(value, (str, unicode))\n else:\n assert isinstance(value, str)\n\n size = len(value)\n # FAIL HARD WHEN trying to write too much data into PLC\n if size > max_size:\n raise ValueErro... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
The same as x[indices], but return an empty array if indices are empty,
instead of returning all x elements,
and handles sparse "vectors". | [
"def mask(x, indices):\n \n indices_shape = (\n [len(indices)] if isinstance(indices, list) else indices.shape)\n if not indices_shape[0]:\n return np.array([])\n elif is_sparse_vector(x) and len(indices_shape) == 1:\n return x[0, indices].toarray()[0]\n else:\n return x[i... | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sets fromType
@param string $fromType from_type string
@return $this | [
"public function setFromType($fromType)\n {\n $allowedValues = $this->getFromTypeAllowableValues();\n if (!in_array($fromType, $allowedValues)) {\n throw new \\InvalidArgumentException(\n sprintf(\n \"Invalid value for 'fromType', must be one of '%s'\",\... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Modify all deprecated and experimental links
@private | [
"function (oEvent) {\n\t\t\t\tvar aItems = oEvent.getSource().getItems(),\n\t\t\t\t\tiLen = aItems.length,\n\t\t\t\t\toItem;\n\n\t\t\t\twhile (iLen--) {\n\t\t\t\t\toItem = aItems[iLen];\n\t\t\t\t\t// Access control lazy loading method if available\n\t\t\t\t\tif (oItem._getLinkSender) {\n\t\t\t\t\t\tvar oCustomData ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Jumbotron::render
@return string | [
"public function render()\n {\n if ($this->attributes->hasAttributeClass('jumbotron-fluid')) {\n\n $output[] = $this->open();\n\n $container = new Element('div', 'container');\n $container->attributes->addAttributeClass('container-fluid');\n\n if ($this->hasChil... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Visitor looking for matching between current node and pattern.
If it match, save it but whatever happen, keep going. | [
"def visit(self, node):\n \n if Check(node, dict()).visit(self.pattern):\n self.result.add(node)\n self.generic_visit(node)"
] | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public void setCCPID(Integer newCCPID) {\n\t\tInteger oldCCPID = ccpid;\n\t\tccpid = newCCPID;\n\t\tif (eNotificationRequired())\n\t\t\teNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.LND__CCPID, oldCCPID, ccpid));\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 sentence about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
// NewPutEndpointID creates a new http.Handler for the put endpoint ID operation | [
"func NewPutEndpointID(ctx *middleware.Context, handler PutEndpointIDHandler) *PutEndpointID {\n\treturn &PutEndpointID{Context: ctx, Handler: handler}\n}"
] | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Checks if the required fields metadata were inserted in some other class of the hierachy.
@param DoctrineClassMetadata $classMetadata
@return bool | [
"private function hasEncryptionFieldsDoctrineMetadata(DoctrineClassMetadata $classMetadata)\n {\n $return = false;\n if (ClassMetadataInfo::INHERITANCE_TYPE_JOINED === $classMetadata->inheritanceType\n || ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE === $classMetadata->inheritanceTyp... | [
"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 summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Track the current route.
@param \Illuminate\Routing\Route $route
@return int | [
"private function trackRoute(Route $route)\n {\n return $this->getModel()->newQuery()->firstOrCreate([\n 'name' => $this->getRouteName($route),\n 'action' => $route->getActionName(),\n ])->getKey();\n }"
] | [
"public function compose(View $view)\n {\n /**\n * @var \\Carbon\\Carbon $start\n * @var \\Carbon\\Carbon $end\n * @var \\Illuminate\\Support\\Collection $range\n */\n extract(DateRange::getCurrentMonthDaysRange());\n\n $v... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// getInsertLocation determines insert location in a Section, which is the
// first blank line after a non-blank. | [
"func (s *Section) getInsertLocation(idx int) int {\n\tfor i := idx; i >= 0; i-- {\n\t\tif s.file.lines[i].item != nil {\n\t\t\treturn i + 1\n\t\t}\n\t}\n\n\treturn -1\n}"
] | [
"def check_arrange_act_spacing(self) -> typing.Generator[AAAError, None, None]:\n \n yield from self.check_block_spacing(\n LineType.arrange,\n LineType.act,\n 'AAA03 expected 1 blank line before Act block, found {}',\n )"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Browses recursively the components in order to find components with the name.
@param name the component's name.
@param components components to browse.
@return the first component with the name. | [
"protected Component lookForComponent(String name, ObservableList<Node> components) {\n for (int i = 0; i < components.size() && !mFindWithEqual; i++) {\n //String componentName = ComponentNamer.getInstance().getNameForComponent(components[c]);\n Node c = components.get(i);\n ... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get the last one of the records. | [
"def get_last(postid, limit=10):\n '''\n \n '''\n recs = TabPostHist.select().where(\n TabPostHist.post_id == postid\n ).order_by(TabPostHist.time_update.desc()).limit(limit)\n if recs.count():\n return recs.get()\n return None"
] | [
"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:"
} |
Serialize the ResponseObject. Returns a webob `Response`
object. | [
"def _serialize(self):\n \n\n # Do something appropriate if the response object is unbound\n if self._defcode is None:\n raise exceptions.UnboundResponse()\n\n # Build the response\n resp = self.response_class(request=self.req, status=self.code,\n ... | [
"def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Computer Science:"
} |
Get the Namespace root for Entity Relations
@param string $projectRootNamespace
@param array $subDirectories
@return string | [
"public function getOwningRelationsRootFqn(\n string $projectRootNamespace,\n array $subDirectories\n ): string {\n $relationsRootFqn = $projectRootNamespace\n . AbstractGenerator::ENTITY_RELATIONS_NAMESPACE . '\\\\';\n if (count($subDirectories) > 0) {\n ... | [
"protected function beforeInit()\n {\n parent::beforeInit();\n \n $this->isCli = true;\n \n // load default config\n Config::setDefault(DefaultConfig::console());\n \n // load default definition\n $this->definition = $this->getDefaultDefinition()... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Substance.Application.ElementRenderer ========================================================================== This is just a simple helper that allows us to create DOM elements in a data-driven way | [
"function(attributes) {\n this.attributes = attributes;\n\n // Pull off preserved properties from attributes\n // --------\n\n this.tagName = attributes.tag;\n this.children = attributes.children || [];\n this.text = attributes.text || \"\";\n this.html = attributes.html;\n\n delete attributes.children;\n ... | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Handle boto exception and convert to class
IO exceptions
Raises:
OSError subclasses: IO error. | [
"def _handle_client_error():\n \n try:\n yield\n\n except _ClientError as exception:\n error = exception.response['Error']\n if error['Code'] in _ERROR_CODES:\n raise _ERROR_CODES[error['Code']](error['Message'])\n raise"
] | [
"async def get_object_proxy_location(self, client, pid):\n \n try:\n return (await client.describe(pid)).get(\"DataONE-Proxy\")\n except d1_common.types.exceptions.DataONEException:\n # Workaround for older GMNs that return 500 instead of 404 for describe()\n pa... | codesearchnet | {
"query": "Represent the Github sentence about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about Computer Science:"
} |
Since it's such a different case than the other two types,
hasAndBelongsToMany gets its own method.
@param Garp_Util_Configuration $options
@return bool Success | [
"protected static function _relateHasAndBelongsToMany($options) {\n $modelA = $options['modelA'];\n $modelB = $options['modelB'];\n $keyA = $options['keyA'];\n $keyB = $options['keyB'];\n $ruleA = $options['ruleA'];\n $ruleB = $options['ruleB'];\n $bindingModel... | [
"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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
return the tileset corresponding to the specified id <br>
will throw an exception if no matching tileset is found
@name me.TMXTilesetGroup#getTilesetByGid
@public
@function
@param {Number} gid
@return {me.TMXTileset} corresponding tileset | [
"function getTilesetByGid(gid) {\n var invalidRange = -1; // clear the gid of all flip/rotation flags\n\n gid &= TMX_CLEAR_BIT_MASK; // cycle through all tilesets\n\n for (var i = 0, len = this.tilesets.length; i < len; i++) {\n // return the corresponding tileset if matching\n ... | [
"def warp_object(self, tileMapObj):\n \"\"\"\"\"\"\n print \"Collision\"\n if tileMapObj.can_warp:\n #Check to see if we need to load a different tile map\n if self.map_association != self.exitWarp.map_association:\n #Load the new tile map.\n ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Sets the parameters for the relation
@return void | [
"public function setParameters($parameters)\n {\n\t\t$this->parameters = [];\n\t\t\n\t\tif(!is_array($parameters)){\n\t\t\t$parameters = Helpers::convertStringToArray($parameters, '|');\n\t\t}\n \n foreach ($parameters as $parameter) {\n $this->parameters[] = Helpers::eliminateDupilcates... | [
"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:"
} |
Case insensitive exact match.
@param path path to find descriptor for
@return path descriptor or null if not found | [
"public ConfigPath findByPath(final String path) {\n return paths.stream()\n .filter(it -> it.getPath().equalsIgnoreCase(path))\n .findFirst()\n .orElse(null);\n }"
] | [
"def _find_combo_match(path):\n \n key_str = _form_key_str(path)\n if not key_str:\n # _form_key_str() says this isn't even a CSS/JS file.\n return None\n\n if not msettings['JOINED'].has_key(key_str):\n # No combo file match found. Must be an single file.\n return None\n ... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Renders the close button.
@return string the rendering result | [
"protected function renderCloseButton()\n {\n if ($this->closeButton !== null) {\n $tag = ArrayHelper::removeValue($this->closeButton, 'tag', 'a');\n $label = ArrayHelper::removeValue($this->closeButton, 'label', '×');\n if ($tag === 'button' && !isset($this->close... | [
"def set_form form\n raise \"Form is nil in set_form\" if form.nil?\n @form = form\n @id = form.add_widget(self) if !form.nil? and form.respond_to? :add_widget\n # 2009-10-29 15:04 use form.window, unless buffer created\n # should not use form.window so explicitly everywhere.\n # added... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// The ready method puts a worker to the end of the ready list: | [
"func s_worker_ready(self worker_t, workers []worker_t) []worker_t {\n\tfor i, worker := range workers {\n\t\tif self.id_string == worker.id_string {\n\t\t\tif i == 0 {\n\t\t\t\tworkers = workers[1:]\n\t\t\t} else if i == len(workers)-1 {\n\t\t\t\tworkers = workers[:i]\n\t\t\t} else {\n\t\t\t\tworkers = append(work... | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Convert the affiliation request to a JSON object | [
"private JsonObject affToJsonObject() {\n JsonObjectBuilder ob = Json.createObjectBuilder();\n if (client.getCAName() != null) {\n ob.add(HFCAClient.FABRIC_CA_REQPROP, client.getCAName());\n }\n if (this.updateName != null) {\n ob.add(\"name\", updateName);\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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns true if both objects are the same type and have same length property
@method sameLength | [
"function sameLength(a, b) {\n return typeof a === typeof b &&\n a && b &&\n a.length === b.length;\n }"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Loads all objects from the specified table that match the supplied
query. | [
"protected <T> ArrayList<T> loadAll (final Table<T> table,\n final String query)\n throws PersistenceException\n {\n return execute(new Operation<ArrayList<T>>() {\n public ArrayList<T> invoke (\n Connection conn, DatabaseLiaison liai... | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Converts a role object into an array for the rest service.
@param RoleInterface $role
@return array | [
"protected function convertRole(RoleInterface $role)\n {\n $roleData['id'] = $role->getId();\n $roleData['name'] = $role->getName();\n $roleData['identifier'] = $role->getIdentifier();\n $roleData['system'] = $role->getSystem();\n $roleData['permissions'] = [];\n\n $perm... | [
"@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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
A helper function that ensures that self._index is
up-to-date. If the index is older than self.INDEX_TIMEOUT,
then download it again. | [
"def _update_index(self, url=None):\n \"\"\"\"\"\"\n # Check if the index is aleady up-to-date. If so, do nothing.\n if not (self._index is None or url is not None or\n time.time()-self._index_timestamp > self.INDEX_TIMEOUT):\n return\n\n # If a URL was specified, then update our URL.\n ... | [
"def time_to_run(self, class_, time_):\n \n app_name = class_.app_name\n try:\n info = self.job_state_database[app_name]\n except KeyError:\n if time_:\n h, m = [int(x) for x in time_.split(':')]\n # only run if this hour and minute is ... | codesearchnet | {
"query": "Represent the comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Loads configuration from a YAML file.
@param [String] path
The path to the configuration file.
@return [Hash]
The loaded configuration.
@raise [InvalidConfig]
The configuration file did not contain a YAML Hash.
@since 0.4.1 | [
"def load_configuration(path)\n config = YAML.load_file(path)\n\n unless config.kind_of?(Hash)\n raise(InvalidConfig,\"DeploYML file #{path.dump} does not contain a Hash\",caller)\n end\n\n return config\n end"
] | [
"function (options) {\n _.isString(options) && (options = { mode: 'raw', raw: options });\n if (!options.mode) { return; } // need a valid mode @todo raise error?\n\n var mode = RequestBody.MODES[options.mode.toString().toLowerCase()] || RequestBody.MODES.raw,\n urlencoded = options.... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about PHP:"
} |
Load the tool consumer from the database.
@param string $key The consumer key value
@param boolean $autoEnable True if the consumer should be enabled (optional, default if false)
@return boolean True if the consumer was successfully loaded | [
"private function load($key, $autoEnable = false)\n {\n $this->initialise();\n $this->key = $key;\n $ok = $this->storage->toolConsumerLoad($this);\n if (!$ok) {\n $this->enabled = $autoEnable;\n }\n\n return $ok;\n }"
] | [
"protected function getAuthForLogin()\n {\n if ($this->useAgent()) {\n return $this->getAgent();\n }\n\n // If a \"key\" was specified in the auth credentials, we will load it into a\n // secure RSA key instance, which will be used to connect to the servers\n // in p... | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Return the cms object with the site root set to "/".
@return the cms object with the site root set to "/".
@throws CmsException thrown if initializing the root cms object fails. | [
"private CmsObject getRootCms() throws CmsException {\n\n if (null == m_rootCms) {\n m_rootCms = OpenCms.initCmsObject(m_cms);\n m_rootCms.getRequestContext().setSiteRoot(\"\");\n }\n return m_rootCms;\n }"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Language and programming:"
} |
Adds an Entry to a Section of the List.
@access public
@param mixed $entry Entry to add
@param string $section Section to add in
@return void | [
"public function addEntry( $entry, $section )\r\n\t{\r\n\t\tif( isset( $this->list[$section] ) && is_array( $this->list[$section] ) && in_array( $entry, $this->list[$section] ) )\r\n\t\t\tthrow new InvalidArgumentException( 'Entry \"'.$entry.'\" is already in Section \"'.$section.'\".' );\r\n\t\t$this->list[$sectio... | [
"protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code about Software development:"
} |
Create an express http server and return it
Config the socketio service to use this server
@api private
@return {} | [
"function startServer() {\n var server = require('http').createServer(app);\n var socket = socketio(server, {\n serveClient: true,\n path: '/socket.io-client'\n });\n // Setup SocketIO\n socketConfig(socket);\n return server;\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 Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Programming:"
} |
API ******************************************************************* | [
"public function build(): Html\n\t{\n\t\t$wrapper = Html::el();\n\t\tforeach ($this->tags as $property => $content) {\n\t\t\t$wrapper->addHtml(Html::el('meta')->addAttributes([\n\t\t\t\t'property' => $property,\n\t\t\t\t'content' => $content,\n\t\t\t]));\n\t\t}\n\n\t\treturn $wrapper;\n\t}"
] | [
"@Override\n\tpublic void toPDB(StringBuffer buf){\n\t\t// 1 2 3 4 5 6 7\n\t\t//01234567890123456789012345678901234567890123456789012345678901234567890123456789\n\t\t//HEADER COMPLEX (SERINE PROTEASE/INHIBITORS) 06-FEB-98 1A4W\n\t\t//TITLE CRYSTAL... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
// Direction computes the direction the line is pointing from A() to B().
// The units are radians from the positive x-axis.
// Range same as math.Atan2, [-Pi, Pi] | [
"func (l *Line) Direction() float64 {\n\treturn math.Atan2(l.b[1]-l.a[1], l.b[0]-l.a[0])\n}"
] | [
"@Override\n public int parity() {\n\n // create three vectors, v->u, v->w and u->x\n double[] vu = toVector(v, u);\n double[] vw = toVector(v, w);\n double[] ux = toVector(u, x);\n\n // normal vector (to compare against), the normal vector (n) looks like:\n // x n w... | codesearchnet | {
"query": "Represent the Github description about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
// Convert_v1_ImageLabel_To_build_ImageLabel is an autogenerated conversion function. | [
"func Convert_v1_ImageLabel_To_build_ImageLabel(in *v1.ImageLabel, out *build.ImageLabel, s conversion.Scope) error {\n\treturn autoConvert_v1_ImageLabel_To_build_ImageLabel(in, out, s)\n}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get the configuration options for an identifier
@param mixed An object that implements AnObjectServiceable, AnServiceIdentifier object
or valid identifier string
@param array An associative array of configuration options | [
"public static function getConfig($identifier)\n {\n $objIdentifier = self::getIdentifier($identifier);\n $strIdentifier = (string) $objIdentifier;\n\n return isset(self::$_configs[$strIdentifier]) ? self::$_configs[$strIdentifier]->toArray() : array();\n }"
] | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Get an iterator over the CSV data from the response. | [
"def _handle_response(res, delimiter):\n \"\"\"\"\"\"\n if res.status_code == 200:\n # Python 2 -- csv.reader will need bytes\n if sys.version_info[0] < 3:\n csv_io = BytesIO(res.content)\n # Python 3 -- csv.reader needs str\n else:\n csv_io = StringIO(res.tex... | [
"@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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
requires absolute path | [
"function getThemeFromPath(dir, program, cb) {\n var configPath = path.resolve(dir, \"theme.json\");\n program.log(2, constants.LOG_SEV_INFO, \"Attempting to read \" + configPath);\n fs.readFile(configPath, { encoding: 'utf-8' }, function (err, data) {\n if (err) {\n p... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
事件处理方法
@param MessageEventParam $e
@return void | [
"public function handle(MessageEventParam $e)\n {\n if(!Worker::isWorkerStartAppComplete())\n {\n $GLOBALS['WORKER_START_END_RESUME_COIDS'][] = Coroutine::getuid();\n Coroutine::suspend();\n }\n // 上下文创建\n RequestContext::create();\n RequestContext:... | [
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] | codesearchnet | {
"query": "Represent the text about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
// Connect adds a CONNECT route to the default Mux. See the documentation for
// web.Mux for more information about what types this function accepts. | [
"func Connect(pattern web.PatternType, handler web.HandlerType) {\n\tDefaultMux.Connect(pattern, handler)\n}"
] | [
"func NewHTTPCommand(stdin io.Reader, stdout, stderr io.Writer) *cobra.Command {\n\tcom, err := cobrafy.Command(http.NewMain())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcom.Use = `http`\n\tcom.Short = `listens for and indexes arbitrary JSON data in Pilosa`\n\tcom.Long = `\npdk http listens for and indexes arbitra... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Get the data as JSON data in an array format (<code>[ [scale,nanos], ...]</code>
@return a JSON formatted string containing the raw data. | [
"public String toJSONString() {\n \n String rawdata = stats.stream().sorted(Comparator.comparingInt(UStats::getIndex))\n .map(sr -> sr.toJSONString())\n .collect(Collectors.joining(\",\\n \", \"[\\n \", \"\\n ]\"));\n \n String fields = Stream.of(UStat... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Reads the result from socket and parses it
@return array|bool|null|string
@throws CException socket or data problems | [
"private function parseResponse()\n\t{\n\t\tif(($line=fgets($this->_socket))===false)\n\t\t\tthrow new CException('Failed reading data from redis connection socket.');\n\t\t$type=$line[0];\n\t\t$line=substr($line,1,-2);\n\t\tswitch($type)\n\t\t{\n\t\t\tcase '+': // Status reply\n\t\t\t\treturn true;\n\t\t\tcase '-'... | [
"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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Provides the Id in array format column-value.
False if is a new object.
@return array|bool | [
"public function identifier() {\n if (empty($this->record[$this->id_name])) {\n return FALSE;\n }\n\n return array($this->id_name => $this->record[$this->id_name]);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
helper method to switch the profiles
@param newSelection
@return true if the new selection was the current profile | [
"protected boolean switchProfiles(IProfile newSelection) {\n if (newSelection == null) {\n return false;\n }\n if (mCurrentProfile == newSelection) {\n return true;\n }\n\n if (mAlternativeProfileHeaderSwitching) {\n int prevSelection = -1;\n ... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Do indicates an expected call of Do | [
"func (mr *MockHTTPClientMockRecorder) Do(arg0 interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Do\", reflect.TypeOf((*MockHTTPClient)(nil).Do), arg0)\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Answers the span class names for the extended object.
@param DBViewports $span Optional viewports field to use instead of extended object field.
@return array | [
"public function getSpanClassNames(DBViewports $span = null)\n {\n $classes = [];\n \n if (!$span) {\n $span = $this->owner->getSpanViewports();\n }\n \n if ($span->allEqualTo('auto')) {\n \n // Add Span Prefix Only:\n \n ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Item is a parent item.
@param adapterPosition adapter position.
@return true, otherwise is false. | [
"public final boolean isParentItem(int adapterPosition) {\n int itemCount = 0;\n\n int parentCount = parentItemCount();\n for (int i = 0; i < parentCount; i++) {\n if (itemCount == adapterPosition) {\n return true;\n }\n\n itemCount += 1;\n\n ... | [
"@Override\n public Object instantiateItem(ViewGroup container, int position) {\n int itemViewType = getItemViewType(position);\n RecyclerView.ViewHolder holder = mRecycledViewPool.getRecycledView(itemViewType);\n\n if (holder == null) {\n holder = mAdapter.createViewHolder(contai... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Determine if the request should NOT be cached based on the URI query.
@param array $queryParams The query parameters to verify.
@return boolean | [
"private function isQueryExcluded(array $queryParams)\n {\n if (empty($queryParams)) {\n return false;\n }\n\n if ($this->excludedQuery === '*') {\n return true;\n }\n\n if (empty($this->excludedQuery) && !is_numeric($this->excludedQuery)) {\n r... | [
"public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
removes flash variables marked as old
@access private
@return void | [
"protected function _cleanup_flash()\n\t{\n\t\tforeach($this->flash as $key => $value)\n\t\t{\n\t\t\tif ($value['state'] === 'expire')\n\t\t\t{\n\t\t\t\tunset($this->flash[$key]);\n\t\t\t}\n\t\t}\n\t}"
] | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// RelatedKeywords implements the related.Document interface needed for fast page searches. | [
"func (p *pageMeta) RelatedKeywords(cfg related.IndexConfig) ([]related.Keyword, error) {\n\n\tv, err := p.Param(cfg.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cfg.ToKeywords(v)\n}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
//////// Provider functions /////////////
//////////////////////////////////////////
// NewProvider instantiates a StoreProvider | [
"func NewProvider() Provider {\n\tdbPath := ledgerconfig.GetPvtdataStorePath()\n\tdbProvider := leveldbhelper.NewProvider(&leveldbhelper.Conf{DBPath: dbPath})\n\treturn &provider{dbProvider: dbProvider}\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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Add CLICommand object to CLIHandler. | [
"def addopt ( opt )\r\n raise TypeError, 'Incorrectly types for option object.' unless\r\n\topt.instance_of? Cmdlib::Option\r\n\r\n @options[opt.longname.to_sym] = opt\r\n end"
] | [
"@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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Handles bulk deletions of a range of annotations (local or global) using
query string or body data
@param tsdb The TSD to which we belong
@param query The query to parse and respond to | [
"void executeBulkDelete(final TSDB tsdb, HttpQuery query) {\n try {\n final AnnotationBulkDelete delete_request;\n if (query.hasContent()) {\n delete_request = query.serializer().parseAnnotationBulkDeleteV1();\n } else {\n delete_request = parseBulkDeleteQS(query);\n }\n \n... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Mount an EBS volume
Args:
volume (str): EBS volume ID
device (str): default /dev/xvdf
mountpoint (str): default /mnt/data
fstype (str): default ext4 | [
"def mount_volume(volume, device='/dev/xvdf', mountpoint='/mnt/data', fstype='ext4'):\n '''\n \n '''\n _ec2().attach_volume(volume, _host_node()['id'], device)\n time.sleep(1)\n sudo('mkdir -p \"%s\"' % mountpoint)\n sudo('mount -t \"%s\" \"%s\" \"%s\"' % (fstype, device, mountpoint))"
] | [
"def ensure_block_device(block_device):\n '''\n \n '''\n _none = ['None', 'none', None]\n if (block_device in _none):\n error_out('prepare_storage(): Missing required input: block_device=%s.'\n % block_device)\n\n if block_device.startswith('/dev/'):\n bdev = block_d... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Searches all vertices for the first negative cycle
@return Walk
@throws UnderflowException if there's no negative cycle
@uses AlgorithmSpMooreBellmanFord::getVertices() | [
"public function getCycleNegative()\n {\n // remember vertices already visited, as they can not lead to a new cycle\n $verticesVisited = array();\n // check for all vertices\n foreach ($this->graph->getVertices()->getMap() as $vid => $vertex) {\n // skip vertices already vi... | [
"public static Weighted<Arborescence<Node>> getMaxArborescence(WeightedGraph graph, Node root) {\n // remove all edges incoming to `root`. resulting arborescence is then forced to be rooted at `root`.\n return getMaxArborescence(graph.filterEdges(not(DirectedEdge.hasDestination(root))));\n }"
] | codesearchnet | {
"query": "Represent the comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Computer Science:"
} |
Convert an iterable value to an array with consecutive integer indexes
- if the value is already an array, only its values will be returned (keys are discarded)
- if the value is traversable, all its values will be returned | [
"static function toList(iterable $iterable): array\n {\n return $iterable instanceof \\Traversable ? iterator_to_array($iterable, false) : array_values($iterable);\n }"
] | [
"function flattenList(list) {\n // Make a copy, so the original tensor is not modified.\n list = [].concat(list);\n\n // Note that i must be checked against the length of the list each time through the loop, as the\n // list is modified within the iterations.\n for (let i = 0; i < list.length; i++) {\n if (... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Validates the given key.
@param key the key to validate.
@throws IllegalArgumentException if the {@code key} is {@code null} or its length is higher than the maximum allowed
({@value #MAX_KEY_SIZE}). | [
"private static void validateKey(String key) {\n\t\tif (key == null || key.length() > MAX_KEY_SIZE) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid key - must be non null and have a length less than \" + MAX_KEY_SIZE);\n\t\t}\n\t}"
] | [
"protected function makeKeyString($key): string {\n //convert numbers to strings.\n $stringValue = (string)$key;\n $length = strlen( $stringValue );\n if( $length == 0 ){\n throw new \\Exception(\"Key values must be string values of at least 1 character. Empty strings cannot b... | codesearchnet | {
"query": "Represent the instruction about Encryption:",
"pos": "Represent the code about Encryption:",
"neg": "Represent the code about AWS S3:"
} |
public operator() (); | [
"function(z_query) {\n\t\t\t\n\t\t\t// hash query\n\t\t\tif(typeof z_query == 'object') {\n\t\t\t\treturn query_hash(z_query);\n\t\t\t}\n\t\t\t// string\n\t\t\telse if(typeof z_query == 'string') {\n\n\t\t\t\tif(z_query[0] == ':' || z_query[0] == '?') {\n\t\t\t\t\treturn qb({\n\t\t\t\t\t\tselect: '',\n\t\t\t\t\t\tw... | [
"public SystemInputDefBuilder hasIf( String name, Object value)\n {\n return\n value != null\n ? has( name, value)\n : this;\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public NotificationChain basicSetImplicitReceiver(XExpression newImplicitReceiver, NotificationChain msgs)\n\t{\n\t\tXExpression oldImplicitReceiver = implicitReceiver;\n\t\timplicitReceiver = newImplicitReceiver;\n\t\tif (eNotificationRequired())\n\t\t{\n\t\t\tENotificationImpl notification = new ENotificationImp... | [
"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 sentence about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
// NewDropsondeMarshaller instantiates a DropsondeMarshaller and logs to the
// provided logger. | [
"func NewDropsondeMarshaller(logger *gosteno.Logger) *DropsondeMarshaller {\n\tmessageCounts := make(map[events.Envelope_EventType]*uint64)\n\tfor key := range events.Envelope_EventType_name {\n\t\tvar count uint64\n\t\tmessageCounts[events.Envelope_EventType(key)] = &count\n\t}\n\treturn &DropsondeMarshaller{\n\t\... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Returns this row in {@link ArrayNode} representation.
@return this row in {@link ArrayNode} representation | [
"public JsonNode toJsonArray() {\n\t\tArrayNode node = new ObjectMapper().createArrayNode();\n\t\tfor (String value : getAll()) {\n\t\t\tnode.add(value);\n\t\t}\n\t\treturn node;\n\t}"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github comment about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about Software development:"
} |
// SetPendingCount sets the PendingCount field's value. | [
"func (s *Service) SetPendingCount(v int64) *Service {\n\ts.PendingCount = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// ListWorkItemChildren get all child work items | [
"func (r *GormWorkItemLinkRepository) ListWorkItemChildren(ctx context.Context, parentID uuid.UUID, start *int, limit *int) ([]workitem.WorkItem, int, error) {\n\tdefer goa.MeasureSince([]string{\"goa\", \"db\", \"workitemlink\", \"children\", \"query\"}, time.Now())\n\twhere := fmt.Sprintf(`\n\tid in (\n\t\tSELECT... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Method to check a field exists.
@param string $field The field name to check.
@return boolean True if exists. | [
"public function exists($field)\n {\n // Remove \\0 from begin of field name.\n if (strpos($field, \"\\0\") === 0) {\n $field = substr($field, 3);\n }\n\n return isset($this->$field);\n }"
] | [
"public function validate( $input )\n {\n // Check if passed input is an object and instance of phpillowDocument\n // at all, otherwise we can exit immediately\n if ( !is_object( $input ) ||\n !( $input instanceof phpillowDocument ) )\n {\n throw new phpillowVal... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about PHP programming:"
} |
// NewClient creates a new mdns Client that can be used to query
// for records | [
"func newClient() (*client, error) {\n\t// TODO(reddaly): At least attempt to bind to the port required in the spec.\n\t// Create a IPv4 listener\n\tuconn4, err := net.ListenUDP(\"udp4\", &net.UDPAddr{IP: net.IPv4zero, Port: 0})\n\tif err != nil {\n\t\tlog.Printf(\"[ERR] mdns: Failed to bind to udp4 port: %v\", err... | [
"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 Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Get the key performance stats for the dashboard.
@return array | [
"public function index()\n {\n return [\n 'jobsPerMinute' => app(MetricsRepository::class)->jobsProcessedPerMinute(),\n 'processes' => $this->totalProcessCount(),\n 'queueWithMaxRuntime' => app(MetricsRepository::class)->queueWithMaximumRuntime(),\n 'queueWithMa... | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
eslint-disable-next-line flowtype/no-weak-types | [
"function memoizedFunction() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var cache = cacheMap.getOrSet(options.thisNamespace ? this : method, function () {\n return {};\n });\n\n ... | [
"function es5Plugins(){\n return [\n require('babel-plugin-check-es2015-constants'),\n require('babel-plugin-transform-es2015-arrow-functions'),\n require('babel-plugin-transform-es2015-block-scoped-functions'),\n require('babel-plugin-transform-es2015-block-scoping'),\n require('babel-p... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return the minions found by looking via regular expressions | [
"def _check_pcre_minions(self, expr, greedy): # pylint: disable=unused-argument\n '''\n \n '''\n reg = re.compile(expr)\n return {'minions': [m for m in self._pki_minions() if reg.match(m)],\n 'missing': []}"
] | [
"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 Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// layerStatusFromDockerString translates a string in a Docker status
// line to a layerStatus | [
"func layerStatusFromDockerString(dockerStatus string) layerStatus {\n\tswitch dockerStatus {\n\tcase \"Pushing\":\n\t\treturn statusPushing\n\tcase \"Downloading\":\n\t\treturn statusDownloading\n\tcase \"Extracting\", \"Verifying Checksum\", \"Download complete\":\n\t\treturn statusExtracting\n\tcase \"Pull compl... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Sets up the index table based on the given list of the same size and
comparator.
@param <T> the type in use
@param list the list of points to obtain a sorted IndexTable for
@param cmp the comparator to determined the sorted order | [
"public <T> void sort(List<T> list, Comparator<T> cmp)\n {\n if(index.size() < list.size())\n for(int i = index.size(); i < list.size(); i++ )\n index.add(i);\n if(list.size() == index.size())\n Collections.sort(index, new IndexViewCompList(list, cmp));\n ... | [
"function NDDBIndex(idx, nddb) {\n // The name of the index.\n this.idx = idx;\n // Reference to the whole nddb database.\n this.nddb = nddb;\n // Map indexed-item to a position in the original database.\n this.resolve = {};\n // List of all keys in `resolve` object.... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the long_description_content_type based on the extension of the
package describe path (e.g. .txt, .rst, or .md). | [
"def get_description_type(path=PKG_DESCRIBE):\n \n _, ext = os.path.splitext(path)\n return {\n \".rst\": \"text/x-rst\",\n \".txt\": \"text/plain\",\n \".md\": \"text/markdown\",\n }[ext]"
] | [
"def pandoc_process(app, what, name, obj, options, lines):\n \"\n\n if not lines:\n return None\n\n input_format = app.config.mkdsupport_use_parser\n output_format = 'rst'\n\n # Since default encoding for sphinx.ext.autodoc is unicode and pypandoc.convert_text, which will always return a\n ... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// NewServiceRelationship creates a new Relationship based on the specified alias
// and relationship type. | [
"func NewServiceRelationship(nameAlias string, relType ServiceRelationshipType) ServiceRelationship {\n\tname, alias := NameAlias(nameAlias)\n\treturn ServiceRelationship{\n\t\tTarget: name,\n\t\tAlias: alias,\n\t\tType: relType,\n\t}\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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Command for reflection database objects | [
"def run():\n \"\"\"\"\"\"\n parser = OptionParser(\n version=__version__, description=__doc__,\n )\n\n parser.add_option(\n '-u', '--url', dest='url',\n help='Database URL (connection string)',\n )\n\n parser.add_option(\n '-r', '--render', dest='render', default='dot'... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Creates a code location URL from a class
@param codeLocationClass the class
@return A URL created from Class
@throws InvalidCodeLocation if URL creation fails | [
"public static URL codeLocationFromClass(Class<?> codeLocationClass) {\n String pathOfClass = codeLocationClass.getName().replace(\".\", \"/\") + \".class\";\n URL classResource = codeLocationClass.getClassLoader().getResource(pathOfClass);\n String codeLocationPath = removeEnd(getPathFromURL(c... | [
"def spec(self):\n \"\"\"\"\"\"\n from ambry_sources.sources import SourceSpec\n\n d = self.dict\n d['url'] = self.url\n\n # Will get the URL twice; once as ref and once as URL, but the ref is ignored\n\n return SourceSpec(**d)"
] | codesearchnet | {
"query": "Represent the Github instruction about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
Add module routes defined in config. | [
"public function addRoutes()\n {\n list($rulesBefore, $rulesAfter) = $this->collectRoutes();\n Yii::$app->urlManager->addRules($rulesBefore, false);\n Yii::$app->urlManager->addRules($rulesAfter, true);\n //echo'<pre>'.RoutesInfo::showRoutes($this->uniqueId).'</pre>';exit;\n }"
] | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// WithTimeout adds the timeout to the userinfo params | [
"func (o *UserinfoParams) WithTimeout(timeout time.Duration) *UserinfoParams {\n\to.SetTimeout(timeout)\n\treturn o\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
méthode inspirée de VisualScoreTag dans LambdaProbe/JStripe (Licence GPL) | [
"static String toBar(double percentValue) { // NOPMD\r\n\t\tfinal double myPercent = Math.max(Math.min(percentValue, 100d), 0d);\r\n\t\tfinal StringBuilder sb = new StringBuilder();\r\n\t\tfinal String body = \"<img src=''?resource=bar/rb_{0}.gif'' alt=''+'' title=''\"\r\n\t\t\t\t+ I18N.createPercentFormat().format... | [
"void writeToFile() throws IOException {\r\n\t\t// on clone le counter avant de le sérialiser pour ne pas avoir de problèmes de concurrences d'accès\r\n\t\tfinal Counter counter = this.clone();\r\n\t\t// on n'écrit pas rootCurrentContextsByThreadId en fichier\r\n\t\t// puisque ces données ne seront plus vraies dans... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Removes all the cp options where uuid = ? from the database.
@param uuid the uuid | [
"@Override\n\tpublic void removeByUuid(String uuid) {\n\t\tfor (CPOption cpOption : findByUuid(uuid, QueryUtil.ALL_POS,\n\t\t\t\tQueryUtil.ALL_POS, null)) {\n\t\t\tremove(cpOption);\n\t\t}\n\t}"
] | [
"def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})"
] | codesearchnet | {
"query": "Represent the post about Work management:",
"pos": "Represent the code about Work management:",
"neg": "Represent the code:"
} |
Parse original data with type {@link T} into model data list with type {@link L}
@param data Original data.
@param parent the parent group to hold the parsed list.
@return Parsed data list.
@since 3.0.0 | [
"public List<L> parseComponent(@Nullable C parent, @Nullable T data) {\n return mDataParser.parseComponent(data, parent, this);\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the sentence about Data parsing:",
"pos": "Represent the code about Data parsing:",
"neg": "Represent the code about Software development:"
} |
Convenience wrapper for new_param() that constructs a Param element
from an instance of a Python builtin type. See new_param() for a
description of the valid keyword arguments. | [
"def from_pyvalue(name, value, **kwargs):\n\t\n\treturn new_param(name, ligolwtypes.FromPyType[type(value)], value, **kwargs)"
] | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
{@inheritDoc}
@throws \InvalidArgumentException When the extractor can not be found. | [
"public function get(string $path, array $row): ?string\n {\n if (!array_key_exists($this->colName, $row) || (null === $row[$this->colName])) {\n return null;\n }\n $content = $this->decode($row[$this->colName]);\n $chunks = explode('.', $path);\n\n if (!array_key_e... | [
"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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Saves a data in memcached.
Supports tags.
@see \Zend_Cache_Backend_Memcached::save() | [
"public function save($data, $id, $tags = array(), $specificLifetime = false)\n {\n $result = parent::save($data, $id, array(), $specificLifetime);\n if ($tags) {\n if (!method_exists($this->_handle, 'tag_add')) {\n \\Zend_Cache::throwException('Method tag_add() is not sup... | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// ToRun transitions a pod from prepared -> run, leaves the pod locked in the run directory.
// the creator of the pod (via NewPod()) may also jump directly from preparing -> run
// This method refreshes the pod state. | [
"func (p *Pod) ToRun() error {\n\tif !p.createdByMe && !p.isPrepared {\n\t\treturn fmt.Errorf(\"bug: only prepared pods may transition to run\")\n\t}\n\n\tif p.createdByMe && !p.isPrepared && !p.isPreparing {\n\t\treturn fmt.Errorf(\"bug: only prepared or preparing pods may transition to run\")\n\t}\n\n\tif err := ... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Returns resource's Fedora URI
@param bool $standardized should the Uri be standardized (in the form
used in a triplestore) or current Fedora connection specific
@return string | [
"public function getUri(bool $standardized = false): string {\n if ($standardized) {\n return $this->fedora->standardizeUri($this->uri);\n } else {\n return $this->fedora->sanitizeUri($this->uri);\n }\n }"
] | [
"def get_docs_url(self, role, name):\n \n\n # Expand partial names to full names\n name = self.get_full_name(role, name)\n # Look up domain corresponding to role\n dom = IntersphinxInventory.roledomain[role]\n # Get the inventory entry tuple corresponding to the name\n ... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Parses a LCOV report to coverage data. | [
"async function parseReport() { // eslint-disable-line no-unused-vars\n try {\n const coverage = await promises.readFile('lcov.info', 'utf8');\n const report = Report.fromCoverage(coverage);\n console.log(`The coverage report contains ${report.records.length} records:`);\n console.log(report.toJSON());... | [
"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 Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public NotificationChain basicSetLeft(RuleElement newLeft, NotificationChain msgs)\n {\n RuleElement oldLeft = left;\n left = newLeft;\n if (eNotificationRequired())\n {\n ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SimpleAntlrPackage.UNTIL_ELEMENT__LEFT, oldLef... | [
"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:"
} |
@param string $key
@param string|array $value
@return string | [
"private static function makeParam(string $key, $value): string\n {\n if (is_array($value)) {\n $tmp = [];\n foreach ($value as $v) {\n $tmp[] = urlencode((string)$key) . '[]=' . urlencode((string)$v);\n }\n\n return implode('&', $tmp);\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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// List existing log drains for an add-on. | [
"func (s *Service) LogDrainListByAddOn(ctx context.Context, addOnIdentity string, lr *ListRange) (LogDrainListByAddOnResult, error) {\n\tvar logDrain LogDrainListByAddOnResult\n\treturn logDrain, s.Get(ctx, &logDrain, fmt.Sprintf(\"/addons/%v/log-drains\", addOnIdentity), nil, lr)\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 text about App development:",
"pos": "Represent the code about App development:",
"neg": "Represent the code about Programming:"
} |
Show customer
https://developers.taxjar.com/api/?php#get-show-a-customer
@param integer $customer_id
@return object Customer object. | [
"public function showCustomer($customer_id)\n {\n $response = $this->client->get('customers/' . $customer_id);\n return json_decode($response->getBody())->customer;\n }"
] | [
"def tempo_account_add_account(self, data=None):\n \n url = 'rest/tempo-accounts/1/account/'\n if data is None:\n return \"\"\"Please, provide data e.g.\n {name: \"12312312321\",\n key: \"1231231232\",\n lead: {name: \... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
A DSL method for defining a class that holds serialization logic.
@param [Class] klass a class that should inherit form Surrealist::Serializer
@raise ArgumentError if Surrealist::Serializer is not found in the ancestors chain | [
"def surrealize_with(klass, tag: Surrealist::VarsHelper::DEFAULT_TAG)\n if klass < Surrealist::Serializer\n Surrealist::VarsHelper.add_serializer(self, klass, tag: tag)\n instance_variable_set(VarsHelper::PARENT_VARIABLE, klass.defined_schema)\n else\n raise ArgumentError, \"#{klass} ... | [
"protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Volume set the volume for the user's current playback device.
//
// Percent is must be a value from 0 to 100 inclusive.
//
// Requires the ScopeUserModifyPlaybackState in order to modify the player state | [
"func (c *Client) Volume(percent int) error {\n\treturn c.VolumeOpt(percent, nil)\n}"
] | [
"function init(domainManager) {\n _domainManager = domainManager;\n if (!domainManager.hasDomain(\"launcher\")) {\n domainManager.registerDomain(\"launcher\", {major: 0, minor: 1});\n }\n domainManager.registerCommand(\n \"launcher\", // domain name\n \"launch\", // comma... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Send Text Message with mentions
@param peer destination peer
@param text message text
@param mentions user's mentions | [
"@ObjectiveCName(\"sendMessageWithPeer:withText:withMentions:\")\n public void sendMessage(@NotNull Peer peer, @NotNull String text, @Nullable ArrayList<Integer> mentions) {\n sendMessage(peer, text, null, mentions, false);\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github post about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about programming:"
} |
@param string | \LaravelPlus\Extension\Specs\InputSpec $pathOrSpec
@param array $in
@return \LaravelPlus\Extension\Specs\InputModel | [
"public function inputModel($pathOrSpec, array $in = null)\n {\n if (is_string($pathOrSpec)) {\n $spec = $this->make($pathOrSpec);\n }\n else {\n $spec = $pathOrSpec;\n }\n\n return new InputModel($spec, $in);\n }"
] | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
initialize consumer for simulation
:param num_of_paths: number of path
:type num_of_paths: int
:param grid: list of grid point
:type grid: list(date)
:param seed: simulation seed
:type seed: hashable | [
"def initialize(self, grid=None, num_of_paths=None, seed=None):\n \n self.num_of_paths = num_of_paths\n self.grid = grid\n self.seed = seed\n self.result = list()\n self.state = self.initial_state"
] | [
"def make_jobs():\n \n\n # set up list of arguments\n inputvec = [[3], [5], [10], [20]]\n\n # create empty job vector\n jobs = []\n\n # create job objects\n for arg in inputvec:\n # The default queue used by the Job class is all.q. You must specify\n # the `queue` keyword argument... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
<code>optional .alluxio.grpc.file.StopSyncPOptions options = 2;</code> | [
"public alluxio.grpc.StopSyncPOptions getOptions() {\n return options_ == null ? alluxio.grpc.StopSyncPOptions.getDefaultInstance() : options_;\n }"
] | [
"@java.lang.Deprecated\n public java.util.Map<java.lang.String, alluxio.grpc.InconsistentPropertyValues> getValues() {\n return getValuesMap();\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Generate the php file code
@see \Cathedral\Builder\BuilderAbstract::setupFile() | [
"protected function setupFile() {\n\t\t$this->_file->setNamespace($this->getNames()->namespace_entity);\n\t\n\t\t$this->_file->setUse('Zend\\Db\\RowGateway\\RowGatewayInterface');\n\t\t$this->_file->setUse(\"{$this->getNames()->namespace_model}\\\\{$this->getNames()->modelName}\");\n\t}"
] | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Make public file or folder private (delete public url) | [
"def unpublish(self, path):\n \"\"\"\"\"\"\n \n data = \"\"\"\n<propertyupdate xmlns=\"DAV:\">\n <remove>\n <prop>\n <public_url xmlns=\"urn:yandex:disk:meta\" />\n </prop>\n </remove>\n</propertyupdate>\n \"\"\"\n \n _check_dst_absolute(path)\n resp = s... | [
"protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Data synchronization:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.