query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Update the specified resource in storage.
@param \TypiCMS\Modules\Tags\Models\Tag $model
@param \TypiCMS\Modules\Tags\Http\Requests\FormRequest $request
@return \Illuminate\Http\RedirectResponse | [
"public function update(Tag $tag, FormRequest $request)\n {\n $this->repository->update($request->id, $request->all());\n\n return $this->redirect($request, $tag);\n }"
] | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// ParseURL parses a LogDog URL into a Stream. If the URL is malformed, or
// if the host, project, or path is invalid, an error will be returned.
//
// A LogDog URL has the form:
// logdog://<host>/<project>/<prefix>/+/<name> | [
"func ParseURL(v string) (*StreamAddr, error) {\n\tu, err := url.Parse(v)\n\tif err != nil {\n\t\treturn nil, errors.Annotate(err, \"failed to parse URL\").Err()\n\t}\n\n\t// Validate Scheme.\n\tif u.Scheme != logDogURLScheme {\n\t\treturn nil, errors.Reason(\"URL scheme %q is not %s\", u.Scheme, logDogURLScheme).E... | [
"def restore(self):\n ''\n #\n #\n # As of 2016-06-15, Jottacloud.com has changed their restore api\n # To restore, this is what's done\n #\n # HTTP POST to https://www.jottacloud.com/web/restore/trash/list\n # Data:\n # hash:undefined\n # ... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// Stop closes the connections. | [
"func (t *transacter) Stop() {\n\tt.stopped = true\n\tt.endingWg.Wait()\n\tfor _, c := range t.conns {\n\t\tc.Close()\n\t}\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 instruction about Container management:",
"pos": "Represent the code about Container management:",
"neg": "Represent the code about programming:"
} |
// SetFormat sets the Format field's value. | [
"func (s *CreateJobPlaylist) SetFormat(v string) *CreateJobPlaylist {\n\ts.Format = &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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Set template with selected event type | [
"public final void setTemplate() {\n template = new HashMap();\n if (isEventExist()) {\n template.putAll(events.get(next));\n }\n template.put(\"event\", eventType);\n }"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Cached data for current downline customer.
@return \Praxigento\Downline\Repo\Data\Customer | [
"private function getDwnlCustomer()\n {\n if (is_null($this->cacheDwnlCust)) {\n $custId = $this->session->getCustomerId();\n $this->cacheDwnlCust = $this->daoDwnlCust->getById($custId);\n }\n return $this->cacheDwnlCust;\n }"
] | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Only accepts as a valid base A, C, G and T
or IUPAC ambiguous if enabled
@param base
@return | [
"static boolean isValidBase(char base, boolean acceptAmbiguous) {\n boolean isValidBase = PRECISE_BASES.contains(base);\n if (!isValidBase && acceptAmbiguous) {\n isValidBase = N.equals(base) || AMBIGUOUS_BASES.contains(base);\n }\n return isValidBase;\n }"
] | [
"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 Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Regular expressions:"
} |
/* (non-Javadoc)
@see net.finmath.stochastic.RandomVariableInterface#getHistogram(int,double) | [
"@Override\n\tpublic double[][] getHistogram(int numberOfPoints, double standardDeviations) {\n\t\tdouble[] intervalPoints = new double[numberOfPoints];\n\t\tdouble[] anchorPoints\t= new double[numberOfPoints+1];\n\t\tdouble center\t= getAverage();\n\t\tdouble radius\t= standardDeviations * getStandardDeviation();\... | [
"@Override\n\tpublic AssetModelMonteCarloSimulationInterface getCloneWithModifiedSeed(int seed) {\n\t\t// Create a corresponding MC process\n\t\tAbstractProcess process = new ProcessEulerScheme(new BrownianMotion(this.getTimeDiscretization(), 1 /* numberOfFactors */, this.getNumberOfPaths(), seed));\n\t\treturn new... | codesearchnet | {
"query": "Represent the comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
开启后, 可以选择多个日期, 仅在 date 下可用, 默认为false
@param bool $bool
@return $this | [
"public function multiple($bool = true)\n {\n if ($this->props['type'] == 'date')\n $this->props['multiple'] = (bool)$bool;\n else\n $this->props['multiple'] = false;\n\n return $this;\n }"
] | [
"static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Add one or more items
@param {*|Array.<*>} items A single item or array of items which will be
added to this collection
@fires add | [
"function () {\n\t\tvar items = _.flatten(arguments);\n\t\tfor (var i = 0, l = items.length; i < l; i++) {\n\t\t\tthis.addItem(items[i], this.items.length);\n\t\t}\n\t}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Find returns the device matching the given name. | [
"func (l VirtualDeviceList) Find(name string) types.BaseVirtualDevice {\n\tfor _, device := range l {\n\t\tif l.Name(device) == name {\n\t\t\treturn device\n\t\t}\n\t}\n\treturn nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code:"
} |
Return of "True" means IP has was removed.
Return of "False" means IP wasn't being denied.
@param ip
@return | [
"public static synchronized boolean removeDenyIP(String ip) {\n\t\tif(deniedIP!=null && deniedIP.remove(ip)!=null) {\n\t\t\twriteIP();\n\t\t\tif(deniedIP.isEmpty()) {\n\t\t\t\tdeniedIP=null;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}"
] | [
"public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// NewTransaction starts a new transaction. The resulting transaction object
// can be mutated without incurring changes to the underlying Datastore until
// the transaction is Committed. | [
"func (d *Datastore) NewTransaction(readOnly bool) (ds.Txn, error) {\n\td.closeLk.RLock()\n\tdefer d.closeLk.RUnlock()\n\tif d.closed {\n\t\treturn nil, ErrClosed\n\t}\n\n\treturn &txn{d, d.DB.NewTransaction(!readOnly), false}, nil\n}"
] | [
"public void applyAndJournal(Supplier<JournalContext> context, DeleteFileEntry entry) {\n // Unlike most entries, the delete file entry must be applied *before* making the in-memory\n // change. This is because delete file and create file are performed with only a read lock on\n // the parent directory. As... | codesearchnet | {
"query": "Represent the sentence about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about Software Development:"
} |
Unmarshall a DOMElement object corresponding to a SliderInteraction element.
@param \DOMElement $element A DOMElement object.
@return \qtism\data\QtiComponent A SliderInteraction object.
@throws \qtism\data\storage\xml\marshalling\UnmarshallingException | [
"protected function unmarshall(DOMElement $element)\n {\n if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) {\n\n if (($lowerBound = $this->getDOMElementAttributeAs($element, 'lowerBound', 'float')) !== null) {\n\n if (($upperBo... | [
"public static function createFromDataModel(VariableDeclaration $variableDeclaration)\n {\n $variable = parent::createFromDataModel($variableDeclaration);\n\n if ($variableDeclaration instanceof OutcomeDeclaration) {\n\n $variable->setViews($variableDeclaration->getViews());\n ... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Remove signal handler.
@param $signal | [
"public function removeSignal($signal)\n {\n if (isset($this->_signalEvents[$signal])) {\n $this->_signalEvents[$signal]->del();\n unset($this->_signalEvents[$signal]);\n }\n }"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// Create a transaction to migrate an instance from one dedicated host to another dedicated host | [
"func (r Virtual_Guest) MigrateDedicatedHost(destinationHostId *int) (err error) {\n\tvar resp datatypes.Void\n\tparams := []interface{}{\n\t\tdestinationHostId,\n\t}\n\terr = r.Session.DoRequest(\"SoftLayer_Virtual_Guest\", \"migrateDedicatedHost\", params, &r.Options, &resp)\n\treturn\n}"
] | [
"function databaseInitialize() {\n var entries = db.getCollection(\"entries\");\n var messages = db.getCollection(\"messages\");\n\n // Since our LokiFsStructuredAdapter is partitioned, the default 'quickstart3.db'\n // file will actually contain only the loki database shell and each of the collections\n // wi... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Add an element
@param element
the element to add | [
"void addElement(KElement element) {\n\t\tif (!this.elements.contains(element)) {\n\t\t\telement.setIndex(this.elements.size());\n\t\t\tthis.elements.add(element);\n\t\t}\n\t}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// InstalledPluginList ... | [
"func InstalledPluginList() ([]Plugin, error) {\n\trouting, err := readPluginRouting()\n\tif err != nil {\n\t\treturn []Plugin{}, err\n\t}\n\n\tpluginList := []Plugin{}\n\n\tfor name := range routing.RouteMap {\n\t\tif plugin, found, err := LoadPlugin(name); err != nil {\n\t\t\treturn []Plugin{}, err\n\t\t} else if... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github sentence about App development:",
"pos": "Represent the Github code about App development:",
"neg": "Represent the Github code about programming:"
} |
db query
@param string $sql
@return mixed | [
"public function query($sql)\n {\n if (true == Config::get('sql_log')) {\n wlog('SQL-Log', $sql);\n }\n\n $_key = strtolower(substr($sql, 0, 6));\n if ($_key == 'select') {\n $qt = 'query';\n } else {\n $qt = 'exec';\n }\n\n if (tr... | [
"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 text about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about programming:"
} |
Return an iterator over the rows of the data matrix :attr:`X`.
Parameters
----------
chunk_size
Row size of a single chunk. | [
"def chunked_X(self, chunk_size: Optional[int] = None):\n \n if chunk_size is None:\n # Should be some adaptive code\n chunk_size = 6000\n start = 0\n n = self.n_obs\n for _ in range(int(n // chunk_size)):\n end = start + chunk_size\n yi... | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Convert_kops_AuthorizationSpec_To_v1alpha2_AuthorizationSpec is an autogenerated conversion function. | [
"func Convert_kops_AuthorizationSpec_To_v1alpha2_AuthorizationSpec(in *kops.AuthorizationSpec, out *AuthorizationSpec, s conversion.Scope) error {\n\treturn autoConvert_kops_AuthorizationSpec_To_v1alpha2_AuthorizationSpec(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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Saves changed mapping configurations | [
"public function save()\n {\n $aParams = \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter(\"editval\");\n $aRDFaPayments = (array) \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter(\"ardfapayments\");\n\n // Delete old mappings\n $oDb = \\OxidE... | [
"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:"
} |
// WithDigest sets the digest for an image. | [
"func (i *Image) WithDigest(digest digest.Digest) (err error) {\n\ti.Digest = digest\n\ti.named, err = reference.WithDigest(i.named, digest)\n\treturn err\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Send the request with specified data
@param mixed $data The data to send
@return ResponseInterface | [
"public function sendData($data)\r\n {\r\n $response = $this->braintree->merchantAccount()->update($data['merchantAccountId'], $data['merchantData']);\r\n\r\n return $this->response = new Response($this, $response);\r\n }"
] | [
"@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }"
] | codesearchnet | {
"query": "Represent the description about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Programming:"
} |
// SetPowerDuration sets the power state globally, on all devices, transitioning
// over the specified duration | [
"func (p *V2) SetPowerDuration(state bool, duration time.Duration) error {\n\tp.RLock()\n\tdefer p.RUnlock()\n\tfor _, dev := range p.devices {\n\t\tl, ok := dev.(*device.Light)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif err := l.SetPowerDuration(state, duration); err != nil {\n\t\t\tcommon.Log.Warnf(\"Failed set... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
recursively work backwards through the tokens and up the dom, covering all options | [
"function crawl(e, i, p) {\n while (p = walker[dividedTokens[i]](p, e)) {\n if (isNode(p) && (interpret.apply(p, q(tokens[i])))) {\n if (i) {\n if (cand = crawl(p, i - 1, p)) return cand\n } else return p\n }\n }\n }"
] | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// copyNodeEvents is a helper to copy a list of NodeEvent's | [
"func copyNodeEvents(events []*NodeEvent) []*NodeEvent {\n\tl := len(events)\n\tif l == 0 {\n\t\treturn nil\n\t}\n\n\tc := make([]*NodeEvent, l)\n\tfor i, event := range events {\n\t\tc[i] = event.Copy()\n\t}\n\treturn c\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Parse Http Headers in array
@param string $headers
@return array | [
"public static function parse($headers) {\n $fields = explode(\"\\r\\n\", preg_replace('/\\x0D\\x0A[\\x09\\x20]+/', ' ', $headers));\n\n if(empty($fields)) return [];\n\n return array_reduce($fields, function($carry, $field) {\n $match = [];\n if (!preg_match('/([^:]+): (.+)/m'... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the summarization about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
// MustGet return cached value, it panics if error occurs. | [
"func (v *Value) MustGet(dirty ...bool) (value interface{}) {\n\tvalue, err := v.Get(dirty...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn value\n}"
] | [
"func (dbcr *DiskBlockCacheRemote) DoesCacheHaveSpace(\n\t_ context.Context, _ DiskBlockCacheType) (bool, error) {\n\t// We won't be kicking off long syncing prefetching via the remote\n\t// cache, so just pretend the cache has space.\n\treturn true, nil\n}"
] | codesearchnet | {
"query": "Represent the post about Go programming language:",
"pos": "Represent the code about Go programming language:",
"neg": "Represent the code about programming:"
} |
// numServiceRoutes returns the number of service routes on this account. | [
"func (a *Account) numServiceRoutes() int {\n\ta.mu.RLock()\n\tdefer a.mu.RUnlock()\n\treturn len(a.imports.services)\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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
//GetVolumeID returns an RBD Volume formatted as <pool>.<imageName> | [
"func GetVolumeID(pool, image *string) *string {\n\n\tvolumeID := fmt.Sprintf(\"%s.%s\", *pool, *image)\n\treturn &volumeID\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// GetDocknetState gets the docknet entry from state store | [
"func GetDocknetState(tenantName, networkName, serviceName string) (*DnetOperState, error) {\n\tlog.Infof(\"GetDocknetState for %s.%s.%s\", tenantName, networkName, serviceName)\n\n\t// Get the state driver\n\tstateDriver, err := utils.GetStateDriver()\n\tif err != nil {\n\t\tlog.Warnf(\"Couldn't get state driver f... | [
"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:"
} |
// SendMetrics sends the regeneration statistics for this endpoint to
// Prometheus. | [
"func (s *regenerationStatistics) SendMetrics() {\n\tendpointPolicyStatus.Update(s.endpointID, s.policyStatus)\n\tmetrics.EndpointCountRegenerating.Dec()\n\n\tif !s.success {\n\t\t// Endpoint regeneration failed, increase on failed metrics\n\t\tmetrics.EndpointRegenerationCount.WithLabelValues(metrics.LabelValueOut... | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the comment about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code about programming:"
} |
Actual constructor of the solver. | [
"def new(self, bootstrap_with=None, use_timer=False, incr=False,\n with_proof=False):\n \n\n assert not incr or not with_proof, 'Incremental mode and proof tracing cannot be set together.'\n\n if not self.glucose:\n self.glucose = pysolvers.glucose41_new()\n\n i... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Router connection information | [
"def connectionType()\n joinThread()\n type = getCString()\n if MiniUPnP.UPNP_GetConnectionTypeInfo(@urls.controlURL,\n @data.servicetype,type) != 0 then\n raise UPnPException.new, \"Error while retriving connection info.\"\n end\n ... | [
"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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Iterate over the items by $group=>$assets.
@return ArrayIterator | [
"public function getIterator()\n {\n $array = [];\n foreach (array_keys($this->imports) as $group) {\n $array[$group] = $this->offsetGet($group);\n }\n\n return new ArrayIterator($array);\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// SetAPI configures the server with the specified API. Needs to be called before Serve | [
"func (s *Server) SetAPI(api *restapi.CiliumHealthAPI) {\n\tif api == nil {\n\t\ts.api = nil\n\t\ts.handler = nil\n\t\treturn\n\t}\n\n\ts.api = api\n\ts.api.Logger = log.Printf\n\ts.handler = configureAPI(api)\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:"
} |
Creates an anonymous object based on a reflection.
@param mixed $class A class, object or trait to wrap.
@param mixed ...$args Arguments for use during construction.
@return object An anonymous, wrapped object.
@see Wrapper::wrapObject | [
"public static function createObject($class, ...$args) : object\n {\n $work = self::wrapObject($class);\n $work->__gentryConstruct(...$args);\n return $work;\n }"
] | [
"public function getSection($key)\n {\n if (false === $this->hasSection($key)) {\n throw new ConfigException(sprintf('\"%s\" is not a section', $key));\n }\n\n // do not return the parent object if we were subclassed, but an actual\n // \"Config\" object to avoid copying in... | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) IMachinegetPageFusionEnabled(request *IMachinegetPageFusionEnabled) (*IMachinegetPageFusionEnabledResponse, error) {\n\tresponse := new(IMachinegetPageFusionEnabledResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ... | [
"@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 description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
/*
Validate numeric ID syntax
@param mixed Value to validate
@return bool True if valid, false if not | [
"public static function numericId ($value)\n {\n // Check type and characters\n if (!is_int($value)\n &&\n !(is_string($value) && preg_match('/^[0-9]+$/', $value))\n ) {\n return false;\n }\n\n // Check range\n if ($value > 0) {\n ... | [
"function extend(ctx, obj) {\n\n /**\n * @method Database#none\n * @description\n * Executes a query that expects no data to be returned. If the query returns any kind of data,\n * the method rejects.\n *\n * When receiving a multi-query result, only the last r... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// Info outputs an informational log.
// fields can be nil. | [
"func (l *Logger) Info(msg string, fields map[string]interface{}) error {\n\treturn l.Log(LvInfo, msg, fields)\n}"
] | [
"func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Computer Science:"
} |
// Publish artifacts to artifactory
//
// Docs: https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-Example-DeployinganArtifact | [
"func (Pipe) Publish(ctx *context.Context) error {\n\tif len(ctx.Config.Artifactories) == 0 {\n\t\treturn pipe.Skip(\"artifactory section is not configured\")\n\t}\n\n\t// Check requirements for every instance we have configured.\n\t// If not fulfilled, we can skip this pipeline\n\tfor _, instance := range ctx.Conf... | [
"private void cmdHelpActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_cmdHelpActionPerformed\n DialogUtils.open(URI.create(\"https://github.com/ontop/ontop/wiki/ObdalibPluginJDBC\"), this);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
Gets UTF-8 bytes from the string.
@param s
@return | [
"public static byte[] bytes(String s) {\n try {\n return s.getBytes(ENCODING);\n } catch (UnsupportedEncodingException e) {\n log.error(\"UnsupportedEncodingException \", e);\n throw new RuntimeException(e);\n }\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
//Use if you already have an Authentication header you want to pass through to couchdb | [
"func (pta *PassThroughAuth) AddAuthHeaders(req *http.Request) {\n\treq.Header.Set(\"Authorization\", pta.AuthHeader)\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
手工加载指定的文件
可以是相对路径,也可以是绝对路径
@param string $filePath 文件路径 | [
"public function loadFile($filePath) {\n require_once (substr($filePath, 0, 1) != '/' && substr($filePath, 1, 1) != ':')\n ? $this->basePath . DIRECTORY_SEPARATOR . $filePath : $filePath;\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Removes magic constants from current replace list. | [
"def _unset_magic_constants(self):\n \n if '__FILE__' in self._replace:\n del self._replace['__FILE__']\n\n if '__ROUTINE__' in self._replace:\n del self._replace['__ROUTINE__']\n\n if '__DIR__' in self._replace:\n del self._replace['__DIR__']\n\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// GetHashCost returns the bcrypt cost factor. Defaults to 12. | [
"func (c *Config) GetHashCost() int {\n\tif c.HashCost == 0 {\n\t\treturn fosite.DefaultBCryptWorkFactor\n\t}\n\treturn c.HashCost\n}"
] | [
"protected function computeEncryptionKey($password = '')\n {\n $revision = $this->revision;\n\n // TODO: The password string is generated from OS codepage characters by first\n // converting the string to PDFDocEncoding. If the input is Unicode, first convert\n // to a codepage encodi... | 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:"
} |
only add 1/2 the co-occurences, otherwise they would be counted 2 times. | [
"protected Cooccurrence filterCooccurence(JCas jCas, Annotation enclosingAnnot,\n Annotation annot1, Annotation annot2, String[] ids1, String[] ids2) {\n\n if (annot1.getAddress() < annot2.getAddress()) {\n return super.filterCooccurence(jCas, enclosingAnnot, annot1, annot2, ids1,\n ... | [
"def _calculate_index_of_coincidence(frequency_map, length):\n \n if length <= 1:\n return 0\n # We cannot error here as length can legitimiately be 1.\n # Imagine a ciphertext of length 3 and a key of length 2.\n # Spliting this text up and calculating the index of coincidence res... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SpartaCommand issues a go run command that encapsulates resolving
// global env vars that can be translated into Sparta command line options | [
"func SpartaCommand(commandParts ...string) error {\n\tnoopValue := \"\"\n\tparsedBool, parsedBoolErr := strconv.ParseBool(os.Getenv(\"NOOP\"))\n\tif parsedBoolErr == nil && parsedBool {\n\t\tnoopValue = \"--noop\"\n\t}\n\tcurDir, curDirErr := os.Getwd()\n\tif curDirErr != nil {\n\t\treturn errors.New(\"Failed to g... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Load HTML from string
@param string $html
@return Document
@throws InvalidArgumentException if argument is not string | [
"public function loadHtml($html)\n {\n if (!is_string($html)) {\n throw new InvalidArgumentException(__METHOD__ . ' expects parameter 1 to be string.');\n }\n\n libxml_use_internal_errors(true);\n libxml_disable_entity_loader(true);\n\n $sxe = simplexml_load_string($... | [
"public function text($text)\n {\n if (is_string($text) || settype($text, 'string') !== false) {\n return parent::text($this->encodeString($text));\n }\n throw new \\InvalidArgumentException(get_class($this) . ':text - Cannot cast passed value to string (did you forget to define a... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Return the gradient as a pair of numpy arrays.
Returns
-------
:obj:`tuple` of :obj:`numpy.ndarray` of float
The gradients of the image along each dimension. | [
"def gradients(self):\n \n g = np.gradient(self.data.astype(np.float32))\n return g"
] | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Validate validates VM kinds. | [
"func (kinds *Kinds) Validate(c *validation.Context) {\n\tnames := stringset.New(len(kinds.GetKind()))\n\tfor i, k := range kinds.GetKind() {\n\t\tc.Enter(\"kind %d\", i)\n\t\tswitch {\n\t\tcase k.Name == \"\":\n\t\t\tc.Errorf(\"name is required\")\n\t\tcase !names.Add(k.Name):\n\t\t\tc.Errorf(\"duplicate name %q\"... | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Creates a time object from the time part of the supplied date time.
@param \DateTimeInterface $dateTime
@return TimeOfDay | [
"public static function fromNative(\\DateTimeInterface $dateTime) : TimeOfDay\n {\n return new self((int)$dateTime->format('H'), (int)$dateTime->format('i'), (int)$dateTime->format('s'));\n }"
] | [
"@Deprecated\n public Timex2Time modifiedCopy(final Modifier modifier) {\n return new Timex2Time(val, modifier, set, granularity, periodicity, anchorVal, anchorDir,\n nonSpecific);\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// SetJobRunId sets the JobRunId field's value. | [
"func (s *StartJobRunOutput) SetJobRunId(v string) *StartJobRunOutput {\n\ts.JobRunId = &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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get CatalogResolver.
@return CatalogResolver | [
"public static synchronized CatalogResolver getCatalogResolver() {\n if (catalogResolver == null) {\n final CatalogManager manager = new CatalogManager();\n manager.setIgnoreMissingProperties(true);\n manager.setUseStaticCatalog(false); // We'll use a private catalog.\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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about File management:"
} |
// expired returns a collection of keys for leases that have expired.
// Any pinned leases are not included in the return. | [
"func (f *FSM) removeExpired(newTime time.Time) []lease.Key {\n\tvar expired []lease.Key\n\tfor gKey, entries := range f.groups {\n\t\tfor key, entry := range entries {\n\t\t\texpiry := entry.start.Add(entry.duration)\n\t\t\tif expiry.Before(newTime) && !f.isPinned(key) {\n\t\t\t\tdelete(entries, key)\n\t\t\t\texpi... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
{{{ public function process() | [
"public function process()\n {\n parent::process();\n\n $data = $this->getForm()->getFormData();\n\n $this->crop_width = $data[$this->id . '_width'];\n $this->crop_height = $data[$this->id . '_height'];\n $this->crop_left = $data[$this->id . '_x'];\n $this->crop_top = $d... | [
"@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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns PGFPlots code for a number of patch objects. | [
"def draw_pathcollection(data, obj):\n \n content = []\n # gather data\n assert obj.get_offsets() is not None\n labels = [\"x\" + 21 * \" \", \"y\" + 21 * \" \"]\n dd = obj.get_offsets()\n\n draw_options = [\"only marks\"]\n table_options = []\n\n if obj.get_array() is not None:\n ... | [
"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:"
} |
Draws samples from the `fake` distribution.
Returns:
`np.ndarray` of samples. | [
"def draw(self):\r\n '''\r\n \r\n '''\r\n observed_arr = self.noise_sampler.generate()\r\n arr = self.inference(observed_arr)\r\n return arr"
] | [
"def resolution(self, values):\n \n values = np.asanyarray(values, dtype=np.int64)\n if values.shape != (2,):\n raise ValueError('resolution must be (2,) float')\n # assign passed values to focal length\n self._resolution = values"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get only one property from a variable
@param string $variableId on which we want the property
@param string $property to retrieve
@return int|string the property retrieved | [
"public function getVariableProperty($variableId, $property)\n {\n list($itemUri, $propertyName) = $this->extractResultVariableProperty($variableId);\n $response = $this->unserializeVariableValue(\n $this->getPersistence()->hGet(\n self::PREFIX_CALL_ID.$itemUri,\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// WeekdayShort returns the locales short weekday given the 'weekday' provided | [
"func (tr *tr_CY) WeekdayShort(weekday time.Weekday) string {\n\treturn tr.daysShort[weekday]\n}"
] | [
"func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about datetime:"
} |
create an animitter instance,
@param {Object} [options]
@param {Function} fn( deltaTime:Number, elapsedTime:Number, frameCount:Number )
@returns {Animitter} | [
"function createAnimitter(options, fn){\n\n if( arguments.length === 1 && typeof options === 'function'){\n fn = options;\n options = {};\n }\n\n var _instance = new Animitter( options );\n\n if( fn ){\n _instance.on('update', fn);\n }\n\n return _instance;\n}"
] | [
"function render (state) {\n if (update) return update(state)\n const loop = mainLoop(state, renderFn(rend), vdom)\n update = loop.update\n return loop.target\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetNextToken sets the NextToken field's value. | [
"func (s *ListOrganizationsOutput) SetNextToken(v string) *ListOrganizationsOutput {\n\ts.NextToken = &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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Create a dictionary of SEQID: OLNID from the supplied | [
"def strains(self):\n \n with open(os.path.join(self.path, 'strains.csv')) as strains:\n next(strains)\n for line in strains:\n oln, seqid = line.split(',')\n self.straindict[oln] = seqid.rstrip()\n self.strainset.add(oln)\n ... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Add a custom Log Record Handler to the root of the tree
@param handler The handler to add
@return this | [
"public RedwoodConfiguration rootHandler(final LogRecordHandler handler){\r\n tasks.add(new Runnable(){ public void run(){ Redwood.appendHandler(handler); } });\r\n Redwood.appendHandler(handler);\r\n return this;\r\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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Applies the matrices computed from the scene object's
linked to the skeleton bones to the current pose.
@see #applyPose(GVRPose, int)
@see #setPose(GVRPose) | [
"public void poseFromBones()\n {\n for (int i = 0; i < getNumBones(); ++i)\n {\n GVRSceneObject bone = mBones[i];\n if (bone == null)\n {\n continue;\n }\n if ((mBoneOptions[i] & BONE_LOCK_ROTATION) != 0)\n {\n ... | [
"private void convertFromARtoVRSpace(float scale) {\n mPose.update(mARPlane.getCenterPose(), scale);\n getTransform().setModelMatrix(mPose.getPoseMatrix());\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Blob upload/download speed summary.
Trigger 'progress' event every progress updates. | [
"function SpeedSummary (name) {\n this.name = name;\n this._startTime = Date.now();\n this._timeWindowInSeconds = 10;\n this._timeWindow = this._timeWindowInSeconds * 1000;\n this._totalWindowSize = 0;\n this._speedTracks = new Array(this._timeWindowInSeconds);\n this._speedTrackPtr = 0;\n this.totalSize = ... | [
"def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
// SetBucket sets the Bucket field's value. | [
"func (s *ListObjectVersionsInput) SetBucket(v string) *ListObjectVersionsInput {\n\ts.Bucket = &v\n\treturn s\n}"
] | [
"function Entry (content, name, parent) {\n if (!(this instanceof Entry)) return new Entry(content, name, parent);\n\n this._parent = parent; // parent can be a Document or ArrayField\n this._schema = parent._schema; // the root Document\n this._name = name; // the field name supplied by the user\n this._hidde... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// forEachKeyScope calls the given function for each known manager scope
// within the set of scopes known by the root manager. | [
"func forEachKeyScope(ns walletdb.ReadBucket, fn func(KeyScope) error) error {\n\tbucket := ns.NestedReadBucket(scopeBucketName)\n\n\treturn bucket.ForEach(func(k, v []byte) error {\n\t\t// skip non-bucket\n\t\tif len(k) != 8 {\n\t\t\treturn nil\n\t\t}\n\n\t\tscope := KeyScope{\n\t\t\tPurpose: binary.LittleEndian.U... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Throws an exception on db error or db connect error | [
"private function AssertSuccess()\n {\n if ($this->db)\n {\n if ($this->IsConnected())\n {\n $errorCode = $this->db->errno;\n if ($errorCode != 0)\n {\n if ($this->inTransaction)\n $this->Ro... | [
"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:"
} |
Sets the allowed permissions of a given access control entry as allowed permissions in the access control list.<p>
The denied permissions are left unchanged.
@param entry the access control entry | [
"public void setAllowedPermissions(CmsAccessControlEntry entry) {\n\n CmsPermissionSetCustom p = m_permissions.get(entry.getPrincipal());\n if (p == null) {\n p = new CmsPermissionSetCustom();\n m_permissions.put(entry.getPrincipal(), p);\n }\n p.setPermissions(entr... | [
"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 summarization about Access control:",
"pos": "Represent the code about Access control:",
"neg": "Represent the code about programming:"
} |
Create VM and add disks if specified. | [
"def create_vm(self, userid, cpu, memory, disk_list, profile,\n max_cpu, max_mem, ipl_from, ipl_param, ipl_loadparam):\n \n rd = ('makevm %(uid)s directory LBYONLY %(mem)im %(pri)s '\n '--cpus %(cpu)i --profile %(prof)s --maxCPU %(max_cpu)i '\n '--maxMemSize ... | [
"def initrd(self, initrd):\n \n\n initrd = self.manager.get_abs_image_path(initrd)\n\n log.info('QEMU VM \"{name}\" [{id}] has set the QEMU initrd path to {initrd}'.format(name=self._name,\n id=self._id,\n... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Constructs a FactorContext
@param string $sid A string that uniquely identifies this Factor.
@return \Twilio\Rest\Authy\V1\Service\Entity\FactorContext | [
"public function getContext($sid) {\n return new FactorContext(\n $this->version,\n $this->solution['serviceSid'],\n $this->solution['identity'],\n $sid\n );\n }"
] | [
"protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n ... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Returns the user pointer of the specified window.
Wrapper for:
void* glfwGetWindowUserPointer(GLFWwindow* window); | [
"def get_window_user_pointer(window):\n \n\n window_addr = ctypes.cast(ctypes.pointer(window),\n ctypes.POINTER(ctypes.c_long)).contents.value\n\n if window_addr in _window_user_data_repository:\n data = _window_user_data_repository[window_addr]\n is_wrapped_py_ob... | [
"def releaseNativeOverlayHandle(self, ulOverlayHandle, pNativeTextureHandle):\n \n\n fn = self.function_table.releaseNativeOverlayHandle\n result = fn(ulOverlayHandle, pNativeTextureHandle)\n return result"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Simple helper to postprocess angular outputs from StatsCollectors in the
way we want. | [
"def postproc (stats_result):\n \n n, mean, scat = stats_result\n mean *= 180 / np.pi # rad => deg\n scat /= n # variance-of-samples => variance-of-mean\n scat **= 0.5 # variance => stddev\n scat *= 180 / np.pi # rad => deg\n return mean, scat"
] | [
"@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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add notification to queue.
@param array $all_notifications Previous notification.
@return array All notifications. | [
"public function add_notification( $all_notifications ) {\n\n\t\t$developers = [\n\t\t\t'Bogdan',\n\t\t\t'Marius',\n\t\t\t'Hardeep',\n\t\t\t'Rodica',\n\t\t\t'Stefan',\n\t\t\t'Uriahs',\n\t\t\t'Madalin',\n\t\t\t'Radu',\n\t\t\t'Silviu',\n\t\t\t'Andrei',\n\t\t];\n\n\t\t$link = 'https://wordpress.org/support/' . $this->... | [
"public function flush(): void\n {\n if (empty($this->buffers)) {\n return;\n }\n\n foreach ($this->buffers as $buffer) {\n try {\n $this->sender->sendTo($buffer[0], $buffer[1], $buffer[2]);\n } catch (SenderException $e) {\n if ... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Technology:"
} |
Get the existing document or proxy for this id of this class, or create
a new one.
@param string $targetId
@param string $className
@param string $locale
@return object | [
"public function getOrCreateProxy($targetId, $className, $locale = null)\n {\n $document = $this->getDocumentById($targetId);\n\n // check if referenced document already exists\n if ($document) {\n $metadata = $this->dm->getClassMetadata($className);\n if ($locale && $l... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get an array of paginated page data
@return array | [
"public function getPages()\n {\n $pages = array();\n\n if ($this->pages <= 1) {\n return array();\n }\n\n if ($this->pages <= $this->limit_pages) {\n for ($i = 1; $i <= $this->pages; $i++) {\n $pages[] = $this->createPage($i, $i == $this->current)... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Generator which gives all four lines if a fastq read as one string | [
"def stream_fastq(file_handler):\n ''' \n '''\n next_element = ''\n for i, line in enumerate(file_handler):\n next_element += line\n if i % 4 == 3:\n yield next_element\n next_element = ''"
] | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Adds phone number(s) to the blacklist
@param $phoneNumbers array|string The phone numbers
@return string status API response | [
"public function addBlacklist($phoneNumbers = null)\n {\n //If the <nums> parameter is blank, all users are removed from blacklist as Mutlucell Api says\n if ($phoneNumbers === null) {\n $phoneNumbers = '';\n }\n\n if (is_array($phoneNumbers)) {\n $phoneNumbers =... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// ParseTime parses wall clock time.
// e.g. hhmmss.ssss
// An empty time string will result in an invalid time. | [
"func ParseTime(s string) (Time, error) {\n\tif s == \"\" {\n\t\treturn Time{}, nil\n\t}\n\tif !timeRe.MatchString(s) {\n\t\treturn Time{}, fmt.Errorf(\"parse time: expected hhmmss.ss format, got '%s'\", s)\n\t}\n\thour, _ := strconv.Atoi(s[:2])\n\tminute, _ := strconv.Atoi(s[2:4])\n\tsecond, _ := strconv.ParseFloa... | [
"func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about datetime:"
} |
// FromServices builds environment variables that a container is started with,
// which tell the container where to find the services it may need, which are
// provided as an argument. | [
"func FromServices(services []*v1.Service) []v1.EnvVar {\n\tvar result []v1.EnvVar\n\tfor i := range services {\n\t\tservice := services[i]\n\n\t\t// ignore services where ClusterIP is \"None\" or empty\n\t\t// the services passed to this method should be pre-filtered\n\t\t// only services that have the cluster IP ... | [
"def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
// Release will return n units to the semaphore and notify any currently
// blocking Acquire calls. | [
"func (s *Sem) Release(n int64) {\n\ts.c.L.Lock()\n\tdefer s.c.L.Unlock()\n\tdebug.Printf(\"Release max %d free %d, n %d\", s.max, s.free, n)\n\ts.free += n\n\ts.c.Broadcast()\n}"
] | [
"@Override\n protected void updateCount() {\n // set counter to the actual value, rather than to try and\n // keep track with a seperate variable.\n // This counter must only be updated by the selector thread,\n // which allows us to omit synchronized logic.\n // there can be t... | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Returns <code>true</code> if the given log entry type matches this filter.<p>
@param type the log entry type to test
@return <code>true</code> if the given log entry type matches this filter | [
"public boolean matchType(CmsLogEntryType type) {\n\n if (m_excludeTypes.contains(type)) {\n return false;\n }\n if (m_includeTypes.isEmpty()) {\n return true;\n }\n return m_includeTypes.contains(type);\n }"
] | [
"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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about AWS Redshift:"
} |
Emits {@code modifiers} in the standard order. Modifiers in {@code implicitModifiers} will not
be emitted. | [
"public void emitModifiers(Set<Modifier> modifiers, Set<Modifier> implicitModifiers)\n throws IOException {\n if (modifiers.isEmpty()) return;\n for (Modifier modifier : EnumSet.copyOf(modifiers)) {\n if (implicitModifiers.contains(modifier)) continue;\n emitAndIndent(modifier.name().toLowerCas... | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
function str2unicode($str) // removed for dapphp/radius | [
"public function str2unicode($str)\n {\n $uni = '';\n $str = (string) $str;\n for ($i = 0; $i < strlen($str); $i++) {\n $a = ord($str{$i}) << 8;\n $uni .= sprintf(\"%X\", $a);\n }\n return pack('H*', $uni);\n }"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github instruction about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about Software development:"
} |
将map转化为json
@param map
@return | [
"public String formatMap2JSON(Map<String, Object> map) {\n\t\tStringWriter stringWriter = new StringWriter();\n\t\tString json = \"\";\n\t\ttry {\n\t\t\tJsonGenerator gen = new JsonFactory()\n\t\t\t\t\t.createJsonGenerator(stringWriter);\n\t\t\tMAPPER.writeValue(gen, map);\n\t\t\tgen.close();\n\t\t\tjson = stringWr... | [
"public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {\n String[] arr = nsAtZealotId.split(ZealotConst.SP_AT);\n if (arr.length != LEN) {\n throw new ValidFailException(\"nsAtZealotId参数的值必须是xml文件中的 nameSpace + '@@' + zealotId 节点的值,\"\n + \"如:'stu... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Generate the names for all route ids in the specification | [
"function getRouteNamespaces(spec) {\n let names = new Map();\n for (let id of spec.routeIDs) {\n let [namespace, explicit] = Namespace.forRoute(spec.route(id));\n namespace.log.push(`Route ${id} maps to ${namespace.fullName} (explicit = ${explicit})`);\n names.set(id, [namespace, explici... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Send email.
@param PasswordRecoverEvent $event Event | [
"public function sendEmail(PasswordRecoverEvent $event)\n {\n $this->renderEmail(\n 'Password recover email',\n $event->getUser()->getEmail(),\n [\n 'user' => $event->getUser(),\n ]\n );\n }"
] | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Get menu item by id
@param string $language The language code.
@return mixed The item object | [
"public function getDefault($language = '*')\n\t{\n\t\tif (array_key_exists($language, $this->_default) && $this->get('language_filter'))\n\t\t{\n\t\t\treturn $this->_items[$this->_default[$language]];\n\t\t}\n\n\t\tif (array_key_exists('*', $this->_default))\n\t\t{\n\t\t\treturn $this->_items[$this->_default['*']]... | [
"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:"
} |
// CompareAndSwapCertAuthority updates existing cert authority if the existing cert authority
// value matches the value stored in the backend. | [
"func (a *AuthWithRoles) CompareAndSwapCertAuthority(new, existing services.CertAuthority) error {\n\tif err := a.action(defaults.Namespace, services.KindCertAuthority, services.VerbCreate); err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\tif err := a.action(defaults.Namespace, services.KindCertAuthority, services.... | [
"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... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Salvar arquivo Config.
@param $group
@param string $environment | [
"public function saveConfig($group, $environment = '')\n {\n // Path do arquivo\n $path = config_path();\n\n // Itens\n $items = config($group, []);\n\n // Nome do arquivo\n $file = (! $environment || ($environment == 'production'))\n ? \"{$path}/{$group}.php\... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Return a list of all our methods matching a given string.
Is +is_class_methods+ if 'nil', we don't care if the method
is a class method or not, otherwise we only return
those methods that match | [
"def local_methods_matching(name, is_class_method)\n\n list = case is_class_method\n when nil then @class_methods + @instance_methods\n when true then @class_methods\n when false then @instance_methods\n else fail \"Unknown is_class_method: #{is_class_method.ins... | [
"def describe(self):\n \n result = {}\n #Because we created an Instance object, we already know that this object\n #is not one of the regular built-in types (except, perhaps, for list,\n #dict and set objects that can have their tracking turned on).\n\n #For objects that ar... | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
// stop stops the retrieval process and sets an error code that will be returned
// by getError | [
"func (r *sentReq) stop(err error) {\n\tr.lock.Lock()\n\tif !r.stopped {\n\t\tr.stopped = true\n\t\tr.err = err\n\t\tclose(r.stopCh)\n\t}\n\tr.lock.Unlock()\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 Container management:",
"pos": "Represent the Github code about Container management:",
"neg": "Represent the Github code about programming:"
} |
Generate and write feed content to handle
@param resource $targetHandle
@return $this
@throws FeedException
@throws LockException | [
"public function generateFeed($targetHandle)\n {\n $this->executeLocked(function () use ($targetHandle) {\n $this->writer->write($targetHandle);\n $this->touchFeedGenerateDate();\n });\n return $this;\n }"
] | [
"public function onDelete()\n {\n $this->validateRequestTheme();\n\n $type = Request::input('templateType');\n\n $this->loadTemplate($type, trim(Request::input('templatePath')))->delete();\n\n /*\n * Extensibility - documented above\n */\n $this->fireSystemEvent... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Return a string with the configuration | [
"def config(self):\n \"\"\"\"\"\"\n return \", \".join('%s:%s' % (key, value) for key, value in self.conf.items())"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Return server side errors. Shall be overridden by derived forms to add their
extra errors for AngularJS. | [
"def get_field_errors(self, field):\n \n identifier = format_html('{0}[\\'{1}\\']', self.form_name, field.name)\n errors = self.errors.get(field.html_name, [])\n return self.error_class([SafeTuple(\n (identifier, self.field_error_css_classes, '$pristine', '$pristine', 'invalid... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Set implicit wait. Default to @core.default_wait.
@example
set_wait 2
set_wait # @core.default_wait
@param timeout [Integer] the timeout in seconds
@return [void] | [
"def set_wait(timeout = nil)\n timeout = @core.default_wait if timeout.nil?\n @driver.manage.timeouts.implicit_wait = timeout\n end"
] | [
"function Flow(waits, // @arg Integer: Number of wait for processes\n callback, // @arg Function/FunctionHash/Flow/FlowHash: callback and forks\n // callback on completion of processes.\n // callback(err:Error, args:MixArray)\n ... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Remove subscriber from the given observer.
:param session_id: Subscriber's session identifier
:param observer_id: Observer identifier | [
"def remove_subscriber(session_id, observer_id):\n \n models.Observer.subscribers.through.objects.filter(\n subscriber_id=session_id, observer_id=observer_id\n ).delete()"
] | [
"def add_object(self, obj):\n \"\"\"\"\"\"\n if _debug: Application._debug(\"add_object %r\", obj)\n\n # extract the object name and identifier\n object_name = obj.objectName\n if not object_name:\n raise RuntimeError(\"object name required\")\n object_identifier... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// printRacks prints rack data to stdout in tab-separated columns. | [
"func printRacks(tsv bool, racks ...*crimson.Rack) {\n\tif len(racks) > 0 {\n\t\tp := newStdoutPrinter(tsv)\n\t\tdefer p.Flush()\n\t\tif !tsv {\n\t\t\tp.Row(\"Name\", \"Datacenter\", \"Description\", \"State\", \"KVM\")\n\t\t}\n\t\tfor _, r := range racks {\n\t\t\tp.Row(r.Name, r.Datacenter, r.Description, r.State,... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.