query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// SetContinuousBackupsDescription sets the ContinuousBackupsDescription field's value. | [
"func (s *DescribeContinuousBackupsOutput) SetContinuousBackupsDescription(v *ContinuousBackupsDescription) *DescribeContinuousBackupsOutput {\n\ts.ContinuousBackupsDescription = v\n\treturn s\n}"
] | [
"@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Creates a new Time instance from hour, minute and second components.
@param $h Hour component
@param int $m Minute component
@param int|double $s Second component
@param int|double $f Fractional second component
@return Time | [
"public static function hms($h, $m = 0, $s = 0, $f = 0)\n {\n $sec = static::hmsf2sec($h, $m, $s, $f);\n\n return static::sec($sec);\n }"
] | [
"private static function _createFromTimestamp($timestamp) {\r\n // Creates an instance of the current class\r\n $date = new DateMilli();\r\n // Creates the DateTime PHP object from the given timestamp\r\n $dateTime = new \\DateTime();\r\n // Check if the given timestamp is a float... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns a unique hash for the context of the current request, depending
on whether the request comes from frontend or backend.
@return string | [
"public function getContextHash()\n {\n return ($this->environmentService->isEnvironmentInFrontendMode())\n ? 'fe-' . Core::get()->getPageController()->id\n : 'be-' . StringService::get()->sanitizeString(GeneralUtility::_GET('M'));\n }"
] | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// SetCreatedDate sets the CreatedDate field's value. | [
"func (s *Deployment) SetCreatedDate(v time.Time) *Deployment {\n\ts.CreatedDate = &v\n\treturn s\n}"
] | [
"function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Factory function that reads a FITS file and returns a f2nimage object.
Use hdu to specify which HDU you want (primary = 0) | [
"def fromfits(infile, hdu = 0, verbose = True):\n \n \n pixelarray, hdr = ft.getdata(infile, hdu, header=True)\n pixelarray = np.asarray(pixelarray).transpose()\n #print pixelarray\n \n pixelarrayshape = pixelarray.shape\n if verbose :\n print \"Input shape : (%i, %i)\" % (pixelarrays... | [
"def build_reference_wcs(inputs, sciname='sci'):\n \"\"\"\"\"\"\n # start by creating a composite field-of-view for all inputs\n wcslist = []\n for img in inputs:\n nsci = countExtn(img)\n for num in range(nsci):\n extname = (sciname, num + 1)\n if sciname == 'sci':\n... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Generate HTML demo page
@param {Function} done | [
"function generateDemoHtml(done) {\n\t\t\tif (!o.htmlDemo) {\n\t\t\t\tdone();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar context = prepareHtmlTemplateContext();\n\n\t\t\t// Generate HTML\n\t\t\tvar demoTemplate = readTemplate(o.htmlDemoTemplate, 'demo', '.html');\n\t\t\tvar demo = renderTemplate(demoTemplate, context);... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// sqlExecStmt executes the prepared SQL statement with any optional arguments,
// and returns the nuber of rows affected. | [
"func sqlExecStmt(stmt *sql.Stmt, execErrPrefix string, args ...interface{}) (int64, error) {\n\tres, err := stmt.Exec(args...)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"%v %v\", execErrPrefix, err)\n\t}\n\tif res == nil {\n\t\treturn 0, nil\n\t}\n\n\tvar N int64\n\tN, err = res.RowsAffected()\n\tif err != nil... | [
"public function doBind( PDOStatement $stmt )\n {\n foreach ( $this->boundValues as $key => $value )\n {\n try\n {\n $stmt->bindValue( $key, $value, $this->boundValuesType[$key] );\n }\n catch ( PDOException $e )\n {\n ... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software Development:"
} |
Used only for Segments. Not for Queries | [
"@Override\n public DateTimeFormatter getFormatter(Formatter type)\n {\n GranularityType granularityType = GranularityType.fromPeriod(period);\n switch (type) {\n case DEFAULT:\n return DateTimeFormat.forPattern(granularityType.getDefaultFormat());\n case HIVE:\n return DateTimeForma... | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Check looks inside the JSON file to see if any fields are poorly specified | [
"func (f *JSONConfigFile) Check() error {\n\treturn PickFirstError(\n\t\t// Feel free to add others here..\n\t\tfunc() error {\n\t\t\t_, err := f.GetRunMode()\n\t\t\treturn err\n\t\t}(),\n\t)\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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
JSON result format | [
"function(){\n\t\tvar self = this;\n\n\t\treturn {\n\t\t\tname: self.nsPath.split( '.' ).pop(),\n\t\t\tnsPath: self.nsPath,\n\t\t\tcount: self.count,\n\t\t\tpassed: self.passed,\n\t\t\tfailed: self.failed,\n\t\t\tskipped: self.skipped,\n\t\t\tstart: self.start,\n\t\t\tend: self.end,\n\t\t\ttime: self.end - self.sta... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Prompt the user for input.
@param string $question
@param string $default
@return string | [
"public function ask($question, $default = null)\n\t{\n\t\t$dialog = $this->getHelperSet()->get('dialog');\n\n\t\treturn $dialog->ask($this->output, \"<question>$question</question>\", $default);\n\t}"
] | [
"public function help($help)\n {\n $green = \"\\033[49;32m\";\n $end = \"\\033[0m\";\n\n $array['import'] = [\n 'Import Search Results',\n $green . 'mp3 import' . $end,\n '',\n 'Option Description Required Default Availab... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Assert that df is a subset of items
Parameters
==========
df : DataFrame
items : dict
mapping of columns (k) to array-like of values (v) that
``df[k]`` is expected to be a subset of | [
"def within_set(df, items=None):\n \n for k, v in items.items():\n if not df[k].isin(v).all():\n raise AssertionError\n return df"
] | [
"def _accumulate(data_list, no_concat=()):\n \n acc = Accumulator()\n for data in data_list:\n for name, val in data.items():\n acc.add(name, val)\n out = {name: acc[name] for name in acc.names if name not in no_concat}\n\n # Some variables should not be concatenated but should be k... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get the current list of active channels
@return object|bool - false for a failure, JSON object for all other results | [
"public function show()\n {\n try {\n\n $result = FALSE;\n\n if (is_null($this->pestObject))\n throw new Exception(\"PEST Object not provided or is null\", 503);\n\n $uri = \"/channels\";\n $result = $this->pestObject->... | [
"def get(resource, params: {}, key: Steam.apikey)\n params[:key] = key\n response = @conn.get resource, params\n JSON.parse(response.body)\n rescue JSON::ParserError\n # If the steam web api returns an error it's virtually never in json, so\n # lets pretend that we're getting some sort... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Generate a tin from a given coords list. The internal tin geoms array is set from the result.
@param coordinateList the coords to use for the tin generation. | [
"private void generateTin( List<Coordinate> coordinateList ) {\n pm.beginTask(\"Generate tin...\", -1);\n DelaunayTriangulationBuilder b = new DelaunayTriangulationBuilder();\n b.setSites(coordinateList);\n Geometry tinTriangles = b.getTriangles(gf);\n tinGeometries = new Geometry... | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/* (non-Javadoc)
@see java.util.Iterator#next() | [
"public UrlSearchResult next() {\n\t\tif(cachedNext == null) {\n\t\t\tthrow new NoSuchElementException(\"use hasNext!\");\n\t\t}\n\t\tUrlSearchResult tmp = cachedNext;\n\t\tcachedNext = null;\n\t\treturn tmp;\n\t}"
] | [
"public Set<java.util.Map.Entry<String, T>> entrySet()\n\t{\n\t\treturn lookupMap.entrySet();\n\t}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about language and writing:"
} |
// SetQueries sets the Queries field's value. | [
"func (s *DescribeQueriesOutput) SetQueries(v []*QueryInfo) *DescribeQueriesOutput {\n\ts.Queries = 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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Prepare luckymoney.
@param array $params
@return \EntWeChat\Support\Collection | [
"public function prepare(array $params)\n {\n $params['wxappid'] = $this->merchant->app_id;\n\n // XXX: PLEASE DON'T CHANGE THE FOLLOWING LINES.\n $params['auth_mchid'] = '1000052601';\n $params['auth_appid'] = 'wxbf42bd79c4391863';\n\n $params['amt_type'] = 'ALL_RAND';\n\n ... | [
"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 comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
//export destinationEmpty | [
"func destinationEmpty(cinfo *C.struct_jpeg_compress_struct) C.boolean {\n\t// need to write *entire* buffer, not subtracting free_in_buffer\n\tmgr := getDestinationManager(cinfo)\n\tflushBuffer(mgr, writeBufferSize)\n\treturn C.TRUE\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:"
} |
<code>
.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult k_map_estimation_result = 7;
</code> | [
"public com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResultOrBuilder\n getKMapEstimationResultOrBuilder() {\n if (resultCase_ == 7) {\n return (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult) result_;\n }\n return com.google.privacy.dlp.v2.Anal... | [
"@java.lang.Deprecated\n public java.util.Map<java.lang.String, com.google.cloud.datalabeling.v1beta1.AnnotationSpec>\n getAnnotationColors() {\n return getAnnotationColorsMap();\n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the ping instance.
@throws \InvalidArgumentException
@return \JJG\Ping
Return the ping instance. | [
"protected function getPingInstance()\n {\n if (empty($this->port)) {\n throw new \\InvalidArgumentException(\n 'Missing host port, ensure you called setPort().'\n );\n }\n $instance = $this->createPing();\n $instance\n ->setPort($this->... | [
"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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
function _formatDataSetLabels() | [
"private function _percentageSumCalculation($groupID,$seriesCount) {\r\n\t\t//\tAdjust our values to a percentage value across all series in the group\r\n\t\tfor($i = 0; $i < $seriesCount; ++$i) {\r\n\t\t\tif ($i == 0) {\r\n\t\t\t\t$sumValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotVal... | [
"function (suite) {\n return _.template(readFileForRespectiveTemplates('features.html'))({\n suite: suite,\n _: _,\n calculateDuration: calculateDuration,\n columnLayoutWidth: getColumnLayoutWidth(),\n decideScenarioTitlePadding: preventOverlappingTheSce... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Ensures all values of the given `hash` are BINARY-encoded, if necessary. | [
"def binary_encode_any_high_ascii_in_hash(hash)\n Hash[hash.map { |key, value| [key, binary_encode_any_high_ascii(value)] }]\n end"
] | [
"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 Github text about Blockchain:",
"pos": "Represent the Github code about Blockchain:",
"neg": "Represent the Github code about Software development:"
} |
Removes a node from a slot (default content). It ensures that if the slot doesn't have any assigned nodes yet, that the node is actually removed, otherwise it's just unregistered. | [
"function removeNodeFromSlot (slot, node) {\n const isInDefaultMode = slot.assignedNodes().length === 0;\n unregisterNode(slot, node, () => {\n if (isInDefaultMode) {\n slot.__removeChild(node);\n }\n });\n}"
] | [
"private void removeContext(final String contextID) {\n\n synchronized (this.contextStack) {\n\n if (!contextID.equals(this.contextStack.peek().getIdentifier())) {\n throw new IllegalStateException(\"Trying to close context with id `\" + contextID +\n \"`. But the top context has id `\" +\... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Convenience method for the REPL. I got tired of typing this string every time I logged in. | [
"def getStore(self, name, domain):\n \"\"\"\"\"\"\n return IRealm(self.original.store.parent).accountByAddress(name, domain).avatars.open()"
] | [
"def generate(options, command: nil)\n # First, enable `always_trace`, to show the stack trace\n always_trace!\n\n used_switches = []\n options.each do |option|\n next if option.description.to_s.empty? # \"private\" options\n next unless option.display_in_shell\n\n short_swi... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Deactivates the Component. | [
"def deactivate(self):\n \n\n raise foundations.exceptions.ProgrammingError(\n \"{0} | '{1}' Component cannot be deactivated!\".format(self.__class__.__name__, self.__name))"
] | [
"@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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Returns a {@see Cache} object for a sub-namespace.
@param string $namespace
@param int $defaultTTL
@return Cache | [
"public function ns($namespace, $defaultTTL = null)\n {\n $namespace = $this->id($namespace);\n $defaultTTL = $defaultTTL ?: $this->defaultTTL;\n return new Cache($this->backend, $namespace, $defaultTTL, $this->ttlVariation);\n }"
] | [
"protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n ... | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
// done is called when the PendingItem processing is done.
//
// It can be because there was an error, it was linked to another item, it was
// present on the server or finally it was uploaded successfully. | [
"func (i *PendingItem) done() error {\n\ttracer.CounterAdd(i.a, \"itemsProcessing\", -1)\n\ti.a = nil\n\treturn nil\n}"
] | [
"boolean detectAndHandleBackupTimeout(long timeoutMillis) {\n // if the backups have completed, we are done; this also filters out all non backup-aware operations\n // since the backupsAcksExpected will always be equal to the backupsAcksReceived\n boolean backupsCompleted = backupsAcksExpected ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Callsback an ip address or null if can't find the hostname | [
"function(hostname, callback) {\n get_nodes(function(err,nodes) {\n if (err) return callback(err);\n\n var n = nodes.filter(function(node) {\n return node.name === hostname;\n });\n\n callback(null,(n.length === 1) ? n[0].ip_address : null);\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 Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Pops the top frame off the frame stack. | [
"def __pop_top_frame(self):\n \"\"\"\"\"\"\n popped = self.__stack.pop()\n if self.__stack:\n self.__stack[-1].process_subframe(popped)"
] | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Initializes the default configuration for the object.
Called from {@link __construct()} as a first step of object instantiation.
@param AnConfig $config An optional AnConfig object with configuration options. | [
"protected function _initialize(AnConfig $config)\n {\n $description = $this->_description;\n\n $properties = $description->getProperty();\n\n $validations = array();\n\n foreach ($properties as $property) {\n\n if ($property->isAttribute() && $property->getFormat()) {\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 summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Offset to retrieve
@link http://php.net/manual/en/arrayaccess.offsetget.php
@param mixed $offset <p>
The offset to retrieve.
</p>
@return mixed Can return all value types.
@since 5.0.0 | [
"public function offsetGet($offset)\n {\n return isset($this->areas[$offset]) ? $this->areas[$offset] : null;\n }"
] | [
"protected static function intervalHasTime(DateInterval $interval)\n {\n // The array_key_exists and get_object_vars are used as a workaround to check microsecond support.\n // Both isset and property_exists will fail on PHP 7.0.14 - 7.0.21 due to the following bug:\n // https://bugs.php.net... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Get the groups that contain the specified DN as its member.
@param dn
@return
@throws WIMException | [
"private List<String> getGroups(String dn) throws WIMException {\n List<String> grpList = new ArrayList<String>();\n String filter = iLdapConfigMgr.getGroupMemberFilter(dn);\n String[] searchBases = iLdapConfigMgr.getGroupSearchBases();\n for (int i = 0; i < searchBases.length; i++) {\n ... | [
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
syck_parser_reset_levels | [
"public void resetLevels() {\n while(lvl_idx > 1) {\n popLevel();\n }\n\n if(lvl_idx < 1) {\n lvl_idx = 1;\n levels[0] = new Level();\n levels[0].spaces = -1;\n levels[0].ncount = 0;\n levels[0].domain = \"\";\n }\n ... | [
"def forward_char(self, e): # (C-f)\r\n \"\"\"\r\n self.l_buffer.forward_char(self.argument_reset)\r\n self.finalize()"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get vlan attached ifaces. | [
"def ifaces(cls, name):\n \n ifaces = Iface.list({'vlan_id': cls.usable_id(name)})\n ret = []\n for iface in ifaces:\n ret.append(Iface.info(iface['id']))\n return ret"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Returns the size dimensions of the specified element.
@method getSize
@param {Element/String} elm Element object or element ID to get rectangle from.
@return {object} Rectangle for specified element object with w, h fields. | [
"function (elm) {\n var self = this, w, h;\n\n elm = self.get(elm);\n w = self.getStyle(elm, 'width');\n h = self.getStyle(elm, 'height');\n\n // Non pixel value, then force offset/clientWidth\n if (w.indexOf('px') === -1) {\n w = 0;\n }\n\n // Non pi... | [
"function(props) {\n props = defaultValue(props, {});\n\n this.title = props.title;\n\n /**\n * Gets or sets the list of items, ordered from bottom to top, with properties:\n * * `color`: CSS color description,\n * * `lineColor`: CSS color description,\n * * `multipleColors`: An array of CSS color descri... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Initialize environment variables
@throws InvalidPathException | [
"protected function initEnvironment(): void\n {\n $envFile = $this->getRootRelatedPath($this->getEnvFileName());\n\n $this->assertFileIsReadable($envFile);\n\n self::$envIsSet = (bool)(new Dotenv($this->getRootDirectory(), $this->getEnvFileName()))->load();\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 Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about File management:"
} |
All we do is transform the table into json and reutrn a JSONDataSource | [
"function ElementDataSource(config) {\n\tvar newData = [],\n\t\tnewColumns = [];\n\n\tvar headings = config.data.all('tr th');\n\n\theadings.each(function(th){\n\t\tnewColumns.push(th.getHtml());\n\t});\n\n\tconfig.data.all('tr').each(function(tr){\n\t\tvar newRow = {},\n\t\t\tpopulated = false;\n\n\t\tfor (var i =... | [
"@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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(NotebookInstanceSummary notebookInstanceSummary, ProtocolMarshaller protocolMarshaller) {\n\n if (notebookInstanceSummary == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marsh... | [
"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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Computes the histogram inside the specified region. Results are returned by calling {@link #getHistogram()}.
@param image Input image
@param region Region which is to be sampled | [
"public void computeHistogram( T image , RectangleRotate_F32 region ) {\n\n\t\tinterpolate.setImage(image);\n\n\t\tc = (float)Math.cos( region.theta );\n\t\ts = (float)Math.sin( region.theta );\n\n\t\tfor( int i = 0; i < histogram.length; i++ ) {\n\t\t\thistogram[i] = 0;\n\t\t}\n\n\t\t// if it is entirely inside th... | [
"@Override\n\tprotected void processImage(ImageBase image) {\n\t\t// The data type of 'image' was specified in onCreate() function\n\t\t// The line below will compute the gradient and store it in two images. One for the\n\t\t// gradient along the x-axis and the other along the y-axis\n\t\tgradient.process((GrayU8)i... | codesearchnet | {
"query": "Represent the Github post about Data analysis:",
"pos": "Represent the Github code about Data analysis:",
"neg": "Represent the Github code:"
} |
// Removes any *.zap files which aren't listed in the rootBolt. | [
"func (s *Scorch) removeOldZapFiles() error {\n\tliveFileNames, err := s.loadZapFileNames()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcurrFileInfos, err := ioutil.ReadDir(s.path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.rootLock.RLock()\n\n\tfor _, finfo := range currFileInfos {\n\t\tfname := finfo.Name()\... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Same as :meth:`CodeGenerator.visit_Output`, but do not call
``to_string`` on output nodes in generated code. | [
"def visit_Output(self, node, frame):\n \n if self.has_known_extends and frame.require_output_check:\n return\n\n finalize = self.environment.finalize\n finalize_context = getattr(finalize, 'contextfunction', False)\n finalize_eval = getattr(finalize, 'evalcontextfuncti... | [
"def generic_visit(self, node):\n \"\"\"\"\"\"\n # [[[cog\n # cog.out(\"print(pcolor('Enter generic visitor', 'magenta'))\")\n # ]]]\n # [[[end]]]\n # A generic visitor that potentially closes callables is needed to\n # close enclosed callables that are not at the en... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@SuppressWarnings(\"unchecked\")\r\n\tpublic EList<IfcReinforcementBarProperties> getCrossSectionReinforcementDefinitions() {\r\n\t\treturn (EList<IfcReinforcementBarProperties>) eGet(\r\n\t\t\t\tIfc2x3tc1Package.Literals.IFC_SECTION_REINFORCEMENT_PROPERTIES__CROSS_SECTION_REINFORCEMENT_DEFINITIONS,\r\n\t\t\t\ttru... | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the Github post about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Fail all replication operations with the exception that this node is no longer the replica with the sent index | [
"private void nodeNotOwnsBackup(InternalPartitionImpl partition) {\n int partitionId = getPartitionId();\n int replicaIndex = getReplicaIndex();\n NodeEngine nodeEngine = getNodeEngine();\n\n ILogger logger = getLogger();\n if (logger.isFinestEnabled()) {\n int currentR... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Get node with included mixin with keyfames selector like
`+nani(foo) { 0% {}}`
@param {number} i Token's index number
@returns {number} Length of the include | [
"function checkIncludeWithKeyframes2(i) {\n const start = i;\n let l;\n\n if (tokens[i].type === TokenType.PlusSign) i++;\n else return 0;\n\n if (l = checkIdentOrInterpolation(i)) i += l;\n else return 0;\n\n if (l = checkSC(i)) i += l;\n\n if (l = checkArguments(i)) i += l;\n else return 0;\n\n if (l = ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Adds assets to this site excluded scan targets by IP address range.
@param [String] from Beginning IP address of a range.
@param [String] to Ending IP address of a range. | [
"def exclude_ip_range(from, to)\n from_ip = IPAddr.new(from)\n to_ip = IPAddr.new(to)\n (from_ip..to_ip)\n raise 'Invalid IP range specified' if (from_ip..to_ip).to_a.size.zero?\n @excluded_scan_targets[:addresses] << IPRange.new(from, to)\n rescue ArgumentError => e\n raise \"#{e... | [
"func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
get transformer defined in class scope.
@return mixed|bool | [
"protected function getTransformer()\n {\n if (property_exists($this, $transformer = $this->getTransformerProperty())) {\n return app($this->{$transformer});\n }\n\n return false;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Will attempt to refill headers if we see more fields.
@param eachRow | [
"protected void tryRefillHeaders(JSONObject eachRow) {\n if (eachRow == null) {\n return;\n }\n if (eachRow.keySet().size() > baseFieldNames.size() - 1) {//i.e excluding timestamp, if the sizes are not same then we have not covered all field names\n baseFieldNames.clear();... | [
"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 Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Make sure that all tests were executed successfully. | [
"private function checkIfWorkersCrashed(): void\n {\n if ($this->db->query('SELECT COUNT(id) FROM tests')->fetchColumn(0) === '0') {\n return;\n }\n\n throw new RuntimeException(\n 'Some workers have crashed.' . PHP_EOL\n . '----------------------' . PHP_EOL\... | [
"public List<Rule> findRulesToExecute() {\n\n\t\tthis.logger.fine( \"Looking for rules to execute after an event was recorded for application \" + this.app );\n\t\tList<Rule> result = new ArrayList<> ();\n\t\tlong now = System.nanoTime();\n\n\t\t/*\n\t\t * For all the rules, find if there are events that should tri... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
getter for pubTypeList - gets The list of the publication types, O
@generated
@return value of the feature | [
"public FSArray getPubTypeList() {\n if (Header_Type.featOkTst && ((Header_Type)jcasType).casFeat_pubTypeList == null)\n jcasType.jcas.throwFeatMissing(\"pubTypeList\", \"de.julielab.jules.types.Header\");\n return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Header_Typ... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Installs all units from the manifest.
@return [Boolean, nil] if units were installed or nil if fails mid-install | [
"def install\n return false unless install? quiet: !(logger.level == Logger::DEBUG)\n\n UNIT_TYPES.each do |type|\n units[type.to_s.pluralize.to_sym].each do |unit|\n return nil unless install_unit(unit, type)\n end\n end\n true\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Display all configured key bindings. | [
"def list_keys(pymux, variables):\n \n # Create help string.\n result = []\n\n for k, custom_binding in pymux.key_bindings_manager.custom_bindings.items():\n needs_prefix, key = k\n\n result.append('bind-key %3s %-10s %s %s' % (\n ('-n' if needs_prefix else ''), key, custom_bind... | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
The unary {@code minus} operator. This is the equivalent to
the Java's {@code -} function. This function is not null-safe.
@param number a number.
@return {@code -number} | [
"@Pure\n\t@Inline(value = \"(-($1.byteValue()))\", constantExpression = true)\n\tpublic static int operator_minus(Byte number) {\n\t\treturn -number.byteValue();\n\t}"
] | [
"private static String identifyBadCast(Type lhs, Type rhs, Types types) {\n if (!lhs.isPrimitive()) {\n return null;\n }\n if (types.isConvertible(rhs, lhs)) {\n // Exemption if the rhs is convertible to the lhs.\n // This allows, e.g.: <byte> &= <byte> since the narrowing conversion can nev... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Log when connection is closed, if needed call callback. | [
"def connection_lost(self, exc):\n \"\"\"\"\"\"\n if exc:\n log.exception('disconnected due to exception')\n else:\n log.info('disconnected because of close/abort.')\n if self.disconnect_callback:\n self.disconnect_callback(exc)"
] | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Transpose a 2D matrix | [
"function transpose(matrix) {\n\t// For NxN matrix\n\tvar n = matrix[0].length;\n\tvar temp;\n\n\t// Walk through columns\n\tfor (var i = 0, j = 0; i < n; i++) {\n\t\tj = i;\n\t\t// Walk through rows\n\t\twhile (j < n) {\n\t\t\tif (i !== j) {\n\t\t\t\ttemp = matrix[i][j];\n\t\t\t\tmatrix[i][j] = matrix[j][i];\n\t\t... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// AddBranch mocks base method | [
"func (m *MockModel) AddBranch(arg0, arg1 string) error {\n\tret := m.ctrl.Call(m, \"AddBranch\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Builds a hidden form with data necessary to create a codepen. | [
"function buildForm(data) {\n var form = angular.element(\n '<form style=\"display: none;\" method=\"post\" target=\"_blank\" action=\"' +\n CODEPEN_API +\n '\"></form>'\n );\n var input = '<input type=\"hidden\" name=\"data\" value=\"' + escapeJsonQuotes(data) + '\" />';\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 instruction about Writing:",
"pos": "Represent the code about Writing:",
"neg": "Represent the code:"
} |
Reduces a timespan with multiple begin or end dates to a single earliest
begin date and a single latest end date.
@param timespan [DPLA::MAP::TimeSpan] the timespan to reduce
@return [DPLA::MAP::TimeSpan] an updated timespan | [
"def reduce_to_largest_span(timespan)\n timespan.begin = timespan.begin.sort.first\n timespan.end = timespan.end.sort.last\n timespan\n end"
] | [
"def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
get long-opt value(bool)
@param string $name
@param bool $default
@return bool | [
"public function lBoolOpt(string $name, $default = false): bool\n {\n $val = $this->lOpt($name);\n\n return \\is_bool($val) ? $val : (bool)$default;\n }"
] | [
"final static function f($op) {return dfcf(function(OP $op) {\n\t\t$c = df_con_hier($m = df_ar(dfpm($op), M::class), __CLASS__); /** @var string $c */ /** @var M $m */\n\t\treturn new $c($m);\n\t}, [dfp($op)]);}"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
******************** Methods ******************************************* | [
"@Override protected void handleEvents(final String EVENT_TYPE) {\n super.handleEvents(EVENT_TYPE);\n if (\"RECALC\".equals(EVENT_TYPE)) {\n resize();\n redraw();\n setBar(gauge.getCurrentValue());\n } else if (\"SECTION\".equals(EVENT_TYPE)) {\n sect... | [
"def new_station(self, _id, callSign, name, affiliate, fccChannelNumber):\n \"\"\"\"\"\"\n\n if self.__v_station:\n # [Station: 11440, WFLX, WFLX, Fox Affiliate, 29]\n # [Station: 11836, WSCV, WSCV, TELEMUNDO (HBC) Affiliate, 51]\n # [Station: 11867, TBS, Turner Broadc... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Assert true or invalid kind for annotation exception.
@param expression
the expression
@param element
the element
@param annotationClazz
the annotation clazz | [
"public static void assertTrueOrInvalidKindForAnnotationException(boolean expression, Element element,\n\t\t\tClass<? extends Annotation> annotationClazz) {\n\t\tif (!expression) {\n\t\t\tString msg = String.format(\"%s %s, only class can be annotated with @%s annotation\", element.getKind(),\n\t\t\t\t\telement, an... | [
"public StringAssert isString() {\n Node node = assertType(STRING);\n return new StringAssert((String) node.getValue()).as(\"Different value found in node \\\"%s\\\"\", path);\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Check if the profile name is valid | [
"def name_valid?(profile_name, profile_base_path)\n unless valid_puppet_class_name?(profile_name)\n error _('wizard.profile.invalid_name')%{words: Bebox::RESERVED_WORDS.join(', ')}\n return false\n end\n return true if profile_base_path.empty?\n # Check if the path name is valid\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 Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Deletes all the attributes and sends a clear event to all listeners. The persistent data object is also removed from a persistent
shared object.
@return true on success, false otherwise | [
"protected boolean clear() {\r\n log.debug(\"clear\");\r\n super.removeAttributes();\r\n // send confirmation to client\r\n ownerMessage.addEvent(Type.CLIENT_CLEAR_DATA, name, null);\r\n notifyModified();\r\n changeStats.incrementAndGet();\r\n return true;\r\n }"
... | [
"@Override\n public void unIndex(Class entityClazz, Object entity, EntityMetadata metadata, MetamodelImpl metamodel)\n {\n // we need not implement this method for Redis because\n // redis automatically removes indexes while performing delete\n logger.warn(\"Removing index is implicitly m... | codesearchnet | {
"query": "Represent the Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
-------------------------------- INFO -------------------------------- | [
"public static void info(Object message) {\n\t\tlog(Level.INFO, message, null, (Object[])null);\n\t}"
] | [
"public static function protect()\n\t{\n\t\t$eye = \\Cli::color(\"*\", 'green');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"PROTECT ALL HUMANS\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::color(\"\t\t\t ____[\\\\\", 'blue').$eye.\\Cli::color('---', 'blue').$eye.\\Cli:... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Parse the body of a close :class:`Frame`.
Returns a tuple (``code``, ``reason``) if successful otherwise
raise :class:`.ProtocolError`. | [
"def parse_close(data):\n '''\n '''\n length = len(data)\n if length == 0:\n return 1005, ''\n elif length == 1:\n raise ProtocolError(\"Close frame too short\")\n else:\n code, = unpack('!H', data[:2])\n if not (code in CLOSE_CODES or 3000 <= code < 5000):\n ... | [
"def parse_string_value_from_substring(substring) -> str:\n '''\n \n '''\n try:\n value = substring.split(':')[1]\n return str(value)\n except (ValueError, IndexError, TypeError, AttributeError):\n log.exception('Unexpected arg to parse_string_value_from_substring:')\n rai... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Resets the data and flash data containers | [
"protected function reset()\n\t{\n\t\t// create the data container\n\t\t$this->data = new DataContainer();\n\n\t\t// create the flash container\n\t\t$this->flash = new FlashContainer();\n\n\t\t// initialise the flash expiry store\n\t\t$this->flash->set(FlashContainer::EXPIRE_DATA_KEY, array());\n\n\t}"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
print basic statistics about an edge, e.g. layer/attribute counts | [
"def edge_statistics(docgraph):\n \"\"\"\"\"\"\n print \"Edge statistics\\n===============\"\n layer_counts = Counter()\n attrib_counts = Counter()\n source_counts = Counter()\n target_counts = Counter()\n for source, target, edge_attrs in docgraph.edges_iter(data=True):\n for layer in e... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Base32 uses the z-base-32 character set but encodes and decodes similar
// to base58, allowing it to create an even smaller result string.
// NOTE: There are many different base32 implementations so becareful when
// doing any interoperation. | [
"func (f ID) Base32() string {\n\n\tif f < 32 {\n\t\treturn string(encodeBase32Map[f])\n\t}\n\n\tb := make([]byte, 0, 12)\n\tfor f >= 32 {\n\t\tb = append(b, encodeBase32Map[f%32])\n\t\tf /= 32\n\t}\n\tb = append(b, encodeBase32Map[f])\n\n\tfor x, y := 0, len(b)-1; x < y; x, y = x+1, y-1 {\n\t\tb[x], b[y] = b[y], b... | [
"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:"
} |
Get an array of all region names on this page where a block may appear
@return array the internal names of the regions on this page where block may appear. | [
"public function get_regions() {\n if (is_null($this->defaultregion)) {\n $this->page->initialise_theme_and_output();\n }\n return array_keys($this->regions);\n }"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Language and programming:"
} |
// newAuthContext creates a new authentication context for st. | [
"func newAuthContext(\n\tst *state.State,\n\tclock clock.Clock,\n) (*authContext, error) {\n\tctxt := &authContext{\n\t\tst: st,\n\t\tclock: clock,\n\t\tlocalUserInteractions: authentication.NewInteractions(),\n\t}\n\n\t// Create a bakery service for discharging third-party caveat... | [
"@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 comment about Go programming language:",
"pos": "Represent the Github code about Go programming language:",
"neg": "Represent the Github code about programming:"
} |
Creates a project with a name. All other parameters are optional. They
are: `note`, `customer_id`, `budget`, `budget_type`,
`active_hourly_rate`, `hourly_rate`, `hourly_rates_per_service`, and
`archived`. | [
"def create_project(self, name, **kwargs):\n \n data = self._wrap_dict(\"project\", kwargs)\n data[\"customer\"][\"name\"] = name\n return self.post(\"/projects.json\", data=data)"
] | [
"def parse!\n unless raw.has_key?(:sales_orders)\n raw[:sales_orders] = {}\n end\n\n # force orders to be an array\n orders = raw[:sales_orders].fetch(:sales_order_summary, {})\n unless orders.kind_of?(Array)\n raw[:sales_orders][:sales_order_summary] = [orders]\n end\n\n... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Splits list into several sub-lists according to predicate.
@param <T>
@param list
@param predicate
@return | [
"public static final <T> List<List<T>> split(List<T> list, Predicate<T> predicate)\r\n {\r\n if (list.isEmpty())\r\n {\r\n return Collections.EMPTY_LIST;\r\n }\r\n List<List<T>> lists = new ArrayList<>();\r\n boolean b = predicate.test(list.get(0));\r\n int le... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github summarization about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code:"
} |
// NewTxAcceptedNtfn returns a new instance which can be used to issue a
// txaccepted JSON-RPC notification. | [
"func NewTxAcceptedNtfn(txHash string, amount float64) *TxAcceptedNtfn {\n\treturn &TxAcceptedNtfn{\n\t\tTxID: txHash,\n\t\tAmount: amount,\n\t}\n}"
] | [
"func (bcR *BlockchainReactor) AddPeer(peer p2p.Peer) {\n\tmsgBytes := cdc.MustMarshalBinaryBare(&bcStatusResponseMessage{bcR.store.Height()})\n\tif !peer.Send(BlockchainChannel, msgBytes) {\n\t\t// doing nothing, will try later in `poolRoutine`\n\t}\n\t// peer is added to the pool once we receive the first\n\t// b... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Determines if the authorizations are adequate
to execute the compiled object. Completion requires the list of
all database objects in a compiled statement. | [
"void checkAccessRights(Session session) {\n\n if (targetTable != null && !targetTable.isTemp()) {\n targetTable.checkDataReadOnly();\n session.checkReadWrite();\n }\n\n if (session.isAdmin()) {\n return;\n }\n\n for (int i = 0; i < sequences.lengt... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
/* (non-Javadoc)
@see com.att.cadi.aaf.v2_0.AAFCon#setInitURI(java.lang.String) | [
"@Override\n\tprotected void setInitURI(String uriString) throws CadiException {\n\t\ttry {\n\t\t\tinitURI = new URI(uriString);\n\t\t} catch (URISyntaxException e) {\n\t\t\tthrow new CadiException(e);\n\t\t}\n\t}"
] | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// GetKeyLoader returns the keyloader for a TLSConfig object. If the keyloader
// has not been initialized, it will first do so. | [
"func (t *TLSConfig) GetKeyLoader() *KeyLoader {\n\tt.keyloaderLock.Lock()\n\tdefer t.keyloaderLock.Unlock()\n\n\t// If the keyloader has not yet been initialized, do it here\n\tif t.KeyLoader == nil {\n\t\tt.KeyLoader = &KeyLoader{}\n\t}\n\treturn t.KeyLoader\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Do it all in one easy method call.
@param array $aOptions Config options. | [
"public static function skeDoosh(array $aOptions)\n {\n // Load JS\n echo <<<EOD\n<script>\n if (typeof jQuery == 'undefined') {\n skedLoadTag(\n 'http://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js',\n loadSkedJs\n );\n } else {\n loadS... | [
"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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// GetProcessList executes "SHOW PROCESSLIST" and returns the resultset. | [
"func GetProcessList(endpoint string) ([]Process, error) {\n\tvar dataSet []map[string]string\n\tvar err error\n\tif dataSet, err = readDataSet(endpoint, \"SHOW PROCESSLIST\"); err != nil {\n\t\treturn nil, err\n\t}\n\tprocesses := make([]Process, 0, len(dataSet))\n\tfor _, row := range dataSet {\n\t\tprocesses = a... | [
"protected function showHelp($msg = '', $code = 0)\n {\n $usage = Cli::color('USAGE:', 'brown');\n $commands = Cli::color('COMMANDS:', 'brown');\n $sOptions = Cli::color('SPECIAL OPTIONS:', 'brown');\n $pOptions = Cli::color('PUBLIC OPTIONS:', 'brown');\n $version = Cli::color(... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about PHP programming:"
} |
Get a list of packed nodes from a ingest definition. | [
"def _getSynIngestNodes(self, item):\n '''\n \n '''\n pnodes = []\n seen = item.get('seen')\n # Track all the ndefs we make so we can make sources\n ndefs = []\n\n # Make the form nodes\n tags = item.get('tags', {})\n forms = item.get('forms', {}... | [
"@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:"
} |
generate per-message header for a XML file | [
"def generate_message_h(directory, m):\n ''''''\n f = open(os.path.join(directory, 'mavlink_msg_%s.h' % m.name_lower), mode='w')\n t.write(f, '''\n#pragma once\n// MESSAGE ${name} PACKING\n\n#define MAVLINK_MSG_ID_${name} ${id}\n\nMAVPACKED(\ntypedef struct __mavlink_${name_lower}_t {\n${{ordered_fields: $... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Display the previous link
@access public
@param string $tag Text string to be displayed as the link. Defaults to '<<'
@return string | [
"function renderPrev($tag = '<<') {\n if ($this->total_rows == 0)\n return FALSE;\n \n if ($this->page > 1) {\n //return ' <a href=\"' . $this->php_self . '?page=' . ($this->page - 1) . '&' . $this->append . '\">' . $tag . '</a>';\n $pageno = $this->page ... | [
"public function rejectInlineListTool(Errors &$errors, Meta &$meta)\n {\n if (stristr((string)$meta->getValue(), '://listtool') !== false) {\n $errors->reject('You cannot embed the List Tool inline, use the provided fields and input [[listtool]] into the contents instead.');\n }\n }"
... | codesearchnet | {
"query": "Represent the comment about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
转换成美音
:param arpabet:
:return: | [
"def convert_to_american_phonetic_alphabet(self, arpabet):\n '''\n \n '''\n\n word = self._convert_to_word(arpabet=arpabet)\n\n if not word:\n return None\n\n return word.translate_to_american_phonetic_alphabet()"
] | [
"def _build_msg_content(self, msgtype='text', **kwargs):\n \n data = {'msgtype': msgtype}\n if msgtype == 'text':\n data[msgtype] = {'content': kwargs.get('content')}\n elif msgtype == 'image' or msgtype == 'voice' or msgtype == 'file':\n data[msgtype] = {'media_id'... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Initializes the logger object from the standard library. This method
should only be called inside the register method
@private | [
"def init_logger\n @logger = case @path\n when STDOUT_STREAM then Logger.new(STDOUT)\n when STDERR_STREAM then Logger.new(STDERR)\n else Logger.new(File.open(@path, 'a'))\n end\n @logger.datetime_format = @datetime_format\n @logger.sev_thres... | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
From filter array.
@param array $array
@return LocationRange | [
"public static function fromFilterArray(array $array): LocationRange\n {\n $coordinates = array_map(function (array $coordinate) {\n return Coordinate::createFromArray($coordinate);\n }, $array['coordinates']);\n\n return new Polygon($coordinates);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Get repository version.
@return string
Version. | [
"public function getVersion()\n {\n $process = new Process('git describe --tags HEAD', $this->directory);\n\n if ($process->run() == 0) {\n $version = trim($process->getOutput());\n } else {\n $process = new Process('git log --pretty=\"%H\" -n1 HEAD', $this->directory);... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// receive is the internal implementation of Conn.Receive, which can be called
// recursively to handle multi-part messages. | [
"func (c *Conn) receive() ([]Message, error) {\n\t// NB: All non-nil errors returned from this function *must* be of type\n\t// OpError in order to maintain the appropriate contract with callers of\n\t// this package.\n\t//\n\t// This contract also applies to functions called within this function,\n\t// such as che... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
<p>
{@inheritDoc}
</p><p>
According to the FAT file system specification, leading and trailing
spaces in the {@code name} are ignored by this method.
</p>
@param name {@inheritDoc}
@return {@inheritDoc}
@throws IOException {@inheritDoc} | [
"@Override\n public FatLfnDirectoryEntry addFile(String name) throws IOException {\n checkWritable();\n checkUniqueName(name);\n \n name = name.trim();\n final ShortName sn = makeShortName(name);\n \n final FatLfnDirectoryEntry entry =\n new FatLfnD... | [
"protected void createGenModelAnnotations()\n\t{\n\t\tString source = \"http://www.eclipse.org/emf/2002/GenModel\";\t\n\t\taddAnnotation\n\t\t (jvmIdentifiableElementEClass.getEOperations().get(0), \n\t\t source, \n\t\t new String[] \n\t\t {\n\t\t\t \"documentation\", \"<p>The identifier of a JvmIdentifiable... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Text generation:"
} |
returns the title for the given post/page
Params:
+id+:: ID, post_slug, or post_title - if this is nil it will use the @content variable (the current page) | [
"def obtain_the_title(check = nil)\n \tpost = obtain_record(check)\n \trender :inline => post.post_title if !post.blank?\n end"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Deletes the commerce discount rule from the database. Also notifies the appropriate model listeners.
@param commerceDiscountRule the commerce discount rule
@return the commerce discount rule that was removed
@throws PortalException | [
"@Override\n\tpublic com.liferay.commerce.discount.model.CommerceDiscountRule deleteCommerceDiscountRule(\n\t\tcom.liferay.commerce.discount.model.CommerceDiscountRule commerceDiscountRule)\n\t\tthrows com.liferay.portal.kernel.exception.PortalException {\n\t\treturn _commerceDiscountRuleLocalService.deleteCommerce... | [
"@Override\n public void unIndex(Class entityClazz, Object entity, EntityMetadata metadata, MetamodelImpl metamodel)\n {\n // we need not implement this method for Redis because\n // redis automatically removes indexes while performing delete\n logger.warn(\"Removing index is implicitly m... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
library.define('I (wait for|wait|look for|search|find) (?:the|a|an) (' + htmlTags.sort(function (a, b){return b-a}).join('|') + ')', | [
"function (action, selector, done) {\n\t\t\tvar ctx = this;\n\t\t\tctx.plugins[step.name].devices.each(function (device, next) {\n\t\t\t\twdApi.getElement({\n\t\t\t\t\tctx: ctx,\n\t\t\t\t\twait: Boolean(action.match(/wait/)),\n\t\t\t\t\tdevice: device,\n\t\t\t\t\tselector: selector\n\t\t\t\t}, next);\n\t\t\t}, done... | [
"function () {\n var value;\n\n if (input.charAt(i) !== 'u' || !$(/^url\\(/)) return;\n value = $(this.entities.quoted) || $(this.entities.variable) ||\n $(/^(?:(?:\\\\[\\(\\)'\"])|[^\\(\\)'\"])+/) || \"\";\n\n e... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return 'auth token' string, if the user credentials are already stored | [
"def has_credentials_stored():\n \n\n try:\n with open(credentials_file, 'r') as f:\n token = f.readline().strip()\n id = f.readline().strip()\n\n return token\n except Exception, e:\n return False"
] | [
"def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
only array, object now treated as iterable | [
"function isIterable (v) {\n return type.call(v) == OBJECT || type.call(v) == ARRAY\n}"
] | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@function reverseArray
@description
immutably reverse the order of an array
@param {Array<*>} array the array to reverse
@returns {Array<*>} the reversed array | [
"function reverseArray(array) {\n let index = array.length,\n newArray = [];\n\n while (index--) {\n newArray.push(array[index]);\n }\n\n return newArray;\n}"
] | [
"function random (seed) {\n /**\n * Creates a subgenerator from the current one\n *\n * @param {string} key Key of the subgenerator\n * @param {...number} params Parameters affecting the subgenerator's seed\n */\n\n function subgen (key, ...params) {\n return random(createSeed([...seed, keygen(key),... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Create takes the representation of a sample and creates it. Returns the server's representation of the sample, and an error, if there is any. | [
"func (c *samples) Create(sample *v1alpha1.Sample) (result *v1alpha1.Sample, err error) {\n\tresult = &v1alpha1.Sample{}\n\terr = c.client.Post().\n\t\tNamespace(c.ns).\n\t\tResource(\"samples\").\n\t\tBody(sample).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}"
] | [
"public static long createFileId(long containerId) {\n long id = BlockId.createBlockId(containerId, BlockId.getMaxSequenceNumber());\n if (id == INVALID_FILE_ID) {\n // Right now, there's not much we can do if the file id we're returning is -1, since the file\n // id is completely determined by the ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// dataToAuth generates list of byte blobs authenticated by MAC. | [
"func dataToAuth(version byte, public []byte, state []byte) [][]byte {\n\tout := [][]byte{\n\t\t{version},\n\t\tpublic,\n\t}\n\tif len(state) != 0 {\n\t\tout = append(out, state)\n\t}\n\treturn out\n}"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
method to replace a previous set header
@param view
@param padding
@param divider
@param height | [
"public void setHeader(@NonNull View view, boolean padding, boolean divider, DimenHolder height) {\n mDrawerBuilder.getHeaderAdapter().clear();\n if (padding) {\n mDrawerBuilder.getHeaderAdapter().add(new ContainerDrawerItem().withView(view).withDivider(divider).withHeight(height).withViewP... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// EditPost handles the request and edits the post | [
"func EditPost() echo.HandlerFunc {\n\n\t// swagger:route PUT /projects/{id}/posts/{pid} project post EditProjectPost\n\t//\n\t// Update the speficied post on the specified project board\n\t//\n\t// Consumes:\n\t// - application/json\n\t//\n\t//\tProduces:\n\t//\t- application/json\n\t//\n\t//\tSecurity:\n\t//\t\to... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about Web development:",
"pos": "Represent the Github code about Web development:",
"neg": "Represent the Github code about Software development:"
} |
/*
(non-Javadoc)
@see javax.jms.BytesMessage#writeInt(int) | [
"@Override\n\tpublic void writeInt(int value) throws JMSException\n {\n try\n {\n getOutput().writeInt(value);\n }\n catch (IOException e)\n {\n throw new FFMQException(\"Cannot write message body\",\"IO_ERROR\",e);\n }\n }"
] | [
"public javax.jms.Destination getDestination() throws ControlException {\n if (_destination == null) {\n _destination =\n (javax.jms.Destination) getJndiControl().getResource(getDestinationProperties().sendJndiName(),\n javax.jms.Destination.class);\n }\n ... | codesearchnet | {
"query": "Represent the Github summarization about Java programming:",
"pos": "Represent the Github code about Java programming:",
"neg": "Represent the Github code:"
} |
Creates a method call expression
@class
@constructor | [
"function MethodCallExpression(name, args) {\n /**\n * Gets or sets the name of this method\n * @type {String}\n */\n this.name = name;\n /**\n * Gets or sets an array that represents the method arguments\n * @type {Array}\n */\n this.args = [];\n if (_.isArray(args))\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set the object attributes for a single object and resolve the
qualifiers. This sets attributes for Properties, Methods, and
Parameters. | [
"def _set_new_object(self, new_obj, inherited_obj, new_class, superclass,\n qualifier_repo, propagated, type_str):\n \n assert isinstance(new_obj, (CIMMethod, CIMProperty, CIMParameter))\n if inherited_obj:\n inherited_obj_qual = inherited_obj.qualifiers\n ... | [
"public String getNotifierClass()\n {\n StringBuffer sb = new StringBuffer(getShortName());\n sb.append(\"Notifier\");\n\n //\n // If the event set declaration has any parameterized types, then include them on\n // the notifier class as well. Currently, these can only be param... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Стартовый метод
@version 16.01.2019
@author Дмитрий Щербаков <atomcms@ya.ru> | [
"public function start()\n {\n $user_info = $this->dic['user'];\n if (is_array($user_info) && count($user_info) > 0) {\n $this->response->setData((new RunAfterGet($this->dic))->run($user_info));\n } else {\n $this->response->setData(Response::error401('Необходимо автори... | [
"final protected function v($name = null) {return dfak($this, function() {\n\t\t$result = dfa($this->_data, 'value', []);\n\t\t/**\n\t\t * 2016-06-29\n\t\t * Что интересно, при смене области действия настроек с глобальной на другую (сайт или магазин)\n\t\t * поле «value» может почему-то содержать не массив,\n\t\t *... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.