query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html>`_ :arg policy: The name of the index lifecycle policy
[ "def delete_lifecycle(self, policy=None, params=None):\n \n return self.transport.perform_request(\n \"DELETE\", _make_path(\"_ilm\", \"policy\", policy), params=params\n )" ]
[ "def _new_percolator(spec, search_pattern):\n \"\"\"\"\"\"\n if spec and search_pattern:\n query = query_string_parser(search_pattern=search_pattern).to_dict()\n for index in current_search.mappings.keys():\n # Create the percolator doc_type in the existing index for >= ES5\n ...
codesearchnet
{ "query": "Represent the instruction about Elasticsearch:", "pos": "Represent the code about Elasticsearch:", "neg": "Represent the code:" }
// SetSourceUrl sets the SourceUrl field's value.
[ "func (s *ThreatIntelIndicator) SetSourceUrl(v string) *ThreatIntelIndicator {\n\ts.SourceUrl = &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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
upload file or files @param array $options @return array|boolean
[ "protected function uploadFile($options)\n {\n if ( $options['type'] === 'file' ) {\n $this->repo = new FileRepository($options);\n $this->hasFile = true;\n } else {\n $this->repo = new ImageRepository($options);\n $this->hasPhoto = true;\n }\n\n ...
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Initializes the type given the string value of the type.<p> @param type a string representation of the type @return the actual type object
[ "private static I_Loader initLoader(String type) {\r\n\r\n if (TYPE_PROPERTIES.equals(type)) {\r\n return new CmsVfsBundleLoaderProperties();\r\n } else if (TYPE_XML.equals(type)) {\r\n return new CmsVfsBundleLoaderXml();\r\n } else {\r\n return new CmsVfsBundle...
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Little hack to make <input> can perform waves effect
[ "function (elements) {\n for (var a = 0; a < elements.length; a++) {\n var el = elements[a];\n\n if (el.tagName.toLowerCase() === 'input') {\n var parent = el.parentNode;\n\n // If input already have parent just pass through\n if (parent.tagName.toLowerCase() === 'i' &&...
[ "def handle_key ch\n $log.debug \" KeyDispatcher GOT KEY #{ch} \"\n @keyint = ch\n @keychr = nil\n chr = nil\n chr = ch.chr if ch > 32 and ch < 127\n @keychr = chr\n\n ret = process_key ch\n # revert to the basic handling of key_map and refreshing pad.\n #####\n # ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create a new file parameter :param help_string: :param default: :param suffixes: :return:
[ "def create_new_file(help_string=NO_HELP, default=NO_DEFAULT, suffixes=None):\n # type: (str, Union[str, NO_DEFAULT_TYPE], Union[List[str], None]) -> str\n \n # noinspection PyTypeChecker\n return ParamFilename(\n help_string=help_string,\n default=default,\n ...
[ "def __store_config(self, args, kwargs):\n \n signature = (\n 'schema',\n 'ignore_none_values',\n 'allow_unknown',\n 'require_all',\n 'purge_unknown',\n 'purge_readonly',\n )\n for i, p in enumerate(signature[: len(args)])...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Get existing validation records.
[ "def _get_existing(driver, zone_name, server_name, validation):\n \n if zone_name is None:\n zones = sorted(\n (z for z\n in driver.list_zones()\n if server_name.rstrip(u'.')\n .endswith(u'.' + z.domain.rstrip(u'.'))),\n key=lambda z: len(z.d...
[ "@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:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Invokes the given merge operation. @param serviceName the service name @param operation the merge operation @param partitionId the partition ID of the operation
[ "protected void invoke(String serviceName, Operation operation, int partitionId) {\n try {\n operationCount++;\n operationService\n .invokeOnPartition(serviceName, operation, partitionId)\n .andThen(mergeCallback);\n } catch (Throwable t) {\n...
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// RemovePermissionWithContext mocks base method
[ "func (m *MockLambdaAPI) RemovePermissionWithContext(arg0 aws.Context, arg1 *lambda.RemovePermissionInput, arg2 ...request.Option) (*lambda.RemovePermissionOutput, error) {\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"RemovePer...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Get a single role by name
[ "func (rs *RoleService) Get(ctx context.Context, roleName string) (r *Role, resp *APIResponse, err error) {\n\tr = &Role{}\n\t_, resp, err = rs.client.getAction(ctx, &APIClientRequest{\n\t\tAPIVersion: apiV1,\n\t\tPath: fmt.Sprintf(\"admin/security/roles/%s\", roleName),\n\t\tResponseBody: r,\n\t})\n\n\tr...
[ "function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
// NewIndexWriter returns a new IndexWriter.
[ "func NewIndexWriter() IndexWriter {\n\tbuf := bytes.NewBuffer(make([]byte, 0, 1024*1024))\n\treturn &directIndex{buf: buf, w: bufio.NewWriter(buf)}\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github sentence about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code about programming:" }
Render output from given statistics. @param ProjectStatistics $statistics @return void
[ "public function render(ProjectStatistics $statistics)\n {\n $table = new Table($this->output);\n\n $table\n ->setHeaders(['Name', 'Classes', 'Methods', 'Methods/Class', 'Lines', 'LoC', 'LoC/Method'])\n ->setRows($statistics->components())\n ->addRow($statistics->ot...
[ "def _get_result_paths(self, data):\n \n\n # Swarm OTU map (mandatory output)\n return {'OtuMap': ResultPath(Path=self.Parameters['-o'].Value,\n IsWritten=True)}" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Is this table a m:n pivot table? @param bool $newStatus The new status. @return bool The old status.
[ "public function isPivotTable($newStatus = false)\n {\n $oldStatus = $this->isPivotTable;\n\n if (func_num_args()) {\n $this->isPivotTable = $newStatus;\n } // if\n\n return $oldStatus;\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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
/* (non-Javadoc) @see org.protempa.proposition.TemporalProposition#isEqual(java.lang.Object)
[ "@Override\n public boolean isEqual(Object o) {\n if (o == this) {\n return true;\n }\n if (!(o instanceof TemporalParameter)) {\n return false;\n }\n\n TemporalParameter p = (TemporalParameter) o;\n return super.isEqual(p)\n && (this...
[ "public LexemeIdValue copy(LexemeIdValue object) {\n\t\treturn dataObjectFactory.getLexemeIdValue(object.getId(), object.getSiteIri());\n\t}" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about text processing:" }
Removes all active facets from the request. @return SearchRequest
[ "public function removeAllFacets()\n {\n $path = $this->prefixWithNamespace('filter');\n $this->argumentsAccessor->reset($path);\n $this->stateChanged = true;\n return $this;\n }" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about Web development:", "pos": "Represent the Github code about Web development:", "neg": "Represent the Github code about Programming:" }
Parses the authorization header for a basic authentication. @param string $header @return false|array
[ "private static function parseAuthorizationHeader($header)\n {\n if (strpos($header, 'Digest') !== 0) {\n return false;\n }\n\n $needed_parts = ['nonce' => 1, 'nc' => 1, 'cnonce' => 1, 'qop' => 1, 'username' => 1, 'uri' => 1, 'response' => 1];\n $data = [];\n\n preg_...
[ "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 Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
All CloudFormation states listed here: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html
[ "def exit_unless_updateable!\n stack_name = Jets::Naming.parent_stack_name\n exists = stack_exists?(stack_name)\n return unless exists # continue because stack could be updating\n\n stack = cfn.describe_stacks(stack_name: stack_name).stacks.first\n status = stack[\"stack_status\"]\n if...
[ "def limits(args):\n \n # https://aws.amazon.com/about-aws/whats-new/2014/06/19/amazon-ec2-service-limits-report-now-available/\n # Console-only APIs: getInstanceLimits, getAccountLimits, getAutoscalingLimits, getHostLimits\n # http://boto3.readthedocs.io/en/latest/reference/services/dynamodb.html#Dynam...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns the order in which the given node's children should be evaluated. <p>In most cases, this is EvaluationDirection.FORWARD because the AST order matches the actual evaluation order. A few nodes require reversed evaluation instead.
[ "private static EvaluationDirection getEvaluationDirection(Node node) {\n switch (node.getToken()) {\n case DESTRUCTURING_LHS:\n case ASSIGN:\n case DEFAULT_VALUE:\n if (node.getFirstChild().isDestructuringPattern()) {\n // The lhs of a destructuring assignment is evaluated AFTER t...
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
----- helper methods ----------------------------------------------------
[ "@VisibleForTesting\n public static List<IStruct> getAllTraits(IReferenceableInstance entityDefinition,\n TypeSystem typeSystem) throws AtlasException {\n List<IStruct> traitInfo = new LinkedList<>();\n for (String traitName : entityDefinition.getTraits(...
[ "def help(self):\r\n \"\"\"\"\"\"\r\n QMessageBox.about(self, _(\"Help\"),\r\n \"\"\"<b>%s</b>\r\n <p><i>%s</i><br> edit foobar.py\r\n <p><i>%s</i><br> xedit foobar.py\r\n <p><i>%s</i><br> run ...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Calculate and update which pages are visible, possibly updating CSS classes on the pages @param {boolean} updateClasses Wheter to update page CSS classes as well @returns {void}
[ "function (updateClasses) {\n var i, len, $page,\n state = this.state,\n visibleRange = this.calculateVisibleRange(),\n fullyVisibleRange = this.calculateFullyVisibleRange();\n state.visiblePages.length = 0;\n state.fullyVisiblePages.leng...
[ "function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Builds a Request. All parameters must be effectively immutable, via safe copies. @param httpMethod for the request. @param url for the request. @param headers to include. @param body of the request, can be {@literal null} @return a Request
[ "public static Request create(HttpMethod httpMethod,\n String url,\n Map<String, Collection<String>> headers,\n Body body) {\n return new Request(httpMethod, url, headers, body);\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 text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
// SetEventSubscription sets the EventSubscription field's value.
[ "func (s *RemoveSourceIdentifierFromSubscriptionOutput) SetEventSubscription(v *EventSubscription) *RemoveSourceIdentifierFromSubscriptionOutput {\n\ts.EventSubscription = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns SQL to define the table.
[ "def ddl(self, dialect=None, creates=True, drops=True):\n \n dialect = self._dialect(dialect)\n creator = CreateTable(self.table).compile(mock_engines[dialect])\n creator = \"\\n\".join(l for l in str(creator).splitlines() if l.strip()) # remove empty lines\n comments = \"\\n\\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 sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// ChatAttachmentUploadStart implements the chat1.NotifyChatInterface // for ChatRPC.
[ "func (c *ChatRPC) ChatAttachmentUploadStart(\n\t_ context.Context, _ chat1.ChatAttachmentUploadStartArg) error {\n\treturn nil\n}" ]
[ "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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Complete is an event fired when a transaction successfully completed. // // https://developer.mozilla.org/docs/Web/Reference/Events/complete_indexedDB
[ "func Complete(listener func(*vecty.Event)) *vecty.EventListener {\n\treturn &vecty.EventListener{Name: \"complete\", Listener: listener}\n}" ]
[ "function isDraggingFiles(event) {\n\t// If `event.dataTransfer` is not available then `event.target.files` fallback is used.\n\tif (!event.dataTransfer) {\n\t\treturn true\n\t}\n\t// https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n\t// https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
注册前置分发器. @param IURLPreDispatcher $dispatcher @param int $index
[ "public function registerPreDispatcher(IURLPreDispatcher $dispatcher, $index = 10) {\n $this->preDispatchers [ $index ] [] = $dispatcher;\n ksort($this->preDispatchers, SORT_NUMERIC);\n }" ]
[ "public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Get the report summary. @return string[]
[ "public function getSummary()\n {\n $summary = [];\n\n $name = $this->getName();\n $message = $this->getMessage();\n\n if ($name !== $message) {\n $summary['name'] = $name;\n }\n\n $summary['message'] = $message;\n\n $summary['severity'] = $this->getSev...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// WarnConstraintAliases shows a warning to the user that they have used an // alias for a constraint that might go away sometime.
[ "func WarnConstraintAliases(ctx *cmd.Context, aliases map[string]string) {\n\tfor alias, canonical := range aliases {\n\t\tctx.Infof(\"Warning: constraint %q is deprecated in favor of %q.\\n\", alias, canonical)\n\t}\n}" ]
[ "void appendGoogRequiresTo(StringBuilder sb) {\n for (GoogRequire require : googRequires.values()) {\n // TODO(lukes): we need some namespace management here... though really we need namespace\n // management with all declarations... The problem is that a require could introduce a name\n // alias ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Return the Pauli sigma_Z operator acting on the given qubit
[ "def sZ(qubit: Qubit, coefficient: complex = 1.0) -> Pauli:\n \"\"\"\"\"\"\n return Pauli.sigma(qubit, 'Z', coefficient)" ]
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Check resource. @return Result
[ "public function check()\n {\n foreach ($this->target->paths as $path) {\n if (! $this->getFilesystem()->isWritable($path)) {\n return $this->makeResult(\n false,\n sprintf($this->target->getErrorMessage(), $path)\n );\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic EList<IfcAppliedValue> getBaseCosts() {\r\n\t\treturn (EList<IfcAppliedValue>) eGet(Ifc4Package.Literals.IFC_CONSTRUCTION_RESOURCE__BASE_COSTS, true);\r\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the instruction about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
Retrieve Bad Player Stats @access public @return object JSON
[ "public function retrieveBadPlayerStats ()\n {\n $data = file_get_contents(\"http://battlefield.play4free.com/en/profile/stats/\" .$this->_profileID. \"/\" .$this->_soldierID. \"?g=[%22BadPlayerStats%22]\");\n $badPlayerStats = json_decode($data);\n return $badPlayerStats;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// AddToUserAgent adds an extension to the current user agent
[ "func (c *Client) AddToUserAgent(extension string) error {\n\tif extension != \"\" {\n\t\tc.UserAgent = fmt.Sprintf(\"%s %s\", c.UserAgent, extension)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"Extension was empty, User Agent stayed as %s\", c.UserAgent)\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param $name @return mixed
[ "final public function &__get($name)\n {\n $value = $this->data[$name];\n\n //Apply accessor\n $this->applyModifier($name, $value, 'get');\n\n return $value;\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Returns the array of channel ids for the policy. @return The array of channel ids
[ "public long[] getChannelIdArray()\n {\n long[] ret = new long[channelIds.size()];\n for(int i = 0; i < channelIds.size(); i++)\n ret[i] = channelIds.get(i);\n return ret;\n }" ]
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns whether the keypath resolution should propagate to children. Some keypaths resolve to content other than leaf contents (such as a layer or content group transform) so sometimes this will return false.
[ "@SuppressWarnings(\"SimplifiableIfStatement\")\n @RestrictTo(RestrictTo.Scope.LIBRARY)\n public boolean propagateToChildren(String key, int depth) {\n if (\"__container\".equals(key)) {\n return true;\n }\n return depth < keys.size() - 1 || keys.get(depth).equals(\"**\");\n }" ]
[ "function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NewRef returns a new membership reference
[ "func NewRef(refresh time.Duration, context Context, chConfigRef *lazyref.Reference) *Ref {\n\tref := &Ref{\n\t\tchConfigRef: chConfigRef,\n\t\tcontext: context,\n\t}\n\n\tref.Reference = lazyref.New(\n\t\tref.initializer(),\n\t\tlazyref.WithRefreshInterval(lazyref.InitImmediately, refresh),\n\t)\n\n\treturn re...
[ "@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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Fatalf returns an error that will cause mage to print out the // given message and exit with the given exit code.
[ "func Fatalf(code int, format string, args ...interface{}) error {\n\treturn fatalErr{\n\t\tcode: code,\n\t\terror: fmt.Errorf(format, args...),\n\t}\n}" ]
[ "function startDeamon () {\n // ps aux | grep yourscript\n // kill -s SIGINT [process_id]\n process.stdin.resume()\n process.on('SIGINT', function (err) {\n // An easy way to send the SIGINT signal is with Control-C in most terminal programs.\n // Note:\n // SIGUSR1 is reserved by node.js to start th...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Get the select columns for the relation query. @param array $columns @return \Mellivora\Database\Eloquent\Relations\BelongsToMany
[ "protected function shouldSelect(array $columns = ['*'])\n {\n if ($columns === ['*']) {\n $columns = [$this->related->getTable() . '.*'];\n }\n\n return array_merge($columns, $this->aliasedPivotColumns());\n }" ]
[ "public function GetTableColumnNames($tableName) {\n $this->setDbConfigList(array());\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::COLUMNNAMES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"DESCRI...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Computes the volume of this SpatialComparable. @param box Box @param scale Scaling factor @return the volume of this SpatialComparable
[ "public static double volumeScaled(SpatialComparable box, double scale) {\n final int dim = box.getDimensionality();\n double vol = 1.;\n for(int i = 0; i < dim; i++) {\n double delta = box.getMax(i) - box.getMin(i);\n if(delta == 0.) {\n return 0.;\n }\n vol *= delta * scale;\n ...
[ "private int dimensionality(Relation<O> rel) {\n // Explicit:\n if(idim >= 0) {\n return idim;\n }\n // Cast to vector field relation.\n @SuppressWarnings(\"unchecked\")\n final Relation<NumberVector> frel = (Relation<NumberVector>) rel;\n int dim = RelationUtil.dimensionality(frel);\n ...
codesearchnet
{ "query": "Represent the description about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
Build a result set keyed by PK. @param array $results @param string. $primaryKey @return array
[ "protected function buildKeyedResultSet(array $results, string $primaryKey) : array\n {\n $builder = new EntityBuilder($this->mapper, array_keys($this->eagerLoads), $this->useCache);\n\n $keys = array_map(function ($item) use ($primaryKey) {\n return $item[$primaryKey];\n }, $resu...
[ "@Override\n public AccessPlan fromView(XsStringVal schema, XsStringVal view) {\n return new AccessPlanSubImpl(this, \"op\", \"from-view\", new Object[]{ schema, view });\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
This method is the same as the other processAuthChallenge() without the user/password option.
[ "public Request processAuthChallenge(Response response, Request req_msg) {\n return processAuthChallenge(response, req_msg, null, null);\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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
{@inheritdoc} @param int $bufferSize @throws \RuntimeException
[ "public function emit(ResponseInterface $response, int $bufferSize = 4096){\n while(0 < ob_get_level()){\n ob_end_flush();\n }\n\n if(!headers_sent($file, $line)){\n $this->emitHttpStatus($response);\n $this->emitHeaders($response);\n }\n\n if(0 < ...
[ "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:" }
Fixes for various DOM errors that MAL commits. Yes, I know this is a cardinal sin, but there's really no elegant way to fix this.
[ "def fix_bad_html(html):\n \n # on anime list pages, sometimes tds won't be properly opened.\n html = re.sub(r'[\\s]td class=', \"<td class=\", html)\n # on anime list pages, if the user doesn't specify progress, MAL will try to close a span it didn't open.\n def anime_list_closing_span(match):\n return mat...
[ "private JSType getJSType(Node n) {\n JSType jsType = n.getJSType();\n if (jsType == null) {\n // TODO(nicksantos): This branch indicates a compiler bug, not worthy of\n // halting the compilation but we should log this and analyze to track\n // down why it happens. This is not critical and wil...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
deletes the entry for the key & parameter from the store.
[ "def delete(key, parameters = {})\n @stores.map {|s| s.delete(key, parameters)}.any?\n end" ]
[ "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 Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Print the result, ascii encode if necessary
[ "def print_result(result):\n \"\"\"\"\"\"\n try:\n print result\n except UnicodeEncodeError:\n if sys.stdout.encoding:\n print result.encode(sys.stdout.encoding, 'replace')\n else:\n print result.encode('utf8')\n except:\n print \"Unexpected error attemp...
[ "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:" }
Bind an extra variable to the view with the given variable id. The same instance will be provided to all views the binding is bound to.
[ "@NonNull\n public final ItemBinding<T> bindExtra(int variableId, Object value) {\n if (extraBindings == null) {\n extraBindings = new SparseArray<>(1);\n }\n extraBindings.put(variableId, value);\n return this;\n }" ]
[ "function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetText sets the text content of the entry.
[ "func (e *Entry) SetText(text string) {\n\te.text.Set([]rune(text))\n\t// TODO: Enable when RuneBuf supports cursor movement for CJK.\n\t// e.ensureCursorIsVisible()\n\te.offset = 0\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 about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// ListenAndServe listens on the TCP network address addr and then calls Serve // with handler to handle sessions on incoming connections. Handler is typically // nil, in which case the DefaultHandler is used.
[ "func ListenAndServe(addr string, handler Handler, options ...Option) error {\n\tsrv := &Server{Addr: addr, Handler: handler}\n\tfor _, option := range options {\n\t\tif err := srv.SetOption(option); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn srv.ListenAndServe()\n}" ]
[ "def process_request_thread(self, request, client_address):\n \"\"\"\"\"\"\n # Instantiate the request handler.\n handler = self.RequestHandlerClass(request, client_address, self)\n try:\n # Attempt to handle a request with the handler.\n handler.handle_request()\n self.request_complete_c...
codesearchnet
{ "query": "Represent the text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Find actual default data source name. <p>If use master-slave rule, return master data source name.</p> @return actual default data source name
[ "public Optional<String> findActualDefaultDataSourceName() {\n String defaultDataSourceName = shardingDataSourceNames.getDefaultDataSourceName();\n if (Strings.isNullOrEmpty(defaultDataSourceName)) {\n return Optional.absent();\n }\n Optional<String> masterDefaultDataSourceNam...
[ "public static IGroupMember getGroupMember(String key, Class<?> type) throws GroupsException {\n /*\n * WARNING: The 'type' parameter is not the leafType; you're obligated\n * to say whether you want a group or a non-group (i.e. some type of\n * entity). In fact, the underlying imp...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Process the text @param source the sourcetext @return the result of text processing @see TextProcessor#process(CharSequence)
[ "public CharSequence process(CharSequence source) {\n if (source != null && source.length() > 0) {\n String stringSource = source instanceof String ? (String) source : source.toString();\n\n // Array to cache founded indexes of sequences\n int[] indexes = new int[escape.lengt...
[ "def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Determine if the browser is Maxthon or not, add by BugBuster @return boolean True if the browser is Maxthon otherwise false
[ "protected function checkBrowserMaxthon() {\n if( stripos($this->_agent,'Maxthon') !== false ) {\n $aresult = explode('/',stristr($this->_agent,'Maxthon'));\n $aversion = explode(' ',$aresult[1]);\n $this->setVersion($aversion[0]);\n $this->setBrowser(self::BROWSER...
[ "def detectAndroidTablet(self):\n \n #First, let's make sure we're on an Android device.\n if not self.detectAndroid():\n return False\n\n #Special check for Android devices with Opera Mobile/Mini. They should NOT report here.\n if self.detectOperaMobile():\n ...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
update the chart function
[ "function UpdateChartData()\r\n{\r\n while(Points > 10)\r\n {\r\n Points -= 1;\r\n\r\n myLineChart.removeData();\r\n }\r\n\r\n myLineChart.addData([Data[\"Temperature\"]], Math.floor((Date.now() - StartTime) / 1000.0));\r\n myLineChart.update();\r\n Points+=1;\r\n}" ]
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Draw implements the Drawable interface.
[ "func (self *Block) Draw(buf *Buffer) {\n\tif self.Border {\n\t\tself.drawBorder(buf)\n\t}\n\tbuf.SetString(\n\t\tself.Title,\n\t\tself.TitleStyle,\n\t\timage.Pt(self.Min.X+2, self.Min.Y),\n\t)\n}" ]
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Build the menu structure. @return mixed
[ "public function getItemProviders()\n {\n foreach ($this->modules->enabled() as $module) {\n $name = studly_case($module->getName());\n $class = 'Modules\\\\'.$name.'\\\\MenuExtenders\\\\MenuExtender';\n\n if (class_exists($class)) {\n $extender = $this->con...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Auto Generated Code
[ "def show_vcs_output_vcs_nodes_vcs_node_info_node_public_ip_addresses_node_public_ip_address(self, **kwargs):\n \n config = ET.Element(\"config\")\n show_vcs = ET.Element(\"show_vcs\")\n config = show_vcs\n output = ET.SubElement(show_vcs, \"output\")\n vcs_nodes = ET.SubEl...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about File management:" }
Put CHAP-MD5 specific attributes For authenticating using CHAP-MD5 via RADIUS you have to put the challenge and the response. The chapid is inserted in the first byte of the response. @return void
[ "function putAuthAttributes()\n {\n if (isset($this->username)) {\n $this->putAttribute(RADIUS_USER_NAME, $this->username);\n }\n if (isset($this->response)) {\n $response = pack('C', $this->chapid) . $this->response;\n $this->putAttribute(RADIUS_CHAP_PASSWOR...
[ "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 Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Update the Group memberships for the given users state :param user: User to update for :param state: State to update user for :return:
[ "def update_groups_for_user(self, user: User, state: State = None):\n \n if state is None:\n state = user.profile.state\n for config in self.filter(states=state):\n # grant user new groups for their state\n config.update_group_membership_for_user(user)\n ...
[ "def delete_state(node)\n # => Find the Node\n existing = find_state(node)\n return 'Node not present in state' unless existing\n # => Delete the Node from State\n state.delete(existing)\n # => Write Out the Updated State\n write_state\n # => Return the Deleted Node\n ex...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software Development:" }
Initialize this manager.
[ "void startInternal() throws LifecycleException {\n _log.info( getClass().getSimpleName() + \" starts initialization... (configured\" +\n \" nodes definition \" + _memcachedNodes + \", failover nodes \" + _failoverNodes + \")\" );\n\n _statistics = Statistics.create( _enableStatistics )...
[ "@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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Decorator for views that require a team be supplied wither via a slug in the url pattern or already set on the request object from the TeamMiddleware
[ "def team_required(func=None):\n \n def decorator(view_func):\n @functools.wraps(view_func, assigned=available_attrs(view_func))\n def _wrapped_view(request, *args, **kwargs):\n slug = kwargs.pop(\"slug\", None)\n if not getattr(request, \"team\", None):\n re...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// SetName sets the Name field's value.
[ "func (s *CreateDataSourceInput) SetName(v string) *CreateDataSourceInput {\n\ts.Name = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
------------------------------------------------------------------ Interface ------------------------------------------------------------------
[ "function TieBreaker(oldRes, posAry, limit, opts) {\n if (!(this instanceof TieBreaker)) {\n return new TieBreaker(oldRes, posAry, limit, opts);\n }\n this._opts = TieBreaker.defaults(opts);\n var invReason = TieBreaker.invalid(oldRes, posAry, this._opts, limit);\n if (invReason !== null) {\n this._opts....
[ "public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
/* (non-Javadoc) @see org.joml.Matrix4dc#getTransposed(int, java.nio.ByteBuffer)
[ "public ByteBuffer getTransposed(int index, ByteBuffer dest) {\n MemUtil.INSTANCE.putTransposed(this, index, dest);\n return dest;\n }" ]
[ "public static double dot(@javax.annotation.Nonnull final List<double[]> a, @javax.annotation.Nonnull final List<double[]> b) {\n return com.simiacryptus.util.ArrayUtil.sum(com.simiacryptus.util.ArrayUtil.multiply(a, b));\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
A helper function used by the {@link #getSubProperties} methods.
[ "protected static void extractSubProperties (Properties source, Properties dest, String prefix)\n {\n // extend the prefix to contain a dot\n prefix = prefix + \".\";\n int preflen = prefix.length();\n\n // scan the source properties\n Enumeration<?> names = source.propertyName...
[ "@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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Define the ball style. @param eventType the type of event for this ball
[ "public void setStyle(final JRebirthEventType eventType) {\n\n switch (eventType) {\n case CREATE_APPLICATION:\n this.circle.setFill(BallColors.APPLICATION.get());\n this.label.setText(\"App\");\n break;\n case CREATE_NOTIFIER:\n ...
[ "def set_form form\n raise \"Form is nil in set_form\" if form.nil?\n @form = form\n @id = form.add_widget(self) if !form.nil? and form.respond_to? :add_widget\n # 2009-10-29 15:04 use form.window, unless buffer created\n # should not use form.window so explicitly everywhere.\n # added...
codesearchnet
{ "query": "Represent the Github description about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code:" }
设置Long类型参数. @param value
[ "public void setLong(Long value) {\r\n\t\tthis.checkNull(value);\r\n\t\tlist.add(value);\r\n\t\ttype.add(Long.class);\r\n\t}" ]
[ "public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}" ]
codesearchnet
{ "query": "Represent the Github sentence about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
Outputs a BeautifulSoup object as a string that should hopefully be minimally modified
[ "def _get_bs4_string(soup):\n \n if len(soup.find_all(\"script\")) == 0:\n soup_str = soup.prettify(formatter=None).strip()\n else:\n soup_str = str(soup.html)\n soup_str = re.sub(\"&amp;\", \"&\", soup_str)\n soup_str = re.sub(\"&lt;\", \"<\", soup_str)\n soup_str = re.s...
[ "def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more x...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Save stores given cloud image metadata. // It supports bulk calls.
[ "func (api *API) Save(metadata params.MetadataSaveParams) (params.ErrorResults, error) {\n\tall, err := imagecommon.Save(api.metadata, metadata)\n\tif err != nil {\n\t\treturn params.ErrorResults{}, errors.Trace(err)\n\t}\n\treturn params.ErrorResults{Results: all}, nil\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Connect to JCR Repostory and JMS queue @throws JMSException if JMS Exception occurred
[ "@PostConstruct\n public void acquireConnections() throws JMSException {\n LOGGER.debug(\"Initializing: {}\", this.getClass().getCanonicalName());\n\n connection = connectionFactory.createConnection();\n connection.start();\n jmsSession = connection.createSession(false, Session.AUTO_A...
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Only allow class attributes that are instances of rootpy.types.Column, ROOT.TObject, or ROOT.ObjectProxy
[ "def checkattr(metacls, attr, value):\n \n if not isinstance(value, (\n types.MethodType,\n types.FunctionType,\n classmethod,\n staticmethod,\n property)):\n if attr in dir(type('dummy', (object,), {})) + \\\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Use this API to fetch vpnsessionpolicy_aaagroup_binding resources of given name .
[ "public static vpnsessionpolicy_aaagroup_binding[] get(nitro_service service, String name) throws Exception{\n\t\tvpnsessionpolicy_aaagroup_binding obj = new vpnsessionpolicy_aaagroup_binding();\n\t\tobj.set_name(name);\n\t\tvpnsessionpolicy_aaagroup_binding response[] = (vpnsessionpolicy_aaagroup_binding[]) obj.ge...
[ "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 comment about API documentation:", "pos": "Represent the code about API documentation:", "neg": "Represent the code about Natural Language Processing:" }
Examines the value yielded from the generator and prepares the next step in interation. @param mixed $yielded
[ "private function next($yielded)\n {\n if (!$this->generator->valid()) {\n $result = $this->generator->getReturn();\n\n if ($result instanceof Awaitable) {\n $this->reject(new AwaitableReturnedError($result));\n return;\n }\n\n if (...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Called by PresentsSession to let us know that we can clear it entirely out of the system.
[ "protected void clearSession (PresentsSession session)\n {\n // remove the session from the username map\n PresentsSession rc;\n synchronized (_usermap) {\n rc = _usermap.remove(session.getAuthName());\n }\n\n // sanity check just because we can\n if (rc == nu...
[ "private void removeContext(final String contextID) {\n\n synchronized (this.contextStack) {\n\n if (!contextID.equals(this.contextStack.peek().getIdentifier())) {\n throw new IllegalStateException(\"Trying to close context with id `\" + contextID +\n \"`. But the top context has id `\" +\...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// newUnconfirmedBlocks returns new data structure to track currently unconfirmed blocks.
[ "func newUnconfirmedBlocks(chain chainRetriever, depth uint) *unconfirmedBlocks {\n\treturn &unconfirmedBlocks{\n\t\tchain: chain,\n\t\tdepth: depth,\n\t}\n}" ]
[ "func (c channelState) ConnectedNodes() map[NodeID]struct{} {\n\tnodes := make(map[NodeID]struct{})\n\tfor _, channels := range c {\n\t\tnodes[channels.Node] = struct{}{}\n\t}\n\n\t// TODO(roasbeef): add outgoing, nodes, allow incoming and outgoing to\n\t// per node\n\t// * only add node is chan as funding amt set...
codesearchnet
{ "query": "Represent the comment about Blockchain:", "pos": "Represent the code about Blockchain:", "neg": "Represent the code about Software development:" }
shutdown all configured cluster monitors.
[ "@Override\n\tpublic void shutdownClusterMonitors() {\n\t\tfor (String clusterName : clustersProvider.getClusterNames()) {\n\t\t\tClusterMonitor<AggDataFromCluster> clusterMonitor = (ClusterMonitor<AggDataFromCluster>) AggregateClusterMonitor\n\t\t\t\t\t.findOrRegisterAggregateMonitor(clusterName);\n\t\t\tclusterMo...
[ "def remove_all_servers(self):\n \n # 'no ntp' removes all server entries.\n # For command_builder, disable command 'ntp' gives the desired command\n cmd = self.command_builder('ntp', disable=True)\n return self.configure(cmd)" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Networking:" }
// tx is either "key=value" or just arbitrary bytes
[ "func (app *KVStoreApplication) DeliverTx(tx []byte) types.ResponseDeliverTx {\n\tvar key, value []byte\n\tparts := bytes.Split(tx, []byte(\"=\"))\n\tif len(parts) == 2 {\n\t\tkey, value = parts[0], parts[1]\n\t} else {\n\t\tkey, value = tx, tx\n\t}\n\tapp.state.db.Set(prefixKey(key), value)\n\tapp.state.Size += 1\...
[ "def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Get a cached socket to the given address @param remote Remote address the socket is connected to. @return A socket with unknown state, possibly closed underneath. Or null.
[ "public Socket get(SocketAddress remote) {\n synchronized(multimap) {\n List<Socket> sockList = multimap.get(remote);\n if (sockList == null) {\n return null;\n }\n \n Iterator<Socket> iter = sockList.iterator();\n while (iter.hasNext()) {\n Socket candidate = iter.nex...
[ "public void close() throws IOException {\n guard.close();\n synchronized (this) {\n if (channel != null && channel.isOpen()) {\n channel.close();\n\n // j2objc: since a @RetainedWith field cannot be reassigned, the following line is\n // comment...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
@param \Spryker\Zed\Kernel\Container $container @return \Spryker\Zed\Kernel\Container
[ "public function providePersistenceLayerDependencies(Container $container): Container\n {\n $container = parent::providePersistenceLayerDependencies($container);\n $container = $this->addProductListPropelQuery($container);\n\n return $container;\n }" ]
[ "public function boot(\\Neos\\Flow\\Core\\Bootstrap $bootstrap)\n {\n $bootstrap->registerRequestHandler(new \\Neos\\Setup\\Core\\RequestHandler($bootstrap));\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
%prog digest fastafile NspI,BfuCI Digest fasta sequences to map restriction site positions.
[ "def digest(args):\n \n p = OptionParser(digest.__doc__)\n p.set_outfile()\n opts, args = p.parse_args(args)\n\n if len(args) != 2:\n sys.exit(not p.print_help())\n\n fastafile, enzymes = args\n enzymes = enzymes.split(\",\")\n enzymes = [x for x in AllEnzymes if str(x) in enzymes]\n ...
[ "def prt_qualifiers(self, prt=sys.stdout):\n \"\"\"\"\"\"\n # 13 not colocalizes_with (TBD: CHK - Seen in gene2go, but not gafs)\n # 4 not contributes_to (TBD: CHK - Seen in gene2go, but not gafs)\n self._prt_qualifiers(self.associations, prt)" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Marshal collection. @param cassandraTypeClazz the cassandra type clazz @param result the result @param clazz the clazz @return the collection
[ "public static Collection marshalCollection(Class cassandraTypeClazz, Collection result, Class clazz, Class resultTypeClass)\n {\n Collection mappedCollection = result;\n\n if (cassandraTypeClazz.isAssignableFrom(BytesType.class))\n {\n mappedCollection = (Collection) PropertyAcce...
[ "private void checkSchemaFields(ZooClassDef schema, Collection<ZooClassDef> cachedSchemata, \n\t\t\tSet<String> missingSchemas) {\n\t\t//do this only now, because only now we can check which field types\n\t\t//are really persistent!\n\t\t//TODO check for field types that became persistent only now -> error!!\n\t\t/...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Add creates a RemindersAddCall object in preparation for accessing the reminders.add endpoint
[ "func (s *RemindersService) Add(text string, time int) *RemindersAddCall {\n\tvar call RemindersAddCall\n\tcall.service = s\n\tcall.text = text\n\tcall.time = time\n\treturn &call\n}" ]
[ "function(list){\n localStorage.setItem(localStorageKey, JSON.stringify(list));\n // if we used a real database, we would likely do the below in a callback\n this.list = list;\n this.trigger(list); // sends the updated list to all listening components (TodoApp)\n }...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Returns the projects in all workspaces containing archived ones or not. @param boolean $archived Return archived projects or not @param string $opt_fields Return results with optional parameters @return string JSON or null
[ "public function getProjects($archived = false, $opt_fields = \"\")\r\n {\r\n $archived = $archived ? \"true\" : \"false\";\r\n $opt_fields = ($opt_fields != \"\") ? \"&opt_fields={$opt_fields}\" : \"\";\r\n\r\n return $this->curl->get(\"projects?archived={$archived}{$opt_fields}\");\r\n ...
[ "def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
@param integer $layoutId @return bool
[ "public function setDefaultLayout($layoutId): bool\n {\n $layout = new LayoutRecord();\n $layout->id = $layoutId;\n $layout->name = 'Default';\n $layout->isDefault = true;\n\n return $layout->save();\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// AssertType makes sure the sentence's type matches the provided one.
[ "func (p *parser) AssertType(typ string) {\n\tif p.Type != typ {\n\t\tp.SetErr(\"type\", p.Type)\n\t}\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 Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Read the band in native blocks.
[ "def read_band_blocks(self, blocksize=CHUNK_SIZE):\n \"\"\"\"\"\"\n # For sentinel 1 data, the block are 1 line, and dask seems to choke on that.\n band = self.filehandle\n\n shape = band.shape\n token = tokenize(blocksize, band)\n name = 'read_band-' + token\n dskx ...
[ "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:" }
// HasAskForMore returns true if a value for AskForMore has been set in this context
[ "func HasAskForMore(ctx context.Context) bool {\n\t_, ok := ctx.Value(ctxKeyAskForMore).(bool)\n\treturn ok\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Overide virtual methods for this extension. `this` : is this Fancytree object `this._super`: the virtual function that was overridden (member of prev. extension or Fancytree)
[ "function(ctx){\n\t\tvar tree = ctx.tree;\n\n\t\t// Bind init-handler to apply cookie state\n\t\ttree.$div.bind(\"fancytreeinit\", function(event){\n\t\t\ttree.debug(\"COOKIE \" + document.cookie);\n\t\t});\n\t\t// Init the tree\n\t\tthis._super(ctx);\n\t}" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Creates the x-axis and y-axis with proper orientations @return {void} @private
[ "function buildAxis() {\n xAxis = d3Axis.axisBottom(xScale)\n .ticks(xTicks)\n .tickPadding(tickPadding)\n .tickFormat(d3Format.format(xAxisFormat));\n\n yAxis = d3Axis.axisLeft(yScale)\n .ticks(yTicks)\n .tickPadding(t...
[ "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 sentence about mathematics:", "pos": "Represent the Github code about mathematics:", "neg": "Represent the Github code:" }
Retrieves a file entry for a path specification. Args: path_spec (PathSpec): path specification. Returns: BDEFileEntry: file entry or None.
[ "def GetFileEntryByPathSpec(self, path_spec):\n \n return bde_file_entry.BDEFileEntry(\n self._resolver_context, self, path_spec, is_root=True, is_virtual=True)" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Creates EETData object from array received from API @param $array @return EETData
[ "static function fromArray($array) {\n\n\t\t$data = new EETData();\n\n\t\tforeach (self::$keyNames as $key) {\n\t\t\tif (array_key_exists($key, $array)) {\n\t\t\t\t$data->$key = $array[$key];\n\t\t\t}\n\t\t}\n\n\t\t$data->rawData = $array;\n\n\t\treturn $data;\n\n\t}" ]
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// safeArrayAllocDescriptorEx allocates SafeArray. // // AKA: SafeArrayAllocDescriptorEx in Windows API.
[ "func safeArrayAllocDescriptorEx(variantType VT, dimensions uint32) (*SafeArray, error) {\n\treturn nil, NewError(E_NOTIMPL)\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Pass through to provider BookAdminSession.get_book_form_for_update
[ "def get_book_form(self, *args, **kwargs):\n \"\"\"\"\"\"\n # Implemented from kitosid template for -\n # osid.resource.BinAdminSession.get_bin_form_for_update_template\n # This method might be a bit sketchy. Time will tell.\n if isinstance(args[-1], list) or 'book_record_types' i...
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NewFileSystemAPIServer ...
[ "func NewFileSystemAPIServer(store store.GroupStore) *FileSystemAPIServer {\n\ts := new(FileSystemAPIServer)\n\ts.gstore = store\n\treturn s\n}" ]
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github description about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code about File management:" }
Perform an HTTP request
[ "def request(method, path, options, format)\n begin\n response = connection(format).send(method) do |request|\n case method.to_sym\n when :get, :delete\n request.url(formatted_path(path, format), options)\n when :post, :put\n request.path = formatted_path...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return the route url to call with bindings from configuration files. @param $route @return string
[ "protected function getRouteUrlWithBindings($route)\r\n\t{\r\n\t\t$urlRouteBindings = [];\r\n\t\t$urlInjectedBindings = [];\r\n\r\n\t\t$routeAction = $route->getAction();\r\n\t\tif (isset($routeAction['as'])) {\r\n\t\t\tif (isset($this->profile['api_calls_bindings'])) {\r\n\t\t\t\tforeach ($this->profile['api_calls...
[ "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 sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// ValidatePostCtx will confirm Post content length is valid.
[ "func (iapi *InsightApi) ValidatePostCtx(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tcontentLengthString := r.Header.Get(\"Content-Length\")\n\t\tcontentLength, err := strconv.Atoi(contentLengthString)\n\t\tif err != nil {\n\t\t\twriteInsightError...
[ "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 comment about Go programming language:", "pos": "Represent the Github code about Go programming language:", "neg": "Represent the Github code about programming:" }
Returns the calendar week number (1-53).
[ "def cweek\n start = Date.civil(year, 1, 1)\n ((jd - start.jd + start.cwday - 5) / 7.0).ceil\n end" ]
[ "def get_victoria_day(self, year):\n \n may_24th = date(year, 5, 24)\n # Since \"MON(day) == 0\", it's either the difference between MON and the\n # current weekday (starting at 0), or 7 days before the May 24th\n shift = may_24th.weekday() or 7\n victoria_day = may_24th - ...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Process a JSONP request by evaluating the mocked response text
[ "function processJsonpRequest( requestSettings, mockHandler, origSettings ) {\n\t\t// Synthesize the mock request for adding a script tag\n\t\tvar callbackContext = origSettings && origSettings.context || requestSettings,\n\t\t\tnewMock = null;\n\n\n\t\t// If the response handler on the moock is a function, call it...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github description about software development:", "pos": "Represent the Github code about software development:", "neg": "Represent the Github code about programming:" }
Creates a new keystore for the izou aes key @param fileName the path to the keystore @param password the password to use with the keystore @return the newly created keystore
[ "private KeyStore createKeyStore(String fileName, String password) {\n File file = new File(fileName);\n KeyStore keyStore = null;\n try {\n keyStore = KeyStore.getInstance(\"JCEKS\");\n if (file.exists()) {\n keyStore.load(new FileInputStream(file), passwo...
[ "def get_kafka_ssl_context():\n \n # NOTE: We assume that Kafka environment variables are present. If using\n # Apache Kafka on Heroku, they will be available in your app configuration.\n #\n # 1. Write the PEM certificates necessary for connecting to the Kafka brokers to physical\n # files. The ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Gets specified object @param {string} name Object name @returns {*} Specified object @throws {Error} if specified object does not exist @this {Injector}
[ "function(name) {\n this._checkObject(name);\n\n if (!this._hasObject([name])) {\n this._setObject([name], this._getObjectCreator([name]).call())._removeObjectCreator([name]);\n }\n return this._ge...
[ "function checkDefined(key) {\n //noinspection JSPotentiallyInvalidUsageOfThis\n if (! data[`${this.moduleName}.${key}`] && typeof parent.get(key) !== 'undefined' && ! util.squelch()) {\n // Not allowing sub-modules to name variables already defined in the parent (unless using o...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }