query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
A series of identifier rewriting to conform with
standard gene identifiers.
:param geneid:
:param sp:
:return: | [
"def _clean_up_gene_id(geneid, sp, curie_map):\n \n # special case for MGI\n geneid = re.sub(r'MGI:MGI:', 'MGI:', geneid)\n\n # rewrite Ensembl --> ENSEMBL\n geneid = re.sub(r'Ensembl', 'ENSEMBL', geneid)\n\n # rewrite Gene:CELE --> WormBase\n # these are old-school ... | [
"def _adj_item_marks(self):\n \"\"\"\"\"\"\n if 'item_marks' in self.kws:\n # Process GO IDs specified in item_marks\n goids = self._get_goids(self.kws['item_marks'])\n # item_marks can take a list of GO IDs on cmdline or in a file.\n # --item_marks=GO:0... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
fromBaseIter
@param XPath2NodeIterator $baseIter
@param string $allowSameElementRepeat
@return \lyquidity\XPath2\Iterator\DocumentOrderNodeIterator | [
"public static function fromBaseIter( $baseIter, $allowSameElementRepeat = false )\r\n\t{\r\n\t\t$result = new DocumentOrderNodeIterator();\r\n\t\t$result->allowSameElementRepeat = $allowSameElementRepeat;\r\n\t\t$result->fromDocumentOrderNodeIteratorParts( $baseIter );\r\n\t\treturn $result;\r\n\t}"
] | [
"public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
To be called when the task is actually complete.
@param error normally null (preferable to handle errors yourself), but may be specified to simulate an exception from {@link Executable#run}, as per {@link ExecutorListener#taskCompletedWithProblems} | [
"public synchronized final void completed(@CheckForNull Throwable error) {\n if (executor!=null) {\n executor.completedAsynchronous(error);\n } else {\n result = error == null ? NULL : error;\n }\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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
/*
(non-Javadoc)
@see org.jdiameter.common.api.app.IAppSessionDataFactory#getAppSessionData(java.lang.Class, java.lang.String) | [
"@Override\r\n public IAccSessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {\r\n if (clazz.equals(ClientAccSession.class)) {\r\n ClientAccSessionDataReplicatedImpl data =\r\n new ClientAccSessionDataReplicatedImpl(sessionId, this.mobicentsCluster, this.replicatedS... | [
"public synchronized void onCloseSession(ExtendedSession session)\n {\n this.cache.remove(key((ManageableRepository)session.getRepository(), session.getWorkspace().getName()));\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns OP_1NEGATE, OP_0 .. OP_16 for ints from -1 to 16.
Returns OP_INVALIDOPCODE for other ints. | [
"def opcode_for_small_integer(small_int)\n raise ArgumentError, \"small_int must not be nil\" if !small_int\n return OP_0 if small_int == 0\n return OP_1NEGATE if small_int == -1\n if small_int >= 1 && small_int <= 16\n return OP_1 + (small_int - 1)\n end\n return OP_INVAL... | [
"protected long doHash(int step, int field) throws ANTLRException {\n int u = UPPER_BOUNDS[field];\n if (field==2) u = 28; // day of month can vary depending on month, so to make life simpler, just use [1,28] that's always safe\n if (field==4) u = 6; // Both 0 and 7 of day of week are Sunda... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
return `True` if current python version match version passed.
raise a deprecation warning if only PY2 or PY3 is supported as you probably
have a conditional that should be removed. | [
"def support(self, version):\n \n\n if not self._known_version(version):\n warn(\"unknown feature: %s\"%version)\n return True\n else:\n if not self._get_featureset_support(version):\n warn(\"You are not supporting %s anymore \"%str(version), User... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Do unordered jobs | [
"protected function doUnorderedJobs()\n {\n $jobNames = $this->getUnorderedJobNames();\n\n foreach ($jobNames as $jobName) {\n $job = $this->getLocalJob($jobName);\n if (!$job) {\n throw new \\Exception(\"job [$jobName] not exists\");\n }\n ... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns next node from cursor.
@param {function(object):boolean} filter Override internal filter
@return {Node|object} | [
"function(filter){\n filter = filter || this.filter;\n\n var cursor = this.cursor_ || this.root_;\n\n do\n {\n var node = cursor[this.a]; // next child\n while (!node)\n {\n if (cursor === this.root_)\n return this.cursor_ = null;\n\n node = curs... | [
"function function_ (options) {\n options.hash.kind = 'function'\n var result = ddata._identifier(options)\n return result ? options.fn(result) : 'ERROR, Cannot find function.'\n}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
This method builds ParagraphVectors model, expecting JavaRDD<LabelledDocument>.
It can be either non-tokenized documents, or tokenized.
@param documentsRdd | [
"public void fitLabelledDocuments(JavaRDD<LabelledDocument> documentsRdd) {\n\n validateConfiguration();\n\n broadcastEnvironment(new JavaSparkContext(documentsRdd.context()));\n\n JavaRDD<Sequence<VocabWord>> sequenceRDD =\n documentsRdd.map(new DocumentSequenceConvertFu... | [
"def fit(self, dataset):\n \n if not isinstance(dataset, RDD):\n raise TypeError(\"dataset should be an RDD of term frequency vectors\")\n jmodel = callMLlibFunc(\"fitIDF\", self.minDocFreq, dataset.map(_convert_to_vector))\n return IDFModel(jmodel)"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(LogGroup logGroup, ProtocolMarshaller protocolMarshaller) {\n\n if (logGroup == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(logGroup.getLogGroupName(), LOGGROUPNAME_... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// GetBase64Value retrieves and decodes a value expected to be base64-encoded binary | [
"func (c *VaultClient) GetBase64Value(path string) ([]byte, error) {\n\tval, err := c.GetStringValue(path)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\tdecoded, err := base64.StdEncoding.DecodeString(val)\n\tif err != nil {\n\t\treturn []byte{}, fmt.Errorf(\"vault path: %v: error decoding base64 value: %v\"... | [
"public function generateCrypt(array $data)\n {\n // No data values should be null.\n\n array_walk($data, function (&$value) {\n if (! isset($value)) {\n $value = '';\n }\n });\n\n // Build the data in a query string.\n\n // The encrypted da... | codesearchnet | {
"query": "Represent the Github instruction about AWS S3:",
"pos": "Represent the Github code about AWS S3:",
"neg": "Represent the Github code about Software development:"
} |
// NewDefaultAuthenticationInfoResolverWrapper builds a default authn resolver wrapper | [
"func NewDefaultAuthenticationInfoResolverWrapper(\n\tproxyTransport *http.Transport,\n\tkubeapiserverClientConfig *rest.Config) AuthenticationInfoResolverWrapper {\n\n\twebhookAuthResolverWrapper := func(delegate AuthenticationInfoResolver) AuthenticationInfoResolver {\n\t\treturn &AuthenticationInfoResolverDelega... | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns column nr on which to split PSM table. Chooses from flags
given via bioset and splitcol | [
"def get_splitcolnr(header, bioset, splitcol):\n \"\"\"\"\"\"\n if bioset:\n return header.index(mzidtsvdata.HEADER_SETNAME)\n elif splitcol is not None:\n return splitcol - 1\n else:\n raise RuntimeError('Must specify either --bioset or --splitcol')"
] | [
"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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Parses the types to create a pretty choice | [
"function getChoices() {\n const name = choice => fp.padStart(MAX_DESC)(choice.value)\n const desc = choice => wrap(choice.description, MAX)\n return types.map(choice => {\n if (choice.value === 'separator') return SEPARATOR\n return {\n name: `${name(choice)} ${choice.emoji} ${desc(choice)}`,\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Indicates if a packet is websocket push action.
@param mixed | [
"protected function isWebsocketPushPacket($packet)\n {\n if (! is_array($packet)) {\n return false;\n }\n\n return $this->isWebsocket\n && array_key_exists('action', $packet)\n && $packet['action'] === Websocket::PUSH_ACTION;\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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Close is a no-op on non-temporary filesystems. On temporary
// ones (as returned by TmpFS), it removes all the temporary files. | [
"func (f *fileSystem) Close() error {\n\tif f.temporary {\n\t\treturn os.RemoveAll(f.root)\n\t}\n\treturn nil\n}"
] | [
"func (dbcr *DiskBlockCacheRemote) DoesCacheHaveSpace(\n\t_ context.Context, _ DiskBlockCacheType) (bool, error) {\n\t// We won't be kicking off long syncing prefetching via the remote\n\t// cache, so just pretend the cache has space.\n\treturn true, nil\n}"
] | codesearchnet | {
"query": "Represent the Github instruction about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code about programming:"
} |
setting options
@exports language
@function language
@param {Object} opt - various options. Check README.md
@return {Function} | [
"function language(opt) {\n\n var options = opt || Object.create(null);\n var include = __dirname + '/min/lib/dictionary.js';\n var lang = options.dictionary || require(include).LANG;\n var my = {\n cookie: String(options.cookie || 'lang'),\n domain: String(options.domain || ''),\n path: String(options... | [
"function () {\n /**\n * Get a valid file path for a template file from a set of directories\n * @param {Object} opts Configurable options (see periodicjs.core.protocols for more details)\n * @param {string} [opts.extname] Periodic extension that may contain view file\n * @param {string} opts.viewna... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Add a field to the current form instance.
@param FieldTypeInterface $field
@return FormBuilderInterface | [
"public function add(FieldTypeInterface $field): FormBuilderInterface\n {\n /** @var BaseType $field */\n $opts = $this->validateOptions(array_merge([\n 'errors' => $this->form->getOption('errors'),\n 'theme' => $this->form->getOption('theme')\n ], $field->getOptions())... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// delete forgets about any cached SelectorPolicy that this endpoint uses.
//
// Returns true if the SelectorPolicy was removed from the cache. | [
"func (cache *policyCache) delete(identity *identityPkg.Identity) bool {\n\tcache.Lock()\n\tdefer cache.Unlock()\n\t_, ok := cache.policies[identity.ID]\n\tif ok {\n\t\tdelete(cache.policies, identity.ID)\n\t}\n\treturn ok\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 Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// UniqueVariableNamesRule Unique variable names
//
// A GraphQL operation is only valid if all its variables are uniquely named. | [
"func UniqueVariableNamesRule(context *ValidationContext) *ValidationRuleInstance {\n\tknownVariableNames := map[string]*ast.Name{}\n\n\tvisitorOpts := &visitor.VisitorOptions{\n\t\tKindFuncMap: map[string]visitor.NamedVisitFuncs{\n\t\t\tkinds.OperationDefinition: {\n\t\t\t\tKind: func(p visitor.VisitFuncParams) (s... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Concaterator concatenates tokens from a series of iterators. | [
"func Concaterator(iterators ...Iterator) Iterator {\n\treturn func() Token {\n\t\tfor len(iterators) > 0 {\n\t\t\tt := iterators[0]()\n\t\t\tif t != EOF {\n\t\t\t\treturn t\n\t\t\t}\n\t\t\titerators = iterators[1:]\n\t\t}\n\t\treturn EOF\n\t}\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param string $handle
@param string $src
@param array|string $dependency
@param array $attributes
@return $this | [
"public function css($handle = null, $src = null, $dependency = null, array $attributes = [])\n {\n if ($handle === null) {\n $handle = $this->getName();\n }\n\n // Set default media attribute\n if (!isset($attributes['media'])) {\n $attributes['media'] = 'all';\... | [
"public static function castDimensions(Image\\Dimensions $dimensions, array $a, Stub $stub, $isNested, $filter = 0)\n {\n $stub->class .= sprintf(' \"%s\"', (string) $dimensions);\n\n return $a;\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Updates an existing account custom field.
@param accountId The external account number (int) or account ID Guid. (required)
@param customFieldId (required)
@param customField (optional)
@return CustomFields | [
"public CustomFields updateCustomField(String accountId, String customFieldId, CustomField customField) throws ApiException {\n return updateCustomField(accountId, customFieldId, customField, null);\n }"
] | [
"@Operation(name=\"$find-matches\", idempotent=true)\n public Parameters findMatchesAdvanced(\n @OperationParam(name=\"dateRange\") DateRangeParam theDate,\n @OperationParam(name=\"name\") List<StringParam> theName,\n @OperationParam(name=\"code\") TokenAndListParam theEnd) {\n \n Paramet... | 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:"
} |
Normalizes a route object.
@param {Object} route The route object to normalize.
@returns {Object} The normalized route object. | [
"function normalize(route) {\n const normalized = { ...route };\n\n if (is.not.array(normalized.path) && is.not.string(normalized.path)) {\n throw new Error(\"The route's path must be a String or [String]\");\n }\n\n if (is.array(normalized.method)) {\n /* If method is an array */\n for (let method of ... | [
"function MiddlewareContext (router) {\n events.EventEmitter.call(this);\n\n /**\n * Express routing options (e.g. `caseSensitive`, `strict`).\n * If set to an Express Application or Router, then its routing settings will be used.\n * @type {express#Router}\n */\n this.router = router || {};\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Register the service providers associated with the
lucadegasperi/oauth2-server-laravel package.
@return void | [
"protected function registerOAuthProviders()\n\t{\n\t\t$this->app->register(new FluentStorageServiceProvider($this->app));\n\t\t$this->app->register(new OAuth2ServerServiceProvider($this->app));\n\t}"
] | [
"protected static function showOutro($projectRoot = 'n.a.')\n {\n \\cli\\line();\n \\cli\\line(\\cli\\Colors::colorize('%nEnjoy developing with %yDoozr%n'));\n \\cli\\line('To maintain your app you can now run %k%Uphp app/console%n%N from your project');\n \\cli\\line('root: %k%U'.$pr... | 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:"
} |
Return matcher implementation depending on the conversion mode
@param conversionType
@return AbstractMatcher implementation | [
"public static RuleSet getMatcherImpl(int conversionType) {\n switch (conversionType) {\n case Constant.JCL_TO_SLF4J:\n return new JCLRuleSet();\n case Constant.LOG4J_TO_SLF4J:\n return new Log4jRuleSet();\n case Constant.JUL_TO_SLF4J:\n return new JULRul... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(StartFaceSearchRequest startFaceSearchRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (startFaceSearchRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
指定したK値、データセットを基に学習データセットの初期化を行う。<br>
データセット中の各対象点の以下の値を再計算する。
<ol>
<li>K距離値</li>
<li>K距離近傍データのIDリスト</li>
<li>局所到達可能密度</li>
</ol>
@param kn K値
@param dataSet 学習データセット | [
"public static void initDataSet(int kn, LofDataSet dataSet)\n {\n Collection<LofPoint> pointList = dataSet.getDataMap().values();\n // K距離、K距離近傍を全て更新した後局所到達可能密度を更新する必要があるため、2ブロックに分けて行う。\n for (LofPoint targetPoint : pointList)\n {\n // 対象点のK距離、K距離近傍を更新する。\n updat... | [
"public static double calculateLofWithUpdate(int kn, int max, LofPoint addedPoint,\n LofDataSet dataSet)\n {\n // データ数が最大に達している場合には古い方からデータの削除を行う\n String deleteId = addPointToDataSet(max, addedPoint, dataSet);\n\n // K距離、K距離近傍、局所到達可能密度の更新を行う対象点の一覧を取得する。\n Set<String> updat... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// New creates a new Reader that reads lines from the io.Reader.
//
// The Reader is already started when returned, so it is unsafe to modify
// any struct fields. | [
"func New(r io.Reader) *Reader {\n\tresult := &Reader{\n\t\tReader: r,\n\t\tTimeout: 100 * time.Millisecond,\n\t\tCh: make(chan string),\n\t}\n\n\tgo result.Run()\n\treturn result\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:"
} |
Determine if one or more actions are allowed
@param string|array $action
@param string|\BeatSwitch\Lock\Resources\Resource $resource
@param int $resourceId
@return bool | [
"public function can($action, $resource = null, $resourceId = null)\n {\n $actions = (array) $action;\n $resource = $this->convertResourceToObject($resource, $resourceId);\n $permissions = $this->getPermissions();\n\n foreach ($actions as $action) {\n if ($aliases = $this->... | [
"public static function GetTabsStatus(\\Puzzlout\\Framework\\Core\\User $user, $sessionKey) {\n return $user->getAttribute($sessionKey);\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Writes the contents of the pool entry. | [
"void write(ByteCodeWriter out)\n throws IOException\n {\n out.write(ConstantPool.CP_INTEGER);\n out.writeInt(_value);\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Create an empty index dataset in the given group. | [
"def create_index(group, chunk_size, compression=None, compression_opts=None):\n \"\"\"\"\"\"\n dtype = np.int64\n if chunk_size == 'auto':\n chunks = True\n else:\n chunks = (nb_per_chunk(np.dtype(dtype).itemsize, 1, chunk_size),)\n\n group.create_dataset(\n 'index', (0,), dtype... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Creates a label for the title of the screen
@param string
@return | [
"public JComponent createTitleLabel(final String text, final boolean includeBackButton) {\n if (includeBackButton) {\n final ActionListener actionListener = e -> _window.changePanel(AnalysisWindowPanelType.WELCOME);\n return createTitleLabel(text, actionListener);\n }\n re... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
Transforms a domain specific Role object into a Role identifier.
@param mixed $value
@return mixed|null
@throws TransformationFailedException | [
"public function transform($value)\n {\n if (null === $value) {\n return null;\n }\n\n if (!$value instanceof APIRole) {\n throw new TransformationFailedException('Expected a ' . APIRole::class . ' object.');\n }\n\n return $value->id;\n }"
] | [
"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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about File management:"
} |
Call all of the before callbacks and return if a result is given.
@param \Illuminate\Contracts\Auth\Authenticatable|null $user
@param string $ability
@param array $arguments
@return bool|null | [
"protected function callBeforeCallbacks($user, $ability, array $arguments)\n {\n foreach ($this->beforeCallbacks as $before) {\n if (! $this->canBeCalledWithUser($user, $before)) {\n continue;\n }\n\n if (! is_null($result = $before($user, $ability, $argumen... | [
"abstract public function __construct(Request $request, Translator $translator, View $view, GridContract $grid);\n\n /**\n * Extend decoration.\n *\n * @param callable $callback\n *\n * @return $this\n */\n public function extend(callable $callback = null)\n {\n // Run the ... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Search for node in its relations
@access public
@return boolean true if found
@param Node $node the node to search for | [
"public function contains(Node $node)\n {\n foreach ($this->links as $linked_node) {\n if ($linked_node == $node) {\n return true;\n }\n }\n\n return false;\n }"
] | [
"function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Update the Cito files without delete user changes
@param Event $event | [
"public static function updateCito(Event $event)\n {\n $options = static::getOptions($event);\n $configDir = $options['symfony-config-dir'];\n $templateDir = $options['symfony-template-dir'];\n $fs = new Filesystem();\n\n /*\n * Update config/packages/cito.yaml\n ... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Converts a raw array to an entity.
@param \Asgard\Entity\Entity $entity
@param array $raw
@return \Asgard\Entity\Entity | [
"protected function hydrate(\\Asgard\\Entity\\Entity $entity, array $raw) {\r\n\t\t$this->unserialize($entity, $raw);\r\n\t\t$entity->setParameter('persisted', true);\r\n\t\t$entity->resetChanged();\r\n\r\n\t\treturn $entity;\r\n\t}"
] | [
"final protected function constructNewObjectsFromRow(LoadingContext $context, Row $row) : ITypedObject\n {\n return $this->mapping->constructNewObjectFromRow($row);\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Called when a recipe cannot be resolved | [
"def recipe_not_found(exception)\n expecting_exception(exception) do\n description = Chef::Formatters::ErrorMapper.file_load_failed(nil, exception)\n display_error(description)\n end\n end"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Finds a line in <full_doc> like
<from_file_keyword> <colon> <path>
and return path | [
"def _find_from_file(full_doc, from_file_keyword):\n \n path = None\n\n for line in full_doc.splitlines():\n if from_file_keyword in line:\n parts = line.strip().split(':')\n if len(parts) == 2 and parts[0].strip() == from_file_keyword:\n path = parts[1].strip()\... | [
"def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Get all required dependencies.
@param string $dependencies
@param array $params
@param bool $isRoute
@return array
@throws Exception | [
"protected function getDependencies($dependencies, $params = [], $isRoute = false)\r\n {\r\n $resolving = [];\r\n\r\n foreach ($dependencies as $dependency) {\r\n if ($dependency->isDefaultValueAvailable()) {\r\n $resolving = $this->getDependencyDefaultValue($dependency, $... | [
"private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Return indices that met the conditions | [
"def where(self, within_of=None, inplace=False, **kwargs):\n \"\"\"\"\"\"\n masks = super(System, self).where(inplace=inplace, **kwargs)\n \n def index_to_mask(index, n):\n val = np.zeros(n, dtype='bool')\n val[index] = True\n return val\n \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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get the default options for the fields for their type
@param $fields array An array of field data
@return array The fields, updated with default data | [
"protected function getDefaultOptions(array $fields)\n {\n $fieldsUpdated = array();\n foreach ($fields as $fieldName => $field) {\n $fieldsUpdated[$fieldName] = $this->typeHandler->getDefaultOptions($field);\n }\n\n return $fieldsUpdated;\n }"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// ReadToken reads Kite Claims from JWT token and uses them to initialize Config. | [
"func (c *Config) ReadToken(key *jwt.Token) error {\n\tc.KiteKey = key.Raw\n\n\tclaims, ok := key.Claims.(*kitekey.KiteClaims)\n\tif !ok {\n\t\treturn errors.New(\"no claims found\")\n\t}\n\n\tc.Username = claims.Subject\n\tc.KontrolUser = claims.Issuer\n\tc.Id = claims.Id // jti is used for jwt's but let's also us... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// newPublisher returns a publishFunc that publishes a single UnitState
// by the given name to the provided Registry, with the given TTL | [
"func newPublisher(reg registry.Registry, ttl time.Duration) publishFunc {\n\treturn func(name string, us *unit.UnitState) {\n\t\tif us == nil {\n\t\t\tlog.Debugf(\"Destroying UnitState(%s) in Registry\", name)\n\t\t\terr := reg.RemoveUnitState(name)\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(\"Failed to destroy Un... | [
"@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:"
} |
Extracts the seconds and nanoseconds component of {@code seconds} as {@code long} and {@code int}
values, passing them to the given converter. The implementation avoids latency issues present
on some JRE releases.
@since 2.9.8 | [
"public static <T> T extractSecondsAndNanos(BigDecimal seconds, BiFunction<Long, Integer, T> convert)\n {\n // Complexity is here to workaround unbounded latency in some BigDecimal operations.\n // https://github.com/FasterXML/jackson-databind/issues/2141\n\n long secondsOnly;\n int... | [
"public String getDescriptiveName()\n {\n StringBuilder sb = new StringBuilder(getDistributionName());\n sb.append(\"(\");\n String[] vars = getVariables();\n double[] vals = getCurrentVariableValues();\n \n sb.append(vars[0]).append(\" = \").append(vals[0]);\n \n... | 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:"
} |
// SetMaxResults sets the MaxResults field's value. | [
"func (s *ListResolverRuleAssociationsInput) SetMaxResults(v int64) *ListResolverRuleAssociationsInput {\n\ts.MaxResults = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns a Filesystem instance based on the scheme of the provided Dsn
@return FilesystemInterface | [
"public function create(Dsn $dsn)\n {\n $dsnId = hash('md5', (string) $dsn);\n\n try {\n $filesystem = $this->mountManager->getFilesystem($dsnId);\n } catch (LogicException $e) {\n if ($dsn->getScheme() === 'file') {\n $path = $dsn->getPath();\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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// SetAverageUtilization sets the AverageUtilization field's value. | [
"func (s *ReservationPurchaseRecommendationDetail) SetAverageUtilization(v string) *ReservationPurchaseRecommendationDetail {\n\ts.AverageUtilization = &v\n\treturn s\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// SetTask sets the Task field's value. | [
"func (s *RenderUiTemplateInput) SetTask(v *RenderableTask) *RenderUiTemplateInput {\n\ts.Task = 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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Retrieve Category from its id and slug, if any.
@return CategoryInterface|null | [
"protected function retrieveCategoryFromQueryString()\n {\n $request = $this->getCurrentRequest();\n $categoryId = $request->get('category_id');\n $categorySlug = $request->get('category_slug');\n\n if (!$categoryId || !$categorySlug) {\n return null;\n }\n\n ... | [
"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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about File management:"
} |
// ArraysWithOneElementPerLine sets up the encoder to encode arrays
// with more than one element on multiple lines instead of one.
//
// For example:
//
// A = [1,2,3]
//
// Becomes
//
// A = [
// 1,
// 2,
// 3,
// ] | [
"func (e *Encoder) ArraysWithOneElementPerLine(v bool) *Encoder {\n\te.arraysOneElementPerLine = v\n\treturn e\n}"
] | [
"function (key, base) { // 477\n if ((typeof key) === \"number\" || key.match(/^[0-9]+$/)) // 478\n key = \"[\" + key + \"]\"; ... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Creates a Formatter.
@param string $id - Formatter ID
@param string $type - Formatter type.
@param array $config - Formatter config.
@throws InvalidConfigException
@return FormatterInterface | [
"public function createFormatter(string $id, string $type, array $config): FormatterInterface\n {\n if (!isset($this->_formatters[$id])) {\n switch ($type) {\n case self::FORMATTER_TYPE_LINE:\n $config = array_replace(\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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Save a script
Save a script # noqa: E501
:param driver: The driver to use for the request. ie. github
:type driver: str
:param script_save: The data needed to save this script
:type script_save: dict | bytes
:rtype: Response | [
"def save_driver_script(driver, script_save=None): # noqa: E501\n \n if connexion.request.is_json:\n script_save = ScriptSave.from_dict(connexion.request.get_json()) # noqa: E501\n\n response = errorIfUnauthorized(role='developer')\n if response:\n return response\n else:\n res... | [
"def reset(self):\n \n path = 'reset'\n request_data = {} # Need to put data into the request to force urllib2 to make it a POST request\n response_data = self.request(path, request_data)\n success = response_data['reset'] # True of False\n return success"
] | codesearchnet | {
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
@param null $key
@param null $default
@return string|int|null | [
"public function getParam($key = null, $default = null)\n {\n if (null === $key) {\n return $this->data[self::P_PARAMS];\n }\n\n return $this->hasParam($key) ? $this->data[self::P_PARAMS][$key] : $default;\n }"
] | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Method which will create a new Encryption provider using the already
specified key. | [
"private void initializeEncryptionProvider() {\n\t\tif (key != null) {\n\t\t\ttry {\n\t\t\t\tencryptionProvider = EncryptionProviderFactory.getProvider(key);\n\t\t\t} catch (UnsupportedKeySizeException e) {\n\t\t\t\tthrow new RuntimeCryptoException(e.getMessage(), e);\n\t\t\t} catch (UnsupportedAlgorithmException e... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetWriteDeadline implements the Conn SetWriteDeadline method. | [
"func (l *Listener) SetWriteDeadline(t time.Time) error {\n\tl.wd.Store(t)\n\treturn 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 text about writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code:"
} |
read stringified uuid into a Buffer | [
"function parse(string) {\n\n var buffer = newBufferFromSize(16);\n var j = 0;\n for (var i = 0; i < 16; i++) {\n buffer[i] = hex2byte[string[j++] + string[j++]];\n if (i === 3 || i === 5 || i === 7 || i === 9) {\n j += 1;\n }\n }\n\n return buffer;\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// GetTag fetches the tag information for the given identifier.
// The id parameter can be a Tag ID or Tag Name. | [
"func (c *Manager) GetTag(ctx context.Context, id string) (*Tag, error) {\n\tif isName(id) {\n\t\ttags, err := c.GetTags(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor i := range tags {\n\t\t\tif tags[i].Name == id {\n\t\t\t\treturn &tags[i], nil\n\t\t\t}\n\t\t}\n\t}\n\n\turl := internal.URL(c, ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Special method for this element only. When value is "false" returns the default value.
@return mixed | [
"public function get_normalized_value() {\n $value = $this->get_value();\n if ($value === false && $this->get_ui() instanceof backup_setting_ui_defaultcustom) {\n $attributes = $this->get_ui()->get_attributes();\n return $attributes['defaultvalue'];\n }\n return $va... | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Normalizes this FilterSpec by normalizing all FilterSpec objects within
<code>expressions</code> and then sorting the list itself.
@return normalized FilterSpec | [
"public FilterSpec normalize() {\n List<FilterSpec> clonedExpressions = expressions != null ? cloneExpressions(expressions, true) : null;\n\n FilterSpec copy = new FilterSpec(path, operator, value, clonedExpressions);\n return copy;\n }"
] | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Prune SiteTree by ID
@param Int
@return Int | [
"public static function pruneByID($RecordID)\n {\n $keep_versions = Config::inst()->get(VersionTruncator::class, 'keep_versions');\n $keep_drafts = Config::inst()->get(VersionTruncator::class, 'keep_drafts');\n $keep_redirects = Config::inst()->get(VersionTruncator::class, 'keep_redirects');... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// SetReplicationInstance sets the ReplicationInstance field's value. | [
"func (s *DeleteReplicationInstanceOutput) SetReplicationInstance(v *ReplicationInstance) *DeleteReplicationInstanceOutput {\n\ts.ReplicationInstance = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetNameModifier sets the NameModifier field's value. | [
"func (s *Output) SetNameModifier(v string) *Output {\n\ts.NameModifier = &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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
1D case: Need to handle specially | [
"function mesh1D(array, level) {\n var zc = zeroCrossings(array, level)\n var n = zc.length\n var npos = new Array(n)\n var ncel = new Array(n)\n for(var i=0; i<n; ++i) {\n npos[i] = [ zc[i] ]\n ncel[i] = [ i ]\n }\n return {\n positions: npos,\n cells: ncel\n }\n}"
] | [
"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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Builds an UPDATE statement (used for {@link PreparedStatement}).
@param tableName
@param columnNames
@param values
@param whereColumns
@param whereValues
@return | [
"public String buildSqlUPDATE(String tableName, String[] columnNames, Object[] values,\n String[] whereColumns, Object[] whereValues) {\n final String SQL_TEMPLATE_FULL = \"UPDATE {0} SET {1} WHERE {2}\";\n final String SQL_TEMPLATE = \"UPDATE {0} SET {1}\";\n\n if (columnNames.lengt... | [
"public @NotNull <T> Optional<T> findOptional(@NotNull Class<T> cl, @NotNull @SQL String sql, Object... args) {\n return findOptional(cl, SqlQuery.query(sql, args));\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Adds an author
@param string $name
@param string $email
@return IntercessionClass
@throws AuthorNoDataException | [
"public function addAuthor(string $name = null, string $email = null)\r\n {\r\n is_null($name) and $name = '';\r\n is_null($email) and $email = '';\r\n\r\n if (empty($name) and empty($email)) {\r\n throw new AuthorNoDataException();\r\n }\r\n\r\n if (!empty($email)) ... | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Software development:"
} |
Keep text before first colon and replace the rest with new text.
If there is no colon in the
:param obj:
:param text:
:param tooltip:
:param replace_all: No colon is searched and whole text is replaced
:return: | [
"def _set_label_text(obj, text, tooltip=None, replace_all=False):\n \n dlab = str(obj.text())\n index_of_colon = dlab.find(': ')\n if index_of_colon == -1:\n index_of_colon = 0\n else:\n index_of_colon += 2\n if replace_all:\n index_of_colon = 0\n obj.setText(dlab[:index_of... | [
"def add_comment(self, line: str) -> None:\n ''' '''\n # the rule is like\n #\n # # comment line --> add to last comment\n # blank line --> clears last comment\n # [ ] --> use last comment\n # parameter: --> use last comment\n # All others: clear last comment... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str | [
"def do_execute(self):\n \n if isinstance(self.input.payload, classes.JavaObject) and self.input.payload.is_serializable:\n copy = serialization.deepcopy(self.input.payload)\n if copy is not None:\n self._output.append(Token(copy))\n else:\n self.... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// ListTubes returns a list of all the existing tubes. | [
"func (this *Beanstalkd) ListTubes() ([]string, error) {\n\te := this.send(\"list-tubes\\r\\n\")\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn this.handleListResponse()\n}"
] | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Set the resources (memory and number of cores) for the Driver.
@param memoryinMegabytes memory to be allocated for the Driver, in MegaBytes.
@param numberOfCores Number of cores to allocate for the Driver.
@return this. | [
"public YarnSubmissionHelper setDriverResources(final int memoryinMegabytes, final int numberOfCores) {\n applicationSubmissionContext.setResource(Resource.newInstance(getMemory(memoryinMegabytes), numberOfCores));\n return this;\n }"
] | [
"def setupJobAfterFailure(self, config):\n \n self.remainingRetryCount = max(0, self.remainingRetryCount - 1)\n logger.warn(\"Due to failure we are reducing the remaining retry count of job %s with ID %s to %s\",\n self, self.jobStoreID, self.remainingRetryCount)\n # S... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Determine the number of solvent molecules per single layer. | [
"def solvent_per_layer(self):\n \n if self._solvent_per_layer:\n return self._solvent_per_layer\n\n assert not (self.solvent_per_lipid is None and self.n_solvent is None)\n if self.solvent_per_lipid is not None:\n assert self.n_solvent is None\n self._sol... | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
We want the Floater to be full-width because the contents will be moved from side to side.
We may/should change this in the future to use just the PARENT View width and/or pass it in the constructor | [
"private void measureFloater() {\n int specWidth = View.MeasureSpec.makeMeasureSpec(screenSize.x, View.MeasureSpec.EXACTLY);\n int specHeight = View.MeasureSpec.makeMeasureSpec(screenSize.y, View.MeasureSpec.AT_MOST);\n mPopupView.measure(specWidth, specHeight);\n }"
] | [
"function get_margin_width()\n {\n //ignore image width, use same width as on predefined bullet ListBullet\n //for proper alignment of bullet image and text. Allow image to not fitting on left border.\n //This controls the extra indentation of text to make room for the bullet image.\n ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns a list of sites from a SiteMatrix, optionally filtered
by 'domain' param | [
"def _sitelist(self, matrix):\n \n _list = []\n for item in matrix:\n sites = []\n\n if isinstance(matrix[item], list):\n sites = matrix[item]\n elif isinstance(matrix[item], dict):\n sites = matrix[item]['site']\n\n for ... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Mechanics for poll(). Call only while holding lock. | [
"private E dequeue() {\n int n = size - 1;\n if (n < 0)\n return null;\n else {\n Object[] array = queue;\n E result = (E) array[0];\n E x = (E) array[n];\n array[n] = null;\n Comparator<? super E> cmp = comparator;\n ... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Gets the list popup window which is lazily initialized.
@return The popup. | [
"private IcsListPopupWindow getListPopupWindow() {\n if (mListPopupWindow == null) {\n mListPopupWindow = new IcsListPopupWindow(getContext());\n mListPopupWindow.setAdapter(mAdapter);\n mListPopupWindow.setAnchorView(ActivityChooserView.this);\n mListPopupWindow.s... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Read HTTP headers and yield them.
Returns:
Generator: yields CRLF separated lines. | [
"def read_trailer_lines(self):\n \n if not self.closed:\n raise ValueError(\n 'Cannot read trailers until the request body has been read.',\n )\n\n while True:\n line = self.rfile.readline()\n if not line:\n # No more dat... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
The data block must fill the entire data capacity of the QR code.
If we fall short, then we must add bytes to the end of the encoded
data field. The value of these bytes are specified in the standard. | [
"def add_words(self):\n \n\n data_blocks = len(self.buffer.getvalue()) // 8\n total_blocks = tables.data_capacity[self.version][self.error][0] // 8\n needed_blocks = total_blocks - data_blocks\n\n if needed_blocks == 0:\n return None\n\n #This will return item1, ... | [
"public FP64 extend(char c) {\n byte b1 = (byte)(c & 0xff);\n extend(b1);\n byte b2 = (byte) (c >>> 8);\n // NOTE pdalbora 23-Jul-2009 -- The following check is intentional. We don't extend the high order byte when it's\n // zero, in order to avoid \"weakening\" the fingerprint of primarily ASCII dat... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Formats imported variables to be used in a script as environment variables.
@param instance the instance whose exported variables must be formatted
@return a non-null map | [
"public static Map<String,String> formatExportedVars( Instance instance ) {\n\n\t\t// The map we will return\n\t\tMap<String, String> exportedVars = new HashMap<> ();\n\n\t\t// Iterate over the instance and its ancestors.\n\t\t// There is no loop in parent relations, so no risk of conflict in variable names.\n\t\tf... | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Generate a random subset with replacement.
@param int $n
@throws \InvalidArgumentException
@return self | [
"public function randomSubsetWithReplacement(int $n) : self\n {\n if ($n < 1) {\n throw new InvalidArgumentException('Cannot generate a'\n . \" subset of less than 1 sample, $n given.\");\n }\n\n $max = $this->numRows() - 1;\n\n $samples = $labels = [];\n\n ... | [
"public List<Integer> getPositiveIntegerList(final String param) {\n return getList(param, new StringToInteger(),\n new IsPositive<Integer>(), \"positive integer\");\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Validate (transaction applied) block against its header, plus fields and
value check. | [
"def validate_block!(original_values)\n raise InvalidBlock, \"gas_used mistmatch actual: #{gas_used} target: #{original_values[:gas_used]}\" if gas_used != original_values[:gas_used]\n raise InvalidBlock, \"timestamp mistmatch actual: #{timestamp} target: #{original_values[:timestamp]}\" if timestamp != o... | [
"def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Return given point rotated around a center point in N dimensions.
Angle is list of rotation in radians for each pair of axis. | [
"def pt_rotate(pt=(0.0, 0.0), angle=[0.0], center=(0.0, 0.0)):\n '''\n '''\n assert isinstance(pt, tuple)\n l_pt = len(pt)\n assert l_pt > 1\n for i in pt:\n assert isinstance(i, float)\n assert isinstance(angle, list)\n l_angle = len(angle)\n assert l_angle == l_pt-1\n for i in... | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the Github comment about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
Do any needed visualization here. Overrides superclass implementations. | [
"def _gripper_visualization(self):\n \n # color the gripper site appropriately based on distance to nearest object\n if self.gripper_visualization:\n # find closest object\n square_dist = lambda x: np.sum(\n np.square(x - self.sim.data.get_site_xpos(\"grip_s... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Removes all the commerce tier price entries where companyId = ? from the database.
@param companyId the company ID | [
"@Override\n\tpublic void removeByCompanyId(long companyId) {\n\t\tfor (CommerceTierPriceEntry commerceTierPriceEntry : findByCompanyId(\n\t\t\t\tcompanyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {\n\t\t\tremove(commerceTierPriceEntry);\n\t\t}\n\t}"
] | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
@param $key
@return bool | [
"private function forceClear($key)\n {\n try {\n return $this->filesystem->delete($this->getFilePath($key));\n } catch (FileNotFoundException $e) {\n return true;\n }\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Finds any provider for a given service.
@param klass service interface or class
@return the first provider found, or null | [
"public static <T> T findAnyServiceProvider( Class<T> klass )\n {\n ServiceLoader<T> loader = ServiceLoader.load( klass );\n Iterator<T> it = loader.iterator();\n return it.hasNext() ? it.next() : null;\n }"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Parse results and messages out of *stream*. | [
"def _parse_results(self, stream):\n \"\"\"\"\"\"\n result = None\n values = None\n try:\n for event, elem in et.iterparse(stream, events=('start', 'end')):\n if elem.tag == 'results' and event == 'start':\n # The wrapper element is a <results... | [
"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 Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code:"
} |
Whether all individual orders are the same
@return | [
"public boolean hasCommonOrder() {\n Order lastOrder = null;\n for (OrderEntry oe : list) {\n if (lastOrder==null) lastOrder=oe.order;\n else if (lastOrder!=oe.order) return false;\n }\n return true;\n }"
] | [
"def before_reject(analysis):\n \n worksheet = analysis.getWorksheet()\n if not worksheet:\n return\n\n # Rejection of a routine analysis causes the removal of their duplicates\n for dup in worksheet.get_duplicates_for(analysis):\n doActionFor(dup, \"unassign\")"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
:param path: str or Path instance
:param name:
:type name: str | [
"def remove_field(self, path, name):\n \n path = make_path(path)\n container = self.get_container(path)\n try:\n value = container._values[name]\n if isinstance(value, ValueTree):\n raise TypeError()\n del container._values[name]\n e... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Return an assets contents. If no parent asset / item ids
are specified, then all assets for the corporation is
returned.
@param int $corporation_id
@param int $parent_item_id
@return \Illuminate\Support\Collection | [
"public function getCorporationAssetContents(int $corporation_id,\n int $parent_item_id = null): Collection\n {\n\n $contents = CorporationAsset::with('type')\n ->where('corporation_id', $corporation_id);\n\n if (! is_null($parent_item_id))\... | [
"protected function calculateViewValue($id, $view, & $properties_cache = null, & $view_cache = null, & $persistent_view_cache = null)\n\t{\n\t\tthrow new InvalidArgumentException('Unknown view \"'.$view.'\" requested on machine \"'.$this->machine_type.'\".');\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Find Interlaced Inserts -> insert 5000, for 5000 more iterations insert same test obj after | [
"function perfFindInterlacedInserts(multiplier) {\n var start, end;\n var totalTimes = [];\n var totalMS = 0;\n\n var loopIterations = arraySize;\n if (typeof (multiplier) != \"undefined\") {\n loopIterations = loopIterations * multiplier;\n }\n\n for (var idx = 0; idx < loopIterations; idx++) {\n var ... | [
"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:"
} |
Exports this object into a LEMS XML object | [
"def toxml(self):\n \n\n return '<Constant' +\\\n (' name = \"{0}\"'.format(self.name) if self.name else '') +\\\n (' symbol = \"{0}\"'.format(self.symbol) if self.symbol else '') +\\\n (' value = \"{0}\"'.format(self.value) if self.value else '') +\\\n (' dimension... | [
"@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:"
} |
// splitAndTrim splits input separated by a comma
// and trims excessive white space from the substrings. | [
"func splitAndTrim(input string) []string {\n\tresult := strings.Split(input, \",\")\n\tfor i, r := range result {\n\t\tresult[i] = strings.TrimSpace(r)\n\t}\n\treturn result\n}"
] | [
"def DocToHelp(doc):\n \"\"\"\"\"\"\n\n # Get rid of starting and ending white space. Using lstrip() or even\n # strip() could drop more than maximum of first line and right space\n # of last line.\n doc = doc.strip()\n\n # Get rid of all empty lines.\n whitespace_only_line = re.compile('^[ \\t]+$', re.M)\n ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(ListRobotApplicationsRequest listRobotApplicationsRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (listRobotApplicationsRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolM... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSConfig. | [
"func (in *ExternalDNSConfig) DeepCopy() *ExternalDNSConfig {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ExternalDNSConfig)\n\tin.DeepCopyInto(out)\n\treturn out\n}"
] | [
"func (resource *Provenance) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Provenance\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Provenance), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*res... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Initiaizes the set of groups | [
"protected function Init()\n {\n $sql = Access::SqlBuilder();\n $tbl = Membergroup::Schema()->Table();\n $order = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));\n $this->groups = Membergroup::Schema()->Fetch(false, null, $order);\n return parent::Init();\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:"
} |
Exit all processes attempting to finish uncommitted active work before exit.
Can be called on an os signal or no zookeeper losing connection. | [
"def clean_exit(signum, frame=None):\n \n global exiting\n if exiting:\n # Since this is set up as a handler for SIGCHLD when this kills one\n # child it gets another signal, the global exiting avoids this running\n # multiple times.\n LOG.debug('Exit in progress clean_exit rece... | [
"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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Extends one Dict with other Dict Key`s or Key`s list,
or dict instance supposed for Dict | [
"def merge(self, other):\n \n ignore = self.ignore\n extra = self.extras\n if isinstance(other, Dict):\n other_keys = other.keys\n ignore += other.ignore\n extra += other.extras\n elif isinstance(other, (list, tuple)):\n other_keys = lis... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
:param member_filter:
callable(obj, tango_class_name, member_name, member) -> bool | [
"def register_object(self, obj, name, tango_class_name=None,\n member_filter=None):\n \n slash_count = name.count(\"/\")\n if slash_count == 0:\n alias = name\n full_name = \"{0}/{1}\".format(self.server_instance, name)\n elif slash_count == 2... | [
"def all(self, data={}, **kwargs):\n \"\n return super(Order, self).all(data, **kwargs)"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Returns a Mutator instance for the given mutator method. The method must be externally
validated to ensure that it accepts one argument and returns void.class. | [
"static synchronized Mutator mutatorFor(Class<?> type, Method method, Configuration configuration,\r\n String name) {\r\n PropertyInfoKey key = new PropertyInfoKey(type, name, configuration);\r\n Mutator mutator = MUTATOR_CACHE.get(key);\r\n if (mutator == null) {\r\n mutator = new MethodMutator(... | [
"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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.