query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Checks whether the folder has a default file of the type container page.<p>
@param folder the folder to check
@return <code>true</code> if the folder has a default file of the type container page | [
"private boolean hasContainerPageDefaultFile(CmsResource folder) {\n\n try {\n CmsResource defaultFile = A_CmsUI.getCmsObject().readDefaultFile(\n folder,\n CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);\n return (defaultFile != null) && CmsResourceTypeXmlCont... | [
"function(terria) {\n CatalogGroup.call(this, terria, \"csw\");\n\n /**\n * Gets or sets the URL of the CSW server. This property is observable.\n * @type {String}\n */\n this.url = \"\";\n\n /**\n * Gets or sets the template XML string to POST to the CSW server to query for catalog items. If this pro... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about AWS Redshift:"
} |
// WaitForReparentJournal is part of the MysqlDaemon interface | [
"func (fmd *FakeMysqlDaemon) WaitForReparentJournal(ctx context.Context, timeCreatedNS int64) error {\n\treturn nil\n}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// ResourceList returns a string representation of a resource list in a human readable format. | [
"func ResourceList(resources v1.ResourceList) string {\n\tresourceStrings := make([]string, 0, len(resources))\n\tfor key, value := range resources {\n\t\tresourceStrings = append(resourceStrings, fmt.Sprintf(\"%v=%v\", key, value.String()))\n\t}\n\t// sort the results for consistent log output\n\tsort.Strings(reso... | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the text about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code about programming:"
} |
Get the data transfer protocol version supported in the cluster
assuming all the datanodes have the same version.
@return the data transfer protocol version supported in the cluster | [
"public int getDataTransferProtocolVersion() throws IOException {\n synchronized (dataTransferVersion) {\n if (dataTransferVersion == -1) {\n // Get the version number from NN\n try {\n int remoteDataTransferVersion = namenode.getDataTransferProtocolVersion();\n updateDataTra... | [
"func (c StatusSetCmd) Info() *cmd.Info {\n\treturn jujucmd.Info(&cmd.Info{\n\t\tName: StatusSetCmdName,\n\t\tArgs: \"<class> <id> <status>\",\n\t\tPurpose: \"update the status of a payload\",\n\t\tDoc: `\n\"payload-status-set\" is used to update the current status of a registered payload.\nThe <class> and <i... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
of the unbound provider ( | [
"public synchronized T get(Scope scope) {\n if (instance != null) {\n return instance;\n }\n\n if (providerInstance != null) {\n if (isProvidingSingletonInScope) {\n instance = providerInstance.get();\n //gc\n providerInstance = null;\n return instance;\n }\n\n ... | [
"def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Executes the given statement
@param stmt The statement to be executed
@throws JdbcServerException In case that the execution was not successful | [
"@Override\n public DataSet executeStatement(String stmt) throws JdbcServerException {\n log.info(\"Received execute statement request: \" + stmt);\n Message response = handleMessageAndCheckResponse(JdbcMessage.execute(stmt));\n return dataSetCreator.createDataSet(response, getMessageType(re... | [
"@Override\n public void onError(Session session, Throwable thr) {\n if (onError != null) {\n Object args[] = new Object[onError.getMethod().getParameterTypes().length];\n MethodData methodData = onError.getMethodData();\n //check if method has optional Session parameter\n... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Releases the lock
@return boolean true on success, false otherwise | [
"public function release(): bool\n {\n $success = true;\n if (is_resource($this->filePointer)) {\n // FIXME: The lockfile should be unlocked at this point but this will again lead to race conditions,\n // so we need to find out how to do this in a safe way. Keeping the lock fi... | [
"public function stream_seek($offset, $whence) {\n $ret = fseek($this->objStream, $offset, $whence);\n\n // fseek returns 0 for success, -1 for failure.\n // We need to return TRUE for success, FALSE for failure.\n return $ret === 0;\n }"
] | codesearchnet | {
"query": "Represent the post about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code:"
} |
Generate an instance context for the instance, the context is capable of
performing various actions. All instance actions are proxied to the context
@return \Twilio\Rest\Preview\Sync\Service\SyncListContext Context for this
SyncListInstance | [
"protected function proxy() {\n if (!$this->context) {\n $this->context = new SyncListContext(\n $this->version,\n $this->solution['serviceSid'],\n $this->solution['sid']\n );\n }\n\n return $this->context;\n }"
] | [
"@Override\n public List<EventExecution> getEventExecutions(String eventHandlerName, String eventName, String messageId, int max) {\n throw new UnsupportedOperationException(\"This method is not implemented in CassandraExecutionDAO. Please use ExecutionDAOFacade instead.\");\n }"
] | codesearchnet | {
"query": "Represent the Github post about Twilio:",
"pos": "Represent the Github code about Twilio:",
"neg": "Represent the Github code:"
} |
Creates a new image.
@param width Number of columns in the image.
@param height Number of rows in the image.
@return New instance of the image. | [
"public T createImage( int width , int height ) {\n\t\tswitch( family ) {\n\t\t\tcase GRAY:\n\t\t\t\treturn (T)GeneralizedImageOps.createSingleBand(getImageClass(),width,height);\n\n\t\t\tcase INTERLEAVED:\n\t\t\t\treturn (T)GeneralizedImageOps.createInterleaved(getImageClass(), width, height, numBands);\n\n\t\t\tc... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Check if all slaves have become available | [
"protected function allSlavesReady()\n {\n if ($this->status === self::STATE_STARTING || $this->status === self::STATE_EMERGENCY) {\n $readySlaves = $this->slaves->getByStatus(Slave::READY);\n $busySlaves = $this->slaves->getByStatus(Slave::BUSY);\n return count($readySlav... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Make the URL people should start at for this version of coverage.py. | [
"def _make_url(major, minor, micro, releaselevel, serial):\n \"\"\"\"\"\"\n url = \"https://django-pagination-bootstrap.readthedocs.io\"\n if releaselevel != 'final':\n # For pre-releases, use a version-specific URL.\n url += \"/en/\" + _make_version(major, minor, micro, releaselevel, serial)... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
协程的发送
@param $send
@param bool $oneway
@param callable|null $set
@return TcpClientRequestCoroutine | [
"public function coroutineSend($send, $oneway = false, callable $set = null)\n {\n return Pool::getInstance()->get(TcpClientRequestCoroutine::class)->init($this, $send, $oneway, $set);\n }"
] | [
"public function onMessage(Connection $conn, Message $msg)\n {\n $this->totalRdyCount--;\n $this->stats[\"messagesReceived\"]++;\n\n yield $this->handleMessage($msg);\n // 收到消息后更新rdy\n // 李文告知不需要每次收到消息就调整RDY\n // $this->maybeUpdateRDY($conn);\n }"
] | codesearchnet | {
"query": "Represent the Github text about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
Run a raw, unprepared query against the PDO connection.
@param string $query
@return bool | [
"public function unprepared($query)\n {\n return $this->run($query, [], function ($query) {\n if ($this->pretending()) {\n return true;\n }\n\n $this->recordsHaveBeenModified(\n $change = $this->getPdo()->exec($query) !== false\n );... | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(UpdateFindingsRequest updateFindingsRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (updateFindingsRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(up... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Attach to this module all bubble-events from loaded modules
This create a Bubble-Event to answer to each event that bubles from the module's modules.
Also attach to all modules' events and handler to dispatch the event.
@param string $id source module id | [
"function (id) {\n\t\t\tif (!_.isString(id))\n\t\t\t\treturn false;\n\n\t\t\tvar module = this.getModule(id),\n\t\t\t\tevents;\n\t\t\tthis.e.log&&this.e.log(\"Attaching module's events...\",'system');\n\t\t\tif (module != undefined && (events=module.getEvents()) && !_.isEmpty(events)) {\n\t\t\t\tfor (e in events)\n... | [
"def set_form form\n raise \"Form is nil in set_form\" if form.nil?\n @form = form\n @id = form.add_widget(self) if !form.nil? and form.respond_to? :add_widget\n # 2009-10-29 15:04 use form.window, unless buffer created\n # should not use form.window so explicitly everywhere.\n # added... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Start a server.
@return the http server
@throws Exception the exception | [
"public synchronized HttpServer<Buffer, Buffer> start() throws Exception {\n\t\tif (server == null) {\n\t\t\tserver = createProtocolListener();\n\t\t}\n\t\treturn server;\n\t}"
] | [
"@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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Shift 8bit unsigned integer to the right. The result is pushed onto the stack.
Optimizations:
* If 1nd or 2nd op is 0 then
do nothing
* If 2nd op is < 4 then
unroll loop | [
"def _shru8(ins):\n \n op1, op2 = tuple(ins.quad[2:])\n\n if is_int(op2):\n op2 = int8(op2)\n\n output = _8bit_oper(op1)\n if op2 == 0:\n output.append('push af')\n return output\n\n if op2 < 4:\n output.extend(['srl a'] * op2)\n outpu... | [
"public void fastClear(int index) {\n assert index >= 0 && index < numBits;\n int wordNum = index >> 6;\n int bit = index & 0x03f;\n long bitmask = 1L << bit;\n bits[wordNum] &= ~bitmask;\n // hmmm, it takes one more instruction to clear than it does to set... any\n ... | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// New channel config implementation | [
"func New(channelID string, options ...Option) (*ChannelConfig, error) {\n\topts, err := prepareOpts(options...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ChannelConfig{channelID: channelID, opts: opts}, 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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Search the qemu-img binary in the same binary of the qemu binary
for avoiding version incompatibily.
:returns: qemu-img path or raise an error | [
"def _get_qemu_img(self):\n \n qemu_img_path = \"\"\n qemu_path_dir = os.path.dirname(self.qemu_path)\n try:\n for f in os.listdir(qemu_path_dir):\n if f.startswith(\"qemu-img\"):\n qemu_img_path = os.path.join(qemu_path_dir, f)\n excep... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Generate an empirical background model in color-magnitude space.
INPUTS:
catalog: Catalog object
OUTPUTS:
background | [
"def backgroundCMD(self, catalog, mode='cloud-in-cells', weights=None):\n \n\n # Select objects in annulus\n cut_annulus = self.roi.inAnnulus(catalog.lon,catalog.lat)\n color = catalog.color[cut_annulus]\n mag = catalog.mag[cut_annulus]\n\n # Units are (deg^2)\n so... | [
"def fileParameter(self, comp):\n \n for row in range(self.nrows()):\n p = self._parameters[row]\n if p['parameter'] == 'filename':\n # ASSUMES COMPONENT IN ONE SELECTION\n if comp in p['selection']:\n return row"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Cleans the url for protocol prefix and trailing slash and replaces special characters
with the given replacement.
:param url: The url of the request.
:param replacement: A string that is used to replace special characters. | [
"def clean_url(url, replacement='_'):\n \n cleaned = re.sub(r'/$', '', re.sub(r'https?://', '', url))\n for character in '/ _ ? & : ; %'.split():\n cleaned = cleaned.replace(character, replacement)\n return cleaned"
] | [
"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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// ComputeIntDiv computes the result of a / b, both a and b are integer. | [
"func ComputeIntDiv(sc *variable.StatementContext, a, b Datum) (d Datum, err error) {\n\tswitch a.Kind() {\n\tcase KindInt64:\n\t\tx := a.GetInt64()\n\t\tswitch b.Kind() {\n\t\tcase KindInt64:\n\t\t\ty := b.GetInt64()\n\t\t\tif y == 0 {\n\t\t\t\treturn d, nil\n\t\t\t}\n\t\t\tr, err1 := DivInt64(x, y)\n\t\t\td.SetIn... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) IMachinesetSnapshotFolder(request *IMachinesetSnapshotFolder) (*IMachinesetSnapshotFolderResponse, error) {\n\tresponse := new(IMachinesetSnapshotFolderResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response, ni... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Verify the provided proxy callback URL. | [
"def validate_callback(self, service, pgturl, pgtid, pgtiou):\n \"\"\"\"\"\"\n if not proxy_allowed(service):\n raise UnauthorizedServiceProxy(\"%s is not authorized to use proxy authentication\" % service)\n\n if not is_scheme_https(pgturl):\n raise InvalidProxyCallback(\... | [
"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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// SetIntegerValue sets the IntegerValue field's value. | [
"func (s *EntitlementValue) SetIntegerValue(v int64) *EntitlementValue {\n\ts.IntegerValue = &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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
@toto implement feature
@param array $items | [
"public function merge(array $items)\n {\n $this->items = $this->arrayMergeRecursive($this->items, $items);\n $this->nestedKeyCache = [];\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:"
} |
// Remove removes an object from the Registry. | [
"func (r *Registry) Remove(item types.ManagedObjectReference) {\n\tr.applyHandlers(func(o RegisterObject) {\n\t\to.RemoveObject(item)\n\t})\n\n\tr.m.Lock()\n\tdelete(r.objects, item)\n\tdelete(r.handlers, item)\n\tdelete(r.locks, item)\n\tr.m.Unlock()\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// ConvertTo converts the histogram bucket values into `Tp`. | [
"func (hg *Histogram) ConvertTo(sc *stmtctx.StatementContext, tp *types.FieldType) (*Histogram, error) {\n\thist := NewHistogram(hg.ID, hg.NDV, hg.NullCount, hg.LastUpdateVersion, tp, hg.Len(), hg.TotColSize)\n\titer := chunk.NewIterator4Chunk(hg.Bounds)\n\tfor row := iter.Begin(); row != iter.End(); row = iter.Nex... | [
"def getPostStates(self):\n '''\n \n '''\n self.aNrmNow = self.mNrmNow - self.cNrmNow\n self.aLvlNow = self.aNrmNow*self.pLvlNow # Useful in some cases to precalculate asset level\n return None"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetServices sets the Services field's value. | [
"func (s *ErrorRootCause) SetServices(v []*ErrorRootCauseService) *ErrorRootCause {\n\ts.Services = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Creates a new active person. | [
"def _create_user(\n self, username, email, short_name, full_name,\n institute, password, is_admin, **extra_fields):\n \n\n # Create Person\n person = self.model(\n username=username, email=email,\n short_name=short_name, full_name=full_name,\n ... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Add the session cookie to the application response.
@param \Symfony\Component\HttpFoundation\Response $response
@param \Illuminate\Session\SessionInterface $session
@return void | [
"protected function addCookieToResponse(Response $response, SessionInterface $session)\n\t{\n\t\tif ($this->usingCookieSessions())\n\t\t{\n\t\t\t$this->manager->driver()->save();\n\t\t}\n\n\t\tif ($this->sessionIsPersistent($config = $this->manager->getSessionConfig()))\n\t\t{\n\t\t\t$response->headers->setCookie(n... | [
"public function register()\n {\n parent::register();\n\n $this->singleton(Contracts\\Agent::class, function ($app) {\n /** @var \\Illuminate\\Http\\Request $request */\n $request = $app['request'];\n\n return new Agent($request->server->all());\n });\n ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Register a {@link GeometryEditSuspendHandler} that catches events that signal the editing process was suspended.
@param handler
The {@link GeometryEditSuspendHandler} to add as listener.
@return The registration of the handler. | [
"public JsHandlerRegistration addGeometryEditSuspendHandler(final GeometryEditSuspendHandler handler) {\n\t\torg.geomajas.plugin.editing.client.event.GeometryEditSuspendHandler h;\n\t\th = new org.geomajas.plugin.editing.client.event.GeometryEditSuspendHandler() {\n\n\t\t\tpublic void onGeometryEditSuspend(Geometry... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// SetTags sets the Tags field's value. | [
"func (s *WorkspaceRequest) SetTags(v []*Tag) *WorkspaceRequest {\n\ts.Tags = v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// ErrorInternal does Error 500. | [
"func ErrorInternal(responseWriter http.ResponseWriter, err error) bool {\n\treturn Error(responseWriter, http.StatusInternalServerError, err)\n}"
] | [
"async def get_object_proxy_location(self, client, pid):\n \n try:\n return (await client.describe(pid)).get(\"DataONE-Proxy\")\n except d1_common.types.exceptions.DataONEException:\n # Workaround for older GMNs that return 500 instead of 404 for describe()\n pa... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
Depth-first search for active pipeline. | [
"function findActivePipeline(pipelineId, isRoot) {\n var infoMap = STATUS_MAP.pipelines[pipelineId];\n if (!infoMap) {\n return null;\n }\n\n // This is an active leaf node.\n if (infoMap.children.length == 0 && infoMap.status != 'done') {\n return pipelineId;\n }\n\n // Sort children by start time onl... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetLexiconNames sets the LexiconNames field's value. | [
"func (s *SynthesisTask) SetLexiconNames(v []*string) *SynthesisTask {\n\ts.LexiconNames = v\n\treturn s\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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Return an instantiated class of HTML
@param string[] $options
@return \mpf\web\request\HTML | [
"public static function get($options = array())\n {\n if (!isset(self::$_instances[md5(serialize($options))])) {\n return new HTML($options);\n }\n\n return self::$_instances[md5(serialize($options))];\n }"
] | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns a predicate that evaluates to {@code true} if its
argument satisfies all predicates {@code ps}. | [
"public static <T> Predicate<T> and(final Predicate<? super T>... ps) {\n return new Predicate<T>() {\n @Override\n public boolean apply(T obj) {\n for (Predicate<? super T> p : ps) {\n if (!p.apply(obj)) {\n return false;\n }\n }\n return true;\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Check if name is not snake case.
@param string $name
@param string $definedClass
@return boolean | [
"public function validateName($name, $definedClass)\n {\n if ($name != camel_case($name)) {\n throw new Exception('Name \"'.$name.'\" (defined in class \"'.$definedClass.'\") is not a camel case name.');\n }\n\n return true;\n }"
] | [
"public function getWord($name, $default = '', $verb = 'get', $options = array())\n {\n //First word in a sanitized string\n $sentence = $this->getString($name, $default, false);\n\n //@TODO validate string before breaking into words;\n //Requires php5.3!!\n return (string)strs... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Build a Criteria object containing the values of all modified columns in this object.
@return Criteria The Criteria object containing all modified values. | [
"public function buildCriteria()\n {\n $criteria = new Criteria(C2PTableMap::DATABASE_NAME);\n\n if ($this->isColumnModified(C2PTableMap::COL_CATEGORY_ID)) {\n $criteria->add(C2PTableMap::COL_CATEGORY_ID, $this->category_id);\n }\n if ($this->isColumnModified(C2PTableMap::C... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Generate column for each ancestor.
@param currentResource Current resource
@param rootResource Root resource
@return Columns | [
"private static List<Column> getAncestorColumns(Resource currentResource, Resource rootResource) {\n List<Column> columns = new ArrayList<>();\n List<Resource> ancestors = getAncestors(currentResource, rootResource);\n for (int i = 0; i < ancestors.size(); i++) {\n Resource r = ancestors.get(i);\n\n ... | [
"public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
User Signup
@method POST
@url /v1/users
@return Response | [
"public function signup() : Response\n {\n $user = $this->userModel;\n\n $request = $this->request->getPost();\n\n if (empty($request)) {\n $request = $this->request->getJsonRawBody(true);\n }\n\n $user->email = $this->request->getPost('email', 'email');\n $us... | [
"def authorized_get(self):\n ''''''\n request = TOPRequest('xxxxx.xxxxx.customers.authorized.get')\n self.create(self.execute(request))\n return self.result"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public String convertIfcTaskTypeEnumToString(EDataType eDataType, Object instanceValue) {\r\n\t\treturn instanceValue == null ? null : instanceValue.toString();\r\n\t}"
] | [
"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 description about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
// Convert_rbac_ClusterRole_To_v1beta1_ClusterRole is an autogenerated conversion function. | [
"func Convert_rbac_ClusterRole_To_v1beta1_ClusterRole(in *rbac.ClusterRole, out *v1beta1.ClusterRole, s conversion.Scope) error {\n\treturn autoConvert_rbac_ClusterRole_To_v1beta1_ClusterRole(in, out, s)\n}"
] | [
"func init() {\n\t// Milo is only responsible for validating the config matching the instance's\n\t// appID in a project config.\n\tvalidation.Rules.Add(\"regex:projects/.*\", \"${appid}.cfg\", validateProjectCfg)\n\tvalidation.Rules.Add(\"services/${appid}\", globalConfigFilename, validateServiceCfg)\n}"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Returns the current sorting column, saved in a session or cached. | [
"protected function getSortColumn()\n {\n if (!$this->isSortable()) {\n return false;\n }\n\n if ($this->sortColumn !== null) {\n return $this->sortColumn;\n }\n\n /*\n * User preference\n */\n if ($this->showSorting && ($sortOptions... | [
"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 text about Cassandra database:",
"pos": "Represent the code about Cassandra database:",
"neg": "Represent the code about Language and programming:"
} |
Clean up resources. | [
"@Override\n public void destroyResources() {\n if (eurekaConnCleaner != null) {\n // Execute the connection cleaner one final time during shutdown\n eurekaConnCleaner.execute(connectionCleanerTask);\n eurekaConnCleaner.shutdown();\n }\n if (apacheHttpClient ... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// RedactHeaders processes a headers object, returning a redacted list | [
"func RedactHeaders(headers http.Header) (processedHeaders []string) {\n\tfor name, header := range headers {\n\t\tfor _, v := range header {\n\t\t\tif com.IsSliceContainsStr(REDACT_HEADERS, name) {\n\t\t\t\tprocessedHeaders = append(processedHeaders, fmt.Sprintf(\"%v: %v\", name, \"***\"))\n\t\t\t} else {\n\t\t\t\... | [
"function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
/* (non-Javadoc)
@see org.fcrepo.server.security.impl.RequestCtx#encode(java.io.OutputStream, org.jboss.security.xacml.sunxacml.Indenter) | [
"@Override\n public void encode(OutputStream output, Indenter indenter) {\n encode(output, indenter, null);\n }"
] | [
"@Override\n public void removeSSOCookieFromResponse(HttpServletResponse resp) {\n if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {\n ((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());\n removeJwtSSOCookies((com.... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Construct the syntax to add a column.
@param string $field
@param string $type
@param $meta
@return string | [
"private function addColumn($field, $type = \"migration\", $meta = \"\")\n {\n\n\n if ($type == 'migration') {\n\n $syntax = sprintf(\"\\$table->%s('%s')\", $field['type'], $field['name']);\n\n // If there are arguments for the schema type, like decimal('amount', 5, 2)\n /... | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Parses a string into a series of tokens in Reverse Polish Notation order.
@param string $string
@return \Xylemical\Expressions\Token[]
@throws \Xylemical\Expressions\ParserException
@see https://en.wikipedia.org/wiki/Shunting-yard_algorithm | [
"public function parse($string) {\n $output = new \\SplQueue();\n $operator = new \\SplStack();\n\n // Convert the string to tokens for the lexer.\n $tokens = $this->lexer->tokenize($string);\n\n // while there are tokens to be read:\n while (count($tokens)) {\n ... | [
"private function addLiteral($string) {\r\n\t\t$converter = new \\n2n\\log4php\\pattern\\converter\\ConverterLiteral($string);\r\n\t\t$this->addToChain($converter);\r\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
@param RemoveFromCart $command
@throws \Exception | [
"public function handle(RemoveFromCart $command)\n {\n $cart = $this->carts->getById(new CartId($command->cartId()));\n $cart->remove(new SKU($command->sku()));\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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
<p>toXml.</p>
@param document a {@link com.greenpepper.document.Document} object.
@return a {@link java.lang.String} object.
@throws java.io.IOException if any. | [
"public static String toXml(com.greenpepper.document.Document document) throws IOException\n\t{\n\t\tStringWriter sw = new StringWriter();\n\n\t\tXmlReport xmlReport = XmlReport.newInstance(\"\");\n\t\txmlReport.generate( document );\n\t\txmlReport.printTo( sw );\n\n\t\treturn sw.toString();\n\t}"
] | [
"public void call(String method, Object[] args)\n throws IOException\n {\n startCall(method);\n\n if (args != null) {\n for (int i = 0; i < args.length; i++)\n writeObject(args[i]);\n }\n\n completeCall();\n }\n\n /**\n * Starts the method ca... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about writing:"
} |
Returns the unicode code point at specified index
@param int $index
@return int
@throws InvalidArgumentException
@throws OutOfBoundsException | [
"public function codePointAt(int $index): int\n {\n return mb_ord((string) $this->charAt($index), $this->encoding);\n }"
] | [
"public static function toByteString($value)\n {\n if (self::isStringCastable($value)) {\n return (string)$value;\n } else {\n throw new \\InvalidArgumentException(ErrorMessageCreator::create($value, 'ByteString (a string)'));\n }\n }"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Add a request header
@param string $key
@param string $value | [
"public function addRequestHeader($key, $value = null)\n {\n if (is_array($key)) {\n foreach ($key as $newKey => $newValue) {\n $this->addRequestHeader($newKey, $newValue);\n }\n } else {\n $key = preg_replace_callback(\n '/([\\s\\-_]|^... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Create or update entry for process with finished at information.
Set status to "failed".
@param ProcessId $processId
@param \DateTimeImmutable $finishedAt
@return void | [
"public function logProcessFailed(ProcessId $processId, \\DateTimeImmutable $finishedAt)\n {\n $data = [\n 'finished_at' => $finishedAt->format(\\DateTime::ISO8601),\n 'status' => self::STATUS_FAILED,\n ];\n\n $entry = $this->loadProcessEntryIfExists($processId);\n\n ... | [
"public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }"
] | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
// Initialize make sure network exists if network is enabled | [
"func (n *Networks) Initialize(ctx context.Context) error {\n\tif !n.networkEnabled {\n\t\treturn nil\n\t}\n\tfor _, network := range n.networks {\n\t\terr := network.EnsureItExists(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\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 comment about network configuration:",
"pos": "Represent the Github code about network configuration:",
"neg": "Represent the Github code about programming:"
} |
// encodeBroadcastNotify encodes a message and enqueues it for broadcast
// and notifies the given channel when transmission is finished. Fails
// silently if there is an encoding error. | [
"func (m *Memberlist) encodeBroadcastNotify(node string, msgType messageType, msg interface{}, notify chan struct{}) {\n\tbuf, err := encode(msgType, msg)\n\tif err != nil {\n\t\tm.logger.Printf(\"[ERR] memberlist: Failed to encode message for broadcast: %s\", err)\n\t} else {\n\t\tm.queueBroadcast(node, buf.Bytes(... | [
"void offerData(byte[] chunk) {\n if (chunk == null || chunk.length == 0) {\n throw new IllegalArgumentException(\"chunk must have at least one byte of data\");\n }\n\n if (closed) {\n return;\n }\n\n // Since this is an unbounded queue, offer() always succeeds. In addition, we don't make a... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Implements execution conventions for RecursiveTask. | [
"protected final boolean exec() {\n Object backup = replay(captured);\n try {\n result = compute();\n return true;\n } finally {\n restore(backup);\n }\n }"
] | [
"public QueryContext with( Problems problems ) {\n return new QueryContext(context, repositoryCache, workspaceNames, overriddenNodeCachesByWorkspaceName, schemata,\n indexDefns, nodeTypes, bufferManager, hints, problems, variables);\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Go programming language:"
} |
Refund an Item’s funds held in escrow.
@see https://reference.promisepay.com/#refund
@return [Boolean] | [
"def refund(options = {})\n response = JSON.parse(@client.patch(\"items/#{send(:id)}/refund\", options).body)\n @attributes = response['items']\n true\n end"
] | [
"def get(self):\n ''''''\n request = TOPRequest('xxxxx.xxxxx.campaign.areaoptions.get')\n self.create(self.execute(request), fields=['success','result'], models={'result':AreaOption})\n return self.result"
] | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Creates an expression from the given token and adds it
to the stack of the given expression.
In the case of "and" and "or" expressions the last expression
is poped from the expression stack to link it to the new
created one. | [
"def create_and_push_expression(token, expressions):\n \n if token == 'and':\n right_expr = expressions.pop()\n expressions.append(And(expressions.pop(), right_expr))\n elif token == 'or':\n right_expr = expressions.pop()\n expressions.append(Or(expressions.pop(), right_expr))\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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add a number of public keys together. | [
"def combine(self, pubkeys):\n \"\"\"\"\"\"\n assert len(pubkeys) > 0\n\n outpub = ffi.new('secp256k1_pubkey *')\n for item in pubkeys:\n assert ffi.typeof(item) is ffi.typeof('secp256k1_pubkey *')\n\n res = lib.secp256k1_ec_pubkey_combine(\n self.ctx, outpub... | [
"public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Gets a scope model
<p/>
Adds the model if it is not present.
@param <T> The type
@param scope The scope type
@return The scope type model | [
"public <T extends Annotation> ScopeModel<T> getScopeModel(final Class<T> scope) {\n return scopes.getCastValue(scope);\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
自动识别构建变量
@access public
@param string $name 变量描述
@return string | [
"public function autoBuildVar(&$name)\n {\n $flag = substr($name, 0, 1);\n\n if (':' == $flag) {\n // 以:开头为函数调用,解析前去掉:\n $name = substr($name, 1);\n } elseif ('$' != $flag && preg_match('/[a-zA-Z_]/', $flag)) {\n // XXX: 这句的写法可能还需要改进\n // 常量不需要解析\n... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Detector for hexagonal grid of circles. All circles must be entirely inside of the image.
@param config Configuration for target
@return The detector | [
"public static CalibrationDetectorCircleHexagonalGrid circleHexagonalGrid( @Nullable ConfigCircleHexagonalGrid config ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ConfigGridDimen configGrid ) {\n\t\tif( config == null )\n\t\t\tconfig = new ConfigCircleHexagonalGrid();\n\t\tconfig.checkValidity();\n\n\t\treturn new Cal... | [
"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 about Computer Vision:",
"pos": "Represent the code about Computer Vision:",
"neg": "Represent the code:"
} |
Set transliteration system.
@param string $system transliteration system
@return Settings fluent interface | [
"public function setSystem($system)\n {\n if (!in_array($system, $this->getSupportedTranliterationSystems())) {\n throw new \\InvalidArgumentException(\n sprintf('Transliteration system \"%s\" is not supported for \"%s\" language.',\n $system,\n ... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Toggle table field.
@param array $ids
@param int $value
@return int | [
"protected function _toggleField(array $ids, $value = STATUS_UN_PUBLISH)\n {\n return $this->_table->updateAll([\n $this->_configRead('field') => $value,\n ], [\n $this->_table->getPrimaryKey() . ' IN (' . implode(',', $ids) . ')'\n ]);\n }"
] | [
"function openTable()\n {\n $this->examples = [];\n $this->markdown = ''; // Clear table\n $this->declareAbstraction = true;\n $this->add('| Visibility | Function |');\n $this->add('|:-----------|:---------|');\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Set a value of the current state.
@param mixed $name Name of the attribute to set.
@param mixed $value New value for the attribute. | [
"public function setValue($name, $value) {\n $this->_states[count($this->_states) - 1][1][$name] = $value;\n }"
] | [
"function Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Same as {@link #retry(Callable, Predicate, int, int)} with quietTries = 0. | [
"public static <T> T retry(final Callable<T> f, Predicate<Throwable> shouldRetry, final int maxTries) throws Exception\n {\n return retry(f, shouldRetry, 0, maxTries);\n }"
] | [
"ExecutionResult with(boolean completed, boolean success) {\n return new ExecutionResult(result, failure, nonResult, waitNanos, completed, success,\n successAll == null ? success : success && successAll);\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
get a scheduled lambda name | [
"function getScheduledName(arr) {\n var name = arr.slice(0).shift()\n return [`${app}-production-${name}`, `${app}-staging-${name}`]\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Replace Django's generic error messages with MTP-specific versions
NB: avoid trailing full stops visually, they are added for screen readers in templates | [
"def replace_default_error_messages():\n \n forms.Field.default_error_messages['required'] = _('This field is required')\n forms.CharField.default_error_messages['min_length'] = _('You’ve entered too few characters')\n forms.CharField.default_error_messages['max_length'] = _('You’ve entered too many cha... | [
"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 instruction about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about Language and programming:"
} |
Tophat sets PI in the RG to be the inner distance size, but the SAM spec
states should be the insert size. This fixes the RG in the alignment
file generated by Tophat header to match the spec | [
"def fix_insert_size(in_bam, config):\n \n fixed_file = os.path.splitext(in_bam)[0] + \".pi_fixed.bam\"\n if file_exists(fixed_file):\n return fixed_file\n header_file = os.path.splitext(in_bam)[0] + \".header.sam\"\n read_length = bam.estimate_read_length(in_bam)\n bam_handle= bam.open_sam... | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Finds a good learning rate to start with.
eta = 1/(lambda*(t0+t)) - we find good t0
@param function
@param initial
@param sampleSize
@param seta | [
"public double tune(AbstractStochasticCachingDiffUpdateFunction function, double[] initial, int sampleSize, double seta)\r\n {\r\n Timing timer = new Timing();\r\n int[] sample = function.getSample(sampleSize);\r\n double sobj = getObjective(function, initial, 1, sample);\r\n double besteta = 1;\r\n ... | [
"def ystep(self):\n \n \"\"\"\n\n self.Y = sp.prox_l1(self.AX - self.S + self.U, self.Wdf / self.rho)"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Action that will update cart
@param type $data
@param type $form | [
"public function doUpdate($data, $form)\n {\n try {\n foreach ($this->Items() as $item) {\n foreach ($data as $key => $value) {\n $sliced_key = explode(\"_\", $key);\n if ($sliced_key[0] == \"Quantity\") {\n if (isset($... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Gamma returns a gamma corrected copy of the image. Provided gamma param must be larger than 0. | [
"func Gamma(src image.Image, gamma float64) *image.RGBA {\n\tgamma = math.Max(0.00001, gamma)\n\n\tlookup := make([]uint8, 256)\n\n\tfor i := 0; i < 256; i++ {\n\t\tlookup[i] = uint8(f64.Clamp(math.Pow(float64(i)/255, 1.0/gamma)*255, 0, 255))\n\t}\n\n\tfn := func(c color.RGBA) color.RGBA {\n\t\treturn color.RGBA{lo... | [
"def normalize(self, inplace=True):\n \n phi = self if inplace else self.copy()\n\n # The pdf of a Joint Gaussian distrinution is always\n # normalized. Hence, no changes.\n if not inplace:\n return phi"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Is the operating from the specified family
@param string $name The name of the family
@return boolean | [
"public function isFamily($name)\n {\n if ($this->getName() == $name) {\n return true;\n }\n\n if (isset($this->family)) {\n if ($this->family->getName() == $name) {\n return true;\n }\n }\n\n return false;\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
-> a #dict of |{random_string: random_int}| | [
"def randdict(self):\n \n return {\n self.randstr: self._map_type(int)\n for x in range(self.random.randint(3, 10))}"
] | [
"final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Helper function to return the minimum size of the index space to be passed to the reduction given the input and
output tensors | [
"public static int cudnnGetReductionIndicesSize(\n cudnnHandle handle, \n cudnnReduceTensorDescriptor reduceTensorDesc, \n cudnnTensorDescriptor aDesc, \n cudnnTensorDescriptor cDesc, \n long[] sizeInBytes)\n {\n return checkResult(cudnnGetReductionIndicesSizeNative(hand... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
<pre>
Handle describing the feeds and fetches of the step.
</pre>
<code>optional string handle = 2;</code> | [
"public java.lang.String getHandle() {\n java.lang.Object ref = handle_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
creates a new {@link OnJqueryFunction} instance
@param selector The CSS selector for event delegation
@return new {@link OnJqueryFunction} instance | [
"public static OnJqueryFunction on(final Attr events, final Attr selector, final Object data, JavaScriptInlineFunction handler) {\n return on(events, selector, JQuery.auto(data), handler);\n }"
] | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Checks to see if the current document has been modified and should \
be saved.
:return <bool> | [
"def checkForSave( self ):\n \n # if the file is not modified, then save is not needed\n if ( not self.isModified() ):\n return True\n \n options = QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel\n question = 'Would you like to save your changes to %... | [
"def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
//
// PUT /api/users/{name}
//
// Updates information about individual user. | [
"func (c *Client) PutUser(username string, info UserSettings) (res *http.Response, err error) {\n\tbody, err := json.Marshal(info)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq, err := newRequestWithBody(c, \"PUT\", \"users/\"+PathEscape(username), body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tres... | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Aij += array[j]
@param i
@param arr
@param offset | [
"public void addRow(int i, double[] arr, int offset)\r\n {\r\n int n = cols;\r\n for (int j=0;j<n;j++)\r\n {\r\n add(i, j, arr[j+offset]);\r\n }\r\n }"
] | [
"def backward_word(self, e): # (M-b)\r\n \"\"\"\r\n self.l_buffer.backward_word(self.argument_reset)\r\n self.finalize()"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param string $name
@param mixed $value
@return \marvin255\serviform\interfaces\Field | [
"public function addToAttribute($name, $value)\n {\n $attr = $this->getAttribute($name);\n $this->setAttribute($name, $attr . $value);\n\n return $this;\n }"
] | [
"public function createUiComponent(\\n2n\\impl\\web\\ui\\view\\html\\HtmlView $view, \\rocket\\ei\\util\\Eiu $eiu) {\r\n\t\treturn $view->getHtmlBuilder()->getEsc($eiu->field()->getValue());\r\n\t}"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Prepare the STK Push request
@param int $amount
@param int $number
@param string $reference
@param string $description
@param string $account
@return mixed | [
"public function push($amount = null, $number = null, $reference = null, $description = null, $account = null)\n {\n $account = $account ?: $this->account;\n $time = Carbon::now()->format('YmdHis');\n $configs = (new ConfigurationRepository)->useAccount($account);\n\n $shortCode = $co... | [
"public function DMSAuthorization($amount, $currency = 981, $description = '', $language = 'GE')\n {\n return $this->transaction('a', $amount, $currency, $description, $language, 'DMS');\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Transaction Management:",
"pos": "Represent the Github code about Transaction Management:",
"neg": "Represent the Github code about programming:"
} |
//Introduces a new event into the handler for processing
//and sending to relevant plugins. | [
"func (ph Manager) Dispatch(e Event, args Args) error {\n\treturn ph.dispatch(\"local\", e, args)\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Serialize the WebsiteConfig object into xml string.
@return string
@throws OssException | [
"public function serializeToXml()\n {\n $xml = new \\SimpleXMLElement('<?xml version=\"1.0\" encoding=\"utf-8\"?><WebsiteConfiguration></WebsiteConfiguration>');\n $index_document_part = $xml->addChild('IndexDocument');\n $error_document_part = $xml->addChild('ErrorDocument');\n $inde... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Checks whether a DualInputOperator is correctly connected. In case that
the contract is incorrectly connected a RuntimeException is thrown.
@param dualInputContract
DualInputOperator that is checked. | [
"private void checkDualInputContract(DualInputOperator<?, ?, ?, ?> dualInputContract) {\n\t\tOperator<?> input1 = dualInputContract.getFirstInput();\n\t\tOperator<?> input2 = dualInputContract.getSecondInput();\n\t\t// check if input exists\n\t\tif (input1 == null || input2 == null) {\n\t\t\tthrow new MissingChildE... | [
"@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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Returns the number of terms found within the specified document. | [
"def get_document_length(self, document):\n \n if document in self._documents:\n return self._documents[document]\n else:\n raise IndexError(DOCUMENT_DOES_NOT_EXIST)"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Add the neccesary sv coordinates for a variant
Args:
variant (puzzle.models.variant) | [
"def _add_sv_coordinates(self, variant):\n \n variant.stop_chrom = variant.CHROM\n variant.start = int(variant.POS)\n \n # If we have a translocation:\n if ':' in variant.ALT:\n other_coordinates = variant.ALT.strip('ACGTN[]').split(':')\n variant.stop... | [
"def setConfiguration(self, configuration):\n \n \"\"\"\n if isinstance(configuration, Configuration):\n configuration = configuration.value\n\n self.dev.set_configuration(configuration)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Updates the FFT plots kwarg *'plot'*, which is
either 'response' or (well actually anything).
For other arguments, see: :meth:`FFTWidget.updateData<sparkle.gui.plotting.pyqtgraph_widgets.FFTWidget.updateData>` | [
"def updateFft(self, *args, **kwargs):\n \n p = kwargs.pop('plot')\n if p == 'response': \n self.responseFftPlot.updateData(*args, **kwargs)\n else:\n self.stimFftPlot.updateData(*args, **kwargs)"
] | [
"def setModel(self, model):\n \"\"\n self._model = model\n self.ui.aofsSpnbx.setValue(model.samplerate())"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
Use this API to fetch filtered set of event resources.
filter string should be in JSON format.eg: "vm_state:DOWN,name:[a-z]+" | [
"public static event[] get_filtered(nitro_service service, String filter) throws Exception\r\n\t{\r\n\t\tevent obj = new event();\r\n\t\toptions option = new options();\r\n\t\toption.set_filter(filter);\r\n\t\tevent[] response = (event[]) obj.getfiltered(service, option);\r\n\t\treturn response;\r\n\t}"
] | [
"def list(self, mask=None):\n \n if mask is None:\n mask = \"mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]\"\n groups = self.client.call('Account', 'getPlacementGroups', mask=mask, iter=True)\n return groups"
] | codesearchnet | {
"query": "Represent the Github summarization about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic void eUnset(int featureID)\n\t{\n\t\tswitch (featureID)\n\t\t{\n\t\t\tcase TypesPackage.JVM_FIELD__STATIC:\n\t\t\t\tsetStatic(STATIC_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase TypesPackage.JVM_FIELD__FINAL:\n\t\t\t\tsetFinal(FINAL_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase TypesPackage.JVM_FIELD__TYP... | [
"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 instruction about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Convert to a unicode string.
If x is a byte string, assume it is utf-8 and decode to a Python unicode
string. You must call this on text strings you get back from libvips. | [
"def _to_string(x):\n \n if x == ffi.NULL:\n x = 'NULL'\n else:\n x = ffi.string(x)\n if isinstance(x, byte_type):\n x = x.decode('utf-8')\n\n return x"
] | [
"def _init_io_container(self, init_value):\n \n if isinstance(init_value, CLOB_STRING_IO_CLASSES):\n # already a valid StringIO instance, just use it as it is\n v = init_value\n else:\n # works for strings and unicodes. However unicodes must only contain valid a... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetUserStackAssociations sets the UserStackAssociations field's value. | [
"func (s *DescribeUserStackAssociationsOutput) SetUserStackAssociations(v []*UserStackAssociation) *DescribeUserStackAssociationsOutput {\n\ts.UserStackAssociations = 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:"
} |
Removes all |{key: value}| entries in :prop:key_prefix of
:prop:_client | [
"def clear(self, match=\"*\", count=1000):\n \n cursor = '0'\n while cursor != 0:\n cursor, keys = self.scan(cursor=cursor, match=match, count=count)\n if keys:\n self._client.delete(*keys)"
] | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Is self a superdomain of other?
The notion of subdomain includes equality.
@rtype: bool | [
"def is_superdomain(self, other):\n \n\n (nr, o, nl) = self.fullcompare(other)\n if nr == NAMERELN_SUPERDOMAIN or nr == NAMERELN_EQUAL:\n return True\n return False"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Print environment variables. | [
"def cli(env):\n \"\"\"\"\"\"\n filtered_vars = dict([(k, v)\n for k, v in env.vars.items()\n if not k.startswith('_')])\n env.fout(formatting.iter_to_table(filtered_vars))"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Handles the arguments defined by :meth:`~make_common_parser`
:param parsed_args: Argument parsed with ``argparse`` (``Namespace``)
:return: An :class:`~InitFileHandler` object
:raise IOError: Initial or run script not found | [
"def handle_common_arguments(parsed_args):\n \n # Setup the logger\n logging.basicConfig(\n level=logging.DEBUG if parsed_args.verbose else logging.WARNING\n )\n\n # Framework properties dictionary\n props = {}\n\n # Read the initial configuration script\n init = InitFileHandler()\n ... | [
"def _get_parsing_plan_for_multifile_children(self, obj_on_fs: PersistedObject, desired_type: Type[Any],\n logger: Logger) -> Dict[str, Any]:\n \n raise Exception('This should never happen, since this parser relies on underlying parsers')"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Set the entity abstract.
@param boolean $abstract Flag if the entity is abstract or not. | [
"public function setAbstract($abstract)\n {\n if ($abstract === true) {\n $this->addModifier(Modifiers::MODIFIER_ABSTRACT);\n } else {\n $this->removeModifier(Modifiers::MODIFIER_ABSTRACT);\n }\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 summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Calls out {@link Output::sendError()} with the appropriate values. | [
"public function send()\n {\n $output = new Output();\n $output->setStatusCode($this->code, $this->getResponseDescription($this->code));\n\n //push errorStore into $result object for proper handling\n $result = $this->di->get('result', []);\n $result->addError($this->errorStore... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"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.