query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
For XSS prevention, escape unsafe characters in String by default,
unless it's specifically wrapped in {@link RawHtmlArgument}. | [
"public static Object htmlSafeArgument(Object o) {\n if (o instanceof RawHtmlArgument)\n return ((RawHtmlArgument)o).getValue();\n if (o instanceof Number || o instanceof Calendar || o instanceof Date)\n // formatting numbers and date often requires that they be kept intact\n ... | [
"public static String filterCssValue(SoyValue value) {\n value = normalizeNull(value);\n if (isSanitizedContentOfKind(value, SanitizedContent.ContentKind.CSS)) {\n // We don't need to do this when the CSS is embedded in a\n // style attribute since then the HTML escaper kicks in.\n // TODO(msam... | codesearchnet | {
"query": "Represent the description about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about Natural Language Processing:"
} |
Return whether or not `user` can view information about the user. | [
"def can_view(self, user):\n \"\"\"\"\"\"\n return user.is_admin or self == user \\\n or set(self.classes).intersection(user.admin_for)"
] | [
"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 Access control:",
"pos": "Represent the Github code about Access control:",
"neg": "Represent the Github code about Software development:"
} |
Get OTP from YubiKey. | [
"def get_otp(hsm, args):\n \n if args.no_otp:\n return None\n if hsm.version.have_unlock():\n if args.stdin:\n otp = sys.stdin.readline()\n while otp and otp[-1] == '\\n':\n otp = otp[:-1]\n else:\n otp = raw_input('Enter admin YubiKey OT... | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Context manager that ensures that a hook is not re-triggered by one of its handlers. | [
"def _triggering_ctx(self):\n \n if self._is_triggering:\n raise RuntimeError('{} cannot be triggered while it is being handled'.format(self))\n self._is_triggering = True\n try:\n yield self\n finally:\n self._is_triggering = False"
] | [
"def cancel(self, *args, **kwargs):\n \"\"\"\"\"\"\n # Because remove all futures will trigger `set_result`,\n # we cancel itself first.\n super().cancel()\n for future in self.traverse():\n # All cancelled futures should have callbacks to removed itself\n # ... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns a resource by name.
@param string $name
@return object|null | [
"public function getResource($name = null)\n {\n if (null === $name) {\n $name = $this->config->getResourceName();\n }\n if (isset($this->resources[$name])) {\n return $this->resources[$name];\n }\n return null;\n }"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Update the partition infos on the assigned resource.
@param partitionInfos for the remote task | [
"private void sendUpdatePartitionInfoRpcCall(\n\t\t\tfinal Iterable<PartitionInfo> partitionInfos) {\n\n\t\tfinal LogicalSlot slot = assignedResource;\n\n\t\tif (slot != null) {\n\t\t\tfinal TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway();\n\t\t\tfinal TaskManagerLocation taskManagerLocation = ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Template variable getter. Returns additional params for url
@return string | [
"public function getAdditionalParams()\n {\n $sAddParams = \\OxidEsales\\Eshop\\Application\\Controller\\FrontendController::getAdditionalParams();\n\n if ($oRecomm = $this->getActiveRecommList()) {\n $sAddParams .= \"&recommid=\" . $oRecomm->getId();\n }\n\n if ($sSear... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github summarization about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
Create status icon or link.
@param int $status
@param array $url
@param string $icon
@return null|string | [
"public function status($status = 0, array $url = [], $icon = 'circle')\n {\n $class = (int) $status === 1 ? 'ck-green' : 'ck-red';\n if (count($url) === 0) {\n return $this->icon($icon, ['class' => $class]);\n }\n\n return $this->link(null, 'javascript:void(0);', [\n ... | [
"public static function objectType($fieldId)\n {\n //====================================================================//\n // decode\n $result = self::isIdField($fieldId);\n if (empty($result)) {\n return false;\n }\n //=====================================... | codesearchnet | {
"query": "Represent the Github text about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about Programming:"
} |
// CopyStringMapSlices makes a deep copy of the passed in map[string][]string
// and returns the copy. | [
"func CopyStringMapSlices(a map[string][]string) map[string][]string {\n\tif a == nil {\n\t\treturn nil\n\t}\n\n\tout := make(map[string][]string)\n\tfor key, values := range a {\n\t\tvout := make([]string, len(values))\n\t\tcopy(vout, values)\n\t\tout[key] = vout\n\t}\n\n\treturn out\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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Finish batch.
This function is a static function to avoid serializing the ConfigSync
object unnecessarily. | [
"public static function finishBatch($success, $results, $operations) {\n if ($success) {\n if (!empty($results['errors'])) {\n foreach ($results['errors'] as $error) {\n drupal_set_message($error, 'error');\n \\Drupal::logger('config_sync')->error($error);\n }\n drupal... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Template formatter for "" (default) format. | [
"func textFmt(w io.Writer, format string, x ...interface{}) string {\n\twriteAny(w, false, x[0])\n\treturn \"\"\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:"
} |
Opens the session for writing.
@return Promise Resolved with the session. | [
"public function open(): Promise\n {\n return $this->pending = call(function () {\n if ($this->pending) {\n yield $this->pending;\n }\n\n if ($this->id === null) {\n $this->id = yield $this->storage->create();\n } else {\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Look in the directory for files that match the prefix. If there are none,
leave with currentFile still null. If we find one, advance into it. | [
"protected JournalInputFile openNextFile() throws JournalException {\n File[] journalFiles =\n MultiFileJournalHelper\n .getSortedArrayOfJournalFiles(journalDirectory,\n filenamePrefix);\n\n if (journalFiles.len... | [
"function skip1(previousExpr) {\n \n \n if( previousExpr == always ) {\n /* If there is no previous expression this consume command \n is at the start of the jsonPath.\n Since JSONPath specifies what we'd like to find but not \n necessarily everything leading down t... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Render a Text MessageElement as plain text.
:returns: The plain text representation of the Text MessageElement.
:rtype: basestring | [
"def to_text(self):\n \n if self.items is None:\n return\n else:\n text = ''\n for item in self.items:\n text += ' - %s\\n' % item.to_text()\n\n return text"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Read a file and returns text content
@param string $file File path to read
@return string File content
@throws \Exception | [
"public function read(string $file): string\n {\n $destFile = tempnam(sys_get_temp_dir(), 'pdf_to_text_');\n\n $command = sprintf(\n 'pdftotext -layout %s %s',\n escapeshellarg(realpath($file)),\n escapeshellarg($destFile)\n );\n\n $return = 0;\n ... | [
"public function setSource(string $source)\n {\n if (!file_exists($source)) {\n throw new Server500(new \\ArrayObject(array(\"explain\" =>\n \"The source $source for the ZIP archive does not exist.\",\n \"Please check the source validity.\")));\n }\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:"
} |
/* (non-Javadoc)
@see net.timewalker.ffmq4.common.connection.AbstractConnection#deleteTemporaryQueue(java.lang.String) | [
"@Override\n\tpublic final void deleteTemporaryQueue(String queueName) throws JMSException\n {\n DeleteTemporaryQueueQuery query = new DeleteTemporaryQueueQuery();\n query.setQueueName(queueName);\n transportEndpoint.blockingRequest(query);\n }"
] | [
"public static void init() throws JMFSchemaIdException {\n // Register the MFP diagnostic module\n MfpDiagnostics.initialize();\n\n\n try {\n JMFRegistry.instance.register(JsHdrAccess.schema);\n JMFRegistry.instance.register(JsHdr2Access.schema);\n JMFRegistry.instance.register(JsApiAccess.s... | codesearchnet | {
"query": "Represent the summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Note from Thaniga on 11/5. DME2Client is not expected to be reused... need a fresh one
on each transaction, which is expected to cover the Async aspects.
@return
@throws APIException
@throws DME2Exception | [
"protected EClient<DME2Client> client() throws CadiException {\n\t\ttry {\n\t\t\tDEClient dc = new DEClient(manager,getSecuritySetter(),uri,readTimeout);\n\t\t\tdc.setProxy(isProxy);\n\t\t\treturn dc;\n\t\t} catch (DME2Exception e) {\n\t\t\tthrow new CadiException(e);\n\t\t}\n\t}"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Output an empty-cell comment. | [
"private void outputEmptyCellComment(CellAddress cellRef) {\n XSSFComment comment = commentsTable.findCellComment(cellRef);\n output.cell(cellRef.formatAsString(), null, comment);\n }"
] | [
"def check_arrange_act_spacing(self) -> typing.Generator[AAAError, None, None]:\n \n yield from self.check_block_spacing(\n LineType.arrange,\n LineType.act,\n 'AAA03 expected 1 blank line before Act block, found {}',\n )"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns an {@link java.time.OffsetDateTime} of this offset and the provided {@link java.time.LocalTime}.
@param self a ZoneOffset
@param time a LocalTime
@return an OffsetTime
@since 2.5.0 | [
"public static OffsetTime leftShift(final ZoneOffset self, LocalTime time) {\n return OffsetTime.of(time, self);\n }"
] | [
"<R> R getValue(TemporalQuery<R> query) {\n R result = temporal.query(query);\n if (result == null && optional == 0) {\n throw new DateTimeException(\"Unable to extract value: \" + temporal.getClass());\n }\n return result;\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
If a collection for this resource has already begun (i.e. multiple
resources share this type of resource), then merge with the existing collection
@param mixed $collection
@param object $object
@return void | [
"private function mergeRootCollection(&$collection, $object)\n {\n if (is_array($object)) {\n foreach ($object as $resource) {\n $this->addResourceToRootCollectionIfNonExistant($collection, $resource);\n }\n } elseif ($object instanceof Collection) {\n ... | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Indica si un valor es del tipo correcto
@param mixed $value
@return bool | [
"private function isValidType($value): bool\n {\n if ($this->type instanceof DataType) {\n return $this->type->isTheTypeOf($value);\n }\n\n return true;\n }"
] | [
"private function init(){\n //Load Archivos de Funciones\n $this->loadFunctionsFiles();\n //Instancio el sistema de Cache\n $this->cache= new Support\\Cache\\Cache();\n //EnolaContext->init(): Cargo las configuraciones de contexto faltante\n $this->context->init();\n ... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// See cairo_get_font_options().
//
// C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-get-font-options | [
"func (cr *Context) GetFontOptions(options *FontOptions) {\n\tC.cairo_get_font_options(cr.Ptr, options.Ptr)\n\tif err := cr.status(); err != nil {\n\t\tpanic(err)\n\t}\n}"
] | [
"def get_target(self):\n \n return Surface._from_pointer(\n cairo.cairo_get_target(self._pointer), incref=True)"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetStatusDetails sets the StatusDetails field's value. | [
"func (s *GetMaintenanceWindowExecutionTaskInvocationOutput) SetStatusDetails(v string) *GetMaintenanceWindowExecutionTaskInvocationOutput {\n\ts.StatusDetails = &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:"
} |
/* LicencedError | [
"function LicencedError(mangaSite, mangaName) {\n var instance = new Error(mangaSite + \" has '\" + mangaName + \"' licenced.\");\n instance.mangaSite = mangaSite;\n instance.mangaName = mangaName;\n Object.setPrototypeOf(instance, Object.getPrototypeOf(this));\n if (Error.captureStackTrace) {\n ... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github summarization about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about programming:"
} |
`login` - Login or username of user to add to `role`
`role` - Role to add user to
Add user to role | [
"def role_add(self, role=None, login=None, envs=[], query='/roles/'):\n \n data = {'login': self.args.login}\n juicer.utils.Log.log_debug(\n \"Add Role '%s' to '%s'\", role, login)\n\n for env in self.args.envs:\n if not juicer.utils.role_exists_p(role, self.con... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Set up an observer and tear it down after the first report | [
"function observeOnce(object, observer, types) {\n function _observer(changes) {\n observer(changes);\n unobserve(object, _observer);\n }\n observe(object, _observer, types);\n}"
] | [
"func (rl *resignLeadership) Execute(state State) (*State, error) {\n\t// TODO(fwereade): this hits a lot of interestingly intersecting problems.\n\t//\n\t// 1) we can't yet create a sufficiently dumbed-down hook context for a\n\t// leader-deposed hook to run as specced. (This is the proximate issue,\n\t// an... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// MonthAbbreviated returns the locales abbreviated month given the 'month' provided | [
"func (sr *sr_Latn_BA) MonthAbbreviated(month time.Month) string {\n\treturn sr.monthsAbbreviated[month]\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about datetime:"
} |
Register a given model in the registry | [
"def register(cls):\n \n registry_entry = RegistryEntry(category = cls.category, namespace = cls.namespace, name = cls.name, cls=cls)\n if registry_entry not in registry and not exists_in_registry(cls.category, cls.namespace, cls.name):\n registry.append(registry_entry)\n else:\n log.warn(... | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the Github description about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(EndpointConfigSummary endpointConfigSummary, ProtocolMarshaller protocolMarshaller) {\n\n if (endpointConfigSummary == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(en... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Handles a userinfo request.
:param request: urlencoded request (either query string or POST body)
:param http_headers: http headers | [
"def handle_userinfo_request(self, request=None, http_headers=None):\n # type: (Optional[str], Optional[Mapping[str, str]]) -> oic.oic.message.OpenIDSchema\n \n if http_headers is None:\n http_headers = {}\n userinfo_request = dict(parse_qsl(request))\n bearer_token = e... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Generate Alter Table Charset.
@param string $table
@param string $charset
@return string | [
"protected function getAlterTableCharset($table, $charset)\n {\n $table = $this->dba->ident($table);\n $charset = $this->dba->quote($charset);\n\n return sprintf(\"%s\\$this->execute(\\\"ALTER TABLE %s CHARSET=%s;\\\");\", $this->ind2, $table, $charset);\n }"
] | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Execute and optionally log the given CQL statement. | [
"private ResultSet executeCQL(String cql) {\n m_logger.debug(\"Executing CQL: {}\", cql);\n try {\n return m_dbservice.getSession().execute(cql);\n } catch (Exception e) {\n m_logger.error(\"CQL query failed\", e);\n m_logger.info(\" Query={}\", cql);\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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Set acquires the write lock and sets all the fields in ActiveDevice.
// The acct parameter is not used for anything except to help ensure
// that this is called from inside a LoginState account request. | [
"func (a *ActiveDevice) Set(m MetaContext, uv keybase1.UserVersion, deviceID keybase1.DeviceID,\n\tsigKey, encKey GenericKey, deviceName string, deviceCtime keybase1.Time) error {\n\ta.Lock()\n\tdefer a.Unlock()\n\n\tif err := a.internalUpdateUserVersionDeviceID(uv, deviceID); err != nil {\n\t\treturn err\n\t}\n\n\... | [
"public void clearHandleList() {\n\n final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();\n\n if (isTracingEnabled && tc.isDebugEnabled()) {\n Tr.debug(this, tc, \"Clear the McWrapper handlelist for the following MCWrapper: \" + this);\n }\n\n // since we kn... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// ReceiveMessage blocks until a message is received from the connection. It
// returns an io.Reader with the contents of the message. | [
"func (s *ServerStream) ReceiveMessage(ctx context.Context) (*StreamMessage, error) {\n\treturn s.stream.ReceiveMessage(ctx)\n}"
] | [
"void offerData(byte[] chunk) {\n if (chunk == null || chunk.length == 0) {\n throw new IllegalArgumentException(\"chunk must have at least one byte of data\");\n }\n\n if (closed) {\n return;\n }\n\n // Since this is an unbounded queue, offer() always succeeds. In addition, we don't make a... | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
过滤
@param $array
@return mixed | [
"public function filter(&$array) {\n while(list($key, $var) = each($array)) {\n if ($key != 'argc' && $key != 'argv' && (strtoupper($key) != $key || '' . intval($key) == \"$key\")) {\n if (is_string($var)) {\n $array[$key] = stripslashes($var);\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 instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Software Development:"
} |
if finished, then move this batchTask to his channel and then will be processed as regular task | [
"void processBatchWaitTasks() {\n\t\tChannel channel = context.registry.getChannelOrSystem(Model.CHANNEL_BATCH); // channel TedBW or TedSS\n\t\tint maxTask = context.taskManager.calcChannelBufferFree(channel);\n\t\tMap<String, Integer> channelSizes = new HashMap<String, Integer>();\n\t\tchannelSizes.put(Model.CHANN... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Creates a job.
@param CreateJobParameters $parameters
@return array
@throws SmartlingApiException | [
"public function createJob(CreateJobParameters $parameters)\n {\n $requestData = $this->getDefaultRequestData('json', $parameters->exportToArray());\n return $this->sendRequest('jobs', $requestData, self::HTTP_METHOD_POST);\n }"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get a primed and readytogo flow coordinator. | [
"def get_flow(self, name, options=None):\n \n config = self.project_config.get_flow(name)\n callbacks = self.callback_class()\n coordinator = FlowCoordinator(\n self.project_config,\n config,\n name=name,\n options=options,\n skip=No... | [
"function(hljs) {\n return {\n lexemes: /[!#@\\w]+/,\n keywords: {\n keyword: //ex command\n // express version except: ! & * < = > !! # @ @@\n 'N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea brea... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Controller for the calendar month component.
@ngInject @constructor | [
"function CalendarMonthCtrl($element, $scope, $animate, $q,\n $$mdDateUtil, $mdDateLocale) {\n\n /** @final {!angular.JQLite} */\n this.$element = $element;\n\n /** @final {!angular.Scope} */\n this.$scope = $scope;\n\n /** @final {!angular.$animate} */\n this.$animate = $animate;\n\n /** @f... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// OnCSVCMsg_UpdateStringTable registers a callback for SVC_Messages_svc_UpdateStringTable | [
"func (c *Callbacks) OnCSVCMsg_UpdateStringTable(fn func(*dota.CSVCMsg_UpdateStringTable) error) {\n\tc.onCSVCMsg_UpdateStringTable = append(c.onCSVCMsg_UpdateStringTable, fn)\n}"
] | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Change an existing cron job's query
Args:
iden (bytes): The iden of the cron job to be changed | [
"async def updateCronJob(self, iden, query):\n '''\n \n '''\n cron = self.cell.agenda.appts.get(iden)\n if cron is None:\n raise s_exc.NoSuchIden()\n self._trig_auth_check(cron.useriden)\n await self.cell.agenda.mod(iden, query)"
] | [
"function Request(conn, cmd, args) {\n\n // current connection\n this.conn = conn;\n\n // command name\n this.cmd = cmd;\n\n // command arguments may be modified\n // during validation\n this.args = args;\n\n // raw command arguments, injected by the server\n this.raw = null;\n\n // server will inject thi... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Prepare a scenario
@param BeforeScenarioScope $scope
@throws RuntimeException
@BeforeScenario | [
"public function prepareScenario(BeforeScenarioScope $scope) {\n $dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'behat-api-extension' . DIRECTORY_SEPARATOR . microtime(true);\n mkdir($dir . '/features/bootstrap', 0777, true);\n\n // Locate the php binary\n if (($bin = (new PhpExecutab... | [
"@Conditioned\n @Et(\"Je prends une capture d'écran[\\\\.|\\\\?]\")\n @And(\"I take a screenshot[\\\\.|\\\\?]\")\n public void takeScreenshot(List<GherkinStepCondition> conditions) {\n logger.debug(\"I take a screenshot for [{}] scenario.\", Context.getCurrentScenario());\n screenService.take... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Documentation:"
} |
Binds to template and controllers. | [
"@Override\r\n\tpublic void initUpstream()\r\n\t{\r\n\t\tNucleicAcid nuc = tempReac.getTemplate();\r\n\t\tif (nuc != null)\r\n\t\taddToUpstream(nuc, getGraph());\r\n\r\n\t\tfor (Control cont : tempReac.getControlledOf())\r\n\t\t{\r\n\t\t\taddToUpstream(cont, graph);\r\n\t\t}\r\n\t}"
] | [
"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:"
} |
Register any package services.
@return null | [
"public function register()\n\t {\n\t\t$this->mergeConfigFrom(\n\t\t __DIR__ . '/config/pagekit.php', 'pagekit'\n\t\t );\n\t\t$this->app->bind(\n\t\t 'Breadcrumbs', function () {\n\t\t\treturn new Breadcrumbs();\n\t\t}\n\t\t);\n\n\t\t$this->app->bind(\n\t\t ... | [
"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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
@param Tree $tree
@return ResponseInterface | [
"public function synchronize(Tree $tree): ResponseInterface\n {\n $url = route('admin-trees', ['ged' => $tree->name()]);\n\n $gedcom_files = $this->gedcomFiles(WT_DATA_DIR);\n\n foreach ($gedcom_files as $gedcom_file) {\n // Only import files that have changed\n $filemt... | [
"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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Parses an Amcache Root/File key for events.
Args:
am_entry (pyregf.key): amcache File key.
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs. | [
"def _ProcessAMCacheFileKey(self, am_entry, parser_mediator):\n \"\n amcache_datetime = am_entry.get_value_by_name(\n self._AMCACHE_DATETIME).get_data_as_integer()\n event_data = AmcacheEventData()\n\n event_data.full_path = am_entry.get_value_by_name(\n self._AMCACHE_FULL_PATH).get_data_a... | [
"def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Adds a new segment
@param string|\csslib\Segment $segment Segment to be addded
@param \csslib\Segment $other If given the segment to be added wil be inserted before the other segment
@return \csslib\Segment The added segment | [
"public function addSegment($segment, $other = null){\n\t\tif(!$segment instanceof Segment){\n\t\t\t$segment = new Segment($segment);\n\t\t}\n\t\tif($this->getIndexOf($segment->getName())) throw new \\Exception('Section with this name already exists');\n\t\tif($other){\n\t\t\tif(($index = $this->getIndexOf($other))... | [
"public function initializeArguments()\n {\n $this->registerTagAttribute('enctype', 'string', 'MIME type with which the form is submitted');\n $this->registerTagAttribute('method', 'string', 'Transfer type (GET or POST or dialog)');\n $this->registerTagAttribute('name', 'string', 'Name of fo... | codesearchnet | {
"query": "Represent the comment about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code about programming:"
} |
Return $data encoded as JSON.
@param mixed $response The response
@param bool $prettyPrint If true the JSON will be pretty printed
@return string JSON encoded $response | [
"public static function retJSON($response = null, $prettyPrint = false)\n {\n $options = $prettyPrint ? JSON_PRETTY_PRINT : 0;\n\n return json_encode($response, $options);\n }"
] | [
"public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
turns a multiplication into an And gate if one of the
wires is a bitwidth of 1
:param A:
:param B:
:return: | [
"def _trivial_mult(A, B):\n \n if len(B) == 1:\n A, B = B, A # so that we can reuse the code below :)\n if len(A) == 1:\n a_vals = A.sign_extended(len(B))\n\n # keep the wirevector len consistent\n return pyrtl.concat_list([a_vals & B, pyrtl.Const(0)])"
] | [
"def signed_mult(a, b):\n \n a, b = as_wires(a), as_wires(b)\n final_len = len(a) + len(b)\n # sign extend both inputs to the final target length\n a, b = a.sign_extended(final_len), b.sign_extended(final_len)\n # the result is the multiplication of both, but truncated\n # TODO: this may make e... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// eiToStat converts from a libkbfs.EntryInfo and error to a *dokan.Stat and error.
// Note that handling symlinks to directories requires extra processing not done here. | [
"func eiToStat(ei data.EntryInfo, err error) (*dokan.Stat, error) {\n\tif err != nil {\n\t\treturn nil, errToDokan(err)\n\t}\n\tst := &dokan.Stat{}\n\tfillStat(st, &ei)\n\treturn st, nil\n}"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Turns a JSON structure into a python object. | [
"def parse(binary, **params):\n \"\"\"\"\"\"\n encoding = params.get('charset', 'UTF-8')\n return json.loads(binary, encoding=encoding)"
] | [
"@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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Executes the task. Compiles the given files.
@param task
cc task
@param sources
source files (includes headers)
@param targets
compilation targets
@param linkTarget
link target | [
"public void execute(final CCTask task, final List<File> sources, final Map<String, TargetInfo> targets,\n final TargetInfo linkTarget) {\n try {\n this.projectWriter.writeProject(this.outFile, task, this, sources, targets, linkTarget);\n } catch (final BuildException ex) {\n if (this.failOnErr... | [
"def setup_compile_rcc_parser(self, parser):\n \n parser.set_defaults(func=self.compile_rcc)\n parser.add_argument('rccfile',\n help='the resource file to compile.\\\n The compiled file will be in the jukeboxcore.gui.resources package and en... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Serializes the object
@param [String] str
@return [String] | [
"def to_xml_string(str = '')\n super(str) do\n # needs to override the super color here to push in ln/and something else!\n if color\n str << '<c:spPr><a:solidFill>'\n str << ('<a:srgbClr val=\"' << color << '\"/>')\n str << '</a:solidFill>'\n str << '<a:ln><a:... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Verifies that the group has the required success condition and action and
a falid target percentage.
@param group
the input group
@return the verified group | [
"public static RolloutGroup verifyRolloutGroupHasConditions(final RolloutGroup group) {\n if (group.getTargetPercentage() < 1F || group.getTargetPercentage() > 100F) {\n throw new ValidationException(\"Target percentage has to be between 1 and 100\");\n }\n\n if (group.getSuccessCond... | [
"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:"
} |
Add variable(s) to replacement list
it will automatically format scalar types and arrays,
so they text representation will be inserted
@param $name array|string
@param $value null|string|array
@return $this | [
"public function set($name, $value = null)\n {\n if (is_array($name)) {\n foreach ($name as $innerName => $innerValue) {\n $this->replace($innerName, $this->formatValue($innerValue));\n }\n } else {\n $this->replace($name, $this->formatValue($value));... | [
"def BIF_templates(self):\n \n network_template = Template('network $name {\\n}\\n')\n # property tag may or may not be present in model,and since no of properties\n # can be more than one , will replace them accoriding to format otherwise null\n variable_template = Template(\"\"\... | codesearchnet | {
"query": "Represent the text about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code:"
} |
@param string $key
@param mixed $value
@return Log
@throws \InvalidArgumentException | [
"public function with( $key, $value ) {\n\n\t\tif ( ! is_string( $key ) || ! array_key_exists( $key, self::$filters ) ) {\n\t\t\tthrow new \\InvalidArgumentException( 'Invalid Log key.' );\n\t\t}\n\n\t\treturn $this->merge_array( [ $key => $value ] );\n\t}"
] | [
"static function parseWith($optionsResource, array $_ = null)\n {\n if (!static::isConfigurableWith($optionsResource))\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Configuration Resource provided on (%s); given: (%s).'\n , static::class, \\Poirot\\Std... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Prefix a collection name | [
"function(metric_type, metric) {\n\tvar ary = metric.split('.');\n\tif (options.prefix) ary.shift();\n\tary.unshift(metric_type);\n\treturn ary.join('.')+'_'+options.rate;\n}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Update updates all the submodules in this list. | [
"func (s Submodules) Update(o *SubmoduleUpdateOptions) error {\n\treturn s.UpdateContext(context.Background(), o)\n}"
] | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
デバッグモード用のエラーページ描画用のレスポンスインスタンスを生成する
@param \Throwable $e
@return ResponseInterface | [
"protected function createErrorPageInDebugMode(\\Throwable $e){\n $response = $this->createErrorPage($e);\n $context = [\n \"errors\" => [],\n ];\n\n do{\n $context[\"errors\"][] = $this->analysisError($e);\n }while(($e = $e->getPrevious()) !== nul... | [
"func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Boots up an object and stores.
@since 1.0.0
@param string $key Object key.
@param object $object Definition for this instance. | [
"public function store(string $key, $object)\n {\n if (isset($this->aliases[$key])) {\n $key = $this->aliases[$key];\n }\n\n $this->store[$key] = $object;\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 Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Sets match_titles then calls stored_nested_parse. | [
"def patched_nested_parse(self, *args, **kwargs):\n \"\"\"\"\"\"\n kwargs[\"match_titles\"] = True\n return self.stored_nested_parse(*args, **kwargs)"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
20141027: same as getDateTimeStrConcise but no timezone.
@param d
the d
@return the date time str concise no zone | [
"public static String getDateTimeStrConciseNoZone(Date d) {\n if (d == null)\n return \"\";\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n return sdf.format(d);\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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Open the subscription and submission pages subwindows, but close the
current page if any other type of page is selected. | [
"def handle_selected_page(self):\n \n if not self.selected_page:\n pass\n if self.selected_page.name in ('subscription', 'submission'):\n # Launch page in a subwindow\n self.selected_page = self.selected_page.loop()\n elif self.selected_page.name in ('sub... | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Language and programming:"
} |
Commits work done. | [
"@Override\n public void commit() throws DataCorruptedException, IOException, IllegalStateException{\n try {\n tranManager.commit(t1);\n } catch (RollbackException e) {\n rollback();\n throw new IOException(\"Error trying to commit transaction.\", e);\n } cat... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@Route("/{id}/delete", name="victoire_redirection_delete")
@Method("DELETE")
@param Redirection $redirection
@return Response | [
"public function deleteAction(Redirection $redirection)\n {\n $em = $this->getDoctrine()->getManager();\n\n $em->remove($redirection);\n $em->flush();\n\n /** @var RedirectionRepository $redirectionRepository */\n $redirectionRepository = $em->getRepository('VictoireSeoBundle:R... | [
"public function handleLogOut(): void\n\t{\n\t\t$this->user->logout();\n\t\t$this->flashNotifier->info('cms.user.youAreLoggedOut');\n\t\t$this->presenter->redirect(\":{$this->module}:Sign:in\");\n\t}"
] | codesearchnet | {
"query": "Represent the description about Sales Channel API:",
"pos": "Represent the code about Sales Channel API:",
"neg": "Represent the code about programming:"
} |
Return the function for the specified subcommand.
Args:
name: The name of a subcommand.
Returns:
The loadable object from the entry point represented by the subcommand. | [
"def _get_subcommand(name):\n # type: (str) -> config.RcliEntryPoint\n \n _LOGGER.debug('Accessing subcommand \"%s\".', name)\n if name not in settings.subcommands:\n raise ValueError(\n '\"{subcommand}\" is not a {command} command. \\'{command} help -a\\' '\n 'lists all ava... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
/*
@see com.marklogic.contentpump.DocBuilder#init(java.lang.String) | [
"@Override\n public void init(Configuration conf) {\n String rootName = conf.get(ConfigConstants.CONF_DELIMITED_ROOT_NAME, \n DEFAULT_ROOT_NAME);\n rootStart = '<' + rootName + '>';\n rootEnd = \"</\" + rootName + '>';\n \n }"
] | [
"@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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Checks that the rule is an IPv4 rule of a supported protocol | [
"def _supported_rule(protocol, ethertype):\n \"\"\"\"\"\"\n if not protocol or protocol not in utils.SUPPORTED_SG_PROTOCOLS:\n return False\n\n if ethertype != n_const.IPv4:\n return False\n\n return True"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Generate the filename to be used for this text.
@return string | [
"public function generateFilename(): string\n {\n $options = $this->provider->getOptions();\n\n $options[\"text\"] = $this->text;\n\n $data = serialize($options);\n\n return md5($data) . \".\" . $this->provider->getFormat();\n }"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Stem an English word and return the stemmed form.
:param word: The word that is stemmed.
:type word: str or unicode
:return: The stemmed form.
:rtype: unicode | [
"def stem(self, word):\n\n \n word = word.lower()\n\n if len(word) <= 2:\n return word\n\n elif word in self.__special_words:\n return self.__special_words[word]\n\n # Map the different apostrophe characters to a single consistent one\n word = (word.re... | [
"def _validate_none_or_type(t):\n \n def _validate(setting):\n \"\"\"\n Check the setting to make sure it's the right type.\n\n Args:\n setting (object): The setting to check.\n\n Returns:\n object: The unmodified object if it's the proper type.\n\n Rai... | codesearchnet | {
"query": "Represent the instruction about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about Software Engineering:"
} |
Add the missing groups to the SeqResGroups.
@param modelChain the chain to add the information for
@param sequence the sequence of the construct | [
"public static void addSeqRes(Chain modelChain, String sequence) {\n\t\tList<Group> seqResGroups = modelChain.getSeqResGroups();\n\t\tGroupType chainType = getChainType(modelChain.getAtomGroups());\n\t\tfor(int i=0; i<sequence.length(); i++){\n\t\t\tchar singleLetterCode = sequence.charAt(i);\n\t\t\tGroup group = n... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
causing the field to be persisted and overwritten on the load method. | [
"@SuppressWarnings({\"ConstantConditions\"})\n @Override\n public void load() {\n Class<? extends RepositoryBrowser> rb = repositoryBrowser;\n super.load();\n if (repositoryBrowser!=rb) { // XStream may overwrite even the final field.\n try {\n Field f = SCMDescr... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Download into a folder | [
"def download_to(self, folder):\n '''\n \n '''\n urlretrieve(self.maven_url, os.path.join(folder, self.filename))"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Obtain the IDs of profile and path as Identifiers
@param profileIdentifier actual ID or friendly name of profile
@param pathIdentifier actual ID or friendly name of path
@return
@throws Exception | [
"public static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdentifier) throws Exception {\n Identifiers id = new Identifiers();\n\n Integer profileId = null;\n try {\n profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);\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 Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// SetFileLabel sets the SELinux label for this path or returns an error. | [
"func SetFileLabel(fpath string, label string) error {\n\tif fpath == \"\" {\n\t\treturn ErrEmptyPath\n\t}\n\treturn lsetxattr(fpath, xattrNameSelinux, []byte(label), 0)\n}"
] | [
"def _GetStat(self):\n \n stat_object = super(VShadowFileEntry, self)._GetStat()\n\n if self._vshadow_store is not None:\n # File data stat information.\n stat_object.size = self._vshadow_store.volume_size\n\n # Ownership and permissions stat information.\n\n # File entry type stat informat... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
} |
TODO: Hoist directives (as in asyncDefine) | [
"function asyncDefineMethod(ast) {\n return treeWalk(ast, function (node, descend, path) {\n var transform = getMemberFunction(node);\n descend();\n if (!transform || !examine(transform).isAsync) \n return;\n if (node.kind == 'set') {\n ... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetMarker sets the Marker field's value. | [
"func (s *DescribeDBParametersInput) SetMarker(v string) *DescribeDBParametersInput {\n\ts.Marker = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
permit to extend the template engine with custom functions
@access public
@param $method mixed array,string
@throws MissingTemplateException
@return void
@since 3.0
@package Gcs\Framework\Core\Template | [
"public static function extend($method) {\n if (is_array($method)) {\n if (count($method) == 2 && method_exists($method[0], $method[1])) {\n array_push(self::$_extends, ['class' => $method[0], 'method' => $method[1]]);\n }\n else {\n throw new Mi... | [
"final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\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:"
} |
Get princial details
CLI Example:
.. code-block:: bash
salt 'kdc.example.com' kerberos.get_principal root/admin | [
"def get_principal(name):\n '''\n \n '''\n ret = {}\n\n cmd = __execute_kadmin('get_principal {0}'.format(name))\n\n if cmd['retcode'] != 0 or cmd['stderr']:\n ret['comment'] = cmd['stderr'].splitlines()[-1]\n ret['result'] = False\n\n return ret\n\n for i in cmd['stdout'].... | [
"def create_ckan_ini(self):\n \n self.run_command(\n command='/scripts/run_as_user.sh /usr/lib/ckan/bin/paster make-config'\n ' ckan /project/development.ini',\n rw_project=True,\n ro={scripts.get_script_path('run_as_user.sh'): '/scripts/run_as_user.sh'},\n ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
The alternate ISO format, Pyyyy-Www-ddThh:mm:ss, which excludes months.
<p>
Even if months are present in the period, they are not output.
Fractional seconds (milliseconds) will appear if required.
@return the formatter | [
"public static PeriodFormatter alternateExtendedWithWeeks() {\n if (cAlternateExtendedWihWeeks == null) {\n cAlternateExtendedWihWeeks = new PeriodFormatterBuilder()\n .appendLiteral(\"P\")\n .printZeroAlways()\n .minimumPrintedDigits(4)\n ... | [
"private function to8601Utc(\\DateTimeInterface $dateTime): string\n {\n // Convert to UTC if we can\n if ($dateTime instanceof DateTime) {\n $dateTime->setTimezone(new \\DateTimeZone('UTC'));\n } elseif ($dateTime instanceof \\DateTimeImmutable && $dateTime->getOffset() > 0) {\n ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Tag mocks base method | [
"func (m *MockMutaterMachine) Tag() names_v2.MachineTag {\n\tret := m.ctrl.Call(m, \"Tag\")\n\tret0, _ := ret[0].(names_v2.MachineTag)\n\treturn ret0\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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Opens a file - will actually return a temporary file but replace the
original file when the context is closed. | [
"def open(self, filepath, mode='w+b'):\n \n #Check if the filepath can be accessed and is writable before creating\n #the tempfile\n if not _isFileAccessible(filepath):\n raise IOError('File %s is not writable' % (filepath,))\n\n if filepath in self._files:\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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Compares two basis set dictionaries and prints a report about their differences | [
"def basis_comparison_report(bs1, bs2, uncontract_general=False):\n '''\n \n '''\n\n all_bs1 = list(bs1['elements'].keys())\n\n if uncontract_general:\n bs1 = manip.uncontract_general(bs1)\n bs2 = manip.uncontract_general(bs2)\n\n not_in_bs1 = [] # Found in bs2, not in bs1\n not_... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Copies this {@code Include} to the given task. A {@link TaskCloneException} is thrown if this {@code Include} is eager.
@param task the task to be filled
@return the given task for chaining
@throws TaskCloneException if this {@code Include} is eager. | [
"@Override\n\tprotected Task<E> copyTo (Task<E> task) {\n\t\tif (!lazy) throw new TaskCloneException(\"A non-lazy \" + getClass().getSimpleName() + \" should never be copied.\");\n\n\t\tInclude<E> include = (Include<E>)task;\n\t\tinclude.subtree = subtree;\n\t\tinclude.lazy = lazy;\n\n\t\treturn task;\n\t}"
] | [
"<T> InternalProviderImpl<? extends T> lookupProvider(Class<T> clazz, String bindingName) {\n if (clazz == null) {\n throw new IllegalArgumentException(\"TP can't get an instance of a null class.\");\n }\n InternalProviderImpl<? extends T> scopedProvider = getBoundProvider(clazz, bindingName);\n if... | 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:"
} |
Returns an Avatar URL. | [
"public function avatar(string $email, array $options = [], ?bool $secure = null, bool $validateOptions = false): string\n {\n $url = 'avatar/'.$this->createEmailHash($email);\n\n $options = array_merge($this->defaults, array_filter($options));\n\n if ($validateOptions) {\n $this-... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about File management:"
} |
Return files from bucket sorted by given keys.
:param bucket: :class:`~invenio_files_rest.models.Bucket` containing the
files.
:param keys: Keys order to be used.
:returns: Sorted list of bucket items. | [
"def sorted_files_from_bucket(bucket, keys=None):\n \n keys = keys or []\n total = len(keys)\n sortby = dict(zip(keys, range(total)))\n values = ObjectVersion.get_by_bucket(bucket).all()\n return sorted(values, key=lambda x: sortby.get(x.key, total))"
] | [
"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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about AWS S3:"
} |
// This is a courtesy helper function, which in some cases may not work as expected! | [
"func (s *SystemVMService) GetSystemVmID(name string, opts ...OptionFunc) (string, int, error) {\n\tp := &ListSystemVmsParams{}\n\tp.p = make(map[string]interface{})\n\n\tp.p[\"name\"] = name\n\n\tfor _, fn := range append(s.cs.options, opts...) {\n\t\tif err := fn(s.cs, p); err != nil {\n\t\t\treturn \"\", -1, err... | [
"function isSafeProperty (object, prop) {\n if (!object || typeof object !== 'object') {\n return false\n }\n // SAFE: whitelisted\n // e.g length\n if (hasOwnProperty(safeNativeProperties, prop)) {\n return true\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (prop in Obje... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Generate a unique ID.
@return string Returns the unique identifier, as a string. | [
"public static function uniqid()\n {\n static $n = 0;\n return str_shuffle(\n md5(\n str_shuffle(\n microtime(true) . chr(mt_rand(0, 0xFF))\n . Daemon::$process->getPid() . chr(mt_rand(0, 0xFF))\n . (++$n) . mt_rand(... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
check csrf
@access protected
@return boolean
@since 3.0
@package Gcs\Framework\Core\Security | [
"protected function _checkCsrf() {\n if ($this->_configFirewall['csrf']['enabled'] == true && $this->request->logged == true) {\n if ($this->_csrf['SESSION'] != false && ($this->_csrf['GET'] != false || $this->_csrf['POST'] != false)) {\n if ($this->_csrf['POST'] == $this->_csrf['SE... | [
"public static function backwardsCompatibility(&$oBindTo)\n {\n // @todo (Pablo - 2017-06-07) - Remove these\n $oBindTo->db = Factory::service('Database');\n $oBindTo->encrypt = Factory::service('Encrypt');\n }"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Parses command line options into an options hash.
@param args [Array<String>] arguments passed via the command line
@return [Hash] parsed options | [
"def parse(args)\n @options = {\n reporters: [DEFAULT_REPORTER],\n }\n\n OptionParser.new do |parser|\n parser.banner = \"Usage: #{parser.program_name} [options] [scss-files]\"\n\n add_display_options parser\n add_linter_options parser\n add_file_options parser\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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Run Graql compute count query
@return a Answer object containing the count value | [
"private Stream<Numeric> runComputeCount(GraqlCompute.Statistics.Count query) {\n if (!scopeContainsInstance(query)) {\n LOG.debug(\"Count = 0\");\n return Stream.of(new Numeric(0));\n }\n\n Set<LabelId> scopeTypeLabelIDs = convertLabelsToIds(scopeTypeLabels(query));\n ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Nodes that have only a single connection to one other node are disconnected since they are likely to be noise.
This is done recursively | [
"void disconnectSingleConnections() {\n\n\t\tList<SquareNode> open = new ArrayList<>();\n\t\tList<SquareNode> open2 = new ArrayList<>();\n\n\t\tfor (int i = 0; i < nodes.size(); i++) {\n\t\t\tSquareNode n = nodes.get(i);\n\t\t\tcheckDisconnectSingleEdge(open, n);\n\t\t}\n\n\n\t\twhile( !open.isEmpty() ) {\n\t\t\tfo... | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Creates recipient headers.
@access public
@return string | [
"public function AddrAppend($type, $addr) {\n $addr_str = $type . ': ';\n $addresses = array();\n foreach ($addr as $a) {\n $addresses[] = $this->AddrFormat($a);\n }\n $addr_str .= implode(', ', $addresses);\n $addr_str .= $this->LE;\n\n return $addr_str;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Get the range of archor reading_ids.
Returns:
(int, int): The lowest and highest reading ids.
If no reading ids have been loaded, (0, 0) is returned. | [
"def id_range(self):\n \n\n if len(self._anchor_points) == 0:\n return (0, 0)\n\n return (self._anchor_points[0].reading_id, self._anchor_points[-1].reading_id)"
] | [
"def _get_recording(self, index):\n \"\"\"\"\"\"\n assert index >= 0\n recs = np.nonzero((index - self.offsets[:-1]) >= 0)[0]\n if len(recs) == 0: # pragma: no cover\n # If the index is greater than the total size,\n # return the last recording.\n return... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// GapPolicy defines what should be done when a gap in the series is discovered.
// Valid values include "insert_zeros" or "skip". Default is "insert_zeros". | [
"func (a *MinBucketAggregation) GapPolicy(gapPolicy string) *MinBucketAggregation {\n\ta.gapPolicy = gapPolicy\n\treturn a\n}"
] | [
"public static void addDataOptions(final ArgP argp) {\n argp.addOption(\"--full-scan\", \"Scan the entire data table.\");\n argp.addOption(\"--fix\", \"Fix errors as they're found. Use in combination with\"\n + \" other flags.\");\n argp.addOption(\"--fix-all\", \"Set all flags and fix errors as the... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Data parsing:"
} |
Returns a string that may safely be used as the href of a link
to the route with the given name, URL parameters, and query. | [
"function makeHref(to, params, query) {\n var path = Router.makePath(to, params, query);\n return location === HashLocation ? '#' + path : path;\n }"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Language and programming:"
} |
Parse a table node.
:param node: The lxml table node to parse
:param state: The global state necessary to place the node in context
of the document as a whole. | [
"def _parse_table(self, node, state):\n \n if not self.tabular:\n logger.error(\"Called _parse_table without tabular activated.\")\n return state\n\n if node.tag == \"table\":\n table_idx = state[\"table\"][\"idx\"]\n stable_id = f\"{state['document']... | [
"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 about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
The tabview module provides a widget for managing content bound to tabs.
@module tabview
@requires yahoo, dom, event, element | [
"function(el, attr) {\n attr = attr || {};\n if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) {\n attr = el; // treat first arg as attr object\n el = attr.element || null;\n }\n \n if (!el && !attr.element) { // create if we dont have on... | [
"function ready(bounds, elem) {\n form.scope(\"item\", elem ); // initiate the scope which uses the svg dom as parent node\n space.bindMouse();\n space.play();\n}"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Gets the attribute name.<p>
@return the attribute name | [
"@Column(header = Messages.GUI_HISTORY_DIALOG_COL_PROPERTY_0, order = 10)\n public String getProperty() {\n\n String result = m_comp.getName();\n if (result.startsWith(\"GUI_\")) {\n result = CmsVaadinUtils.getMessageText(result);\n }\n return result;\n }"
] | [
"public Element tagName(String tagName) {\n Validate.notEmpty(tagName, \"Tag name must not be empty.\");\n tag = Tag.valueOf(tagName, NodeUtils.parser(this).settings()); // maintains the case option of the original parse\n return this;\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Detects if it's a child where or a parent where, runs the child clauses and where statements, if there are any
results, adds a WHERE at the start if it's a parent, then adds the selected operator (and or or ) between each
clause.
{@inheritDoc} | [
"@Override\n public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException {\n StringWriter stringWriter = new StringWriter();\n WhereContext whereContext = new WhereContext(env.getCustomAttribute(\"whereTag\"));\n ... | [
"function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.