query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Converts Doctrine mapping type name to a migration column method name | [
"public static function toMigrationMethodName($type, $columnName)\n {\n $typeMap = self::getDoctrineTypeMap();\n\n if (!in_array($type, $typeMap)) {\n throw new SystemException(sprintf('Unknown column type: %s', $type));\n }\n\n // Some Doctrine types map to multiple migrat... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
See Also: listNodesResponse()
Args:
vendorSpecific:
Returns: | [
"def listNodes(self, vendorSpecific=None):\n \n response = self.listNodesResponse(vendorSpecific)\n return self._read_dataone_type_response(response, 'NodeList')"
] | [
"def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Get the HTML content associated with the given exception.
@param \Exception $exception
@param int $code
@param \Illuminate\Http\Request $request
@return string | [
"protected function getContent(Exception $exception, $code, Request $request)\n {\n\n // Only if the debug mode is enabled, show a more verbose error message.\n if ((boolean)$this->config->get('app.debug') === true) {\n if (class_exists(Whoops::class)) {\n // If Whoops is ... | [
"protected function httpMethodNotAllowed(string $method_name) {\n\t\t$class_name = __CLASS__;\n\t\t$message = \"Method: [{$method_name}] Not Allowed in property \" . \"[\\$httpMethodNames] on class [{$class_name}]\";\n\t\t\n\t\tthrow new MethodNotAllowedException($this->httpMethodNames, $message);\n\t}"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Elevated die ParentClass um properties der Hierarchy laden zu können | [
"public function setParentClass(GClass $gClass) {\n $this->class->setParentClass($gClass);\n if ($gClass->exists()) {\n try {\n // damit die gclass vernünftig initialisiert wird\n $this->class->elevateParent();\n \n } catch (\\Psc\\Code\\Generate\\ReflectionException $e) {\n ... | [
"protected function processEntityFormRequest(Entity $entity, FormData $requestData, $revision) {\n $dataName = 'layoutManager';\n \n if (isset($requestData->$dataName) && count($requestData->$dataName) > 0) {\n $serialized = $requestData->$dataName;\n } /*else {\n throw $this->err->validationE... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Write a log entry for a Frontend or UI Request.
Args:
request: A HttpRequest protobuf.
source: Client id of the client initiating the request. Optional.
message_count: Number of messages received from the client. Optional. | [
"def LogHttpFrontendAccess(self, request, source=None, message_count=None):\n \n # TODO(user): generate event_id elsewhere and use it for all the log\n # messages that have to do with handling corresponding request.\n event_id = self.GetNewEventId()\n\n log_msg = \"%s-%s [%s]: %s %s %s %s (%d)\" % (\... | [
"def reset(self):\n \n self.getsCounter = 0\n\n # dictionary of processed requests for each client. Value for each\n # client is a dictionary with request id as key and transaction id as\n # value\n self.processedRequests = {} # type: Dict[str, Dict[int, str]]\n\n #... | codesearchnet | {
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
@param \ReflectionParameter $param
@throws Exception\RuntimeException
@return mixed | [
"protected function resolveArgumentValue(\\ReflectionParameter $param)\n {\n $paramClass = null;\n\n try {\n $paramClass = $param->getClass();\n }\n catch (\\ReflectionException $e) {\n }\n\n if (!($paramClass instanceof ReflectionClass) || $param->isDefaultVa... | [
"public function setAttr(\\n2n\\persistence\\orm\\property\\EntityProperty $entityProperty, $name, $value) {\r\n\t\tthrow new UnsupportedOperationException();\r\n\t}"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
'~'付きのファイルパスの'~'をパスに置き換えて返却する
@name resolveTilde
@memberof fsys
@method
@param {String} str 相対パス
@return {String} file path | [
"function (str) {\n if (str && str.substr(0,1) === '~') {\n return process.env.HOME + str.substr(1);\n }\n return str;\n }"
] | [
"public static function Connect (array $options, $name = self::DEFAULT_CONNECTION_NAME) {\n\t\tforeach (['server_key', 'server_salt', 'client_key', 'client_salt'] as $key) {\n\t\t\tif (!isset($options[$key])) {\n\t\t\t\tthrow CoreException::RaiseSystemError('クッキー認証の%sが設定されていません。CookieAuth::Connect([\\'%s\\' => 任意のパ... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
<p>imposterize.</p>
@param t a {@link java.lang.Throwable} object.
@return a {@link java.lang.RuntimeException} object. | [
"public static RuntimeException imposterize( Throwable t )\n {\n if (t instanceof RuntimeException) return (RuntimeException) t;\n\n return new ExceptionImposter( t );\n }"
] | [
"@javax.annotation.Nonnull\n public com.simiacryptus.util.data.DoubleStatistics accept(@javax.annotation.Nonnull final double[] value) {\n Arrays.stream(value).forEach(this::accept);\n return this;\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Prepare the model
@param $model | [
"function (model) {\n\t\t\tvar c = this.c,\n\t\t\t\ts = this;\n\t\t\tthis.m[model]=function () {\n\t\t\t\tvar modelClass = c[model];\n\t\t\t\treturn new modelClass({ autoInit: true }, s.c, s, s.db);\n\t\t\t};\n\t\t}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Verify that value is a string list or None | [
"def assert_string_list(dist, attr, value):\n \"\"\"\"\"\"\n try:\n assert ''.join(value) != value\n except (TypeError, ValueError, AttributeError, AssertionError):\n raise DistutilsSetupError(\n \"%r must be a list of strings (got %r)\" % (attr, value)\n )"
] | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the Github summarization about Software Engineering:",
"pos": "Represent the Github code about Software Engineering:",
"neg": "Represent the Github code:"
} |
find all extensions in dirs and organize them by type load from `strider.json` or package.json's `strider` section | [
"function (dirs, done) {\n var self = this;\n utils.findExtensions(dirs, function (err, extensions) {\n if (err) return done(err);\n\n for (var i = 0; i < extensions.length; i++) {\n extensions[i].type = extensions[i].type || 'basic';\n extensions[i].id = extensions[i].id.toLowerCase()... | [
"def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Check the version of active minions
CLI Example:
.. code-block:: bash
salt-run manage.versions | [
"def versions():\n '''\n \n '''\n ret = {}\n client = salt.client.get_local_client(__opts__['conf_file'])\n try:\n minions = client.cmd('*', 'test.version', timeout=__opts__['timeout'])\n except SaltClientError as client_error:\n print(client_error)\n return ret\n\n labe... | [
"def docker(gandi, vm, args):\n \n if not [basedir for basedir in os.getenv('PATH', '.:/usr/bin').split(':')\n if os.path.exists('%s/docker' % basedir)]:\n gandi.echo(\"\"\"'docker' not found in $PATH, required for this command \\\nto work\nSee https://docs.docker.com/installation/#installat... | codesearchnet | {
"query": "Represent the sentence about SaltStack:",
"pos": "Represent the code about SaltStack:",
"neg": "Represent the code:"
} |
// Validate returns an error if there's a problem with the
// parameters being used to create a remote application. | [
"func (p AddRemoteApplicationParams) Validate() error {\n\tif !names.IsValidApplication(p.Name) {\n\t\treturn errors.NotValidf(\"name %q\", p.Name)\n\t}\n\tif p.URL != \"\" {\n\t\t// URL may be empty, to represent remote applications corresponding\n\t\t// to consumers of an offered application.\n\t\tif _, err := cr... | [
"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 sentence about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about Software development:"
} |
// UpdateVariable updates a single variable in the store with a changeset | [
"func (c *Client) UpdateVariable(ctx context.Context, id platform.ID, update *platform.VariableUpdate) (*platform.Variable, error) {\n\top := getOp(platform.OpUpdateVariable)\n\tvar variable *platform.Variable\n\terr := c.db.Update(func(tx *bolt.Tx) error {\n\t\tm, pe := c.findVariableByID(ctx, tx, id)\n\t\tif pe !... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Time the run
@param {*} key key from the data object
@param {Function} fn function to be called
@returns {Function} function to be executed
@private | [
"function time(key, fn) {\n if (typeof data[key] === \"undefined\") {\n data[key] = 0;\n }\n\n return function(...args) {\n let t = process.hrtime();\n\n fn(...args);\n t = process.hrtime(t);\n data[key] += t[0] * 1e3 + t[1] / 1e6;\n ... | [
"function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// lexMapKey consumes the text of a key. Assumes that the first character (which
// is not whitespace) has already been consumed. | [
"func lexMapKey(lx *lexer) stateFn {\n\tr := lx.peek()\n\tif isWhitespace(r) || isNL(r) || isKeySeparator(r) {\n\t\tlx.emit(itemKey)\n\t\treturn lexMapKeyEnd\n\t}\n\tlx.next()\n\treturn lexMapKey\n}"
] | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Create client certificate validation success
@param sClientID
Client ID to use. May neither be <code>null</code> nor empty.
@return Never <code>null</code>. | [
"@Nonnull\n public static ClientCertificateValidationResult createSuccess (@Nonnull @Nonempty final String sClientID)\n {\n ValueEnforcer.notEmpty (sClientID, \"ClientID\");\n return new ClientCertificateValidationResult (true, sClientID);\n }"
] | [
"public void setName(String name) throws ApplicationException {\n\tif (name == null) return;\n\tthis.name = name.trim();\n\tif (name.length() == 0) throw new ApplicationException(\"invalid attribute definition\", \"attribute [name] can't be a empty string\");\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Assert the option matching the CSS selector is selected. | [
"def is_selected_by_selector(self, selector):\n \"\"\"\"\"\"\n elem = find_element_by_jquery(world.browser, selector)\n if not elem.is_selected():\n raise AssertionError(\"Element expected to be selected.\")"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
field.getAst().getName() changes, field.getName() remains the same | [
"private void changeSharedFieldInternalName(Field field) {\n field.getAst().rename(InternalIdentifiers.getSharedFieldName(field.getName()));\n }"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Cast given config value to the appropriate type
@param string $name Name of the config value
@param string $value Config value in string form
@return mixed Config value in appropriate type | [
"protected function castConfigValue($name, $value)\n\t{\n\t\tforeach ($this->configTypes as list($nameRegexp, $valueRegexp, $methodName))\n\t\t{\n\t\t\tif (preg_match($nameRegexp, $name) && preg_match($valueRegexp, $value))\n\t\t\t{\n\t\t\t\treturn $this->$methodName($value);\n\t\t\t}\n\t\t}\n\n\t\treturn $value;\n... | [
"public function getSection($key)\n {\n if (false === $this->hasSection($key)) {\n throw new ConfigException(sprintf('\"%s\" is not a section', $key));\n }\n\n // do not return the parent object if we were subclassed, but an actual\n // \"Config\" object to avoid copying in... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// IsPubKeyEqual checks that two public keys are equal | [
"func IsPubKeyEqual(a, b *ecdsa.PublicKey) bool {\n\tif !ValidatePublicKey(a) {\n\t\treturn false\n\t} else if !ValidatePublicKey(b) {\n\t\treturn false\n\t}\n\t// the curve is always the same, just compare the points\n\treturn a.X.Cmp(b.X) == 0 && a.Y.Cmp(b.Y) == 0\n}"
] | [
"func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Sets config options for a given user.
@param array $config array containing key/value pairs to set
@param int $userid userid to set config for (defaults to current) | [
"public final function set_user_config($config, $userid=0) {\n global $DB;\n\n if (empty($userid)) {\n $userid = $this->user->id;\n }\n\n foreach ($config as $key => $value) {\n if ($key != 'visible' && !in_array($key, $this->get_allowed_user_config())) {\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// UInts returns a slice of uints without any duplicates in it. | [
"func UInts(input []uint) []uint {\n\tu := make([]uint, 0, len(input))\n\tm := make(map[uint]bool)\n\n\tfor _, val := range input {\n\t\tif _, ok := m[val]; !ok {\n\t\t\tm[val] = true\n\t\t\tu = append(u, val)\n\t\t}\n\t}\n\n\treturn u\n}"
] | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns Suggestions for given query and fieldName.
@param {string} db
@param {string} index
@param {string} term
@param {string} field
@param {Function} cb | [
"function (db, index, term, field, cb) {\n\t\t\tvar url = host +\n\t\t\t\t'databases/' + db +\n\t\t\t\t'/suggest/' + index +\n\t\t\t\t'?term=' + encodeURIComponent(term) +\n\t\t\t\t'&field=' + field +\n\t\t\t\t'&max=10&distance=Default&accuracy=0.5';\n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\ti... | [
"function Api(config) {\n // config\n this._config = config || {};\n this._config.transforms = _.merge(this._config.transforms || {},{\n defaults: {\n serialize: JSON.stringify,\n deserialize: JSON.parse\n }\n });\n\n this._config.headers = this._config.headers || {};\n\n // stack of [('one' |... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Next increments the index and returns a bool indicating if any further
// items exist. | [
"func (iter *bitArrayIterator) Next() bool {\n\titer.index++\n\treturn uint64(iter.index) <= iter.stopIndex\n}"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)\n\t{\n\t\tswitch (featureID)\n\t\t{\n\t\t\tcase SarlPackage.SARL_ACTION__FIRED_EVENTS:\n\t\t\t\treturn ((InternalEList<?>)getFiredEvents()).basicRemove(otherEnd, msgs);\n\t\t}\n\t\treturn super.eIn... | [
"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 post about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Given a list of hits, all with same query,
returns a set of the contigs containing that query | [
"def _containing_contigs(self, hits):\n ''''''\n return {hit.ref_name for hit in hits if self._contains(hit)}"
] | [
"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 about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
This lifecycle phase is implemented by invoking the {@link Mp#shouldBeEvicted()} method on the instance
@see MessageProcessorLifecycle#invokeEvictable(Object) | [
"@Override\n public boolean invokeEvictable(final Mp instance) throws DempsyException {\n try {\n return instance.shouldBeEvicted();\n } catch(final RuntimeException rte) {\n throw new DempsyException(rte, true);\n }\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public <C extends CDACallback<SynchronizedSpace>> C fetch(C callback) {\n return (C) Callbacks.subscribeAsync(observe(), callback, client);\n }"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
@param Database $databaseNode
@return $this | [
"protected function buildMetadataFile(Database $databaseNode)\n {\n $metadata = [];\n $namespace = $databaseNode->getPackage();\n $template = new Template(__DIR__);\n \n foreach ($databaseNode->getTables() as $table) {\n $entityClass = sprintf('%s\\\\%s', $namespace,... | [
"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:"
} |
// SetMaxItems sets the MaxItems field's value. | [
"func (s *GetServiceLastAccessedDetailsWithEntitiesInput) SetMaxItems(v int64) *GetServiceLastAccessedDetailsWithEntitiesInput {\n\ts.MaxItems = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Search searches all images in local docker server for images that match terms | [
"func (r DockerClientSearcher) Search(precise bool, terms ...string) (ComponentMatches, []error) {\n\tcomponentMatches := ComponentMatches{}\n\terrs := []error{}\n\tfor _, term := range terms {\n\t\tvar (\n\t\t\tref imageapi.DockerImageReference\n\t\t\terr error\n\t\t)\n\t\tswitch term {\n\t\tcase \"__dockerimage_f... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get a mock object.
@param $key
@return \PHPUnit_Framework_MockObject_MockObject | [
"protected function getHelpMock($key)\n {\n if (!isset($this->helpMocks[$key])) {\n throw new \\InvalidArgumentException(sprintf('The required mock object \"%s\" doesn\\'t exist.', $key));\n }\n\n return $this->helpMocks[$key];\n }"
] | [
"public function gatherContexts(BeforeScenarioScope $scope) {\n $environment = $scope->getEnvironment();\n $this->mink = $environment->getContext('Starbug\\Behat\\Context\\MinkContext');\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Change the display name and title of the list item. | [
"function updateListItem(itemMetadata, customFileMetadata) {\n // Define the list item changes. Use the FileLeafRef property to change the display name. \n // Assemble the file update metadata \n var metadata = {\n __metadata: {\n type: itemMetadata... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Data synchronization:"
} |
Show prompt to ask user.
@param string $msg Question.
@param string $default Default value.
@throws \LogicException
@return string The value that use input.
@since 2.0 | [
"public function ask($msg = '', $default = null)\n {\n for ($i = 1; $i <= $this->attempt; $i++) {\n $value = trim($this->in($msg));\n\n $handler = $this->getHandler();\n\n if (!is_callable($handler)) {\n throw new \\LogicException('Please set a callable hand... | [
"protected function help()\n {\n $style = new Style(' *** RUN - HELP ***');\n Out::std($style->color('fg', Style::COLOR_GREEN)->get());\n Out::std('');\n\n $help = new Help('...', true);\n $help->addArgument('', 'color', 'Activate colors (do not activate when redirect output in... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Deopt on use of a binding identifier with the same name as our rest param.
See https://github.com/babel/babel/issues/2091 | [
"function BindingIdentifier(node, parent, scope, state) {\n if (node.name === state.name) {\n state.deopted = true;\n }\n }"
] | [
"def normalize_version(version)\n if version =~ /^\\d+$/\n \"#{@service}:#{version}\"\n elsif version.include?(':') && !version.include?(\":ufo-\")\n version\n else # assume git sha\n # tongueroo/demo-ufo:ufo-2018-06-21T15-03-52-ac60240\n from_git_sha(version)\n end\n... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Continues the chunk upload session with an additional fragment
@param Guid $uploadId The unique identifier of the upload session.
@param int $fileOffset
@param string $content
@return ClientResult | [
"public function continueUpload($uploadId,$fileOffset,$content)\n {\n $returnValue = new ClientResult();\n $qry = new InvokePostMethodQuery($this->getResourcePath(),\n \"ContinueUpload\",\n array('uploadId' => $uploadId->toString(),'fileOffset' => $fileOffset),\n $c... | [
"public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Gets the frame into which data should be receieved
@throws PayloadException
@return Frame | [
"protected function getReceivingFrame(): Frame\n {\n $current = $this->getCurrentFrame();\n\n if ($current->isComplete()) {\n if ($current->isFinal()) {\n throw new PayloadException('Payload cannot receive data: it is already complete');\n } else {\n ... | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
设置不同请求类型下面的方法前缀
@access public
@param string|array $method 请求类型
@param string $prefix 类型前缀
@return $this | [
"public function setMethodPrefix($method, $prefix = '')\n {\n if (is_array($method)) {\n $this->methodPrefix = array_merge($this->methodPrefix, array_change_key_case($method));\n } else {\n $this->methodPrefix[strtolower($method)] = $prefix;\n }\n\n return $this;... | [
"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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Listen object change.
@param objectProperty the object to listen
@param consumeOld process the old object
@param consumeNew process the new object | [
"protected <T> void listenObject(ObjectProperty<T> objectProperty, Consumer<T> consumeOld, Consumer<T> consumeNew) {\n objectProperty.addListener(\n (final ObservableValue<? extends T> ov, final T old_val, final T new_val) -> {\n if (old... | [
"public void away (ClientObject caller, String message)\n {\n BodyObject body = _locator.forClient(caller);\n // we modify this field via an invocation service request because a body object is not\n // modifiable by the client\n body.setAwayMessage(message);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// Update updates an existing chocolate | [
"func (s *ChocolateStorage) Update(c model.Chocolate) error {\n\t_, exists := s.chocolates[c.ID]\n\tif !exists {\n\t\treturn fmt.Errorf(\"Chocolate with id %s does not exist\", c.ID)\n\t}\n\ts.chocolates[c.ID] = &c\n\n\treturn nil\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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:167:1: value_section : ( value_sentence )+ -> ^( VT_ENTRY_VAL ( value_sentence )+ ) ; | [
"public final DSLMapParser.value_section_return value_section() throws RecognitionException {\n\t\tDSLMapParser.value_section_return retval = new DSLMapParser.value_section_return();\n\t\tretval.start = input.LT(1);\n\n\t\tObject root_0 = null;\n\n\t\tParserRuleReturnScope value_sentence18 =null;\n\n\t\tRewriteRule... | [
"def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Regular expressions:"
} |
获得响应处理句柄
@param \One\Protocol\Contracts\Request $request
@return \One\Protocol\Contracts\RespondHandler | [
"protected function getHandler(Request $request): RespondHandler\n {\n if (($handler = $this->getAcceptHandler($request)) === null) {\n $priorities = $this->priorities();\n\n return array_shift($priorities);\n }\n\n return $handler;\n }"
] | [
"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:... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about PHP programming:"
} |
Parse callback request
@param array $params
@return stdClass
@throws GatewayException | [
"public function callback(array $params = null)\n\t{\n\t\t$this->cleanup();\n\n\t\tif(null === $params){\n\t\t\tif(!empty($_POST)){\n\t\t\t\t$params = $_POST;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tempty($params) ||\n\t\t\tempty($params['term']) ||\n\t\t\tempty($params['sign']) ||\n\t\t\tempty($params['type'])\n\t\t) {... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Java wrapper for {@link FeatureSpec#extractWithSubsetSettings(String, FeatureBuilder, ClassTag)}. | [
"public JRecordExtractor<T, float[]> extractWithSubsetSettingsFloat(String settings) {\n return new JRecordExtractor<>(JavaOps.extractWithSubsetSettingsFloat(self, settings));\n }"
] | [
"public static LinkedFlowScope createEntryLattice(TypedScope scope) {\n return new LinkedFlowScope(HamtPMap.<TypedScope, OverlayScope>empty(), scope, scope);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
A wrapper for getting things
:returns: The response of your get
:rtype: dict | [
"def _get(self, *args, **kwargs):\n \n response = requests.get(*args, **kwargs)\n\n response.raise_for_status()\n\n return response.json()"
] | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the Github text about AWS Route 53:",
"pos": "Represent the Github code about AWS Route 53:",
"neg": "Represent the Github code about Software development:"
} |
Returns the summary label of a node for visualisation purposes | [
"public static String getDisplayText(OptionalIdentifiedDefinition camelNode) {\n String id = camelNode.getId();\n if (!Strings2.isEmpty(id)) {\n return id;\n }\n if (camelNode instanceof FromDefinition) {\n FromDefinition node = (FromDefinition) camelNode;\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
reads the services.yml file
@param string $bundleDir bundle dir
@return void | [
"protected function readServicesAndParams($bundleDir)\n {\n $this->servicesFile = $bundleDir.'/Resources/config/services.yml';\n if ($this->fs->exists($this->servicesFile)) {\n $this->services = Yaml::parseFile($this->servicesFile);\n }\n\n if (!isset($this->services['servi... | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Recursive Copy
@param string $src
@param string $dst | [
"private function recursiveCopy($src, $dst)\n {\n @mkdir($dst, 0755);\n\n $iterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($src, \\RecursiveDirectoryIterator::SKIP_DOTS),\n \\RecursiveIteratorIterator::SELF_FIRST\n );\n\n foreach ($... | [
"def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Validate a V_RGBW value. | [
"def validate_v_rgbw(value):\n \"\"\"\"\"\"\n if len(value) != 8:\n raise vol.Invalid(\n '{} is not eight characters long'.format(value))\n return validate_hex(value)"
] | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
将一个数组写入一个php文件里
@param $data
@param $fileName 不带后戳的文件名,根路径为path_temp所指向的路径
@return int | [
"public static function php($data, $fileName) {\n $filePath = Config::getx('path_temp') . $fileName.'.php';\n $result = file_put_contents($filePath, \"<?php\\nreturn \" . var_export($data, true) . \";\");\n return $result;\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 sentence about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
:param ekey: export key, i.e. a pair (datastore key, fmt)
:param dstore: datastore object | [
"def export_agg_losses_ebr(ekey, dstore):\n \n if 'ruptures' not in dstore:\n logging.warning('There are no ruptures in the datastore')\n return []\n name, ext = export.keyfunc(ekey)\n agg_losses = dstore['losses_by_event']\n has_rup_data = 'ruptures' in dstore\n extra_list = [('magn... | [
"def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Added function to add a reference "Elephants. See Chickens" | [
"function IndexEntrySee($txta, $txtb)\n\t{\n\t\tif ($this->directionality == 'rtl') { // *OTL*\n\t\t\t// ONLY DO THIS IF NOT IN TAGS\n\t\t\tif ($txta == strip_tags($txta)) {\n\t\t\t\t$txta = str_replace(':', ' - ', $txta); // *OTL*\n\t\t\t}\n\t\t\tif ($txtb == strip_tags($txtb)) {\n\t\t\t\t$txtb = str_replace(':', ... | [
"def process(self, candidates):\n \n for c in candidates[:]:\n if c.locator not in self.good_locators:\n # TODO: search string, i.e. find \"EU_Street_Name\" in \"EU_Street_Name.GBR_StreetName\"\n candidates.remove(c)\n\n return candidates"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param Field|string $field
@param array $options
@param string[] list of tags
@return GridConfig Fluent interface | [
"public function addField($field, $options = array(), $tagList = array())\n {\n if (! (\\is_string($field) || $field instanceof Field)) {\n throw new \\InvalidArgumentException('Argument $field should be string or instance of Kitpages\\DataGridBundle\\Grid\\Field');\n }\n\n if (\\... | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Search for items | [
"public Observable<SearchViewState> search(String searchString) {\n // Empty String, so no search\n if (searchString.isEmpty()) {\n return Observable.just(new SearchViewState.SearchNotStartedYet());\n }\n\n // search for product\n return searchEngine.searchFor(searchString)\n .map(product... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Init method.
@return void | [
"protected function init() {\n $this->data['crud'] = 'u';\n $this->data['edulevel'] = self::LEVEL_TEACHING;\n $this->data['objecttable'] = user_competency::TABLE;\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:"
} |
Get extended attributes for the path
@param string $path
@param string $attribute attribute to get the info
@return string the attribute value | [
"public function getAttribute($path, $attribute) {\n\t\treturn $this->getState()->getxattr($this->buildUrl($path), $attribute);\n\t}"
] | [
"public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key.... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
{@inheritDoc}
@throws InvalidArgumentException If $file is not a valid value
@throws UnexpectedValueException If $file is an array or FileBag that
contains a value that’s not a File or SplInfoObject object. | [
"public function has($file)\n {\n if (($isArray = is_array($file)) || $file instanceof Traversable) {\n foreach ($file as $key => $f) {\n try {\n if ( ! $this->has($f)) {\n return false;\n }\n }\n ... | [
"private function guardValidModelAndIdentifier($model, $identifier)\n {\n if (empty($model) || (!is_object($model) && (null === $identifier || '' === $identifier))) {\n throw new ResolveComponentDataException('Model has to be an object or (a scalar + an identifier in 2nd argument)');\n }... | codesearchnet | {
"query": "Represent the Github description about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Software development:"
} |
Get mimetype
@return string | [
"public function getMimetype()\n {\n if (isset($this->mimetype) === false) {\n $finfo = new \\finfo(FILEINFO_MIME);\n $mimetype = $finfo->file($this->getPathname());\n $mimetypeParts = preg_split('/\\s*[;,]\\s*/', $mimetype);\n $this->mimetype = strtolower($mime... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// createNetworkHelper creates the association between docker network and contiv network
// if tag is given map docker net to epg or network, else create a contiv network | [
"func createNetworkHelper(networkID string, tag string, IPv4Data, IPv6Data []driverapi.IPAMData) error {\n\tvar tenantName, networkName, serviceName string\n\tvar err error\n\tif tag != \"\" {\n\t\t// we need to map docker network to policy group or network using the tag\n\t\tlog.Infof(\"Received tag %s\", tag)\n\t... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Technology:"
} |
Returns a merge/upsert (i.e. insert or update) SQL query when supported by the database.
@return string|null The SQL string or null when not supported | [
"private function getMergeSql()\n {\n $driver = $this->db->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n\n switch ($driver) {\n case 'mysql':\n return <<<SQL\nINSERT INTO {$this->options['table']} ({$this->options['id_col']}, \n{$this->options['data_col']}, \n{$this->options['t... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Returns the field type identifier for $field.
@param \eZ\Publish\API\Repository\Values\Content\Content $content
@param \eZ\Publish\API\Repository\Values\Content\Field $field
@return string | [
"private function getFieldTypeIdentifier(Content $content, Field $field)\n {\n $contentType = $content->getContentType();\n $key = $contentType->id . ' ' . $field->fieldDefIdentifier;\n\n if (!isset($this->fieldTypeIdentifiers[$key])) {\n $this->fieldTypeIdentifiers[$key] = $cont... | [
"protected function validateCriterionInput(Criterion $criterion)\n {\n /** @var $criterion \\eZ\\Publish\\API\\Repository\\Values\\Content\\Query\\Criterion\\LogicalOperator */\n if (!isset($criterion->criteria[0]) || (count($criterion->criteria) > 1)) {\n throw new RuntimeException('Inv... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Generates supported tags for unspecified ABI types to support more intuitive cross-platform
resolution. | [
"def _get_supported_for_any_abi(version=None, platform=None, impl=None, force_manylinux=False):\n \"\"\"\"\"\"\n unique_tags = {\n tag for abi in _gen_all_abis(impl, version)\n for tag in _get_supported(version=version,\n platform=platform,\n impl=im... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Checks if the current request is unique
@return bool | [
"public function isViewUnique()\n {\n $hash = $this->getCurrentHash();\n\n if (in_array($hash, $this->session->get('tracker.views', [])))\n {\n return false;\n }\n\n return true;\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 NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about Programming:"
} |
generate self.tracksInOrder from self.playlist | [
"function cacheTracksArray(self) {\n self.tracksInOrder = Object.keys(self.playlist).map(trackById);\n self.tracksInOrder.sort(asc);\n self.tracksInOrder.forEach(function(track, index) {\n track.index = index;\n });\n\n function asc(a, b) {\n return operatorCompare(a.sortKey, b.sortKey);\n }\n function... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
//
// Calculates the X.25 checksum on a byte buffer
//
// return the checksum over the buffer bytes
// | [
"func crcCalculate(m *MAVLinkPacket) uint16 {\n\tcrc := crcInit()\n\n\tfor _, v := range m.Pack()[1 : m.Length+6] {\n\t\tcrc = crcAccumulate(v, crc)\n\t}\n\tmessage, _ := m.MAVLinkMessage()\n\tcrc = crcAccumulate(message.Crc(), crc)\n\treturn crc\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 post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Render output to html string.
@param string $template
@param array $vars
@return mixed | [
"protected function renderOutput(string $template, array $vars = [])\n {\n $tpl = $this->template . '.'. $template;\n\n if (view()->exists($tpl)) {\n return view($tpl, $vars)->render();\n }\n\n abort(404, \"View named $tpl not exists.\");\n }"
] | [
"public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Ensure local time and get the beginning of the day | [
"def getDayStart(self, dateTime):\n ''' '''\n return ensure_localtime(dateTime).replace(hour=0,minute=0,second=0,microsecond=0)"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetTags sets the Tags field's value. | [
"func (s *CreateRepositoryInput) SetTags(v []*Tag) *CreateRepositoryInput {\n\ts.Tags = v\n\treturn s\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Initialize session bag
@throws Exception
@throws \Rad\DependencyInjection\Exception\ServiceNotFoundException | [
"public function initialize()\n {\n if (false === $this->initialized) {\n if (!$this->container) {\n throw new Exception('A container object is required to access the \\'session\\' service.');\n }\n\n $this->session = $this->container->get('session');\n ... | [
"public function createService(ServiceLocatorInterface $serviceLocator)\n {\n /** @var $processingConfig ProcessingConfig */\n $processingConfig = $serviceLocator->get('processing_config');\n\n return ProcessingNode::initializeAs(NodeName::fromString($processingConfig->getNodeName()));\n ... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
// NewBalancerBuilder returns a balancer builder. The balancers
// built by this builder will use the picker builder to build pickers. | [
"func NewBalancerBuilder(name string, pb PickerBuilder) balancer.Builder {\n\treturn NewBalancerBuilderWithConfig(name, pb, Config{})\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
magic entry point for most operations (bind, wire) | [
"function viper(HTML) {\n return arguments.length < 2 ?\n (HTML == null || typeof HTML === 'string' ?\n render.bind({}) :\n ('raw' in HTML ?\n render.bind({})(HTML) :\n wireWeakly(HTML, 'html'))) :\n ('raw' in HTML ?\n render.bind({}) : viper.wire\n ).apply(null, arguments);\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// AllowsAnonymous returns true when there is an authenticator that means optional auth | [
"func (ras RouteAuthenticators) AllowsAnonymous() bool {\n\tfor _, ra := range ras {\n\t\tif ra.AllowsAnonymous() {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Not ``this`` with ``width`` bitwidth | [
"public function inotn($width)\n {\n assert(is_integer($width) && $width >= 0);\n $neg = false;\n if( $this->isNeg() )\n {\n $this->negi();\n $neg = true;\n }\n\n for($i = 0; $i < $width; $i++)\n $this->bi = $this->bi->setbit($i, !$this->... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetS3Configuration sets the S3Configuration field's value. | [
"func (s *SplunkDestinationConfiguration) SetS3Configuration(v *S3DestinationConfiguration) *SplunkDestinationConfiguration {\n\ts.S3Configuration = 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 instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
// GetFloat32 gets given key as an float32 | [
"func (e *Entity) GetFloat32(name string) (float32, bool) {\n\tx, ok := e.Get(name).(float32)\n\treturn x, ok\n}"
] | [
"def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Natural Language Processing:"
} |
// ServeHTTP implements the Middleware interface, just recover from the panic. Would provide information on the web page
// if in debug mode. | [
"func (m *RecoveryWare) ServeHTTP(ctx context.Context, w http.ResponseWriter, r *http.Request, next Handler) context.Context {\n\tdefer func() {\n\t\tif err := recover(); err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tstack := make([]byte, m.stackSize)\n\t\t\tstack = stack[:runtime.Stack(s... | [
"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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Check for encapsed variables inside string.
This function is launched when the current token is T_ENCAPSED_AND_WHITESPACE. | [
"private function _checkEncapsedVariablesInsideString() {\n\t\tif ($this->_isActive('encapsedVariablesInsideString') && (!$this->statementStack->getCurrentStackItem()->inHeredoc || ($this->_inFuncCall && !$this->_config->isException('encapsedVariablesInsideString', end($this->_currentFuncCall))))) {\n\t\t\t$this->_... | [
"def localize_sql(self, sql: str) -> str:\n \n # pyodbc seems happy with ? now (pyodbc.paramstyle is 'qmark');\n # using ? is much simpler, because we may want to use % with LIKE\n # fields or (in my case) with date formatting strings for\n # STR_TO_DATE().\n # If you get t... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns the context dictionary for a given reading list. | [
"def get_reading_list_context(self, **kwargs):\n \"\"\"\"\"\"\n reading_list = None\n context = {\n \"name\": \"\",\n \"content\": reading_list,\n \"targeting\": {},\n \"videos\": []\n }\n\n if self.reading_list_identifier == \"popular\"... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Handle a registration request for the application.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"public function login(Request $request)\n {\n $this->validate($request, [\n $this->username() => 'required|string|email|max:240',\n 'password' => 'required|string|min:4|max:240',\n ]);\n\n // If the class is using the ThrottlesLogins trait, we can automatically ... | [
"public function boot()\n {\n $manager = new Manager;\n\n // If you have to customize the manager instance, like setting a custom serializer,\n // I strongly suggest you to create your own service provider and add you manager configuration action here\n // Here some example if you wan... | codesearchnet | {
"query": "Represent the Github instruction about Laravel:",
"pos": "Represent the Github code about Laravel:",
"neg": "Represent the Github code about Software development:"
} |
siehe SyntaxElement.fillValues() | [
"protected void extractValues(HashMap<String, String> values) {\n for (Iterator<SyntaxElement> i = elements.listIterator(); i.hasNext(); ) {\n i.next().extractValues(values);\n }\n }"
] | [
"@Override\n public GeldbetragFactory getFactory() {\n return new GeldbetragFactory().setCurrency(currency).setNumber(betrag).setContext(context);\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Require a NodeRt namespace package and load it into the global namespace. | [
"function using(ns) {\n\tlet nsParts = ns.split('.');\n\tlet parentObj = global;\n\n\t// Build an object tree as necessary for the namespace hierarchy.\n\tfor (let i = 0; i < nsParts.length - 1; i++) {\n\t\tlet nsObj = parentObj[nsParts[i]];\n\t\tif (!nsObj) {\n\t\t\tnsObj = {};\n\t\t\tparentObj[nsParts[i]] = nsObj... | [
"@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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Prepend to a file.
@param string $path
@param string $data
@return int | [
"public function prepend($path, $data)\n\t{\n\t\tif ($this->exists($path))\n\t\t{\n\t\t\treturn $this->write($path, $data . $this->read($path));\n\t\t}\n\n\t\treturn $this->write($path, $data);\n\t}"
] | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Overrides the ContentControllerSearchExtension and adds snippets to results.
@param array $data
@param SearchForm $form
@param SS_HTTPRequest $request
@return HTMLText | [
"public function results($data, $form, $request)\n {\n $result = null;\n $results = $form->getResults();\n $query = $form->getSearchQuery();\n\n // Add context summaries based on the queries.\n foreach ($results as $result) {\n $contextualTitle = new ... | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// DecodeElement RSS module decode | [
"func (md *Decoder) DecodeElement(d *xmlp.Decoder, m *Modules) error {\n\tspace := d.Space\n\n\tswitch space {\n\tcase dublinCoreSpace:\n\t\tif err := md.decodeDublinCore(d, &m.DublinCore); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase mediaSpace:\n\t\tif err := md.decodeMedia(d, &m.Media); err != nil {\n\t\t\tretu... | [
"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 about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Populate temporary data structures to build resource group specs and selectors from db | [
"private synchronized void populateFromDbHelper(Map<Long, ResourceGroupSpecBuilder> recordMap,\n Set<Long> rootGroupIds,\n Map<Long, ResourceGroupIdTemplate> resourceGroupIdTemplateMap,\n Map<Long, Set<Long>> subGroupIdsToBuild)\n {\n List<ResourceGroupSpecBuilder> records... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// SetMaxRecords sets the MaxRecords field's value. | [
"func (s *DescribeClusterDbRevisionsInput) SetMaxRecords(v int64) *DescribeClusterDbRevisionsInput {\n\ts.MaxRecords = &v\n\treturn s\n}"
] | [
"def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about AWS S3:"
} |
Validate this Rule
@param string Field name
@param string Field value
@param Validator Validator object
@return bool True if rule passes | [
"public function validate($field, $value, $validator) {\n\t\tif(strlen($value) === 0) return false;\n\t\t$value = (int) $value;\n\t\treturn $value <= $this->max;\n\t}"
] | [
"private void required(String attributeName, String attributValue) throws ApplicationException {\n\tif (StringUtil.isEmpty(attributValue))\n\t throw new ApplicationException(\"invalid attribute constellation for the tag zip\", \"attribute [\" + attributeName + \"] is required, if action is [\" + action + \"]\");... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Does the recipient's email address map to an email address in the "users" database table?
@return bool | [
"public function isInboundEmailToEmailAddressMapToUser() {\n\n // We map an inbound Mailgun route to a record in the \"users\" table, by email address\n $mappedRoutes = config('lasallecmsmailgun.inbound_map_mailgun_routes_with_user_email_address');\n\n foreach ($mappedRoutes as $route => $user)... | [
"def _unlinkUser(self):\n \n KEY = \"linked_contact_uid\"\n\n # Nothing to do if no user is linked\n if not self.hasUser():\n return False\n\n user = self.getUser()\n username = user.getId()\n\n # Unset the UID from the User Property\n user.setMembe... | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
The DeviceService (HTTP) configuration for this device registry.
Generated from protobuf field <code>.google.cloud.iot.v1.HttpConfig http_config = 9;</code>
@param \Google\Cloud\Iot\V1\HttpConfig $var
@return $this | [
"public function setHttpConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Iot\\V1\\HttpConfig::class);\n $this->http_config = $var;\n\n return $this;\n }"
] | [
"public function setTranslation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AutoMl\\V1beta1\\TranslationAnnotation::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// SetObjectType sets the ObjectType field's value. | [
"func (s *Facet) SetObjectType(v string) *Facet {\n\ts.ObjectType = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Connects to Hetzner account, changes an existing record and returns a boolean,
if update was successful or not. Needed identifier or rtype & name to lookup
over all records of the zone for exactly one record to update. | [
"def _update_record(self, identifier=None, rtype=None, name=None, content=None): # pylint: disable=too-many-locals,too-many-branches\n \n with self._session(self.domain, self.domain_id) as ddata:\n # Validate method parameters\n if identifier:\n dtype, dname, dcon... | [
"def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
This calls the Windows RegQueryInfoKey function in a Unicode safe way. | [
"def QueryInfoKey(key):\n \"\"\"\"\"\"\n regqueryinfokey = advapi32[\"RegQueryInfoKeyW\"]\n regqueryinfokey.restype = ctypes.c_long\n regqueryinfokey.argtypes = [\n ctypes.c_void_p, ctypes.c_wchar_p, LPDWORD, LPDWORD, LPDWORD, LPDWORD,\n LPDWORD, LPDWORD, LPDWORD, LPDWORD, LPDWORD,\n ctypes.POINT... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Remove an item at index from the Carousel.
@method removeItem
@public
@param index {Number} The position to where in the list (starts from
zero).
@return {Boolean} Return true on success, false otherwise | [
"function (index) {\n var carousel = this,\n item,\n num = carousel.get(\"numItems\");\n\n if (index < 0 || index >= num) {\n YAHOO.log(\"Index out of bounds\", \"error\", WidgetName);\n return false;\n }\n\n ... | [
"function (obj) {\n\n if (!(ariaUtilsType.isObject(obj) || ariaUtilsType.isArray(obj))) {\n this.$logError(this.INVALID_TYPE_OF_ARGUMENT);\n return;\n }\n\n /**\n * Contains the initial array or map from which the view is built. This can be ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
@param Node $node
@param Environment $environment
@return Node | [
"public function leaveNode(Node $node, Environment $environment): Node\n {\n if (!($node instanceof ModuleNode)) {\n return $node;\n }\n\n if ($node->hasAttribute('embedded_templates')) {\n /** @var ModuleNode $embeddedTemplate */\n foreach ($node->getAttribu... | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Add internal banner
@param referenz $Banner
@return array $arrBannersStat | [
"protected function addBannerIntern( &$Banner )\n {\n $arrBannersStat = array();\n $oriSize = false;\n \n // return array(bool $intMaxViews, bool $intMaxClicks)\n $MaxViewsClicks = $this->getMaxViewsClicksStatus($Banner);\n\n // set $Banner['banner_active'] as HTML Text\... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
https://api.slack.com/methods/im.history | [
"def open(self, user):\n \n self.params.update({\n 'user': user,\n })\n return FromUrl('https://slack.com/api/im.open', self._requests)(data=self.params).post()"
] | [
"def files(self, query, **kwargs):\n \n self.url = 'https://slack.com/api/search.files'\n return super(Search, self).search_from_url(query, **kwargs)"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
This returns a set of the tasks that are being run by other worker | [
"def _get_run_by_other_worker(worker):\n \n task_sets = _get_external_workers(worker).values()\n return functools.reduce(lambda a, b: a | b, task_sets, set())"
] | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// WithHTTPClient adds the HTTPClient to the inventory get params | [
"func (o *InventoryGetParams) WithHTTPClient(client *http.Client) *InventoryGetParams {\n\to.SetHTTPClient(client)\n\treturn o\n}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Validate single BemJson node https://ru.bem.info/platform/bemjson/
@param {Object} bemJson
@param {String} fileName
@return {Array} | [
"function validateBemJsonNode(bemJson, fileName) {\n let errors = [];\n\n const fieldTypes = {\n block: ['string'],\n elem: ['string'],\n mods: ['object'],\n elemMods: ['object'],\n content: ['object', 'string', 'number', 'boolean'],\n html: ['string'],\n mix: ['object', 'string'],\n js: [... | [
"function exported (options) {\n var exp = arrayify(options.data.root).find(where({ '!kind': 'module', id: this.id }))\n return exp || this\n}"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// LoggingAndRecovery handle HTTP request logging + recovery | [
"func LoggingAndRecovery(color bool) pure.Middleware {\n\n\treturn func(next http.HandlerFunc) http.HandlerFunc {\n\n\t\tif color {\n\n\t\t\treturn func(w http.ResponseWriter, r *http.Request) {\n\n\t\t\t\tt1 := time.Now()\n\n\t\t\t\tlw := lrpool.Get().(*logWriter)\n\t\t\t\tlw.status = 200\n\t\t\t\tlw.size = 0\n\t\... | [
"public void unload() {\n Map<String, String> settings = CACHE.get();\n CACHE.remove();\n // update cache of settings to be used in case of DB connectivity error\n this.getPropertyDbFailureCache = settings;\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.