query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
The following functions are needed only when the option to preserve the comments is active. | [
"function addComment(start, end, type, value) {\n assert(typeof start === 'number', 'Comment must have valid position');\n\n // Because the way the actual token is scanned, often the comments\n // (if any) are skipped twice during the lexical analysis.\n // Thus, we need to skip adding a... | [
"public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi... | codesearchnet | {
"query": "Represent the Github sentence about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code about programming:"
} |
// ExtractAlternativesAsExact returns the first found AlternativesAsExactOption from the
// given variadic arguments or nil otherwise. | [
"func ExtractAlternativesAsExact(opts ...interface{}) *opt.AlternativesAsExactOption {\n\tfor _, o := range opts {\n\t\tif v, ok := o.(*opt.AlternativesAsExactOption); ok {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn nil\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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
@param array $parameters
@return void | [
"protected function addParameter(array $parameters)\n {\n foreach ($parameters as $paramName => $paramValue) {\n $parameter = new Parameter($paramName, $paramValue);\n $this->parameters->add($parameter);\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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Given the parsed args, initialize the dbt tracking code.
It would be nice to re-use this profile later on instead of parsing it
twice, but dbt's intialization is not structured in a way that makes that
easy. | [
"def initialize_config_values(parsed):\n \n try:\n cfg = UserConfig.from_directory(parsed.profiles_dir)\n except RuntimeException:\n cfg = UserConfig.from_dict(None)\n\n if cfg.send_anonymous_usage_stats:\n dbt.tracking.initialize_tracking(parsed.profiles_dir)\n else:\n db... | [
"def _morph(self):\n \"\"\"\"\"\"\n self.scanner_paths = {}\n if not hasattr(self, '_local'):\n self._local = 0\n if not hasattr(self, 'released_target_info'):\n self.released_target_info = False\n\n self.store_info = 1\n self._func_exists = 4\n ... | codesearchnet | {
"query": "Represent the Github description about Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code about File management:"
} |
//Generates the OFFSET clause for an SQL statement | [
"func (me *DefaultAdapter) OffsetSql(buf *SqlBuilder, offset uint) error {\n\tif offset > 0 {\n\t\tbuf.Write(me.OffsetFragment)\n\t\treturn me.Literal(buf, offset)\n\t}\n\treturn nil\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 about Data retrieval:",
"pos": "Represent the Github code about Data retrieval:",
"neg": "Represent the Github code:"
} |
Get the most recent commit of the source branch. | [
"function (cb) {\n async.map(self._repos, function (repo, repoCb) {\n self._client.gitdata.getReference({\n user: self._repoParts[repo].org,\n repo: self._repoParts[repo].repo,\n ref: branchSrcFull\n }, function (err, res) {\n if (self._checkAndHandleError(err,... | [
"public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Pass the TagResults down the chain. | [
"func (it *HasA) TagResults(dst map[string]graph.Value) {\n\tit.tags.TagResult(dst, it.Result())\n\n\tit.primaryIt.TagResults(dst)\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Accept both booleans and CLIFilters as input and
turn it into a CLIFilter. | [
"def to_cli_filter(bool_or_filter):\n \n if not isinstance(bool_or_filter, (bool, CLIFilter)):\n raise TypeError('Expecting a bool or a CLIFilter instance. Got %r' % bool_or_filter)\n\n return {\n True: _always,\n False: _never,\n }.get(bool_or_filter, bool_or_filter)"
] | [
"@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:"
} |
Shortcut to create a <link> element specific to CSS
@param aCSSURL
The CSS URL to be referenced
@return Never <code>null</code>. | [
"@Nonnull\n public static HCLink createCSSLink (@Nonnull final ISimpleURL aCSSURL)\n {\n return new HCLink ().setRel (EHCLinkType.STYLESHEET).setType (CMimeType.TEXT_CSS).setHref (aCSSURL);\n }"
] | [
"public static function insertTemplatePF ($parser, $template, $spot=''){\n //process additional arguments into a usable array\n $params = array();\n //sanitize the template name\n $template = preg_replace('/[^A-Za-z0-9_\\-]/', '_', $template);\n //this will be stripped out, assuming the skin is based... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
console.log(ce); | [
"function getdata(err,response){\n \t\t\tif(err){$scope.errmsg = \"Server error, please try again.\";console.log({error:err})}\n\t \t\tif(response){\n\t \t\t\t//console.log(response);\n\t\t\t\tif (response.msg=\"OK\"){\n\t\t\t\t\t$scope.srvdbs = [];\n\t\t\t\t\t$scope.add_db = false;\n\t\t\t\t\t$scope.$emit('relo... | [
"function (config) {\n var that = this;\n console.log(logCord$6, 'You maybe known some config information');\n var svr = new ProxyServer();\n svr.start(config);\n that.mc.trigger(TypeMsg$5.OnCallActive, '');\n return that\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about language and writing:"
} |
/* (non-Javadoc)
@see com.tvd12.ezyfox.core.command.ResponseToRoom#only(java.lang.String[]) | [
"@Override\n public ResponseToRoom only(String... params) {\n includedVars.addAll(Arrays.asList(params));\n return this;\n }"
] | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.chatsample.web.ChatService.class);\n }"
] | codesearchnet | {
"query": "Represent the instruction about org.archive.wayback.resourceindex:",
"pos": "Represent the code about org.archive.wayback.resourceindex:",
"neg": "Represent the code:"
} |
Drop table if exists.
@param string $table
@return $this | [
"public function drop($table = '')\n {\n $tableName = '';\n\n $tableName = ($table !== '') ?\n $table : $this->tableName;\n\n $this->schema = strtoupper(__FUNCTION__).' TABLE IF EXISTS\n `'.$this->database.'`.`'.$tableName.'`'.PHP_EOL;\n\n return $this;\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 summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
// Patch registers a new PATCH route for a path with matching handler in the Mux. | [
"func (m *Mux) Patch(pattern string, handler http.HandlerFunc) {\n\tm.Handle(http.MethodPatch, pattern, handler)\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
reads a Magic template file, puts data in a list of dictionaries | [
"def magic_read(self,infile):\n \n# print \"calling magic_read(self, infile)\", infile\n hold,magic_data,magic_record,magic_keys=[],[],{},[]\n try:\n f=open(infile,\"r\")\n except:\n return [],'bad_file'\n d = f.readline()[:-1].strip('\\n')\n if... | [
"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 text about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code:"
} |
Gets the MIME Type of the given image.
The file must be exists.
@param string $image
@return string | [
"private static function getMimeTypeOfImage($image)\n {\n static $mimes;\n if ($mimes === null) {\n $mimes = [\n 'cod' => 'image/cis-cod',\n 'ras' => 'image/cmu-raster',\n 'fif' => 'image/fif',\n 'gif' => 'image/gif',\n ... | [
"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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Enable options.
@param options Options to enable. | [
"@SafeVarargs\n public final void enable(Option... options) {\n for (Option o : options) {\n optionSet.add(o);\n }\n }"
] | [
"def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Evaluate the value.
@param _value value to be evaluated
@return Long value | [
"protected Long eval(final Object[] _value)\n {\n final Long ret;\n\n if (_value == null) {\n ret = null;\n } else if (_value[0] instanceof String && ((String) _value[0]).length() > 0) {\n ret = Long.parseLong((String) _value[0]);\n } else if (_value[0] instanceo... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
checkPageHasImages.
check if page Content has a img's in it
@param none
@return boolean | [
"private function checkPageHasImages() {\n\n $html = $this->getPageContent();\n\n // for newly created page\n if ($html == '') {\n return false;\n }\n\n $dom = $this->createDOMDocumentFromHTML($html);\n\n $elements = $dom->getElementsByTagName('img');\n re... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Run searchlight function on block data in parallel.
`extra_params` contains:
- Searchlight function.
- `Shape` mask.
- Minimum active voxels proportion required to run the searchlight
function. | [
"def _singlenode_searchlight(l, msk, mysl_rad, bcast_var, extra_params):\n \n\n voxel_fn = extra_params[0]\n shape_mask = extra_params[1]\n min_active_voxels_proportion = extra_params[2]\n outmat = np.empty(msk.shape, dtype=np.object)[mysl_rad:-mysl_rad,\n ... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the possible value(s).
@param Request $request
@param ArgumentMetadata $argument
@return \Generator | [
"public function resolve(Request $request, ArgumentMetadata $argument)\n {\n if (\\array_key_exists($argument->getType(), $this->mappingParameters)) {\n yield $this->mappingParameters[$argument->getType()];\n }\n else {\n foreach ($this->mappingParameters as $value) {\n... | [
"public function getAll() : array\n {\n $fieldOptions = call_user_func($this->fieldOptionsLoader);\n TypeMismatchException::verifyAllInstanceOf(__METHOD__, '<return>', $fieldOptions, IFieldOption::class);\n return $fieldOptions;\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Set servlet the properties. | [
"@Override\n public boolean setProperties(Dictionary<String, String> properties) {\n this.properties = properties;\n if (this.properties != null)\n {\n if (properties.get(\"debug\") != null)\n debug = Integer.parseInt(properties.get(\"debug\"));\n\n if (p... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
解析JSON内容到数组
@param string $json
@return array
@throws InvalidResponseException | [
"public static function json2arr($json)\n {\n $result = json_decode($json, true);\n if (empty($result)) {\n throw new InvalidResponseException('invalid response.', '0');\n }\n if (!empty($result['errcode'])) {\n throw new InvalidResponseException($result['errmsg'... | [
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] | codesearchnet | {
"query": "Represent the text about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code:"
} |
using score map which is an array of what the current user would rate all the unrated items, add them to that users sorted recommended set | [
"function(err){\n client.del(recommendedZSet, function(err){\n async.each(scoreMap,\n function(scorePair, callback){\n client.zadd(recommendedZSet, scorePair[0], scorePair[1], function(err){\n callback();\n ... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Binds the specified {@link CompositeServiceEntry}. | [
"protected T service(CompositeServiceEntry<I, O> entry) {\n requireNonNull(entry, \"entry\");\n services.add(entry);\n return self();\n }"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
<editor-fold desc="Circles & commands"> | [
"function executeCommand(command, circles, current, position) {\n var circle = circles[current],\n transformed = false;\n\n switch (command) {\n case 'increase-x':\n circle.x += 10;\n transformed = true;\n b... | [
"func (s *StringCodeGenerator) Init() {\n\ts.Position = vm.Position{State: vm.NewState()}\n\ts.Lines = []string{\"(Exported by gocnc)\", \"G21G90\\n\"}\n}"
] | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Tell the cache to start a new transaction. If no other transaction is
active, the write cache is flushed before the transaction is started. | [
"def begin_transaction\n if @transaction_stack.empty?\n # The new transaction is the top-level transaction. Flush the write\n # buffer to save the current state of all objects.\n flush\n else\n # Save a copy of all objects that were modified during the enclosing\n # tran... | [
"public void applyAndJournal(Supplier<JournalContext> context, DeleteFileEntry entry) {\n // Unlike most entries, the delete file entry must be applied *before* making the in-memory\n // change. This is because delete file and create file are performed with only a read lock on\n // the parent directory. As... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
读取整个Excel文件,并把读取的数据放入beanMap中,全部返回
@param file Excel文件
@param scale 指定若数值中含有小数则保留几位小数,四舍五入,null或者<=0表示不四舍五入
@return 返回所有封装好的beanMap数据
@throws ReadExcelException | [
"public static List<Map<String, Object>> readExcelToMapList(File file, Integer scale) throws ReadExcelException {\n return XLSReader.readExcel(file, scale).getDatas();\n }"
] | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about text processing:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *DescribeGroupsInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DescribeGroupsInput\"}\n\tif s.AuthenticationToken != nil && len(*s.AuthenticationToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"AuthenticationToken\", 1))\n\t}\n\tif s.Limit != nil && *s.Limit... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Insert inserts the AuthUserUserPermission to the database. | [
"func (auup *AuthUserUserPermission) Insert(db XODB) error {\n\tvar err error\n\n\t// if already exist, bail\n\tif auup._exists {\n\t\treturn errors.New(\"insert failed: already exists\")\n\t}\n\n\t// sql insert query, primary key provided by autoincrement\n\tconst sqlstr = `INSERT INTO django.auth_user_user_permis... | [
"@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Display a single post | [
"public function init(Request $request, $postType, $id, $method, $customId = '')\n {\n \t// Lets validate if the post type exists and if so, continue.\n\t\t$postTypeModel = $this->getPostType($postType);\n \tif(!$postTypeModel){\n \t\t$errorMessages = 'You are not authorized to do this.';\n \t\tretur... | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Encode to Base64
@param input
@param urlSafeEncoding
@return | [
"public static String encode(final String input, final boolean urlSafeEncoding) {\n\t\treturn new String(encode(input.getBytes(charsetUTF8), urlSafeEncoding), charsetISOLatin1);\n\t}"
] | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Creates a label that triggers an action using the supplied text and handler. The label will
be styled as specified with an additional style that configures the mouse pointer and adds
underline to the text. | [
"public static Label newActionLabel (String text, String style, ClickHandler onClick)\n {\n return makeActionLabel(newLabel(text, style), onClick);\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetBackupPlanArn sets the BackupPlanArn field's value. | [
"func (s *RecoveryPointCreator) SetBackupPlanArn(v string) *RecoveryPointCreator {\n\ts.BackupPlanArn = &v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Convert String-formatted options into Object-formatted ones and store in cache | [
"function createOptions(options) {\n var object = optionsCache[options] = {};(options.match(rnotwhite) || []).forEach(function (flag) {\n object[flag] = true;\n });\n return object;\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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Installs the shop files.
@param \Composer\Script\Event $event Event instance
@throws \RuntimeException If an error occured | [
"public static function install( \\Composer\\Script\\Event $event )\n\t{\n\t\t$repository = $event->getComposer()->getRepositoryManager()->getLocalRepository();\n\n\t\tif( ( $t3package = $repository->findPackage( 'aimeos/aimeos-typo3', '*' ) ) === null\n\t\t\t&& ( $t3package = $repository->findPackage( 'typo3-ter/a... | [
"public function onPostPackageEvent(PackageEvent $event) {\n $package = $this->getBltPackage($event->getOperation());\n if ($package) {\n // By explicitly setting the blt package, the onPostCmdEvent() will\n // process the update automatically.\n $this->bltPackage = $package;\n }\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Create a new vertex between this vertex and `other` by linearly interpolating all properties using a parameter of `t`. Subclasses should override this to interpolate additional properties. | [
"function(other, t) {\n var newpos = this.pos.lerp(other.pos, t);\n return new CSG.Vertex(newpos);\n }"
] | [
"function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Convert_core_ExecAction_To_v1_ExecAction is an autogenerated conversion function. | [
"func Convert_core_ExecAction_To_v1_ExecAction(in *core.ExecAction, out *v1.ExecAction, s conversion.Scope) error {\n\treturn autoConvert_core_ExecAction_To_v1_ExecAction(in, out, s)\n}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@param MarkNodeAsPending $command
@param Pbjx $pbjx
@return NodeMarkedAsPending | [
"protected function createNodeMarkedAsPending(MarkNodeAsPending $command, Pbjx $pbjx): NodeMarkedAsPending\n {\n /** @var NodeMarkedAsPending $event */\n $event = $this->createEventFromCommand($command, 'marked-as-pending');\n return $event;\n }"
] | [
"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:"
} |
Validate attribute
@param \yii\base\Model $model
@param string $attribute
@return bool|void | [
"public function validateAttribute($model, $attribute)\n {\n $country = '';\n if ($this->country !== null) {\n $country = $this->country;\n } elseif ($this->countryAttribute !== null) {\n $country = $model->{$this->countryAttribute};\n } elseif ($this->countryCod... | [
"public function setAttr(\\n2n\\persistence\\orm\\property\\EntityProperty $entityProperty, $name, $value) {\r\n\t\tthrow new UnsupportedOperationException();\r\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Collect all on demand imports. | [
"private static ImmutableList<ImportTree> getWildcardImports(List<? extends ImportTree> imports) {\n ImmutableList.Builder<ImportTree> result = ImmutableList.builder();\n for (ImportTree tree : imports) {\n // javac represents on-demand imports as a member select where the selected name is '*'.\n Tr... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Deletes several columns by name in every row.
@param array $names List of column names to delete.
@param bool $deleteRecursiveInSubtables Whether to apply this change to all subtables or not. | [
"public function deleteColumns($names, $deleteRecursiveInSubtables = false)\n {\n foreach ($this->rows as $row) {\n foreach ($names as $name) {\n $row->deleteColumn($name);\n }\n $subTable = $row->getSubtable();\n if ($subTable) {\n ... | [
"public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Get column of mysql type: bigint | [
"public Long getLong(String column) {\r\n\t\tNumber n = getNumber(column);\r\n\t\treturn n != null ? n.longValue() : null;\r\n\t}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@see Router::forEvent
@see GearmanClient::doBackground
@param Event $event
@throws \Exception | [
"protected function doSendEvent(Event $event): void\n {\n if (!$this->shouldUseGearman()) {\n $this->locator->getEventBus()->receiveEvent($event);\n return;\n }\n\n $envelope = new TransportEnvelope($event, 'php');\n $channel = $this->router->forEvent($event);\n\... | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Retrieve The shipment of the tracking datum. | [
"func (r Account_Shipment_Tracking_Data) GetShipment() (resp datatypes.Account_Shipment, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Account_Shipment_Tracking_Data\", \"getShipment\", nil, &r.Options, &resp)\n\treturn\n}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the sentence about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code:"
} |
// MultiValueMode specifies how the decay function should be calculated
// on a field that has multiple values.
// Valid modes are: min, max, avg, and sum. | [
"func (fn *LinearDecayFunction) MultiValueMode(mode string) *LinearDecayFunction {\n\tfn.multiValueMode = mode\n\treturn fn\n}"
] | [
"def set_prop(self, prop, value, ef=None):\n \n if ef:\n # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF.\n # value is restricted to the corresponding enrichment factor and should be a float\n self.ef[prop] = value\n ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Implement to provide binding definitions using the exposed binding
methods. | [
"@Override\n protected void configure() {\n\n // Bind the vertx and container instances\n bind(vertx).to(Vertx.class);\n\n // Request and read stream\n bindFactory(VertxRequestReferencingFactory.class).to(HttpServerRequest.class).in(PerLookup.class);\n bindFactory(VertxRequestR... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Parse tags in a string to turn them into bash escape codes.
@param string $string
@return mixed | [
"public function parseTags($string)\n {\n foreach ($this->tags as $tag => $code) {\n if (strpos($string, \"<{$tag}>\") !== false\n || strpos($string, \"</{$tag}>\") !== false\n ) {\n $string = str_replace(\"<{$tag}>\", $code, $string);\n $... | [
"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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Retrieves the child node. Tests both default name and with namespace.
@param parentNode
@param name
@return | [
"private Xpp3Dom getChild(Xpp3Dom parentNode, String name) {\n\t\tXpp3Dom child = parentNode.getChild(name);\n\t\tif (child != null) {\n\t\t\treturn child;\n\t\t}\n\t\t\n\t\treturn parentNode.getChild(namespace + name);\n\t}"
] | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Get session
@return \League\OAuth2\Server\Entity\SessionEntity | [
"public function getSession()\n {\n if ($this->session instanceof SessionEntity) {\n return $this->session;\n }\n\n $this->session = $this->server->getSessionStorage()->getByAccessToken($this);\n\n return $this->session;\n }"
] | [
"protected function createAccessToken(array $response, AbstractGrant $grant)\n {\n return new \\Stevenmaguire\\OAuth2\\Client\\Token\\AccessToken($response);\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Delegates to the {@link Log#warn(Object)} method of the underlying
{@link Log} instance.
<p>
However, this form avoids superfluous object creation when the logger is disabled
for level WARN.
</p>
@param format
the format string
@param arg
the argument | [
"@Override\n public void warn(String format, Object arg) {\n if (logger.isWarnEnabled()) {\n FormattingTuple ft = MessageFormatter.format(format, arg);\n logger.warn(ft.getMessage(), ft.getThrowable());\n }\n }"
] | [
"@SuppressWarnings(\"unused\")\n @Internal\n protected final void warnMissingProperty(Class type, String method, String property) {\n if (LOG.isWarnEnabled()) {\n LOG.warn(\"Configuration property [{}] could not be set as the underlying method [{}] does not exist on builder [{}]. This usuall... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Add a multi-valued attribute. | [
"public void addCollectionAttribute(String name, Object value) {\n List<Object> attributeValues = getCollectionAttribute(name);\n attributeValues.add(value);\n }"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param int $options
@throws \Rexlabs\ArrayObject\Exceptions\JsonEncodeException
@return string|mixed | [
"public function toJson(int $options = 0)\n {\n $json = json_encode($this->toArray(), $options);\n if (JSON_ERROR_NONE !== json_last_error()) {\n throw new JsonEncodeException(json_last_error_msg());\n }\n\n return $json;\n }"
] | [
"private function handleErrorUnit(Invoke\\Error $unit): Result\\AbstractResult\n {\n return new Result\\Error(null, $unit->getBaseException());\n }"
] | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
// NewCounter implements Provider. | [
"func (p *graphiteProvider) NewCounter(name string) metrics.Counter {\n\treturn p.g.NewCounter(name)\n}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Takes un-encrypted text and encrypts it.
@param string $text
@return string $text | [
"public static function encrypt($text)\n {\n if (function_exists('mcrypt_encrypt')) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $len = mcrypt_get_key_size(MCRYPT_XTEA, MCRYPT_MODE_ECB);\n\n ... | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// ValidateUpstreamCommitsWithoutGodepsChanges returns an error if any
// upstream commits have no Godeps changes. | [
"func ValidateUpstreamCommitsWithoutGodepsChanges(commits []util.Commit) error {\n\tproblemCommits := []util.Commit{}\n\tfor _, commit := range commits {\n\t\tif commit.HasVendoredCodeChanges() && !commit.DeclaresUpstreamChange() {\n\t\t\tproblemCommits = append(problemCommits, commit)\n\t\t}\n\t}\n\tif len(problem... | [
"func (cr *ConflictResolver) BeginNewBranch() {\n\tcr.inputLock.Lock()\n\tdefer cr.inputLock.Unlock()\n\t// Reset the curr input so we don't ignore a future CR\n\t// request that uses the same revision number (i.e.,\n\t// because the previous CR failed to flush due to a\n\t// conflict).\n\tcr.currInput = conflictIn... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
A candidate is viable if the `js` or the `xjs` file exists.
@param {array} candidates - Pathes of module files (without extension).
@returns {string} The first candidate if no module has been found. | [
"function getFirstViableCandidate(candidates) {\n for( const candidate of candidates) {\n const fileJS = `${candidate}.js`;\n if( Fs.existsSync(fileJS) ) return candidate;\n const fileXJS = `${candidate}.xjs`;\n if( Fs.existsSync(fileXJS) ) return candidate;\n }\n\n return candi... | [
"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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return the percentage of providers of a project
that are new to the providers database. | [
"def new_providers(pronac, dt):\n \n info = data.providers_info\n df = info[info['PRONAC'] == pronac]\n providers_count = data.providers_count.to_dict()[0]\n\n new_providers = []\n segment_id = None\n\n for _, row in df.iterrows():\n cnpj = row['nrCNPJCPF']\n cnpj_count = provider... | [
"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 sentence about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code about Data synchronization:"
} |
// Start starts the MakeyButtonDriver and polls the state of the button at the given interval.
//
// Emits the Events:
// Push int - On button push
// Release int - On button release
// Error error - On button error | [
"func (b *MakeyButtonDriver) Start() (err error) {\n\tstate := 1\n\tgo func() {\n\t\ttimer := time.NewTimer(b.interval)\n\t\ttimer.Stop()\n\t\tfor {\n\t\t\tnewValue, err := b.connection.DigitalRead(b.Pin())\n\t\t\tif err != nil {\n\t\t\t\tb.Publish(Error, err)\n\t\t\t} else if newValue != state && newValue != -1 {\... | [
"function onRead (key) {\n if (key !== null) {\n if (cli.debug) console.log('Key:', key)\n // Exits on CTRL-C\n if (key === '\\u0003') process.exit()\n // If enter is pressed and the program is waiting for the user to press enter\n // so that the emulator can step forward, then call the appropriate ... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Add noise to sdr by turning off numNoiseBits active bits and turning on
numNoiseBits in active bits
@param sdr (array) Numpy array of the SDR
@param noiseLevel (float) amount of noise to be applied on the vector. | [
"def corruptSparseVector(sdr, noiseLevel):\n \n\n numNoiseBits = int(noiseLevel * np.sum(sdr))\n if numNoiseBits <= 0:\n return sdr\n activeBits = np.where(sdr > 0)[0]\n inActiveBits = np.where(sdr == 0)[0]\n\n turnOffBits = np.random.permutation(activeBits)\n turnOnBits = np.random.permutation(inActiveBi... | [
"def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
TODO: read also configuration to be able to tell which plugins /
plugin tasks are available for each service | [
"function (serviceDir, selectedConfiguration) {\n if (!serviceDir.startsWith('/')) {\n throw new Error(`serviceDir (${serviceDir}) must be absolute path.`);\n }\n\n // Create services folder if it doesn't exist.\n if (!fs.existsSync(serviceDir)) {\n fs.mkdirSync(serviceDir);\n }\n\n // 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:"
} |
Helper function used by precache and precache-named which does the
actual precaching | [
"async def _precache(url, to_type, force=False):\n '''\n \n '''\n if force:\n cli.print('%s: force clearing' % url)\n _clear_cache(url)\n cli.print('%s: precaching \"%s\"' % (url, to_type))\n with autodrain_worker():\n await singletons.workers.async_enqueue_multiconvert(url, t... | [
"def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
vom GC behandelte Referenzen wegräumen | [
"private static void purgeQueue() {\n\n ChronoReference cref;\n\n while ((cref = (ChronoReference) QUEUE.poll()) != null) {\n for (ChronoReference test : CHRONOS) {\n if (test.name.equals(cref.name)) {\n CHRONOS.remove(test);\n break;\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Deserialize takes some Flatbuffer serialized bytes and deserializes them as
// structs.DevInfo. | [
"func Deserialize(p []byte) *structs.DevInfo {\n\tdevInfo := flat.GetRootAsDevInfo(p, 0)\n\t// get the # of interfaces\n\tdLen := devInfo.DeviceLength()\n\tinfo := &structs.DevInfo{Timestamp: devInfo.Timestamp(), Device: make([]structs.Device, dLen)}\n\tfDev := &flat.Device{}\n\tsDev := structs.Device{}\n\tfor i :=... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// SetSigningImageFormat sets the SigningImageFormat field's value. | [
"func (s *GetSigningPlatformOutput) SetSigningImageFormat(v *SigningImageFormat) *GetSigningPlatformOutput {\n\ts.SigningImageFormat = 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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
@param array $entry
@return string | [
"protected function getEntryPath(array $entry)\n {\n $path = '';\n\n foreach ($entry['path_collection']['entries'] as $folder) {\n if ($folder['id'] == self::ROOT_DIR_ID) {\n continue;\n }\n\n $path .= $folder['name'] . '/';\n }\n\n $pat... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// WithTemplate assigns Template to Options. | [
"func WithTemplate(template io.Reader) Option {\n\treturn func(setter OptionSetter) {\n\t\tsetter.SetTemplate(template)\n\t}\n}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/**
* Write records individually.
*/ | [
"func writeRecords(\n\tclient *as.Client,\n\tkeyPrefix string,\n\tbinName string,\n\tvaluePrefix string,\n\tsize int,\n) {\n\tfor i := 1; i <= size; i++ {\n\t\tkey, _ := as.NewKey(*shared.Namespace, *shared.Set, keyPrefix+strconv.Itoa(i))\n\t\tbin := as.NewBin(binName, valuePrefix+strconv.Itoa(i))\n\n\t\tlog.Printf... | [
"function (options) {\n _.isString(options) && (options = { mode: 'raw', raw: options });\n if (!options.mode) { return; } // need a valid mode @todo raise error?\n\n var mode = RequestBody.MODES[options.mode.toString().toLowerCase()] || RequestBody.MODES.raw,\n urlencoded = options.... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about PHP:"
} |
Retrieves the notifications list.
@param int $userId
@param int $page
@param int $maxResult
@param bool $isRss
@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
@return mixed | [
"public function getUserNotificationsList(User $user, $page = 1, $maxResult = -1, $isRss = false, $notificationParameters = null, $category = null)\n {\n $query = $this->getUserNotifications($user, $page, $maxResult, $isRss, $notificationParameters, false, $category);\n $adapter = new DoctrineORMAd... | [
"public function canDisplay(Exception $original, Exception $transformed, int $code)\n {\n return $transformed instanceof TooManyRequestsHttpException && $this->request->is('auth*');\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Terminate the agent, clean the files, close connections
Should be called manually | [
"def close(self):\n \n os.remove(self._file)\n os.rmdir(self._dir)\n self.thread._exit = True\n self.thread.join(1000)\n self._close()"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github summarization about command or instruction:",
"pos": "Represent the Github code about command or instruction:",
"neg": "Represent the Github code about programming:"
} |
Provide the contents of the CSS file. | [
"function getCSS(document) {\n var content = document.CSS;\n return replacements(document, replacements(document, content));\n}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Associate an instance profile with an IAM role.
CLI Example:
.. code-block:: bash
salt myminion boto_iam.associate_profile_to_role myirole myiprofile | [
"def associate_profile_to_role(profile_name, role_name, region=None, key=None,\n keyid=None, profile=None):\n '''\n \n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n if not role_exists(role_name, region, key, keyid, profile):\n log... | [
"def delete_ec2_role(self, role, mount_point='aws-ec2'):\n \n return self._adapter.delete('/v1/auth/{0}/role/{1}'.format(mount_point, role))"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
return null if there is no CrawlDatum to generate
@return | [
"public CrawlDatum next(){\n int topN = getConf().getTopN();\n int maxExecuteCount = getConf().getOrDefault(Configuration.KEY_MAX_EXECUTE_COUNT, Integer.MAX_VALUE);\n\n if(topN > 0 && totalGenerate >= topN){\n return null;\n }\n\n CrawlDatum datum;\n while (true)... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Serve implements Handler internface. It processing the request and
// writes back the response. | [
"func (mux *ServeMux) Serve(rw ResponseWriter, r *Request) {\n\th := mux.Handler(r)\n\th.Serve(rw, r)\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 sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
Override to visit Strings.
@param name member name, or null if array member
@param pos position of member in list or array
@param value String visited
@param param custom parameter
@return custom result, null by default | [
"public R visit(String name, int pos, String value, P param) {\n return null;\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 about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about programming:"
} |
Return all the possible guesses from the magic library about
the content of the file.
@param fullpath: location of the file
@type fullpath: string
@return: guesses about content of the file
@rtype: tuple | [
"def get_magic_guesses(fullpath):\n \n if CFG_HAS_MAGIC == 1:\n magic_cookies = _get_magic_cookies()\n magic_result = []\n for key in magic_cookies.keys():\n magic_result.append(magic_cookies[key].file(fullpath))\n return tuple(magic_result)\n elif CFG_HAS_MAGIC == 2:... | [
"def parse(self, root):\n \"\"\"\"\"\"\n #Use the first element in the versions list since there should only be one.\n v = _get_xml_version(root)[0]\n result = {}\n\n for child in root: \n if child.tag in self.versions[v].entries:\n entry = self.v... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Receives a message. | [
"@SuppressWarnings(\"unchecked\")\n private void handleRequest(long requestId, Object request) {\n HandlerHolder holder = handlers.get(request.getClass());\n if (holder == null) {\n connection.handleResponseError(requestId, new ConnectException(\"no handler registered\"));\n return;\n }\n\n F... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Checks for definition errors associated with a given {@link InjectionPoint} | [
"public void validateInjectionPointForDefinitionErrors(InjectionPoint ij, Bean<?> bean, BeanManagerImpl beanManager) {\n if (ij.getAnnotated().getAnnotation(New.class) != null && ij.getQualifiers().size() > 1) {\n throw ValidatorLogger.LOG.newWithQualifiers(ij, Formats.formatAsStackTraceElement(ij... | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Populate page for posts item where necessary.
@access public | [
"public function populate_page_for_posts_items() {\n\t\t$page_for_posts = get_option( 'page_for_posts' );\n\t\tif ( ! $page_for_posts ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $this->is_post_context() ) {\n\t\t\t$locator = Carbon_Breadcrumb_Locator::factory( 'post', 'page' );\n\t\t\t$items = $locator->get_items( 500,... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Inserts a base path into the sys.path list if one is specified in
the configuration. | [
"def insert_paths(self):\n \n if self.args.path:\n sys.path.insert(0, self.args.path)\n\n if hasattr(self.config.application, config.PATHS):\n if hasattr(self.config.application.paths, config.BASE):\n sys.path.insert(0, self.config.application.paths.base)"
] | [
"def get_root_path(self, name):\n \n module = modules.get(name)\n if module is not None and hasattr(module, '__file__'):\n return dirname(abspath(module.__file__))\n\n # Flask keeps looking at this point. We instead set the root path to None,\n # assume that the user do... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get an array of all source paths for this package.
@return array<integer,string> All source paths. | [
"public function allSourcePaths()\n {\n return array_merge(\n $this->allPsr4SourcePaths(),\n $this->allPsr0SourcePaths(),\n $this->autoloadClassmap(),\n $this->autoloadFiles(),\n $this->includePath()\n );\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// QueryGet gets the string by key from the request query, if it exists.
// Otherwise, returns "". | [
"func QueryGet(request *http.Request, key string) string {\n\treturn request.URL.Query().Get(key)\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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Sets a {@link Function} to execute if this matches. | [
"public FluentMatchingR<T, R> get(Function<A, R> function) {\n return get(fluentMatchingR, function);\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:"
} |
Make a function to Function class | [
"def function(fname):\n \n def _f(func):\n class WrapFunction(Function):\n name = fname\n\n def __call__(self, *args, **kwargs):\n return func(*args, **kwargs)\n\n return WrapFunction\n\n return _f"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Setup buffer script.
@param string $script
@param bool|false $top
@return $this | [
"public function setBuffer($script, $top = false)\n {\n $script = trim($script);\n if ($top) {\n array_unshift($this->_buffers, $script);\n } else {\n array_push($this->_buffers, $script);\n }\n\n return $this;\n }"
] | [
"public function openFile($path = '')\n {\n $path = '/home/'.$this->userName.'/'.$path;\n $this->returnCode = 'no';\n\n return $this->send('v-open-fs-file', $this->userName, $path);\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about PHP programming:"
} |
Get file item values from the request allowing for multi part form fields.
@param request the request being processed
@param key the file parameter key to return
@return the file item values | [
"public static FileItem[] getRequestFileItemValues(final HttpServletRequest request, final String key) {\n\t\treturn getRequestFileItems(request).get(key);\n\t}"
] | [
"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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Stores an item in local storage.
@param api the storage interface.
@param id the storage ID to use.
@param key the key for the item.
@param data the data for the item (any javascript object/primitive). | [
"function(api, id, key, data) {\n // get storage object\n var obj = _getStorageObject(api, id);\n if(obj === null) {\n // create a new storage object\n obj = {};\n }\n // update key\n obj[key] = data;\n\n // set storage object\n _setStorageObject(api, id, obj);\n}"
] | [
"function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Make a list unique, retaining order of initial appearance. | [
"def unique_list(lst):\n \"\"\"\"\"\"\n uniq = []\n for item in lst:\n if item not in uniq:\n uniq.append(item)\n return uniq"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// AddAllWildcardProducersToAllRouters executes AddWildcardProducersToRouter on
// all currently registered routers | [
"func (registry *streamRegistry) AddAllWildcardProducersToAllRouters() {\n\tregistry.ForEachStream(\n\t\tfunc(streamID MessageStreamID, router Router) {\n\t\t\tregistry.AddWildcardProducersToRouter(router)\n\t\t})\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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetNielsenConfiguration sets the NielsenConfiguration field's value. | [
"func (s *JobTemplateSettings) SetNielsenConfiguration(v *NielsenConfiguration) *JobTemplateSettings {\n\ts.NielsenConfiguration = 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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Decrypt a message with your secret key, that had been encrypted with
your public key by the other endpoint.
@param ResponseInterface $response
@param SealingSecretKey $secretKey
@return ResponseInterface
@throws InvalidMessageException | [
"public function unsealResponse(\n ResponseInterface $response,\n SealingSecretKey $secretKey\n ): ResponseInterface {\n $body = Base64UrlSafe::decode((string) $response->getBody());\n $unsealed = Simple::unseal(\n $body,\n $secretKey\n );\n return ... | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// SetArn sets the Arn field's value. | [
"func (s *SecurityProfileSummary) SetArn(v string) *SecurityProfileSummary {\n\ts.Arn = &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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Retrieve Galaxy *.loc file for the given reference/aligner name.
First tries to find an aligner specific *.loc file. If not defined
or does not exist, then we need to try and remap it from the
default reference file | [
"def _get_galaxy_loc_file(name, galaxy_dt, ref_dir, galaxy_base):\n \n if \"file\" in galaxy_dt and os.path.exists(os.path.join(galaxy_base, galaxy_dt[\"file\"])):\n loc_file = os.path.join(galaxy_base, galaxy_dt[\"file\"])\n need_remap = False\n elif alignment.TOOLS[name].galaxy_loc_file is ... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the "View <element>" link.
@since 0.1.0
@param string $permalink Permalink to the current post.
@param ArgumentCollection $args Collection of arguments.
@return string HTML link to view the post. | [
"protected function getViewLink( $permalink, $args ) {\n\t\tif ( ! $permalink ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t' <a href=\"%s\">%s</a>',\n\t\t\tesc_url( $permalink ),\n\t\t\t$args[ Argument::LINKS ][ Link::VIEW_LINK ]\n\t\t);\n\t}"
] | [
"protected function checkSortableColumnHasAttribute(TableListColumn $column): void\n {\n if (! $column->getAttribute('attribute') && $column->getAttribute('isSortableColumn')) {\n $errorMessage = 'One of the sortable columns has no defined attribute. You have to define a column '\n ... | codesearchnet | {
"query": "Represent the summarization about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
// SetDesiredNumber sets the DesiredNumber field's value. | [
"func (s *UpdateNumberOfDomainControllersInput) SetDesiredNumber(v int64) *UpdateNumberOfDomainControllersInput {\n\ts.DesiredNumber = &v\n\treturn s\n}"
] | [
"public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
self.collectionKey is correct here | [
"function (item, req, eachReq, res, next) {\n eachReq.item = item;\n eachReq[indexKey] = index;\n index++;\n next();\n }"
] | [
"def func(name):\n \n\n \"\"\"\n # Raise condition evaluated in same call as exception addition\n pexdoc.addex(TypeError, \"Argument `name` is not valid\", not isinstance(name, str))\n return \"My name is {0}\".format(name)"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Compute the expectation:
expectation[n] = <Ka_{Z1, x_n} Kb_{x_n, Z2}>_p(x_n)
- Ka_{.,.}, Kb_{.,.} :: RBF kernels
Ka and Kb as well as Z1 and Z2 can differ from each other.
:return: N x dim(Z1) x dim(Z2) | [
"def _expectation(p, kern1, feat1, kern2, feat2, nghp=None):\n \n\n if kern1.on_separate_dims(kern2) and isinstance(p, DiagonalGaussian):\n # no joint expectations required\n eKxz1 = expectation(p, (kern1, feat1))\n eKxz2 = expectation(p, (kern2, feat2))\n return eKxz1[:, :, None] ... | [
"def rsdl_rn(self, AX, Y):\n \"\"\"\"\"\"\n\n # The primal residual normalisation term is\n # max( ||A x^(k)||_2, ||B y^(k)||_2 ) and B = -(I I I ...)^T.\n # The scaling by sqrt(Nb) of the l2 norm of Y accounts for the\n # block replication introduced by multiplication by B\n ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Parse bucket url queries for ListObjects V2. | [
"func getListObjectsV2Args(values url.Values) (prefix, token, startAfter, delimiter string, fetchOwner bool, maxkeys int, encodingType string, errCode APIErrorCode) {\n\terrCode = ErrNone\n\n\t// The continuation-token cannot be empty.\n\tif val, ok := values[\"continuation-token\"]; ok {\n\t\tif len(val[0]) == 0 {... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
! @brief Write bytes into the connection. | [
"def write(self, data):\n \"\"\"\"\"\"\n # If nobody is connected, act like all data was written anyway.\n if self.connected is None:\n return 0\n data = to_bytes_safe(data)\n size = len(data)\n remaining = size\n while remaining:\n count = self... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
delete all options entries from .
@param null $group
@return array | [
"public function clear($group = null) {\n if( isset($group) )\n unset($this->settings[$group]);\n else\n $this->settings = [];\n\n return $this;\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 about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Produces the "Constructors" section and the constructor signatures
(since swig does not do so for classes) for class docstrings. | [
"def make_constructor_list(self, constructor_nodes, classname):\n \"\"\"\"\"\"\n if constructor_nodes == []:\n return\n self.add_text(['\\n', 'Constructors',\n '\\n', '------------'])\n for n in constructor_nodes:\n self.add_text('\\n')\n ... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.