query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// Convert_v1_PodSecurityPolicyReviewStatus_To_security_PodSecurityPolicyReviewStatus is an autogenerated conversion function.
[ "func Convert_v1_PodSecurityPolicyReviewStatus_To_security_PodSecurityPolicyReviewStatus(in *v1.PodSecurityPolicyReviewStatus, out *security.PodSecurityPolicyReviewStatus, s conversion.Scope) error {\n\treturn autoConvert_v1_PodSecurityPolicyReviewStatus_To_security_PodSecurityPolicyReviewStatus(in, out, s)\n}" ]
[ "func init() {\n\t// Milo is only responsible for validating the config matching the instance's\n\t// appID in a project config.\n\tvalidation.Rules.Add(\"regex:projects/.*\", \"${appid}.cfg\", validateProjectCfg)\n\tvalidation.Rules.Add(\"services/${appid}\", globalConfigFilename, validateServiceCfg)\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Close closes gzip writer and file
[ "func (f *gzipWriter) Close() error {\n\tvar errors []error\n\tif f.Writer != nil {\n\t\terrors = append(errors, f.Writer.Close())\n\t\tf.Writer.Reset(ioutil.Discard)\n\t\twriterPool.Put(f.Writer)\n\t\tf.Writer = nil\n\t}\n\tif f.file != nil {\n\t\terrors = append(errors, f.file.Close())\n\t\tf.file = nil\n\t}\n\tr...
[ "def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Returns a Calendarobject to a given dateString in the Format 'DATEFORMAT'. If the given String is of the wrong format, null is returned. @see XLinkUtils#DATEFORMAT
[ "public static Calendar dateStringToCalendar(String dateString) {\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat formatter = new SimpleDateFormat(XLinkConstants.DATEFORMAT);\n try {\n calendar.setTime(formatter.parse(dateString));\n } catch (Exception ex) {\n...
[ "def _evalDateStd(self, datetimeString, sourceTime):\n \n s = datetimeString.strip()\n sourceTime = self._evalDT(datetimeString, sourceTime)\n\n # Given string is in the format 07/21/2006\n return self.parseDate(s, sourceTime)" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
*interned*: there is only one per InetAddress.
[ "public static final H2ONode intern( H2Okey key ) {\n H2ONode h2o = INTERN.get(key);\n if( h2o != null ) return h2o;\n final int idx = UNIQUE.getAndIncrement();\n h2o = new H2ONode(key,idx);\n H2ONode old = INTERN.putIfAbsent(key,h2o);\n if( old != null ) return old;\n synchronized(H2O.class) {...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Starts to capture @param integer $timestamp Last modified timestamp @param integer $ttl Time to live in seconds @return void
[ "public function configure($timestamp, $ttl)\n {\n if ($this->isModified($timestamp)) {\n $this->appendLastModified($timestamp, $ttl);\n } else {\n $this->appendNotModified($ttl);\n }\n }" ]
[ "public function setDirectives($directives)\n {\n parent::setDirectives($directives);\n $lifetime = $this->getLifetime(false);\n if ($lifetime > 2592000) {\n // #ZF-3490 : For the memcached backend, there is a lifetime limit of 30 days (2592000 seconds)\n $this->_log('m...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Merge implements Element.Merge
[ "func (e EmptyElement) Merge(v Strategy) (Result, error) {\n\treturn v.MergeEmpty(e)\n}" ]
[ "protected List<List<Row<I>>> incorporateCounterExample(DefaultQuery<I, D> ce) {\n return ObservationTableCEXHandlers.handleClassicLStar(ce, table, oracle);\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// TxHeight gives the block height of the transaction id specified
[ "func (db *WiredDB) TxHeight(txid *chainhash.Hash) (height int64) {\n\ttxraw, err := db.client.GetRawTransactionVerbose(txid)\n\tif err != nil {\n\t\tlog.Errorf(\"GetRawTransactionVerbose failed for: %v\", txid)\n\t\treturn 0\n\t}\n\theight = txraw.BlockHeight\n\treturn\n}" ]
[ "public static long createFileId(long containerId) {\n long id = BlockId.createBlockId(containerId, BlockId.getMaxSequenceNumber());\n if (id == INVALID_FILE_ID) {\n // Right now, there's not much we can do if the file id we're returning is -1, since the file\n // id is completely determined by the ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
&lambda;<sub>1</sub> controls the L<sub>1</sub> regularization penalty. @param lambda1 the L<sub>1</sub> regularization penalty to use
[ "public void setLambda1(double lambda1)\n {\n if(lambda1 < 0 || Double.isNaN(lambda1) || Double.isInfinite(lambda1))\n throw new IllegalArgumentException(\"Lambda1 must be non-negative, not \" + lambda1);\n this.lambda1 = lambda1;\n }" ]
[ "def _compute_focal_depth_term(self, C, hypo_depth):\n \n # p. 901. \"(i.e, depth is capped at 125 km)\".\n focal_depth = hypo_depth\n if focal_depth > 125.0:\n focal_depth = 125.0\n\n # p. 902. \"We used the value of 15 km for the\n # depth coefficient hc ...\"....
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Decode a list of tokens to a unicode string. Args: tokens: a list of Unicode strings Returns: a unicode string
[ "def decode(tokens):\n \n token_is_alnum = [t[0] in _ALPHANUMERIC_CHAR_SET for t in tokens]\n ret = []\n for i, token in enumerate(tokens):\n if i > 0 and token_is_alnum[i - 1] and token_is_alnum[i]:\n ret.append(u\" \")\n ret.append(token)\n return \"\".join(ret)" ]
[ "def _set_text(self, value):\n \n working_index = self.working_index\n working_lines = self._working_lines\n\n original_value = working_lines[working_index]\n working_lines[working_index] = value\n\n # Return True when this text has been changed.\n if len(value) != l...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Toggle the "enabled"-state of the Cache. <p>Returns the previous "enabled"-state of the Cache.</p> @param boolean $state @return boolean
[ "public final function enable($state = true){\n\n\t\t$old_state = $this->_enabled;\n\n\t\t$this->_enabled = (bool) $state;\n\n\t\treturn $old_state;\n\t}" ]
[ "public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }" ]
codesearchnet
{ "query": "Represent the comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
Process basic constraints extension. @param Certificate $cert @throws PathValidationException
[ "private function _processBasicContraints(Certificate $cert)\n {\n if ($cert->tbsCertificate()->version() == TBSCertificate::VERSION_3) {\n $extensions = $cert->tbsCertificate()->extensions();\n if (!$extensions->hasBasicConstraints()) {\n throw new PathValidationExcep...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
プロパティファイルから取得する。 <p>プロパティ名を補完する。 @param path プロパティファイルのパス名 @param allowedNoDefault デフォルトのメッセージがない場合を許可するかどうか。 @param appendUserResource クラスパスのルートにあるユーザ定義のメッセージソースも読み込むかどうか指定します。 @return
[ "private MessageResource loadDefaultResource(final boolean allowedNoDefault, final boolean appendUserResource) {\r\n\r\n final String path = getPropertyPath();\r\n Properties props = new Properties();\r\n try {\r\n props.load(new InputStreamReader(MessageResolver.class.getResourceAsS...
[ "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 Github description about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about Software development:" }
com/dyuproject/protostuff/parser/ProtoParser.g:641:1: ignore_block : LEFTCURLY ( ignore_block_body )* RIGHTCURLY ;
[ "public final ProtoParser.ignore_block_return ignore_block() throws RecognitionException {\n ProtoParser.ignore_block_return retval = new ProtoParser.ignore_block_return();\n retval.start = input.LT(1);\n\n Object root_0 = null;\n\n Token LEFTCURLY166=null;\n Token RIGHTCURLY168=n...
[ "def get_hgvs_language() -> ParserElement:\n \"\"\"\"\"\"\n hgvs = (variant_characters | quote)(IDENTIFIER)\n language = variant_tags + nest(hgvs)\n return language" ]
codesearchnet
{ "query": "Represent the comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Skip over any whitespace characters that are permitted on a given line (i.e. all except newlines), starting from a given index and returning the first index passed any whitespace encountered.
[ "private int skipLineSpace(int index) {\n\t\twhile (index < tokens.size() && isLineSpace(tokens.get(index))) {\n\t\t\tindex++;\n\t\t}\n\t\treturn index;\n\t}" ]
[ "def DocToHelp(doc):\n \"\"\"\"\"\"\n\n # Get rid of starting and ending white space. Using lstrip() or even\n # strip() could drop more than maximum of first line and right space\n # of last line.\n doc = doc.strip()\n\n # Get rid of all empty lines.\n whitespace_only_line = re.compile('^[ \\t]+$', re.M)\n ...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Reorders items with values of sortAttribute begin from zero. @param bool $middle @return integer @throws \Exception
[ "public function reorder($middle = true)\n {\n $result = 0;\n \\Yii::$app->getDb()->transaction(function () use (&$result, $middle) {\n $list = $this->getQueryInternal()\n ->select($this->owner->primaryKey())\n ->orderBy([$this->sortAttribute => SORT_ASC])\n...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Creates an BinaryString that contains `length` spaces.
[ "public static BinaryString blankString(int length) {\n\t\tbyte[] spaces = new byte[length];\n\t\tArrays.fill(spaces, (byte) ' ');\n\t\treturn fromBytes(spaces);\n\t}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about 32-bit integers:", "pos": "Represent the Github code about 32-bit integers:", "neg": "Represent the Github code about programming:" }
Get the vsphere object associated with a given text name or MOID
[ "def get_obj(self, vimtype, name, return_all=False, path=\"\"):\n \"\"\"\"\"\"\n obj = list()\n if path:\n obj_folder = self.content.searchIndex.FindByInventoryPath(path)\n container = self.content.viewManager.CreateContainerView(\n obj_folder, vimtype, True...
[ "func (c StatusSetCmd) Info() *cmd.Info {\n\treturn jujucmd.Info(&cmd.Info{\n\t\tName: StatusSetCmdName,\n\t\tArgs: \"<class> <id> <status>\",\n\t\tPurpose: \"update the status of a payload\",\n\t\tDoc: `\n\"payload-status-set\" is used to update the current status of a registered payload.\nThe <class> and <i...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// selectFields generates comma separated field names string
[ "func selectFields(val interface{} /*, opts Options*/) (statement string) {\n\tfields := structs.ListExportedFields(val, cqlExported)\n\tret := bytes.Buffer{}\n\tfirst := true\n\tfor _, field := range fields {\n\t\tfieldName, exported := fieldName(field)\n\t\tif exported {\n\t\t\tif first {\n\t\t\t\tfirst = false\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 sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
[TARGET commit()]
[ "public Key commit() {\n Datastore datastore = transaction.getDatastore();\n // [START commit]\n // create an entity\n KeyFactory keyFactory = datastore.newKeyFactory().setKind(\"MyKind\");\n Key key = datastore.allocateId(keyFactory.newKey());\n Entity entity = Entity.newBuilder(key).set(\"descri...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get the current user's roles of the application. If the user is a guest, empty array should be returned. @return array
[ "public function roles()\n {\n $user = $this->user();\n $userId = 0;\n is_null($user) || $userId = $user->getAuthIdentifier();\n $roles = Arr::get($this->userRoles, \"{$userId}\", []);\n if (empty($roles)) {\n $roles = $this->getUserRolesFromEventDispatcher($user,...
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Send a request to get cipher keys from an user. @param $number Phone number of the user you want to get the cipher keys.
[ "public function sendGetCipherKeysFromUser($numbers, $replaceKey = false)\n {\n if (!is_array($numbers)) {\n $numbers = [$numbers];\n }\n\n $this->replaceKey = $replaceKey;\n $msgId = $this->nodeId['cipherKeys'] = $this->createIqId();\n\n $userNode = [];\n for...
[ "def usage() -> None:\n \n\n print()\n print('Usage: setnym.py <config-ini>')\n print()\n print('where <config-ini> represents the path to the configuration file.')\n print()\n print('The operation submits a nym to a trustee anchor to send to the ledger,')\n print('if the ledger does not hav...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// GetAWSServiceCatalogPortfolioShareWithName retrieves all AWSServiceCatalogPortfolioShare items from an AWS CloudFormation template // whose logical ID matches the provided name. Returns an error if not found.
[ "func (t *Template) GetAWSServiceCatalogPortfolioShareWithName(name string) (*resources.AWSServiceCatalogPortfolioShare, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *resources.AWSServiceCatalogPortfolioShare:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\tret...
[ "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 post about Cloud Foundry API:", "pos": "Represent the code about Cloud Foundry API:", "neg": "Represent the code about Software development:" }
Button callback to show the file selector
[ "@Override\n public void actionPerformed(ActionEvent e) {\n // Use a new JFileChooser. Inconsistent behaviour otherwise!\n final JFileChooser fc = new JFileChooser(new File(\".\"));\n if(param.isDefined()) {\n fc.setSelectedFile(param.getValue());\n }\n\n if(e.getSource() == button) {\n in...
[ "function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// New client func
[ "func NewClient(name string, b func(...client.Option) client.Client) Option {\n\treturn func(o *Options) {\n\t\to.Clients[name] = b\n\t}\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return True if the field can be serialized into a JSON doc.
[ "def _is_field_serializable(self, field_name):\n \"\"\"\"\"\"\n return (\n self._meta.get_field(field_name).get_internal_type()\n in self.SIMPLE_UPDATE_FIELD_TYPES\n )" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// SetSnapshotCreateTime sets the SnapshotCreateTime field's value.
[ "func (s *DBSnapshot) SetSnapshotCreateTime(v time.Time) *DBSnapshot {\n\ts.SnapshotCreateTime = &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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Marshall the given parameter object.
[ "public void marshall(ListRecoveryPointsByResourceRequest listRecoveryPointsByResourceRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (listRecoveryPointsByResourceRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\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 Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// ResourceInstance returns the state for the resource instance with the given // address within the receiving module state, or nil if the requested instance // is not tracked in the state.
[ "func (ms *Module) ResourceInstance(addr addrs.ResourceInstance) *ResourceInstance {\n\trs := ms.Resource(addr.Resource)\n\tif rs == nil {\n\t\treturn nil\n\t}\n\treturn rs.Instance(addr.Key)\n}" ]
[ "function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// NewObserver returns an Oberserver to monitor different statistics from redis
[ "func NewObserver(redisHost, redisPort, redisPassword string, redisDb int64) *Observer {\n\tq := &Observer{\n\t\tredisHost: redisHost,\n\t\tredisPort: redisPort,\n\t\tredisPassword: redisPassword,\n\t\tredisDb: redisDb,\n\t\tStats: make(map[string]*QueueStat),\n\t}\n\tq.redisClient = redis.New...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Load a module Loads a local or npm module. If the module name starts with an . a local module will be loaded. @param {string} module Loads a module @return {any} Returns the loaded module.
[ "function(file) {\n if (require.alias && require.alias[file]) {\n file = require.alias[file];\n }\n\n var module = {\n exports: {},\n file: file\n };\n\n file = require.resolve(this && this.file ? this.file : './', file);\n\n var requireFunc...
[ "function parse_id (id, env) {\n var origin = id;\n\n // commonjs parser could not parse non-literal argument of `require`\n // So, users might pass a null value into `require()`\n id || err('null id');\n\n env || (env = {});\n var map = env.map || {};\n\n // 3 kinds of id:\n // - relative module path\n //...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Setup store specific variables. @param \tool_log\log\manager $manager manager instance.
[ "protected function helper_setup(\\tool_log\\log\\manager $manager) {\n $this->manager = $manager;\n $called = get_called_class();\n $parts = explode('\\\\', $called);\n if (!isset($parts[0]) || strpos($parts[0], 'logstore_') !== 0) {\n throw new \\coding_exception(\"Store $ca...
[ "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 comment about Data management:", "pos": "Represent the code about Data management:", "neg": "Represent the code:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *GetGeoMatchSetInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"GetGeoMatchSetInput\"}\n\tif s.GeoMatchSetId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"GeoMatchSetId\"))\n\t}\n\tif s.GeoMatchSetId != nil && len(*s.GeoMatchSetId) < 1 {\n\t\tinvalidParams.A...
[ "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:" }
// ZipT is the typed version of Zip. // // - resultSelectorFn is of type "func(TFirst,TSecond)TResult" // // NOTE: Zip has better performance than ZipT.
[ "func (q Query) ZipT(q2 Query,\n\tresultSelectorFn interface{}) Query {\n\tresultSelectorGenericFunc, err := newGenericFunc(\n\t\t\"ZipT\", \"resultSelectorFn\", resultSelectorFn,\n\t\tsimpleParamValidator(newElemTypeSlice(new(genericType), new(genericType)), newElemTypeSlice(new(genericType))),\n\t)\n\tif err != n...
[ "@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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Updates the internal client state based on the state received from the server.<p> @param result the result of the last shell command execution
[ "private void updateState(CmsShellCommandResult result) {\n\n m_errorCode = result.getErrorCode();\n m_prompt = result.getPrompt();\n m_exitCalled = result.isExitCalled();\n m_hasError = result.hasError();\n m_echo = result.hasEcho();\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:" }
Optimize cssnano plugin @param {Object} options
[ "function OptimizeCssnanoPlugin(options) {\n this.options = Object.assign({\n sourceMap: false,\n cssnanoOptions: {\n preset: 'default',\n },\n }, options);\n\n if (this.options.sourceMap) {\n this.options.sourceMap = Object.assign(\n {inline: false},\n this.options.sourceMap || {});\n...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// The IsDirExists judges path is directory or not.
[ "func IsDirExists(path string) bool {\n\tfi, err := os.Stat(path)\n\n\tif err != nil {\n\t\treturn os.IsExist(err)\n\t} else {\n\t\treturn fi.IsDir()\n\t}\n\n\tpanic(\"util isDirExists not reached\")\n}" ]
[ "def is_multifile_object_without_children(self, location: str) -> bool:\n \n # (1) Find the base directory and base name\n if isdir(location): # special case: parent location is the root folder where all the files are.\n return len(self.find_multifile_object_children(location)) == 0...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// Timeout returns the current timeout value
[ "func (dt *dynamicTimeout) Timeout() time.Duration {\n\treturn time.Duration(atomic.LoadInt64(&dt.timeout))\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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Applies contrast curve constraint to each population See :func:`vespa.stars.StarPopulation.apply_cc`; all arguments passed to that function for each population.
[ "def apply_cc(self, cc, **kwargs):\n \n if type(cc)==type(''):\n pass\n if cc.name not in self.constraints:\n self.constraints.append(cc.name)\n for pop in self.poplist:\n if not pop.is_specific:\n try:\n pop.apply_cc(cc,...
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github sentence about Writing:", "pos": "Represent the Github code about Writing:", "neg": "Represent the Github code:" }
// SetOutputS3BucketName sets the OutputS3BucketName field's value.
[ "func (s *Command) SetOutputS3BucketName(v string) *Command {\n\ts.OutputS3BucketName = &v\n\treturn s\n}" ]
[ "func NewTarTimeoutError() error {\n\treturn Error{\n\t\tMessage: fmt.Sprintf(\"timeout waiting for tar stream\"),\n\t\tDetails: nil,\n\t\tErrorCode: TarTimeoutError,\n\t\tSuggestion: \"check the Source-To-Image scripts if it accepts tar stream for assemble and sends for save-artifacts\",\n\t}\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
判断是否存在key. @param string $key @return bool
[ "public function has($key)\n {\n $result = $this->load($key);\n return Arr::has(static::$configs[$result[0]], $result[1]);\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
Generate HTMLResponse from UserException @param UserException $exception @param array $values @return \Orpheus\InputController\HTTPController\JSONHTTPResponse
[ "public static function generateFromUserException(UserException $exception, $values=array()) {\n\t\t$code = $exception->getCode();\n\t\tif( !$code ) {\n\t\t\t$code = HTTP_BAD_REQUEST;\n\t\t}\n\t\tif( $exception instanceof UserReportsException ) {\n\t\t\t/* @var $exception UserReportsException */\n\t\t\t$response = ...
[ "public function beforeSend(\\Mmi\\Http\\Request $request)\n {\n //pobranie odpowiedzi\n $response = \\Mmi\\App\\FrontController::getInstance()->getResponse();\n //zmiana contentu\n $response->setContent((new \\Cms\\Model\\ContentFilter($response->getContent()))->getFilteredContent())...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Iterate through the elements of this XElement and invoke the action for each. @param depthFirst do a depth first search? @param action the action to invoke, non-null
[ "public void visit(boolean depthFirst, Consumer<? super XElement> action) {\n Deque<XElement> queue = new LinkedList<>();\n queue.add(this);\n while (!queue.isEmpty()) {\n XElement x = queue.removeFirst();\n action.accept(x);\n if (depthFirst) {\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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Method: loadMapObject Load the GMap and register appropriate event listeners. If we can't load GMap2, then display a warning message.
[ "function() {\n if (!this.type) {\n this.type = G_NORMAL_MAP;\n }\n var mapObject, termsOfUse, poweredBy;\n var cache = OpenLayers.Layer.Google.cache[this.map.id];\n if (cache) {\n // there are already Google layers added to this map\n mapObject = ...
[ "function useRequest() {\n var request = Module['memoryInitializerRequest'];\n var response = request.response;\n if (request.status !== 200 && request.status !== 0) {\n var data = tryParseAsDataURI(Module['memoryInitializerRequestURL']);\n if (data) {\n response = ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Register the service provider. @return void
[ "public function register()\n {\n $this->app->singleton(AreaManager::class, function() {\n $auth = $this->app->make('auth');\n $request = $this->app->make('request');\n $config = (array) config('areas', []);\n\n return new AreaManager($request, $auth, $confi...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Retrieves all current OrganizationType objects
[ "def get_org_types(self):\n \n if not self.client.session_id:\n self.client.request_session()\n\n object_query = \"SELECT Objects() FROM OrganizationType\"\n result = self.client.execute_object_query(object_query=object_query)\n msql_result = result['body'][\"ExecuteMSQ...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github summarization about permissions:", "pos": "Represent the Github code about permissions:", "neg": "Represent the Github code:" }
Pad an ideal/nadir estimate. This is mainly useful for padding the nadir estimated by a payoff table for safety purposes.
[ "def pad(idnad: Tuple[List[float], List[float]], pad_nadir=0.05, pad_ideal=0.0):\n \n ideal, nadir = idnad\n ideal_arr = np.array(ideal)\n nadir_arr = np.array(nadir)\n idnad_range = nadir_arr - ideal_arr\n nadir_arr += pad_nadir * idnad_range\n ideal_arr -= pad_ideal * idnad_range\n return ...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Yield packets until a Close packet is received.
[ "def ReadUntilClose(self):\n \"\"\"\"\"\"\n while True:\n cmd, data = self.ReadUntil(b'CLSE', b'WRTE')\n if cmd == b'CLSE':\n self._Send(b'CLSE', arg0=self.local_id, arg1=self.remote_id)\n break\n if cmd != b'WRTE':\n if cmd...
[ "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 post about Computer Networking:", "pos": "Represent the code about Computer Networking:", "neg": "Represent the code:" }
/*! Creates a new text layer with the text \a $text, font \a $font and adjustment \a $widthAdjustment and \a $heightAdjustment at the angle \a $angle and returns it.
[ "static function createForText( $text, &$font, $widthAdjustment, $heightAdjustment, $angle,\n $absoluteWidth = false, $absoluteHeight = false )\n {\n $Return = false;\n if ( !( $font instanceof eZImageFont ) )\n return $Return;\n if ( !function_exists( ...
[ "def y_offset(self, container):\n \"\"\"\"\"\"\n offset = (self.parent.y_offset(container)\\\n if hasattr(self.parent, 'y_offset') else 0)\n if self.is_script(container):\n style = self._style(container)\n offset += (self.parent.height(container) *\n ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create the Tile corresponding to a cell. @param Cell? $cell A cell, or `null`. @return null If `null` is given. @return false If the `$cell` is `WIDE_LEFT` or `TALL_BOTTOM`, or @return Tile The Tile corresponding to the Cell value.
[ "public static function fromCell($cell)\n {\n switch (Cell::toValue($cell)) {\n case null:\n return null;\n case Cell::SMALL:\n return self::SMALL();\n case Cell::TALL_TOP:\n return self::TALL();\n case Cell::WIDE_LEF...
[ "def make_grid_frame(self, event):\n \n if self.grid_frame:\n print('-I- You already have a grid frame open')\n pw.simple_warning(\"You already have a grid open\")\n return\n\n try:\n grid_type = event.GetButtonObj().Name[:-4] # remove '_btn'\n ...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Converts a $value to a persistence value. @param \eZ\Publish\Core\FieldType\Keyword\Value $value @return \eZ\Publish\SPI\Persistence\Content\FieldValue
[ "public function toPersistenceValue(SPIValue $value)\n {\n return new FieldValue(\n array(\n 'data' => null,\n 'externalData' => $value->values,\n 'sortKey' => $this->getSortInfo($value),\n )\n );\n }" ]
[ "protected function getLimitationByIdentifier($identifier)\n {\n switch ($identifier) {\n case APILimitation::CONTENTTYPE:\n return new \\eZ\\Publish\\API\\Repository\\Values\\User\\Limitation\\ContentTypeLimitation();\n\n case APILimitation::LANGUAGE:\n ...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Call the middleware stack. @param string $id @param Request|Response $owner @return Request|Response $result @throws InvalidConfigException @throws InvalidValueException
[ "public function callMiddleware($id, $owner)\n {\n if ($owner->freezed) {\n return $owner;\n }\n\n $class = get_class($owner);\n foreach ($owner->middleware as $definition) {\n $middleware = make($definition);\n if (!$middleware instanceof MiddlewareCo...
[ "private function handleErrorUnit(Invoke\\Error $unit): Result\\AbstractResult\n {\n return new Result\\Error(null, $unit->getBaseException());\n }" ]
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:" }
@param string $recipientOrPhone @param string $typingIndicator @return array
[ "public static function createForTyping($recipientOrPhone, $typingIndicator) {\n $options = [];\n $data = [\n 'recipient' => self::createRecipientField($recipientOrPhone),\n 'sender_action' => $typingIndicator,\n ];\n $options[RequestOptions::JSON] = $data;\n\n ...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the description about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
// Info mocks base method
[ "func (m *MockCloud) Info() (cloud.CpiInfo, error) {\n\tret := m.ctrl.Call(m, \"Info\")\n\tret0, _ := ret[0].(cloud.CpiInfo)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Create an Amp\Artax\Request object from the operation. @return \Amp\Artax\Request
[ "public function createRequest() {\n $request = new \\Amp\\Artax\\Request();\n $url = null;\n $request->setMethod('');\n\n\n\n //Parameters are parsed and set, lets prepare the request\n if ($url == null) {\n $url = \"https://api.github.com\";\n }\n $reque...
[ "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 Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Load the Response with the provided XML string (not base64 encoded) @param ssoService Maestrano ssOSsoService @param String xml response provided by the SAML idp
[ "public static Response loadFromXML(Sso ssoService, String xml) throws CertificateException, ParserConfigurationException, SAXException, IOException {\n\t\treturn new Response(ssoService.getSamlSettings().getIdpCertificate(), xml);\n\t}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Process an array of commands. @param string|array $commands @return array
[ "public function processCommands($commands)\n {\n $separator = $this->environment->getSeparator();\n $shell = $this->config->getContextually('remote.shell');\n $shelled = $this->config->getContextually('remote.shelled');\n $sudo = $this->config->getContextually('remote.sudo');\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Convert this attachment to its array representation. @return array
[ "public function toArray()\n {\n return [\n 'fallback' => $this->fallback,\n 'text' => $this->text,\n 'pretext' => $this->preText,\n 'color' => $this->color,\n 'footer' => $this->footer,\n 'mrkdwn_in' => $this->us...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
from interface LogChute
[ "public void log (int level, String message, Throwable t)\n {\n if (isLevelEnabled(level)) {\n _sctx.log(message, t);\n }\n }" ]
[ "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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetAddress sets the Address field's value.
[ "func (s *RelationalDatabaseEndpoint) SetAddress(v string) *RelationalDatabaseEndpoint {\n\ts.Address = &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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Converts input to a Shape. Args: x: Shape, str, or None. Returns: Shape or None. Raises: ValueError: If x cannot be converted to a Shape.
[ "def convert_to_shape(x):\n \n if x is None:\n return None\n if isinstance(x, Shape):\n return x\n if isinstance(x, str):\n x = _parse_string_to_list_of_pairs(x, seconds_to_int=True)\n return Shape(x)" ]
[ "def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret...
codesearchnet
{ "query": "Represent the post about Software Engineering:", "pos": "Represent the code about Software Engineering:", "neg": "Represent the code about programming:" }
Handle directive @return string
[ "public function message($view) : string\n {\n $view = $this->getPath($view);\n $path = self::$views . $view . self::$extension;\n\n if (file_exists($path)) {\n return '<!--%' .base64_encode($view). '%-->' . PHP_EOL . file_get_contents($path);\n }\n else {\n throw new PartialNotFoundExcept...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about Text translation:", "pos": "Represent the code about Text translation:", "neg": "Represent the code:" }
Get content-type from req/res objects. @param {object} @return {Object} @private
[ "function getcontenttype(obj) {\n if (typeof obj.getHeader === 'function') {\n // res-like\n return obj.getHeader('content-type')\n }\n\n if (typeof obj.headers === 'object') {\n // req-like\n return obj.headers && obj.headers['content-type']\n }\n}" ]
[ "function function_ (options) {\n options.hash.kind = 'function'\n var result = ddata._identifier(options)\n return result ? options.fn(result) : 'ERROR, Cannot find function.'\n}" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Read SHEETPR record
[ "private function _readSheetPr()\r\n\t{\r\n\t\t$length = self::_GetInt2d($this->_data, $this->_pos + 2);\r\n\t\t$recordData = substr($this->_data, $this->_pos + 4, $length);\r\n\r\n\t\t// move stream pointer to next record\r\n\t\t$this->_pos += 4 + $length;\r\n\r\n\t\t// offset: 0; size: 2\r\n\r\n\t\t// bit: 6; mas...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Prints the specified error message. @param key The resource bundle key for the message. @param substitutions The values to be substituted for the tokens in the message skeleton.
[ "private void printErrorMessage(String key, Object... substitutions) {\n Tr.error(tc, key, substitutions);\n errorMsgIssued = true;\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 Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Defines an embedded value object collection property. @param string $property @return EmbeddedCollectionDefiner @throws InvalidArgumentException
[ "public function embeddedCollection(string $property): EmbeddedCollectionDefiner\n {\n $this->verifyProperty(__METHOD__, $property);\n\n return $this->relation($property)->asEmbedded()->collection();\n }" ]
[ "public @CheckForNull PropertyType getPropertyType(@Nonnull Object instance, @Nonnull String field) {\n // in global.jelly, instance==descriptor\n return instance==this ? getGlobalPropertyType(field) : getPropertyType(field);\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
parses text to find just the time element of an ISO date/time string i.e. 13:30:45 @param {String} timeString @param {String} format @return {String}
[ "function( timeString, format ) {\n\n\t\t\tthis.setFormat(format);\n\t\t\tthis.clearTime();\n\t\t\tvar parts = [];\n\n\t\t\t// discover date separtor for auto profile // default is ':'\n\t\t\tif(timeString.indexOf(':') === -1) {\n\t\t\t\tthis.autoProfile.tsep = '';\n\t\t\t}\n\n\t\t\t// finds timezone HH:MM:SS and H...
[ "function (value) {\n var date = new Date(value)\n assertErr(!isNaN(date.getTime()), TypeError, 'Field error: value is an invalid Date')\n return date\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Instantiates a ColorGradingTexture from the following parameters. @param url The location of the color gradind data (currently only supporting 3dl) @param scene The scene the texture will be used in
[ "function ColorGradingTexture(url, scene) {\n var _this = _super.call(this, scene) || this;\n if (!url) {\n return _this;\n }\n _this._textureMatrix = BABYLON.Matrix.Identity();\n _this.name = url;\n _this.url = url;\n _this...
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Handle is the handler for MessageDeleteBulk events.
[ "func (eh messageDeleteBulkEventHandler) Handle(s *Session, i interface{}) {\n\tif t, ok := i.(*MessageDeleteBulk); ok {\n\t\teh(s, t)\n\t}\n}" ]
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// DoubleEmphasis is the double emphasis tag callback. Outputs a simple // plain-text version of the input.
[ "func (r renderer) DoubleEmphasis(out *bytes.Buffer, text []byte) {\n\tout.Write(text)\n}" ]
[ "def visit_rule(self, node, rule):\n \"\"\"\"\"\"\n label, equals, expression = rule\n expression.name = label # Assign a name to the expr.\n return expression" ]
codesearchnet
{ "query": "Represent the instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
Finish synchronizing a source that was updated via #start_synchronize. This method returns self if the source is already synchronized. Otherwise it parses the AST and returns a new synchronized Source. @return [Source]
[ "def finish_synchronize\n return self if synchronized?\n synced = Source.new(@code, filename)\n if synced.parsed?\n synced.version = version\n return synced\n end\n synced = Source.new(@repaired, filename)\n synced.error_ranges.concat (error_ranges + last_updater.changes....
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Reset all instance variables to their original state. This method might be useful in cases where a new camera is available, and the application needs to force the plugin to chooseCameras() again.
[ "function destroy(success, error){\n error = null; // should never error\n cancelScan();\n if(mediaStreamIsActive()){\n killActiveMediaStream();\n }\n backCamera = null;\n frontCamera = null;\n var preview = getVideoPreview();\n var still = getImg();\n if(preview){\n preview.rem...
[ "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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Import all files in ./xslt directory
[ "public function updateXSLTs($sourcedir = 'xslt')\n {\n $d = dir($sourcedir);\n while (false !== ($entry = $d->read())) {\n if (($entry[0] != '.') && (substr($entry, -5) == '.xslt')) {\n $importdata = [];\n $importdata['nazev'] = s...
[ "def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetChallengeName sets the ChallengeName field's value.
[ "func (s *RespondToAuthChallengeInput) SetChallengeName(v string) *RespondToAuthChallengeInput {\n\ts.ChallengeName = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Create service @param ServiceLocatorInterface $serviceLocator @return mixed
[ "public function createService(ServiceLocatorInterface $serviceLocator)\n {\n $service = new Environment();\n\n /** @var Client $pmProxyClient */\n $pmProxyClient = $serviceLocator->get('KmbPmProxy\\Client');\n $service->setPmProxyClient($pmProxyClient);\n\n /** @var HydratorIn...
[ "@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 Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Creates a manager to handle autoscale operations.
[ "def _configure_manager(self):\n \n self._manager = ScalingGroupManager(self,\n resource_class=ScalingGroup, response_key=\"group\",\n uri_base=\"groups\")" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// NestedMarshalTo allows a caller to avoid extra allocations during serialization of an Unknown // that will contain an object that implements ProtobufMarshaller.
[ "func (m *Unknown) NestedMarshalTo(data []byte, b ProtobufMarshaller, size uint64) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tdata[i] = 0xa\n\ti++\n\ti = encodeVarintGenerated(data, i, uint64(m.TypeMeta.Size()))\n\tn1, err := m.TypeMeta.MarshalTo(data[i:])\n\tif err != nil {\n\t\treturn 0, err\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Return imported module for the given name.
[ "def my_import(name, path=None):\n \"\"\"\"\"\"\n\n # Documentation for importlib says this may be needed to pick up\n # modules created after the program has started\n if hasattr(importlib, 'invalidate_caches'):\n # python 3.3+\n importlib.invalidate_caches()\n\n if path is not None:\n...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Checks if the current user is allowed @return Boolean
[ "final public function isGranted(array $roles, array $resources, array $modules, array $accesses)\n {\n // Find a user which matches the required roles.\n $user = $this->checkRole($roles);\n\n if (null === $user) {\n return false;\n } else {\n return $this->isUse...
[ "@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 summarization about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code about Programming:" }
A convenience function which pops a key k from source to dest. None values are not passed on. If k already exists in dest an error is raised.
[ "def pop_to(source, dest, key, name=None):\n \n value = source.pop(key, None)\n if value is not None:\n safe_setitem(dest, key, value, name=name)\n return value" ]
[ "def persistent_id(self, obj):\n \"\"\"\"\"\"\n if isinstance(obj, Element):\n # Here, our persistent ID is simply a tuple, containing a tag and\n # a key\n return obj.__class__.__name__, obj.symbol\n else:\n # If obj does not have a persistent ID, re...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Float - For now this is really just a wrapper around `rand.Float64`
[ "func Float(min, max float64) (float64, error) {\n\treturn min + Rnd.Float64()*(max-min), nil\n}" ]
[ "func (m BinaryFloatMapper) ID(fi ...interface{}) (rowIDs []int64, err error) {\n\t// TODO implement (have to redo the Mapper interface to handle slice)\n\treturn []int64{0}, nil\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Text processing:" }
Update looking_for attribute of a Profile.
[ "def update_looking_for(profile_tree, looking_for):\n \n div = profile_tree.xpath(\"//div[@id = 'what_i_want']\")[0]\n looking_for['gentation'] = div.xpath(\".//li[@id = 'ajax_gentation']/text()\")[0].strip()\n looking_for['ages'] = replace_chars(div.xpath(\".//li[@id = 'ajax_ages']/text()\")[0].strip()...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
delete files in dir that match pattern
[ "def _purge(dir, pattern, reason=''):\n \n for f in os.listdir(dir):\n if re.search(pattern, f):\n print \"Purging file {0}. {1}\".format(f, reason)\n os.remove(os.path.join(dir, f))" ]
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
// NewStatic node constructor
[ "func NewStatic(Vars []node.Node) *Static {\n\treturn &Static{\n\t\tFreeFloating: nil,\n\t\tVars: Vars,\n\t}\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// NewCmdConfigUnset returns a Command instance for 'config unset' sub command
[ "func NewCmdConfigUnset(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command {\n\toptions := &unsetOptions{configAccess: configAccess}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"unset PROPERTY_NAME\",\n\t\tDisableFlagsInUseLine: true,\n\t\tShort: i18n.T(\"Unsets an indiv...
[ "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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Networking:" }
class decorator to create "_full_state" methods/properties on the class (so they are valid for all instances created from this class). Parameters ---------- class_with_globalize_methods
[ "def add_full_state_methods(class_with_globalize_methods):\n \n assert hasattr(class_with_globalize_methods, 'active_set')\n assert hasattr(class_with_globalize_methods, 'nstates_full')\n\n for name, method in class_with_globalize_methods.__dict__.copy().items():\n if isinstance(method, property)...
[ "def registration_function_for_optionable(self, optionable_class):\n \"\"\"\"\"\"\n self._assert_not_frozen()\n # TODO(benjy): Make this an instance of a class that implements __call__, so we can\n # docstring it, and so it's less weird than attatching properties to a function.\n def register(*args, ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// ParseProtoAddr parses a Golang network address.
[ "func ParseProtoAddr(protoAddr string) (proto string, addr string, err error) {\n\n\tif emptyRX.MatchString(protoAddr) {\n\t\treturn \"\", \"\", ErrParseProtoAddrRequired\n\t}\n\n\t// If the provided network address does not begin with one\n\t// of the valid network protocols then treat the string as a\n\t// file p...
[ "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 Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
Convert string chart into text markup with the correct attributes. chart -- palette chart as a string convert -- function that converts a single palette entry to an (attr, text) tuple, or None if no match is found
[ "def parse_chart(chart, convert):\n \n out = []\n for match in re.finditer(ATTR_RE, chart):\n if match.group('whitespace'):\n out.append(match.group('whitespace'))\n entry = match.group('entry')\n entry = entry.replace(\"_\", \" \")\n while entry:\n # try t...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Register the box. @return void
[ "public function register() {\n\t\t$builder = $this->get_builder();\n\n\t\t// Sets the builder configures.\n\t\tforeach ( $this->get_builder_config() as $key => $value ) {\n\t\t\t$builder->set_option( $key, $value );\n\t\t}\n\n\t\t( new Loader( $builder ) )->fire();\n\t}" ]
[ "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:" }
// Close increments a counter. If the backing io.Reader is also an io.Closer, // we also try to close it.
[ "func (c *Closer) Close() error {\n\tc.Count++\n\tif cl, ok := c.Reader.(io.Closer); ok {\n\t\treturn cl.Close()\n\t}\n\treturn nil\n}" ]
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
Generate Limit part @param int $limitCount @param int $limitOffset @param string $limit Reference for the resulting query part
[ "public function generateLimit($limitCount, $limitOffset, &$limit)\n {\n $limit = \"\";\n\n if (empty($limitCount)) {\n return;\n }\n\n $limit = \"$limitCount\";\n\n if (! empty($limitOffset)) {\n $limit .= \",$limitOffset\";\n }\n }" ]
[ "@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift...
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Composes success response. @param \yii\db\ActiveRecordInterface $model @return mixed response.
[ "protected function respondSuccess($model)\n {\n if (Yii::$app->request->isAjax) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return [\n 'success' => true\n ];\n }\n\n return $this->controller->redirect($this->createReturnUrl('vie...
[ "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 text about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code about Programming:" }
region > homePage
[ "@Action(\n semantics = SemanticsOf.SAFE\n )\n @HomePage\n public FullCalendar2WicketToDoAppDashboard lookup() {\n return container.newViewModelInstance(FullCalendar2WicketToDoAppDashboard.class, ID);\n }" ]
[ "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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
args: if sql has parameters defined with either %s or %(key)s then args should be a either list or dict of parameter values respectively. returns the insert id
[ "def insertSQL(conn, sql, args=None):\n '''\n \n '''\n with doCursor(conn) as cursor:\n cursor.execute(sql, args)\n id = conn.insert_id()\n return id" ]
[ "def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
pattern处理,若不为正则则调用glob处理生成正则
[ "function normalize(pattern) {\n var type = toString.call(pattern);\n switch (type) {\n case '[object String]':\n return _.glob(pattern);\n case '[object RegExp]':\n return pattern;\n default:\n xgulp.log.error('invalid rege...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about text processing:" }
Parse experiment parameters from the data directory name Args ---- name_exp: str Name of data directory with experiment parameters Returns ------- tag_params: dict of str Dictionary of parsed experiment parameters
[ "def parse_experiment_params(name_exp):\n '''\n '''\n if ('/' in name_exp) or ('\\\\' in name_exp):\n raise ValueError(\"The path {} appears to be a path. Please pass \"\n \"only the data directory's name (i.e. the \"\n \"experiment name)\".format(name...
[ "def _unpack_list(example):\n \n try:\n x = example[0]\n y = example[1]\n meta = None\n return x, y, meta\n except IndexError:\n raise IndicoError(\n \"Invalid input data. Please ensure input data is \"\n \"formatted as a list of `[data, target]` pa...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Resolves path to the internal prototypes. @return string @throws IllegalStateException in case of absence internal prototypes directory
[ "private function reslovePrototypesPath()\n {\n $prototypesPath = $this->prototypesPath;\n\n // fallback\n if (empty($prototypesPath)) {\n $prototypesPath = \\dirname(__DIR__).'/prototypes';\n }\n\n if (!is_dir($prototypesPath) || !is_readable($prototypesPath)) {\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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
return stored data Returns: unpickled data
[ "def data(self):\n \n try:\n bytestream = super(MimeData, self).data(self._mimeType).data()\n return pickle.loads(bytestream)\n except:\n raise" ]
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetNextToken sets the NextToken field's value.
[ "func (s *DescribeConfigRuleEvaluationStatusOutput) SetNextToken(v string) *DescribeConfigRuleEvaluationStatusOutput {\n\ts.NextToken = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// Returns a key, val... for a line..
[ "func getKeyVal(s string) (key, value string) {\n\tp := strings.SplitN(s, keySep, 2)\n\treturn p[0], icsReplacer.Replace(p[1])\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 description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
{@inheritdoc} @throws \InvalidArgumentException
[ "public function process(ContainerBuilder $container)\n {\n if (!$container->hasDefinition(TaggedServices::class)) {\n return;\n }\n\n $manager = $container->getDefinition(TaggedServices::class);\n\n $definitions = $container->getDefinitions();\n foreach ($definition...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }