query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// QueueReactor provides a reactor that listens on the supplied // queue for data and error messages but if the queue gets closed then //the reactor is closed along
[ "func QueueReactor(ps *PressureStream) (qr Reactor) {\n\tqr = ReactIdentity()\n\tGoDefer(\"ReactorQueue:Manage\", func() {\n\t\tdefer qr.Close()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase d, ok := <-ps.Signals:\n\t\t\t\tif !ok {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tqr.Send(d)\n\t\t\tcase e, ok := <-ps.Errors:\n\t\t\t\...
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about File management:" }
Close the component view This removes the component from the model, closing the view and leaving the form in a dirty state. @method close
[ "function() {\n var t = this;\n UI.hideToolTips();\n UI.pageView.model.get('components').remove(t.model);\n t.connectMonitor(false);\n t.view.remove();\n }" ]
[ "function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Given a jobId and host, returns the N most recent events in its history on that host in the cluster.
[ "@Override\n public List<TaskStatusEvent> getJobHistory(final JobId jobId, final String host)\n throws JobDoesNotExistException {\n final Job descriptor = getJob(jobId);\n if (descriptor == null) {\n throw new JobDoesNotExistException(jobId);\n }\n final ZooKeeperClient client = provider.get(...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Method overload from the standard HttpServletRequest API.<p> @see javax.servlet.http.HttpServletResponse#addHeader(java.lang.String, java.lang.String)
[ "@Override\n public void addHeader(String name, String value) {\n\n if (isSuspended()) {\n return;\n }\n\n if (CmsRequestUtil.HEADER_CONTENT_TYPE.equalsIgnoreCase(name)) {\n setContentType(value);\n return;\n }\n\n if (m_cachingRequired && !m_in...
[ "@Override\n\tpublic void registerServlet(Class<? extends Servlet> servletClass,\n\t\t\t\t\t\t\t\tString[] urlPatterns, Dictionary<String, ?> initParams,\n\t\t\t\t\t\t\t\tHttpContext httpContext) throws ServletException {\n\t\tLOG.warn(\"Http service has already been stopped\");\n\t}" ]
codesearchnet
{ "query": "Represent the Github summarization about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about Software development:" }
Creates a fixed configuration for the supplied Map. Only key/value pairs from this map will be present in the final configuration. There is no implicit override from system properties.
[ "public static Config getFixedConfig(@Nonnull Map<String, String> config)\n {\n return getFixedConfig(new MapConfiguration(config));\n }" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Insert a new user and attach to it the organization admin policy @param {Object} job @param {Function} next
[ "function insertOrgAdminUser (job, next) {\n if (job.user) {\n const { id, name } = job.user\n const { id: organizationId } = job.organization\n\n userOps.insertUser(job.client, { id, name, organizationId }, (err, res) => {\n if (err) return next(err)\n job.user.id = res.rows[0].id\n...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
// GetUserQuotaInfo implements the BlockServer interface for BlockServerRemote
[ "func (b *BlockServerRemote) GetUserQuotaInfo(ctx context.Context) (info *kbfsblock.QuotaInfo, err error) {\n\tctx = rpc.WithFireNow(ctx)\n\tb.log.LazyTrace(ctx, \"BServer: GetUserQuotaInfo\")\n\tdefer func() {\n\t\tb.log.LazyTrace(ctx, \"BServer: GetUserQuotaInfo done (err=%v)\", err)\n\t}()\n\tres, err := b.getCo...
[ "@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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Actual query with caching results in local for current request @inheritdoc
[ "protected function queryInternal($method, $fetchMode = null)\n {\n if ($method !== '') {\n $rawSql = $this->getRawSql();\n $requestLocalCacheKey = implode('', [\n __CLASS__,\n $method,\n $fetchMode,\n $this->db->dsn,\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 text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Send data to the device. If the write fails for any reason, an :obj:`IOError` exception is raised. :param buf: the data to send. :type buf: list(int) :return: success status. :rtype: bool
[ "def write_data(self, buf):\n \n result = self.devh.controlMsg(\n usb.ENDPOINT_OUT + usb.TYPE_CLASS + usb.RECIP_INTERFACE,\n usb.REQ_SET_CONFIGURATION, buf, value=0x200, timeout=50)\n if result != len(buf):\n raise IOError('pywws.device_libusb.USBDevice.write_da...
[ "def interface_required(interface):\n \n def _interface_required(func):\n \"\"\"Internal decorator that wraps around the decorated function.\n\n Args:\n func (function): function being decorated\n\n Returns:\n The wrapper function.\n ...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
<code> .google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata video_classification_details = 5; </code>
[ "public com.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata\n getVideoClassificationDetails() {\n if (detailsCase_ == 5) {\n return (com.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata)\n details_;\n }\n return com.google.cloud.data...
[ "@java.lang.Deprecated\n public java.util.Map<java.lang.String, com.google.cloud.automl.v1beta1.DataType> getFields() {\n return getFieldsMap();\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns all files in the workspace that match a glob. If the client does not support workspace/files, it falls back to searching the file system directly. @param string $glob @return Promise <string[]> The URIs
[ "public function find(string $glob): Promise\n {\n return $this->client->workspace->xfiles()->then(function (array $textDocuments) use ($glob) {\n $uris = [];\n foreach ($textDocuments as $textDocument) {\n $path = Uri\\parse($textDocument->uri)['path'];\n ...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Create a GraphKit object of the contours.
[ "def graphkit(*args)\n\t\tif args.size == 0\n\t\t\tconts = @last_contours\n\t\telse\n\t\t\tconts = contours(*args)\n\t\tend\n\t\tgraphs = conts.map do |val, cons|\n\t\t\tunless cons[0]\n\t\t\t\tnil\n\t\t\telse\n\t\t\t\t(cons.map do |con|\n\t# \t\t\t\tp con\n\t\t\t\t\tcontour = con.transpose\n\t\t\t\t\tkit = CodeRun...
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NormalizedLinearCoefficients returns a fixed linear coefficient pair.
[ "func NormalizedLinearCoefficients(m, b, stdev, avg float64) LinearCoefficientSet {\n\treturn LinearCoefficientSet{\n\t\tM: m,\n\t\tB: b,\n\t\tStdDev: stdev,\n\t\tAvg: avg,\n\t}\n}" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// MarshalJSONBuf marshal buff to json - template
[ "func (j *Archiver) MarshalJSONBuf(buf fflib.EncodingBuffer) error {\n\tif j == nil {\n\t\tbuf.WriteString(\"null\")\n\t\treturn nil\n\t}\n\tvar err error\n\tvar obj []byte\n\t_ = obj\n\t_ = err\n\tbuf.WriteString(`{\"Untar\":`)\n\t/* Falling back. type=func(io.Reader, string, *archive.TarOptions) error kind=func *...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Get the Database Name. Always override this method. @return The database name.
[ "public String getDatabaseName()\n {\n // ****Override this****, If not, try to figure it out\n if (m_vRecordList != null)\n if (this.getRecordlistAt(0) != null)\n return this.getRecordlistAt(0).getDatabaseName();\n return DBConstants.BLANK; // Blank\n }" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
// SetBandwidthType sets the BandwidthType field's value.
[ "func (s *DeleteBandwidthRateLimitInput) SetBandwidthType(v string) *DeleteBandwidthRateLimitInput {\n\ts.BandwidthType = &v\n\treturn s\n}" ]
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
// SetFirstUtteredDate sets the FirstUtteredDate field's value.
[ "func (s *UtteranceData) SetFirstUtteredDate(v time.Time) *UtteranceData {\n\ts.FirstUtteredDate = &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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns the number of records in the database, optionally limited by the provided select object. @param Zend_Db_Select $select @return Int Number of records
[ "public function count(Zend_Db_Select $select = null) {\n if (!$select) {\n $select = $this->select();\n }\n $select->from($this->getName(), array('count' => new Zend_Db_Expr('COUNT(*)')));\n if ($row = $this->fetchRow($select)) {\n return (int)$row->count;\n ...
[ "public static function insert(array $data)\n {\n $self = static::getInstance();\n\n $data = static::filterColumns($data);\n\n if (!\\count($data)) {\n throw new DbException(\n \"Invalid field names of table `{$self->name}`. Please check use of `insert()` method\"\n...
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
https://github.com/samsonasik/ErrorHeroModule/blob/6af28a0520257caf9e8e66d5aa35819c2e4327cf/src/HeroTrait.php#L81
[ "private function createErrorHandler()\n {\n /*\n * @param int $severity\n * @param string $message\n * @param string $file\n * @param int $line\n * @return void\n * @throws ErrorException if error is not within the error_reporting mask.\n */\n ...
[ "func DAODrainList() []common.Address {\n\treturn []common.Address{\n\t\tcommon.HexToAddress(\"0xd4fe7bc31cedb7bfb8a345f31e668033056b2728\"),\n\t\tcommon.HexToAddress(\"0xb3fb0e5aba0e20e5c49d252dfd30e102b171a425\"),\n\t\tcommon.HexToAddress(\"0x2c19c7f9ae8b751e37aeb2d93a699722395ae18f\"),\n\t\tcommon.HexToAddress(\...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Compute overall OR between bitmaps two-by-two. This function runs in linear time with respect to the number of bitmaps. @param bitmaps input bitmaps @return aggregated bitmap
[ "public static RoaringBitmap naive_or(RoaringBitmap... bitmaps) {\n RoaringBitmap answer = new RoaringBitmap();\n for (int k = 0; k < bitmaps.length; ++k) {\n answer.naivelazyor(bitmaps[k]);\n }\n answer.repairAfterLazy();\n return answer;\n }" ]
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Round array values recursively @param array $data Target array @param integer $precision The number of decimal digits to round to @return array
[ "public static function roundValues(array $data, $precision = 2)\n {\n return self::filterValuesRecursively($data, function($value) use ($precision) {\n $value = is_numeric($value) ? round($value, $precision) : $value;\n $value = empty($value) ? 0 : $value;\n\n return $val...
[ "def formatDecimalMark(value, decimalmark='.'):\n \n # We have to consider the possibility of working with decimals such as\n # X.000 where those decimals are important because of the precission\n # and significant digits matters\n # Using 'float' the system delete the extre desimals with 0 as a valu...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Checks if file exists in path on the remote FTP/SFTP system. DOES NOT OPEN the file when it's exists ``` php <?php $I->seeFileFound('UserModel.php','app/models'); ?> ``` @param $filename @param string $path
[ "public function seeFileFound($filename, $path = '')\n {\n $files = $this->grabFileList($path);\n $this->debug(\"see file: {$filename}\");\n $this->assertContains($filename, $files, \"file {$filename} not found in {$path}\");\n }" ]
[ "public static function getPathConsole() {\n\t\t\n\t\t$console = isset($_SERVER[\"SCRIPT_NAME\"]) ? $_SERVER[\"SCRIPT_NAME\"] : Config::getOption(\"phpScriptName\");\n\t\t\n\t\tif (!$console) {\n\t\t\t$configPath = Console::getHumanReadablePath(Config::getOption(\"configPath\"));\n\t\t\tConsole::writeError(\"please...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Method to get a Status from the cache. @param _id id of the status wanted. @return Status @throws CacheReloadException on error
[ "public static Status get(final long _id)\n throws CacheReloadException\n {\n final Cache<Long, Status> cache = InfinispanCache.get().<Long, Status>getCache(Status.IDCACHE4STATUS);\n if (!cache.containsKey(_id)) {\n Status.getStatusFromDB(Status.SQL_ID4STATUS, _id);\n }\n ...
[ "public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about N/A:" }
Retrieves the Pane object for the given paneId @param {!string} paneId - id of the pane to retrieve @return {?Pane} the Pane object or null if a pane object doesn't exist for the pane @private
[ "function _getPane(paneId) {\n paneId = _resolvePaneId(paneId);\n\n if (_panes[paneId]) {\n return _panes[paneId];\n }\n\n return null;\n }" ]
[ "function _destroyEditorIfNotNeeded(document) {\n if (!(document instanceof DocumentManager.Document)) {\n throw new Error(\"_destroyEditorIfUnneeded() should be passed a Document\");\n }\n if (document._masterEditor) {\n // findPaneForDocument tries to locate the pane in ...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// Stream streams the build logs to the server.
[ "func (c *client) Stream(id int64, rc io.ReadCloser) error {\n\turi := fmt.Sprintf(pathStream, c.base, id)\n\terr := c.post(uri, rc, nil)\n\n\treturn err\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Marshall the given parameter object.
[ "public void marshall(AudioSelectorSettings audioSelectorSettings, ProtocolMarshaller protocolMarshaller) {\n\n if (audioSelectorSettings == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(au...
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Transform a <code>&lt;plugins ... /&gt;</code> structure.
[ "protected void parseProcessEnginePlugins(Element element, List<ProcessEnginePluginXml> plugins) {\n for (Element chidElement : element.elements()) {\n if(PLUGIN.equals(chidElement.getTagName())) {\n parseProcessEnginePlugin(chidElement, plugins);\n }\n }\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Error gives a human-readable description of the error.
[ "func (k KeyError) Error() string {\n\treturn fmt.Sprintf(\"couldn't create key for object %+v: %v\", k.Obj, k.Err)\n}" ]
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the Github instruction about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
// SetLimit sets the Limit field's value.
[ "func (s *DescribeConfigurationAggregatorsInput) SetLimit(v int64) *DescribeConfigurationAggregatorsInput {\n\ts.Limit = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns all <code>step</code> elements @return list of <code>step</code>
[ "public List<Step<Job<T>>> getAllStep()\n {\n List<Step<Job<T>>> list = new ArrayList<Step<Job<T>>>();\n List<Node> nodeList = childNode.get(\"step\");\n for(Node node: nodeList)\n {\n Step<Job<T>> type = new StepImpl<Job<T>>(this, \"step\", childNode, node);\n list.add(type);...
[ "def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// return a slice of s3 tags associated with the given s3 bucket. Essentially // s3.GetBucketTagging, except returns an empty slice instead of an error when // there are no tags.
[ "func getTagSetS3(s3conn *s3.S3, bucket string) ([]*s3.Tag, error) {\n\trequest := &s3.GetBucketTaggingInput{\n\t\tBucket: aws.String(bucket),\n\t}\n\n\tresponse, err := s3conn.GetBucketTagging(request)\n\tif ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == \"NoSuchTagSet\" {\n\t\t// There is no tag set ass...
[ "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 summarization about AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code:" }
Throws a ParameterException unless exactly one parameter is defined.
[ "public void assertExactlyOneDefined(final String param1, final String param2) {\n // Asserting that exactly one is defined is the same as asserting that they do not have the same\n // value for definedness.\n if (isPresent(param1) == isPresent(param2)) {\n throw new ParameterException(\n Str...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Calculates offset for absolute level if path is a version history or launch path. @param path Path @param resourceResolver Resource resolver @return 0 or offset if a version history or launch path.
[ "private static int getAbsoluteLevelOffset(@NotNull String path, @NotNull ResourceResolver resourceResolver) {\n Matcher versionHistoryMatcher = VERSION_HISTORY_PATTERN.matcher(path);\n if (versionHistoryMatcher.matches()) {\n return 3;\n }\n Matcher legacyVersionHistoryMatcher = LEGACY_VERSION_HIS...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Load a theme from the specified configuration file. Parameters: filename: The name of the filename to load. source: A description of where the theme was loaded from.
[ "def from_file(cls, filename, source):\n \n _logger.info('Loading theme %s', filename)\n\n try:\n config = configparser.ConfigParser()\n config.optionxform = six.text_type # Preserve case\n with codecs.open(filename, encoding='utf-8') as fp:\n co...
[ "def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more x...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Render current state of application, verbose.
[ "def application_simple_state(context, application):\n \n state_machine = get_state_machine(application)\n state = state_machine.get_state(application)\n return state.name" ]
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Close cleans up connections associated with requests
[ "func (c *SessionContext) Close() error {\n\tclosers := c.TransferClosers()\n\tfor _, closer := range closers {\n\t\tc.Debugf(\"Closing %v.\", closer)\n\t\tcloser.Close()\n\t}\n\tif c.clt != nil {\n\t\treturn trace.Wrap(c.clt.Close())\n\t}\n\treturn nil\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github summarization about Computer Networking:", "pos": "Represent the Github code about Computer Networking:", "neg": "Represent the Github code about programming:" }
// SetRequestCancelExternalWorkflowExecutionDecisionAttributes sets the RequestCancelExternalWorkflowExecutionDecisionAttributes field's value.
[ "func (s *Decision) SetRequestCancelExternalWorkflowExecutionDecisionAttributes(v *RequestCancelExternalWorkflowExecutionDecisionAttributes) *Decision {\n\ts.RequestCancelExternalWorkflowExecutionDecisionAttributes = v\n\treturn s\n}" ]
[ "@Override\n public void setContent(final InputStream content, final String contentType,\n final Collection<URI> checksums, final String originalFileName,\n final StoragePolicyDecisionPoint storagePolicyDecisionPoint)\n throws UnsupportedOperationExc...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Java programming:" }
Passes a data point off to the storage handler plugin if it has been configured. @param tsdb The TSDB from which to grab the SEH plugin @param dp The data point to process @param e The exception that caused this
[ "void handleStorageException(final TSDB tsdb, final IncomingDataPoint dp, \n final Exception e) {\n final StorageExceptionHandler handler = tsdb.getStorageExceptionHandler();\n if (handler != null) {\n handler.handleError(dp, e);\n }\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// StatusCode gets status code
[ "func (p *ProxyWriter) StatusCode() int {\n\tif p.code == 0 {\n\t\t// per contract standard lib will set this to http.StatusOK if not set\n\t\t// by user, here we avoid the confusion by mirroring this logic\n\t\treturn http.StatusOK\n\t}\n\treturn p.code\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Deserializes the encrypted serialized model instances, tx, in a queryset of transactions. Note: each transaction instance contains encrypted JSON text that represents just ONE model instance.
[ "def deserialize_transactions(self, transactions=None, deserialize_only=None):\n \n\n if (\n not self.allow_self\n and transactions.filter(producer=socket.gethostname()).exists()\n ):\n raise TransactionDeserializerError(\n f\"Not deserializing ow...
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Inspects given $inputValue and potentially converts it into a dedicated value object. @param mixed $inputValue @return \Netgen\Bundle\EzSyliusBundle\Core\FieldType\SyliusProduct\Value The potentially converted input value
[ "protected function createValueFromInput($inputValue)\n {\n if (!is_int($inputValue)) {\n return $inputValue;\n }\n\n return new Value(\n $this->productRepository->find($inputValue)\n );\n }" ]
[ "public function choices(): HasMany\n {\n return $this->hasMany(\\Iocaste\\Microservice\\Foundation\\Data\\Models\\Parameter\\Choice::class);\n }" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Attempts to persist the role field changes @return [true, false, error] true if saved, false if no save! method, Error on some error
[ "def persist_role_changes! \n puts \"Troles::Common::Storage::BaseMany.persist_role_changes!\" if Troles::Common::Config.log_on?\n if !role_subject.respond_to? :save\n puts \"could not save since no #save method on subject: #{role_subject}\" if Troles::Common::Config.log_on?\n retu...
[ "def create\n upsert do\n # NOTE: create!() is not used because assign to @record to draw form.\n # Otherwise, @record would be in nil so failure at edgarj/_form rendering.\n #\n # NOTE2: valid? after create() calls validate_on_update. This is not\n # an expected behavior. ...
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Handle all HTTP request. @return HttpResponse|BinaryFileResponse
[ "public function serve()\n {\n $this->applyMiddleware();\n\n $requestMethod = $this->getRequest()->method();\n\n if ( ! in_array($requestMethod, $this->getRequest()->allowedHttpVerbs())) {\n return $this->response->send(null, HttpResponse::HTTP_METHOD_NOT_ALLOWED);\n }\n\n ...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about File management:" }
Reads file contents as stream. @param bool $psr7Stream = false @return resource|\Psr\Http\Message\StreamInterface
[ "public function readStream($psr7Stream = false)\n {\n $response = $this->api->request('GET', $this->absolutePath());\n\n if ($psr7Stream) {\n return $response->getBody();\n }\n\n return StreamWrapper::getResource($response->getBody());\n }" ]
[ "public function run()\n {\n $this->loadMiddleware();\n\n //~ Default response\n $response = new HttpMessage\\Response();\n //$response->getBody()->write('-- static --');\n\n //~ Get response\n $stack = new HttpMiddleware\\Stack($response, $this->middleware);\n ...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Get GIF by ID Endpoint Returns a GIF given that GIF's unique ID @param api_key Giphy API Key. @param gif_id Filters results by specified GIF ID. @param [Hash] opts the optional parameters @return [InlineResponse2001]
[ "def gifs_gif_id_get(api_key, gif_id, opts = {})\n data, _status_code, _headers = gifs_gif_id_get_with_http_info(api_key, gif_id, opts)\n return data\n end" ]
[ "def load(element_key, options = {})\n parameter = { query: options }\n parameter[:basic_auth] = @auth\n\n response = self.class.get(\"/elements/#{element_key}\", parameter)\n\n if response.success?\n searchResponseHeader = SearchResponseHeader.new(response)\n searchResponseHeader....
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
success. @param Circuit $circuit
[ "protected function success(Circuit $circuit)\n {\n $circuit->resetFailure();\n\n $this->dispatcher->dispatch(CircuitEvents::SUCCESS, (new CircuitEvent($circuit)));\n $this->writeToStore($circuit);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
The manifest definition of the stencilset as a dict.
[ "def manifest(self):\n \"\"\"\"\"\"\n if not self._manifest:\n with open(self.manifest_path) as man:\n self._manifest = json.load(man)\n return self._manifest" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
bias_variable generates a bias variable of a given shape.
[ "def bias_variable(shape):\n \"\"\"\"\"\"\n initial = tf.constant(0.1, shape=shape)\n return tf.Variable(initial)" ]
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
@param Request $request @param string $path @param int $status @return RedirectResponse @throws \LogicException @throws \InvalidArgumentException
[ "public function createSignedRedirectResponse(Request $request, $path, $status = 302)\n {\n return new RedirectResponse($this->httpUtils->generateUri($request, $this->uriSigner->sign($path)), $status);\n }" ]
[ "public function handleError(HTTPInputRequest $request, HTTPOutputResponse $response, \\Throwable $e) : void\n {\n if ($e instanceof HTTPError) {\n $e->generateErrorResponse();\n }\n #$error = (new HTTPServerError([], $e->getMessage()))->generateErrorResponse();\n throw $e;...
codesearchnet
{ "query": "Represent the post about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code about Software development:" }
Return count of badges by $type between $startDate and $endDate @param number|unknown $startDate @param number|unknown $endDate
[ "public function getBadgesByRangeDate($type, $level, $startDate = '', $endDate = '')\n {\n $em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\n\n $startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\n $endDateTime = \\DateTime::createFromFormat('d/m/Y...
[ "final function isActive() {return /** @var int $y1 */ /** @var int $y2 */\n\t\t($y1 = df_year()) < ($y2 = $this->expYear()) || ($y1 === $y2 && df_month() <= $this->expMonth())\n\t;}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// HandlerFunc provides a Martini compatible handler interface
[ "func (ra *RemoteAddr) HandlerFunc(w http.ResponseWriter, r *http.Request) {\n\tra.handleActualRequest(w, r)\n}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns the starting line number of an excerpt for a given line number. @param int $line Line number to calculate start index for. @return int
[ "public function getExcerptStart($line)\n {\n if ($this->isExcerptOnly() === false) {\n return 1;\n }\n\n return max(1, $line - floor($this->getExcerptSize() / 2));\n }" ]
[ "def augment_cells_no_span(self, rows, source):\n \n # TODO: Hardwired str transform.\n # 4-tuple: morerows, morecols, offset, cellblock\n # - morerows: The number of additional rows this cells spans\n # - morecols: The number of additional columns this cell spans\n # - off...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
execute external executor/method @this Evaluation @param {Object} params instruction keywords ($exec, $method, $args) @return {Promise|Any} result
[ "function eval$exec(params) {\n var $exec = params.$exec;\n var $method = params.$method;\n var executor = this.js._executors[$exec];\n if (!executor) throw new Error('unknown executor ' + $exec);\n if ($method) {\n if (typeof executor[$method] != 'function')\n throw new Error('unknown method ' + $meth...
[ "def bind(self, fn: \"Callable[[Any], Reader]\") -> 'Reader':\n \n \"\"\"\n return Reader(lambda x: fn(self.run(x)).run(x))" ]
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Marks a single conversation as read. Returns the updated `conversation dict`_. WARNING: This method is currently not documented in the official API and might therefore be unstable.
[ "def conversations_read(self, id):\n \n id = self.__unpack_id(id)\n url = '/api/v1/conversations/{0}/read'.format(str(id))\n return self.__api_request('POST', url)" ]
[ "function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
BitmapFactory fails to decode the InputStream.
[ "public synchronized static Bitmap load(InputStream is, int width, int height) {\n BitmapFactory.Options opt = null;\n try {\n opt = new BitmapFactory.Options();\n if (width > 0 && height > 0) {\n if (is.markSupported()) {\n is.mark(is.available(...
[ "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 post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
// Close closes the tar archive, flushing any unwritten // data to the underlying writer.
[ "func (tw *Writer) Close() error {\n\tif tw.err != nil || tw.closed {\n\t\treturn tw.err\n\t}\n\ttw.Flush()\n\ttw.closed = true\n\tif tw.err != nil {\n\t\treturn tw.err\n\t}\n\n\t// trailer: two zero blocks\n\tfor i := 0; i < 2; i++ {\n\t\t_, tw.err = tw.w.Write(zeroBlock)\n\t\tif tw.err != nil {\n\t\t\tbreak\n\t\t...
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about File management:" }
// SetHealthCheckEnabled sets the HealthCheckEnabled field's value.
[ "func (s *TargetGroup) SetHealthCheckEnabled(v bool) *TargetGroup {\n\ts.HealthCheckEnabled = &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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Raise a time-out if an element of the asynchronous sequence takes too long to arrive. Note: the timeout is not global but specific to each step of the iteration.
[ "async def timeout(source, timeout):\n \n async with streamcontext(source) as streamer:\n while True:\n try:\n item = await wait_for(anext(streamer), timeout)\n except StopAsyncIteration:\n break\n else:\n yield item" ]
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about File management:" }
from A means node.level == 0 from . import B means node.level == 1 from .A means node.level == 1
[ "def handle_relative_import(self, node):\n \n no_file = os.path.abspath(os.path.join(self.filenames[-1], os.pardir))\n skip_init = False\n\n if node.level == 1:\n # Same directory as current file\n if node.module:\n name_with_dir = os.path.join(no_fil...
[ "def BETWEEN(a, b):\n \n if any((isinstance(x, ConditionalElement) for x in (a, b))):\n raise TypeError(\n \"A ConditionalElement can't be used as an operator condition.\")\n else:\n return P(lambda x: a <= x <= b)" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// StreamInterceptor provides a mock function with given fields: srv, stream, info, handler
[ "func (_m *Auth) StreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\tret := _m.Called(srv, stream, info, handler)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(interface{}, grpc.ServerStream, *grpc.StreamServerInfo, grpc.StreamHandler...
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetRealtimeEndpointInfo sets the RealtimeEndpointInfo field's value.
[ "func (s *DeleteRealtimeEndpointOutput) SetRealtimeEndpointInfo(v *RealtimeEndpointInfo) *DeleteRealtimeEndpointOutput {\n\ts.RealtimeEndpointInfo = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Function that gets called again as soon as it finishes (forever).
[ "def loop():\n \"\"\"\"\"\"\n print(\"Straight\")\n board.digital_write(L_CTRL_1, 1)\n board.digital_write(L_CTRL_2, 0)\n board.analog_write(PWM_L, 245)\n board.digital_write(R_CTRL_1, 1)\n board.digital_write(R_CTRL_2, 0)\n board.analog_write(PWM_R, 245)\n board.sleep(2.0)\n\n print(\...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Call this after you've created all the PawnSpot you need and are ready to add them to the board.
[ "def finalize(self, initial=True):\n \"\"\"\"\"\"\n if getattr(self, '_finalized', False):\n return\n if (\n self.proxy is None or\n not hasattr(self.proxy, 'name')\n ):\n Clock.schedule_once(self.finalize, 0)\n return\n ...
[ "function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NewField returns a new field corresponding to the polynomial poly // and generator α. The Reed-Solomon encoding in QR codes uses // polynomial 0x11d with generator 2. // // The choice of generator α only affects the Exp and Log operations.
[ "func NewField(poly, α int) *Field {\n\tif poly < 0x100 || poly >= 0x200 || reducible(poly) {\n\t\tpanic(\"gf256: invalid polynomial: \" + strconv.Itoa(poly))\n\t}\n\n\tvar f Field\n\tx := 1\n\tfor i := 0; i < 255; i++ {\n\t\tif x == 1 && i != 0 {\n\t\t\tpanic(\"gf256: invalid generator \" + strconv.Itoa(α) +\n\t\t...
[ "def rs_correct_errata(msg_in, synd, err_pos, fcr=0, generator=2): # err_pos is a list of the positions of the errors/erasures/errata\n ''''''\n global field_charac\n msg = bytearray(msg_in)\n # calculate errata locator polynomial to correct both errors and erasures (by combining the errors positions gi...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get Data from all controls of this section @since 1.0.0 @see \uix\load @return array Array of sections data structured by the controls
[ "public function get_data() {\n\n\t\tif ( empty( $this->data ) ) {\n\t\t\t$data = parent::get_data();\n\t\t\tif ( ! empty( $data[ $this->slug ] ) ) {\n\t\t\t\t$this->data = $data[ $this->slug ];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->data;\n\t}" ]
[ "def render_flow(self, data):\n \n\n self.render_tree(data)\n\n # then reconstruct a new ODT document with the generated content\n for status in self.__save_output():\n yield status" ]
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
starts the web interface and possibly other processes
[ "def start_aikif():\n \n if sys.platform[0:3] == 'win':\n os.system(\"start go_web_aikif.bat\") \n else:\n os.system(\"../aikif/web_app/web_aikif.py\")\n import webbrowser\n import time\n time.sleep(1)\n webbrowser.open('http://127.0.0.1:5000')" ]
[ "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:" }
Use this API to fetch authorizationpolicy_csvserver_binding resources of given name .
[ "public static authorizationpolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{\n\t\tauthorizationpolicy_csvserver_binding obj = new authorizationpolicy_csvserver_binding();\n\t\tobj.set_name(name);\n\t\tauthorizationpolicy_csvserver_binding response[] = (authorizationpolicy_csvserv...
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Natural Language Processing:" }
Extracts a byte from a BV, where the index refers to the byte in a big-endian order :param index: the byte to extract :return: An 8-bit BV
[ "def get_byte(self, index):\n \n pos = self.size() // 8 - 1 - index\n return self[pos * 8 + 7 : pos * 8]" ]
[ "def create_response_pdu(self, data):\n \n log.debug('Create single bit response pdu {0}.'.format(data))\n bytes_ = [data[i:i + 8] for i in range(0, len(data), 8)]\n\n # Reduce each all bits per byte to a number. Byte\n # [0, 0, 0, 0, 0, 1, 1, 1] is intepreted as binary en is deci...
codesearchnet
{ "query": "Represent the sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
Converts API rating identifier to constant value. @param string $identifier @return int
[ "protected static function getRatingByStringIdentifier(string $identifier): int\n {\n switch ($identifier) {\n case 's':\n return PostInterface::RATING_SAFE;\n\n case 'q':\n return PostInterface::RATING_QUESTIONABLE;\n\n case 'e':\n ...
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
**********************************************************************************************************************************************************************
[ "public function getGroupeFromTypeEvenement($idTypeEvenement = 0)\n {\n $req = \"select groupe from typeEvenement where idTypeEvenement = '\".$idTypeEvenement.\"'\";\n $res = $this->connexionBdd->requete($req);\n $fetch = mysql_fetch_assoc($res);\n\n return $fetch['groupe'];\n }" ]
[ "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 comment about N/A:", "pos": "Represent the code about N/A:", "neg": "Represent the code about Programming:" }
Allow User to remove their selected context from Member @param User $user Currently authenticated User @param Member $member Member to remove Member from @return boolean
[ "public function detachMemberTagMember(User $user, Member $member)\r\n {\r\n return $user->selected_context->id === $member->id;\r\n }" ]
[ "def _unlinkUser(self):\n \n KEY = \"linked_contact_uid\"\n\n # Nothing to do if no user is linked\n if not self.hasUser():\n return False\n\n user = self.getUser()\n username = user.getId()\n\n # Unset the UID from the User Property\n user.setMembe...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Samples from Multinomial Normal Distribution. @param mean @param covariance @return A multinomialGaussianSample from the Multinomial Normal Distribution
[ "public static double[] multinomialGaussianSample(double[] mean, double[][] covariance) {\n MultivariateNormalDistribution gaussian = new \n MultivariateNormalDistribution(mean, covariance);\n gaussian.reseedRandomGenerator(RandomGenerator.getThreadLocalRandom().nextLong());\n return...
[ "def is_stationary(self):\n \"\"\"\n # for disconnected matrices, the stationary distribution depends on the estimator, so we can't compute\n # it directly. Therefore we test whether the initial distribution is stationary.\n return np.allclose(np.dot(self._Pi, self._Tij), self._Pi)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Deletes the ephemeral node. Make sure that no future watches will fire. @throws InterruptedException @throws KeeperException
[ "synchronized public void shutdown() throws InterruptedException, KeeperException {\n m_shutdown = true;\n es.shutdown();\n es.awaitTermination(365, TimeUnit.DAYS);\n }" ]
[ "public AutoCloseable registerErrorHandler(final EventHandler<Exception> theHandler) {\n this.transport.registerErrorHandler(theHandler);\n return new SubscriptionHandler<>(\n new Exception(\"Token for finding the error handler subscription\"), this.unsubscribeException);\n }" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Get the configured server from the SSH config. @param string $host @return string|null
[ "protected function getConfiguredServer($host)\n {\n if ($config = $this->getSshConfig($this->getSystemUser())) {\n return $config->findConfiguredHost($host);\n }\n }" ]
[ "protected function configureApp ()\n {\n $this->envData['APP_ENV'] = $this->choice (\"Choose environment. [local|production]\", ['local', 'production'], 0);\n $this->envData['APP_KEY'] = \"\";\n $this->envData['APP_DEBUG'] = $this->confirm (\"Enable debugging?\", 'yes') ? \"true\" : \"f...
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:" }
AIX support to gather and return (averaged) IO stats.
[ "def _iostat_aix(interval, count, disks):\n '''\n \n '''\n log.debug('DGM disk iostat entry')\n\n if disks is None:\n iostat_cmd = 'iostat -dD {0} {1} '.format(interval, count)\n elif isinstance(disks, six.string_types):\n iostat_cmd = 'iostat -dD {0} {1} {2}'.format(disks, interval,...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Generate an HTML image element. @param string $url @param string $alt @param array $attributes @param bool $secure @return \Illuminate\Support\HtmlString
[ "public function image($url, $alt = null, $attributes = [], $secure = null)\n {\n $attributes['alt'] = $alt;\n\n return $this->toHtmlString('<img src=\"' . $this->url->asset($url,\n $secure) . '\"' . $this->attributes($attributes) . '>');\n }" ]
[ "public static function __callstatic($name, $params)\n {\n $knownStyles = static::getKnownStyles();\n $styleID = $knownStyles[$name];\n\n $style = static::style($styleID);\n\n // target string is expected to be:\n $targetString = $params[0][0];\n\n $element = new Tex...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Performs immediate task start - fire and forget. Used in web requests to start task in background. @param integer $taskId @throws \Exception
[ "public static function runImmediateTask($taskId)\n {\n $command = new ProcessBuilder();\n $command->setWorkingDirectory(Yii::getAlias('@app'));\n $command->setPrefix(self::getPhpBinary());\n if (strncasecmp(PHP_OS, 'WIN', 3) === 0) {\n $command->add('yii');\n } else...
[ "@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 text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Configures the classpath which we'll use to load service classes.
[ "public void setClasspath (Path path)\n {\n _cloader = ClasspathUtils.getClassLoaderForPath(getProject(), path, \"narya\");\n\n // set the parent of the classloader to be the classloader used to load this task, rather\n // than the classloader used to load Ant, so that we have access to Nary...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the description about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code about Software development:" }
Returns a constant like Module#const_get no matter what namespace it's nested in. Returns nil if the constant is not found.
[ "def any_const_get(name)\n return name if name.is_a?(Module)\n begin\n klass = Object\n name.split('::').each {|e|\n klass = klass.const_get(e)\n }\n klass\n rescue\n nil\n end\n end" ]
[ "function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// SetRunId sets the RunId field's value.
[ "func (s *SignalExternalWorkflowExecutionFailedEventAttributes) SetRunId(v string) *SignalExternalWorkflowExecutionFailedEventAttributes {\n\ts.RunId = &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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Save the values if any have been changed @param array $values @param int $userId @return int
[ "protected function _updateTrack(array $values, $userId = null)\n {\n if (null === $userId) {\n $userId = $this->currentUser->getUserId();\n }\n // \\MUtil_Echo::track($values);\n if ($this->tracker->filterChangesOnly($this->_respTrackData, $values)) {\n $where ...
[ "function ResetUserArray()\n {\n $this->_user_data = array();\n $this->_user_data = $this->ResetTempUserArray();\n\n // The user data array is not read actually\n $this->SetUserDataReadFlag(false);\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Builds a {@link Batcher} which will provide batches to the provided {@code listener}. Note: The builder is required to have either a time or size bound to build a batch.
[ "public <T> Batcher<T> build(BatchListener<T> listener) {\n requireNonNull(listener);\n checkState(maxSize != UNSET_INT || interval != UNSET_INT, \"All batchers are required to have either a time or size bound.\");\n\n ExecutorService handler = (listenerService == null ? newCachedThreadPool() :...
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
// getEnterpriseResourceIter is used to retrieve an iterator over an enterprise // only table.
[ "func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus...
[ "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:" }
Logs errors and onNext at info level using slf4j {@link Logger}. @param <T> the return generic type @return a logging {@link Observer}
[ "public static <T> Observer<? super T> log() {\n return new Observer<T>() {\n\n @Override\n public void onCompleted() {\n // do nothing\n }\n\n @Override\n public void onError(Throwable e) {\n log.error(e.getMessage(), e);\n...
[ "@Override\n protected <T1, R extends Completes<?>> R dispatchQuery(BiFunction<P, T1, R> query, T1 routable1) {\n throw new UnsupportedOperationException(\"query protocols are not supported by this router by default\");\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:" }
// ServerFromDisk 既存ディスクをコピーして新たなディスクを作成するビルダー
[ "func ServerFromDisk(client APIClient, name string, sourceDiskID int64) CommonServerBuilder {\n\tb := newServerBuilder(client, name)\n\tb.hasCommonProperty = true\n\tb.hasNetworkInterfaceProperty = true\n\tb.hasDiskProperty = true\n\tb.hasDiskSourceProperty = true\n\tb.hasDiskEditProperty = true\n\tb.hasServerEvent...
[ "func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// WriteFlatCoords2 writes flat coordinates 2.
[ "func WriteFlatCoords2(w io.Writer, byteOrder binary.ByteOrder, flatCoords []float64, ends []int, stride int) error {\n\tif err := WriteUInt32(w, byteOrder, uint32(len(ends))); err != nil {\n\t\treturn err\n\t}\n\toffset := 0\n\tfor _, end := range ends {\n\t\tif err := WriteFlatCoords1(w, byteOrder, flatCoords[off...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Bootstrap the application services.
[ "public function boot()\n {\n $this->app->when(HipChatChannel::class)\n ->needs(HipChat::class)\n ->give(function () {\n return new HipChat(\n new HttpClient,\n config('services.hipchat.url'),\n config('services....
[ "@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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
## CustomInput constructor Creates a new instance of CustomInput
[ "function CustomInput() {\n\n /**\n * ### CustomInput.input\n *\n * The HTML input element\n */\n this.input = null;\n\n /**\n * ### CustomInput.placeholder\n *\n * The placeholder text for the input form\n *\n * Some types...
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetSourceFile sets the SourceFile field's value.
[ "func (s *PutFileEntry) SetSourceFile(v *SourceFileSpecifier) *PutFileEntry {\n\ts.SourceFile = v\n\treturn s\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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
/* @return @throws IOException @throws ProtocolException
[ "public HttpURLConnection getConnection() throws IOException, ProtocolException {\n HttpURLConnection conn = HttpUtils.getHttpConnection(constructUrl(), expectedResponseCode, allowedUnexpectedResponseCodes, 30, method, headers, streamToWrite);\n return conn;\n }" ]
[ "public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about N/A:" }
Add a new element to 'Departments' @param \AgentSIB\Diadoc\Api\Proto\Department $value
[ "public function addDepartments(\\AgentSIB\\Diadoc\\Api\\Proto\\Department $value)\n {\n if ($this->Departments === null) {\n $this->Departments = new \\Protobuf\\MessageCollection();\n }\n\n $this->Departments->add($value);\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Returns a list of all nodes ultimately downstream of the given node in the dependency graph, in topological order.
[ "def all_downstreams(self, node, graph=None):\n \"\"\"\"\"\"\n if graph is None:\n graph = self.graph\n nodes = [node]\n nodes_seen = set()\n i = 0\n while i < len(nodes):\n downstreams = self.downstream(nodes[i], graph)\n for downstream_nod...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Darken a hex color.
[ "def darken_color(color, amount):\n \"\"\"\"\"\"\n color = [int(col * (1 - amount)) for col in hex_to_rgb(color)]\n return rgb_to_hex(color)" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Clean up the specified input text by stripping unwanted characters, converting idioms to their canonical form, converting number words to numbers (three => 3), and converting ordinal words to numeric ordinals (third => 3rd)
[ "protected static String preNormalize(String text) {\n String normalizedText = text.toLowerCase();\n normalizedText = Chronic.numericizeNumbers(normalizedText);\n normalizedText = normalizedText.replaceAll(\"['\\\"\\\\.]\", \"\");\n normalizedText = normalizedText.replaceAll(\"([/\\\\-,@])\", \" $1 \");...
[ "def get_head(name, line, releases):\n \n if not line:\n return False\n # if this line begins with an invalid starting character, return early.\n # invalid characters are those used by various markup languages to introduce a new\n # new list item\n for char in INVALID_LINE_START:\n #...
codesearchnet
{ "query": "Represent the Github sentence about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about Software development:" }
Marshall the given parameter object.
[ "public void marshall(DescribeServerRequest describeServerRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describeServerRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(de...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Parse a namespace declaration. @return NamespaceNode
[ "private function _namespace() {\n $node = new NamespaceNode();\n $this->matchDocComment($node);\n $this->mustMatch(T_NAMESPACE, $node);\n if ($this->currentType === T_STRING) {\n $name = $this->namespaceName();\n $node->addChild($name, 'name');\n }\n $this->matchHidden($node);\n $bod...
[ "def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Regular expressions:" }
Loads the content group with the supplied name. @param string $moduleAndGroupName eg 'pages.home' @return LoadedContentGroup
[ "public function load(string $moduleAndGroupName) : LoadedContentGroup\n {\n $loadedContentGroup = $this->actualContentLoaderService->load($moduleAndGroupName);\n\n return new LoadedContentGroup(\n $loadedContentGroup->getConfig(),\n $this->createPreviewContentGroup($loadedCon...
[ "public function Base_GetAppSettingsMenuItems_Handler($Sender) {\n $Menu = &$Sender->EventArguments['SideMenu'];\n $Menu->AddItem('Forum', T('Forum'));\n $Menu->AddLink('Forum', T('Tagging'), 'settings/tagging', 'Garden.Settings.Manage');\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
<p> The log groups. </p> @return The log groups.
[ "public java.util.List<LogGroup> getLogGroups() {\n if (logGroups == null) {\n logGroups = new com.amazonaws.internal.SdkInternalList<LogGroup>();\n }\n return logGroups;\n }" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Get the list of row names @return
[ "public ArrayList<String> getDataRows() {\n\t\tArrayList<String> rows = new ArrayList<String>();\n\t\tfor (String row : rowLookup.keySet()) {\n\t\t\tif (this.isMetaDataRow(row)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tHeaderInfo hi = rowLookup.get(row);\n\t\t\tif (!hi.isHide()) {\n\t\t\t\trows.add(row);\n\t\t\t}\n\t\t...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
handleValues @param array $args @return array|mixed @since 3.4.6
[ "protected function handleValues(array $args)\n {\n if (\\count($args) === 1) {\n $values = $args[0];\n } else {\n $values = [];\n\n foreach ($args as $i => $arg) {\n $values['Value ' . ($i + 1)] = $arg;\n }\n }\n\n return $va...
[ "private function getFormOptionsDeclaration()\n {\n\n // we got a max instances allowed in normality tags\n $formOptions = json_encode( $this->formOptions );\n $formOptions = Php::varExport( $formOptions, true );\n\n $this->class->classComponents[] = new VariableDeclaration(\n ...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }