query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// Close cleans up the hook and closes the ETW provider. If the provder was // registered by etwlogrus, it will be closed as part of `Close`. If the // provider was passed in, it will not be closed.
[ "func (h *Hook) Close() error {\n\tif h.closeProvider {\n\t\treturn h.provider.Close()\n\t}\n\treturn nil\n}" ]
[ "func (m *Manager) removeProxyServiceLocked(proxyID string) {\n\tstate, ok := m.proxies[proxyID]\n\tif !ok {\n\t\treturn\n\t}\n\n\t// Closing state will let the goroutine we started in Ensure finish since\n\t// watch chan is closed.\n\tstate.Close()\n\tdelete(m.proxies, proxyID)\n\n\t// We intentionally leave poten...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Performs the Commit action with the Flow Adapter @param array $attributes @return array
[ "protected function performCommit(array $attributes)\n {\n return $this->flow->send(\n 'post',\n $this->endpoint . '/' . ($options['method'] ?? $this->verbsMap['commit'] ?? 'create'),\n $attributes\n );\n }" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
List the dependencies for a component. If Prism is provided, only returns dependencies that are not present in `Prism.languages` @param {Object} component Component definition @param {Prism} Prism instance @return {Array<String>}
[ "function getDependencies(component, Prism) {\n // Cast require to an Array\n const deps = [].concat(component.require || []);\n\n if (Prism) {\n return deps.filter(\n dep =>\n // Remove dependencies that are already loaded\n !Prism.languages[dep]\n );...
[ "function () {\n /**\n * Get a valid file path for a template file from a set of directories\n * @param {Object} opts Configurable options (see periodicjs.core.protocols for more details)\n * @param {string} [opts.extname] Periodic extension that may contain view file\n * @param {string} opts.viewna...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Print packages from queue
[ "def listed(self):\n \n print(\"\\nPackages in the queue:\\n\")\n for pkg in self.packages():\n if pkg:\n print(\"{0}{1}{2}\".format(self.meta.color[\"GREEN\"], pkg,\n self.meta.color[\"ENDC\"]))\n self.quit = True...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// List existing app features.
[ "func (s *Service) AppFeatureList(ctx context.Context, appIdentity string, lr *ListRange) (AppFeatureListResult, error) {\n\tvar appFeature AppFeatureListResult\n\treturn appFeature, s.Get(ctx, &appFeature, fmt.Sprintf(\"/apps/%v/features\", appIdentity), nil, lr)\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 description about App development:", "pos": "Represent the Github code about App development:", "neg": "Represent the Github code about programming:" }
// Length returns the sum of the length of the LineStrings.
[ "func (g *MultiLineString) Length() float64 {\n\treturn length2(g.flatCoords, 0, g.ends, g.stride)\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// signerRefs returns the set of signer blobRefs matching the signer keyID. It // does not return an error if none is found.
[ "func (x *Index) signerRefs(ctx context.Context, keyID string) (SignerRefSet, error) {\n\tif x.corpus != nil {\n\t\treturn x.corpus.signerRefs[keyID], nil\n\t}\n\tit := x.queryPrefixString(keySignerKeyID.name)\n\tvar err error\n\tvar refs SignerRefSet\n\tdefer closeIterator(it, &err)\n\tprefix := keySignerKeyID.nam...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Displays a SyntaxHighlighter content. @param array $args The arguments. @return string Returns the SyntaxHighlighter content. @throws FileNotFoundException Throws a file not found exception if the file does not exists.
[ "public function syntaxHighlighterContentFunction(array $args = []) {\n\n $tag = ArrayHelper::get($args, \"tag\", \"pre\");\n $language = ArrayHelper::get($args, \"language\", \"php\");\n $filename = ArrayHelper::get($args, \"filename\");\n $content = ArrayHelper::get($args, \"cont...
[ "public function validate( $input )\n {\n // Check if passed input is an object and instance of phpillowDocument\n // at all, otherwise we can exit immediately\n if ( !is_object( $input ) ||\n !( $input instanceof phpillowDocument ) )\n {\n throw new phpillowVal...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about PHP programming:" }
// Get reads the file specified by the tag
[ "func (d *FileDepot) Get(tag *Tag) ([]byte, error) {\n\tif err := d.check(tag); err != nil {\n\t\treturn nil, err\n\t}\n\treturn ioutil.ReadFile(d.path(tag.name))\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github text about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code about programming:" }
数据报解析,将byte数组解析为数据报 @param data 数据报的byte数组 @param allowErr 是否允许数据报错误,true表示允许,当允许该错误的时候,如果数据报实际长度大于报头的长度将采用报头的长度,该参数主要用于解析UDP数据 @return 从data中解析的数据报对象 @throws IllegalRequestException 正常情况不会抛该异常,当请求非法时可能抛出该异常
[ "public static Datagram decode(final byte[] data,\n boolean allowErr) throws IllegalRequestException {\n try {\n if (log.isDebugEnabled()) {\n log.debug(\"要解析的数据为:{}\", Arrays.toString(data));\n }\n // 字符集数据\n int end...
[ "protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}" ]
codesearchnet
{ "query": "Represent the description about Encryption:", "pos": "Represent the code about Encryption:", "neg": "Represent the code about Programming:" }
// WriteString writes a string to response write
[ "func (ctx *Context) WriteString(content string) (int, error) {\n\treturn io.WriteString(ctx.ResponseWriter, content)\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Returns the previous (last persisted) state of the property. If nothing is found, NULL is returned. @param object $object @param string $propertyName @return mixed
[ "public function getCleanStateOfProperty($object, $propertyName)\n {\n if ($this->isReconstitutedEntity($object) === false) {\n return null;\n }\n $identifier = $this->getIdentifierByObject($object);\n if (!isset($this->reconstitutedEntitiesData[$identifier]['properties'][$...
[ "@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Sets the account code used to bill this channel. @param account the account code used to bill this channel.
[ "void setAccount(String account)\n {\n final String oldAccount = this.account;\n\n this.account = account;\n firePropertyChange(PROPERTY_ACCOUNT, oldAccount, account);\n }" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
loads 'Recommendation lists' rss data @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. @param \OxidEsales\Eshop\Application\Model\RecommendationList $oRecommList recomm list to load articles from @return null
[ "public function loadRecommListArticles(\\OxidEsales\\Eshop\\Application\\Model\\RecommendationList $oRecommList)\n {\n if (($this->_aChannel = $this->_loadFromCache(self::RSS_RECOMMLISTARTS . $oRecommList->getId()))) {\n return;\n }\n\n $oList = oxNew(\\OxidEsales\\Eshop\\Applica...
[ "protected function _calcListItemsCount($sql)\n {\n $stringModifier = getStr();\n\n // count SQL\n $sql = $stringModifier->preg_replace('/select .* from/i', 'select count(*) from ', $sql);\n\n // removing order by\n $sql = $stringModifier->preg_replace('/order by .*$/i', '', $s...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Allow a single user to use this menu @param allowedUser allowed user @return this
[ "public T allowedUser(User allowedUser) {\n this.userPredicate = (user) -> user.getId() == allowedUser.getId();\n return instance();\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return value of one of parameter(s) or NULL is it has no value (or was not specified)
[ "def getx(self, name, *args):\n \n return lib.zargs_getx(self._as_parameter_, name, *args)" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
update the count of this stat datanode @param lastPrefix the path of the node that is quotaed. @param diff the diff to be added to the count
[ "public void updateCount(String lastPrefix, int diff) {\n String statNode = Quotas.statPath(lastPrefix);\n DataNode node = nodes.get(statNode);\n StatsTrack updatedStat = null;\n if (node == null) {\n // should not happen\n LOG.error(\"Missing count node for stat \"...
[ "public void add(final DataPoints dps) {\n metric_uids.add(dps.metricUID());\n \n // TODO - tags intersection\n \n for (final byte[] tagk : dps.getAggregatedTagUids()) {\n aggregated_tags.add(tagk);\n }\n \n tsuids.addAll(dps.getTSUIDs());\n // TODO - this ain't right. We need to num...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Write the blacklist.
[ "def write_blacklist (self):\n \n oldmask = os.umask(0077)\n for key, value in self.blacklist.items():\n self.write(u\"%d %s%s\" % (value, repr(key), os.linesep))\n self.close_fileoutput()\n # restore umask\n os.umask(oldmask)" ]
[ "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:" }
Change the Ready state to false
[ "protected void unsetReady()\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(tc, \"unsetReady\", this);\n\n //set the ready state\n _ready = false;\n\n if (_keyGroup != null)\n _keyGroup.groupNotReady();\n\n // if consu...
[ "function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Generate the contributions for the BuildFactory.
[ "protected void generateBuilderFactoryContributions() {\n\t\tfinal ExpressionContextDescription expressionContext = getExpressionContextDescription();\n\t\tfinal String createFunctionName = \"createXExpression\"; //$NON-NLS-1$\n\t\tthis.builderFactoryContributions.addContribution(new StringConcatenationClient() {\n...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Returns a new Response with no format data. Used to dispatch the individual format methods.
[ "def method_missing(name, &block)\n @formats.push([name, block || proc {}]) unless @formats.any? {|n,b| n == name}\n end" ]
[ "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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// SetSourceAccount sets the SourceAccount field's value.
[ "func (s *AddPermissionInput) SetSourceAccount(v string) *AddPermissionInput {\n\ts.SourceAccount = &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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Get faxes. @return FaxEntity[] @VirtualProperty @SerializedName("faxes") @Groups({"fullAccount"})
[ "public function getFaxes()\n {\n $faxes = [];\n if ($this->entity->getFaxes()) {\n foreach ($this->entity->getFaxes() as $fax) {\n $faxes[] = $fax;\n }\n }\n\n return $faxes;\n }" ]
[ "public List<String> getScheduledNotificationMessage(ScheduledNotification notification) {\n return broker.callRPCList(\"RGCWXQ SCHMSG\", null, notification.getIen());\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Programming:" }
2016-07-18 2017-11-12 It returns all the payment's transactions except the first one, wrapped by event instances. @used-by response() @return Ev[]
[ "private function responses() {return dfc($this, function() {return array_map(function(T $t) {return\n\t\tF::s($this->_m, df_trd($t))->e()\n\t;}, $this->tResponses());});}" ]
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Marshall the given parameter object.
[ "public void marshall(NotifyEmailType notifyEmailType, ProtocolMarshaller protocolMarshaller) {\n\n if (notifyEmailType == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(notifyEmailType.getS...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Generates a proper description for the given argument.
[ "def _get_description(arg):\n \"\"\"\"\"\"\n desc = []\n otherwise = False\n if arg.can_be_inferred:\n desc.append('If left unspecified, it will be inferred automatically.')\n otherwise = True\n elif arg.is_flag:\n desc.append('This argument defaults to '\n '<c...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// packFile packs a file or directory to zip.Writer.
[ "func packFile(srcFile string, recPath string, zw *zip.Writer, fi os.FileInfo) error {\n\tif fi.IsDir() {\n\t\tfh, err := zip.FileInfoHeader(fi)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfh.Name = recPath + \"/\"\n\t\tif _, err = zw.CreateHeader(fh); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tf...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// TxGet allows you to pass in your own bolt transaction to retrieve a value from the bolthold and puts it into result
[ "func (s *Store) TxGet(tx *bolt.Tx, key, result interface{}) error {\n\tstorer := newStorer(result)\n\n\tgk, err := encode(key)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbkt := tx.Bucket([]byte(storer.Type()))\n\tif bkt == nil {\n\t\treturn ErrNotFound\n\t}\n\n\tvalue := bkt.Get(gk)\n\tif value == nil {\n\t\tr...
[ "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 post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about File management:" }
Read data from the specified stream until it is closed by the remote peer. If the stream is never ended, this never returns.
[ "async def read_data(self, stream_id: int) -> bytes:\n \n frames = [f async for f in self.stream_frames(stream_id)]\n return b''.join(frames)" ]
[ "def send_io(io)\n # We read a message before actually calling #send_io\n # in order to prevent the other side from accidentally\n # read()ing past the normal data and reading our file\n # descriptor too.\n #\n # For example suppose that side A looks like this:\n #\n # read...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
get al list of all dependencies for the given item "dep"
[ "def _get_all_refs(self, dep, handled_refs=None):\n \n if handled_refs is None:\n handled_refs = [dep]\n else:\n if dep in handled_refs:\n return []\n res = []\n if dep in self.future_values_key_item:\n res.extend(\n s...
[ "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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Add custom parameters to pass to the JS via JSON. @since 1.0.0 @access public @return void
[ "public function to_json() {\n\t\tparent::to_json();\n\n\t\t// We need to make sure we have the correct image URL.\n\t\tforeach ( $this->choices as $value => $args ) {\n\t\t\t$this->choices[ $value ]['url'] = esc_url( sprintf( $args['url'], get_template_directory_uri(), get_stylesheet_directory_uri() ) );\n\t\t}\n\...
[ "function init(entry, socket, req) { // {{{2\n/**\n * Class constructor\n *\n * @param entry {Object} Entry of xorg kind\n *\n * @method constructor\n */\n\n this.entry = entry;\n\n O.link.open(this, socket);\n}" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Computer Science:" }
删除指定卡券 @param string $cardId @return false|Http
[ "public function deleteCard($cardId)\n {\n return $this->auth(function () use ($cardId) {\n $data = json_encode(['card_id' => $cardId], JSON_UNESCAPED_UNICODE);\n $result = $this->http->postJson($this->baseUrl . 'card/delete?access_token=' . $this->accessToken, $data);\n\n ...
[ "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:" }
[addEventListener Adds event listener to the timer] @param {string} event [event to listen] @param {function} listener [the event listener function]
[ "function addEventListener (event, listener) {\n if (hasDOM()) {\n eventEmitter.addEventListener(event, listener);\n } else if (hasEventEmitter()) {\n eventEmitter.on(event, listener);\n }\n }" ]
[ "function() {\n var events = this.eventDelegates;\n log.events && (Object.keys(events).length > 0) && console.log('[%s] addHostListeners:', this.localName, events);\n // NOTE: host events look like bindings but really are not;\n // (1) we don't want the attribute to be set and (2) we want to sup...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
@param array $info @param bool $recursive @return array
[ "public static function cleanPhpInfo($info, $recursive = false)\n {\n static $excludeKeys = ['directive', 'variable',];\n\n $clean = [];\n\n // Remove images and move nested args to root\n if (!$recursive && isset($info[0], $info[0][0]) && is_array($info[0])) {\n $info['ge...
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Parse Options @private @param options
[ "function parseOptions(options, callback) {\n \"use strict\";\n\n var _ = require('underscore');\n var config = require('./config');\n\n // get the UID and GID that we should run the workers as (allows workers to drop root privileges)\n if (options.u || options.g) {\n if (semver.gte(process.versions.node, '...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
determine connectivity structure. for simplicity only connects atoms of the same residue, peptide bonds and nucleotides
[ "function() {\n console.time('Mol.deriveConnectivity');\n var thisStructure = this;\n var prevResidue = null;\n this.eachResidue(function(res) {\n var sqrDist;\n var atoms = res.atoms();\n var numAtoms = atoms.length;\n for (var i = 0; i < numAtoms; i+=1) {\n var atomI = atoms...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Sets the hostname (e.g. localhost) which is required to access this site.<p> Setting the hostname to "*" is a wildcard that matches all hostnames @param serverName the hostname (e.g. localhost) which is required to access this site
[ "protected void setServerName(String serverName) {\n\n if (CmsStringUtil.isEmpty(serverName) || (WILDCARD.equals(serverName))) {\n m_serverName = WILDCARD;\n } else {\n m_serverName = serverName.trim();\n }\n }" ]
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
Obtain a runtime type information on a class. @param clazz The class object for which type information is required @return The runtime information interface
[ "public static <T> Clazz<T> FindClazz( Class<T> clazz )\n\t{\n\t\treturn impl.FindClazz( clazz );\n\t}" ]
[ "public String getNotifierClass()\n {\n StringBuffer sb = new StringBuffer(getShortName());\n sb.append(\"Notifier\");\n\n //\n // If the event set declaration has any parameterized types, then include them on\n // the notifier class as well. Currently, these can only be param...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
If core font is selected in document which is not onlyCoreFonts - substitute with non-core font
[ "function SubstituteCharsNonCore(&$writehtml_a, &$writehtml_i, &$writehtml_e)\n\t{\n\t\t// Ignore if in Textarea\n\t\tif ($writehtml_i > 0 && strtolower(substr($writehtml_a[$writehtml_i - 1], 0, 8)) == 'textarea') {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (mb_convert_encoding(mb_convert_encoding($writehtml_e, $this->mb_e...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Replaces the content of the item identified by it's registration key by the new value. @param string $identifier @param mixed $value @param string $type @throws RegistryException
[ "public function replace($identifier, $value, $type = \"\")\n {\n if (!$this->isRegistered($identifier, $type)) {\n throw new RegistryException(\n RegistryException::MODIFICATION_ATTEMPT_FAILED_TEXT . '(identifier: ' . $identifier . ')',\n RegistryException::MODIFI...
[ "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 summarization about Documentation:", "pos": "Represent the code about Documentation:", "neg": "Represent the code:" }
// OpenStorageTrie opens the storage trie of an account.
[ "func (db *cachingDB) OpenStorageTrie(addrHash, root common.Hash) (Trie, error) {\n\treturn trie.NewSecure(root, db.db)\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Return the fields which contain personal data. @param collection $items a reference to the collection to use to store the metadata. @return collection the updated collection of metadata items.
[ "public static function get_metadata(collection $items) : collection {\n $items->add_database_table(\n 'glossary_entries',\n [\n 'glossaryid' => 'privacy:metadata:glossary_entries:glossaryid',\n 'userid' => 'privacy:metadata:glossary_entries:useri...
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Removes the FindBugs builder from the project. @see IProjectNature#deconfigure
[ "@Override\n public void deconfigure() throws CoreException {\n if (DEBUG) {\n System.out.println(\"Removing findbugs from the project build spec.\");\n }\n // de-register FindBugs builder\n removeFromBuildSpec(FindbugsPlugin.BUILDER_ID);\n }" ]
[ "public ClassReloadingStrategy enableBootstrapInjection(File folder) {\n return new ClassReloadingStrategy(instrumentation, strategy, new BootstrapInjection.Enabled(folder), preregisteredTypes);\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Validate that an attribute matches a date format. @param string $attribute @param mixed $value @param array $parameters @return bool
[ "protected function validateDateFormat($attribute, $value, $parameters)\n {\n $this->requireParameterCount(1, $parameters, 'date_format');\n\n $parsed = date_parse_from_format($parameters[0], $value);\n\n return $parsed['error_count'] === 0 && $parsed['warning_count'] === 0;\n }" ]
[ "public static function custom($check, $regex = null)\n {\n if ($regex === null) {\n static::$errors[] = 'You must define a regular expression for Validation::custom()';\n\n return false;\n }\n\n return static::_check($check, $regex);\n }" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Devide url on segments @return array
[ "protected function devideUrl()\n {\n $parts = explode('/', $this->getPath());\n $cnt = count($parts);\n for ($i = 0; $i < $cnt; $i++) {\n $parts[$i] = trim($parts[$i]);\n }\n return $parts;\n }" ]
[ "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:" }
Main method of the Command-line interface (CLI) @param args command-line arguments @throws Throwable
[ "public static void main(String[] args) throws Throwable {\n\t\tCliArguments arguments = CliArguments.parse(args);\n\t\tif (arguments.isSet() && !arguments.isUsageMode()) {\n\t\t\tCliRunner runner = new CliRunner(arguments);\n\t\t\ttry {\n\t\t\t\trunner.run();\n\t\t\t} finally {\n\t\t\t\trunner.close();\n\t\t\t}\n\...
[ "public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about N/A:" }
Returns true, if a given character is a letter (a-z and A-Z). @param string $char A single character @return bool
[ "protected function isLetter($char)\n {\n if ($char === null) {\n return false;\n }\n\n // Notice: ord(null) will return 0.\n // ord() does not work with utf-8 characters.\n $ascii = ord($char);\n\n // ASCII codes: 65 = 'A', 90 = 'Z', 97 = 'a', 122 = 'z'\n ...
[ "def type(self, type):\n \n if type is None:\n raise ValueError(\"Invalid value for `type`, must not be `None`\")\n if type is not None and len(type) > 50:\n raise ValueError(\"Invalid value for `type`, length must be less than or equal to `50`\")\n if type is not N...
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Create field instance by its declaration. @param array $declaration Field declaration. @return AbstractField Field instance. @throws ConfigurationException If invalid declaration is presented.
[ "private static function instantiate(array $declaration)\n {\n $fieldType = array_shift($declaration);\n\n $class = \"\\\\Zerg\\\\Field\\\\\" . ucfirst(strtolower($fieldType));\n if (class_exists($class)) {\n $reflection = new \\ReflectionClass($class);\n return $reflec...
[ "private function getColumnFromName($name)\n {\n foreach ($this->columnConfiguration as $i => $col) {\n if ($col->getName() == $name) {\n return $col;\n }\n }\n\n // This exception should never happen. If it does, something is\n // wrong w/ the rel...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
//////////////////////////////////////////////////////////////////////////////// // Run the alias command.
[ "func aliasCmd(args []string, aliases *Aliases) error {\n\tif len(args) >= 2 {\n\t\tvar eth string\n\t\tif len(args) > 2 {\n\t\t\teth = args[2]\n\t\t}\n\t\t// TODO: Validate mac address\n\t\talias, mac := args[0], args[1]\n\t\treturn aliases.Add(alias, mac, eth)\n\t}\n\treturn errors.New(\"alias command requires a ...
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
パスを変換する @param string $path 変換前のパス @param mixed $callback コールバック関数 または 変換ルール文字列 @return [type] 変換後のパス
[ "public function rewrite($path, $callback){\n\t\tif( is_null($callback) ){\n\t\t\t// コールバック関数が設定されなかった場合\n\t\t\treturn $path;\n\t\t}elseif( is_callable($callback) ){\n\t\t\t// コールバック関数が設定された場合\n\t\t\treturn call_user_func( $callback, $path );\n\t\t}elseif( is_string($callback) ){\n\t\t\t$path_rewrited = $callback;\...
[ "function GroupProfile(_id, _owner) {\n this._id = _id;\n this._owner = _owner;\n this._parent = null; //!< 親 GroupProfile インスタンス\n this._children = []; //!< 子 GroupProfile インスタンス\n this._expanded = false; //!< 開閉情報\n this._st...
codesearchnet
{ "query": "Represent the post about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
// Open opens a filepath.
[ "func (w *Writer) open(filepath string) error {\n\tf, err := os.Create(filepath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tw.File = f\n\treturn nil\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code about programming:" }
// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSTrim
[ "func (d *Domain) FSTrim(mount string, minimum uint64, flags uint32) error {\n\tvar cmount *C.char\n\tif mount != \"\" {\n\t\tcmount := C.CString(mount)\n\t\tdefer C.free(unsafe.Pointer(cmount))\n\t}\n\n\tvar err C.virError\n\tret := C.virDomainFSTrimWrapper(d.ptr, cmount, C.ulonglong(minimum), C.uint(flags), &err)...
[ "func (g *Generator) SetVMHypervisorParameters(parameters []string) {\n\tg.initConfigVMHypervisor()\n\tg.Config.VM.Hypervisor.Parameters = parameters\n}" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
插入排序 @param arrays 数组
[ "public static void insertSort(int[] arrays) {\n for (int i = 1; i < arrays.length; i++) {\n int currentNumber = arrays[i];\n int j = i - 1;\n while (j >= 0 && arrays[j] > currentNumber) {\n arrays[j + 1] = arrays[j--];\n }\n arrays[j + 1]...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about text processing:" }
// WithTimeout adds the timeout to the get Json web key set params
[ "func (o *GetJSONWebKeySetParams) WithTimeout(timeout time.Duration) *GetJSONWebKeySetParams {\n\to.SetTimeout(timeout)\n\treturn o\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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
[ "func (lkt *lkt) WeekdayNarrow(weekday time.Weekday) string {\n\treturn lkt.daysNarrow[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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about datetime:" }
// Encode serializes the target Init into the passed io.Writer observing // the protocol version specified. // // This is part of the lnwire.Message interface.
[ "func (msg *Init) Encode(w io.Writer, pver uint32) error {\n\treturn WriteElements(w,\n\t\tmsg.GlobalFeatures,\n\t\tmsg.LocalFeatures,\n\t)\n}" ]
[ "func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}" ]
codesearchnet
{ "query": "Represent the Github description about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code:" }
Format::apply @return string
[ "public function apply()\n {\n if (empty($this->string)) {\n return '';\n }\n\n $lines = explode(\"\\n\", $this->string);\n\n foreach ($lines as &$line) {\n $line = ((string)$this->quote)\n . $line;\n }\n\n if ($this->color instanceof...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemory
[ "func (d *Domain) SetMemory(memory uint64) error {\n\tvar err C.virError\n\tresult := C.virDomainSetMemoryWrapper(d.ptr, C.ulong(memory), &err)\n\tif result == -1 {\n\t\treturn makeError(&err)\n\t}\n\treturn nil\n}" ]
[ "func (g *Generator) SetVMHypervisorParameters(parameters []string) {\n\tg.initConfigVMHypervisor()\n\tg.Config.VM.Hypervisor.Parameters = parameters\n}" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetEditHistory implements the KBFSOps interface for KBFSOpsStandard
[ "func (fs *KBFSOpsStandard) GetEditHistory(\n\tctx context.Context, folderBranch data.FolderBranch) (\n\ttlfHistory keybase1.FSFolderEditHistory, err error) {\n\tops := fs.getOps(ctx, folderBranch, FavoritesOpAdd)\n\treturn ops.GetEditHistory(ctx, folderBranch)\n}" ]
[ "@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Compute x^T * y (dot product)
[ "public static double dot(DoubleMatrix x, DoubleMatrix y) {\n\t\t//return NativeBlas.ddot(x.length, x.data, 0, 1, y.data, 0, 1);\n\t\treturn JavaBlas.rdot(x.length, x.data, 0, 1, y.data, 0, 1);\n\t}" ]
[ "def _forney(self, omega, X):\n ''''''\n # XXX Is floor division okay here? Should this be ceiling?\n\n Y = [] # the final result, the error/erasures polynomial (contain the values that we should minus on the received message to get the repaired message)\n Xlength = len(X)\n for l...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
{@inheritDoc} @see org.jboss.shrinkwrap.api.Assignable#as(java.lang.Class)
[ "@Override\n public <TYPE extends Assignable> TYPE as(final Class<TYPE> clazz) {\n return archive.as(clazz);\n }" ]
[ "void processAnnotatedType(@Observes ProcessAnnotatedType<DefaultHystrixConcurrencyStrategy> event) {\n event.configureAnnotatedType()\n .filterFields(field -> \"managedThreadFactory\".equals(field.getJavaMember().getName()))\n .forEach(field -> {\n field.remo...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return HTTP protocol version (X.Y) @param array $server The $_SERVER supperglobal. @return string Protocol version.
[ "private static function getProtocolVersion(array $server)\n {\n if (!isset($server['SERVER_PROTOCOL'])) {\n return '1.1';\n }\n\n if (!preg_match('/^(HTTP\\/)?(\\d+(?:\\.\\d+)+)/', $server['SERVER_PROTOCOL'], $matches)) {\n throw new \\UnexpectedValueException(\n ...
[ "public function setRequestHeader($name, $value) {\n $header = array();\n $header[$name] = $value;\n //TODO: as a limitation of the driver it self, we will send permanent for the moment\n $this->browser->addHeader($header, true);\n }" ]
codesearchnet
{ "query": "Represent the summarization about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
Initializes fields with data from setup bean. @param the webapp name (null for root webapp)
[ "public void initFromSetupBean(String webapp) {\n\n String db = m_setupBean.getDatabase();\n CmsSetupBean bean = m_setupBean;\n Map<String, String[]> params = new HashMap<>();\n m_setupPanel.setVisible(true);\n switch (db) {\n case \"mysql\":\n case \"mssql\"...
[ "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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
helper for decode
[ "private static void checkByte(int ch, int pos, int len) throws IOException {\n if ((ch & 0xc0) != 0x80) {\n throw new IOException(\n GT.tr(\"Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}\",\n pos, len, ch));\n }\n }" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create the schema if necessary. @return {@code true} if the schema was created @see DataSourceProperties#getSchema()
[ "public boolean createSchema() {\n\t\tList<Resource> scripts = getScripts(\"spring.datasource.schema\",\n\t\t\t\tthis.properties.getSchema(), \"schema\");\n\t\tif (!scripts.isEmpty()) {\n\t\t\tif (!isEnabled()) {\n\t\t\t\tlogger.debug(\"Initialization disabled (not running DDL scripts)\");\n\t\t\t\treturn false;\n\...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Create a WURFL_UserAgentHandlerChain from the given $context @param WURFL_Context $context @return WURFL_UserAgentHandlerChain
[ "public static function createFrom(WURFL_Context $context)\n {\n $cached_data = $context->cacheProvider->load('UserAgentHandlerChain');\n if ($cached_data !== null) {\n self::$_userAgentHandlerChain = $cached_data;\n foreach (self::$_userAgentHandlerChain->getHandlers() as $ha...
[ "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 summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
If there is a Java SecurityManager create a Permission. @param permission The permission
[ "public void addPermission(Permission permission) {\n if ((securityManager != null) && (permission != null)) {\n permissionList.add(permission);\n }\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Make best effort to make a port address valid
[ "func ScrubPortString(port string) string {\n\t// remove possible protocol at string beginning\n\tscrubbed := protocolPrefixRegex.ReplaceAllString(port, \"\")\n\n\tmatched, _ := regexp.MatchString(\"^[0-9]+$\", scrubbed)\n\tif matched {\n\t\tscrubbed = fmt.Sprintf(\":%s\", scrubbed)\n\t}\n\n\treturn scrubbed\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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
trade是一个可迭代的list/generator
[ "def import_trade(self, trade):\n \n for item in trade:\n self.make_deal(item.code, item.datetime, item.amount,\n item.towards, item.price.item.order_model, item.amount_model)" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns the first Server object matching the given name. @param string $name @throws Exception @return Server
[ "public function serverGetByName($name)\n {\n foreach($this->serverList() as $server)\n {\n if($server[\"virtualserver_name\"] == $name) return $server;\n }\n\n throw new Exception(\"invalid serverID\", 0x400);\n }" ]
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Important comments begin with /*! They are treated as license blocks, but no further JSDoc parsing is performed
[ "void parseImportantComment() {\n state = State.SEARCHING_ANNOTATION;\n skipEOLs();\n\n JsDocToken token = next();\n\n ExtractionInfo info = extractMultilineComment(token, WhitespaceOption.PRESERVE, false, true);\n\n // An extra space is added by the @license annotation\n // so we need to add one ...
[ "def t_ANY_ID(self, token):\n '\n if token.value in self.KEYWORDS:\n if (token.value == 'annotation_type') and self.cur_indent:\n # annotation_type was added as a reserved keyword relatively\n # late, when there could be identifers with the same name\n ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Regular expressions:" }
Get an ID from a user, creates if necessary
[ "def get_id_from_user(user):\n \"\"\"\"\"\"\n id = r_client.hget('user-id-map', user)\n if id is None:\n id = str(uuid4())\n r_client.hset('user-id-map', user, id)\n r_client.hset('user-id-map', id, user)\n return id" ]
[ "func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit...
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
load a object(those in spec._version_.objects) from a JSON reference.
[ "def load_obj(self, jref, getter=None, parser=None):\n \n obj = self.__resolver.resolve(jref, getter)\n\n # get root document to check its swagger version.\n tmp = {'_tmp_': {}}\n version = utils.get_swagger_version(obj)\n if version == '1.2':\n # swagger 1.2\n ...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Logs the probe result and raises on failure
[ "def report_and_raise(probe_name, probe_result, failure_msg):\n \"\"\"\"\"\"\n log.info('%s? %s' % (probe_name, probe_result))\n if not probe_result:\n raise exceptions.ProbeException(failure_msg)\n else:\n return True" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Generate the Plist file. @param it the appendable used for generated the "tmLanguage" file.
[ "protected void generatePlistFile(CombinedTmAppendable it) {\n\t\tfinal String language = getLanguageSimpleName().toLowerCase();\n\t\tfinal String newBasename = getBasename(MessageFormat.format(BASENAME_PATTERN_NEW, language));\n\t\twriteFile(newBasename, it.getNewSyntaxContent());\n\t}" ]
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Print the UI that allows us to change the number of tasks assigned per heartbeat.
[ "private void showNumTaskPerHeartBeatOption(\n PrintWriter out, boolean advancedView) {\n\n out.print(\"<h2>Number of Assigned Tasks Per HeartBeat</h2>\\n\");\n out.printf(\"<p>Number of map tasks assigned per heartbeat:%s\",\n generateSelect(Arrays.asList(\"1,2,3,4,5,6,7,8,9,10\".spli...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Returns the ip:port of the MinIO process // running in the container
[ "func findEndpoint() (string, error) {\n\tcmd := exec.Command(\"netstat\", \"-ntlp\")\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\t// error getting stdout pipe\n\t\treturn \"\", err\n\t}\n\tif err = cmd.Start(); err != nil {\n\t\t// error executing the command.\n\t\treturn \"\", err\n\t}\n\t// split n...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github summarization about Container management:", "pos": "Represent the Github code about Container management:", "neg": "Represent the Github code about programming:" }
// Returns a slice of ElementParser's for the Graphite format
[ "func NewWavefrontElements() []ElementParser {\n\tvar elements []ElementParser\n\twsParser := WhiteSpaceParser{}\n\twsParserNextOpt := WhiteSpaceParser{nextOptional: true}\n\trepeatParser := LoopedParser{wrappedParser: &TagParser{}, wsPaser: &wsParser}\n\telements = append(elements, &NameParser{}, &wsParser, &Value...
[ "@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 Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
@param ResponseInterface $response @throws \Fnayou\InstapushPHP\Exception\ApiException
[ "protected function handleNotJsonException(ResponseInterface $response)\n {\n if (true !== $response->hasHeader('Content-Type')\n || 'application/json' !== $response->getHeaderLine('Content-Type')\n ) {\n throw new ApiException(\n \\sprintf(\n ...
[ "public function beforeSend(\\Mmi\\Http\\Request $request)\n {\n //pobranie odpowiedzi\n $response = \\Mmi\\App\\FrontController::getInstance()->getResponse();\n //zmiana contentu\n $response->setContent((new \\Cms\\Model\\ContentFilter($response->getContent()))->getFilteredContent())...
codesearchnet
{ "query": "Represent the Github comment about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Programming:" }
giving it an improved prediction).
[ "private void score_decide(Chunk chks[], Chunk nids, Chunk wrks, Chunk tree, int nnids[]) {\n for( int row=0; row<nids._len; row++ ) { // Over all rows\n int nid = (int)nids.at80(row); // Get Node to decide from\n if( isDecidedRow(nid)) { // already done\n nnids[row...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// String returns a string representation of the message, lazily // rendering the message, and caching it privately.
[ "func (p *ProcessInfo) String() string {\n\tif p.rendered == \"\" {\n\t\tp.rendered = renderStatsString(p.Message, p)\n\t}\n\n\treturn p.rendered\n}" ]
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the Github sentence about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code:" }
SURFACE 3D = NOTDEEP + ACC
[ "def get_surface_subseq_3D(protein,\n depth_prop='RES_DEPTH-msms', depth_cutoff=2.5, depth_condition='<',\n acc_prop='RSA_ALL-freesasa_het', acc_cutoff=25, acc_condition='>'):\n \"\"\"\"\"\"\n empty = {'surface_3D': {'subseq_len' : 0, 'subse...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Set global timeout value, in seconds, for all DDE calls
[ "def setTimeout(self, time):\n \"\"\"\"\"\"\n self.conversation.SetDDETimeout(round(time))\n return self.conversation.GetDDETimeout()" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
@param CheckOutcome $outcome @return string
[ "protected function getTranslatedMessage(CheckOutcome $outcome)\n {\n return $this->translateOutcomeLevel($outcome->getLevel()).' - '.$this->translate(\n $outcome->getMessageKey(),\n $outcome->getMessageParameters()\n );\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Process the lines from a file. @param SplFileObject $file @return void
[ "protected function processLines(SplFileObject $file)\n {\n $filename = $file->getPathname();\n\n $lines = [];\n $duplicates = [];\n foreach ($file as $line) {\n $trimLine = trim($line);\n $lineNo = ($file->key() + 1);\n\n if (isset($lines[$trimLine]))...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Converts a {@link JsonObject} to a {@link State} object. It does not add any keys specified in the excludeKeys array
[ "public static State jsonObjectToState(JsonObject jsonObject, String... excludeKeys) {\n State state = new State();\n List<String> excludeKeysList = excludeKeys == null ? Lists.<String>newArrayList() : Arrays.asList(excludeKeys);\n for (Map.Entry<String, JsonElement> jsonObjectEntry : jsonObject.entrySet()...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// SetMaxAllocatedStorage sets the MaxAllocatedStorage field's value.
[ "func (s *OrderableReplicationInstance) SetMaxAllocatedStorage(v int64) *OrderableReplicationInstance {\n\ts.MaxAllocatedStorage = &v\n\treturn s\n}" ]
[ "func (a *AccumulatedCopySizeError) Error() string {\n\treturn fmt.Sprintf(\"Unable to complete the copy, the accumulated size increase of copy is %d, exceeding the limit %d\", a.accumulated, a.limit)\n}" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
This is the entry point method.
[ "public void onModuleLoad() {\n final Button sendButton = new Button( messages.sendButton() );\n final TextBox nameField = new TextBox();\n nameField.setText( messages.nameField() );\n final Label errorLabel = new Label();\n\n // We can add style names to widgets\n sendButton.addStyleName(\"sendBu...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Get the filename from a given path
[ "public static String getFilename(String path) {\n //The filename is after the last slash\n final int index = path != null ? path.lastIndexOf(\"/\") : -1;\n if (index == -1) {\n IOException ioe = new IOException(TraceNLS.getFormattedMessage(FileTransferHelper.class,\n ...
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SyncQueueLen will set the maximum queue len for the internal // channel used for SubscribeSync().
[ "func SyncQueueLen(max int) Option {\n\treturn func(o *Options) error {\n\t\to.SubChanLen = max\n\t\treturn nil\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Gets the list of watchers from the given Plexus context. @param context the Plexus context @return the list of watcher, empty if none. Modifying the resulting list, updates the stored list.
[ "static synchronized List<Watcher> get(Context context) {\n List<Watcher> watchers;\n if (context.contains(WATCHERS_KEY)) {\n try {\n watchers = (List<Watcher>) context.get(WATCHERS_KEY);\n } catch (ContextException e) {\n throw new IllegalStateExcep...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get a handle for this object This function returns an unique identifier for the object. This id can be used as a hash key for storing objects or for identifying an object @return string A string that is unique
[ "public function getHandle()\n {\n if (isset($this->_identity_key)) {\n $handle = $this->getProperty($this->_identity_key);\n } else {\n $handle = parent::getHandle();\n }\n\n return $handle;\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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// ATime returns the LastAccessTime from Win32FileAttributeData.
[ "func (fi *winExFileInfo) ATime() time.Time {\n\tlastAccessTime := fi.Sys().(syscall.Win32FileAttributeData).LastAccessTime\n\tn := lastAccessTime.Nanoseconds()\n\treturn time.Unix(0, 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 Github description about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code about programming:" }
Do subtraction on date string. @param dateStr formatted date string. @param days days count you want to subtract. @param tz time zone of the date time string @return datetime string.
[ "public static String dateSub(String dateStr, int days, TimeZone tz) {\n\t\tlong ts = parseToTimeMillis(dateStr, tz);\n\t\tif (ts == Long.MIN_VALUE) {\n\t\t\treturn null;\n\t\t}\n\t\treturn dateSub(ts, days, tz);\n\t}" ]
[ "def _parse_filter_word(self, word):\n \n if isinstance(word, str):\n word = \"'{}'\".format(word)\n elif isinstance(word, dt.date):\n if isinstance(word, dt.datetime):\n if word.tzinfo is None:\n # if it's a naive datetime, localize the d...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
{@inheritDoc} @throws Exception
[ "@Override\n protected void initQueue(T queue, QueueSpec spec) throws Exception {\n queue.setMongoClient(defaultMongoClient).setConnectionString(defaultConnectionString)\n .setCollectionName(defaultCollectionName);\n\n String connectionString = spec.getField(SPEC_FIELD_CONNECTION_STR...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Update given $block with $parameterData for the $locale.
[ "private function updateBlockTranslation(Block $block, array $parameterData, string $locale): void\n {\n $updateStruct = $this->blockService->newBlockUpdateStruct($locale, $block);\n $updateStruct->fillParametersFromHash($block->getDefinition(), $parameterData, true);\n\n $this->blockService...
[ "function completeQuery(err) {\n if (err) return cb(err);\n db.eval(zahd, 2, 'expiring_domains', 'querying_domains',\n expiration, domain, next);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// internal function to add a PEM-encoded clientRootCA
[ "func (gServer *GRPCServer) appendClientRootCA(clientRoot []byte) error {\n\n\terrMsg := \"Failed to append client root certificate(s): %s\"\n\t//convert to x509\n\tcerts, subjects, err := pemToX509Certs(clientRoot)\n\tif err != nil {\n\t\treturn fmt.Errorf(errMsg, err.Error())\n\t}\n\n\tif len(certs) < 1 {\n\t\tre...
[ "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:" }
Convert CSV to a list of dicts formatted for os_cloud_config Given a CSV file in the format below, convert it into the structure expected by os_could_config JSON files. pm_type, pm_addr, pm_user, pm_password, mac
[ "def _csv_to_nodes_dict(nodes_csv):\n \n\n data = []\n\n for row in csv.reader(nodes_csv):\n node = {\n \"pm_user\": row[2],\n \"pm_addr\": row[1],\n \"pm_password\": row[3],\n \"pm_type\": row[0],\n \"mac\": [\n row[4]\n ...
[ "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 Github sentence about Data processing:", "pos": "Represent the Github code about Data processing:", "neg": "Represent the Github code about Technology:" }
Set/update _current_term and _current_session fields on all bills for a given location.
[ "def populate_current_fields(abbr):\n \n meta = db.metadata.find_one({'_id': abbr})\n current_term = meta['terms'][-1]\n current_session = current_term['sessions'][-1]\n\n for bill in db.bills.find({settings.LEVEL_FIELD: abbr}):\n if bill['session'] == current_session:\n bill['_curr...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Do a remote call. @param $request The Request instance @param $isLogin Boolean whether this request is a login request or not @return The Response instance
[ "protected function doRemoteCall(Request $request, $isLogin) {\n // initially login, if no sessionId is set\n $sessionId = $this->getSessionId();\n if (!$isLogin && $sessionId == null) {\n $response = $this->doLogin();\n if ($response) {\n \t $sessionId = $this->getSessionId();\n }\n ...
[ "public static function current()\n {\n if (static::$_current === null) {\n if ($token = AuthToken::current()) {\n //\n // TODO: (known bug)\n // When accessing $token->auth inside an observer other than `auth`,\n // the table name of ...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }