query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Run the migrations. @return void
[ "public function up()\n {\n // only thing to change is the version number\n\n /** @var \\LCI\\Blend\\Blendable\\SystemSetting $systemSetting */\n $systemSetting = $this->blender->getBlendableLoader()->getBlendableSystemSetting('blend.version');\n $systemSetting\n ->setSeeds...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the Github summarization about Database management:", "pos": "Represent the Github code about Database management:", "neg": "Represent the Github code about programming:" }
this is for times we need to check if a media file is an actual media file Note: this does not download the file only checks if the return code is valid
[ "public function isValid() \n {\n $headers = get_headers($this->url);\n $header = $headers[0]; // the result code\n $type = $headers[sizeof($headers) - 1]; // content type\n $m = array();\n\n if (preg_match(\"/\\d{3}/\", $header, $m)) {\n\n if (substr($m[0], 0, 1) == \"2\")\n ...
[ "def uri_from(url)\n # This will raise an InvalidURIError if the URL is very wrong. It will\n # still pass for strings like \"foo\", though.\n url = URI(url)\n\n # We need to check if the URL was either http://, https:// or ftp://,\n # because these are the only ones we can download from. o...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Get all values or a single one from an input type. @param string $source @param string $key @param mixed $default @return mixed
[ "protected function input( $source, $key = '', $default = null ) {\n\t\t$source = isset( $this->{$source} ) && is_array( $this->{$source} ) ? $this->{$source} : [];\n\n\t\tif ( empty( $key ) ) {\n\t\t\treturn $source;\n\t\t}\n\n\t\treturn Arr::get( $source, $key, $default );\n\t}" ]
[ "public function getStoreValue($data = null)\n {\n\n // If Overrite Value\n if (isset($this->value) && $this->overwriteValue) {\n return $this->value;\n }\n\n // If user have user input value\n if ($data != null && isset($data[$this->getName()])) {\n\n // ...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Check if the given value is expected. @param $value @return bool
[ "protected function isExpected($value)\n {\n if ($expected = $this->getValue()) {\n $this->setActualValue($value);\n\n return $this->getActualValue() === $expected;\n }\n\n return true;\n }" ]
[ "public StringAssert isString() {\n Node node = assertType(STRING);\n return new StringAssert((String) node.getValue()).as(\"Different value found in node \\\"%s\\\"\", path);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Build the URL from the pre-created parameters. @param params The parameters for the method @return Builder object
[ "public URL buildUrl(final TmdbParameters params) {\n StringBuilder urlString = new StringBuilder(TMDB_API_BASE);\n\n LOG.trace(\"Method: '{}', Sub-method: '{}', Params: {}\", method.getValue(), submethod.getValue(),\n ToStringBuilder.reflectionToString(params, ToStringStyle.SHORT_PREFI...
[ "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 summarization about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about Natural Language Processing:" }
Notificaiton that one of the configuration option has changed state @param e The event describing the change of state
[ "public void itemStateChangedHandler(ItemEvent e) {\r\n\t\tString valueName = (String) controlToValueName.get(e.getSource());\r\n\t\tLinearInterpolator value = (LinearInterpolator) valueMap.get(valueName);\r\n\r\n\t\tif (e.getStateChange() == ItemEvent.SELECTED) {\r\n\t\t\tvalue.setActive(true);\r\n\t\t\teditor.reg...
[ "def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return true if graph with name graph_name has field with name field_name. @param graph_name: Graph Name @param field_name: Field Name. @return: Boolean
[ "def graphHasField(self, graph_name, field_name):\n \n graph = self._graphDict.get(graph_name, True)\n return graph.hasField(field_name)" ]
[ "def set_target_ref(self, value):\n \n if value is None or not isinstance(value, str):\n raise TypeError(\"TargetRef is required and must be set to a String\")\n else:\n self.__target_ref = value" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
----------------------------------------------------
[ "@SuppressWarnings(\"rawtypes\")\r\npublic static Object getMappedProperty(Object bean, String name, String key)\r\n throws IllegalAccessException, InvocationTargetException, NoSuchMethodException,Exception\r\n {\r\n if(bean == null)\r\n throw new IllegalArgumentException(\"No bean specified...
[ "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 about language and writing:", "pos": "Represent the code about language and writing:", "neg": "Represent the code:" }
Removes the database of id $dbid from the internal KeePassPHP database. @param $dbid A database ID. @param $kphpdbPwd The password of the KphpDB file. @return true if the database $dbid existed and could be removed, false otherwise.
[ "public static function removeDatabase($dbid, $kphpdbPwd)\r\n\t{\r\n\t\tif(!self::$_started)\r\n\t\t{\r\n\t\t\tself::addDebug(\"KeepassPHP is not started!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$kphpdb = self::openKphpDB($dbid, $kphpdbPwd);\r\n\t\t\t$hash = $kphpdb->getDBFileHash();\r\...
[ "public function getPropertyValue($propertyName, $objectId = null)\n {\n\n //You can return this protected properties as objects too.\n if (in_array($propertyName, array(\"objectId\", \"objectType\", \"objectURI\")) && isset($this->$propertyName)) {\n return $this->$propertyName;\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Use this API to count the filtered set of lbmonbindings_service_binding resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
[ "public static long count_filtered(nitro_service service, String monitorname, String filter) throws Exception{\n\t\tlbmonbindings_service_binding obj = new lbmonbindings_service_binding();\n\t\tobj.set_monitorname(monitorname);\n\t\toptions option = new options();\n\t\toption.set_count(true);\n\t\toption.set_filter...
[ "def list(self, mask=None):\n \n if mask is None:\n mask = \"mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]\"\n groups = self.client.call('Account', 'getPlacementGroups', mask=mask, iter=True)\n return groups" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Writes a big-endian 24-bit medium integer to the buffer.
[ "@SuppressWarnings(\"deprecation\")\n public static ByteBuf writeMediumBE(ByteBuf buf, int mediumValue) {\n return buf.order() == ByteOrder.BIG_ENDIAN? buf.writeMedium(mediumValue) : buf.writeMediumLE(mediumValue);\n }" ]
[ "def write_tag(tag)\n # Group 0002 is always little endian, but the rest of the file may be little or big endian.\n # When we shift from group 0002 to another group we need to update our endian/explicitness variables:\n switch_syntax_on_write if tag.group != META_GROUP and @switched == false\n #...
codesearchnet
{ "query": "Represent the Github instruction about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Programming:" }
This is called by the container when a MESSAGE message arrives.
[ "protected void doMessage(SipServletRequest request) throws \r\n ServletException, IOException {\r\n\r\n request.createResponse(SipServletResponse.SC_OK).send(); \r\n\r\n Object message = request.getContent();\r\n String from = request.getFrom().getURI().toString();\r\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 summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Gets the first value of the given data type. @param dataType the data type to look for or null for the "unknown" data type @return the value or null if not found
[ "public String first(ICalDataType dataType) {\n\t\tString dataTypeStr = toLocalName(dataType);\n\t\treturn first(dataTypeStr);\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 summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// Marshal passes through to proto.Marshal
[ "func (p ProtobufImpl) Marshal(msg proto.Message) ([]byte, error) {\n\tres, err := proto.Marshal(msg)\n\treturn res, errors.WithStack(err)\n}" ]
[ "func init() {\n\t// take an output from a print function\n\toutput := pio.Wrap(logrus.Errorf)\n\t// register a new printer with name \"logrus\"\n\t// which will be able to read text and print as string.\n\tpio.Register(\"logrus\", output).Marshal(pio.Text)\n\n\t// p := pio.Register(\"logrus\", output).Marshal(pio....
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Sets the is_sortable variable to the given boolean, sort_default_column to the given string, and the sort_default_order to the given integer. @param bool $bool @param string $defaultcolumn @param int $defaultorder @return void
[ "function sortable($bool, $defaultcolumn = NULL, $defaultorder = SORT_ASC) {\n $this->is_sortable = $bool;\n $this->sort_default_column = $defaultcolumn;\n $this->sort_default_order = $defaultorder;\n }" ]
[ "protected function showsTopParentsOnly()\n {\n $relation = $this->getModelInformation()->list->default_top_relation;\n\n // If the default is to restrict to top-level only,\n // or the reverse with a user-initiated reversal (relation = false):\n // Restrict the query to top level.\n\...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Return the approximate size of the queue.
[ "def qsize(self, qname):\n \"\"\"\"\"\"\n if qname in self._queues:\n return self._queues[qname].qsize()\n else:\n raise ValueError(_(\"queue %s is not defined\"), qname)" ]
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Return a proper object
[ "def factory(cls, object_source):\n \n if object_source.type is ObjectRaw.Types.object:\n return ObjectObject(object_source)\n elif object_source.type not in ObjectRaw.Types or object_source.type is ObjectRaw.Types.type:\n return ObjectType(object_source)\n elif obj...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Get/Set document title. @param null|string $title title to set @return mixed
[ "public function title($title = null)\n {\n if ($title === null) {\n return $this->_title;\n }\n $this->_title = $title;\n\n return $this;\n }" ]
[ "public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
If the map has a define serializer for the given attr, run it.
[ "function(map, attr, val) {\n\tvar serializer = attr === \"*\" ? false : getPropDefineBehavior(\"serialize\", attr, map.define);\n\tif (serializer === undefined) {\n\t\treturn oldSingleSerialize.call(map, attr, val);\n\t} else if (serializer !== false) {\n\t\treturn typeof serializer === \"function\" ? serializer.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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// FindOptionByShortName finds an option that is part of the command, or any of // its parent commands, by matching its long name (including the option // namespace).
[ "func (c *Command) FindOptionByShortName(shortName rune) (option *Option) {\n\tfor option == nil && c != nil {\n\t\toption = c.Group.FindOptionByShortName(shortName)\n\n\t\tc, _ = c.parent.(*Command)\n\t}\n\n\treturn option\n}" ]
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Record a prepare operation. @param preparedOperation the prepared operation
[ "void recordPreparedOperation(final TransactionalProtocolClient.PreparedOperation<ServerTaskExecutor.ServerOperation> preparedOperation) {\n recordPreparedTask(new ServerTaskExecutor.ServerPreparedResponse(preparedOperation));\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 text:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
// Destination returns the deployment destination for an environment in app spec data
[ "func Destination(data []byte, environment string) (*v1alpha1.ApplicationDestination, error) {\n\tvar appSpec struct {\n\t\tEnvironments map[string]struct {\n\t\t\tDestination v1alpha1.ApplicationDestination\n\t\t}\n\t}\n\terr := yaml.Unmarshal(data, &appSpec)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could ...
[ "@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 Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Format an email object @param object $oEmail The raw email object @return void @throws \Nails\Common\Exception\FactoryException
[ "protected function formatObject(&$oEmail)\n {\n $oEmail->type = !empty($this->aEmailType[$oEmail->type]) ? $this->aEmailType[$oEmail->type] : null;\n\n if (empty($oEmail->type)) {\n throw new NailsException(\n 'Invalid Email Type: email with ID #' . $oEmail->id . ' has an...
[ "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 Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Formatter for human-readable time Only handles time up to 60 minutes gracefully @param double $time @param integer $percision @return string
[ "protected function getReadableTime($time, $percision = 3)\n {\n $unit = 's';\n if ($time < 1) {\n $time *= 1000;\n $percision = 0;\n $unit = 'ms';\n } elseif ($time > 60) {\n $time /= 60;\n $unit = 'm';\n }\n $time = numbe...
[ "def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns the size of a file in bytes. :param f: Filename :param unit: Return the byte size in these units (gigabytes, etc.). :return:
[ "def size(f, unit='B', fileStore=None):\n \n divisor = return_bytes(unit)\n fileID = process_infile(f, fileStore)[0]\n return fileID.size / divisor" ]
[ "def initialize(self, timestamp=None, user=None, comment=None,\n filename=None, source=None, size=None):\n\n self.timestamp = none_or(timestamp, Timestamp)\n \n\n self.user = none_or(user, User)\n \"\"\"\n Contributing user metadata : :class:`~mwtypes.User`\n ...
codesearchnet
{ "query": "Represent the Github sentence about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
Returns the StringSyntax instance. @return Tarsana\Syntax\StringSyntax
[ "public static function instance() : StringSyntax\n {\n if (self::$instance === null)\n self::$instance = new StringSyntax;\n return self::$instance;\n }" ]
[ "def DeserializeExclusiveData(self, reader):\n \n self.Type = TransactionType.StateTransaction\n\n self.Descriptors = reader.ReadSerializableArray('neo.Core.State.StateDescriptor.StateDescriptor')" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Evaluates a reverse polish notation token list
[ "private static Requirement evaluateReversePolishNotation(Iterator<Tokenizer.Token> iterator, Semver.SemverType type) {\n try {\n Tokenizer.Token token = iterator.next();\n\n if (token.type == Tokenizer.TokenType.VERSION) {\n if (\"*\".equals(token.value) || (type == Semv...
[ "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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Hook containing the actual save code. Call's afterSave() for user interaction. @see afterSave()
[ "public function saveData()\n {\n $model = $this->getModel();\n\n if ($this->formData['gto_valid_until']) {\n // Make sure date based units are valid until the end of the day.\n $date = new \\MUtil_Date(\n $this->formData['gto_valid_until'],\n ...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Hide the popup, but only after the current event has been processed.<p>
[ "public void hideDelayed() {\n\n // The reason for using this function, instead of calling hide directly, is that\n // the latter leads to harmless but annoying Javascript errors when called from\n // Javascript inside the IFrame, since the IFrame is closed before the function returns.\n ...
[ "public void discardHeaderClick(ClickEvent event) {\n if (event == null) return;\n\n // Example: we use radioset on collapsible header, so stopPropagation() is needed\n // to suppress collapsible open/close behavior.\n // But preventDefault() is not needed, otherwise radios won't switch....
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Wraps input field in input group container that allows prepending and appending text or html. Example: text_field(:value, bootstrap: {prepend: "$.$$"}}) text_field(:value, bootstrap: {append: {html: "<button>Go</button>"}}})
[ "def draw_input_group(bootstrap, errors, &block)\n prepend_html = draw_input_group_content(bootstrap, :prepend)\n append_html = draw_input_group_content(bootstrap, :append)\n\n help_text = draw_help(bootstrap.help)\n\n # Not prepending or appending anything. Bail.\n if prepend_html.blank...
[ "def make_sample():\n \n if md_sample:\n # user has set another:\n return md_sample\n _md = []\n for hl in range(1, 7): _md.append('#' * hl + ' ' + 'Header %s' % hl)\n this = open(__file__).read().split('\"\"\"', 3)[2].splitlines()[:10]\n _md.append('```python\\n\"\"\" Test \"\"\"\\n...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NewCounter returns a counter, sending observations to this Influxstatsd object.
[ "func (d *Influxstatsd) NewCounter(name string, sampleRate float64) *Counter {\n\td.rates.Set(name, sampleRate)\n\treturn &Counter{\n\t\tname: name,\n\t\tobs: d.counters.Observe,\n\t}\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Deletes given contact. @param Contact $contact @return bool @throws \Exception
[ "public function deleteContact(Contact $contact)\n {\n if ($this !== $contact->contactable()->first())\n return false;\n\n return $contact->delete();\n }" ]
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Show information on salactus workers. (slow)
[ "def workers():\n \"\"\"\"\"\"\n counter = Counter()\n for w in Worker.all(connection=worker.connection):\n for q in w.queues:\n counter[q.name] += 1\n import pprint\n pprint.pprint(dict(counter))" ]
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Converts the Response object body to an array @return array
[ "public function bodyToArray()\n {\n // Getting response content\n $xmlContent = $this->response->getContent();\n\n // Wrapping it into a Xml reader object and convert it to array\n $xmlReader = new Xml();\n return $xmlReader->fromString($xmlContent);\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// doTick handles the ticker goroutine of the timer system
[ "func (t *TimeoutWheel) doTick() {\r\n\tvar expiredList timeoutList\r\n\r\n\tticker := time.NewTicker(t.tickInterval)\r\n\tfor range ticker.C {\r\n\t\tatomic.AddUint64(&t.ticks, 1)\r\n\r\n\t\tmtx := t.lockBucket(t.ticks)\r\n\t\tif t.state != running {\r\n\t\t\tmtx.Unlock()\r\n\t\t\tbreak\r\n\t\t}\r\n\r\n\t\tbucket ...
[ "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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
@param string $sessionid @return bool @throws \Koldy\Config\Exception @throws \Koldy\Exception
[ "public function destroy($sessionid)\n {\n if ($this->disableLog) {\n Log::temporaryDisable('sql');\n }\n\n try {\n $this->getAdapter()->delete($this->getTableName())->where('id', $sessionid)->exec();\n return true;\n\n } catch (DbException $e) {\n ...
[ "public static function disable()\n {\n Pool::createPool();\n\n static::$pool->config->setDisabled(true);\n static::$pool->createClass('Brainworxx\\\\Krexx\\\\Controller\\\\DumpController')\n ->noFatalForKrexx();\n\n Config::$disabledByPhp = true;\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Reload the current model instance with fresh attributes from the database. @return $this
[ "public function refresh()\n {\n if (! $this->exists) {\n return $this;\n }\n\n $this->setRawAttributes(\n static::newQueryWithoutScopes()->findOrFail($this->getKey())->attributes\n );\n\n $this->load(collect($this->relations)->except('pivot')->keys()->toA...
[ "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:" }
gets filter params from session @return String
[ "protected function getParams($key = null)\n {\n $params = $this->session->get(uri());\n return !is_null($key) ? array_get($params, $key) : $params;\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 description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
@param \simple_html_dom_node $li @param bool $replacement @return string
[ "protected function addListItem($li, $replacement = false)\n {\n $this->addClassToNode($li, $replacement ? self::CLASS_LIST_ITEM_CHANGED : self::CLASS_LIST_ITEM_ADDED);\n $li->innertext = sprintf('<ins>%s</ins>', $li->innertext);\n\n return $li->outertext;\n }" ]
[ "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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Creates an endpoint reference by duplicating the endpoint reference of a given server. @param server @param address @param props @return
[ "private static EndpointReferenceType createEPR(Server server, String address, SLProperties props) {\n EndpointReferenceType sourceEPR = server.getEndpoint().getEndpointInfo().getTarget();\n EndpointReferenceType targetEPR = WSAEndpointReferenceUtils.duplicate(sourceEPR);\n WSAEndpointReference...
[ "@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 sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Return a message based on its index in the mailbox. @param string $id @return mixed
[ "public function getMessage($id = '')\n {\n $message = [];\n if (is_array($this->messages) == true) {\n foreach($this ->messages as $msg) {\n if ($msg['index'] == $id) {\n $message = $msg;\n break;\n }\n }\n ...
[ "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 comment about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
Get an key values arry of attributes @return arry of attributes
[ "public function getAttributes()\n {\n \t// Sequence validation\n \t$this->ensureAuthenticationCallSuccessful();\n \t// This is likely a duplicate check that could be removed....\n if ( empty($this->_user) ) {\n // if no user is set, there shouldn't be any attributes also...\n ...
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Retrieves an array of pageIds from mountPoints that allready have a queue entry. @param string $identifier identifier of the mount point @return array pageIds from mountPoints that allready have a queue entry
[ "public function findPageIdsOfExistingMountPagesByMountIdentifier(string $identifier) : array\n {\n $queryBuilder = $this->getQueryBuilder();\n $resultSet = $queryBuilder\n ->select('item_uid')\n ->add('select', $queryBuilder->expr()->count('*', 'queueItemCount'), true)\n ...
[ "function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
For more info on v1 wvw matches API go <a href="https://wiki.guildwars2.com/wiki/API:1/wvw/matches">here</a><br/> @return simple wvw matches info @throws GuildWars2Exception see {@link ErrorCode} for detail @see AllWvWMatchOverview wvw matches
[ "public AllWvWMatchOverview getAllWvWMatchOverview() throws GuildWars2Exception {\n\t\ttry {\n\t\t\tResponse<AllWvWMatchOverview> response = gw2API.getAllWvWMatchOverview().execute();\n\t\t\tif (!response.isSuccessful()) throwError(response.code(), response.errorBody());\n\t\t\treturn response.body();\n\t\t} catch ...
[ "def get(self):\n ''''''\n request = TOPRequest('xxxxx.xxxxx.campaign.areaoptions.get')\n self.create(self.execute(request), fields=['success','result'], models={'result':AreaOption})\n return self.result" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Adds the current subsite.<p> @param referencePath the reference path
[ "public void addCurrentSubsite(String referencePath) {\n\n CmsADEConfigData configData = OpenCms.getADEManager().lookupConfiguration(m_cms, referencePath);\n String basePath = configData.getBasePath();\n if (basePath != null) {\n addOption(\n Type.currentSubsite,\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Draws the Page Header
[ "protected function drawPageHeader()\n {\n $data = $this->data;\n\n $title = utf8_decode($data['header_title'] ?? '');\n $body = utf8_decode($data['header_body'] ?? '');\n $info = utf8_decode($this->simpleTemplate($data['header_info'] ?? ''));\n\n $this->billetSetFont('cell_dat...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// ToSlice - returns slice of actions from the action set.
[ "func (actionSet ActionSet) ToSlice() []Action {\n\tactions := []Action{}\n\tfor action := range actionSet {\n\t\tactions = append(actions, action)\n\t}\n\n\treturn actions\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 Text analysis:", "pos": "Represent the code about Text analysis:", "neg": "Represent the code:" }
Binds parameters into statement to create a new statement ready to execute @return string final statement @throws InvalidParameterNumberException
[ "protected function doBind() {\r\n $parsed = self::$parser->parse($this->statement);\r\n $index = 0;\r\n $params = $this->getParameters();\r\n $this->walk($parsed, $index, $params);\r\n return self::$creator->create($parsed);\r\n }" ]
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the Github instruction about API documentation:", "pos": "Represent the Github code about API documentation:", "neg": "Represent the Github code:" }
renderInTable() is called to render FITS images in a table
[ "def renderInTable(self, relpath=\"\"):\n \"\"\"\"\"\"\n # return from cache if available\n cachekey, html = self.checkCache('InTable', relpath)\n if html is not None:\n return html\n # else regenerate\n # single image: render as standard cells\n if len(se...
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param Repository $query @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|mixed
[ "public function build(Repository $query)\n {\n $filters = collect($this->filters());\n $count = $filters->count();\n\n if ($count === 0) {\n return;\n }\n\n foreach ($filters as $key => $filter) {\n $filters[$key] = new $filter();\n }\n\n re...
[ "public function register()\n {\n $this->app->singleton('Congraph\\Core\\Bus\\CommandDispatcher', function ($app) {\n return new CommandDispatcher($app, function () use ($app) {\n return $app['Illuminate\\Contracts\\Queue\\Queue'];\n });\n });\n\n $this->...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Build an \Illuminate\Http\Request object. @param string $verb @param \Ratchet\ConnectionInterface $connection @param \Ratchet\Wamp\Topic $topic @param array $data @param array|null $params @return \Illuminate\Http\Request
[ "protected function buildRequest($verb, Connection $connection, $topic, $data = [], $params = null)\n {\n $uri = [\n 'protocol' => 'ws://',\n 'host' => $connection->WebSocket->request->getHost(),\n 'port' => ':' . config('twostream.websocket.port'),\n ...
[ "protected function registerClassAliases()\n {\n $serviceAliases = [\n Request::class => 'Dingo\\Api\\Contract\\Http\\Request',\n 'api.dispatcher' => Dispatcher::class,\n 'api.http.validator' => 'Dingo\\Api\\Http\\RequestValidator',\n 'api.http.response' => 'Din...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software Development:" }
Creates a new CRFDatum from the preprocessed allData format, given the document number, position number, and a List of Object labels. @return A new CRFDatum
[ "protected List<CRFDatum> extractDatumSequence(int[][][] allData, int beginPosition, int endPosition,\r\n List<IN> labeledWordInfos) {\r\n List<CRFDatum> result = new ArrayList<CRFDatum>();\r\n int beginContext = beginPosition - windowSize + 1;\r\n if (beginContext < 0) {\r\n beginContext = 0;\r\...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// blockSize returns the block size, in bytes, of cipher.
[ "func (cipher CipherFunction) blockSize() int {\n\tswitch cipher {\n\tcase Cipher3DES:\n\t\treturn des.BlockSize\n\tcase CipherCAST5:\n\t\treturn 8\n\tcase CipherAES128, CipherAES192, CipherAES256:\n\t\treturn 16\n\t}\n\treturn 0\n}" ]
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github summarization about Blockchain:", "pos": "Represent the Github code about Blockchain:", "neg": "Represent the Github code:" }
Resize the current column to its contents.
[ "def _resizeCurrentColumnToContents(self, new_index, old_index):\r\n \"\"\"\"\"\"\r\n if new_index.column() not in self._autosized_cols:\r\n # Ensure the requested column is fully into view after resizing\r\n self._resizeVisibleColumnsToContents()\r\n self.dataTable.sc...
[ "function get_margin_width()\n {\n //ignore image width, use same width as on predefined bullet ListBullet\n //for proper alignment of bullet image and text. Allow image to not fitting on left border.\n //This controls the extra indentation of text to make room for the bullet image.\n ...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create a PEP-370 environment
[ "def create_env(self):\n \n root = path.Path(os.environ.get('SERVICES_ROOT', 'services'))\n self.env_path = (root / self.name).abspath()\n cmd = [\n self.python,\n '-c', 'import site; print(site.getusersitepackages())',\n ]\n out = subprocess.check_out...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<p>Get column with Integer val.</p> @param pNm column name @return Integer column val @throws ExceptionWithCode if field not found
[ "public final Integer getInt(final String pNm) throws ExceptionWithCode {\n if (this.ints != null && this.ints.keySet().contains(pNm)) {\n return this.ints.get(pNm);\n }\n if (this.idInts != null && this.idInts.keySet().contains(pNm)) {\n return this.idInts.get(pNm);\n }\n throw new Excepti...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Pipeline to use while processing the request.
[ "func (r *BulkIndexRequest) Pipeline(pipeline string) *BulkIndexRequest {\n\tr.pipeline = pipeline\n\tr.source = nil\n\treturn r\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 Web development:", "pos": "Represent the code about Web development:", "neg": "Represent the code:" }
@param array|null $params @param array|string|null $options @deprecated Use the `save` method on the Dispute object @return array The updated dispute.
[ "public function updateDispute($params = null, $options = null)\n {\n $url = $this->instanceUrl() . '/dispute';\n list($response, $opts) = $this->_request('post', $url, $params, $options);\n $this->refreshFrom(['dispute' => $response], $opts, true);\n return $this->dispute;\n }" ]
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Simplified method form for invoking the ListPipelines operation with an AsyncHandler. @see #listPipelinesAsync(ListPipelinesRequest, com.amazonaws.handlers.AsyncHandler)
[ "@Override\n public java.util.concurrent.Future<ListPipelinesResult> listPipelinesAsync(\n com.amazonaws.handlers.AsyncHandler<ListPipelinesRequest, ListPipelinesResult> asyncHandler) {\n\n return listPipelinesAsync(new ListPipelinesRequest(), asyncHandler);\n }" ]
[ "public LogStreamResponse getLogs(Log.LogRequestBuilder logRequest) {\n return connection.execute(new Log(logRequest), apiKey);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Uses a getter to obtain a value, then sets that value appropriately into a supplied JsonObject. @param getter @param o @param fieldName @param j
[ "private static void addFieldToJsonObject(Method getter, Object o,\n String fieldName, JsonObjectBuilder j) {\n try {\n Object fieldValue = getter.invoke(o);\n\n if (fieldValue == null) {\n } else if (fieldValue instanceof String) {...
[ "public @CheckForNull PropertyType getPropertyType(@Nonnull Object instance, @Nonnull String field) {\n // in global.jelly, instance==descriptor\n return instance==this ? getGlobalPropertyType(field) : getPropertyType(field);\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// validateEndorserTransaction validates the payload of a // transaction assuming its type is ENDORSER_TRANSACTION
[ "func validateEndorserTransaction(data []byte, hdr *common.Header) error {\n\tputilsLogger.Debugf(\"validateEndorserTransaction starts for data %p, header %s\", data, hdr)\n\n\t// check for nil argument\n\tif data == nil || hdr == nil {\n\t\treturn errors.New(\"nil arguments\")\n\t}\n\n\t// if the type is ENDORSER_...
[ "private static void executeCheckLockTimeVerify(Transaction txContainingThis, int index, LinkedList<byte[]> stack, Set<VerifyFlag> verifyFlags) throws ScriptException {\n if (stack.size() < 1)\n throw new ScriptException(ScriptError.SCRIPT_ERR_INVALID_STACK_OPERATION, \"Attempted OP_CHECKLOCKTIMEV...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Get resource metadata for a resource name @param resourceName Name of the resource @return Resource metadata for this name @throws RuntimException if the resource name doesn't exist
[ "public ResourceMetadata getResourceMetadata(String resourceName) {\n if (!resourceMetadataMap.containsKey(resourceName)) {\n throw new RuntimeException(\"No resource metadata for \" + resourceName);\n }\n return resourceMetadataMap.get(resourceName);\n }" ]
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about AWS S3:" }
// Info is defined on the cmd.Command interface.
[ "func (c *AddCommand) Info() *cmd.Info {\n\treturn jujucmd.Info(&cmd.Info{\n\t\tName: \"add-space\",\n\t\tArgs: \"<name> [<CIDR1> <CIDR2> ...]\",\n\t\tPurpose: \"Add a new network space.\",\n\t\tDoc: strings.TrimSpace(addCommandDoc),\n\t})\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
$this->ConsumeQName @return void
[ "private function ConsumeQName()\r\n\t{\r\n\t\t$c;\r\n\t\t$sb = array();\r\n\t\t$this->BeginToken();\r\n\t\twhile ( ( $c = $this->Peek( 0 ) ) && ord( $c ) != 0 && preg_match( \"/^[\\p{L}\\p{N}_\\-.:]/u\", $c ) )\r\n\t\t{\r\n\t\t\t$sb[] = $this->Read();\r\n\t\t}\r\n\t\t$this->EndToken();\r\n\t\t$this->ConsumeToken2(...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Read and execute a command from the server socket @throws IOException
[ "@FFDCIgnore({ IOException.class })\n private boolean acceptAndExecuteCommand() {\n boolean socketValid = false;\n try {\n //exceptions thrown by accept are assumed to mean the channel is no longer usable.\n SocketChannel sc = serverSocketChannel.accept();\n socketV...
[ "@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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Matching packages distinguish between uppercase and lowercase
[ "def case_insensitive(self):\n \n if \"--case-ins\" in self.flag:\n data = []\n data = Utils().package_name(self.PACKAGES_TXT)\n data_dict = Utils().case_sensitive(data)\n for pkg in self.packages:\n index = self.packages.index(pkg)\n ...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Enqueue an operation to delete a Firestore document. Example: ``` $transaction->delete($document); ``` @param DocumentReference $document The document to delete. @param array $options Configuration Options. @return Transaction
[ "public function delete(DocumentReference $document, array $options = [])\n {\n $this->writer->delete($document->name(), $options);\n\n return $this;\n }" ]
[ "public function update(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"patch\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Record an undo operation. Also clears the redo stack. Raises IndexError when no group is open.
[ "def register(self, func, *args, **kwargs):\n \n self._open[-1].append(UndoOperation(func, *args, **kwargs))\n if not (self._undoing or self._redoing):\n self._redo = []\n self.notify()" ]
[ "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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Removes and returns the object at the beginning of the queue. @return mixed the item at the beginning of the queue @throws \yii\base\Exception if the queue is empty
[ "public function dequeue () {\n if ($this->_c === 0)\n throw new Exception(\\Yii::t ('yii' , 'The queue is empty.'));\n else {\n --$this->_c;\n return array_shift ($this->_d);\n }\n }" ]
[ "public function next()\n {\n // fetch next entry.\n // if we have no entrys anymore, we add false (which is\n // returned by shiftEntry()) so current() will complain.\n if (count($this->_iteratorCache) - 1 <= $this->count()) {\n $this->_iteratorCache[] = $this->shiftEntry(...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Method to get the value for a list of object. @param _objectList list of objects @throws EFapsException on error @return object
[ "public Object getValue(final List<Object> _objectList)\n throws EFapsException\n {\n final List<Object> ret = new ArrayList<Object>();\n for (final Object object : _objectList) {\n ret.add(getValue(object));\n }\n return _objectList.size() > 0 ? (ret.size() > 1 ? re...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Handle an ajax call. @return void @throws ResponseException Throws a response exception. @SuppressWarnings(PHPMD.Superglobals) @SuppressWarnings(PHPMD.CamelCaseVariableName) @SuppressWarnings(PHPMD.ExitExpression)
[ "public function handleAjaxCall()\n {\n $input = $this->getEnvironment()->getInputProvider();\n\n if ('DcGeneralLoadSubTree' !== $input->getValue('action')) {\n parent::handleAjaxCall();\n\n return;\n }\n\n $response = new Response(\n $this->ajaxTreeVi...
[ "public function attachValidators(Validator $validator)\n {\n /** @var ClassMetadata $fileMetadata */\n $fileMetadata = $validator->getMetadataFor('phpDocumentor\\Descriptor\\FileDescriptor');\n /** @var ClassMetadata $constantMetadata */\n $constantMetadata = $validator->getMetadat...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Sets the protocol level. @param int $value @throws \InvalidArgumentException
[ "public function setProtocolLevel($value)\n {\n if ($value < 3 || $value > 4) {\n throw new \\InvalidArgumentException(sprintf('Unknown protocol level %d.', $value));\n }\n\n $this->protocolLevel = $value;\n if ($this->protocolLevel === 3) {\n $this->protocolName...
[ "public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about N/A:" }
@param bool|float|int|string $scalar @param string $label @return void
[ "private function scalar($scalar, string $label = ''): void\n {\n if (is_bool($scalar)) {\n $scalar = $scalar ? 'true' : 'false';\n } elseif (is_string($scalar)) {\n $scalar = \"'{$this->escape($scalar)}'\";\n }\n\n if ($label !== '') {\n $label = $thi...
[ "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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
(non-PHPdoc) @see PAGI\Client.IClient::databaseDel()
[ "public function databaseDel($family, $key)\n {\n $cmd = implode(\n ' ',\n array(\n 'DATABASE', 'DELTREE', '\"' . $family. '\"', '\"' . $key . '\"'\n )\n );\n $result = $this->send($cmd);\n if ($result->isResult(0)) {\n throw ...
[ "public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Gets the child name based on the parent name. @param child the key of the child @param parent the key of the parent @return the child key with the parent prefix removed
[ "protected String getChildName(String child, String parent) throws IOException {\n if (child.startsWith(parent)) {\n return child.substring(parent.length());\n }\n throw new IOException(ExceptionMessage.INVALID_PREFIX.getMessage(parent, child));\n }" ]
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
get start and end date of select quarter @param string $quarter @return array
[ "public static function getQuarter($quarter = 'current')\n {\n\n $response['startDate'] = null;\n $response['endDate'] = null;\n\n switch ($quarter)\n {\n case 'current': // current quarter\n $currentMonth = date('m');\n $currentYear =...
[ "function completeQuery(err) {\n if (err) return cb(err);\n db.eval(zahd, 2, 'expiring_domains', 'querying_domains',\n expiration, domain, next);\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// GetYearlyPriceInCents returns the YearlyPriceInCents field if it's non-nil, zero value otherwise.
[ "func (m *MarketplacePlan) GetYearlyPriceInCents() int {\n\tif m == nil || m.YearlyPriceInCents == nil {\n\t\treturn 0\n\t}\n\treturn *m.YearlyPriceInCents\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// Error can be either of the following types: // // - InvalidObjectFault // - RuntimeFault
[ "func (service *VboxPortType) IVBoxSVCAvailabilityChangedEventgetAvailable(request *IVBoxSVCAvailabilityChangedEventgetAvailable) (*IVBoxSVCAvailabilityChangedEventgetAvailableResponse, error) {\n\tresponse := new(IVBoxSVCAvailabilityChangedEventgetAvailableResponse)\n\terr := service.client.Call(\"\", request, res...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the post about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Defines the visibility of the start/stop indicators @param START_STOP_INDICATOR_VISIBLE
[ "public void setStartStopIndicatorVisible(final boolean START_STOP_INDICATOR_VISIBLE) {\n startStopIndicatorVisible = START_STOP_INDICATOR_VISIBLE;\n init(INNER_BOUNDS.width, INNER_BOUNDS.height);\n repaint(INNER_BOUNDS);\n }" ]
[ "public void addToolbarButtons(ToolScreen toolScreen)\n {\n new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, \"Delete All\", MenuConstants.DELETE, \"Delete All\", null);\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Apply the route changes by adding and removing the necessary routes.
[ "func (r *routesOption) Apply(server *Server) {\n\tserver.mu.Lock()\n\troutes := make([]*client, len(server.routes))\n\ti := 0\n\tfor _, client := range server.routes {\n\t\troutes[i] = client\n\t\ti++\n\t}\n\tserver.mu.Unlock()\n\n\t// Remove routes.\n\tfor _, remove := range r.remove {\n\t\tfor _, client := range...
[ "function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Update plugin data. @param UpdatedEvent $event
[ "public function onUpdated(UpdatedEvent $event)\n {\n if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {\n $this->addPackage($event->getPackage());\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Filter product list by brand ID @param int $iBrandID @return $this
[ "public function brand($iBrandID)\n {\n $arResultIDList = ProductListStore::instance()->brand->get($iBrandID);\n\n return $this->intersect($arResultIDList);\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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// SetMotorPower sets a motor's power from -128 to 127.
[ "func (g *Driver) SetMotorPower(motor Motor, power int8) error {\n\treturn g.writeBytes([]byte{\n\t\tgoPiGo3Address,\n\t\tSET_MOTOR_PWM,\n\t\tbyte(motor),\n\t\tbyte(power),\n\t})\n}" ]
[ "def send_calibrate_accelerometer(self, simple=False):\n \n\n calibration_command = self.message_factory.command_long_encode(\n self._handler.target_system, 0, # target_system, target_component\n mavutil.mavlink.MAV_CMD_PREFLIGHT_CALIBRATION, # command\n 0, # confir...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Parse jenkins ajax response in order find the current jenkins build history
[ "func parseBuildHistory(d io.Reader) []*History {\n\tz := html.NewTokenizer(d)\n\tdepth := 0\n\tbuildRowCellDepth := -1\n\tbuilds := make([]*History, 0)\n\tisInsideDisplayName := false\n\tvar curBuild *History\n\tfor {\n\t\ttt := z.Next()\n\t\tswitch tt {\n\t\tcase html.ErrorToken:\n\t\t\tif z.Err() == io.EOF {\n\t...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Gets each place holders of event's arguments @param GenericEvent $event Any event @return array
[ "protected function getPlaceholders(GenericEvent $event)\n {\n return array(\n '%eventname%' => $event['eventname'],\n '%source%' => $event['source'],\n '%filename%' => $event->hasArgument('file') ? $event['file'] : '',\n '%error%' => $event->hasArgument...
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Caching wrapper for pg_affected_rows() This appears bugged in php 5.3 and postgres 9.1 returning the number of rows modified by a statement @return int
[ "public function numAffectedRows()\n {\n if( !isset( $this->affectedRows ) ) {\n $this->affectedRows = pg_affected_rows( $this->resource );\n }\n return $this->affectedRows;\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:" }
A scanner that matches the input against the specified string case insensitively. @param str the string to match @return the scanner.
[ "public static Parser<Void> stringCaseInsensitive(String str) {\n return Patterns.stringCaseInsensitive(str).toScanner(str);\n }" ]
[ "def _extract_lookup(self, key):\n \"\"\"\"\"\"\n parts = key.split('__')\n # 'exact' is the default lookup if there was no explicit comparison op in `key`\n # Assume there is only one `__` in the key.\n # FIXME Change for child attribute query support\n op = 'exact' if...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Append a double value. This increases the array's length by one. @param value A double value. @throws JSONException if the value is not finite. @return this.
[ "public JSONArray element( double value ) {\n Double d = new Double( value );\n JSONUtils.testValidity( d );\n return element( d );\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:" }
*******************BEGINNING OF FUNCTION********************//
[ "public static boolean is_jhaladi(String str)\n {\n String s1 = VarnaUtil.getAdiVarna(str);\n if (is_jhal(s1)) return true;\n return false;\n }" ]
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about PHP programming:" }
* Performs coloring of the textpane. This method needs to be rewriten. @throws Exception
[ "public void recolorQuery() throws Exception {\n\t\tPrefixManager man = apic.getMutablePrefixManager();\n\n\t\tString input = doc.getText(0, doc.getLength());\n\t\tImmutableList<TargetAtom> current_query = parse(input, man);\n\n\t\tif (current_query == null) {\n JOptionPane.showMessageDialog(null, \"An e...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// index/ReaderUtil.java /* Common util methods for dealing wiht IndexReaders and IndexReaderContexts. */ /* Walks up the reader tree and return the given context's top level reader context, or in other words the reader tree's root context. */
[ "func TopLevelContext(ctx IndexReaderContext) IndexReaderContext {\n\tfor ctx.Parent() != nil {\n\t\tctx = ctx.Parent()\n\t}\n\treturn ctx\n}" ]
[ "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:" }
Initialize eXpansion. @param OutputInterface $console @return $this|mixed @throws \Maniaplanet\DedicatedServer\Xmlrpc\TransportException
[ "public function init(OutputInterface $console)\n {\n $this->checkPhpExtensions($console);\n\n $this->console->init($console, $this->dispatcher);\n $this->dispatcher->dispatch(self::EVENT_BEFORE_INIT, []);\n\n $this->factory->createConnection();\n $this->dispatcher->init($this-...
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Regenerate forces the regeneration of endpoint programs & policy // Should only be called with e.state == StateWaitingToRegenerate or with // e.state == StateWaitingForIdentity
[ "func (e *Endpoint) Regenerate(owner Owner, regenMetadata *ExternalRegenerationMetadata) <-chan bool {\n\tdone := make(chan bool, 1)\n\n\tvar (\n\t\tctx context.Context\n\t\tcFunc context.CancelFunc\n\t)\n\n\tif regenMetadata.ParentContext != nil {\n\t\tctx, cFunc = context.WithCancel(regenMetadata.ParentContext)...
[ "@Scheduled(initialDelayString = PROP_SCHEDULER_DELAY_PLACEHOLDER, fixedDelayString = PROP_SCHEDULER_DELAY_PLACEHOLDER)\n public void autoAssignScheduler() {\n LOGGER.debug(\"auto assign schedule checker has been triggered.\");\n // run this code in system code privileged to have the necessary\n ...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Count document into the index and then multiply it by the request cutoff frequency to compute an absolute cutoff frequency limit (max numbre of doc). @param RequestInterface $request The spellcheck request. @return int
[ "private function getCutoffrequencyLimit(RequestInterface $request)\n {\n $indexStatsResponse = $this->client->indexStats($request->getIndex());\n $indexStats = current($indexStatsResponse['indices']);\n $totalIndexedDocs = $indexStats['total']['docs']['count'];\n\n return $re...
[ "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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Receive a request. For testing purposes, `skip_author_verification` can be passed. Authorship will not be verified.
[ "def receive(\n self,\n request: RequestType,\n user: UserType = None,\n sender_key_fetcher: Callable[[str], str] = None,\n skip_author_verification: bool = False) -> Tuple[str, dict]:\n \n self.user = user\n self.get_contact_key = sender_k...
[ "def try_storage(self, identifier, req, resp, resource, uri_kwargs):\n \n if identifier is None:\n user = None\n\n # note: if user_storage is defined, always use it in order to\n # authenticate user.\n elif self.user_storage is not None:\n user = self.u...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
list the contents of a directory @param {[type]} argv [description] @return {[type]} [description]
[ "function bin(argv) {\n var uri = argv[2]\n if (!uri) {\n console.error('uri is required')\n }\n shell.ls(uri, function(err, arr) {\n for (i=0; i<arr.length; i++) {\n console.log(arr[i])\n }\n })\n}" ]
[ "function (data) {\n var fnState = JSON.parse(data.toString());\n\n if (fnState && fnState.v) {\n //\"v\":{\"temperature\":2}\n fnState.v = messages.TranslateIntTypes(fnState.v);\n }\n\n this.coreFnState = fnState;\n\n //logger.log(\"got describe return \", t...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
@param array $options @return \Knp\Menu\ItemInterface @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
[ "public function createStructure(array $options): ItemInterface\n {\n $menu = $this->factory->createItem('root');\n\n $menuItems = [\n self::ITEM__SEARCH => $this->createMenuItem(\n self::ITEM__SEARCH,\n [\n 'route' => 'ezplatform.search',...
[ "protected function getLimitationByIdentifier($identifier)\n {\n switch ($identifier) {\n case APILimitation::CONTENTTYPE:\n return new \\eZ\\Publish\\API\\Repository\\Values\\User\\Limitation\\ContentTypeLimitation();\n\n case APILimitation::LANGUAGE:\n ...
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
// String returns the string representation of the transaction.
[ "func (t *Transaction) String() string {\n\treturn fmt.Sprintf(\"txID=%s, txCR=%s\", t.ID, t.Created)\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description about Transaction Management:", "pos": "Represent the Github code about Transaction Management:", "neg": "Represent the Github code:" }
// Value implements the Valuer interface.
[ "func (sv StringValuer) Value() (string, error) {\n\tv := string(sv)\n\tif len(v) == 0 {\n\t\treturn \"\", errors.New(\"[-empty-]\")\n\t}\n\treturn v, nil\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@param int $productId @param int $storeId @return void
[ "private function initStoreProductData($productId, $storeId)\n {\n if (!array_key_exists($productId, $this->attributeData)) {\n $this->attributeData[$productId] = [];\n }\n\n if (!array_key_exists($storeId, $this->attributeData[$productId])) {\n $this->attributeData[$pr...
[ "public function LinkingMode()\n {\n /** @var Page_Controller $controller */\n $controller = Controller::curr();\n $params = $controller->getURLParams();\n\n return $params['ID'] === $this->URLSegment ? 'current' : 'link';\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about text processing:" }