query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Unlink (disassociate) the specified properties object. @param others: The list object to unlink. Unspecified means unlink all. @type others: [L{Properties},..] @return: self @rtype: L{Properties}
[ "def unlink(self, *others):\n \n if not len(others):\n others = self.links[:]\n for p in self.links[:]:\n if p in others:\n p.teardown()\n return self" ]
[ "def component(self, *components):\n \n \"\"\"\n for component in components:\n self._component.append(component)\n return self" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
If approximate is True then only the points from SRTM grid will be used, otherwise a basic aproximation of nearby points will be calculated.
[ "def get_elevation(self, latitude, longitude, approximate=None):\n \n if not (self.latitude - self.resolution <= latitude < self.latitude + 1):\n raise Exception('Invalid latitude %s for file %s' % (latitude, self.file_name))\n if not (self.longitude <= longitude < self.longitude + 1...
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
结束监听 @param Context $context
[ "private function listenAfter()\r\n {\r\n //监听器结束\r\n //$_listeners=array_reverse($this->m_listeners);\r\n $_listeners=$this->m_listeners;\r\n foreach ($_listeners as $listener){\r\n $listener->listenAfter($this->m_context);\r\n }\r\n }" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
MessageListener for stateless transport. This listener expect a handshake to precede each message.
[ "function StatelessListener(ptcl, readableFactory, opts) {\n MessageListener.call(this, ptcl, opts);\n var self = this;\n var readable;\n\n process.nextTick(function () {\n // Delay listening to allow handlers to be attached even if the factory is\n // purely synchronous.\n readable = readableFactory.c...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
保存数据 @return array
[ "public function actionSave()\n {\n $menu_id = Yii::$app->request->post('menu_id');\n $parent_id = intval(Yii::$app->request->post('parent_id'));\n $text = Yii::$app->request->post('origin_text');\n $title = Yii::$app->request->post('title');\n $url = Yii::$app->request->post('...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Initialize the handler, setup the authentication entry attributes.
[ "public void initialize() {\n /*\n * Use a set to ensure we ignore duplicates.\n */\n val attributes = new HashSet<String>();\n LOGGER.debug(\"Initializing LDAP attribute configuration...\");\n if (StringUtils.isNotBlank(this.principalIdAttribute)) {\n LOGGER.d...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Set the network ID and Account ID.
[ "def get_ids(self):\n \"\"\"\"\"\"\n response = api.request_networks(self)\n all_networks = []\n network_dict = {}\n for network, status in self.networks.items():\n if status['onboarded']:\n all_networks.append('{}'.format(network))\n netwo...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
create TV gradient executor with input binded on img
[ "def get_tv_grad_executor(img, ctx, tv_weight):\n \n if tv_weight <= 0.0:\n return None\n nchannel = img.shape[1]\n simg = mx.sym.Variable(\"img\")\n skernel = mx.sym.Variable(\"kernel\")\n channels = mx.sym.SliceChannel(simg, num_outputs=nchannel)\n out = mx.sym.Concat(*[\n mx.sy...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Marshall the given parameter object.
[ "public void marshall(ListDiscoveredResourcesRequest listDiscoveredResourcesRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (listDiscoveredResourcesRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n pro...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get and print media templates from all types @since 0.2.0 @since 0.9.0 Deprecate menu_icons_media_templates filter. @wp_hook action print_media_templates
[ "public static function _media_templates() {\n\t\t$id_prefix = 'tmpl-menu-icons';\n\n\t\t// Deprecated.\n\t\t$templates = apply_filters( 'menu_icons_media_templates', array() );\n\n\t\tif ( ! empty( $templates ) ) {\n\t\t\tif ( WP_DEBUG ) {\n\t\t\t\t_deprecated_function( 'menu_icons_media_templates', '0.9.0', 'menu...
[ "public function getViewer($action)\n {\n // Answer Viewer Object (from parent):\n \n if (!$this->isCMSPreview()) {\n return parent::getViewer($action);\n }\n \n // Load Page Requirements (uses theme):\n \n PageController::create(Page::create())-...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Size returns the sum of the Size of all Ranges.
[ "func (rs Ranges) Size() uint64 {\n\tvar sz uint64\n\tfor i := range rs {\n\t\tsz += 1 + (rs[i].End - rs[i].Begin)\n\t}\n\treturn sz\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
output for average @function avg @param {Array} input - line parsed @param {String} output - header @return {Array}
[ "function avg(input, output) {\n\n var event = input[0];\n if (event.what === 0 && event.total === 0) {\n return [];\n }\n return [ output, [ 'total', cyan + event.what.toFixed(3) + close ],\n [ 'average', cyan + (event.what / event.total).toFixed(3) + close ],\n [ 'max', cyan + event.max.toFixed(3) + ...
[ "def BIF_templates(self):\n \n network_template = Template('network $name {\\n}\\n')\n # property tag may or may not be present in model,and since no of properties\n # can be more than one , will replace them accoriding to format otherwise null\n variable_template = Template(\"\"\...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Run the query. @return builder
[ "private function query()\n {\n foreach ($this->search_models as $model_name => $filters) {\n // Apply search against the original model.\n if ($model_name === 'self') {\n self::applySearch($this->query, $filters);\n continue;\n }\n\n ...
[ "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:" }
Create a shadow-root in this host and stamp `template` as it's content. An element may override this method for custom behavior. @method shadowFromTemplate
[ "function(template) {\n if (template) {\n // make a shadow root\n var root = this.createShadowRoot();\n // stamp template\n // which includes parsing and applying MDV bindings before being\n // inserted (to avoid {{}} in attribute values)\n // e.g. to prevent <img src=...
[ "function() {\n var events = this.eventDelegates;\n log.events && (Object.keys(events).length > 0) && console.log('[%s] addHostListeners:', this.localName, events);\n // NOTE: host events look like bindings but really are not;\n // (1) we don't want the attribute to be set and (2) we want to sup...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets all threads in a specified box Args: box_key box to look in returns a list of thread dicts
[ "def get_box_threads(self, box_key):\n\t\t'''\n\t\t'''\n\t\turi = '/'.join([\n\t\t\t\t\t\tself.api_uri,\n\t\t\t\t\t\tself.boxes_suffix,\n\t\t\t\t\t\tbox_key,\n\t\t\t\t\t\tself.threads_suffix\n\t\t\t\t\t\t])\n\t\treturn self._req('get', uri)" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SetSubnetIds sets the SubnetIds field's value.
[ "func (s *CreateCacheSubnetGroupInput) SetSubnetIds(v []*string) *CreateCacheSubnetGroupInput {\n\ts.SubnetIds = v\n\treturn s\n}" ]
[ "@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Turn a list of dicts into XML nodes with tag names taken from the dict keys and element text taken from dict values. This is a list of dicts so that the XML nodes can be ordered in the XML output.
[ "def struct_to_xml(node, struct):\n \n for obj in struct:\n for k, v in obj.items():\n etree.SubElement(node, k).text = v" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns json feed.
[ "def parse_json(self, page):\n ''''''\n if not isinstance(page, basestring):\n page = util.decode_page(page)\n \n self.doc = json.loads(page)\n results = self.doc.get(self.result_name, [])\n \n if not results:\n self.check_status(self.doc.get('s...
[ "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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Find the File for the resource file in the various source directories. @param sourceDirectories List of directories to scan @param resourceFileName File name of resource file @return The resolved File @throws IOException If the File cannot be found
[ "protected File findFile(final List<File> sourceDirectories, String resourceFileName) throws IOException {\n\t for (final File sourceDirectory : sourceDirectories) {\n\t final File resourceFile = new File(sourceDirectory, resourceFileName);\n\t if (resourceFile.exists()) {\n\t return res...
[ "@Nullable\n protected String locate(String scriptAddress, String name) {\n String canonicalizedPath = canonicalizePath(scriptAddress, name);\n\n String normalizedPath = canonicalizedPath;\n if (ModuleLoader.isAmbiguousIdentifier(canonicalizedPath)) {\n normalizedPath = ModuleLoader.MODULE_SLASH + ca...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Deletes an actor and all of the necessary cleanup. It also dispatches all the apps to clean up after the deleted actor. @param AnCommandContext $context Context parameter @return AnDomainEntityAbstract
[ "protected function _actionDelete(AnCommandContext $context)\n {\n $this->getService('repos:components')\n ->fetchSet()\n ->registerEventDispatcher($this->getService('anahita:event.dispatcher'));\n\n $result = parent::_actionDelete($context);\n\n $this->getService('an...
[ "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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
region ÜRÜN İŞLEMLERİ (EKLE-SİL-GÜNCELLE-BUL) @param {integer} _tahta_id @param {integer} _sayfalama @returns {LazyLoadingResponse|Promise}
[ "function f_urun_tumu(_tahta_id, _sayfalama) {\r\n //l.info(\"f_db_urun_tumu\");\r\n\r\n return f_urun_aktif_urun_idleri(_tahta_id, _sayfalama)\r\n .then(\r\n /** @param {string[]} _aktifUrun_idleri */\r\n function (_aktifUrun_idleri) {\r\n r...
[ "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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// Configure the identity field of a collection in a single function call.
[ "func (self *Collection) SetIdentity(name string, idtype Type, formatter FieldFormatterFunc, validator FieldValidatorFunc) *Collection {\n\tif name != `` {\n\t\tself.IdentityField = name\n\t}\n\n\tself.IdentityFieldType = idtype\n\n\tif formatter != nil {\n\t\tself.IdentityFieldFormatter = formatter\n\t}\n\n\tif va...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
检查是否可读字节数 @param minimumReadableBytes
[ "private void checkReadableBytesUnsafe(int minimumReadableBytes) {\r\n\t\tif (readerIndex > writerIndex - minimumReadableBytes) {\r\n\t\t\tthrow new IndexOutOfBoundsException(\r\n\t\t\t\t\tString.format(\"readerIndex(%d) + length(%d) exceeds writerIndex(%d): %s\", readerIndex,\r\n\t\t\t\t\t\t\tminimumReadableBytes,...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
input method @param string $fieldName @param array $options @return string
[ "public function input($fieldName, $options = [])\n {\n //** we need to make the input combine with <span class=\"input-group-addon\">@</span>\n if (isset($options['icon'])) {\n $icon = $this->Html->icon($options['icon']);\n\n $between = '<div class=\"input-group\">' . '<span ...
[ "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 Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Create the name of the hidden field that is containing a capacity implementation. @param id the id of the capacity. @return the field name.
[ "public static String createNameForHiddenCapacityImplementationAttribute(String id) {\n\t\treturn PREFIX_CAPACITY_IMPLEMENTATION + fixHiddenMember(id.toUpperCase()).replace(\".\", //$NON-NLS-1$\n\t\t\t\tHIDDEN_MEMBER_REPLACEMENT_CHARACTER);\n\t}" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Sets the value of the specified attribute in the current item to the given value.
[ "public Item withShort(String attrName, short val) {\n checkInvalidAttrName(attrName);\n return withNumber(attrName, Short.valueOf(val));\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// ContainsPvtWrites returns true if this transaction is not limited to affecting the public data only
[ "func (t *Transaction) ContainsPvtWrites() bool {\n\tfor _, ns := range t.RWSet.NsRwSets {\n\t\tfor _, coll := range ns.CollHashedRwSets {\n\t\t\tif coll.PvtRwSetHash != nil {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}" ]
[ "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 comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EClass getIfcFontStyle() {\r\n\t\tif (ifcFontStyleEClass == null) {\r\n\t\t\tifcFontStyleEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(676);\r\n\t\t}\r\n\t\treturn ifcFontStyleEClass;\r\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the description about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
Add branch instrumentation information for each block.
[ "private void processBranchInfo(Node branchNode, FileInstrumentationData data, List<Node> blocks) {\n int lineNumber = branchNode.getLineno();\n data.setBranchPresent(lineNumber);\n\n // Instrument for each block\n int numBranches = 0;\n for (Node child : blocks) {\n data.putBranchNode(lineNumbe...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// networkingEnviron returns a environs.NetworkingEnviron instance from the // current model config, if supported. If the model does not support // environs.Networking, an error satisfying errors.IsNotSupported() will be // returned.
[ "func networkingEnviron(getter environs.EnvironConfigGetter) (environs.NetworkingEnviron, error) {\n\tenv, err := environs.GetEnviron(getter, environs.New)\n\tif err != nil {\n\t\treturn nil, errors.Annotate(err, \"opening environment\")\n\t}\n\tif netEnv, ok := environs.SupportsNetworking(env); ok {\n\t\treturn ne...
[ "func NewRemoteConfigSource(source *apiv1.NodeConfigSource) (RemoteConfigSource, string, error) {\n\t// NOTE: Even though the API server validates the config, we check whether all *known* fields are\n\t// nil here, so that if a new API server allows a new config source type, old clients can send\n\t// an error mess...
codesearchnet
{ "query": "Represent the Github summarization about network configuration:", "pos": "Represent the Github code about network configuration:", "neg": "Represent the Github code about Software development:" }
Instantiate winston logger. @param {string=} opt_level . @param {string=} opt_dir . @return {winston.Logger} .
[ "function createLogger(opt_level, opt_dir) {\n var config = getLogConfig(opt_level, opt_dir);\n var transports = getTransports(config);\n\n // check logdir\n if (!fs.existsSync(config.file.dir)) {\n throw new Error(\n util.format('The logdir does not exist: %s', config.file.dir));\n }\n\n // create in...
[ "function addCommand(descriptor){\n\t// Check descriptor type.\n\tvar err = {};\n\tif( !checkDescriptor(descriptor, err) ){\n\t\tlogger.error(\n\t\t\t'The command descriptor is invalid.',\n\t\t\tnew Error('[command.io] Invalid command descriptor (\"'+err.key+'\": expected \"'+err.expect+'\", have \"'+err.type+'\")....
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Write header value. @param string $key @param string $value @return void
[ "public function withHeader(string $key, string $value): void\n {\n $this->headers[$key] = $value;\n }" ]
[ "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 about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// getCurrentNet returns the network on which the bitcoind node is running.
[ "func (c *BitcoindConn) getCurrentNet() (wire.BitcoinNet, error) {\n\thash, err := c.client.GetBlockHash(0)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tswitch *hash {\n\tcase *chaincfg.TestNet3Params.GenesisHash:\n\t\treturn chaincfg.TestNet3Params.Net, nil\n\tcase *chaincfg.RegressionNetParams.GenesisHash:\n\t...
[ "function Task(init) {\n this.basedir = init.basedir;\n this.bundle = init.bundle;\n this.datasetId = init.datasetId;\n this.pid = init.pid;\n this.nodes = init.nodes;\n this.action = init.action;\n this.outputStreamOk = true;\n this.files = {}; // object in which we store shuffle file informations to ...
codesearchnet
{ "query": "Represent the sentence about Networking:", "pos": "Represent the code about Networking:", "neg": "Represent the code:" }
Remove any stored representation of conversational state for bean identified by given key. <p>
[ "public void remove(BeanId beanId)\n {\n final String fileName = getPortableFilename(beanId);\n final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();\n if (isTraceOn && tc.isEntryEnabled())\n Tr.entry(tc, \"remove: key=\" + beanId + \", file=\" + fileName); //d248470\n\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// SetName sets the Name field's value.
[ "func (s *Queue) SetName(v string) *Queue {\n\ts.Name = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Sorts the incoming xml. @param originalXml the xml that should be sorted. @return the sorted xml
[ "private String sortXml(final String originalXml) {\n\n xmlProcessingInstructionParser.scanForIgnoredSections(originalXml);\n String xml = xmlProcessingInstructionParser.replaceIgnoredSections();\n\n insertXmlInXmlProcessor(xml, () -> \"Could not sort \" + pomFile.getAbsolutePath() + \" content...
[ "def parse(self, root):\n \"\"\"\"\"\"\n #Use the first element in the versions list since there should only be one.\n v = _get_xml_version(root)[0]\n result = {}\n\n for child in root: \n if child.tag in self.versions[v].entries:\n entry = self.v...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Returns a new html anchor. @param string, $routeName @param string|null $title @param array $parameters @param array $attributes @param array $additionalRouteNames @param bool $isVisible @return LinkRoute
[ "public function linkRoute($routeName, $title = null, $parameters = [], $attributes = [], $additionalRouteNames = [], $isVisible = true)\n {\n return new LinkRoute($routeName, $title, $parameters, $attributes, $additionalRouteNames, $isVisible);\n }" ]
[ "protected function createLink(DataGrid $grid, $href, $params)\n\t{\n\t\t/**\n\t\t * Int case of ActionCallback, $this->href is a identifier of user callback\n\t\t */\n\t\t$params = $params + ['__key' => $this->href];\n\n\t\treturn $this->grid->link('actionCallback!', $params);\n\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about Software development:" }
Create a new product. Args: name: name of the new product. Returns: A new product instance.
[ "def new_product(self, name):\n \n n = self._product_cls(self, name, summary_cls=self._summary_cls)\n self.graph.add_node(n)\n self.products.append(n)\n return n" ]
[ "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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Check if key has previously been added to this store. This function makes a linear search through the log file and is very slow. Returns True if the event has previously been added, False otherwise.
[ "def key_exists(self, key):\n \n assert isinstance(key, str)\n self._close()\n try:\n return self._unsafe_key_exists(key)\n finally:\n self._open()" ]
[ "function LoggerContext() {\n LifeCycle.call(this);\n\n /**\n * Context start time\n */\n this.startTime = new Date();\n\n /**\n * The list of trace levels that the logger context knows about\n */\n this.logLevel = new LogLevel();\n\n /**\n * Root logger, final ancestor of all ...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// ZMQ_RECOVERY_IVL: Get multicast recovery interval // // See: http://api.zeromq.org/4-1:zmq-getsockopt#toc34
[ "func (soc *Socket) GetRecoveryIvl() (time.Duration, error) {\n\tv, err := soc.getInt(C.ZMQ_RECOVERY_IVL)\n\treturn time.Duration(v) * time.Millisecond, err\n}" ]
[ "def peers_by_group(self, name):\n \n return czmq.Zlist(lib.zyre_peers_by_group(self._as_parameter_, name), True)" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Calls certain method @param string $methodName Method name, without transport extension (i.e. .xml or .json) @param array $data Method data @return mixed Parsed data from method @throws Exception Exception with error response from the method
[ "public function method($methodName, array $data = array())\n {\n $curl = new CURL();\n $url = $this->url . $methodName . '.json';\n $result = $curl->getURL($url, $data);\n $json = json_decode($result);\n if (!$result) {\n throw new Exception('No response retrieved')...
[ "public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_...
codesearchnet
{ "query": "Represent the Github text about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Programming:" }
@deprecated @param string $hash @param string|null $context @return string
[ "public function getFile(string $hash, ?string $context = null): string\n {\n @trigger_error(\"StorageManager::getFile is deprecated use the getContents or the getResource function\", E_USER_DEPRECATED);\n $resource = $this->read($this->adapters, $hash, $context);\n //TODO:use (if neede) htt...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Save checksum for the specified path info. Args: path_info (dict): path_info to save checksum for. checksum (str): checksum to save.
[ "def save(self, path_info, checksum):\n \n assert path_info[\"scheme\"] == \"local\"\n assert checksum is not None\n\n path = path_info[\"path\"]\n assert os.path.exists(path)\n\n actual_mtime, actual_size = get_mtime_and_size(path)\n actual_inode = get_inode(path)\n...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@param null|string $index @param iterable $attributes @return iterable
[ "protected function filterAttributesOnCreate(?string $index, iterable $attributes): iterable\n {\n if ($index !== null) {\n $pkName = $this->getModelSchemas()->getPrimaryKey($this->getModelClass());\n yield $pkName => $index;\n }\n\n $knownAttrAndTypes = $this->getModel...
[ "public static function castDimensions(Image\\Dimensions $dimensions, array $a, Stub $stub, $isNested, $filter = 0)\n {\n $stub->class .= sprintf(' \"%s\"', (string) $dimensions);\n\n return $a;\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Search Get full file list
[ "function getFileList(branchName = config.baseBranch) {\n logger.debug(`getFileList(${branchName})`);\n return config.storage.getFileList(branchName);\n}" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* Provide an estimate of encoded length of the payload
[ "int guessPayloadLength() {\n int length = 0;\n // Total guess at average size of map entry\n try {\n Map<String,Object> payload = getBodyMap();\n length = payload.size()*60;\n }\n catch (UnsupportedEncodingException e) {\n // No FFDC code needed\n // hmm... how do we figure out a...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the instruction about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code:" }
Assign word to array @param string $word @param int $value @return string
[ "public function addWord($word, $value = 1)\n {\n if (isset($this->wordsArray[$word])) {\n $this->wordsArray[$word] += $value;\n } else {\n $this->wordsArray[$word] = $value;\n }\n }" ]
[ "def backward_word(self, e): # (M-b)\r\n \"\"\"\r\n self.l_buffer.backward_word(self.argument_reset)\r\n self.finalize()" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Open a connection with the server_url and creds, and enumerate instances defined by the functions namespace and classname arguments. Displays either the error return or the mof for instances returned.
[ "def execute_request(server_url, creds, namespace, classname):\n \n\n print('Requesting url=%s, ns=%s, class=%s' % \\\n (server_url, namespace, classname))\n\n try:\n # Create a connection\n CONN = WBEMConnection(server_url, creds,\n default_namespace=names...
[ "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 summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Parses the XML from the legacy database. Returns only the data required by the FieldType, nothing more. @param string $xml @return array
[ "protected function parseLegacyXml($xml)\n {\n $extractedData = array();\n\n $dom = new \\DOMDocument();\n $dom->loadXml($xml);\n\n $ezimageTag = $dom->documentElement;\n\n if (!$ezimageTag->hasAttribute('url')) {\n throw new \\RuntimeException('Missing attribute \"u...
[ "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 about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Create a {@code Key} given its URL safe encoded form. @throws IllegalArgumentException when decoding fails
[ "public static Key fromUrlSafe(String urlSafe) {\n try {\n String utf8Str = URLDecoder.decode(urlSafe, UTF_8.name());\n com.google.datastore.v1.Key.Builder builder = com.google.datastore.v1.Key.newBuilder();\n TextFormat.merge(utf8Str, builder);\n return fromPb(builder.build());\n } catch ...
[ "public final void setTemplateMode(final String templateMode) {\n // Setter overload actually goes against the JavaBeans spec, but having this one is good for legacy\n // compatibility reasons. Besides, given the getter returns TemplateMode, intelligent frameworks like\n // Spring will recogniz...
codesearchnet
{ "query": "Represent the summarization about Encryption:", "pos": "Represent the code about Encryption:", "neg": "Represent the code about programming:" }
Count previous tags of the same name until it reaches a tag name of type stop_tag, then stop counting
[ "def tag_limit_sibling_ordinal(tag, stop_tag_name):\n \n tag_count = 1\n for prev_tag in tag.previous_elements:\n if prev_tag.name == tag.name:\n tag_count += 1\n if prev_tag.name == stop_tag_name:\n break\n\n return tag_count" ]
[ "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:" }
Render image field row @access public @param IFormModel $model model @param string $property model property @param array $options attribute array @return string
[ "public function imageFieldRow(IFormModel $model, $property, array $options = [])\n {\n $element = $this->getField($model, $property);\n $options['id'] = $element['id'];\n\n return Html::openTag('div', $this->getBlock('block', $options)).\n Html::label($model->getLabel($property), $el...
[ "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:" }
// NewTLSConfig validates the TLSSettings and returns the tls.Config with the converted parameters
[ "func NewTLSConfig(s *TLSSettings) (*tls.Config, error) {\n\t// Parse min and max TLS versions\n\tvar min, max uint16\n\tvar err error\n\n\tif s.MinVersion == \"\" {\n\t\tmin = tls.VersionTLS10\n\t} else if min, err = ParseTLSVersion(s.MinVersion); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif s.MaxVersion == \"\"...
[ "func (cc *ClientConn) fallbackToDefaultServiceConfig(sc string) bool {\n\tif cc.dopts.disableServiceConfig {\n\t\treturn true\n\t}\n\t// The logic below is temporary, will be removed once we change the resolver.State ServiceConfig field type.\n\t// Right now, we assume that empty service config string means resolv...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Validate email @return boolean
[ "public function isValid() {\n $valid = parent::isValid();\n if (!filter_var($this->getValue(), FILTER_VALIDATE_EMAIL)) {\n $valid = false;\n }\n \n return $valid;\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github text about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code about programming:" }
// GetV1 implements ChatServiceHandler.GetV1.
[ "func (c *chatServiceHandler) GetV1(ctx context.Context, opts getOptionsV1) Reply {\n\tvar rlimits []chat1.RateLimit\n\tclient, err := GetChatLocalClient(c.G())\n\tif err != nil {\n\t\treturn c.errReply(err)\n\t}\n\n\tconv, rlimits, err := c.findConversation(ctx, opts.Channel)\n\tif err != nil {\n\t\treturn c.errRe...
[ "func (ProxyQueryServiceAsyncBridge) Check(context.Context) check.Response {\n\treturn check.Response{Name: \"Query Service\", Status: check.StatusPass}\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:" }
// See forminfo.go for format.
[ "func makeEntry(f *FormInfo, c *Char) uint16 {\n\te := uint16(0)\n\tif r := c.codePoint; HangulBase <= r && r < HangulEnd {\n\t\te |= 0x40\n\t}\n\tif f.combinesForward {\n\t\te |= 0x20\n\t}\n\tif f.quickCheck[MDecomposed] == QCNo {\n\t\te |= 0x4\n\t}\n\tswitch f.quickCheck[MComposed] {\n\tcase QCYes:\n\tcase QCNo:\...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
This method registers the {@link #registerToplevelSecurityException(Class) top-level security exceptions}. You may override it to add additional or other classes.
[ "protected void registerToplevelSecurityExceptions() {\n\n this.securityExceptions.add(SecurityException.class);\n this.securityExceptions.add(SecurityErrorUserException.class);\n registerToplevelSecurityExceptions(\"org.springframework.security.access.AccessDeniedException\");\n registerToplevelSecurit...
[ "void forceLoggingViaChildLogger(LogRecord record) {\n // Assume that nobody else will configure or manipulate loggers with this \"secret\" name.\n Logger forcingLogger = getForcingLogger(logger);\n\n // This logger can be garbage collected at any time, so we must always reset any configuration.\n // Th...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Calculates a percentile based on a continuous distribution of the column value @param arg argument @return percentile_cont(arg)
[ "public static <T extends Number> WithinGroup<T> percentileCont(T arg) {\n if (arg.doubleValue() < 0.0 || arg.doubleValue() > 1.0) {\n throw new IllegalArgumentException(\"The percentile value should be a number between 0 and 1\");\n }\n return percentileCont(ConstantImpl.create(arg)...
[ "function(dvi, di) {\n var dim = msg.structure.dimensions.observation[di];\n // Calculate the key position for the dimension index\n var pos = dimPosition(dim);\n // Update the obskey with the dimension value\n obsKey[pos] = dim.values[dvi].id;\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Write the logging configuration to the {@code logging.properties} file. @param context the context used to determine the file location.
[ "public void writeConfiguration(final OperationContext context) {\n final String loggingConfig;\n switch (context.getProcessType()) {\n case DOMAIN_SERVER: {\n loggingConfig = FileResolver.resolvePath(context, \"jboss.server.data.dir\", PROPERTIES_FILE);\n brea...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// GetNamespaces returns a list of namespaces
[ "func (c *Client) GetNamespaces() ([]services.Namespace, error) {\n\tout, err := c.Get(c.Endpoint(\"namespaces\"), url.Values{})\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\tvar re []services.Namespace\n\tif err := utils.FastUnmarshal(out.Bytes(), &re); err != nil {\n\t\treturn nil, trace.Wrap(err)\n...
[ "func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
@param string $index @param UriInterface $requestUri @param CrudInterface $crud @param JsonSchemasInterface $jsonSchemas @param EncoderInterface $encoder @return ResponseInterface
[ "protected static function defaultCreateResponse(\n string $index,\n UriInterface $requestUri,\n CrudInterface $crud,\n JsonSchemasInterface $jsonSchemas,\n EncoderInterface $encoder\n ): ResponseInterface {\n $model = $crud->read($index);\n assert($model !== null...
[ "public function createService(ServiceLocatorInterface $serviceLocator)\n {\n if ($serviceLocator instanceof ServiceLocatorAwareInterface) {\n $serviceLocator = $serviceLocator->getServiceLocator();\n }\n /** @var ServiceLocatorInterface $domainManager */\n $domainManager =...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Return an instance of the given class name. Cache the created instance so the same one is returned on multiple calls. @param string $class @return mixed @throws \Ellipse\Container\Exceptions\ReflectionContainerException
[ "private function make(string $class)\n {\n if (! array_key_exists($class, $this->instances)) {\n\n try {\n\n return $this->instances[$class] = ($this->factory)($class)->value($this);\n\n }\n\n catch (ResolvingExceptionInterface $e) {\n\n thro...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Returns child components. @return ReadonlyObjectCollection
[ "public function children()\n {\n if ($this->readonlyCollection === null) {\n $this->readonlyCollection = new ReadonlyObjectCollection(\n $this->writableChildren()\n );\n }\n\n return $this->readonlyCollection;\n }" ]
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Mark this breakpoint as final state and record the current timestamp. Example: ``` $breakpoint->finalize(); ```
[ "public function finalize()\n {\n list($usec, $sec) = explode(' ', microtime());\n $micro = sprintf(\"%06d\", $usec * 1000000);\n $when = new \\DateTime(date('Y-m-d H:i:s.' . $micro));\n $when->setTimezone(new \\DateTimeZone('UTC'));\n $this->finalTime = $when->format('Y-m-d\\T...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Wrap a connection along its {@link Origin} reference. @param connection @param pool @param <T> @return
[ "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n static <T> T wrapConnection(T connection, Origin<T> pool) {\n\n ReturnObjectOnCloseInvocationHandler<T> handler = new ReturnObjectOnCloseInvocationHandler<T>(connection, pool);\n\n Class<?>[] implementedInterfaces = connection.getClass().getInte...
[ "@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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
:param job_homedir: explicit value for home directory, used for testing purposes :rtype: string :returns: path to output directory Returns the output directory, where all outputs are created, and uploaded from
[ "def get_output_dir(job_homedir=None):\n '''\n \n '''\n if job_homedir is not None:\n home_dir = job_homedir\n else:\n home_dir = environ.get('HOME')\n odir = os.path.join(home_dir, 'out')\n return odir" ]
[ "def get_root_path(self, name):\n \n module = modules.get(name)\n if module is not None and hasattr(module, '__file__'):\n return dirname(abspath(module.__file__))\n\n # Flask keeps looking at this point. We instead set the root path to None,\n # assume that the user do...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<p> A list of the SSH public keys assigned to IAM user. </p> @return A list of the SSH public keys assigned to IAM user.
[ "public java.util.List<SSHPublicKeyMetadata> getSSHPublicKeys() {\n if (sSHPublicKeys == null) {\n sSHPublicKeys = new com.amazonaws.internal.SdkInternalList<SSHPublicKeyMetadata>();\n }\n return sSHPublicKeys;\n }" ]
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns the average value of the current array. @param int $decimals <p>The number of decimal-numbers to return.</p> @return float|int <p>The average value.</p>
[ "public function average($decimals = 0)\n {\n $count = \\count($this->getArray(), \\COUNT_NORMAL);\n\n if (!$count) {\n return 0;\n }\n\n if (!\\is_int($decimals)) {\n $decimals = 0;\n }\n\n return \\round(\\array_sum($this->getArray()) / $count, $d...
[ "public static function up(Float $number, Int $count = 0) : Float\n {\n if( $count === 0 )\n {\n return ceil($number);\n }\n\n $numbers = explode(\".\", $number);\n\n $edit = 0;\n\n if( ! empty($numbers[1]) )\n {\n $edit = substr($numbers[1],...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
TODO : check if formly or easy form generato fields model by default or if both -> easy for generator is chosen
[ "function loadFieldsModel(){\n\t\t\tconst initialFieldsModel = angular.isArray(scope.edaEasyFormViewerEasyFormGeneratorFieldsModel)\n ? loadExistingConfigurationModel(scope.edaEasyFormViewerEasyFormGeneratorFieldsModel) //translate easy form generator to formly fields model\n\t\t\t\t: {};\n\t\t\treturn initi...
[ "def set_form_row\n return :UNHANDLED if @current_component.nil?\n cc = @current_component\n $log.debug \"STACKFLOW #{@name} set_form_row calling sfr for #{cc.name}, r #{cc.row} c: #{cc.col} \"\n $log.debug \" STACKFLOW on enter sfr #{@current_component.name} #{@current_component} \"\n\n @...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
rally point commands
[ "def cmd_rally(self, args):\n ''''''\n #TODO: add_land arg\n if len(args) < 1:\n self.print_usage()\n return\n\n elif args[0] == \"add\":\n self.cmd_rally_add(args[1:])\n\n elif args[0] == \"move\":\n self.cmd_rally_move(args[1:])\n\n ...
[ "def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Creates a new signature. @internal @return Signature
[ "public static function create(string $signature, array $protectedHeader, ?string $encodedProtectedHeader, array $header = []): self\n {\n return new self($signature, $protectedHeader, $encodedProtectedHeader, $header);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Возвращает бинарные данные со ссылки с вспомогательными данными, такими, как тип MIME, имя файла и расширение, если есть и т.д. По умолчанию использует кеширование в течении 1 часа.
[ "static function get_bin($url, $curl_options = array())\n\t{\n\t\t$original_url = $url;\n\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt_array($ch, array(\n\t\t\tCURLOPT_TIMEOUT => defval($curl_options, 'timeout', 15),\n\t\t\tCURLOPT_FOLLOWLOCATION => true,\n\t\t\tCURLOPT_MAXREDIRS => 22,\n\t\t\tCURLOPT_ENCODING => '...
[ "private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Remove all words at, or below, the provided threshold Args: threshold (int): The threshold at which a word is to be \ removed
[ "def remove_by_threshold(self, threshold=5):\n \n keys = [x for x in self._dictionary.keys()]\n for key in keys:\n if self._dictionary[key] <= threshold:\n self._dictionary.pop(key)\n self._update_dictionary()" ]
[ "def kernel(self):\n \n stop_words = [ y.lower() for y in self.abbreviations.values() + self.filler_words ]\n kernel = ' '.join([ x for x in self.expand().split() if x.lower() not in stop_words ])\n\n # this is a hack to get around the fact that this is the only two-word phrase we want t...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
同 System.out.println()方法,打印控制台日志 @param t 异常对象 @param template 文本模板,被替换的部分用 {} 表示 @param values 值
[ "public static void log(Throwable t, String template, Object... values) {\r\n\t\tout.println(StrUtil.format(template, values));\r\n\t\tif (null != t) {\r\n\t\t\tt.printStackTrace();\r\n\t\t\tout.flush();\r\n\t\t}\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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Writes a .zip file in Google Transit format.
[ "def Write(self, outpath):\n \"\"\n out = zipfile.ZipFile(outpath, mode=\"w\", compression=zipfile.ZIP_DEFLATED)\n for filename, func in [('agency.txt', self.WriteAgency),\n ('calendar.txt', self.WriteCalendar),\n ('calendar_dates.txt', self.WriteCalendar...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Adds the specified element to the end of this bag. if needed also increases the capacity of the bag.
[ "public void add (E e) {\n\t\t// is size greater than capacity increase capacity\n\t\tif (size == data.length) {\n\t\t\tgrow();\n\t\t}\n\n\t\tdata[size++] = e;\n\t}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create an instance of {@link JAXBElement }{@code <}{@link OffsetCurveType }{@code >} @param value Java instance representing xml element's value. @return the new instance of {@link JAXBElement }{@code <}{@link OffsetCurveType }{@code >}
[ "@XmlElementDecl(namespace = \"http://www.opengis.net/gml\", name = \"OffsetCurve\", substitutionHeadNamespace = \"http://www.opengis.net/gml\", substitutionHeadName = \"_CurveSegment\")\n public JAXBElement<OffsetCurveType> createOffsetCurve(OffsetCurveType value) {\n return new JAXBElement<OffsetCurveTy...
[ "@Nonnull\n public static <T> UBL21WriterBuilder <T> create (@Nonnull final Class <T> aClass)\n {\n return new UBL21WriterBuilder <> (aClass);\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// GetSysValFromString returns either 1 or 0 in a single byte.
[ "func (b *BinaryAttribute) GetSysValFromString(userVal string) []byte {\n\tf, err := strconv.ParseFloat(userVal, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tret := make([]byte, 1)\n\tif f > 0 {\n\t\tret[0] = 1\n\t}\n\treturn ret\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:" }
// Read returns raw session store by session ID.
[ "func (p *RedisProvider) Read(sid string) (session.RawStore, error) {\n\tpsid := p.prefix + sid\n\tif !p.Exist(sid) {\n\t\tif err := p.c.SetEx(psid, p.duration, \"\").Err(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tvar kv map[interface{}]interface{}\n\tkvs, err := p.c.Get(psid).Result()\n\tif err != nil...
[ "@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 comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Runs the report once all initialization is complete.
[ "protected void dispatch(Throwable object, boolean child) {\n if (object instanceof CompilationFailedException) {\n report((CompilationFailedException) object, child);\n } else if (object instanceof GroovyExceptionInterface) {\n report((GroovyExceptionInterface) object, child);\n...
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Throws a lexer-exception. The current line and offset of the exception get automatically appended to the message @param string $message A meaningful error message @throws Exception
[ "protected function throwException($message)\n {\n\n $near = $this->isAtEnd() ? 'END' : $this->peek(10);\n $message = \"Failed to lex jade: $message (Line: {$this->line}, Offset: {$this->offset}, Near: `$near`)\";\n throw new Exception($message);\n }" ]
[ "def get_value(self, context):\n \"\"\"\"\"\"\n if self.value:\n return expressions.eval_string(self.value, context)\n else:\n # Empty input raises cryptic EOF syntax err, this more human\n # friendly\n raise ValueError('!py string expression is empty...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// SessionRegenerate Generate new sid for file session. // it delete old file and create new file named from new sid.
[ "func (fp *FileProvider) SessionRegenerate(oldsid, sid string) (Store, error) {\n\tfilepder.lock.Lock()\n\tdefer filepder.lock.Unlock()\n\n\terr := os.MkdirAll(path.Join(fp.savePath, string(oldsid[0]), string(oldsid[1])), 0777)\n\tif err != nil {\n\t\tSLogger.Println(err.Error())\n\t}\n\terr = os.MkdirAll(path.Join...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Return all or a single query parameter as a URI compatible string. @param string $id Optional parameter name. @param boolean $array return the array format or not @return null|string|array
[ "public function params($id = null, $array = false)\n {\n $config = Grav::instance()['config'];\n $sep = $config->get('system.param_sep');\n\n $params = null;\n if ($id === null) {\n if ($array) {\n return $this->params;\n }\n $output = ...
[ "public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
@see parent::setContentHeader() @param $contentType @param string $charset @return Controller
[ "public function setContentHeader($contentType, $charset = 'UTF-8')\n {\n if (!$this->response) {\n return $this->getResponse()->setContentHeader($contentType, $charset);\n }\n return parent::setContentHeader($contentType, $charset);\n }" ]
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
[ "func (nb *nb) MonthAbbreviated(month time.Month) string {\n\treturn nb.monthsAbbreviated[month]\n}" ]
[ "func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about datetime:" }
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ "func (in *ExportOptions) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}" ]
[ "function customizer(destination, source) {\n // If we're not working with a plain object, copy the value as is\n // If source is an array, for instance, it will replace destination\n if (!isPlain(source)) {\n return source;\n }\n\n // If the new value is a plain object but the first object value is not\n ...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param \DateInterval $interval @return $this|\DateTime|Time @throws \RuntimeException Frozen. @throws \Exception Propagated.
[ "public function add(/*\\DateInterval*/ $interval) : \\DateTime /*self invariant*/\n {\n // NB: Argument type hinting (\\DateInterval $interval)\n // would provoke E_WARNING when cloning.\n // Catch 22: Specs say that native \\DateTime method is type hinted,\n // but warning when clon...
[ "private function handleErrorUnit(Invoke\\Error $unit): Result\\AbstractResult\n {\n return new Result\\Error(null, $unit->getBaseException());\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Adds a custom converter to the model. @param converter custom converter @deprecated use {@link #convertWith(org.javalite.activejdbc.conversion.Converter, String...)} instead
[ "@Deprecated\n protected static ValidationBuilder convertWith(org.javalite.activejdbc.validation.Converter converter) {\n return ModelDelegate.convertWith(modelClass(), converter);\n }" ]
[ "public <V> Function<Cursor, V> cursorToBean(Class<V> api)\n {\n return (FindDataVault<ID,T,V>) _valueBeans.get(api);\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetHandlePid set the window handle by pid
[ "func SetHandlePid(pid int32, args ...int32) {\n\tvar isHwnd int32\n\tif len(args) > 0 {\n\t\tisHwnd = args[0]\n\t}\n\n\tC.set_handle_pid_mData(C.uintptr(pid), C.uintptr(isHwnd))\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Updates an existing MetaTag model. If update is successful, the browser will be redirected to the 'view' page. @param integer $id @return mixed
[ "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if (!\\Yii::$app->user->can('update', ['model' => $model]))\n throw new ForbiddenHttpException(Module::t('metaTag', 'Access denied.'));\n \n if ($model->load(\\Yii::$app->request->post()) && $model->...
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Natural Language Processing:" }
handle an incoming mavlink packet
[ "def process_mavlink_packet(self, m):\n ''''''\n mtype = m.get_type()\n\n # if you add processing for an mtype here, remember to add it\n # to mavlink_packet, above\n if mtype in ['WAYPOINT_COUNT','MISSION_COUNT']:\n if (self.num_wps_expected == 0):\n #I ...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Connect app paths to the Application @param array $paths @return void
[ "public function bindPaths(array $paths)\n {\n foreach($paths as $key => $val)\n {\n $paths[$key] = realpath($val);\n }\n\n return $paths;\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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get a Map of process name/alias to process config name A config may be reused under multiple aliases @param nameList a list of process names conforming to the processNameListPattern
[ "public static Map<String,String> getNamesWithAliases(String nameList) {\n String[] names = nameList.split(\",\");\n Map<String,String> results = new LinkedHashMap<>(); //retain ordering / determinism\n for ( String p : names) {\n String configName = p.trim();\n\n if ( co...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
// SetQuery sets a new URL query param field. // If another query param exists with the same key, it will be overwritten.
[ "func (r *Request) SetQuery(name, value string) *Request {\n\tr.Use(query.Set(name, value))\n\treturn r\n}" ]
[ "function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetRequestPayer sets the RequestPayer field's value.
[ "func (s *DeleteObjectsInput) SetRequestPayer(v string) *DeleteObjectsInput {\n\ts.RequestPayer = &v\n\treturn s\n}" ]
[ "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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Grant access to create a new layout by common group settings @return GrantResult
[ "private function GrantCreateLayout()\n {\n $groups = $this->GetGroups();\n foreach ($groups as $group)\n {\n if ($group->GetCreateLayouts())\n {\n return GrantResult::Allowed();\n }\n }\n return GrantResult::NoAccess();\n }" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Perform a length assertion. @param string|array|Countable $countable @param $length @param string $message
[ "public function lengthOf($countable, $length, $message = '')\n {\n $this->assertion->setActual($countable);\n\n return $this->assertion->to->have->length($length, $message);\n }" ]
[ "public static function optionalIsNotSuffix(Input $definition): self\n {\n $pointer = self::createPointerString($definition->getInput(), $definition->getIndex());\n\n return new self(\"Optional sequence cannot be followed by anything else:\\n$pointer\");\n }" ]
codesearchnet
{ "query": "Represent the post about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Programming:" }
Recursively creates a directory @param string $folder Name of folder to create @note Adapted from the PHP manual comment 76612
[ "public function mkdirr($folder)\n {\n $folders = preg_split(\"#[\\\\\\\\/]#\", $folder);\n $base = '';\n for($i = 0, $c = count($folders); $i < $c; $i++) {\n if(empty($folders[$i])) {\n if (!$i) {\n // special case for root level\n ...
[ "public function parameters()\n {\n $parameters = parent::parameters();\n if (!isset($parameters['VALUE']) && in_array($this->name, ['URL', 'PHOTO'])) {\n // If we are encoding a URI value, and this URI value has no\n // VALUE=URI parameter, we add it anyway.\n //\n...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// actionClientCommand is the client action
[ "func actionClientCommand(ctx *cli.Context) error {\n\treturn client.New(&client.Config{\n\t\tAuthorizer: ctx.String(\"authorizer\"),\n\t\tInterval: ctx.Duration(\"interval\"),\n\t\tKubeAPI: ctx.String(\"kubeapi-url\"),\n\t\tKubeConfigPath: ctx.String(\"kubeconfig\"),\n\t\tNodeURL: ...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// MarshalText implements the encoding.TextMarshaler interface and // encodes the game's PGN.
[ "func (g *Game) MarshalText() (text []byte, err error) {\n\treturn []byte(encodePGN(g)), nil\n}" ]
[ "func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }