query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Register the event callback. | [
"protected function registerWorkerErrorCallback()\n {\n $this->swooleServer->on('WorkerError', function ($server, $workerId, $workerPid, $exitCode, $signal) {\n $this->reportWorkerError($workerId, $workerPid, $exitCode, $signal);\n\n $this->events->dispatch(new Events\\WorkerError($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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Exception Handler
Handles any Exceptions from the application. This is set as the
default exception handler for all exceptions.
@param [type] $exception [description]
@return [type] [description] | [
"public function exceptionHandler($exception)\n {\n # Set 500 error code as well as something unexpected happened\n $this->getResponse()->setStatusCode(500);\n\n # Log the exception\n $this->getLogger()->critical(\n $exception->getMessage().' in file '.$exception->getFile().' on line '.$exception-... | [
"public function shutdown()\n {\n\n // query whether or not, class has been shutdown by an unhandled error\n if ($lastError = error_get_last()) {\n // add the passed error information to the array with the errors\n $error = ErrorUtil::singleton()->fromArray($lastError);\n ... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
github ui url https://github.com/limberest/limberest-demo OR... github api contents https://api.github.com/repos/limberest/limberest-demo | [
"function(url, branch) {\r\n this.url = url;\r\n if (url.startsWith('https://api.github.com/repos/')) {\r\n this.path = url.substring(29);\r\n this.apiUrl = url;\r\n }\r\n else if (url.startsWith('https://github.com/')) {\r\n this.path = url.substring(19);\r\n this.apiUrl = 'https://api.github.com/r... | [
"def create_logstash(self, **kwargs):\n \n logstash = predix.admin.logstash.Logging(**kwargs)\n logstash.create()\n logstash.add_to_manifest(self)\n\n logging.info('Install Kibana-Me-Logs application by following GitHub instructions')\n logging.info('git clone https://githu... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Expose JPA entities as repositories.
@return module | [
"@Bean\n\tpublic JpaModule jpaModule() {\n\t\tJpaModule module = JpaModule.newServerModule(em, transactionRunner);\n\n\t\t// directly expose entity\n\t\tmodule.addRepository(JpaRepositoryConfig.builder(ScheduleEntity.class).build());\n\n\t\t// additionally expose entity as a mapped dto\n\t\tmodule.addRepository(Jpa... | [
"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 Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about File management:"
} |
// SetFilters sets the Filters field's value. | [
"func (s *ListTagOptionsInput) SetFilters(v *ListTagOptionsFilters) *ListTagOptionsInput {\n\ts.Filters = 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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(TracingConfig tracingConfig, ProtocolMarshaller protocolMarshaller) {\n\n if (tracingConfig == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(tracingConfig.getMode(), M... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// New API client instance | [
"func New(config Config) *Instance {\n\tclient := &Instance{\n\t\tconf: &config,\n\t\tclients: make(map[string]*fasthttp.HostClient),\n\t\tclientsMu: new(sync.RWMutex),\n\t\tbalancer: newRangeBalancer(),\n\t}\n\n\treturn client\n}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// Get returns a tree node given the namespace | [
"func (c *ConfigTree) Get(ns []string) Node {\n\tc.log(fmt.Sprintf(\"Get on ns (%s)\\n\", ns))\n\tretNodes := new([]Node)\n\t// Return if no root exists (no tree without a root)\n\tif c.root == nil {\n\t\tc.log(fmt.Sprintln(\"ctree: no root - returning nil\"))\n\t\treturn nil\n\t}\n\n\tif len(c.root.keys) == 0 {\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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetAwsAccountId sets the AwsAccountId field's value. | [
"func (s *AwsSecurityFinding) SetAwsAccountId(v string) *AwsSecurityFinding {\n\ts.AwsAccountId = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Push Ancestor for filter the query
@param $ancestor
@return $this
@throws \Aruberuto\Repository\Exceptions\RepositoryException | [
"public function pushAncestor($ancestor)\n {\n if (is_string($ancestor)) {\n $ancestor = new $ancestor;\n }\n if (!$ancestor instanceof AncestorCriteriaInterface) {\n throw new RepositoryException(\"Class \" . get_class($ancestor) . \" must be an instance of Aruberuto\\... | [
"public function GetTableColumnNames($tableName) {\n $this->setDbConfigList(array());\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::COLUMNNAMES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"DESCRI... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Set helper plugin manager instance
@param string|HelperPluginManager $helpers
@return View
@throws Exception\InvalidArgumentException | [
"public function setHelperPluginManager($helpers)\n {\n if (is_string($helpers)) {\n if (!class_exists($helpers)) {\n throw new Exception\\InvalidArgumentException(sprintf(\n 'Invalid helper helpers class provided (%s)',\n $helpers\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Runs command on every job in the run. | [
"def upload(self, *args, **kwargs):\n \"\"\"\"\"\"\n for job in self.jobs:\n job.upload(*args, **kwargs)"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
Normalized exception stacktrace.
@param \Throwable $e
@return array | [
"protected function getStacktrace(\\Throwable $e): array\n {\n $stacktrace = $e->getTrace();\n if (empty($stacktrace)) {\n return [];\n }\n\n //Let's let's clarify exception location\n $header = [\n 'file' => $e->getFile(),\n 'line' => $... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Finds the offset parent common to the two provided nodes
@method
@memberof Popper.Utils
@argument {Element} element1
@argument {Element} element2
@returns {Element} common offset parent | [
"function findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"st... | [
"function getPositionByKey(\n opts: Options,\n // The current value\n containerNode: Node,\n // Key of the node in desired position\n key: string\n): TablePosition {\n return TablePosition.create(opts, containerNode, key);\n}"
] | codesearchnet | {
"query": "Represent the instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
Set the value of the matrix element at column 0 and row 2.
@param m02
the new value
@return this | [
"public Matrix4x3f m02(float m02) {\n this.m02 = m02;\n properties &= ~PROPERTY_ORTHONORMAL;\n if (m02 != 0.0f)\n properties &= ~(PROPERTY_IDENTITY | PROPERTY_TRANSLATION);\n return this;\n }"
] | [
"def _initialize_b_x(self):\n \n \"\"\"\n # Get vector(s) compatible with the matrix,\n # i.e., with the same parallel layout.\n self.petsc_x, self.petsc_b = self.petsc_A.getVecs()\n\n # Set the solution vector to zeros.\n self.petsc_x.set(0)\n\n # Define the... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Mathematics:"
} |
@param $id
@param $name
@return string | [
"protected function renderHiddenInput($id, $name)\n {\n $pattern = '<input type=\"hidden\" %s%s';\n $closingBracket = $this->getInlineClosingBracket();\n\n $attributes = $this->createAttributesString(array(\n 'id' => $id,\n 'name' => $name,\n ));\n\n retu... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get a list of incoming payments from a single payment ID or list of payment IDs from a given height.
@param $payment_ids array
@param $height int
@return string | [
"public function getBulkPayments($payment_ids, $height)\n {\n $params = [\n 'payment_ids' => $payment_ids,\n 'min_block_height' => $height\n ];\n $body = [\n 'method' => 'get_bulk_payments',\n 'params' => $params\n ];\n return $this->... | [
"def fetch(self, payment_id, data={}, **kwargs):\n \"\n return super(Payment, self).fetch(payment_id, data, **kwargs)"
] | codesearchnet | {
"query": "Represent the post about API documentation:",
"pos": "Represent the code about API documentation:",
"neg": "Represent the code about programming:"
} |
------------------------------------------------------------------------------ | [
"void handleGet(\n Object value,\n MatchSpaceKey msg,\n EvalCache cache,\n Object contextValue,\n SearchResults result)\n throws MatchingException, BadMessageFormatMatchingException\n {\n if (tc.isEntryEnabled())\n tc.entry(\n this,\n cclass,\n \"handleGet\",\n ... | [
"public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col... | codesearchnet | {
"query": "Represent the Github instruction about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code about programming:"
} |
Remove the given value if it's present in the set.
@param mixed $value The value to be removed.
@return bool True if the value was present in the set, false otherwise. | [
"public function remove($value): bool\n {\n if (!isset($this->hashMap[$value])) {\n return false;\n }\n\n unset($this->hashMap[$value]);\n\n return true;\n }"
] | [
"public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxS... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Yield all the non exchange reactions in the model. | [
"def _adjustment_reactions(self):\n \"\"\"\"\"\"\n for reaction_id in self._model.reactions:\n if not self._model.is_exchange(reaction_id):\n yield reaction_id"
] | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Create a message set using the given codec.
If codec is CODEC_NONE, return a list of raw Kafka messages. Otherwise,
return a list containing a single codec-encoded message. | [
"def create_message_set(messages, codec=CODEC_NONE, key=None, compresslevel=None):\n \n if codec == CODEC_NONE:\n return [create_message(m, k) for m, k in messages]\n elif codec == CODEC_GZIP:\n return [create_gzip_message(messages, key, compresslevel)]\n elif codec == CODEC_SNAPPY:\n ... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(GetSamplingStatisticSummariesRequest getSamplingStatisticSummariesRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (getSamplingStatisticSummariesRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try ... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Logs a message to stderr. | [
"def log(self, msg, *args):\n \"\"\"\"\"\"\n if args:\n msg %= args\n click.echo(msg, file=sys.stderr)"
] | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
---------------------------------------------------------------------------- | [
"function transformShader(shaderContent, variableDict, config) {\n let match = null;\n let unrolledContents = null;\n let shaderString = shaderContent;\n\n // First do all the variable replacements\n Object.keys(variableDict).forEach((vname) => {\n const value = variableDict[vname];\n const r = new RegEx... | [
"public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col... | codesearchnet | {
"query": "Represent the instruction about language and writing:",
"pos": "Represent the code about language and writing:",
"neg": "Represent the code about programming:"
} |
@since 0.3
@param Revision $revision
@return bool success | [
"public function patrol( Revision $revision ) {\n\t\t$this->api->postRequest( new SimpleRequest(\n\t\t\t'patrol', [\n\t\t\t\t'revid' => $revision->getId(),\n\t\t\t\t'token' => $this->getTokenForRevision( $revision ),\n\t\t\t] ) );\n\t\treturn true;\n\t}"
] | [
"def setConfiguration(self, configuration):\n \n \"\"\"\n if isinstance(configuration, Configuration):\n configuration = configuration.value\n\n self.dev.set_configuration(configuration)"
] | codesearchnet | {
"query": "Represent the description about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about programming:"
} |
// Int32 returns a little endian int32 starting at current offset. | [
"func (b byteReader) Int32() int32 {\n\tb2 := b.b[b.off : b.off+4 : b.off+4]\n\tv3 := int32(b2[3])\n\tv2 := int32(b2[2])\n\tv1 := int32(b2[1])\n\tv0 := int32(b2[0])\n\treturn v0 | (v1 << 8) | (v2 << 16) | (v3 << 24)\n}"
] | [
"def read_plain_boolean(file_obj, count):\n \"\"\"\"\"\"\n # for bit packed, the count is stored shifted up. But we want to pass in a count,\n # so we shift up.\n # bit width is 1 for a single-bit boolean.\n return read_bitpacked(file_obj, count << 1, 1, logger.isEnabledFor(logging.DEBUG))"
] | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Get the sequence mapper
@return PersistenceMapper | [
"protected function getSequenceMapper() {\n if (self::$sequenceMapper == null) {\n self::$sequenceMapper = self::getMapper(self::SEQUENCE_CLASS);\n }\n return self::$sequenceMapper;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Update the specified values on the specified volume. You may specify
one or more values to update. If no values are specified as non-None,
the call is a no-op; no exception will be raised. | [
"def update(self, volume, display_name=None, display_description=None):\n \n uri = \"/%s/%s\" % (self.uri_base, utils.get_id(volume))\n param_dict = {}\n if display_name:\n param_dict[\"display_name\"] = display_name\n if display_description:\n param_dict[\"d... | [
"function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything... | codesearchnet | {
"query": "Represent the description about Software Engineering:",
"pos": "Represent the code about Software Engineering:",
"neg": "Represent the code:"
} |
Create the hard link from src file to the dest file. | [
"public boolean hardLinkTo(String src, String dst) throws IOException { \n INode dstNode = hardLinkToInternal(src, dst); \n getEditLog().logSync(false); \n if (dstNode != null && auditLog.isInfoEnabled()) { \n\t\t\tlogAuditEvent(getCurrentUGI(), Server.getRemoteIp(),\n \"hardlink\", src, dst, dst... | [
"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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Yield an IssueSnapshot for each time the issue changed status or
resolution | [
"def iter_changes(self, issue, include_resolution_changes=True):\n \n\n is_resolved = False\n\n # Find the first status change, if any\n try:\n status_changes = list(filter(\n lambda h: h.field == 'status',\n itertools.chain.from_iterable([c.items... | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// UnmarshalJSON implements json.Unmarshaler and postprocesses of ProducerTopics and VersionObj | [
"func (p *Producer) UnmarshalJSON(b []byte) error {\n\tvar r struct {\n\t\tRemoteAddress string `json:\"remote_address\"`\n\t\tHostname string `json:\"hostname\"`\n\t\tBroadcastAddress string `json:\"broadcast_address\"`\n\t\tTCPPort int `json:\"tcp_port\"`\n\t\tHTTPPort int ... | [
"public Descriptor replaceAllTopicCalls(PSequence<TopicCall<?>> topicCalls) {\n return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// List lists all of the documents in an index. The documents are returned in
// increasing ID order. | [
"func (x *Index) List(c context.Context, opts *ListOptions) *Iterator {\n\tt := &Iterator{\n\t\tc: c,\n\t\tindex: x,\n\t\tcount: -1,\n\t\tlistInclusive: true,\n\t\tmore: moreList,\n\t\tlimit: -1,\n\t}\n\tif opts != nil {\n\t\tt.listStartID = opts.StartID\n\t\tif opts.Lim... | [
"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 instruction about Agent Identity Management:",
"pos": "Represent the code about Agent Identity Management:",
"neg": "Represent the code:"
} |
//applyRingChange attempts to actually apply and persist the disk the given ring change. | [
"func (s *Server) applyRingChange(c *RingChange) error {\n\tbuilderErr, ringErr := s.rbPersistFn(c, false)\n\tif builderErr != nil {\n\t\ts.ctxlog.WithFields(log.Fields{\n\t\t\t\"path\": fmt.Sprintf(\"%s/%s.builder\", s.cfg.RingDir, s.servicename),\n\t\t\t\"ringver\": c.v,\n\t\t\t\"err\": builderErr,\n\t\t})... | [
"@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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
The actual painting function. Draws the groups.
@param paintable
A {@link RasterTile} object.
@param group
The group where the object resides in (optional).
@param context
A MapContext object, responsible for actual drawing. | [
"public void paint(Paintable paintable, Object group, MapContext context) {\n\t\tRasterTile tile = (RasterTile) paintable;\n\t\tcontext.getRasterContext().drawImage(tile.getStore().getLayer(), \n\t\t\t\ttile.getCode().toString(), tile.getUrl(), tile.getBounds(), new PictureStyle(1.0));\n\t}"
] | [
"private boolean pushLayer()\r\n {\r\n if (!requiresCompositing())\r\n return false;\r\n\r\n // Custom version of statePush() that also saves the layer\r\n canvas.saveLayerAlpha(null, clamp255(state.style.opacity), Canvas.ALL_SAVE_FLAG);\r\n\r\n // Save style state\r\n stateStack... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about language and writing:"
} |
:type entity: IqProtocolEntity | [
"def processIqRegistry(self, entity):\n \n if entity.getTag() == \"iq\":\n iq_id = entity.getId()\n if iq_id in self.iqRegistry:\n originalIq, successClbk, errorClbk = self.iqRegistry[iq_id]\n del self.iqRegistry[iq_id]\n\n if entity.g... | [
"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:"
} |
Sets the text to be displayed as a tooltip.
@param text Text to be displayed | [
"public void setText(String text) {\n // Only change if different\n if (!ValueUtils.areEqual(text, toolTip.getTipText())) {\n\n boolean wasVisible = isVisible();\n if (wasVisible) {\n setVisible(false);\n }\n\n toolTip.setTipText(text);\n\n ... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Creates a combined list of Entries using the provided mapping file, and sorts them by
first by priority, then the number of tokens in the regex.
@param mapping The path to a file of mappings
@return a sorted list of Entries | [
"private Map<String, Entry> readEntries(String mapping, boolean ignoreCase) {\n\t\tMap<String, Entry> entries = new HashMap<>();\n\n\t\ttry {\n\t\t\t// ms, 2010-10-05: try to load the file from the CLASSPATH first\n\t\t\tInputStream is = getClass().getClassLoader().getResourceAsStream(mapping);\n\t\t\t// if not fou... | [
"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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
at a res of 1280*720 | [
"private function stitchThumbs($episode, $cache_asset)\n {\n $path = $this->asset_helper->getPath($cache_asset, true);\n // calculate total number of thumbs based on length and timeinterval.\n $numberOfSprites = ceil($episode->getDuration()/$this->sprite_interval);\n //one long image,... | [
"function showIntro() {\n write(\"Welcome to the Recognizer's Sample console application!\");\n write(\"To try the recognizers enter a phrase and let us show you the different outputs for each recognizer or just type 'exit' to leave the application.\");\n write();\n write(\"Here are some examples you co... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Performs checks to see if we have everything needed to mount
sshfs filesystems.
:return: two-tuple (boolean checks_pass, list failure messages) | [
"def perform_preflight_check(self):\n \n failures = []\n if not os.access(self.mount_path_base, os.W_OK):\n msg = (\"Mount path `{path}` doesn't exist or is not writable\"\n \" by the current user.\")\n failures.append(msg.format(\n path = ... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Process as text, escape the value | [
"protected function evalTextTypeValue($record, $column, $value)\n {\n if (is_array($value) && count($value) == count($value, COUNT_RECURSIVE)) {\n $value = implode(', ', $value);\n }\n\n if (is_string($column->format) && !empty($column->format)) {\n $value = sprintf($co... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Build is part of the ModelOperation interface. | [
"func (op *RemoveOfferOperation) Build(attempt int) ([]txn.Op, error) {\n\toffer, err := op.offers.ApplicationOffer(op.offerName)\n\tif errors.IsNotFound(err) {\n\t\treturn nil, jujutxn.ErrNoOperations\n\t}\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\t// When 'force' is set on the operation, this c... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
$ANTLR start synpred7_InternalSARL | [
"public final void synpred7_InternalSARL_fragment() throws RecognitionException { \n // InternalSARL.g:7866:4: ( ( () 'for' '(' ( ( ruleSarlXLoopFormalParameter ) ) ':' ) )\n // InternalSARL.g:7866:5: ( () 'for' '(' ( ( ruleSarlXLoopFormalParameter ) ) ':' )\n {\n // InternalSARL.g:786... | [
"def visitPredicate(self, ctx: ShExDocParser.PredicateContext):\n \n self.expression.predicate = self.context.predicate_to_IRI(ctx)"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
The job is done since all it's component tasks are either
successful or have failed. | [
"@SuppressWarnings(\"deprecation\")\n private void jobCompleteUnprotected() {\n //\n // All tasks are complete, then the job is done!\n \n if(this.terminated == JobStatus.FAILED \n || this.terminated == JobStatus.KILLED) {\n terminate(this.terminated);\n }\n if (this.status.getRunStat... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Returns an item line for the coupon code discount on this order.
@return array
An item line array. | [
"protected function getCouponCodeDiscountLine()\n {\n $result = array(\n Tag::ItemNumber => $this->order['details']['BT']->coupon_code,\n Tag::Product => $this->t('discount'),\n Tag::Quantity => 1,\n Meta::UnitPriceInc => (float) $this->order['details']['BT']->c... | [
"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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Writes to the socket with appropriate locking of the
FileDescriptor.
@param b the data to be written
@param off the start offset in the data
@param len the number of bytes that are written
@exception IOException If an I/O error has occurred. | [
"private void socketWrite(byte b[], int off, int len) throws IOException {\n\n if (len <= 0 || off < 0 || off + len > b.length) {\n if (len == 0) {\n return;\n }\n throw new ArrayIndexOutOfBoundsException();\n }\n\n Object traceContext = IoTrace.s... | [
"@Override\n public int read(byte[] buffer, int offset, int length) throws IOException {\n abortIfNeeded();\n int numBytesRead;\n // If no more bytes are available, do not read any bytes into the buffer\n if(this.virtualAvailable <= 0) {\n numBytesRead = -1;\n } else... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Java programming:"
} |
Set additional claims which will be embedded in the ID token.
<p>
The argument is converted into a JSON string and passed to
{@link #setClaims(String)} method.
</p>
@param claims
Additional claims. Keys are claim names.
@return
{@code this} object. | [
"public BackchannelAuthenticationCompleteRequest setClaims(Map<String, Object> claims)\n {\n if (claims == null || claims.size() == 0)\n {\n this.claims = null;\n }\n else\n {\n setClaims(Utils.toJson(claims));\n }\n\n return this;\n }"
] | [
"@Override\n public List<FixtureResult> runFixtureScript(\n final FixtureScript fixtureScript,\n @Parameter(optionality = Optionality.OPTIONAL)\n @ParameterLayout(\n named = \"Parameters\",\n describedAs = \"Script-specific parameters (if any). The ... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Render and output dispatch table | [
"def render_table(output_dir, packages, jenv=JENV):\n \n destination_filename = output_dir + \"/com/swiftnav/sbp/client/MessageTable.java\"\n with open(destination_filename, 'w+') as f:\n print(destination_filename)\n f.write(jenv.get_template(TEMPLATE_TABLE_NAME).render(packages=packages))"
] | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns the value of a request parameter and convert to BigInteger with a default value if it is null.
@param name a String specifying the name of the parameter
@return a BigInteger representing the single value of the parameter | [
"public BigInteger getParaToBigInteger(String name,BigInteger defaultValue){\n\t\treturn this.toBigInteger(getPara(name), defaultValue);\n\t}"
] | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. | [
"func (s *UpdateClusterInput) SetPreferredMaintenanceWindow(v string) *UpdateClusterInput {\n\ts.PreferredMaintenanceWindow = &v\n\treturn s\n}"
] | [
"public final void start() {\n if (!enabled) {\n return;\n }\n\n long periodSeconds = properties.getSeconds(PERIOD_SECONDS);\n if (periodSeconds <= 0) {\n long defaultValue = Long.parseLong(PERIOD_SECONDS.getDefaultValue());\n logger.warning(\"Provided cl... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Return's the category product relations for the product with the passed SKU.
@param string $sku The product SKU to load the category relations for
@return array The category product relations for the product with the passed SKU | [
"public function findAllBySku($sku)\n {\n\n // prepare the params\n $params = array(MemberNames::SKU => $sku);\n\n // initialize the array for the category product relations\n $categoryProducts = array();\n\n // load and return the product category relation for the passed produ... | [
"function(){\n\n this.manifest = {\n apiEventType: '',\n apiModelId: '', // this is the id for this module \n routeBase: '', // this can be overwritten\n routes: [\n ],\n routeErrorMessages: {\n conditions: 'No query conditions were specified',\n query: 'Error querying for item(s): ',\... | codesearchnet | {
"query": "Represent the Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Programming:"
} |
Forceful cleanup the logs | [
"@JmxOperation(description = \"Forcefully invoke the log cleaning\")\n public void cleanLogs() {\n synchronized(lock) {\n try {\n for(Environment environment: environments.values()) {\n environment.cleanLog();\n }\n } catch(DatabaseExc... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Serialize this object into a POF stream.
@param writer POF writer to use
@throws IOException if an error occurs during serialization | [
"public void writeExternal(PofWriter writer)\n throws IOException {\n super.writeExternal(writer);\n writer.writeBinary(10, toBinary(value));\n writer.writeBoolean(11, fAllowInsert);\n writer.writeBoolean(12, fReturn);\n }"
] | [
"@Override\n public DataFrameRecord<T> getNext() throws DataCorruptionException, DurableDataLogException {\n Exceptions.checkNotClosed(this.closed, closed);\n\n try {\n while (!this.dataFrameInputStream.isClosed()) {\n try {\n if (!this.dataFrameInputStr... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Returns boolean indicating whether the custom function returns true.
@param ctx - Koa context
@param opts - unless configuration
@returns {boolean} | [
"function matchesCustom(ctx, opts) {\n if (opts.custom) {\n return opts.custom.call(ctx);\n }\n return false;\n}"
] | [
"function initCreate (args) {\n // method name is moduleNameCreate\n var methodName = `${this.name}Create`\n // method signature is moduleName.methodname\n var methodSignature = `${this.moduleName}.${methodName}`\n // capture model to pass to function\n var model = this\n // add create method t... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Returns node types by ids
@param array|string $ids
@return Collection | [
"public function getNodeTypesByIds($ids)\n {\n if (empty($ids))\n {\n return null;\n }\n\n if (is_string($ids))\n {\n $ids = json_decode($ids, true);\n }\n\n if (is_array($ids) && ! empty($ids))\n {\n $model = $this->getMode... | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Make a server request from the list of BidRequests.
@param {BidRequest[]} bidRequests A non-empty list of bid requests which should be sent to the Server.
@return ServerRequest Info describing the request to the server. | [
"function(bidRequests, bidderRequest) {\n const tags = bidRequests.map(bidToTag);\n // const zoneIds = bidRequests.map(bidToZoneId);\n // var firstBid = bidRequests[0];\n var ref = utils.getTopWindowUrl();\n const url = URL + '/multi?url=' + ref;\n // + '&callback=window.$$PREBID_GLOBAL$$.giantsRe... | [
"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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
/*
* 取得一个alert
*/ | [
"func (c *Client) GetAlert(projectName string, alertName string) (result GetProjectResult, err error) {\n\n\trequestUrl := c.GetUrl(entity, projectName, \"\")\n\trequestPath := GetRequestPath(entity, projectName, \"\")\n\trequestUrl = requestUrl + \"?alertName=\" + alertName\n\trequestPath = requestPath + \"?alertN... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param array $lines
@param int $at
@param int $lineNr
@param int $linePos
@return string | [
"protected function getErrorDetail(array $lines, $at, &$lineNr, &$linePos)\n {\n $totalLength = 0;\n $lineNr = 0;\n $linePos = 0;\n $line = '';\n\n foreach ($lines as $idx => $line) {\n $length = strlen($line);\n $totalLength += $length;\n\... | [
"protected static function parsePrintableString(&$data, &$result)\n {\n // Printable string type\n $data = self::parseCommon($data, $stringData);\n $result[] = [\n 'Printable String (' . self::$len . ')',\n $stringData, ];\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Creates an XDR Transaction object that represents this
:class:`Transaction`. | [
"def to_xdr_object(self):\n \n source_account = account_xdr_object(self.source)\n memo = self.memo.to_xdr_object()\n operations = [o.to_xdr_object() for o in self.operations]\n ext = Xdr.nullclass()\n ext.v = 0\n return Xdr.types.Transaction(source_account, self.fee,... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about Programming:"
} |
_buildParamStr
拼接参数
@param array $requestParams 请求参数
@param string $requestMethod 请求方法
@return string | [
"protected function _buildParamStr($requestParams, $requestMethod = 'POST')\n {\n $paramStr = '';\n ksort($requestParams);\n $i = 0;\n foreach ($requestParams as $key => $value) {\n if ($key == 'Signature') {\n continue;\n }\n // 排除上传文件的... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Retrieve timestring for client "now"
@returns {String} | [
"function clientNow() {\n var d = new Date();\n var offset = -1 * d.getTimezoneOffset();\n\n d.setUTCMinutes(d.getUTCMinutes() + offset);\n return d.toISOString().replace('Z', minutesToOffsetString(offset));\n}"
] | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@Given (that) a Content Type does not exist with identifier :identifier
Makes sure a content type with $identifier does not exist.
If it exists deletes it. | [
"public function ensureContentTypeDoesntExist($identifier)\n {\n $contentType = $this->loadContentTypeByIdentifier($identifier, false);\n if ($contentType) {\n $this->removeContentType($contentType);\n }\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 Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about PHP programming:"
} |
This method does maintenance of updates within | [
"protected synchronized void maintenance() {\n // first of all we're checking, if all consumers were already registered. if not - just no-op.\n if (positions.size() < expectedConsumers) {\n log.trace(\"Skipping maintanance due to not all expected consumers shown up: [{}] vs [{}]\", position... | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get function from module
:param func_name: function name
:param module_pathname: pathname to module
:return: | [
"def get_func(func_name, module_pathname):\n \n\n if sys.version_info[0] >= 3:\n if sys.version_info[1] >= 6:\n import importlib.util\n spec = importlib.util.spec_from_file_location('module_name', module_pathname)\n cells_module = importlib.util.module_from_spec(spec)\n... | [
"def config_ctx(func):\n \n # Create ConfigurationContext subclass\n class _ConfigurationContext(ConfigurationContext):\n # Set command name for the context class\n cmd = func.__name__\n\n # Set function name for the context class\n fun = func.__name__\n\n # Store the created... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Close closes the GroupReader by closing the cursor file. | [
"func (gr *GroupReader) Close() error {\n\tgr.mtx.Lock()\n\tdefer gr.mtx.Unlock()\n\n\tif gr.curReader != nil {\n\t\terr := gr.curFile.Close()\n\t\tgr.curIndex = 0\n\t\tgr.curReader = nil\n\t\tgr.curFile = nil\n\t\tgr.curLine = nil\n\t\treturn err\n\t}\n\treturn nil\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get dependable actions
@return array | [
"public function dependableActions()\n {\n $actions = config('dependable_actions.' . get_called_class(), []);\n $return = [];\n foreach ($actions as $action) {\n if (!$action instanceof Closure) {\n continue;\n }\n $return[] = call_user_func($... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Convert sequence of ICC s15Fixed16 to list of float. | [
"def s15f16l(s):\n \"\"\"\"\"\"\n # Note: As long as float has at least 32 bits of mantissa, all\n # values are preserved.\n n = len(s) // 4\n t = struct.unpack('>%dl' % n, s)\n return map((2**-16).__mul__, t)"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Format a response from the DropCaches call
@param response A hash map with a response
@return A ChannelBuffer object to pass on to the caller
@throws BadRequestException if the plugin has not implemented this method | [
"public ChannelBuffer formatDropCachesV1(final Map<String, String> response) {\n throw new BadRequestException(HttpResponseStatus.NOT_IMPLEMENTED, \n \"The requested API endpoint has not been implemented\", \n this.getClass().getCanonicalName() + \n \" has not implemented formatDropCachesV1\... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@param Response $response
@return array|Collection
@throws EntityNotFoundException | [
"public function makeArray(Response $response)\n {\n if (!$response->getSuccess()) {\n if ($this->asCollection) {\n return new Collection([], new Meta());\n }\n\n return [];\n }\n\n $result = $this->getResultFromResponse($response);\n\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 Github text about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Software development:"
} |
// netSynAckRetrieveState retrieves the state for SynAck packets at the network
// It relies on the source port cache for that | [
"func (d *Datapath) netSynAckRetrieveState(p *packet.Packet) (*connection.TCPConnection, error) {\n\n\tconn, err := d.sourcePortConnectionCache.GetReset(p.SourcePortHash(packet.PacketTypeNetwork), 0)\n\tif err != nil {\n\t\treturn nil, errNonPUTraffic\n\t}\n\n\treturn conn.(*connection.TCPConnection), nil\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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Generalized where function | [
"func generalizedWhere(funcName string, entries interface{}, key string, test func(interface{}) bool) (interface{}, error) {\n\tentriesVal, err := getArrayValues(funcName, entries)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tselection := make([]interface{}, 0)\n\tfor i := 0; i < entriesVal.Len(); i++ {\n\t\... | [
"@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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Add a basic where clause to the model.
@param string|array|\Closure $column
@param mixed $value
@return $this | [
"protected function modelWhere($column, $value = null)\n {\n $this->model = $this->model->where($column, $value);\n return $this;\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 post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// Handler return HTTP handler representation of this middleware | [
"func (om *ClientIDMiddleware) Handler(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tvar clientID string\n\n\t\taccessToken := om.GetAccessToken(r)\n\n\t\ttoken, err := oauth2.GetValidJWT(r, security.JWTPublicKey)\n\t\tif err != nil {\n\t\t\tlog.Err... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// Log handles the log entry | [
"func (c *Console) Log(e log.Entry) {\n\n\tvar b []byte\n\tvar lvl string\n\tvar i int\n\n\tif c.displayColor {\n\t\tcolor := c.colors[e.Level]\n\n\t\tb = append(b, e.Timestamp.Format(c.timestampFormat)...)\n\t\tb = append(b, space)\n\t\tb = append(b, color...)\n\n\t\tlvl = e.Level.String()\n\n\t\tfor i = 0; i < 6-... | [
"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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns the tag marking the position of an HTML head section.
@return string The tag marking the position of an HTML head section. | [
"function getHead(): string {\n /** @var \\yii\\web\\View|null $view */\n $view = \\Yii::$app->view;\n if (!$view || !$view->hasMethod('head')) return '';\n return $this->captureOutput([$view, 'head']);\n }"
] | [
"def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more x... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// DisableWAL sets whether WAL should be active or not.
// If true, writes will not first go to the write ahead log,
// and the write may got lost after a crash.
// Default: false | [
"func (opts *WriteOptions) DisableWAL(value bool) {\n\tC.rocksdb_writeoptions_disable_WAL(opts.c, C.int(btoi(value)))\n}"
] | [
"public void applyAndJournal(Supplier<JournalContext> context, DeleteFileEntry entry) {\n // Unlike most entries, the delete file entry must be applied *before* making the in-memory\n // change. This is because delete file and create file are performed with only a read lock on\n // the parent directory. As... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
Remove tmp prefix from file path or url. | [
"def remove_tmp_prefix_from_file_path(file_path):\n \n path, filename = os.path.split(file_path)\n return os.path.join(path, remove_tmp_prefix_from_filename(filename)).replace('\\\\', '/')"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@param Metadata $metadata
@return array | [
"protected function prepareForSending(Metadata $metadata)\n\t{\n\t\t$this->calculateGroupingHash($metadata);\n\t\t$metadataArr = array_merge($metadata->getTags(), $metadata->getMetadata());\n\n\t\t$this->setReleaseStage($metadata->getStage());\n\t\t$this->setProjectRoot($metadata->getAppRootDir());\n\t\t$this->setA... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Start monitoring the online status of a user. Returns whether or not the server supports monitoring. | [
"def monitor(self, target):\n \n if 'monitor-notify' in self._capabilities and not self.is_monitoring(target):\n yield from self.rawmsg('MONITOR', '+', target)\n self._monitoring.add(target)\n return True\n else:\n return False"
] | [
"def process_source(source)\n if source == \"00\"\n logger.warn(\"Connection has been aborted by the service provider because of an error by the service user (client side).\")\n elsif source == \"02\"\n logger.warn(\"Connection has been aborted by the service provider because of an error by ... | codesearchnet | {
"query": "Represent the Github sentence about IT infrastructure management:",
"pos": "Represent the Github code about IT infrastructure management:",
"neg": "Represent the Github code about Software development:"
} |
Emitter function for `POTUpdate` builder | [
"def _pot_update_emitter(target, source, env):\n \n from SCons.Tool.GettextCommon import _POTargetFactory\n import SCons.Util\n import SCons.Node.FS\n\n if 'XGETTEXTFROM' in env:\n xfrom = env['XGETTEXTFROM']\n else:\n return target, source\n if not SCons.Util.is_List(xfrom):\n ... | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// VerifyMerkleRootAndKBFS checks that the given merkle root is indeed a valid
// root of the keybase server's Merkle tree, and that the given KBFS root
// is included in that global root. | [
"func (c MerkleClient) VerifyMerkleRootAndKBFS(ctx context.Context, __arg VerifyMerkleRootAndKBFSArg) (err error) {\n\terr = c.Cli.Call(ctx, \"keybase.1.merkle.verifyMerkleRootAndKBFS\", []interface{}{__arg}, nil)\n\treturn\n}"
] | [
"func (h *BlockHeader) Deserialize(r io.Reader) error {\n\t// At the current time, there is no difference between the wire encoding\n\t// at protocol version 0 and the stable long-term storage format. As\n\t// a result, make use of readBlockHeader.\n\treturn readBlockHeader(r, 0, h)\n}"
] | codesearchnet | {
"query": "Represent the Github sentence about container management:",
"pos": "Represent the Github code about container management:",
"neg": "Represent the Github code about programming:"
} |
Calculates the URL to which visitor should be redirected according to
content's & visitor's language.
@param \Cake\Datasource\EntityInterface $content Content to inspect
@return string Redirection URL, empty on error | [
"protected function _calculateRedirection(EntityInterface $content)\n {\n foreach (['translation', 'parent'] as $method) {\n if ($has = $content->{$method}()) {\n return option('url_locale_prefix') ? '/' . $has->get('language') . stripLanguagePrefix($has->get('url')) : $has->get(... | [
"public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerUniversalTagAttributes();\n $this->registerTagAttribute('name', 'string', 'Specifies the name of an anchor');\n $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
Adds a table to this worksheet
:param str address: a range address eg: 'A1:D4'
:param bool has_headers: if the range address includes headers or not
:return: a Table instance | [
"def add_table(self, address, has_headers):\n \n if address is None:\n return None\n params = {\n 'address': address,\n 'hasHeaders': has_headers\n }\n url = self.build_url(self._endpoints.get('add_table'))\n response = self.session.post(url... | [
"def augment_cells_no_span(self, rows, source):\n \n # TODO: Hardwired str transform.\n # 4-tuple: morerows, morecols, offset, cellblock\n # - morerows: The number of additional rows this cells spans\n # - morecols: The number of additional columns this cell spans\n # - off... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Load a metadata file.
@param string $metadataIdent A metadata file path or namespace.
@return MetadataInterface | [
"protected function loadMetadata($metadataIdent)\n {\n $metadata = $this->metadataLoader()->load($metadataIdent, $this->metadataClass());\n return $metadata;\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:"
} |
Initialization of log4j <br>
<b>NOTE</b> - if log4j property file is called log4j.properties then
log4j will be configured already. | [
"private static synchronized void initializeLog4JSubSystem(String configFile)\r\n {\r\n LoggerFactory.getBootLogger().info(\"Initializing Log4J using file: '\" + configFile + \"'\");\r\n if(configFile == null || \"\".equals(configFile.trim()))\r\n {\r\n // no configuration availab... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
newline : whitespace* ("\n" | "\r" "\n"?) | [
"def parse_newline\n s0 = @current_pos\n s1 = []\n s2 = parse_whitespace\n while s2 != :failed\n s1 << s2\n s2 = parse_whitespace\n end\n s2 = match_str(\"\\n\")\n if s2 == :failed\n s2 = @current_pos\n s3 = match_str(\"\\r\")\n s2 = if s3 != :fa... | [
"def hacking_no_cr(physical_line):\n \n \"\"\"\n pos = physical_line.find('\\r')\n if pos != -1 and pos == (len(physical_line) - 2):\n return (pos, \"H903: Windows style line endings not allowed in code\")"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// InvokeStreamHandler calls the stream handler, recovering from panics as
// errors. | [
"func InvokeStreamHandler(\n\ti StreamInvokeRequest,\n) (err error) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\terr = handlePanic(Streaming, i.Logger, r, i.Stream.Request().Meta)\n\t\t}\n\t}()\n\n\treturn i.Handler.HandleStream(i.Stream)\n}"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Send the id and the name to the client.
@param client The client to send to.
@param id The id to send.
@param name The name to send.
@throws IOException In case of error. | [
"private static void writeIdAndName(ClientSocket client, int id, String name) throws IOException\n {\n // New client id\n client.getOut().writeByte(id);\n // New client name\n final byte[] data = name.getBytes(NetworkMessage.CHARSET);\n client.getOut().writeByte(data.length);\n... | [
"function Request(conn, cmd, args) {\n\n // current connection\n this.conn = conn;\n\n // command name\n this.cmd = cmd;\n\n // command arguments may be modified\n // during validation\n this.args = args;\n\n // raw command arguments, injected by the server\n this.raw = null;\n\n // server will inject thi... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Initializes the widget. | [
"public function init()\n {\n if ($this->brandLabel !== false) {\n if (!isset($this->brandLabel)) {\n $this->brandLabel = CHtml::encode(Yii::app()->name);\n }\n\n if (!isset($this->brandUrl)) {\n $this->brandUrl = Yii::app()->homeUrl;\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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Validate the plugin
Ensure we have a dispatchable.
@param mixed $plugin
@return true
@throws Exception\InvalidControllerException | [
"public function validatePlugin($plugin)\n {\n if ($plugin instanceof DispatchableInterface) {\n // we're okay\n return;\n }\n\n throw new Exception\\InvalidControllerException(sprintf(\n 'Controller of type %s is invalid; must implement Zend\\Stdlib\\Dispatc... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Returns all the resources of a particular type belonging to a subscription.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<CognitiveServicesAccountInner> object | [
"public Observable<Page<CognitiveServicesAccountInner>> listAsync() {\n return listWithServiceResponseAsync()\n .map(new Func1<ServiceResponse<Page<CognitiveServicesAccountInner>>, Page<CognitiveServicesAccountInner>>() {\n @Override\n public Page<CognitiveServicesAcc... | [
"@Help(\n help =\n \"Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed.\"\n )\n public void resume(final String idNsr) throws SDKException {\n String url = idNsr + \"/resume\";\n requestPost(url);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Intended for internal/developer use | [
"protected SDVariable gradientBackwardsMarker(String name, SDVariable x) {\n SDVariable result = f().gradientBackwardsMarker(x);\n return updateVariableNameAndReference(result, name);\n }"
] | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// GSClient returns an authenticated Google Storage client instance. | [
"func (s *Service) GSClient(c context.Context, proj types.ProjectName) (gs.Client, error) {\n\t// Get an Authenticator bound to the token scopes that we need for\n\t// authenticated Cloud Storage access.\n\ttransport, err := serverAuth.GetRPCTransport(c, serverAuth.AsProject, serverAuth.WithProject(string(proj)), s... | [
"@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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get mutable model attributes.
@param object $model Model instance.
@return array Array of attributes. | [
"private function getMutableAttributes($model)\n {\n $attrs = get_object_vars($model);\n unset($attrs[$this->key]);\n \n // remove reference attributes, if any\n if ($model instanceof ManagedModelInterface) {\n foreach (array_keys($model->getReferences()) as $ref) {\... | [
"public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
Creates a UrlWildcard object from given parameters.
@param string $sourceUrl
@param string $destinationUrl
@param bool $forward
@return \eZ\Publish\SPI\Persistence\Content\UrlWildcard | [
"public function createUrlWildcard($sourceUrl, $destinationUrl, $forward)\n {\n $urlWildcard = new UrlWildcard();\n\n $urlWildcard->destinationUrl = $this->cleanUrl($destinationUrl);\n $urlWildcard->sourceUrl = $this->cleanUrl($sourceUrl);\n $urlWildcard->forward = $forward;\n\n ... | [
"public function createUrlAlias(URLAlias $urlAlias): UIValue\\Content\\UrlAlias\n {\n return new UIValue\\Content\\UrlAlias($urlAlias);\n }"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Executes a unary call with a response {@link StreamObserver}. The {@code call} should not be
already started. After calling this method, {@code call} should no longer be used. | [
"public static <ReqT, RespT> void asyncUnaryCall(\n ClientCall<ReqT, RespT> call, ReqT req, StreamObserver<RespT> responseObserver) {\n asyncUnaryRequestCall(call, req, responseObserver, false);\n }"
] | [
"void offerData(byte[] chunk) {\n if (chunk == null || chunk.length == 0) {\n throw new IllegalArgumentException(\"chunk must have at least one byte of data\");\n }\n\n if (closed) {\n return;\n }\n\n // Since this is an unbounded queue, offer() always succeeds. In addition, we don't make a... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Wrapper of {@link String#trim()} and return FastStr type instance
@return a FastStr instance without leading and tail space characters
from this FastStr instance | [
"@Override\n public FastStr trim() {\n char[] value = this.buf;\n int len = end;\n int st = begin;\n char[] val = value; /* avoid getfield opcode */\n\n while ((st < len) && (val[st] <= ' ')) {\n st++;\n }\n while ((st < len) && (val[len - 1] <= ' ')... | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the sentence about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
Returns a named field.
You can use dot syntax to get fields from child composite fields
@todo Implement similarly to dataFieldByName() to support nested sets - or merge with dataFields()
@param string $name
@return FormField | [
"public function fieldByName($name)\n {\n if (strpos($name, '.') !== false) {\n list($name, $remainder) = explode('.', $name, 2);\n } else {\n $remainder = null;\n }\n\n foreach ($this as $child) {\n if (trim($name) == trim($child->getName()) || $name ... | [
"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 about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
routing with cron
@access private
@param $src string
@param $controller string
@param $action string
@return void
@since 3.0
@package Gcs\Framework\Core\Engine | [
"private function _routeCron($src, $controller, $action) {\n $this->request->name = '-' . $src . '_' . $controller . '_' . $action;\n $this->request->src = $src;\n $this->request->controller = $controller;\n $this->request->action = $action;\n $this->request->auth = new Auth($this... | [
"public function initialize()\n {\n //The global dispatcher\n\n //state the application is initialized;\n //register aliases as class mocks such that static calls on mock map to instance calls;\n $this->createAliasMock(\n array_merge(\n $this->aliases, [\n ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// PatchNodeCIDR patches the specified node's CIDR to the given value. | [
"func PatchNodeCIDR(c clientset.Interface, node types.NodeName, cidr string) error {\n\traw, err := json.Marshal(cidr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to json.Marshal CIDR: %v\", err)\n\t}\n\n\tpatchBytes := []byte(fmt.Sprintf(`{\"spec\":{\"podCIDR\":%s}}`, raw))\n\n\tif _, err := c.CoreV1().Node... | [
"func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Website Page Controller
@param string $path
@throws \Exception
@return \Symfony\Component\HttpFoundation\Response | [
"public function pageAction($path)\n {\n \t$parts = explode('/', $path);\n \t\n \t$result = $this->get('asf_document.page.manager')->getRepository()->findBySlug($path);\n \t\n \tif ( count($result) == 0 ) {\n \t\tthrow new NotFoundHttpException('Ooops ! Page not found.');\n \t}\n \t\n ... | [
"public function setView() {\n if (!is_string($this->action) || empty($this->action)) {\n $errMessage = 'The action value must be a string and not be empty';\n throw new \\InvalidArgumentException($errMessage, GeneralErrors::VALUE_IS_NOT_OF_EXPECTED_TYPE);\n }\n if (\\Puzz... | codesearchnet | {
"query": "Represent the Github sentence about Symfony:",
"pos": "Represent the Github code about Symfony:",
"neg": "Represent the Github code about PHP:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.