query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Drop the first n elements of the sequence.
>>> seq([1, 2, 3, 4, 5]).drop(2)
[3, 4, 5]
:param n: number of elements to drop
:return: sequence without first n elements | [
"def drop(self, n):\n \n if n <= 0:\n return self._transform(transformations.drop_t(0))\n else:\n return self._transform(transformations.drop_t(n))"
] | [
"def iterintervals(self, n=2):\n \n # tee the original iterator into n identical iterators\n streams = tee(iter(self), n)\n\n # advance the \"cursor\" on each iterator by an increasing\n # offset, e.g. if n=3:\n #\n # [a, b, c, d, e, f, ..., w, x, y... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Gets the busname of the topicspace that the subscription was made through
@return | [
"public String getTopicSpaceBusName()\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n {\n SibTr.entry(this, tc, \"getTopicSpaceBusName\");\n SibTr.exit(this, tc, \"getTopicSpaceBusName\", topicSpaceBusName);\n }\n return topicSpaceBusName... | [
"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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(StopLabelingJobRequest stopLabelingJobRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (stopLabelingJobRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Check if read offsets are valid (positive). | [
"def check_read_offsets(read_offsets):\n \"\"\"\"\"\"\n for read_offset in read_offsets:\n if read_offset < 0:\n msg = 'Read offset must be 0 or greater'\n log.error(msg)\n raise ArgumentError(msg)"
] | [
"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:"
} |
// Sets up the outputMap with all known URL Scheme parsers. | [
"func lockedSetupOutputMap() {\n\tnewOutputFuncMap = make(map[string]NewOutputFunc, 100)\n\tnewOutputFuncMap[\"stdout\"] = newOutputFuncStdout\n\tnewOutputFuncMap[\"stderr\"] = newOutputFuncStderr\n\tnewOutputFuncMap[\"file\"] = newOutputFuncFile\n\tnewOutputFuncMap[\"fd\"] = newOutputFuncFd\n\tnewOutputFuncMap[\"d... | [
"@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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@param string $image
@return string | [
"public function imagePath($image)\n {\n if (!$image) {\n return '';\n }\n\n $parts = explode(';', $image);\n $fileId = $parts[0];\n\n // deliver original file\n $src = $this->router->generate('frontendmedia_inline', ['fileId' => $fileId], UrlGeneratorInterfac... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
@param string $name
@param $value
@return bool|int|\WP_Error | [
"public function update( string $name, $value ) {\n\t\tif ( $this->_user->$name ) {\n\t\t\treturn wp_update_user( [\n\t\t\t\t'ID' => $this->ID,\n\t\t\t\t$name => $value\n\t\t\t] );\n\t\t} elseif ( $this->$name ) {\n\t\t\treturn update_field( $name, $value, $this->_key );\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}"
] | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@param \BiberLtd\Bundle\FileManagementBundle\Entity\FileUploadFolder $folder
@return $this | [
"public function setFolder(FileUploadFolder $folder) {\r\n if(!$this->setModified('folder', $folder)->isModified()) {\r\n return $this;\r\n }\r\n $this->folder = $folder;\r\n return $this;\r\n }"
] | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// GetIPs returns the IP addresses of the Azure VM instance. | [
"func (vm *VM) GetIPs() ([]net.IP, error) {\n\tips := make([]net.IP, 2)\n\n\t// Set up the auth token.\n\ttok, err := getServicePrincipalToken(&vm.Creds, azure.PublicCloud.ResourceManagerEndpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tauthorizer := autorest.NewBearerAuthorizer(tok)\n\n\t// Get the Public ... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
从流中读取内容,读到输出流中
@param in 输入流
@return 输出流
@throws IORuntimeException IO异常 | [
"public static FastByteArrayOutputStream read(InputStream in) throws IORuntimeException {\r\n\t\tfinal FastByteArrayOutputStream out = new FastByteArrayOutputStream();\r\n\t\tcopy(in, out);\r\n\t\treturn out;\r\n\t}"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the sentence about API documentation:",
"pos": "Represent the code about API documentation:",
"neg": "Represent the code about programming:"
} |
Recursively lists all files in a file system below 'path'. | [
"def get_file_list(path):\n \n f_list = []\n def recur_dir(path, newpath = os.path.sep):\n files = os.listdir(path)\n for fle in files:\n f_path = cpjoin(path, fle)\n if os.path.isdir(f_path): recur_dir(f_path, cpjoin(newpath, fle))\n elif os.path.isfile(f_pat... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Prevent student updates to this submission.
Uses url parameter userid.
@param int $userid
@return void | [
"protected function process_lock_submission($userid = 0) {\n\n require_sesskey();\n\n if (!$userid) {\n $userid = required_param('userid', PARAM_INT);\n }\n\n return $this->lock_submission($userid);\n }"
] | [
"public function upgradeDatabase()\n {\n $this->refreshDatabaseTables([\n 'FailedLoginAttempts',\n 'LoginControlIpRanges',\n ]);\n $this->connection->executeQuery('DROP TABLE IF EXISTS SignupRequests');\n $this->connection->executeQuery('DROP TABLE IF EXISTS User... | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// EqualTo returns true if headers are equivalent, false otherwise. | [
"func (header *Header) EqualTo(q *Header) bool {\n\tif header == nil || q == nil {\n\t\treturn false\n\t}\n\tif header.Command.IsLocal() {\n\t\treturn true\n\t}\n\treturn header.TransportProtocol == q.TransportProtocol &&\n\t\theader.SourceAddress.String() == q.SourceAddress.String() &&\n\t\theader.DestinationAddre... | [
"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 comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
公钥验证签名
@param data
@param sign
@param publicKey
@return
@throws Exception | [
"public static boolean checkByPublicKey(String data, String sign, String publicKey) throws Exception {\n\t\tKeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n\t\tbyte[] encodedKey = base64.decode(publicKey);\n\t\tPublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey));\n\t\tjava.sec... | [
"public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {\n String[] arr = nsAtZealotId.split(ZealotConst.SP_AT);\n if (arr.length != LEN) {\n throw new ValidFailException(\"nsAtZealotId参数的值必须是xml文件中的 nameSpace + '@@' + zealotId 节点的值,\"\n + \"如:'stu... | codesearchnet | {
"query": "Represent the instruction about Encryption:",
"pos": "Represent the code about Encryption:",
"neg": "Represent the code about Software Development:"
} |
List entities attached to the given role.
CLI Example:
.. code-block:: bash
salt myminion boto_iam.list_entities_for_policy mypolicy | [
"def list_attached_role_policies(role_name, path_prefix=None, entity_filter=None,\n region=None, key=None, keyid=None, profile=None):\n '''\n \n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n params = {'RoleName': role_name}\n if path_prefix is no... | [
"def delete_ec2_role(self, role, mount_point='aws-ec2'):\n \n return self._adapter.delete('/v1/auth/{0}/role/{1}'.format(mount_point, role))"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
One of ways of creating builder. This is possibly the least verbose way where compiler should be able to guess the generic parameters. | [
"@Nonnull\n\tpublic static <T> LToLongFunction<T> toLongFunctionFrom(Consumer<LToLongFunctionBuilder<T>> buildingFunction) {\n\t\tLToLongFunctionBuilder builder = new LToLongFunctionBuilder();\n\t\tbuildingFunction.accept(builder);\n\t\treturn builder.build();\n\t}"
] | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
password_confirmation check | [
"def validate_password2(self, value):\n \n if value != self.initial_data['password1']:\n raise serializers.ValidationError(_('Password confirmation mismatch'))\n return value"
] | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Register the service providers under the "register" call
@param Repository $config | [
"protected function registerServiceProviders(Repository $config)\n {\n foreach ($this->getComponentsFromConfig($config, 'register', getenv('APP_ENV')) as $provider) {\n $this->app->register($provider);\n\n $config->push('app.providers', $provider);\n }\n }"
] | [
"def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Grows the vector to a new size and initializes the new elements with a given value.
@param size the new size
@param pad the value for new elements | [
"public void growTo(int size, boolean pad) {\n if (this.size >= size)\n return;\n this.ensure(size);\n for (int i = this.size; i < size; i++)\n this.elements[i] = pad;\n this.size = size;\n }"
] | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Encode the specified string using the current charset
@param string $text String to encode
@return string Encoded string | [
"protected function _encode($text)\n {\n $restore = mb_internal_encoding();\n mb_internal_encoding($this->_appCharset);\n if (empty($this->headerCharset)) {\n $this->headerCharset = $this->charset;\n }\n $return = mb_encode_mimeheader($text, $this->headerCharset, 'B'... | [
"protected function makeKeyString($key): string {\n //convert numbers to strings.\n $stringValue = (string)$key;\n $length = strlen( $stringValue );\n if( $length == 0 ){\n throw new \\Exception(\"Key values must be string values of at least 1 character. Empty strings cannot b... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about AWS S3:"
} |
// Validate checks the field values on Rds with the rules defined in the proto
// definition for this message. If any rules are violated, an error is returned. | [
"func (m *Rds) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t{\n\t\ttmp := m.GetConfigSource()\n\n\t\tif v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {\n\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\treturn RdsValidationError{\n\t\t\t\t\tfield: \"ConfigSource\",\n\t\t\t\t\t... | [
"function DataModelMigration() {\n /**\n * Gets an array that contains the definition of fields that are going to be added\n * @type {Array}\n */\n this.add = [];\n /**\n * Gets an array that contains a collection of constraints which are going to be added\n * @type {Array}\n */\n ... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Alias for {@link Query::table()} and {@link Select::columns()}
@param mixed $table
@param mixed $columns
@return $this | [
"public function from($table, $columns = null)\n {\n $this->table($table);\n if( !empty($columns) ) {\n $this->columns($columns);\n }\n return $this;\n }"
] | [
"public function asEmbedded() : EmbeddedRelationTypeDefiner\n {\n return new EmbeddedRelationTypeDefiner($this->definition, $this->orm, $this->accessor, $this->callback);\n }"
] | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Executes "GetExpressCheckoutDetails" and on SUCCESS response - saves
user information and redirects to order page, on failure - sets error
message and redirects to basket page
@return string | [
"public function getExpressCheckoutDetails()\n {\n $basket = $this->getSession()->getBasket();\n\n try {\n $payPalService = $this->getPayPalCheckoutService();\n $builder = oxNew(\\OxidEsales\\PayPalModule\\Model\\PayPalRequest\\GetExpressCheckoutDetailsRequestBuilder::class);\... | [
"public function ModuleInitHook()\n {\n parent::ModuleInitHook();\n $oShop = TdbShop::GetInstance();\n if ($oShop->fieldRedirectToNotFoundPageProductSearchOnNoResults) {\n // in this case the shop may redirect after running the search. since this occurs in the Execute of the modul... | codesearchnet | {
"query": "Represent the sentence about e-commerce:",
"pos": "Represent the code about e-commerce:",
"neg": "Represent the code about programming:"
} |
{@inheritdoc}
@param string $scopesString | [
"public function scopeExists($scopesString)\n {\n $scopes = explode(' ', $scopesString);\n $foundScopes = $this->getScopeDataMapper()->findScopes($scopes);\n $inputScopes = $scopes;\n\n $matches = array_filter($foundScopes, function (Entity\\Scope $scope) use (&$inputScopes) {\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Verifies a hash with a plaintext string using the configurable method. ( main.config -> security.hash )
@param string $string
@param string $hash
@return bool | [
"public static function verify_hash( $string, $hash ) \n\t{\n\t\tif (is_numeric( $algo = ClanCats::$config->get( 'security.hash', 'md5') ))\n\t\t{\n\t\t\treturn password_verify( $string, $hash );\n\t\t}\n\t\treturn ($hash === call_user_func( $algo, $string ));\n\t}"
] | [
"function SHA1(source) { // @arg String - source string\n // @ret SHA1HashHexString\n//{@dev\n $valid($type(source, \"String\"), SHA1, \"source\");\n//}@dev\n\n var sha1 = DataType[\"Array\"][\"toHexStringArray\"](\n SHA1_encode(\n DataType[\"Ui... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Adds a subcontent to the collection.
@param \BackBee\ClassContent\AbstractClassContent $value
@return string the unique identifier of the add subcontent | [
"protected function _addSubcontent(AbstractClassContent $value)\n {\n if (!$this->_subcontent->indexOf($value)) {\n $this->_subcontent->add($value);\n }\n\n $this->subcontentmap[$value->getUid()] = $this->_subcontent->indexOf($value);\n\n return $value->getUid();\n }"
] | [
"public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// UnmarshalJSON sets the object from the provided JSON representation | [
"func (l *EC2InstanceEbsList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := EC2InstanceEbs{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = EC2InstanceEbsList{item}\n\t\treturn nil\n\t}\n\tlist := []EC2InstanceEbs{}\n\ter... | [
"@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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
List item parsing callback
@param array $matches
@return string | [
"protected function _processListItems_callback($matches) {\n\t\t$item = $matches[4];\n\t\t$leading_line =& $matches[1];\n\t\t$leading_space =& $matches[2];\n\t\t$marker_space = $matches[3];\n\t\t$tailing_blank_line =& $matches[5];\n\n\t\tif ($leading_line || $tailing_blank_line || \n\t\t\tpreg_match('/\\n{2,}/', $i... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Initializes the widget.
This renders the form open tag. | [
"public function init()\n {\n if ($classes = ArrayHelper::getValue($this->options, 'class')) {\n $this->options = ArrayHelper::merge($this->options, [\n 'class' => $classes.' sx-form-admin',\n ]);\n } else {\n $this->options = ArrayHelper::merge($this... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Encode58 base58 encodes the input. | [
"func Encode58(inp []byte) string {\n\tnum := new(big.Int).SetBytes(inp)\n\tbuf := make([]byte, 0, len(inp))\n\tbase := big.NewInt(int64(58))\n\trem := new(big.Int)\n\tquo := new(big.Int)\n\n\tfor num.Sign() != 0 {\n\t\tnum, rem = quo.QuoRem(num, base, rem)\n\t\tc := alphabet[rem.Uint64()]\n\t\tbuf = append(buf, c)... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetRawContent sets the RawContent field's value. | [
"func (s *APNSMessage) SetRawContent(v string) *APNSMessage {\n\ts.RawContent = &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 comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Public: Retrieve the data from the graphite server in the requested format.
format - The format of the data to return, as a Symbol (default: :png).
Examples
download(:json)
# => '{"targets":[]}' | [
"def download(format=:png)\n connection.get(url(format)).body\n rescue Faraday::Error::TimeoutError\n raise Slate::Error::TimeoutError\n end"
] | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
</editor-fold>//GEN-END:initComponents | [
"private void releaseResultset() {\n\t\tTableModel model = tblQueryResult.getModel();\n\t\tif (model == null)\n\t\t\treturn;\n\t\tif (!(model instanceof IncrementalResultSetTableModel))\n\t\t\treturn;\n\t\tIncrementalResultSetTableModel imodel = (IncrementalResultSetTableModel) model;\n\t\timodel.close();\n\t}"
] | [
"private void formWindowOpened(java.awt.event.WindowEvent evt)//GEN-FIRST:event_formWindowOpened\n {//GEN-HEADEREND:event_formWindowOpened\n\n spDetails.setVisible(false);\n pack();\n validate();\n\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Remove attributes with an invalid name from given DOM document
@param DOMDocument $dom
@return void | [
"protected static function removeInvalidAttributes(DOMDocument $dom)\n\t{\n\t\t$xpath = new DOMXPath($dom);\n\t\tforeach ($xpath->query('//@*') as $attribute)\n\t\t{\n\t\t\tif (!preg_match('(^(?:[-\\\\w]+:)?(?!\\\\d)[-\\\\w]+$)D', $attribute->nodeName))\n\t\t\t{\n\t\t\t\t$attribute->parentNode->removeAttributeNode(... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Handles a vote request. | [
"protected VoteResponse handleVote(VoteRequest request) {\n // If the request term is not as great as the current context term then don't\n // vote for the candidate. We want to vote for candidates that are at least\n // as up to date as us.\n if (request.term() < raft.getTerm()) {\n log.debug(\"Re... | [
"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 comment about Web development:",
"pos": "Represent the code about Web development:",
"neg": "Represent the code:"
} |
Set the url to redirect to after payment is made/attempted.
This function also populates the FailureUrl, if it is empty.
@param string $url
@return $this object for chaining | [
"public function setSuccessUrl($url)\n {\n $this->setField('SuccessUrl', $url);\n if (!$this->FailureUrl) {\n $this->setField('FailureUrl', $url);\n }\n\n return $this;\n }"
] | [
"public function ModuleInitHook()\n {\n parent::ModuleInitHook();\n $oShop = TdbShop::GetInstance();\n if ($oShop->fieldRedirectToNotFoundPageProductSearchOnNoResults) {\n // in this case the shop may redirect after running the search. since this occurs in the Execute of the modul... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
VCF values can be comma-separated lists, so here we want to convert them into lists of the proper type, else return the singleton value of that type. All values are also nullable, signified with a '.', we want to watch out for those as well. | [
"function maybeMapOverVal(fn, val) {\n var vals = val.split(',');\n if (vals.length > 1) {\n return vals.map(function(v) { return v == '.' ? null : fn(v); });\n }\n return val == '.' ? null : fn(val);\n}"
] | [
"def generate(options, command: nil)\n # First, enable `always_trace`, to show the stack trace\n always_trace!\n\n used_switches = []\n options.each do |option|\n next if option.description.to_s.empty? # \"private\" options\n next unless option.display_in_shell\n\n short_swi... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Filter value
@param string $value Regexp or name of pattern
@throws Exception\InvalidArgumentException | [
"private function filter(&$value)\n {\n if (isset($this->patterns[$value])) {\n $value = $this->patterns[$value];\n } else {\n // Test that pattern is a valid REGEXP pattern\n ErrorHandler::start();\n $this->pattern = (string) $value;\n $status... | [
"public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Documentation:"
} |
Checks when we can start reading the output. Timeout if it takes too long in order to avoid hangs | [
"private boolean startReading() throws IOException, InterruptedException {\n //If the reader is not ready, gives it some milliseconds\n while (!this.reader.ready()) {\n Thread.sleep(this.waitPause);\n if (this.closed) {\n return false;\n }\n }\n ... | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Returns normalized component name. It is used for backward compatibility.
@param string $name
@return string | [
"protected function getNormalizedName(string $name): string\n {\n $name = str_replace('antaresproject/component-', 'antares/', $name);\n $name = str_replace('antaresproject/module-', 'antares/', $name);\n\n return str_replace('-', '_', $name);\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
@VirtualProperty
@SerializedName("netShippingCostsFormatted")
@Groups({"Default","cart"})
@param null|string $locale
@throws PriceFormatterException
@return string | [
"public function getNetShippingCostsFormatted($locale = null)\n {\n return $this->priceFormatter->format((float)$this->entity->getNetShippingCosts(), null, $locale);\n }"
] | [
"@Api\n\tpublic void getValue(String name, CurrencyAttribute attribute) {\n\t\tattribute.setValue((String) formWidget.getValue(name));\n\t}"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Generates the key to the _dict_of_routes based on the list of methods
and path supplied
:param list(str) methods: List of HTTP Methods
:param str path: Path off the base url
:return: str of Path:Method | [
"def _generate_route_keys(self, methods, path):\n \n for method in methods:\n yield self._route_key(method, path)"
] | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Convert incoming CSS to CSS array
This CSS must have the format generated by the online editor
@param $css
@return mixed | [
"public static function cssToArray($css){\n if(!$css) {\n return array();\n }\n $css = str_replace(' /* Do not edit */', '', $css);\n $oldCssArr = explode(\"\\n\", $css);\n $newCssArr = array();\n foreach($oldCssArr as $line) {\n if(false === strpos($l... | [
"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:"
} |
Writes a UTF-8 string. Similar to L{writeUTF}, but does
not prefix the string with a 16-bit length word.
@type value: C{str}
@param value: The string value to be written. | [
"def writeUTFBytes(self, value):\n \n val = None\n\n if isinstance(value, unicode):\n val = value\n else:\n val = unicode(value, 'utf8')\n\n self.stream.write_utf8_string(val)"
] | [
"def _init_io_container(self, init_value):\n \n if isinstance(init_value, CLOB_STRING_IO_CLASSES):\n # already a valid StringIO instance, just use it as it is\n v = init_value\n else:\n # works for strings and unicodes. However unicodes must only contain valid a... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// receiveResponse retrieves a response from the server. | [
"func (r *resp) receiveResponse() *response {\n\t// Receive first line.\n\tline, err := r.reader.ReadBytes('\\n')\n\tif err != nil {\n\t\trerr := errors.Annotate(err, ErrConnectionBroken, errorMessages, \"receive after \"+r.cmd)\n\t\treturn &response{receivingError, 0, nil, rerr}\n\t}\n\tcontent := line[1 : len(lin... | [
"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 about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Updates an IPsecSiteConnection. | [
"def update_ipsec_site_connection(self, ipsecsite_conn, body=None):\n \"\"\"\"\"\"\n return self.put(\n self.ipsec_site_connection_path % (ipsecsite_conn), body=body\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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
outputFormat
@param mixed $value
@param string $name
@return string | [
"public function outputFormat($value, $name)\n {\n $checkZero = str_replace('0', '', $value);\n\n if (empty($checkZero)) {\n return '0';\n }\n $size = intval(Utils::toBn('0x' . mb_substr($value, 0, 64))->toString());\n $length = 2 * $size;\n \n return '... | [
"protected function parseExpressionHtmlLine( Line$line ):self\n\t{\n\t\t$content= $line->slice(1);\n\n\t\treturn $this->openNode(new StringNode($this,$line))->appendLine(\"<?$content?>\");\n\t}"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Using a list of args, determine the most accurate signature to use from
the given context | [
"def lookup_sig(cls, sigs, method_name, expr_args, stmt_or_expr, context):\n \n\n def synonymise(s):\n return s.replace('int128', 'num').replace('uint256', 'num')\n\n # for sig in sigs['self']\n full_sig = cls.get_full_sig(\n stmt_or_expr.func.attr,\n exp... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Use directly check() api from pydocstyle. | [
"def run(self):\n \"\"\"\"\"\"\n if self.exclude_from_doctest:\n for pattern in self.exclude_from_doctest:\n if fnmatch.fnmatch(self.filename, pattern):\n return\n\n checked_codes = pep257.conventions.pep257 | {'D998', 'D999'}\n for error in self._check_source():\n if isinstanc... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// PredicatePushDown implements LogicalPlan PredicatePushDown interface. | [
"func (p *DataSource) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan, error) {\n\treturn predicates, p, nil\n}"
] | [
"private AbstractPlanNode handleUnionLimitOperator(AbstractPlanNode root) {\n // The coordinator's top limit graph fragment for a MP plan.\n // If planning \"order by ... limit\", getNextUnionPlan()\n // will have already added an order by to the coordinator frag.\n // This is the only l... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Replace the AGL Markers in the buffer before rendering it.
@param $pBuffer string
@return string | [
"protected function _prepareRender($pBuffer)\n\t{\n\t\t$hasMarkers = preg_match_all('#(/' . static::VIEW_MARKER . '([A-Z0-9_]+)(::([a-z]+))?/)#', $pBuffer, $matches);\n\t\tif ($hasMarkers !== false) {\n\t\t\tforeach ($matches[2] as $i => $marker) {\n\t\t\t\t$method = '_process' . StringData::toCamelCase($marker) . ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Extract the roof of a polygon
@param polygon
@param height
@return | [
"public static Polygon extractRoof(Polygon polygon, double height) {\n GeometryFactory factory = polygon.getFactory();\n Polygon roofP = (Polygon)polygon.copy();\n roofP.apply(new TranslateCoordinateSequenceFilter(height));\n final LinearRing shell = factory.createLinearRing(getCounterC... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Loads the given class or interface.
@param string $className The name of the class to load.
@return void | [
"public function loadClass($className)\n {\n $fileName = \"\";\n if (false !== ($lastNsPos = strripos($className, self::NAMESPACE_SEPARATOR))) {\n $namespace = substr($className, 0, $lastNsPos);\n $className = substr($className, $lastNsPos + 1);\n $fileName = str_re... | [
"private function throwIfNotEntity(string $className): void\n {\n if (!$this->isEntity($className)) {\n throw new \\UnexpectedValueException('Given class name `' . $className . '` is not a Doctrine entity. Either register a custom GraphQL type for `' . $className . '` when instantiating `' . se... | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
/* (non-Javadoc)
@see com.ibm.ws.sib.processor.runtime.SIMPMessageHandlerControllable#isForeign() | [
"public boolean isForeign()\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) \n SibTr.entry(tc, \"isForeign\");\n \n boolean isForeign = aliasDest.isForeign();\n \n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) \n SibTr.exit(tc, \"isForeign\", new B... | [
"public static void setTextInfoEnabled(boolean textInfoEnabled) {\n com.ibm.ws.pmi.stat.StatsImpl.setEnableTextInfo(textInfoEnabled);\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Converts an array to XML using SimpleXMLElement.
@param array $data
@param SimpleXMLElement $xmlData | [
"private function arrayToXml(array &$data, SimpleXMLElement $xmlData)\n {\n foreach ($data as $key => $value) {\n if (\\is_array($value)) {\n if (\\is_numeric($key)) {\n $key = 'sequential-item';\n }\n $subnode = $xmlData->addChild... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Merge and dedup any entries in {@code ts} that have the same key. The last entry
with a given key will get selected. | [
"private int merge(String[] dst, String[] srcA, int lengthA, Tag[] srcB, int lengthB) {\n int i = 0;\n int ai = 0;\n int bi = 0;\n\n while (ai < lengthA && bi < lengthB) {\n final String ak = srcA[ai];\n final String av = srcA[ai + 1];\n Tag b = srcB[bi];\n int cmp = ak.compareTo(b.k... | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Sets the currently selected node in the scene. If \
multiple nodes are selected, then the last one selected \
will be considered the current one.
:param node | <XNode> || None | [
"def setCurrentNode(self, node):\n \n self.blockSignals(True)\n self.clearSelection()\n if node:\n node.setSelected(True)\n self.blockSignals(False)"
] | [
"def fix_config(self, options):\n \n options = super(ContainerValuePicker, self).fix_config(options)\n\n opt = \"value\"\n if opt not in options:\n options[opt] = \"Model\"\n if opt not in self.help:\n self.help[opt] = \"The name of the container value to pic... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Return random binary string, with given probabilities. | [
"def _sample(probability_vec):\n \"\"\"\"\"\"\n return map(int,\n numpy.random.random(probability_vec.size) <= probability_vec)"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
// stringToCFString converts a Go string to a CFStringRef. | [
"func stringToCFString(gostr string) C.CFStringRef {\n\tcstr := C.CString(gostr)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\treturn C.CFStringCreateWithCString(nilCFAllocatorRef, cstr, C.kCFStringEncodingUTF8)\n}"
] | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Appends a CharSequence to this string builder.
Appending null will call {@link #appendNull()}.
@param seq the CharSequence to append
@return this, to enable chaining
@since 3.0 | [
"@Override\n public StrBuilder append(final CharSequence seq) {\n if (seq == null) {\n return appendNull();\n }\n return append(seq.toString());\n }"
] | [
"public @NotNull QueryBuilder appendPlaceholders(int count) {\n if (count <= 0) throw new IllegalArgumentException(\"count must be positive, but was: \" + count);\n\n query.append('?');\n for (int i = 1; i < count; i++)\n query.append(\",?\");\n\n return this;\n }\n\n /*... | codesearchnet | {
"query": "Represent the Github comment about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
Adds the path mapping to the file path mapping
@param bundlePathMapping
the bundle path mapping
@param pathMapping
the path mapping to add | [
"protected void addFilePathMapping(BundlePathMapping bundlePathMapping, String pathMapping) {\n\t\tlong timestamp = 0;\n\t\tString filePath = resourceReaderHandler.getFilePath(pathMapping);\n\t\tif (filePath != null) {\n\t\t\ttimestamp = resourceReaderHandler.getLastModified(filePath);\n\t\t\tList<FilePathMapping> ... | [
"private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
/*
(non-Javadoc)
@see org.restcomm.protocols.ss7.tcap.api.tc.dialog.Dialog#operationEnded(
org.restcomm.protocols.ss7.tcap.tc.component.TCInvokeRequestImpl) | [
"public void operationTimedOut(InvokeImpl invoke) {\n // this op died cause of timeout, TC-L-CANCEL!\n try {\n this.dialogLock.lock();\n int index = getIndexFromInvokeId(invoke.getInvokeId());\n freeInvokeId(invoke.getInvokeId());\n this.operationsSent[index... | [
"public void initMediaConnection(SipServletRequest request) throws IOException {\n\t\tlog.info(\"initiating media connection\");\n\t\tsipServletResponse = request.createResponse(SipServletResponse.SC_OK);\n\t\tfireEvent(\n\t\t\t\tnull, \n\t\t\t\t(byte[])request.getContent(), \n\t\t\t\t\"org.mobicents.slee.service.i... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
prepareList
@return void | [
"protected function prepareList()\n {\n $displayCount = 0;\n\n foreach ($this->items as &$item) {\n $displayCount++;\n // @todo this should not ignore the items current display state\n // - Should check the current display state and try to keep it if possible\n ... | [
"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:"
} |
// SetSortOrder sets the SortOrder field's value. | [
"func (s *ListWorkteamsInput) SetSortOrder(v string) *ListWorkteamsInput {\n\ts.SortOrder = &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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Split stable id, returning:
* Document (root) stable ID
* Context polymorphic type
* Character offset start, end *relative to document start*
Returns tuple of four values. | [
"def split_stable_id(stable_id):\n \n split1 = stable_id.split(\"::\")\n if len(split1) == 2:\n split2 = split1[1].split(\":\")\n if len(split2) == 3:\n return split1[0], split2[0], int(split2[1]), int(split2[2])\n raise ValueError(f\"Malformed stable_id:\\t{stable_id}\")"
] | [
"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 instruction about Text processing:",
"pos": "Represent the code about Text processing:",
"neg": "Represent the code:"
} |
Check if the app is under maintenance.
@return bool | [
"public static function check()\n {\n $route = isset($_GET['_framework_url_']) ? $_GET['_framework_url_'] : '';\n\n $out = config('maintenance.out', []);\n\n $out[] = config('panel.route', 'vinala');\n\n if (config('panel.setup', true)) {\n if (config('maintenance.enabled',... | [
"@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 summarization about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about Programming:"
} |
Restore the object state from the storage back-end.
@param level [Integer] the transaction nesting level | [
"def _restore(level)\n # Find the most recently stored state of this object. This could be on\n # any previous stash level or in the regular object DB. If the object\n # was created during the transaction, there is not previous state to\n # restore to.\n data = nil\n if @_stash_map\n ... | [
"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 text about Database management:",
"pos": "Represent the code about Database management:",
"neg": "Represent the code about Software development:"
} |
Injects localisation modifiers
@param array $aData The data passed to getCountCommon()
@throws FactoryException
@throws ModelException | [
"protected function injectLocalisationQuery(array &$aData): void\n {\n /** @var Locale $oLocale */\n $oLocale = Factory::service('Locale');\n $sTable = $this->getTableName();\n $sAlias = $this->getTableAlias();\n\n /**\n * Restrict to a specific locale by passing in U... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Replace the state of this object with the same object in some other state. Used for to restore the before immage if
a transaction rolls back or is read from the log during restart.
@param other the object this object is to become a clone of. | [
"public void becomeCloneOf(ManagedObject other)\n {\n final String methodName = \"becomeCloneOf\";\n if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())\n trace.entry(this,\n cclass,\n methodName,\n other);\n\n... | [
"@Override\n public void destroy() // PK20881\n {\n if (tc.isEntryEnabled())\n Tr.entry(tc, \"destroy\");\n\n // Dummy transactionWrappers may not be in any table and so\n // will not have a resourceCallback registered to remove them.\n if (_resourceCallback != null)\n ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Database management:"
} |
Dispatch the websocket to the view function.
Arguments:
websocket_context: The websocket context, optional to match
the Flask convention. | [
"async def dispatch_websocket(\n self, websocket_context: Optional[WebsocketContext]=None,\n ) -> None:\n \n websocket_ = (websocket_context or _websocket_ctx_stack.top).websocket\n if websocket_.routing_exception is not None:\n raise websocket_.routing_exception\n\n ... | [
"def get_app(self):\n \n # First see to connection stack\n ctx = connection_stack.top\n if ctx is not None:\n return ctx.app\n\n # Next return app from instance cache\n if self.app is not None:\n return self.app\n\n # Something went wrong, in mo... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get contact provider
@param string $providerServiceKey
@return ProviderInterface $provider | [
"private function getProvider($providerServiceKey)\n {\n try {\n $provider = $this->getContainer()->get($providerServiceKey);\n } catch (ServiceNotFoundException $e) {\n throw new \\InvalidArgumentException(sprintf('Provider \"%s\" should be defined as a service.', $providerSe... | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | 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:"
} |
// newSnapshot creates a new snapshot with the specified startup parameters. This
// method does not initialize the set of recent signers, so only ever use if for
// the genesis block. | [
"func newSnapshot(config *params.CliqueConfig, sigcache *lru.ARCCache, number uint64, hash common.Hash, signers []common.Address) *Snapshot {\n\tsnap := &Snapshot{\n\t\tconfig: config,\n\t\tsigcache: sigcache,\n\t\tNumber: number,\n\t\tHash: hash,\n\t\tSigners: make(map[common.Address]struct{}),\n\t\tRecen... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// validateDelegationCfg checks deserialized delegation.cfg. | [
"func validateDelegationCfg(ctx *validation.Context, cfg *admin.DelegationPermissions) {\n\tnames := stringset.New(0)\n\tfor i, rule := range cfg.Rules {\n\t\tif rule.Name != \"\" {\n\t\t\tif names.Has(rule.Name) {\n\t\t\t\tctx.Errorf(\"two rules with identical name %q\", rule.Name)\n\t\t\t}\n\t\t\tnames.Add(rule.N... | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
TODO
@param $key
@param $value
@return bool | [
"public static function setVar($key, $value)\n {\n $var = new Vars($key);\n $var->key = $key;\n $var->value = $value;\n return $var->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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Clears the build directories for both CSS and JS
@return void | [
"public function clear()\n {\n $this->clearBuildTs();\n\n $this->_io->verbose('Clearing build files:');\n $this->_clearBuilds();\n\n $this->_io->verbose('');\n $this->out('<success>Complete</success>');\n }"
] | [
"func (r *printRun) RegisterIDFlag() {\n\tr.Flags.BoolVar(&r.id, \"id\", false, doc(`\n\t\tPrint only build ids.\n\n\t\tIntended for piping the output into another bb subcommand:\n\t\t\tbb ls -cl myCL -id | bb cancel\n\t`))\n}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Update the ports status cache. | [
"def _update_port_status_cache(self, device, device_bound=True):\n \"\"\"\"\"\"\n with self._cache_lock:\n if device_bound:\n self._bound_ports.add(device)\n self._unbound_ports.discard(device)\n else:\n self._bound_ports.discard(devic... | [
"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:"
} |
// ID returns the global template identifier | [
"func (t *FpdfTpl) ID() string {\n\treturn fmt.Sprintf(\"%x\", sha1.Sum(t.Bytes()))\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:"
} |
Called when a service has been unregistered from the framework
:param svc_ref: A service reference | [
"def on_service_departure(self, svc_ref):\n \n with self._lock:\n if svc_ref is self.reference:\n # Forget about the service\n self._value.unset_service()\n\n # Clear the reference\n self.reference = None\n\n # Look ... | [
"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 about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Write the subscriber state to the given {@link DataInput}
in the order of:
isMaster
serverState
totalUpdates
streamId
@param dataOutput the data output to write to
@throws IOException | [
"public void write(DataOutput dataOutput) throws IOException {\n dataOutput.writeBoolean(isMaster);\n dataOutput.writeUTF(serverState);\n dataOutput.writeInt(totalUpdates);\n dataOutput.writeInt(streamId);\n\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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Internal method to coerce a target to a string.
The assumption is that if it is not ``None`` and not a string, it is
a Django ``FieldFile`` object. | [
"def _coerce_target(self, target):\n \n if not target or isinstance(target, six.string_types):\n return target\n if not hasattr(target, 'instance'):\n return None\n\n if getattr(target.instance, '_deferred', False):\n model = target.instance._meta.proxy_f... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sort all partitions inplace on the basis of complete name ie dbName.tableName.partitionName | [
"public static List<Partition> sortPartitions(List<Partition> partitions) {\n Collections.sort(partitions, new Comparator<Partition>() {\n @Override\n public int compare(Partition o1, Partition o2) {\n return o1.getCompleteName().compareTo(o2.getCompleteName());\n }\n });\n return par... | [
"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 post about Cassandra database:",
"pos": "Represent the code about Cassandra database:",
"neg": "Represent the code:"
} |
Invoked after a non-sticky session is removed from memcached. | [
"protected void onAfterDeleteFromMemcached( @Nonnull final String sessionId ) {\n final long start = System.currentTimeMillis();\n\n final String validityInfoKey = _sessionIdFormat.createValidityInfoKeyName( sessionId );\n _storage.delete( validityInfoKey );\n\n if (_storeSecondaryBackup... | [
"def evict(self):\n \"\"\"\"\"\"\n logging.debug('Evicting cache for %r', self.cache_key)\n _clear_version_cache(self.cache_key)\n # Cause the cache key to be refreshed next time any operation is\n # run to make sure we don't act on old cached data.\n self.versioned_cache_k... | codesearchnet | {
"query": "Represent the Github summarization about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code:"
} |
Convert a Windows path to a Cygwin path. Just handles the basic case. | [
"def convert_windows_path_to_cygwin(path):\n \"\"\"\"\"\"\n if len(path) > 2 and path[1] == \":\" and path[2] == \"\\\\\":\n newpath = cygwin_full_path_prefix + \"/\" + path[0]\n if len(path) > 3: newpath += \"/\" + path[3:]\n path = newpath\n path = path.replace(\"\\\\\", \"/\")\n ... | [
"public static String pathEncode(String path, Charset charset) {\n return encodeReserved(path, FragmentType.PATH_SEGMENT, charset);\n\n /*\n * path encoding is not equivalent to query encoding, there are few differences, namely dealing\n * with spaces, !, ', (, ), and ~ characters. we will need to man... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
// Get returns the value for the provided key.
// Implementation of the k8s.io/apimachinery/pkg/labels.Labels interface. | [
"func (ls LabelArray) Get(key string) string {\n\tkeyLabel := parseSelectLabel(key, '.')\n\tif keyLabel.IsAnySource() {\n\t\tfor l := range ls {\n\t\t\tif ls[l].Key == keyLabel.Key {\n\t\t\t\treturn ls[l].Value\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor _, lsl := range ls {\n\t\t\tif lsl.Source == keyLabel.Source && lsl.... | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Pause the Quartz scheduler.
@return <code>true</code> if paused, <code>false</code> otherwise
@see QuartzService#pauseQuartzScheduler() | [
"public boolean pauseQuartzScheduler() {\n try {\n this.scheduler.standby();\n return true;\n } catch (SchedulerException e) {\n logger.error(\"error pausing quartz scheduler\", e);\n }\n return false;\n }"
] | [
"public static function killTask($taskId){\n return new SystemCall(function (Task $Task, Scheduler $Scheduler) use ($taskId){\n //Send the status to yield.\n $Task->setSendValue($Scheduler->killTask($taskId));\n //Re-active the Task.\n $Schedule... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
True if the type is a metatype.
@param rdtype: the type
@type rdtype: int
@rtype: bool | [
"def is_metatype(rdtype):\n \"\"\"\"\"\"\n\n if rdtype >= TKEY and rdtype <= ANY or rdtype in _metatypes:\n return True\n return False"
] | [
"def get_constant(self, const_name, context):\n \n\n # check if value is compatible with\n const = self._constants[const_name]\n\n if isinstance(const, ast.AnnAssign): # Handle ByteArrays.\n if context:\n expr = Expr(const.value, context).lll_node\n ... | codesearchnet | {
"query": "Represent the description about text analysis:",
"pos": "Represent the code about text analysis:",
"neg": "Represent the code:"
} |
END GENERATED GETTERS/SETTERS | [
"public static function fromDataString($dataString)\n {\n $expression = '([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(\\[\\])?)'; // php's expression syntax: http://www.php.net/manual/en/language.oop5.basic.php, modified with optional []\n if (preg_match_all('~[*\\s]+' . $expression . ':' . $expr... | [
"protected function prepareResponseHeaders()\n {\n $this->getResponse(true)->headers->set('Content-Type', 'text/html');\n $this->getResponse()->setCharset('utf-8');\n\n\n // FIX FOR IE SESSION COOKIE\n // CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\n //... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about PHP programming:"
} |
Executes the main logic of the service.
@return tao_install_services_Data The result of the service execution. | [
"public function execute(){\r\n \t$ext = common_configuration_ComponentFactory::buildPHPExtension('json');\r\n $report = $ext->check();\r\n \r\n // We fake JSON encoding for a gracefull response in any case.\r\n $json = $report->getStatus() == common_con... | [
"@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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Element definitions with given name(s)
@param [Array || String]
one or many Alchemy::Element names. Pass +'all'+ to get all Element definitions
@return [Array]
An Array of element definitions | [
"def element_definitions_by_name(names)\n return [] if names.blank?\n\n if names.to_s == \"all\"\n Element.definitions\n else\n Element.definitions.select { |e| names.include? e['name'] }\n end\n end"
] | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Builds a pattern node based on a given word and its parent.
@param Pattern $parent The parent pattern object, in case a loop node will be built.
@param string $word A single word from a composite pattern.
@return Pattern A pattern object. | [
"public static function getPatternFor(Pattern $parent, $word)\n {\n if (self::isWildcard($word)) {\n return self::getWildcardPattern($parent, $word);\n }\n\n return new Word($word);\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:"
} |
// Sync flushes the changes to disk. | [
"func (w *SegmentWAL) Sync() error {\n\tvar head *segmentFile\n\tvar err error\n\n\t// Flush the writer and retrieve the reference to the head segment under mutex lock.\n\tfunc() {\n\t\tw.mtx.Lock()\n\t\tdefer w.mtx.Unlock()\n\t\tif err = w.flush(); err != nil {\n\t\t\treturn\n\t\t}\n\t\thead = w.head()\n\t}()\n\ti... | [
"@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:"
} |
// Deprecated: DocumentType is deprecated as of 6.0. | [
"func (q *PercolatorQuery) DocumentType(typ string) *PercolatorQuery {\n\tq.documentType = typ\n\treturn q\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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
multiply two complex numbers
Complex::mul($z, $w) computes and returns $z*$w
@param mixed $z (Complex, or parsable to Complex)
@param mixed $w (Complex, or parsable to Complex)
@retval Complex | [
"public static function mul($z, $w) {\n if (!($z instanceof Complex)) $z = static::parse($z);\n if (!($w instanceof Complex)) $w = static::parse($w);\n\n return static::create($z->x * $w->x - $z->y * $w->y, $z->x * $w->y + $z->y * $w->x);\n }"
] | [
"def term_with_coeff(term, coeff):\n \n if not isinstance(coeff, Number):\n raise ValueError(\"coeff must be a Number\")\n new_pauli = term.copy()\n # We cast to a complex number to ensure that internally the coefficients remain compatible.\n new_pauli.coefficient = complex(coeff)\n return ... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// FilledCircleRGBA draws filled circle with blending.
// (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a562ba6b18fb70547cd50cb3bb0f70272) | [
"func FilledCircleRGBA(renderer *sdl.Renderer, x, y, rad int32, r, g, b, a uint8) bool {\n\t_x := C.Sint16(x)\n\t_y := C.Sint16(y)\n\t_rad := C.Sint16(rad)\n\t_r := C.Uint8(r)\n\t_g := C.Uint8(g)\n\t_b := C.Uint8(b)\n\t_a := C.Uint8(a)\n\treturn C.filledCircleRGBA((*C.SDL_Renderer)(unsafe.Pointer(renderer)), _x, _y... | [
"public function convertToUtf()\n {\n $dbHandler = $this->getDbHandler();\n\n $rs = $dbHandler->query(\n \"SELECT oxvarname, oxvartype, DECODE( oxvarvalue, '{$this->getConfigKey()}') AS oxvarvalue\n FROM oxconfig\n WHERE oxvartype IN ('str', 'a... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Sets the connection URL to the address a Neo4j server is set up at | [
"def set_connection(self, url):\n \n u = urlparse(url)\n\n if u.netloc.find('@') > -1 and (u.scheme == 'bolt' or u.scheme == 'bolt+routing'):\n credentials, hostname = u.netloc.rsplit('@', 1)\n username, password, = credentials.split(':')\n else:\n raise ... | [
"public int getPort() {\n final Connector[] connectors = this.server.getConnectors();\n checkState(connectors.length >= 1, \"Server must have at least 1 connector\");\n\n // The first connector is created upon initializing the server. That's the one that has the port.\n return connectors[0].getLocalPort... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
:param encoding:
:return: | [
"def read(self, encoding=\"utf8\"):\n \n with open(self._filename, \"rb\") as f:\n if self.key:\n return get_module(\"mo_math.crypto\").decrypt(f.read(), self.key)\n else:\n content = f.read().decode(encoding)\n return content"
] | [
"def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Regular expressions:"
} |
// Iter calls the iter function for each key/value pair in the map. If the iter
// function returns true, iteration stops. | [
"func (vs *ValueMap) Iter(iter func(Value, Value) bool) bool {\n\tif vs == nil {\n\t\treturn false\n\t}\n\treturn vs.hashMap.Iter(func(kt, vt util.T) bool {\n\t\tk := kt.(Value)\n\t\tv := vt.(Value)\n\t\treturn iter(k, v)\n\t})\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
deregister service
@param mixed ...$params
@return bool | [
"public function deregisterService(...$params)\n { \n if (empty($this->registerId)) {\n $hostName = gethostname();\n $this->registerId = sprintf('service-%s-%s', $this->registerName, $hostName);\n }\n\n $url = sprintf('%s:%d%s', $this->address, $this->port, self:... | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
after pruning fixed order needs update to match new nnodes/ntips. | [
"def update_fixed_order(self):\n \"\"\n # set tips order if fixing for multi-tree plotting (default None)\n fixed_order = self.ttree._fixed_order\n self.ttree_fixed_order = None\n self.ttree_fixed_idx = list(range(self.ttree.ntips))\n\n # check if fixed_order changed:\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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Overrides the default formatter behavior to log a JSON line. | [
"def call(sev, time, _, msg) #:nodoc:\n level = ({\n Logger::DEBUG => 'DEBUG',\n Logger::INFO => 'INFO',\n Logger::WARN => 'WARN',\n Logger::ERROR => 'ERROR',\n Logger::FATAL => 'FATAL',\n }[sev] || sev.to_s).upcase\n\n if msg.present? && AUTO_... | [
"@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:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.