query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
@param FormInterface $form @param HelperSet $helperSet @param InputInterface $input @param OutputInterface $output @throws CanNotInteractWithForm If the input isn't interactive or a compound form @return array
[ "public function interactWith(\n FormInterface $form,\n HelperSet $helperSet,\n InputInterface $input,\n OutputInterface $output\n ) {\n if (!$input->isInteractive()) {\n throw new CanNotInteractWithForm('This interactor only works with interactive input');\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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Use this API to fetch filtered set of lbroute resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
[ "public static lbroute[] get_filtered(nitro_service service, String filter) throws Exception{\n\t\tlbroute obj = new lbroute();\n\t\toptions option = new options();\n\t\toption.set_filter(filter);\n\t\tlbroute[] response = (lbroute[]) obj.getfiltered(service, option);\n\t\treturn response;\n\t}" ]
[ "def list(self, mask=None):\n \n if mask is None:\n mask = \"mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]\"\n groups = self.client.call('Account', 'getPlacementGroups', mask=mask, iter=True)\n return groups" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Elapsed time for all events {@code from} through {@code to} for the current thread.
[ "public double getElapsedTimeCurrentThread(int from, int to) {\n\t Accumulator acc = getAccForThread();\n\n\t return acc == null ? Double.NaN : (acc.currentTimes[to] - acc.currentTimes[from]) / MILLION;\n }" ]
[ "@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Returns the simplified name of the {@link #serviceType()}.
[ "protected final String simpleServiceName() {\n final Class<?> serviceType = serviceType();\n final String fqcn = serviceType.getName();\n final int lastDot = fqcn.lastIndexOf('.');\n return lastDot < 0 ? fqcn : fqcn.substring(lastDot + 1);\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 instruction about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about Programming:" }
sub class helpers
[ "protected void setIntegerProperty(UIComponent component, String propName,\n ValueExpression value)\n {\n UIComponentELTagUtils.setIntegerProperty(component, propName, value);\n }" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Call the given route's before (non-pattern) filters. @param \Fly\Routing\Route $route @param \Fly\Http\Request $request @return mixed
[ "protected function callAttachedBefores($route, $request)\n\t{\n\t\tforeach ($route->beforeFilters() as $filter => $parameters)\n\t\t{\n\t\t\t$response = $this->callRouteFilter($filter, $parameters, $route, $request);\n\n\t\t\tif ( ! is_null($response)) return $response;\n\t\t}\n\t}" ]
[ "public function initialize()\n {\n //The global dispatcher\n\n //state the application is initialized;\n //register aliases as class mocks such that static calls on mock map to instance calls;\n $this->createAliasMock(\n array_merge(\n $this->aliases, [\n ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Register all standard TEAPPS validation execution sets to the provided registry. @param aRegistry The registry to add the artefacts. May not be <code>null</code>.
[ "public static void initTEAPPS (@Nonnull final ValidationExecutorSetRegistry aRegistry)\n {\n ValueEnforcer.notNull (aRegistry, \"Registry\");\n\n final boolean bNotDeprecated = false;\n\n // No Schematrons here\n aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_TEAPPS_272,\n ...
[ "def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about AWS Auto Scaling:" }
// XXX_OneofFuncs is for the internal use of the proto package.
[ "func (*Response) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Response_OneofMarshaler, _Response_OneofUnmarshaler, _Response_OneofSizer, []interface{}{\n\t\t(*Res...
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Try to find the token for the provided request token key.
[ "def _get_token(self, oauth_request, token_type='access'):\n \"\"\"\"\"\"\n token_field = oauth_request.get_parameter('oauth_token')\n token = self.data_store.lookup_token(token_type, token_field)\n if not token:\n raise OAuthError('Invalid %s token: %s' % (token_type, token_f...
[ "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 Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Unregister a driver type @param string name of the driver type @return bool
[ "public static function unregister_driver_type($type)\n\t{\n\t\tif (in_array($type,array('login', 'group', 'acl')))\n\t\t{\n\t\t\t\\Error::notice('Cannot remove driver type, included drivers login, group and acl cannot be removed.');\n\t\t\treturn false;\n\t\t}\n\n\t\tunset(static::$_drivers[$type]);\n\t\treturn tr...
[ "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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Decodes an anonymous naming scheme that spider monkey implements based on "Naming Anonymous JavaScript Functions" http://johnjbarton.github.io/nonymous/index.html @param {String} name : Function name to clean up @returns String
[ "function cleanFunctionName(name) {\n for (const reg of [\n objectProperty,\n arrayProperty,\n functionProperty,\n annonymousProperty\n ]) {\n const match = reg.exec(name);\n if (match) {\n return match[1];\n }\n }\n\n return name;\n}" ]
[ "function BinaryPacker_pack(source, // @arg Any - source data\n formatID) { // @arg Integer - 0x0001 - 0xffff\n // @ret Uint8Array|null\n//{@dev\n $valid(_isValidFormatID(formatID), BinaryPacker_pack, \"formatID\");\n//}@dev\n var moduleID = ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Java programming:" }
Moves the line to the given value and rebuilds it :param value | <variant>
[ "def setValue( self, value ):\r\n \r\n scene = self.scene()\r\n point = scene.mapFromChart(value, None)\r\n \r\n self.setPos(point.x(), self.pos().y())\r\n self.rebuild(scene.gridRect())" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Index words char trie. @param documents the documents @param maxLevels the max levels @param minWeight the min weight @return the char trie
[ "public static CharTrie indexWords(Collection<String> documents, int maxLevels, int minWeight) {\n return create(documents, maxLevels, minWeight, true);\n }" ]
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Natural Language Processing:" }
Removes the lock for the ke_search index process
[ "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $io = new SymfonyStyle($input, $output);\n $io->title('Remove ke_search indexer lock');\n $indexerRunner = GeneralUtility::makeInstance(IndexerRunner::class);\n $indexerRunner->logger->log('notice', 'Rem...
[ "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:" }
the heart of the threading code
[ "def add_message message\n el = @messages[message.id]\n return if el.message # we've seen it before\n\n #puts \"adding: #{message.id}, refs #{message.refs.inspect}\"\n\n el.message = message\n oldroot = el.root\n\n ## link via references:\n (message.refs + [el.id]).inject(nil) do |prev, ref_id|...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Initializes the widget.
[ "public function init()\n {\n parent::init();\n $this->clientOptions = false;\n if ($this->fixed) {\n if (!isset($this->fixedContainerOptions['class'])) {\n Html::addCssClass($this->fixedContainerOptions, 'navbar-fixed');\n }\n echo Html::begin...
[ "@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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Wrap around FileInstance's send file.
[ "def send_file(self, restricted=True, trusted=False, **kwargs):\n \"\"\"\"\"\"\n return self.file.send_file(\n self.basename,\n restricted=restricted,\n mimetype=self.mimetype,\n trusted=trusted,\n **kwargs\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 text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
@param ModelTransformerInterface $modelTransformer @param int $priority @return $this|ModelTransformerInterface @throws \RuntimeException
[ "public function addModelTransformer($modelTransformer, $priority = 0)\n {\n if (!(($modelTransformer instanceof ModelTransformerInterface)\n || ($modelTransformer instanceof ContextualModelTransformerInterface)\n || ($modelTransformer instanceof ObjectTransformerInterface)\n ...
[ "public function applyFilters($filters, FilterFactory $filterFactory, ConditionAwareRepository $repository)\n {\n // @see Ipunkt\\LaravelJsonApi\\Services\\FilterApplier\\FilterApplier\n \\FilterApplier::applyFiltersToRepository($filters, $filterFactory, $repository);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Creates a new code chunk representing the concatenation of the given statements.
[ "public static Statement of(Statement first, Statement... rest) {\n return of(ImmutableList.<Statement>builder().add(first).add(rest).build());\n }" ]
[ "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 comment about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code:" }
Add a recipient. @param string $email The recipient email address. @param string|null $name The recipient name.
[ "public function add(string $email, string $name = null): void\n {\n $recipient = $this->make();\n $recipient->email = $email;\n if ($name !== null) {\n $recipient->name = $name;\n }\n $this->set($recipient);\n }" ]
[ "public function getParameters(array $additionnal_parameters = array())\n {\n $defaults = array(\n // ------------- USER TAG -------------\n /*\n * User name of the sender of the message.\n */\n 'USERNAME' => null,\n /*\n * Us...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Returns an informative upload error message. @param int $code @return string
[ "public function getErrorMessage($code = null)\n {\n $code = $code ?: $this->$code;\n\n static $errors = [\n UPLOAD_ERR_INI_SIZE => 'The file \"%s\" exceeds your upload_max_filesize ini directive (limit is %d kb).',\n UPLOAD_ERR_FORM_SIZE => 'The file \"%s\" exceeds the upload...
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Return all derived attributes from the DOB e.g 'Age Over', 'Age Under' As a list of AgeVerification @return array e.g [ 'age_under:18' => new AgeVerification(...), 'age_over:50' => new AgeVerification(...), ... ]
[ "public function getAgeVerifications()\n {\n return isset($this->profileData[self::ATTR_AGE_VERIFICATIONS])\n ? $this->profileData[self::ATTR_AGE_VERIFICATIONS] : [];\n }" ]
[ "def example_metadata(study_name, draft_name):\n \"\"\"\"\"\"\n odm = ODM(\"SYSTEM_NAME\", filetype=ODM.FILETYPE_SNAPSHOT)\n\n study = Study(study_name, project_type=Study.PROJECT)\n\n # Push study element into odm\n odm << study\n\n # Create global variables and set them into study.\n study <<...
codesearchnet
{ "query": "Represent the description about database:", "pos": "Represent the code about database:", "neg": "Represent the code:" }
Handle all substatements of `stmt`.
[ "def handle_substmts(self, stmt, p_elem, pset={}):\n \"\"\"\"\"\"\n for sub in stmt.substmts:\n self.handle_stmt(sub, p_elem, pset)" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets a single exchange which requires a vhost and name. :param string vhost: The vhost containing the target exchange :param string name: The name of the exchange :returns: dict
[ "def get_exchange(self, vhost, name):\n \n vhost = quote(vhost, '')\n name = quote(name, '')\n path = Client.urls['exchange_by_name'] % (vhost, name)\n exch = self._call(path, 'GET')\n return exch" ]
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the sentence about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code about AWS S3:" }
The grand coordinator of the plugin. Facilitates communication between all other plugin classes. @param {Object} player Instance of the video.js player. @param {Object} options Options provided by the implementation. @constructor @struct @final
[ "function(player, options) {\n /**\n * Stores user-provided settings.\n * @type {Object}\n */\n this.settings = {};\n\n /**\n * Content and ads ended listeners passed by the publisher to the plugin.\n * These will be called when the plugin detects that content *and all\n * ads* have completed. This d...
[ "function Virgilio(options) {\n if (!(this instanceof Virgilio)) {\n return new Virgilio(options);\n }\n EventEmitter.call(this);\n this.options$ = options = options || {};\n this.util$.validateArg('Virgilio', 'options', options, 'object');\n var logOptions = { level: 10, name: 'virgilio' }...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Read a struct begin. There's nothing on the wire for this, but it is our // opportunity to push a new struct begin marker onto the field stack.
[ "func (p *TCompactProtocol) ReadStructBegin() (name string, err error) {\n\tp.lastField = append(p.lastField, p.lastFieldId)\n\tp.lastFieldId = 0\n\treturn\n}" ]
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about File management:" }
Helper for :meth:`read`.
[ "def _make_txn_selector(self):\n \"\"\"\"\"\"\n if self._transaction_id is not None:\n return TransactionSelector(id=self._transaction_id)\n\n if self._read_timestamp:\n key = \"read_timestamp\"\n value = _datetime_to_pb_timestamp(self._read_timestamp)\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Implements the event listener of this class.<p> @see org.opencms.main.I_CmsEventListener#cmsEvent(org.opencms.main.CmsEvent)
[ "public void cmsEvent(CmsEvent event) {\n\n switch (event.getType()) {\n case I_CmsEventListener.EVENT_REBUILD_SEARCHINDEXES:\n List<String> indexNames = null;\n if ((event.getData() != null)\n && CmsStringUtil.isNotEmptyOrWhitespaceOnly(\n ...
[ "public static I_CmsGalleryServiceAsync createGalleryService() {\n\n I_CmsGalleryServiceAsync service;\n service = GWT.create(I_CmsGalleryService.class);\n String serviceUrl = CmsCoreProvider.get().link(\"org.opencms.ade.galleries.CmsGalleryService.gwt\");\n ((ServiceDefTarget)service).s...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eSet(int featureID, Object newValue)\n\t{\n\t\tswitch (featureID)\n\t\t{\n\t\t\tcase TypesPackage.JVM_FIELD__STATIC:\n\t\t\t\tsetStatic((Boolean)newValue);\n\t\t\t\treturn;\n\t\t\tcase TypesPackage.JVM_FIELD__FINAL:\n\t\t\t\tsetFinal((Boolean)newValue);\n\t\t\t\treturn;\n\t\t\tcase TypesPa...
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the Github comment about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
Decrement the value at the key index in session @param string $key @param number $dec @return number
[ "public static function dec($key, $dec = 1) {\n\t\treturn self::set ( $key, self::get ( $key, 0 ) - $dec );\n\t}" ]
[ "final public function create()\n {\n\n $self = $this;\n\n $splash = $self->getSplash();\n $sessId = $this->generateId($splash);\n\n session_id($sessId); //Must be called before the sesion start to generate the Id\n session_cache_limiter('none');\n\n session_name(md5($se...
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
remote logout url @return string something
[ "public function logoutUrl()\n\t{\n\t\t$open_basedir = ini_get('open_basedir');\n\t\t$safe_mode = ini_get('safe_mode');\n\n\t\t// check parameters and set defaults\n\t\tif (!isset($this->options['post_url'])) {\n\t\t\t$status['error'][] = 'Fatal programming error : no post_url!';\n\t\t} else {\n\t\t\t$this->ch = cu...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Initializes top-level Column TH elements into DD instances. @method _initDraggableColumns @private
[ "function() {\n this._destroyDraggableColumns();\n if(util.DD) {\n var oColumn, elTh, elDragTarget;\n for(var i=0, len=this._oColumnSet.tree[0].length; i<len; i++) {\n oColumn = this._oColumnSet.tree[0][i];\n elTh = oColumn.getThEl();\n Dom.addClass(elTh, DT.CLAS...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Filters out non-displayed elements. @param webElement element to check. @return webElement if it is displayed, null otherwise.
[ "@Override\n public T apply(T webElement) {\n if (firstFound == null) {\n firstFound = webElement;\n }\n return mayPass(webElement) ? webElement : null;\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// MarshalBinary interface implementation
[ "func (m *Endpoint) MarshalBinary() ([]byte, error) {\n\tif m == nil {\n\t\treturn nil, nil\n\t}\n\treturn swag.WriteJSON(m)\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// encryptDataWithNonce encrypts the given data with the given // symmetric key and nonce.
[ "func encryptDataWithNonce(\n\tdata []byte, key [32]byte, nonce [24]byte, ver EncryptionVer) (\n\tencryptedData, error) {\n\tsealedData := secretbox.Seal(nil, data, &nonce, &key)\n\n\treturn encryptedData{\n\t\tVersion: ver,\n\t\tNonce: nonce[:],\n\t\tEncryptedData: sealedData,\n\t}, nil\n}" ]
[ "def get_finished_record_bytes(cls, tls_version: TlsVersionEnum) -> bytes:\n \n # TODO(AD): The ROBOT poc script uses the same Finished record for all possible client hello (default, GCM,\n # etc.); as the Finished record contains a hashes of all previous records, it will be wrong and will caus...
codesearchnet
{ "query": "Represent the comment about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code:" }
/* Given model and verb, get method name and parameter list @param $modelName @param $crudVerb @return null|array @throws \Exception
[ "public function getMethodName($modelName, $crudVerb)\n {\n // enforce we're actually hooked up to a controller\n if (!$this instanceof BaseController) {\n throw new InvalidOperationException(get_class($this));\n }\n // enforce that mapping is actually not empty\n if...
[ "private function prepareGetStorageName()\n {\n $fragment = new CNabuPHPMethodBuilder(\n $this, 'getStorageName', CNabuPHPMethodBuilder::METHOD_PUBLIC, true\n );\n $fragment->addComment('Get the table name represented by this class');\n $fragment->addComment('@return string...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// separatorsScanner returns a split function for a scanner that returns tokens delimited any of the specified runes. // Note that the delimiters themselves are counted as tokens, so callers who want to discard the separators must do this // themselves.
[ "func separatorsScanner(separators []rune) func(data []byte, atEOF bool) (int, []byte, error) {\n\treturn func(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\t\tif atEOF && len(data) == 0 {\n\t\t\treturn 0, nil, nil\n\t\t}\n\n\t\t// Transform the separators into a map (for efficient lookup)\n\t...
[ "function parsePointer(pointer) {\n // Let's split pointer string by tokens' separator character.\n // Also we will reverse resulting array to simplify it's further usage.\n var tokens = pointer.split(tokenSeparator).reverse();\n // Last item in resulting array is always an empty string, we don't need it.\n to...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
calculates the relative basepath @param string $suffix if a suffix given, it will return basepath + filename, otherwise just the basepath @return string
[ "public function getBasepath($suffix = null)\n {\n $relativeDirectory = '.';\n\n $givenRelativePath = dirname($this->getCurrentPage());\n\n if ($givenRelativePath === '/') {\n $givenRelativePath = '';\n }\n\n $depth = substr_count($givenRelativePath, '/');\n\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns a dict that can be used in place of packaging.default_environment.
[ "def pkg_resources_env(self, platform_str):\n \"\"\"\"\"\"\n os_name = ''\n platform_machine = ''\n platform_release = ''\n platform_system = ''\n platform_version = ''\n sys_platform = ''\n\n if 'win' in platform_str:\n os_name = 'nt'\n platform_machine = 'AMD64' if '64' in platfo...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Routine to validate that typ is a valid non-empty PEP484 type hint. If it is a forward reference, it will be resolved :param typ: :param item_type: :param attr_name: :return:
[ "def get_validated_attribute_type_info(typ, item_type, attr_name):\n \n if (typ is None) or (typ is Parameter.empty):\n raise TypeInformationRequiredError.create_for_object_attributes(item_type, attr_name, typ)\n\n # resolve forward references\n typ = resolve_forward_ref(typ)\n\n if not is_val...
[ "def to_cls(self):\n \"\"\"\"\"\"\n # Checks if ``to_cls`` is a string\n # If it is, checks if the entity is imported and available\n # If it is, register the class\n try:\n if isinstance(self._to_cls, str):\n self._to_cls = fetch_entity_cls_from_regi...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetAttemptId sets the AttemptId field's value.
[ "func (s *TaskObject) SetAttemptId(v string) *TaskObject {\n\ts.AttemptId = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Create a new Solr schema for Yokozuna. :param schema: name of Solr schema :type schema: string :param content: actual defintion of schema (XML) :type content: string :rtype boolean
[ "def create_search_schema(self, schema, content):\n \n if not self.yz_wm_schema:\n raise NotImplementedError(\"Search 2.0 administration is not \"\n \"supported for this version\")\n\n url = self.search_schema_path(schema)\n headers = {'Con...
[ "def create_app():\n \n app = App.create_app(__name__)\n app.configure('.configs.settings')\n\n # yes, I should use blueprints; but I don't really care for such a small\n # toy app\n @app.route('/config')\n def get_config():\n \"\"\"Get the current configuration of the app.\"\"\"\n ...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
const so not hoisted, so can get regeneratorRuntime inlined above, needed for Node 4
[ "async function generateCriticalCssWrapped (\n options,\n { forceTryRestartBrowser } = {}\n) {\n const width = parseInt(options.width || DEFAULT_VIEWPORT_WIDTH, 10)\n const height = parseInt(options.height || DEFAULT_VIEWPORT_HEIGHT, 10)\n const timeoutWait = options.timeout || DEFAULT_TIMEOUT\n // Merge prop...
[ "function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Set a player in the ACL list @param name The Player @param deposit Can deposit or not @param withdraw Can withdraw or not @param acl Can modify the ACL or not @param show Can show the balance @param owner If he is the owner
[ "public void set(String name, boolean deposit, boolean withdraw, boolean acl, boolean show, boolean owner) {\n String newName = name.toLowerCase();\n aclList.put(name, Common.getInstance().getStorageHandler().getStorageEngine().saveACL(account, newName, deposit, withdraw, acl, show, owner));\n }" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns the HTML code for the requested resource object @param Request $request Symfony request object @param string $resource Resource location, e.g. "product" @param string $site Unique site code @return Response Generated output
[ "public function getAction( Request $request, $resource, $site = 'default' )\n\t{\n\t\t$cntl = $this->createAdmin( $request, $site, $resource );\n\n\t\tif( ( $html = $cntl->get() ) == '' ) {\n\t\t\treturn $cntl->getView()->response();\n\t\t}\n\n\t\treturn $this->getHtml( $html );\n\t}" ]
[ "public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerUniversalTagAttributes();\n $this->registerTagAttribute('name', 'string', 'Specifies the name of an anchor');\n $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between...
codesearchnet
{ "query": "Represent the Github comment about Symfony:", "pos": "Represent the Github code about Symfony:", "neg": "Represent the Github code about Computer Science:" }
Returns the header collection. The header collection contains incoming HTTP headers. @return HeaderCollection the header collection
[ "public function getHeaders()\n {\n if ($this->_headers === null) {\n $this->_headers = new HeaderCollection();\n foreach ($this->swooleRequest->server as $name => $value) {\n if (strncmp($name, 'HTTP_', 5) === 0) {\n $name = str_replace(' ', '-', uc...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// NetworkConfig returns information about all given relation/unit pairs, // including their id, key and the local endpoint. // It's not included in APIv5 // TODO(wpk): NetworkConfig API is obsoleted by Uniter.NetworkInfo
[ "func (u *UniterAPIV4) NetworkConfig(args params.UnitsNetworkConfig) (params.UnitNetworkConfigResults, error) {\n\tresult := params.UnitNetworkConfigResults{\n\t\tResults: make([]params.UnitNetworkConfigResult, len(args.Args)),\n\t}\n\n\tcanAccess, err := u.accessUnit()\n\tif err != nil {\n\t\treturn params.UnitNet...
[ "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 description about network configuration:", "pos": "Represent the Github code about network configuration:", "neg": "Represent the Github code:" }
Like QString::simpified(), except that it preserves non-breaking spaces (which Evernote uses for identation, etc.)
[ "function simplifyString(s) {\n\tlet output = '';\n\tlet previousWhite = false;\n\tfor (let i = 0; i < s.length; i++) {\n\t\tlet c = s[i];\n\t\tlet isWhite = isWhiteSpace(c);\n\t\tif (previousWhite && isWhite) {\n\t\t\t// skip\n\t\t} else {\n\t\t\toutput += c;\n\t\t}\n\t\tpreviousWhite = isWhite;\n\t}\n\n\twhile (o...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
/should be tested more ... visit https://www.debuggex.com/
[ "function checkForSuffix(mmn, mmns, resultobj, suffix){\n var reponame, namespace, secondunderscorepos, group, lastindex;\n lastindex = mmns.lastIndexOf(suffix.group);\n if(lastindex<1 || lastindex!==mmns.length-suffix.group.length){\n return resultobj;\n }\n reponame = mmn.substring(suffix.user...
[ "def loading_failed(self, rdf_format_opts, uri=\"\"):\n \"\"\"\"\"\"\n if uri:\n uri = \" <%s>\" % str(uri)\n printDebug(\n \"----------\\nFatal error parsing graph%s\\n(using RDF serializations: %s)\"\n % (uri, str(rdf_format_opts)), \"red\")\n printDebu...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// AddUint32 adds the hash value of the 8 bytes of u to h.
[ "func AddUint32(h, u uint32) uint32 {\n\th = (h ^ ((u >> 24) & 0xFF)) * prime32\n\th = (h ^ ((u >> 16) & 0xFF)) * prime32\n\th = (h ^ ((u >> 8) & 0xFF)) * prime32\n\th = (h ^ ((u >> 0) & 0xFF)) * prime32\n\treturn h\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Create a new post from scratch. Return filename This would not commit the file.
[ "def create_new_post(params) \n post_title = params['post']['title']\n post_date = (Time.now).strftime(\"%Y-%m-%d\")\n\n content = yaml_data(post_title).to_yaml + \"---\\n\" + params[:post][:content]\n post_file = (post_date + \" \" + post_title).to_url + '.md'\n file = File...
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
unregister @return $this
[ "public function unregister()\n {\n $this->files->unregister();\n $this->psr0->unregister();\n $this->psr4->unregister();\n\n return $this;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get the value specified by the args, in the file specified by th name
[ "def with_file(name, *args)\n logger.debug \"with_file(#{name.inspect}, #{args.inspect})\"\n result = args.inject(config_for(name)) { |v, i|\n logger.debug \"v = #{v.inspect}, i = #{i.inspect}\"\n case v\n when Hash\n v[i.to_s]\n when Array\n i.is_a?(I...
[ "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 Github comment about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
// execPath returns the executable path.
[ "func execPath() (string, error) {\n\tfile, err := exec.LookPath(os.Args[0])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn filepath.Abs(file)\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Gets all validation warnings of a given component. @param componentClass the component (e.g. {@code VEvent.class}) @return the validation warnings
[ "public List<WarningsGroup> getByComponent(Class<? extends ICalComponent> componentClass) {\n\t\tList<WarningsGroup> warnings = new ArrayList<WarningsGroup>();\n\t\tfor (WarningsGroup group : this.warnings) {\n\t\t\tICalComponent component = group.getComponent();\n\t\t\tif (component == null) {\n\t\t\t\tcontinue;\n...
[ "public ImportSection loadImportSection() throws IOException {\n Optional<ImportSection> idata = maybeLoadImportSection();\n return (ImportSection) getOrThrow(idata,\n \"unable to load import section\");\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:" }
{@inheritdoc} @throws BuildException @return boolean
[ "public function evaluate()\n {\n $this->validate();\n\n $free = disk_free_space($this->partition);\n return $free >= $this->parseHumanSizes($this->needed);\n }" ]
[ "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 Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Adds a component to the distinguished name. @param string $component @param string $value @throws \UnexpectedValueException When the given name does not exist.
[ "protected function addComponent($component, $value)\n {\n $this->validateComponentExists($component);\n\n // We need to make sure the value we're given isn't empty before adding it into our components.\n if (! empty($value)) {\n $this->components[$component][] = $value;\n ...
[ "public function isTrue(&$params)\n {\n $hostObj = $this->host;\n\n $attribute = $hostObj->subcondition;\n\n if (!$user = array_get($params, 'user')) {\n throw new ApplicationException('Error evaluating the user attribute condition: the user object is not found in the condition pa...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
/* (non-Javadoc) @see com.fs.commons.desktop.validation.Validator#validate(com.fs.commons.desktop. validation.Problems, java.lang.String, java.lang.Object)
[ "@Override\n\tpublic boolean validate(final Problems problems, final String compName, final String model) {\n\t\tfinal char[] c = model.toCharArray();\n\t\tboolean result = true;\n\t\tString curr;\n\t\tfor (final char element : c) {\n\t\t\tcurr = new String(new char[] { element });\n\t\t\ttry {\n\t\t\t\tfinal Strin...
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Deletes the given label from the monitor with the given id. @param monitorId The id of the monitor with the label @param label The label to delete @return This object
[ "public MonitorService deleteLabel(String monitorId, Label label)\n {\n HTTP.DELETE(String.format(\"/v1/monitors/%s/labels/%s\", monitorId, label.getKey()));\n return this;\n }" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the description about Work management:", "pos": "Represent the code about Work management:", "neg": "Represent the code about programming:" }
// Since this is a non-string scalar type, sets its current value obtained from parsing the specified string.
[ "func (me *PositiveInteger) Set(s string) {\r\n\tv, _ := strconv.ParseUint(s, 0, 64)\r\n\t*me = PositiveInteger(v)\r\n}" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Calculate the md5sum for a file. Parameters ---------- fname : str Filename. block_size : int Block size to use when reading. Returns ------- hash_ : str The hexadecimal digest of the hash.
[ "def md5sum(fname, block_size=1048576): # 2 ** 20\n \n md5 = hashlib.md5()\n with open(fname, 'rb') as fid:\n while True:\n data = fid.read(block_size)\n if not data:\n break\n md5.update(data)\n return md5.hexdigest()" ]
[ "def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
学習データセットに対象点を追加し、学習データセットの構造を更新する。<br> データ保持数が最大値に達していた場合は学習データセットが保持しているもっとも古い点の削除を行い、削除したデータのIdを返す。 @param max データ保持数最大値 @param addedPoint 対象点 @param dataSet 学習データセット @return 削除したデータのId。削除しなかった場合はnull
[ "public static String addPointToDataSet(int max, LofPoint addedPoint, LofDataSet dataSet)\n {\n // データ数が最大に達している場合には古い方からデータの削除を行う\n boolean dateDelete = false;\n if (max <= dataSet.getDataIdList().size())\n {\n dateDelete = true;\n }\n\n // 削除フラグがONの場合は古いデータか...
[ "public static double calculateLofWithUpdate(int kn, int max, LofPoint addedPoint,\n LofDataSet dataSet)\n {\n // データ数が最大に達している場合には古い方からデータの削除を行う\n String deleteId = addPointToDataSet(max, addedPoint, dataSet);\n\n // K距離、K距離近傍、局所到達可能密度の更新を行う対象点の一覧を取得する。\n Set<String> updat...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Добавляет воркер в балансировщик, когда тот успешно стартует. @param Worker $worker @return bool
[ "public function addWorker(Worker $worker): bool\n {\n if (!$this->running) {\n return false;\n }\n $this->running = 0;\n $this->workerPool->add($worker);\n\n return true;\n }" ]
[ "final function handle() {\n\t\ttry {\n\t\t\tif ($this->m()->s()->log()) {\n\t\t\t\t$this->log();\n\t\t\t}\n\t\t\t$this->_e->validate();\n\t\t\tif ($c = $this->strategyC()) { /** @var string|null $c */\n\t\t\t\tStrategy::handle($c, $this);\n\t\t\t}\n\t\t}\n\t\t/** 2017-09-15 @uses NotForUs is thrown from @see \\Df\...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns a NetworkServiceRecordAgent with which requests regarding NetworkServiceRecords can be sent to the NFVO. @return a NetworkServiceRecordAgent
[ "public synchronized NetworkServiceRecordAgent getNetworkServiceRecordAgent() {\n if (this.networkServiceRecordAgent == null) {\n if (isService) {\n this.networkServiceRecordAgent =\n new NetworkServiceRecordAgent(\n this.serviceName,\n this.projectId,\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Appends style(s) to the escape sequence @param int|array $styles @return null
[ "public function addStyle($styles)\n {\n foreach ((array) $styles as $style) {\n $this->escapeSequence .= Chalk::getEscapeSequence($style);\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
--- STOP INVOCATION STRATEGY ---
[ "@Override\r\n\tpublic void stopped() {\r\n\r\n\t\t// Stop pinger's timer\r\n\t\tif (pingTimer != null) {\r\n\t\t\tpingTimer.cancel(false);\r\n\t\t\tpingTimer = null;\r\n\t\t}\r\n\r\n\t\t// Cleanup\r\n\t\tresponseTimes.clear();\r\n\t}" ]
[ "public static MethodInterface[] getAllValues()\n {\n // This list must be created every time, to insure the caller does\n // not modify an internal list. Declaring a static final list does\n // not work, since it only protects the reference to the list, and\n // not the list entries....
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
////////////////////////////////////////////////////////////////////////////////////////
[ "public static <R> long readLong(ByteAccessStrategy<R> strategy, R resource, long offset, boolean useBigEndian) {\n return useBigEndian ? readLongB(strategy, resource, offset) : readLongL(strategy, resource, offset);\n }" ]
[ "private void readPacket(Results results) throws SQLException {\n Buffer buffer;\n try {\n buffer = reader.getPacket(true);\n } catch (IOException e) {\n throw handleIoException(e);\n }\n\n switch (buffer.getByteAt(0)) {\n\n //***********************************************************...
codesearchnet
{ "query": "Represent the Github description about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
Updates reporting config once we've parsed cmd-line flags.
[ "def update_reporting(self, global_options, is_quiet, run_tracker):\n \"\"\"\"\"\"\n\n # Get any output silently buffered in the old console reporter, and remove it.\n removed_reporter = run_tracker.report.remove_reporter('capturing')\n buffered_out = self._consume_stringio(removed_reporter.settings.out...
[ "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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Technology:" }
Return Context Manager for a file-like (stream) object to store volume info.
[ "def receiveVolumeInfo(self, paths):\n \n path = self.selectReceivePath(paths)\n path = path + Store.theInfoExtension\n\n if Store.skipDryRun(logger, self.dryrun)(\"receive info to %s\", path):\n return None\n\n self._client.receiveInfo(path)\n\n return _SSHStrea...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// getGroups loads and validates the bootstrapapi.BootstrapTokenExtraGroupsKey // key from the bootstrap token secret, returning a list of group names or an // error if any of the group names are invalid.
[ "func getGroups(secret *corev1.Secret) ([]string, error) {\n\t// always include the default group\n\tgroups := sets.NewString(bootstrapapi.BootstrapDefaultGroup)\n\n\t// grab any extra groups and if there are none, return just the default\n\textraGroupsString := getSecretString(secret, bootstrapapi.BootstrapTokenEx...
[ "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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Execute the prime directive. @return self
[ "public function start()\n {\n $cli = $this->climate();\n\n $cli->br();\n $cli->bold()->underline()->out('Cleanup unused attachments & relationships');\n $cli->br();\n\n # $this->pruneRelationships();\n $this->pruneAttachments();\n\n return $this;\n }" ]
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Transforms a UI object key into an activation aware key name. @param key the key. @param active <code>true</code> for <em>active</em> UI keys and <code>false</code> for inactive. @return the transformed key.
[ "public static String activationKey(String key, Boolean active) {\n\n Assert.notNull(key, \"key\");\n Assert.notNull(active, \"active\");\n\n final int index = key.lastIndexOf(VLDockingUtils.DOT);\n final String overlay = active ? VLDockingUtils.ACTIVE_INFIX : VLDockingUtils.INACTIVE_INF...
[ "def set_property(name, value, mark_non_default=true)\n \n #Set the node's property, as specified.\n node = get_property_node(name)\n node.attribute(\"value\").value = value\n\n #If the mark non-default option is set, mark the state is not a default value.\n node.attribute(\"valueState\").v...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
https://xhr.spec.whatwg.org/#constructors
[ "function XMLHttpRequest() {\n EventTarget.call(this, events);\n\n this.readyState;\n\n if (support.xhr.timeout) {\n this.timeout = 0;\n }\n\n if (support.xhr.cors) {\n this.withCredentials = false;\n }\n\n this.upload;\n this.responseType = '';\n this.responseText = '';\n this.responseXML = null;\n...
[ "async def text(self, *, encoding: Optional[str]=None) -> str:\n \"\"\"\"\"\"\n data = await self.read(decode=True)\n # see https://www.w3.org/TR/html5/forms.html#multipart/form-data-encoding-algorithm # NOQA\n # and https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttpreques...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EClass getEDT() {\n\t\tif (edtEClass == null) {\n\t\t\tedtEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(241);\n\t\t}\n\t\treturn edtEClass;\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the comment about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
// NetworkInspectWithRaw returns the information for a specific network configured in the docker host and its raw representation.
[ "func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error) {\n\tvar networkResource types.NetworkResource\n\tresp, err := cli.get(ctx, \"/networks/\"+networkID, nil, nil)\n\tif err != nil {\n\t\tif resp.statusCode == http.StatusNotFound {\n\t\t\treturn ne...
[ "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 text about network configuration:", "pos": "Represent the Github code about network configuration:", "neg": "Represent the Github code about programming:" }
Configure baseline directory
[ "def configure_visual_baseline(self):\n \"\"\"\"\"\"\n # Get baseline name\n baseline_name = self.config.get_optional('VisualTests', 'baseline_name', '{Driver_type}')\n for section in self.config.sections():\n for option in self.config.options(section):\n option...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
/* (non-Javadoc) @see java.io.InputStream#read(byte[], int, int)
[ "@Override\n public int read(byte[] buffer, int offset, int length) throws IOException {\n abortIfNeeded();\n int numBytesRead;\n // If no more bytes are available, do not read any bytes into the buffer\n if(this.virtualAvailable <= 0) {\n numBytesRead = -1;\n } else...
[ "public static void _idx(final byte[] array, int startIndex, byte[] input) {\n\t\ttry {\n\n\t\t\tSystem.arraycopy(input, 0, array, startIndex, input.length);\n\t\t} catch (Exception ex) {\n\t\t\tthrow new KriptonRuntimeException(String.format(\"array size %d, startIndex %d, input length %d\", array.length, startInd...
codesearchnet
{ "query": "Represent the Github summarization about Java programming:", "pos": "Represent the Github code about Java programming:", "neg": "Represent the Github code about programming:" }
Builds WHERE part of a query. @param AnDomainQuery $query Query object @param array $where Where conditions @return string
[ "protected function _buildWhere($query, $where)\n {\n $clause = '';\n\n if (isset($where['condition'])) {\n $clause .= ' '.$where['condition'];\n }\n\n //converts subclause to string only if there's at least one where statement in it\n if (isset($where['clause'])) {\...
[ "public final Map<String, Object> fetchRelation(Class<?> clazz, String query)\n {\n // TODO: need to return list.\n return search(clazz, query, Constants.INVALID, Constants.INVALID, true);\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// SetSimulationSoftwareSuite sets the SimulationSoftwareSuite field's value.
[ "func (s *DescribeSimulationApplicationOutput) SetSimulationSoftwareSuite(v *SimulationSoftwareSuite) *DescribeSimulationApplicationOutput {\n\ts.SimulationSoftwareSuite = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
/* BIFF2-4 single-sheet workbooks
[ "function write_biff_rec(ba, t, payload, length) {\n\tvar len = (length || (payload||[]).length);\n\tvar o = ba.next(4 + len);\n\to.write_shift(2, t);\n\to.write_shift(2, len);\n\tif(len > 0 && is_buf(payload)) ba.push(payload);\n}" ]
[ "def t_ATOM(self, t):\n '\n t.type = LDLfLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Regular expressions:" }
Returns the next move calculated by Gnuchess. @return [String] Returns the short algebraic chess notation of the move.
[ "def gnuchess_move\n pipe = IO.popen('gnuchess -x', 'r+')\n begin\n pipe.puts('depth 1')\n pipe.puts('manual')\n self.coord_moves.each do |m|\n pipe.puts(m)\n end\n pipe.puts('go')\n while line = pipe.gets\n raise IllegalMoveError if line.include...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Sets the input image. Must be called before other functions/ @param gray input image
[ "public void setImage(T gray) {\n\t\tintegral.reshape(gray.width,gray.height);\n\t\tintegralSq.reshape(gray.width,gray.height);\n\n\t\tGIntegralImageOps.transform(gray,integral);\n\t\tif( gray.getDataType().isInteger())\n\t\t\ttransformSq((GrayU8)gray,(GrayS64)integralSq);\n\t\telse\n\t\t\ttransformSq((GrayF32)gray...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get an USBTransfer instance for asynchronous use. iso_packets: the number of isochronous transfer descriptors to allocate.
[ "def getTransfer(self, iso_packets=0):\n \n result = USBTransfer(\n self.__handle, iso_packets,\n self.__inflight_add, self.__inflight_remove,\n )\n self.__transfer_set.add(result)\n return result" ]
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns a child of this node identified by its index. @param integer $index Index of child node @return MShop_Locale_Item_Site_Interface Selected node
[ "public function getChild( $index )\n\t{\n\t\tif( isset( $this->_children[$index] ) ) {\n\t\t\treturn $this->_children[$index];\n\t\t}\n\n\t\tthrow new MShop_Locale_Exception( sprintf( 'Child node with index \"%1$d\" not available', $index ) );\n\t}" ]
[ "public function toModel()\n {\n $nodeClass = $this->getElement()->NodeClass;\n if ($nodeClass === 'Node') {\n throw new LogicException('You must set a custom node in <node_class/> for element: ' . $this->getElement()->getSlug());\n } else {\n throw new LogicException('...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EEnum getIfcTransportElementTypeEnum() {\r\n\t\tif (ifcTransportElementTypeEnumEEnum == null) {\r\n\t\t\tifcTransportElementTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(920);\r\n\t\t}\r\n\t\treturn ifcTransportElementTypeEnumEEn...
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the summarization about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
/* (non-Javadoc) @see net.crowmagnumb.util.ResourceReader#getString(java.lang.String, java.lang.String)
[ "@Override\n public String getString( final String key,\n final String defaultValue )\n {\n String candidate;\n candidate = getFormattedPropValue( key );\n\n if ( candidate == null )\n {\n return defaultValue;\n }\n\n ...
[ "private void genImportCode(ClassCode code) {\n code.importClass(\"java.util.*\");\n code.importClass(\"java.io.IOException\");\n code.importClass(\"java.lang.reflect.*\");\n code.importClass(\"com.baidu.bjf.remoting.protobuf.code.*\");\n code.importClass(\"com.baidu.bjf.remoting....
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
sets actual DOM canvas element
[ "function checkScrollBoxVisibility() {\n self.scrollBox.horizontalBarVisible = (self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden')\n || self.style.overflowX === 'scroll';\n self.scrollBox.horizontalBoxVisible = dataW...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NewVersionedToolsConstraint returns a ToolsConstraint for a tools with a specific version.
[ "func NewVersionedToolsConstraint(vers version.Number, params simplestreams.LookupParams) *ToolsConstraint {\n\treturn &ToolsConstraint{LookupParams: params, Version: vers}\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SetSmsAuthenticationMessage sets the SmsAuthenticationMessage field's value.
[ "func (s *UpdateUserPoolInput) SetSmsAuthenticationMessage(v string) *UpdateUserPoolInput {\n\ts.SmsAuthenticationMessage = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// EqualClass returns true if err is *Error with the same class.
[ "func (ec ErrClass) EqualClass(err error) bool {\n\te := errors.Cause(err)\n\tif e == nil {\n\t\treturn false\n\t}\n\tif te, ok := e.(*Error); ok {\n\t\treturn te.class == ec\n\t}\n\treturn false\n}" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
converts YYYY-MM-DDT00:00:00Z to DD-MM-YYYY
[ "def solr_to_date(d):\n \n return \"{day}:{m}:{y}\".format(y=d[:4], m=d[5:7], day=d[8:10]) if d else d" ]
[ "def validate_format_iso8601(validator, fieldname, value, format_option):\n \n try:\n iso8601.parse_date(value)\n except ValueError:\n raise ValidationError(\n \"Value %(value)r of field '%(fieldname)s' is not in \"\n \"'iso8601 YYYY-MM-DDThh:mm:ss(+/-)hh:mm' format\" % ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
To compute this allowance, the 'rent' value must be provided for the same month, but 'housing_occupancy_status' is not necessary.
[ "def formula_1980(household, period, parameters):\n '''\n \n '''\n return household('rent', period) * parameters(period).benefits.housing_allowance" ]
[ "protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Data synchronization:" }
Gets full class name @param string $name @param string $declaringClass @return string|null
[ "public function resolve($name, $declaringClass)\n {\n if (strpos($name, '\\\\') !== false) {\n return $name;\n }\n $imports = $this->cache->get('_PHX.imports.'.$declaringClass);\n if (!isset($imports)) {\n $imports = ClassHelper::getImports($declaringClass);\n ...
[ "private function prepareGetStorageName()\n {\n $fragment = new CNabuPHPMethodBuilder(\n $this, 'getStorageName', CNabuPHPMethodBuilder::METHOD_PUBLIC, true\n );\n $fragment->addComment('Get the table name represented by this class');\n $fragment->addComment('@return string...
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Utility that can be passed to Google Guava to find a particular result. E.g. <pre> Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, path)) </pre> @param type operation type @param forPath path @return predicate
[ "public static Predicate<CuratorTransactionResult> ofTypeAndPath(final OperationType type, final String forPath)\n {\n return new Predicate<CuratorTransactionResult>()\n {\n @Override\n public boolean apply(CuratorTransactionResult result)\n {\n ...
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Documentation:" }
// SetFontScript sets the FontScript field's value.
[ "func (s *DvbSubDestinationSettings) SetFontScript(v string) *DvbSubDestinationSettings {\n\ts.FontScript = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
initial the plugins by plugin's config @param {Object} plugins plugin's config @return {Promise}
[ "function(plugins, pluginBase){\n var _this = this;\n \n if (typeof pluginBase === 'string') {\n _pluginBase = pluginBase;\n }\n plugins.forEach(function(plugin, index){\n var name;\n var path;\n if (typeof plugin === 'string'){\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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Verifies a sequence of codepoints using the specified filter @param aIter Codepoint iterator @param aFilter Filter to use
[ "public static void verifyNot (final ICodepointIterator aIter, final IntPredicate aFilter)\n {\n final CodepointIteratorRestricted rci = aIter.restrict (aFilter, false, true);\n while (rci.hasNext ())\n rci.next ();\n }" ]
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
通过传入zealot xml文件对应的命名空间、zealot节点的ID以及参数对象(一般是JavaBean或者Map)的结合体,来简单快速的生成和获取sqlInfo信息(有参的SQL). @param nsAtZealotId xml命名空间nameSpace+@@+zealotId的值.如:"student@@queryStudentById" @param paramObj 参数对象(一般是JavaBean对象或者Map) @return 返回SqlInfo对象
[ "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...
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Destroy an app and all its add-ons
[ "def destroy(self):\n \"\"\"\"\"\"\n result = self._result(\n [\"heroku\", \"apps:destroy\", \"--app\", self.name, \"--confirm\", self.name]\n )\n return result" ]
[ "def limitations():\n \n limitation_list = list()\n limitation_list.append(tr('InaSAFE is not a hazard modelling tool.'))\n limitation_list.append(\n tr('InaSAFE is a Free and Open Source Software (FOSS) project, '\n 'published under the GPL V3 license. As such you may freely '\n ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Prepares the CmsObject for jumping to this favorite location, and returns the appropriate URL. @param cms the CmsObject to initialize for jumping to the favorite @return the link for the favorite location @throws CmsException if something goes wrong
[ "public String updateContextAndGetFavoriteUrl(CmsObject cms) throws CmsException {\n\n CmsResourceFilter filter = CmsResourceFilter.IGNORE_EXPIRATION;\n CmsProject project = null;\n switch (getType()) {\n case explorerFolder:\n CmsResource folder = cms.readResource(get...
[ "@Override\n public void onError(Session session, Throwable thr) {\n if (onError != null) {\n Object args[] = new Object[onError.getMethod().getParameterTypes().length];\n MethodData methodData = onError.getMethodData();\n //check if method has optional Session parameter\n...
codesearchnet
{ "query": "Represent the summarization about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }