query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
get the mapping between token->node ip
without taking replication into consideration
https://issues.apache.org/jira/browse/CASSANDRA-4092 | [
"def describe_token_map(self, ):\n \n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_describe_token_map()\n return d"
] | [
"def server_info(self):\n \n retry = 0\n j = self._get_json('serverInfo')\n while not j and retry < 3:\n logging.warning(\"Bug https://jira.atlassian.com/browse/JRA-59676 trying again...\")\n retry += 1\n j = self._get_json('serverInfo')\n return j... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about AWS Route 53:"
} |
Get a dictionary representation of this item, formatted for Elasticsearch | [
"def to_dict(self):\n \"\"\"\"\"\"\n out = {}\n\n fields = self.__class__.search_objects.mapping.properties.properties\n\n for key in fields:\n # TODO: What if we've mapped the property to a different name? Will we allow that?\n\n attribute = getattr(self, key)\n\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 Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Get the relationship query.
@param \Globalis\PuppetSkilled\Database\Magic\Builder $query
@param \Globalis\PuppetSkilled\Database\Magic\Builder $parent
@param array|mixed $columns
@return \Globalis\PuppetSkilled\Database\Magic\Builder | [
"public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*'])\n {\n $query = parent::getRelationQuery($query, $parent, $columns);\n\n return $query->where($this->morphType, $this->morphClass);\n }"
] | [
"public function GetTableColumnNames($tableName) {\n $this->setDbConfigList(array());\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::COLUMNNAMES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"DESCRI... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Pan to the selected features. | [
"public void onClick(ClickEvent clickEvent) {\n\t\tList<Feature> features = new ArrayList<Feature>();\n \t\tfor (VectorLayer layer : mapWidget.getMapModel().getVectorLayers()) {\n\t\t\tfeatures.addAll(layer.getSelectedFeatureValues());\n\t\t}\n\t\t// only zoom when there where really some items selected\n\t\tif (fe... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Send loss and metrics values to MLFlow after each epoch | [
"def on_epoch_end(self, epoch, **kwargs:Any)->None:\n \"\"\n if kwargs['smooth_loss'] is None or kwargs[\"last_metrics\"] is None: return\n metrics = [kwargs['smooth_loss']] + kwargs[\"last_metrics\"]\n for name, val in zip(self.metrics_names, metrics):\n self.client.log_metri... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.
@return string
@throws RuntimeException | [
"public function walkSelectStatement(SelectStatement $AST)\n {\n if ($this->platformSupportsRowNumber()) {\n return $this->walkSelectStatementWithRowNumber($AST);\n }\n\n return $this->walkSelectStatementWithoutRowNumber($AST);\n }"
] | [
"@Override\n public AccessPlan fromView(XsStringVal schema, XsStringVal view) {\n return new AccessPlanSubImpl(this, \"op\", \"from-view\", new Object[]{ schema, view });\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Установить модуль из Marketplace
@param string $plugin название модуля
@param Callable $status метод или функция для приема сообщений
@param Zend_Translate $translator класс-переводчик | [
"public static function install($plugin, $status = null, $translator = null)\n {\n\t\t\n if (!$translator) $translator = Application::getInstance()->getTranslator();\n\t\t \n\t\t$pluginPath = WWWROOT . PLUGIN_DIR . '/' . $plugin;\n\t\t$archiveFile = WWWROOT . PLUGIN_DIR . '/' . $plugin . '.zip';\t\n\n\... | [
"function getValue() {\n\t\t$chosen = parent::getValue(); /** @var string|null $chosen */\n\t\t$allowed = $this->dfValues(); /** @var string[] $allowed */\n\t\t// 2016-11-13\n\t\t// Обрабатываем тот случай, когда значения self::$ORDER и self::$BASE были разрешены\n\t\t// в предыдущих версиях модуля, а потом стали з... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
List all available offers one can migrate to
REST: GET /overTheBox/{serviceName}/migration/offers
@param serviceName [required] The internal name of your overTheBox offer
API beta | [
"public ArrayList<OvhAvailableMigrationOffer> serviceName_migration_offers_GET(String serviceName) throws IOException {\n\t\tString qPath = \"/overTheBox/{serviceName}/migration/offers\";\n\t\tStringBuilder sb = path(qPath, serviceName);\n\t\tString resp = exec(qPath, \"GET\", sb.toString(), null);\n\t\treturn conv... | [
"def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)"
] | codesearchnet | {
"query": "Represent the post about Juju model:",
"pos": "Represent the code about Juju model:",
"neg": "Represent the code:"
} |
get boolean value.
@param key key.
@param def default value.
@return value or default value. | [
"public boolean getBoolean(String key, boolean def) {\n Object tmp = objectMap.get(key);\n return tmp != null && tmp instanceof Boolean ? (Boolean) tmp : def;\n }"
] | [
"def set_property(name, value, mark_non_default=true)\n \n #Set the node's property, as specified.\n node = get_property_node(name)\n node.attribute(\"value\").value = value\n\n #If the mark non-default option is set, mark the state is not a default value.\n node.attribute(\"valueState\").v... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
A decorator for theme context processors | [
"def context(name):\n ''''''\n def wrapper(func):\n g.theme.context_processors[name] = func\n return func\n return wrapper"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Throws an exception with the argument of {@code argument}
@param argument what the exception is about (Access denied to (argument goes here)) | [
"SecurityException getException(String argument) {\n SecurityException exception = new SecurityException(\"Access denied to \" + argument);\n Class[] classStack = getClassContext();\n secureAccess.getBreachHandler().handleBreach(exception, classStack);\n return exception;\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 comment about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code:"
} |
// Returns JSON representation of root node file location. | [
"func (t *Collection) MarshalJSON() ([]byte, error) {\n\trnl := t.rootAddRef()\n\tdefer t.rootDecRef(rnl)\n\treturn rnl.MarshalJSON()\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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
timeout for callbacks. Helps to kill misbehaving plugins, etc | [
"function t(time, done) {\n if (arguments.length === 1) {\n done = time;\n time = 2000;\n }\n var error = new Error(`Callback took too long (max: ${time})`);\n var waiting = true;\n\n var timeout = setTimeout(function () {\n if (!waiting) return;\n waiting = false;\n done(error);\n }, time);\n\... | [
"def _shutdown_broker(self):\n \n if self.broker:\n self.broker.shutdown()\n self.broker.join()\n self.broker = None\n self.router = None\n\n # #420: Ansible executes \"meta\" actions in the top-level process,\n # meaning \"reset_connec... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// NewLoanPmtFreq returns returns an 'enum' value of type loanPmtFreq given its
// string representation | [
"func NewLoanPmtFreq(s string) (loanPmtFreq, error) {\n\tvar e loanPmtFreq\n\terr := e.FromString(s)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn e, nil\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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@param FilterInterface $filter filter to be used to select modules for matching conditions
@return ModuleInterface[] a list of registered modules | [
"public function getModules(FilterInterface $filter = null)\n {\n if ($filter !== null) {\n return $filter->filter($this->modules);\n }\n\n return $this->modules;\n }"
] | [
"private function getColumnFromName($name)\n {\n foreach ($this->columnConfiguration as $i => $col) {\n if ($col->getName() == $name) {\n return $col;\n }\n }\n\n // This exception should never happen. If it does, something is\n // wrong w/ the rel... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Converts matplotlib positioning to pgf node positioning.
Not quite accurate but the results are equivalent more or less. | [
"def _transform_positioning(ha, va):\n \"\"\"\"\"\"\n if ha == \"center\" and va == \"center\":\n return None\n\n ha_mpl_to_tikz = {\"right\": \"east\", \"left\": \"west\", \"center\": \"\"}\n va_mpl_to_tikz = {\n \"top\": \"north\",\n \"bottom\": \"south\",\n \"center\": \"\... | [
"def data_class_detection(self, data):\n \n assert(isinstance(data, list) or isinstance(data, tuple))\n if not isinstance(self, (LineChart, BarChart, ScatterChart)):\n # From the link above:\n # Simple encoding is suitable for all other types of chart\n # re... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Converts an RDF dataset to N-Quads.
@param dataset the RDF dataset to convert.
@return the N-Quads string. | [
"function _toNQuads(dataset) {\n var quads = [];\n for(var graphName in dataset) {\n var triples = dataset[graphName];\n for(var ti = 0; ti < triples.length; ++ti) {\n var triple = triples[ti];\n if(graphName === '@default') {\n graphName = null;\n }\n quads.push(_toNQuad(triple, ... | [
"def usufyToCsvExport(d, fPath):\n \n\n from pyexcel_io import get_data\n try:\n oldData = {\"OSRFramework\": get_data(fPath) }\n except:\n # No information has been recovered\n oldData = {\"OSRFramework\":[]}\n\n # Generating the new tabular data.\n tabularData = _generateTab... | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// SetPosition sets the Position field's value. | [
"func (s *GetUsagePlanKeysInput) SetPosition(v string) *GetUsagePlanKeysInput {\n\ts.Position = &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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// ParentIs is a functon that returns ConditionFunc checking
// if immediate parent's name matches name | [
"func ParentIs(name xml.Name) ConditionFunc {\n\treturn func(parents *NodeList, el xml.Token) bool {\n\t\treturn parents.ParentIs(name)\n\t}\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns an array with the keys
@return array | [
"public static function toKeysArray(ResultIterator $iterator)\n {\n $keys = array();\n foreach ($iterator as $result) {\n $keys[] = $result->getKey();\n \n }\n return $keys;\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Get any field annotations with a matching tag. Return these indexed by field name.
@param $string | [
"public function getFieldAnnotationsForMatchingTag($tag, $fieldName = null) {\n\n if ($fieldName) {\n return isset($this->fieldAnnotations[$fieldName][$tag]) ? $this->fieldAnnotations[$fieldName][$tag] : array();\n } else {\n\n $matchingAnnotations = array();\n foreach... | [
"def apply(self, search, field, value):\n \"\"\"\"\"\"\n # We assume that the field in question has a \"raw\" counterpart.\n return search.query('match', **{'{}.raw'.format(field): value})"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
NB: global config options (e.g. daemonize, pidfile,
logfile, redis options) won't be checked on reload.
should we do a full restart if some of these change? | [
"def reload\n # TODO refactor cfg load and key retrieval, consolidate with initial load\n prev_pikelet_cfg = pikelet_definitions(@config.all)\n\n @config.reload\n\n current_pikelet_cfg = pikelet_definitions(@config.all)\n\n prev_keys = prev_pikelet_cfg.keys\n current_keys = current_... | [
"function execute(exec, req, res) {\n\n // start timing slow logs before execution\n // validation time is not included nor i/o\n this.state.slowlog.start(req.cmd, req.raw);\n\n // ensure the slowlog stop is called\n // before encoding and sending the response\n res.before = this.state.slowlog.stop;\n\n // e... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Scans the files specified by the given options for lints.
@return [Integer] exit status code | [
"def scan_for_lints(options)\n reporter = reporter_from_options(options)\n report = Runner.new.run(options.merge(reporter: reporter))\n report.display\n report.failed? ? Sysexits::EX_DATAERR : Sysexits::EX_OK\n end"
] | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// Debug outputs a debug log message | [
"func (l *BeeLogger) Debug(message string, file string, line int) {\n\tl.mustLogDebug(message, file, line)\n}"
] | [
"func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Computer Science:"
} |
Removes handlers we have added, and restores others if possible | [
"public function deregisterGlobalHandlers()\n {\n if ($this->registered) {\n // Restore the previous error handler if available\n set_error_handler(\n is_callable($this->errorHandler) ? $this->errorHandler : function () { }\n );\n // Restore the p... | [
"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:"
} |
Parses a cookie JAR line.
@param string $line The cookie JAR line.
@return array The data array.
@throws Exception It throws an exception the cookie JAR line is invalid. | [
"public static function parse($line)\n {\n $parts = explode(\"\\t\", trim($line));\n\n if (count($parts) !== 7) {\n throw new RuntimeException(\"Invalid cookie JAR format.\");\n }\n\n $config = [];\n $config['httponly'] = '#HttpOnly_' === substr($parts[0], 0, 10);\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 instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Create a new cluster using information provided in `cluster_info`. | [
"def create(cls, cluster_info):\n \n conn = Qubole.agent(version=\"v2\")\n return conn.post(cls.rest_entity_path, data=cluster_info)"
] | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the post about API documentation:",
"pos": "Represent the code about API documentation:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
Remove country.
@param \BlackForest\PiwikBundle\Entity\PiwikCountry $country
@return boolean TRUE if this collection contained the specified element, FALSE otherwise. | [
"public function removeCountry(\\BlackForest\\PiwikBundle\\Entity\\PiwikCountry $country)\n {\n return $this->country->removeElement($country);\n }"
] | [
"protected function process()\n {\n\n // load the entity ID\n ;\n\n // query whether or not, we've found a new entity ID => means we've found a new customer address\n if ($this->isLastEntityId($entityId = $this->getValue(ColumnKeys::ENTITY_ID))) {\n return;\n }\n\n ... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Check if the passed character is invalid for an element or attribute name
after the first position
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check
@return <code>true</code> if the char is invalid | [
"public static boolean isInvalidXMLNameChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)\n {\n switch (eXMLVersion)\n {\n case XML_10:\n return INVALID_NAME_CHAR_XML10.get (c);\n case XML_11:\n return INVALID_NAME_CHAR_XML11.get (c);\n case HTML:\n return... | [
"private static DNChar denormalize(String string)\n {\n\n if (string.startsWith(\"<\"))\n return new DNChar('<', 4);\n else if (string.startsWith(\">\"))\n return new DNChar('>', 4);\n else if (string.startsWith(\"&\"))\n return new DNChar('&', 5);\n else if (... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Creates registry clone | [
"public function backupRegistry()\n {\n $this->registryCache = array();\n foreach (\\OxidEsales\\Eshop\\Core\\Registry::getKeys() as $class) {\n $instance = \\OxidEsales\\Eshop\\Core\\Registry::get($class);\n $this->registryCache[$class] = clone $instance;\n }\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Set the host
@param string $host | [
"protected function setHost($host)\n {\n $host = strtolower($host);\n \n if ($host !== '' && !$this->isValidDomain($host) && !$this->isValidIpv4($host) && !$this->isValidIpv6($host)) {\n throw new \\InvalidArgumentException(\"Invalid hostname '$host'\");\n }\n \n ... | [
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Removes files given the path and optionally a regular expression
@param string|null regular expression
@return Eden\Folder\Index | [
"public function removeFiles($regex = null)\n {\n //argument 1 must be a string\n Argument::i()->test(1, 'string', 'null');\n\n //get the files\n $files = $this->getFiles($regex);\n\n if (empty($files)) {\n return $this;\n }\n\n //walk the array\n ... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about File management:"
} |
// SetItems sets the Items field's value. | [
"func (s *ListItemsOutput) SetItems(v []*Item) *ListItemsOutput {\n\ts.Items = v\n\treturn s\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/*
@link https://pusher.com/docs/pusher_protocol#presence-channel-events | [
"public function subscribe(ConnectionInterface $connection, stdClass $payload)\n {\n $this->saveConnection($connection);\n\n $connection->send(json_encode([\n 'event' => 'pusher_internal:subscription_succeeded',\n 'channel' => $this->channelName,\n ]));\n }"
] | [
"def init_publisher(app):\n \n @app.context_processor\n def inject_links():\n return {\n 'websub_self_url': stack.top.websub_self_url,\n 'websub_hub_url': stack.top.websub_hub_url,\n 'websub_self_link': stack.top.websub_self_link,\n 'websub_hub_link': stac... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Edit user
@return \Zend\Http\Response|ViewModel|array | [
"public function editAction()\n {\n /* @var $user \\Auth\\Entity\\User */\n $user = $this->userRepository->find($this->params('id'), \\Doctrine\\ODM\\MongoDB\\LockMode::NONE, null, ['allowDeactivated' => true]);\n \n // check if user is not found\n if (!$user) {\n re... | [
"public function createRole(RoleAssignment $roleAssignment): UIValue\\User\\Role\n {\n return new UIValue\\User\\Role($roleAssignment);\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Get ivy settings file from classpath | [
"public static File getIvySettingsFile() throws IOException {\n URL settingsUrl = Thread.currentThread().getContextClassLoader().getResource(IVY_SETTINGS_FILE_NAME);\n if (settingsUrl == null) {\n throw new IOException(\"Failed to find \" + IVY_SETTINGS_FILE_NAME + \" from class path\");\n }\n\n //... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Write a string up to 2**32 bytes long. Assume UTF-8 encoding.
@param $s
@return Writer | [
"public function writeLongStr($s)\n {\n $this->flushBits();\n $this->writeLong(strlen($s));\n $this->out .= $s;\n return $this;\n }"
] | [
"def append_line(self, new_line):\n \"\"\"\"\"\"\n # TODO: The user still has to write the raw line, this is error prone.\n self._write(('PGM', [Integer, String]), self.idx, new_line)"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Inserts a data transfer request. (transfers.insert)
@param Google_DataTransfer $postBody
@param array $optParams Optional parameters.
@return Google_Service_DataTransfer_DataTransfer | [
"public function insert(Google_Service_DataTransfer_DataTransfer $postBody, $optParams = array())\n {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), \"Google_Service_DataTransfer_DataTransfer\");\n }"
] | [
"public function send(string $userId, \\Google_Service_Gmail_Message $message): \\Google_Service_Gmail_Message\n {\n return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->send($userId, $message);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about PHP programming:"
} |
First function, that runs in router | [
"public function run($URL,$host=''){\n\t\tif(ROUTER_DEBUG){\n\t\t\tBLog::addToLog('[Router]: Router started! URL='.$URL.'; host='.$host);\n\t\t\t}\n\t\t$this->init();\n\t\t//bimport('ip.ban');\n\t\t//$r=BIpBan::check();\n\t\t//if($r===false){\n\t\t//\theader($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden');\n\t\t//\tr... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Destroy destroys the window.
// (https://wiki.libsdl.org/SDL_DestroyWindow) | [
"func (window *Window) Destroy() error {\n\tlastErr := GetError()\n\tClearError()\n\tC.SDL_DestroyWindow(window.cptr())\n\terr := GetError()\n\tif err != nil {\n\t\treturn err\n\t}\n\tSetError(lastErr)\n\treturn nil\n}"
] | [
"def close(self):\n ''''''\n h = self.gdx_handle\n gdxcc.gdxClose(h)\n gdxcc.gdxFree(h)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Del removes an element from the Trie. Returns a boolean indicating whether an
// element was actually deleted. | [
"func (t *Trie) Del(path []string) bool {\n\tif len(path) == 0 {\n\t\treturn t.delentry()\n\t}\n\n\tkey := path[0]\n\tnewpath := path[1:]\n\n\tres, ok := t.Children[key]\n\tif !ok {\n\t\treturn false\n\t}\n\n\treturn res.Del(newpath)\n}"
] | [
"public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxS... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns true when thw valid_for_source and valid_for combo uses any round.
@param string $source
@param string $field
@param array $rounds
@return boolean | [
"protected function checkSourceRequired($source, $field, array $rounds)\n {\n if (($source == \\Gems_Tracker_Engine_StepEngineAbstract::ANSWER_TABLE) ||\n ($source == \\Gems_Tracker_Engine_StepEngineAbstract::TOKEN_TABLE)) {\n return isset($rounds[$field]) && $rounds[$field];\n ... | [
"protected function create_relatedObject($key, $relation_type)\n {\n $c = $this->addChild($this->working_node, 'relatedObject');\n $this->addChild($c, 'key', $key);\n $c = $this->addChild($c, 'relation');\n // Mimick ANDS with enpty value to get both tags for relation. Only for better... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Gets the string representation of the log level.
@param logLevel Level of the log message.
@return String representation of the log level. | [
"static String getLevelTag(final int logLevel) {\n\n switch (logLevel) {\n\n case LogLevelConst.FATAL:\n return LogConstants.TAG_FATAL;\n\n case LogLevelConst.ERROR:\n return LogConstants.TAG_ERROR;\n\n case LogLevelConst.WARNING:\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Start dragging a row | [
"def _start_drag_row(self, event):\n \"\"\"\"\"\"\n self._dragged_row = self.identify_row(event.y) # identify dragged row\n bbox = self.bbox(self._dragged_row)\n self._dy = bbox[1] - event.y # distance between cursor and row upper border\n self._dragged_row_y = bbox[1] # y coor... | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// StartOfDay returns the time at 00:00:00 of the same day | [
"func (c *Carbon) StartOfDay() *Carbon {\n\treturn create(c.Year(), c.Month(), c.Day(), 0, 0, 0, 0, c.Location())\n}"
] | [
"public Date convertToDate(long millis, TimeZone tz) {\n\n // no adjustments for the inifity hack values\n if (millis <= PGStatement.DATE_NEGATIVE_INFINITY\n || millis >= PGStatement.DATE_POSITIVE_INFINITY) {\n return new Date(millis);\n }\n if (tz == null) {\n tz = getDefaultTz();\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Invert a set.
@return $this; | [
"public function invert()\n {\n\n $this->containsNull = !$this->containsNull;\n\n if( $this->intervals === array( array(null, null) ) ) {\n $this->intervals = array();\n return $this;\n }\n\n $output = array();\n $working = array( null, null );\n\n ... | [
"final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Condition returns the condition where the PluralRule applies. | [
"func (pr *PluralRule) Condition() string {\n\ti := strings.Index(pr.Rule, \"@\")\n\treturn pr.Rule[:i]\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
set calendar property x-prop
@author Kjell-Inge Gustafsson <ical@kigkonsult.se>
@since 2.0.7 - 2007-06-21
@param string $label
@param string $value
@param array $params optional
@return void | [
"function setXprop( $label, $value, $params=FALSE ) {\n if( empty( $label ) || empty( $value ))\n return;\n $xprop = array( 'value' => $value );\n $toolbox = new calendarComponent();\n $xprop['params'] = $toolbox->_setParams( $params );\n $this->xprop[$label] = $xprop;\n }"
] | [
"public function getPHPDatePattern()\n {\n $isoFormat = Calendar::getDateFormat('short');\n $result = Calendar::tryConvertIsoToPhpFormat($isoFormat);\n if ($result === null) {\n $result = t(/*i18n: Short date format: see http://www.php.net/manual/en/function.date.php */ 'n/j/Y');\... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Write a {@code group} field, including tag, to the stream. | [
"public void writeGroup(final int fieldNumber, final MessageLite value)\n throws IOException {\n writeTag(fieldNumber, WireFormat.WIRETYPE_START_GROUP);\n writeGroupNoTag(value);\n writeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP);\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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Apply correlation to randomly sampled residuals.
See Parent function | [
"def apply_correlation(self, sites, imt, residuals, stddev_intra):\n \n # stddev_intra is repeated if it is only 1 value for all the residuals\n if stddev_intra.shape[0] == 1:\n stddev_intra = numpy.matlib.repmat(\n stddev_intra, len(sites.complete), 1)\n # Resh... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
//////////////////////////////
// GetByName returns a skin based on its name or an error | [
"func (sc *SkinCollection) GetByName(name string) (*Skin, error) {\n\tif skin, ok := sc.db[name]; ok {\n\t\treturn &skin, nil\n\t}\n\treturn nil, fmt.Errorf(\"no such skin: '%s'\", name)\n}"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
@throws PageException | [
"private void doUpdateDefaultPassword() throws PageException {\n\ttry {\n\t admin.updateDefaultPassword(getString(\"admin\", action, \"newPassword\"));\n\t}\n\tcatch (Exception e) {\n\t throw Caster.toPageException(e);\n\t}\n\tstore();\n }"
] | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Set the typeface to the all text views belong to the view group.
@param context the context.
@param layoutRes the layout resource id.
@param typefaceName typeface name.
@param style the typeface style.
@return the view. | [
"public View setTypeface(Context context, @LayoutRes int layoutRes, String typefaceName, int style) {\n\t\treturn setTypeface(context, layoutRes, null, typefaceName, 0);\n\t}"
] | [
"@Override\n public Object instantiateItem(ViewGroup container, int position) {\n int itemViewType = getItemViewType(position);\n RecyclerView.ViewHolder holder = mRecycledViewPool.getRecycledView(itemViewType);\n\n if (holder == null) {\n holder = mAdapter.createViewHolder(contai... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// wrapper around the map to get a Lock for concurrency. This could easily be
// done with Go 1.9 sync.Map, but we want to support versions below. | [
"func (c *Client) setCachedProjectID(label string, id *manifold.ID) {\n\tc.Lock()\n\tdefer c.Unlock()\n\n\tc.projectIDs[label] = id\n}"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Select impl by dialect. | [
"def load_dialect_impl(self, dialect): # type: (DefaultDialect) -> TypeEngine\n \"\"\"\"\"\"\n if self.__use_json(dialect):\n return dialect.type_descriptor(self.__json_type)\n return dialect.type_descriptor(sqlalchemy.UnicodeText)"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Custom attribute writer method checking allowed values (enum).
@param [Object] form_text_field_type Object to be assigned | [
"def form_text_field_type=(form_text_field_type)\n validator = EnumAttributeValidator.new('String', [\"AllTextTypes\", \"PlainText\", \"RichText\"])\n if form_text_field_type.to_i == 0\n unless validator.valid?(form_text_field_type)\n raise ArgumentError, \"invalid value for 'form_text_fie... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// cmdPlaylist lists all playlists or contents of one playlist. | [
"func cmdPlaylist(session *sp.Session, args []string, abort <-chan bool) error {\n\tvar f = flag.NewFlagSet(args[0], flag.ContinueOnError)\n\topts := struct {\n\t\toffset, limit *int\n\t}{\n\t\toffset: f.Int(\"offset\", 0, \"result offset\"),\n\t\tlimit: f.Int(\"limit\", 10, \"result count limitation\"),\n\t}\n\n\... | [
"function databaseInitialize() {\n var entries = db.getCollection(\"entries\");\n var messages = db.getCollection(\"messages\");\n\n // Since our LokiFsStructuredAdapter is partitioned, the default 'quickstart3.db'\n // file will actually contain only the loki database shell and each of the collections\n // wi... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// DurationFunc is a basic parser for the time.Duration type that should be used with `env.ParseWithFuncs()` | [
"func DurationFunc(v string) (interface{}, error) {\n\ts, err := time.ParseDuration(v)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parser duration: %v\", err)\n\t}\n\treturn s, err\n}"
] | [
"func (f *Factory) BindFlags(flags *pflag.FlagSet) {\n\t// any flags defined by external projects (not part of pflags)\n\tflags.AddGoFlagSet(flag.CommandLine)\n\n\t// Merge factory's flags\n\tflags.AddFlagSet(f.flags)\n\n\t// Globally persistent flags across all subcommands.\n\t// TODO Change flag names to consts t... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get
@return Payload | [
"public function get($data = [])\n\t{\n\t\t// Process data given.\n\t\t$processPayload = $this->process(__FUNCTION__, $data);\n\n\t\tif( ! $processPayload->isStatus(Payload::STATUS_VALID))\n\t\t{\n\t\t\treturn $processPayload;\n\t\t}\n\n\t\treturn $this->dataSource->get($data);\n\t}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Compares two keys using the correct comparison method for this
Collection.
@param k1 The first item to be compared.
@param k2 The second item to be compared.
@return a positive or negative integer if they differ, and zero if
equal. | [
"private int compare(Object k1, Object k2) {\n return (mComparator==null ? ((Comparable)k1).compareTo(k2)\n : mComparator.compare(k1, k2));\n }"
] | [
"@Override\n public void putAll(Map<? extends TypeK, ? extends TypeV> m) {\n for (Map.Entry<? extends TypeK, ? extends TypeV> e : m.entrySet())\n put(e.getKey(), e.getValue());\n }\n\n /** Removes all of the mappings from this map. */\n @Override\n public void clear() { // Smack a new empty tab... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// Metrics queries the local dcos-metrics API and returns a slice of
// producers.MetricsMessage. | [
"func (p *Plugin) Metrics() ([]producers.MetricsMessage, error) {\n\tvar messages []producers.MetricsMessage\n\n\t// Fetch node metrics\n\tnodeMetrics, err := p.getNodeMetrics()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmessages = append(messages, nodeMetrics)\n\n\t// Master only collects node metrics; return... | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Pass through to provider SequenceRuleLookupSession.use_any_status_sequence_rule_view | [
"def use_any_status_sequence_rule_view(self):\n \"\"\"\"\"\"\n self._operable_views['sequence_rule'] = ANY_STATUS\n # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked\n for session in self._get_provider_sessions():\n try:\n ... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// ChannelEdit edits the given channel
// channelID : The ID of a Channel
// name : The new name to assign the channel. | [
"func (s *Session) ChannelEdit(channelID, name string) (*Channel, error) {\n\treturn s.ChannelEditComplex(channelID, &ChannelEdit{\n\t\tName: name,\n\t})\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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Used for generating thumbnails. Does not include overlaid
graphics. | [
"def save_plain_image_as_file(self, filepath, format='png', quality=90):\n \n qimg = self.get_plain_image_as_widget()\n qimg.save(filepath, format=format, quality=quality)"
] | [
"def _find_regular_images(container, contentsinfo):\n \n\n for pdfimage, xobj in _image_xobjects(container):\n\n # For each image that is drawn on this, check if we drawing the\n # current image - yes this is O(n^2), but n == 1 almost always\n for draw in contentsinfo.xobject_settings:\n ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
dropIndex
@param string $table
@param string $name
@return string | [
"public static function dropIndex($table, $name)\n {\n $query = static::getQuery();\n\n return static::build(\n 'DROP INDEX',\n $query->quoteName($name),\n 'ON',\n $query->quoteName($table)\n );\n }"
] | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
@param string $companyUserKey
@throws \Pyz\Zed\DataImport\Business\Exception\EntityNotFoundException
@return int | [
"protected function getIdCompanyUserByKey(string $companyUserKey): int\n {\n if (!isset($this->idCompanyUserListCache[$companyUserKey])) {\n $idCompanyUser = $this->getCompanyUserQuery()\n ->filterByKey($companyUserKey)\n ->select(SpyCompanyUserTableMap::COL_ID_COM... | [
"public function GetTableColumnNames($tableName) {\n $this->setDbConfigList(array());\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::COLUMNNAMES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"DESCRI... | codesearchnet | {
"query": "Represent the sentence about API documentation:",
"pos": "Represent the code about API documentation:",
"neg": "Represent the code about Software development:"
} |
// matchLevel is used to recursively descend into the trie. | [
"func matchLevel(l *level, toks []string, results *SublistResult) {\n\tvar pwc, n *node\n\tfor i, t := range toks {\n\t\tif l == nil {\n\t\t\treturn\n\t\t}\n\t\tif l.fwc != nil {\n\t\t\taddNodeToResults(l.fwc, results)\n\t\t}\n\t\tif pwc = l.pwc; pwc != nil {\n\t\t\tmatchLevel(pwc.next, toks[i+1:], results)\n\t\t}\... | [
"@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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Builds the tag for the counter of a given epoch/field, without the OSSOS base.
@param epoch_field:
@param dry_run:
@return: | [
"def build_counter_tag(epoch_field, dry_run=False):\n \n logger.info(\"Epoch Field: {}, OBJECT_COUNT {}\".format(str(epoch_field), str(OBJECT_COUNT)))\n tag = epoch_field[1] + \"-\" + OBJECT_COUNT\n\n if dry_run:\n tag += \"-DRYRUN\"\n\n return tag"
] | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Checks whether the container contains the value i.
@param buf underlying buffer
@param position position of the container in the buffer
@param i index
@return whether the container contains the value i | [
"public static boolean contains(ByteBuffer buf, int position, final short i) {\n final int x = toIntUnsigned(i);\n return (buf.getLong(x / 64 * 8 + position) & (1L << x)) != 0;\n }"
] | [
"function NDDBIndex(idx, nddb) {\n // The name of the index.\n this.idx = idx;\n // Reference to the whole nddb database.\n this.nddb = nddb;\n // Map indexed-item to a position in the original database.\n this.resolve = {};\n // List of all keys in `resolve` object.... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Dumping all private properties.
@return string
The generated HTML markup | [
"public function callMe()\n {\n $output = $this->dispatchStartEvent();\n\n $refProps = array();\n /** @var \\Brainworxx\\Krexx\\Service\\Reflection\\ReflectionClass $ref */\n $ref = $this->parameters[static::PARAM_REF];\n // We need to keep the original reference intact.\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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Return a new DStream containing only the elements that satisfy predicate. | [
"def filter(self, f):\n \n def func(iterator):\n return filter(f, iterator)\n return self.mapPartitions(func, True)"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Помощник вида для пагинатора со стилем вывода "JUMPING". | [
"public function jumping(IPaginator $paginator, $pagesCountInRange)\n {\n $this->checkPagesCountInRange($pagesCountInRange);\n\n return $this->buildContext($paginator) + [\n 'pagesRange' => $this->jumpingBuildPagesRange($paginator, $pagesCountInRange)\n ];\n }"
] | [
"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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.MCFRG__RG_LENGTH:\n\t\t\t\tsetRGLength(RG_LENGTH_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.MCFRG__TRIPLETS:\n\t\t\t\tgetTriplets().clear();\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\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 Github text about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Keep an object in sync with another. | [
"function mirrorProperties(src, dest = {}) {\n function set(name) { dest[name] = src[name]; }\n function _delete(name) { delete dest[name]; }\n\n var handlers = { add: set, update: set, delete: _delete};\n\n assign(dest, src);\n observe(src, makeObserver(handlers));\n return dest;\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 instruction about Data synchronization:",
"pos": "Represent the Github code about Data synchronization:",
"neg": "Represent the Github code about programming:"
} |
Auto guesses name of the view.
For function it will be ``view.__name__``
For classes it will be ``view.url_name`` | [
"def resolve_name(view):\n \n if inspect.isfunction(view):\n return view.__name__\n if hasattr(view, 'url_name'):\n return view.url_name\n if isinstance(view, six.string_types):\n return view.split('.')[-1]\n return None"
] | [
"def func(name):\n \n\n \"\"\"\n # Raise condition evaluated in same call as exception addition\n pexdoc.addex(TypeError, \"Argument `name` is not valid\", not isinstance(name, str))\n return \"My name is {0}\".format(name)"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Camelize an uppercased word | [
"func Camelize(word string) (camelized string) {\n\tfor pos, ru := range []rune(word) {\n\t\tif pos > 0 {\n\t\t\tcamelized += string(unicode.ToLower(ru))\n\t\t} else {\n\t\t\tcamelized += string(unicode.ToUpper(ru))\n\t\t}\n\t}\n\treturn\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Checks if we're authenticated on the SAFE network
@returns {*} | [
"function () {\n this.log('Checking if authorized...');\n return this.Request.get('/auth').auth().execute()\n // let's use our own function here, that resolve true or false,\n // rather than throwing an error if invalid token\n .then(function () {\n this.log('Authorized');\n retur... | [
"@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 text about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about Programming:"
} |
Crop image if is not exists in alias.
@param MediaInterface $media
@param AliasManipulator $aliasManipulator | [
"private function cropImage(MediaInterface $media, AliasManipulator $aliasManipulator)\n {\n $aliasName = $aliasManipulator->getAliasName();\n $aliasArray = $aliasManipulator->getAliasArray();\n $mediaPath = $aliasName.'/'.$media->getReference();\n\n if ($this->filesystemManipulator->... | [
"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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
// WriteUnit writes a systemd unit in the given path with the given unit options
// if no previous error occurred. | [
"func (uw *UnitWriter) WriteUnit(path string, errmsg string, opts ...*unit.UnitOption) {\n\tif uw.err != nil {\n\t\treturn\n\t}\n\n\tfile, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)\n\tif err != nil {\n\t\tuw.err = errwrap.Wrap(errors.New(errmsg), err)\n\t\treturn\n\t}\n\tdefer file.Close()\... | [
"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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get supported languages (by querying the server). | [
"def _get_languages(cls) -> set:\n \"\"\"\"\"\"\n if not cls._server_is_alive():\n cls._start_server_on_free_port()\n url = urllib.parse.urljoin(cls._url, 'Languages')\n languages = set()\n for e in cls._get_root(url, num_tries=1):\n languages.add(e.get('abbr... | [
"@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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Pull this image from registry. Raises an exception if the image is not found in
the registry.
:return: None | [
"def pull(self):\n \n for json_e in self.d.pull(repository=self.name, tag=self.tag, stream=True, decode=True):\n logger.debug(json_e)\n status = graceful_get(json_e, \"status\")\n if status:\n logger.info(status)\n else:\n error... | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) IFramebufferOverlaysetAlpha(request *IFramebufferOverlaysetAlpha) (*IFramebufferOverlaysetAlphaResponse, error) {\n\tresponse := new(IFramebufferOverlaysetAlphaResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Perform logical 'or' between BooleanValue instances | [
"public static Boolean or(Boolean a,Boolean b) \n {\n \treturn orTable[ttIndex(a)][ttIndex(b)];\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Gets log title
@param mixed $id
@param \Illuminate\Database\Eloquent\Model $model
@return String | [
"public static function getLogTitle($id, $model)\n {\n $key = 'USERCONFIG_' . strtoupper($model->type) . '_PROVIDER';\n $provider = last($model->related_data['provider']);\n $html = app('html');\n $params = [];\n $params['owner... | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Return the path for a package.
For example, if the package is java.lang,
the path is java/lang. | [
"public static DocPath forPackage(PackageDoc pd) {\n return (pd == null) ? empty : DocPath.create(pd.name().replace('.', '/'));\n }"
] | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Register an alias for a class
@param string $class The original
@param string $alias The alias name for the class. | [
"public function registerAlias($class, $alias)\n {\n $alias = trim($alias);\n $class = trim($class);\n\n $this->__registry->alias($class, $alias);\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 instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Wraps a group of tests with setUp and tearDown functions.
Used by testCase.
@param {Function} setUp
@param {Function} tearDown
@param {Object} group
@api private | [
"function (setUp, tearDown, group) {\n var tests = {};\n var keys = _keys(group);\n for (var i = 0; i < keys.length; i += 1) {\n var k = keys[i];\n if (typeof group[k] === 'function') {\n tests[k] = wrapTest(setUp, tearDown, group[k]);\n }\n else if (typeof group[k] =... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Builds condition string
@param string $field
@param string|array $bind
@param string $operator
@return string | [
"protected function buildConditionString($field, $bind, $operator)\n {\n if (is_array($bind)) {\n foreach ($bind as &$val) {\n $val = $this->buildConditionString($field, $val, $operator);\n unset($val);\n }\n\n $logical = $operator === '!=' ? ... | [
"function CallArguments_Argument(&$res, $sub)\n {\n if (!empty($res['php'])) {\n $res['php'] .= ', ';\n }\n\n $res['php'] .= ($sub['ArgumentMode'] == 'default') ? $sub['string_php'] :\n str_replace('$$FINAL', 'XML_val', $sub['php']);\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Reflect 'name' using ONLY runtime reflection.
You most likely want to use ScopeStack.reflect instead.
Returns:
Type of 'name', or protocol.AnyType. | [
"def reflect_runtime_member(self, name):\n \n for scope in reversed(self.scopes):\n try:\n return structured.reflect_runtime_member(scope, name)\n except (NotImplementedError, KeyError, AttributeError):\n continue\n\n return protocol.AnyType"
... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Clears and fills {@code mBuckets} with buckets | [
"private List<Bucket<V>> refillBuckets() {\n List<Bucket<V>> bucketsToTrim = new ArrayList<>(mBuckets.size());\n\n for (int i = 0, len = mBuckets.size(); i < len; ++i) {\n final Bucket<V> oldBucket = mBuckets.valueAt(i);\n final int bucketSize = oldBucket.mItemSize;\n final int maxLength = oldB... | [
"long storeSpaceForAdd() {\n return ConcurrentSubList.maximumSerializedSize() // List header\n + 3 * ConcurrentSubList.Link.maximumSerializedSize() // Current,Previous,Next links \n + 4 * owningToken.objectStore.getAddSpaceOverhead() // Store overhead for all of the above.\n ... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@param Campaign $campaign
@throws Exception
API documentation: https://whatcounts.zendesk.com/hc/en-us/articles/204669985 | [
"public function launchCampaign(Campaign &$campaign)\n\t\t{\n\t\t\t$form_data = array(\n\t\t\t\t'list_id' => $campaign->getListId(),\n\t\t\t\t'template_id' => $campaign->getTemplateId(),\n\t\t\t\t'subject' => $campaign->getSubject(),\n\t\t\t\t'seed_list_id' => $campaign->getSeedListId(),\n\t\t\t\t'segmentation_id' ... | [
"public function addExtraOembedProviders( $providers ) {\n\n\t\t// Format (string), Provider (string), Is format a regular expression? (bool)\n\t\t$providers['#https?://mathembed\\.com/latex\\?inputText=.*#i'] = [ 'https://mathembed.com/oembed', true ];\n\t\t$providers['#https?://www\\.openassessments\\.org/assessm... | codesearchnet | {
"query": "Represent the Github summarization about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code:"
} |
Inverse hyperbolic cosine | [
"def acosh(x):\n \n if isinstance(x, UncertainFunction):\n mcpts = np.arccosh(x._mcpts)\n return UncertainFunction(mcpts)\n else:\n return np.arccosh(x)"
] | [
"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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Resets the current context environment, notifiers and motion detectors.
@public | [
"function Reset () {\n log.info('Reseting environment...')\n for (let m in motionDetectors) {\n RemoveDetector(motionDetectors[m])\n }\n for (let n in em.GetNotifiers()) {\n RemoveNotifier(em.GetNotifiers()[n], true)\n }\n em.SetNotifiers([])\n if (em.GetEnvironment()) {\n em.GetEnvironment().remove... | [
"def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Len returns the byte length of the encoded packet. | [
"func (sp *Subscribe) Len() int {\n\tml := sp.len()\n\treturn headerLen(ml) + ml\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Attempts to load static page. Raises exception if not found.
@param string $page
@return Page | [
"protected function loadStaticPage($page)\n {\n $layout = $this->layout ?: $this;\n try {\n $t = 'page/'.str_replace('_', '/', strtolower($page));\n $this->template->findTemplate($t);\n\n $this->page_object = $layout->add($this->page_class, $page, 'Content', array($... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github text about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about File management:"
} |
Builds an IN clause.
@param string $field
@param array $values
@param bool $isIn
@return string | [
"protected function buildIn($field, array $values, $isIn)\n {\n $operator = $isIn ? ' IN ' : ' NOT IN ';\n\n return $field.$operator.$this->parameterizeValues($values);\n }"
] | [
"protected function create_relatedObject($key, $relation_type)\n {\n $c = $this->addChild($this->working_node, 'relatedObject');\n $this->addChild($c, 'key', $key);\n $c = $this->addChild($c, 'relation');\n // Mimick ANDS with enpty value to get both tags for relation. Only for better... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Parse the character encoding from the specified content type header. If
the content type is null, or there is no explicit character encoding,
<code>null</code> is returned.
@param contentType
a content type header | [
"public static String parseCharacterEncoding( final String contentType )\n {\n\n if ( contentType == null )\n {\n return ( null );\n }\n final int start = contentType.indexOf( \"charset=\" );\n if ( start < 0 )\n {\n return ( null );\n }\n ... | [
"def whereIsYadis(resp):\n \n # Attempt to find out where to go to discover the document\n # or if we already have it\n content_type = resp.headers.get('content-type')\n\n # According to the spec, the content-type header must be an exact\n # match, or else we have to look for an indirection.\n ... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Convenience method to set the description $a.
@param mixed $value
@return mixed | [
"protected function set_desca($value) {\n if ($value !== null) {\n if (!is_scalar($value) && !is_array($value) && !($value instanceof stdClass)) {\n throw new coding_exception('$a format not supported.');\n }\n $value = json_encode($value);\n }\n ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
set extended attribute (refactor) | [
"function set_extended_attribute (context, path, node, name, value, flag, callback) {\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n update_node_times(context, path, node, { ctime: Date.now() }, callback);\n }\n }\n\n var xattrs = node.xattrs;\n\n if (flag === X... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Replace the file extension.
@param attValue value to be replaced
@param extName value used to replace with
@return replaced value | [
"public static String replaceExtension(final String attValue, final String extName) {\n String fileName;\n int fileExtIndex;\n int index;\n\n index = attValue.indexOf(SHARP);\n\n if (attValue.startsWith(SHARP)) {\n return attValue;\n } else if (index != -1) {\n ... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.