query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Close the path.
@return path object, for compact syntax. | [
"public SVGPath close() {\n assert lastaction != 0 : \"Paths must begin with a move to the initial position!\";\n if(lastaction != PATH_CLOSE) {\n buf.append(' ').append(PATH_CLOSE);\n lastaction = PATH_CLOSE;\n }\n return this;\n }"
] | [
"def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// TriggerStart asynchronously starts the unit identified by the given name.
// This function does not block for the underlying unit to actually start. | [
"func (m *systemdUnitManager) TriggerStart(name string) error {\n\tjobID, err := m.systemd.StartUnit(name, \"replace\", nil)\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to trigger systemd unit %s start: %v\", name, err)\n\t\treturn err\n\t}\n\tlog.Infof(\"Triggered systemd unit %s start: job=%d\", name, jobID)\n\tr... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Given a datum's features, construct a counter with keys
the labels and values the score (unnormalized log probability)
for each class. | [
"public Counter<L> scoresOf(int[] features) {\r\n Counter<L> scores = new ClassicCounter<L>();\r\n for (L label : labels())\r\n scores.setCount(label, scoreOf(features, label));\r\n return scores;\r\n }"
] | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
// New DescribeLoadBalancerAttribute to describe loadbalancer attribute using regionId avoiding to get not found error
//
// You can read doc at https://www.alibabacloud.com/help/doc-detail/27583.htm | [
"func (client *Client) NewDescribeLoadBalancerAttribute(args *NewDescribeLoadBalancerAttributeArgs) (loadBalancer *LoadBalancerType, err error) {\n\n\tresponse := &DescribeLoadBalancerAttributeResponse{}\n\terr = client.Invoke(\"DescribeLoadBalancerAttribute\", args, response)\n\tif err != nil {\n\t\treturn nil, er... | [
"def _generate_api_gateway(self):\n \n self.tf_conf['resource']['aws_api_gateway_rest_api']['rest_api'] = {\n 'name': self.resource_name,\n 'description': self.description\n }\n self.tf_conf['output']['rest_api_id'] = {\n 'value': '${aws_api_gateway_rest_... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Cleans/checks user has entered all required attributes. This might save
some queries from being sent to server if they are totally wrong. | [
"def clean(self):\n \n if not all([self._type, self._requested, self._value, self._action]):\n raise MalFormattedSource(\n \"<type, requested, value, action> fields are required.\"\n )"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the sentence about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about Software development:"
} |
Gets a new instance of the class corresponding to the key. | [
"public V get(K key) {\n Entry<V> entry = classMap.get(key);\n return entry == null ? null : entry.get();\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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Gets the average cycletime of the current user for the past week.
This includes any ticket that was marked "In Progress" but not reopened. | [
"def get_week_avg_cycletime(self):\n \n def moving_average(new_val, old_avg, prev_n):\n return (new_val + old_avg) / (prev_n + 1)\n\n active_tickets_jql = 'assignee=currentUser() and status was \"In Progress\" DURING (startOfWeek(), endofweek()) and status not in (Backlog, Open) ORDE... | [
"def can_pull(self, initial, scheduled):\n \n if not initial and self.config.is_valid_schedule():\n # if the config has a valid schedule, return True if this is a scheduled run\n return scheduled\n return True"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software Development:"
} |
Set up basic auth for the client
@param username: Login name.
@param password: Login password.
@param realm: The authentication realm.
@return: The current object | [
"def set_basic_auth(self, username, password, realm):\n \n self._passmgr.add_password(realm, self._base_url, username, password)\n return self"
] | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
initialize
@param array $config Configurations.
@return void | [
"public function initialize(array $config)\n {\n parent::initialize($config);\n\n $this->setEmailObject(new Email($this->config('config')));\n }"
] | [
"def setConfiguration(self, configuration):\n \n \"\"\"\n if isinstance(configuration, Configuration):\n configuration = configuration.value\n\n self.dev.set_configuration(configuration)"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
method supporting recursion through all criterions to give
us a string array of tables from each criterion
@return void | [
"private function addCriterionTable(AbstractCriterion $c, array &$s)\n {\n $s[] = $c->getTable();\n foreach ($c->getClauses() as $clause) {\n $this->addCriterionTable($clause, $s);\n }\n }"
] | [
"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 instruction about database:",
"pos": "Represent the code about database:",
"neg": "Represent the code about Natural Language Processing:"
} |
Create this object given the class name.
@param filepath
@return | [
"public URL getResourceURL(String filepath, URL urlCodeBase, String version, ClassLoader classLoader) throws RuntimeException\n {\n if (filepath == null)\n return null;\n if (File.separatorChar != '/')\n filepath = filepath.replace(File.separatorChar, '/'); // Just in case I g... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Creates a LatLng object from a string. For example:
```
$coord = LatLng::createFromString('-3.89,3.22');
```
@param string $value
@return LatLng|null | [
"public static function createFromString($value)\n {\n $coord = explode(',', $value);\n if (count($coord) == 2) {\n $lat = floatval(trim($coord[0]));\n $lng = floatval(trim($coord[1]));\n return new self([\n 'lat' => $lat,\n 'lng' => $l... | [
"function(options) {\n // compile regular expressions once instead of every time they are used\n this.regExes = {\n trimSpace: (/^\\s*|\\s*$/g),\n removeSpace: (/\\s*/g),\n splitSpace: (/\\s+/),\n trimComma: (/\\s*,\\s*/g),\n kmlColor: (/(\\w{2})(... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) INetworkAdaptergetAttachmentType(request *INetworkAdaptergetAttachmentType) (*INetworkAdaptergetAttachmentTypeResponse, error) {\n\tresponse := new(INetworkAdaptergetAttachmentTypeResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, err\n... | [
"@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 post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Returns permissions required to use the field.
@return string[] | [
"public function permissions()\n {\n if (is_array($this->permissions)) {\n return $this->permissions;\n }\n\n if ($this->permissions) {\n return [ $this->permissions ];\n }\n\n return [];\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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about File management:"
} |
// Wants maps a content-type, or part of one ("json", "html", "form", etc...),
// to a buffalo.Handler to respond with when it gets that content-type. | [
"func (r Responder) Wants(ct string, h buffalo.Handler) Responder {\n\tr.moot.Lock()\n\tdefer r.moot.Unlock()\n\tct = strings.ToLower(ct)\n\tr.wants[ct] = h\n\tif ct == \"html\" || ct == \"form\" {\n\t\tr.wants[\"html\"] = h\n\t\tr.wants[\"form\"] = h\n\t}\n\treturn r\n}"
] | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the description about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
SetupSFields Method. | [
"public void setupSFields()\n {\n this.getRecord(ClassInfo.CLASS_INFO_FILE).getField(ClassInfo.CLASS_PACKAGE).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY);\n this.getRecord(ClassInfo.CLASS_INFO_FILE).getF... | [
"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:"
} |
Write the contents of the given ByteBuffer to the OutputStream and flush the stream. | [
"private static void writeAndFlush(\n final ByteBuffer buffer, final OutputStream outputStream) throws IOException {\n\n if (buffer.hasArray()) {\n outputStream.write(buffer.array(), buffer.position(), buffer.remaining());\n } else {\n // cannot access underlying byte array, need to copy into a... | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about File management:"
} |
-------------------------------------------------------------------------------------------------------------------- | [
"public function logDebug()\n {\n if ($this->getVerbosity()>=OutputInterface::VERBOSITY_DEBUG)\n {\n $args = func_get_args();\n $format = array_shift($args);\n\n $this->writeln(vsprintf('<info>'.$format.'</info>', $args));\n }\n }"
] | [
"public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col... | codesearchnet | {
"query": "Represent the Github text about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code about programming:"
} |
changes date by given amount of hours
@api
@param int $hours
@return \stubbles\date\Date | [
"public function byHours(int $hours): Date\n {\n return $this->hourTo($this->originalDate->hours() + $hours);\n }"
] | [
"def creationTime(item):\n \n forThisItem = _CreationTime.createdItem == item\n return item.store.findUnique(_CreationTime, forThisItem).timestamp"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetEnableCloudwatchLogsExports sets the EnableCloudwatchLogsExports field's value. | [
"func (s *RestoreDBClusterToPointInTimeInput) SetEnableCloudwatchLogsExports(v []*string) *RestoreDBClusterToPointInTimeInput {\n\ts.EnableCloudwatchLogsExports = v\n\treturn s\n}"
] | [
"func NewTarTimeoutError() error {\n\treturn Error{\n\t\tMessage: fmt.Sprintf(\"timeout waiting for tar stream\"),\n\t\tDetails: nil,\n\t\tErrorCode: TarTimeoutError,\n\t\tSuggestion: \"check the Source-To-Image scripts if it accepts tar stream for assemble and sends for save-artifacts\",\n\t}\n}"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Short description of method setColumnsAdapter
@access public
@author Cédric Alfonsi, <cedric.alfonsi@tudor.lu>
@param array columnIds
@param Adapter adapter
@return boolean | [
"public function setColumnsAdapter($columnIds, tao_helpers_grid_Cell_Adapter $adapter)\n {\n $returnValue = (bool) false;\n\n \n\t\tif(is_string($columnIds)){\n\t\t\t$columnIds = array($columnIds);\n\t\t}\n\t\tif(is_array($columnIds)){\n\t\t\tforeach($columnIds as $colId){\n\t\t\t\tif (!isset($thi... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Returns all the commerce accounts where userId = ? and type = ?.
@param userId the user ID
@param type the type
@return the matching commerce accounts | [
"@Override\n\tpublic List<CommerceAccount> findByU_T(long userId, int type) {\n\t\treturn findByU_T(userId, type, QueryUtil.ALL_POS, QueryUtil.ALL_POS,\n\t\t\tnull);\n\t}"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
loads an rml mapping into memory
args:
rml_name(str): the name of the rml file | [
"def load_rml(self, rml_name):\n \n conn = CFG.rml_tstore\n cache_path = os.path.join(CFG.CACHE_DATA_PATH, 'rml_files', rml_name)\n if not os.path.exists(cache_path):\n results = get_graph(NSM.uri(getattr(NSM.kdr, rml_name), False),\n conn)\n ... | [
"def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Request a new token
@param array $userData
@return void
@todo Allow different delivery-methods, such as SMS? | [
"public function requestToken(array $userData) {\n if (empty($userData['email'])) {\n $this->_addError(\n sprintf(\n __('%s is a required field'),\n __('Email')\n )\n );\n return false;\n }\n\n ... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Generates the Select clause from this ResultSetMappingBuilder.
Works only for all the entity results. The select parts for scalar
expressions have to be written manually.
@param array $tableAliases
@return string | [
"public function generateSelectClause($tableAliases = array())\n {\n $sql = \"\";\n\n foreach ($this->columnOwnerMap as $columnName => $dqlAlias) {\n $tableAlias = isset($tableAliases[$dqlAlias])\n ? $tableAliases[$dqlAlias] : $dqlAlias;\n\n if ($sql) {\n ... | [
"public static QueryBuilderFind fromType(Class<? extends WindupVertexFrame> type)\n {\n final Query query = new Query();\n // this query is going to be added after evaluate() method, because in some cases we need gremlin and in some\n // frames\n query.searchType = type;\n retu... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
Set default options for libxml loader
@param int $options Default options for libxml loader | [
"public static function setLibXmlLoaderOptions($options = null)\n {\n if (is_null($options) && defined(LIBXML_DTDLOAD)) {\n $options = LIBXML_DTDLOAD | LIBXML_DTDATTR;\n }\n if (version_compare(PHP_VERSION, '5.2.11') >= 0) {\n @libxml_disable_entity_loader($options == (... | [
"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:"
} |
Build export fields | [
"public function buildExportFields()\n {\n $this->addExportField('id', $this->translator->trans('Id'))\n ->addExportField('date', $this->translator->trans('Date'))\n ->addExportField('language', $this->translator->trans('Language'));\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get the adapter default user agent
@return string | [
"public function getUserAgent(): string\n {\n $userAgent = 'Swoft/' . App::version();\n $userAgent .= ' Swoft/' . SWOOLE_VERSION;\n $userAgent .= ' PHP/' . PHP_VERSION;\n if (\\extension_loaded('curl') && \\function_exists('curl_version')) {\n $userAgent .= ' curl/' . \\cur... | [
"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 Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Валидация параметров запроса
@throws \Symfony\Component\Validator\Exception\MissingOptionsException
@throws \Symfony\Component\Validator\Exception\InvalidOptionsException
@throws \Symfony\Component\Validator\Exception\ConstraintDefinitionException | [
"public function validateData()\n {\n $constraint = new Assert\\Collection([\n 'fields' => $this->getValidationRules(),\n ]);\n\n $violations = $this->validator->validate($this->getParameters(), $constraint);\n if ($violations->count()) {\n throw new ValidatorExc... | [
"protected function addSql($sql, array $params = [], array $types = [])\n {\n $message = 'Calling method \"addSql\" is not allowed. Use \"sql\" method instead';\n throw new \\Shopsys\\MigrationBundle\\Component\\Doctrine\\Migrations\\Exception\\MethodIsNotAllowedException($message);\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Liste les process actifs qui ne sont pas en cours d'execution
@return \Minibus\Model\Entity\Process[]: | [
"public function getRunningProcessList($mode, $annee) {\n\t\t$em = $this->getEntityManager ();\n\t\t$params = array (\n\t\t\t\t'mode' => $mode,\n\t\t\t\t'annee' => $annee,\n\t\t\t\t'running' => true \n\t\t);\n\t\t$processes = $em->getRepository ( 'Minibus\\Model\\Entity\\Process' )->findBy ( $params );\n\t\treturn ... | [
"void writeToFile() throws IOException {\r\n\t\t// on clone le counter avant de le sérialiser pour ne pas avoir de problèmes de concurrences d'accès\r\n\t\tfinal Counter counter = this.clone();\r\n\t\t// on n'écrit pas rootCurrentContextsByThreadId en fichier\r\n\t\t// puisque ces données ne seront plus vraies dans... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// AddIdentifiers adds a slice of identifiers to an identifier set. | [
"func (i IdentifierSet) AddIdentifiers(idents Identifiers) {\n\tfor _, ident := range idents {\n\t\ti.Add(ident)\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 instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Input: NginxConf (object) Callback: error (string), Config (object) | [
"function parseNginxConf(_config, callback) {\n\tvar _https = findChild('http', _config);\n\tif (_https.length == 0) {\n\t\tcallback('Directive not found: http');\n\t\treturn;\n\t}\n\n\tvar _http = _https[0];\n\n\tvar _upstreams = findChild('upstream', _http);\n\tif (_upstreams.length == 0) {\n\t\tcallback('Directi... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Calculate proper maxWidth/maxHeight depending if in maximized mode or not, and call the Div in which the
current Dialog is embedded to update its size accordingly.
@param {aria.utils.DomBeans:Size} containerSize
@protected | [
"function (containerSize) {\n var cfg = this._cfg;\n var math = ariaUtilsMath;\n\n var maxHeight, maxWidth;\n if (this._cfg.maximized) {\n maxHeight = containerSize.height + this._shadows.top + this._shadows.bottom;\n maxWidth = containerSize... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Adds a constraint to when the given action can be used.
@param button the button which the constraint applies to.
@param constraint the constraint to add. | [
"public void addActionConstraint(final WButton button, final ActionConstraint constraint) {\n\t\tif (button.getParent() != actions) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Can only add a constraint to a button which is in this table's actions\");\n\t\t}\n\n\t\tgetOrCreateComponentModel().addAction... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Connection::receiveMessage() | [
"public function receiveMessage($length = null)\n {\n if (null === $length)\n return stream_get_contents($this->getSocketStream());\n $response = null;\n while ($chunk = fread($this->getSocketStream(), 1024)) {\n $response .= $chunk;\n if (substr($chunk, -1) ... | [
"def create(self):\n \n self.queue = self.scheduler.queue.addSubQueue(self.priority, LockEvent.createMatcher(self.context, self.key),\n maxdefault = self.size, defaultQueueClass = CBQueue.AutoClassQueue.initHelper('locker', subqueuelimit = 1))"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Looks up a GrailsApplication instance from the ServletContext.
@param servletContext The ServletContext
@return A GrailsApplication or null if there isn't one | [
"public static GrailsApplication lookupApplication(ServletContext servletContext) {\n if (servletContext == null) {\n return null;\n }\n\n GrailsApplication grailsApplication = (GrailsApplication)servletContext.getAttribute(ApplicationAttributes.APPLICATION);\n if(grailsApplic... | [
"private <T> T create(Class<T> pluginType, String className) {\n if (className == null) {\n throw new IllegalStateException(\n \"No default implementation for requested Mockito plugin type: \" + pluginType.getName() + \"\\n\"\n + \"Is this a valid Mockito plugin t... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Returns the ARN user or role whose credentials are used to call the API.
Returns:
(str): The ARN user or role | [
"def get_caller_identity_arn(self):\n \n assumed_role = self.boto_session.client('sts').get_caller_identity()['Arn']\n\n if 'AmazonSageMaker-ExecutionRole' in assumed_role:\n role = re.sub(r'^(.+)sts::(\\d+):assumed-role/(.+?)/.*$', r'\\1iam::\\2:role/service-role/\\3', assumed_role)... | [
"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:"
} |
// SetFilters sets the Filters field's value. | [
"func (s *DescribeCertificatesInput) SetFilters(v []*Filter) *DescribeCertificatesInput {\n\ts.Filters = 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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
begin F196678.10 | [
"private int determineHeartbeatTimeout(Map properties) {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(this, tc, \"determineHeartbeatTimeout\", properties);\n\n // How often should we heartbeat?\n int heartbeatTimeout = JFapChannelConstants.DEFAULT_... | [
"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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the output from running the "rollback" command.
@param string $env environment name (optional)
@param mixed $target target version, or 0 (zero) fully revert (optional)
@return string | [
"public function getRollback($env = null, $target = null)\n {\n $command = ['rollback'];\n if ($env ?: $this->hasOption('environment')) {\n $command += ['-e' => $env ?: $this->getOption('environment')];\n }\n if ($this->hasOption('configuration')) {\n $command +=... | [
"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 Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about AWS Auto Scaling:"
} |
// MessageType returns the message type (pointer to struct) for a named message.
// The type is not guaranteed to implement proto.Message if the name refers to a
// map entry. | [
"func MessageType(name string) reflect.Type {\n\tif t, ok := protoTypedNils[name]; ok {\n\t\treturn reflect.TypeOf(t)\n\t}\n\treturn protoMapTypes[name]\n}"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Retrieve cache file name for given module name, controller name and action name
@return string | [
"public function getCacheFileName()\n {\n $aAssets = $this->getAssets();\n\n $sCacheFileName = isset($aAssets[$sModuleName = $this->getModuleName()]) ? $sModuleName : \\AssetsBundle\\Service\\ServiceOptions::NO_MODULE;\n\n $aUnwantedKeys = array(\n \\AssetsBundle\\AssetFile\\Asset... | [
"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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// MustInc is Inc that panics on failure. | [
"func (c *PCPCounter) MustInc(val int64) {\n\tif err := c.Inc(val); err != nil {\n\t\tpanic(err)\n\t}\n}"
] | [
"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 text about Go programming language:",
"pos": "Represent the Github code about Go programming language:",
"neg": "Represent the Github code:"
} |
Processes a single item from the `output` array.
@access protected
@param array $output The `output` item.
@param array $value The field's value. | [
"protected function process_output( $output, $value ) {\n\t\tforeach ( $value as $key => $sub_value ) {\n\n\t\t\t// If \"element\" is not defined, there's no reason to continue.\n\t\t\tif ( ! isset( $output['element'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the \"choice\" is not the same as the $key in our... | [
"public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software Development:"
} |
Ensure custom observable object extensions follow strict naming style
conventions. | [
"def custom_object_extension_prefix_strict(instance):\n \n for key, obj in instance['objects'].items():\n if not ('extensions' in obj and 'type' in obj and\n obj['type'] in enums.OBSERVABLE_EXTENSIONS):\n continue\n for ext_key in obj['extensions']:\n if (ext... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Flatten compound columns (DataFrames within columns) into top level columns | [
"def normalize(df):\n \"\"\"\"\"\"\n # in ipython notebook, explore and describe the DataFrame columns\n print('Of the {} columns, {} are actually DataFrames'.format(len(df.columns), sum([not isinstance(df[col], pd.Series) for col in df.columns])))\n # remove dataframes with only 2 columns and one is th... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Decodes a string into a schedule tuple.
Args:
string: The string encoding of a schedule tuple.
Returns:
A schedule tuple, see encode_schedule for details. | [
"def decode_schedule(string):\n \n splits = string.split()\n steps = [int(x[1:]) for x in splits[1:] if x[0] == '@']\n pmfs = np.reshape(\n [float(x) for x in splits[1:] if x[0] != '@'], [len(steps), -1])\n return splits[0], tuplize(steps), tuplize(pmfs)"
] | [
"def coerce_one(schema=str):\n \n def validate(val):\n \"\"\"Unpack a single item from the inputs sequence and run validation.\n\n NOTE(larsbutler): This code is highly opinionated for bottle, since\n bottle query params are wrapped in a list, even if there is just a\n single value... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// ImportPublicKey imports a given public key into the keyring | [
"func (x *XC) ImportPublicKey(ctx context.Context, buf []byte) error {\n\tif err := x.pubring.Import(buf); err != nil {\n\t\treturn err\n\t}\n\treturn x.pubring.Save()\n}"
] | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Query the users who do not login recently (90 days).
and not send email (120 days).
time_model: num * month * hours * minite * second
time_login: 3 * 30 * 24 * 60 * 60
time_email: 4 * 30 * 24 * 60 * 60 | [
"def query_nologin():\n '''\n \n '''\n time_now = tools.timestamp()\n return TabMember.select().where(\n ((time_now - TabMember.time_login) > 7776000)\n & ((time_now - TabMember.time_email) > 10368000)\n )"
] | [
"def parse_timespan_value(s):\n \n number, unit = split_number_and_unit(s)\n if not unit or unit == \"s\":\n return number\n elif unit == \"min\":\n return number * 60\n elif unit == \"h\":\n return number * 60 * 60\n elif unit == \"d\":\n return number * 24 * 60 * 60\n... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
/*
Given the sourceList in 'config' form, return the sourceID
Proper sourceID format is <source> | <location> | [
"protected List<String> convertToSourceIDList(List<String> sourceList) {\n List<String> sourceIDList = new ArrayList<String>();\n for (String source : sourceList) {\n String sourceName = getSourceName(source);\n if (!sourceName.equals(\"\")) {\n if (!sourceName.con... | [
"def process(self, candidates):\n \n for c in candidates[:]:\n if c.locator not in self.good_locators:\n # TODO: search string, i.e. find \"EU_Street_Name\" in \"EU_Street_Name.GBR_StreetName\"\n candidates.remove(c)\n\n return candidates"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Code to run before each test.
@param TestInterface $test
@throws ModuleException | [
"public function _before(TestInterface $test)\n {\n if (!extension_loaded('apc') && !extension_loaded('apcu')) {\n throw new ModuleException(\n __CLASS__,\n 'The APC(u) extension not loaded.'\n );\n }\n\n if (!ini_get('apc.enabled') || (PHP... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
根据long值获取ip v4地址
@param longIP IP的long表示形式
@return IP V4 地址 | [
"public static String longToIpv4(long longIP) {\r\n\t\tfinal StringBuilder sb = new StringBuilder();\r\n\t\t// 直接右移24位\r\n\t\tsb.append(String.valueOf(longIP >>> 24));\r\n\t\tsb.append(\".\");\r\n\t\t// 将高8位置0,然后右移16位\r\n\t\tsb.append(String.valueOf((longIP & 0x00FFFFFF) >>> 16));\r\n\t\tsb.append(\".\");\r\n\t\tsb... | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
// SetDestinations sets the Destinations field's value. | [
"func (s *DescribeChannelOutput) SetDestinations(v []*OutputDestination) *DescribeChannelOutput {\n\ts.Destinations = 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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
with the interior of Point B. | [
"private void interiorLineInteriorPoint_(int cluster, int id_a, int id_b,\n\t\t\tint cluster_index_a) {\n\t\tif (m_matrix[MatrixPredicate.InteriorInterior] == 0)\n\t\t\treturn;\n\n\t\tint clusterParentage = m_topo_graph.getClusterParentage(cluster);\n\n\t\tif ((clusterParentage & id_a) != 0 && (clusterParentage & i... | [
"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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// L4ServiceGroups retrieves the list of child L4ServiceGroups of the L4Service | [
"func (o *L4Service) L4ServiceGroups(info *bambou.FetchingInfo) (L4ServiceGroupsList, *bambou.Error) {\n\n\tvar list L4ServiceGroupsList\n\terr := bambou.CurrentSession().FetchChildren(o, L4ServiceGroupIdentity, &list, info)\n\treturn list, err\n}"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Upload files, create thumbs and save it to db
TODO chunk in multi-functions
@param Request $request
@param string $belongsToApp
@return array
@throws \Exception | [
"public function upload($request, $belongsToApp = '')\n {\n $results = array();\n $carbon = new Carbon();\n\n $destinationBasePath = uploadsPath(); // upload basic path\n $year = $carbon->year;\n $month = str_pad($carbon->month, 2, '0', STR_PAD_LEFT);\n $day = str_pad($c... | [
"public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// Perform external file sort. | [
"func (fs *FileSorter) externalSort() (*comparableRow, error) {\n\tif !fs.fetched {\n\t\tif len(fs.buf) > 0 {\n\t\t\terr := fs.flushToFile()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Trace(err)\n\t\t\t}\n\t\t}\n\n\t\theap.Init(fs.rowHeap)\n\t\tif fs.rowHeap.err != nil {\n\t\t\treturn nil, errors.Trace(fs.r... | [
"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 comment about File management:",
"pos": "Represent the code about File management:",
"neg": "Represent the code about programming:"
} |
Load extra data from provider and store it on current UserSocialAuth extra_data field. | [
"def load_extra_data(backend, details, response, uid, user, social_user=None, *args, **kwargs):\n \n social_user = social_user or UserSocialAuth.get_social_auth(backend.name, uid)\n # create verified email address\n if kwargs['is_new'] and EMAIL_CONFIRMATION:\n from ..models import EmailAddress\n... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param StatementsAnalyzer $statements_analyzer
@param PhpParser\Node\Stmt\Foreach_ $stmt
@param Context $context
@return false|null | [
"public static function analyze(\n StatementsAnalyzer $statements_analyzer,\n PhpParser\\Node\\Stmt\\Foreach_ $stmt,\n Context $context\n ) {\n $var_comments = [];\n\n $doc_comment_text = (string)$stmt->getDocComment();\n\n $codebase = $statements_analyzer->getCodebase()... | [
"private function getInstanceCode(Instance $instance) : Code\n {\n $node = ($this->normalizer)($instance->value);\n\n return new Code(new Node\\Stmt\\Return_($node), false);\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return <code>EJBHome</code> instance associated with
this <code>BeanO</code>. <p> | [
"@Override\n public EJBHome getEJBHome()\n {\n try\n {\n EJSWrapper wrapper = home.getWrapper().getRemoteWrapper();\n Object wrapperRef = container.getEJBRuntime().getRemoteReference(wrapper);\n\n // The EJB spec does not require us to narrow to the actual home\n... | [
"public boolean isIdentical(EJBLocalObject obj) throws javax.ejb.EJBException\n {\n // d114925 begin\n HomeInternal hi = beanId.getHome();\n\n if (hi.isStatefulSessionHome()) {\n // Session 6.9.1 - Stateful Session Bean\n // session beans are identical if they are refe... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
EXPECTING A is_data(relation) THAT MAPS VALUES TO lists
THE LISTS ARE EXPECTED TO POINT TO MEMBERS OF A SET
A set() IS RETURNED | [
"def map2set(data, relation):\n \n if data == None:\n return Null\n if isinstance(relation, Data):\n Log.error(\"Does not accept a Data\")\n\n if is_data(relation):\n try:\n # relation[d] is expected to be a list\n # return set(cod for d in data for cod in rela... | [
"def reindex(self, ind):\n \n\n if isinstance(ind, pd.MultiIndex):\n try:\n return self.new(self.data.reindex(ind))\n except:\n raise RuntimeError('QADATASTRUCT ERROR: CANNOT REINDEX')\n else:\n raise RuntimeError(\n ... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
To handle console command | [
"public function handle()\r\n {\r\n $isSuccess = $this->filesystem->cleanDirectory($this->app->sessionDirectoryPath());\r\n\r\n if($isSuccess) {\r\n $this->info('Session cleared!');\r\n }\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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Invokes the /applet-xxxx/rename API method.
For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Name#API-method%3A-%2Fclass-xxxx%2Frename | [
"def applet_rename(object_id, input_params={}, always_retry=True, **kwargs):\n \n return DXHTTPRequest('/%s/rename' % object_id, input_params, always_retry=always_retry, **kwargs)"
] | [
"def Delete(self,location=None):\n\t\t\n\n\t\tif not location: location = clc.v2.Account.GetLocation(session=self.session)\n\n\t\treturn clc.v2.API.Call('POST','/v2-experimental/networks/%s/%s/%s/release' % (self.alias, location, self.id),\n\t\t session=self.session)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Creates the cache folder hierarchy and returns the full path to the given cache file.
@param string $cacheKey
@return string | [
"private function getCachePath($cacheKey)\n {\n $folder = $this->cacheDir . substr($cacheKey, 0, 2) . DIRECTORY_SEPARATOR . substr($cacheKey, 2,\n 2) . DIRECTORY_SEPARATOR . substr($cacheKey, 4, 2) . DIRECTORY_SEPARATOR;\n if (!is_dir($folder)) {\n mkdir($folder, 0755, tru... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Check if any of routes doesn't match
@access private
@return \Lollipop\HTTP\Response | [
"static private function _getDefaultPageNotFound() {\n return [\n 'path' => '404',\n 'callback' => function(\\Lollipop\\HTTP\\Request $req, \\Lollipop\\HTTP\\Response $res, $args = []) {\n // Create a default 404 page\n $pagenotfound = '<!DOCTYPE html>'\n ... | [
"final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Format GET request parameters and keywords. | [
"def _get_keywords(self, **kwargs):\n \"\"\"\"\"\"\n if self.jurisdiction and 'jurisdiction_id' not in kwargs:\n kwargs['jurisdiction_id'] = self.jurisdiction\n if 'count' in kwargs:\n kwargs['page_size'] = kwargs.pop('count')\n if 'start' in kwargs:\n st... | [
"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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
we override the onCloseDocument method.
@param writer
PdfWriter
@param document
Document | [
"@Override\r\n\tpublic void onCloseDocument(final PdfWriter writer, final Document document) {\r\n\t\ttemplate.beginText();\r\n\t\ttemplate.setFontAndSize(bf, 8);\r\n\t\ttemplate.showText(String.valueOf(writer.getPageNumber() - 1));\r\n\t\ttemplate.endText();\r\n\t}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Render the object into a string.
@return mixed | [
"public function render()\n {\n $classes = ArrayList::of([\n 'fa',\n vsprintf('fa-%s', [$this->icon])\n ]);\n\n // Spin class (fa-spin)\n if ($this->spin) {\n $classes = $classes->append(ArrayList::of(['fa-spin']));\n }\n\n // Size classe... | [
"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:"
} |
Get all available translations
@param null $locale
@return mixed | [
"public function all($locale = null){\n\n if(!$locale){\n $locale = $this->getLocale();\n }\n\n $this->load($locale);\n\n $translations = collect([]);\n foreach($this->languages[$locale] as $key => $arg){\n $translations->put($key, $arg['value']);\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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// CreateInstance creates a new compute instance. | [
"func (d *driverOCI) CreateInstance(ctx context.Context, publicKey string) (string, error) {\n\tmetadata := map[string]string{\n\t\t\"ssh_authorized_keys\": publicKey,\n\t}\n\tif d.cfg.Metadata != nil {\n\t\tfor key, value := range d.cfg.Metadata {\n\t\t\tmetadata[key] = value\n\t\t}\n\t}\n\tif d.cfg.UserData != \"... | [
"@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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Get the exception info
Sample usage:
try:
raise Exception("asdfsdfsdf")
except:
print common.get_exception_error()
Return:
return the exception infomation. | [
"def get_exception_error():\r\n ''' \r\n '''\r\n error_message = \"\"\r\n for i in range(len(inspect.trace())):\r\n error_line = u\"\"\"\r\n File: %s - [%s]\r\n Function: %s\r\n Statement: %s\r\n -\"\"\" % (inspect.trace()[i][1], inspect.trace... | [
"def execCommand(Argv, collect_missing):\r\n \r\n \"\"\"\r\n try:\r\n return _execCommand(Argv, collect_missing)\r\n\r\n except Exception as e:\n if Settings['errorHandler']:\n Settings['errorHandler'](e)\n\r\n if Settings['debug']:\r\n # #ToDo: Have an option to debug through stderr. The iss... | codesearchnet | {
"query": "Represent the comment about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
Deletes node assignment for given $contentId and $versionNo.
@param int $contentId
@param int $versionNo | [
"public function deleteNodeAssignment($contentId, $versionNo = null)\n {\n try {\n return $this->innerGateway->deleteNodeAssignment($contentId, $versionNo);\n } catch (DBALException $e) {\n throw new RuntimeException('Database error', 0, $e);\n } catch (PDOException $e)... | [
"public function delete($id)\n {\n $this->innerHandler->delete($id);\n // Delete by primary key will remove the object, so we don't need to clear `ez-language-code-` here.\n $this->cache->deleteMulti(['ez-language-' . $id, 'ez-language-list']);\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
Marshall the given parameter object. | [
"public void marshall(JobExecutionStatusDetails jobExecutionStatusDetails, ProtocolMarshaller protocolMarshaller) {\n\n if (jobExecutionStatusDetails == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Turn the first paragraph of text into the summary text | [
"def paragraph(self, content):\n \n if not self._out.description:\n self._out.description = content\n return ' '"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Language and programming:"
} |
Makes fields
@param Collection $fields
@return string | [
"protected function makeFields(Collection $fields = null)\n {\n if (is_null($fields))\n {\n return '';\n }\n\n $fields = $fields->pluck('name')->toArray();\n\n return count($fields) ? \"'\" . implode(\"', '\", $fields) . \"'\" : '';\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Hash a string using MPQ's hash function. | [
"def _hash(self, string, hash_type):\n \"\"\"\"\"\"\n hash_types = {\n 'TABLE_OFFSET': 0,\n 'HASH_A': 1,\n 'HASH_B': 2,\n 'TABLE': 3\n }\n seed1 = 0x7FED7FED\n seed2 = 0xEEEEEEEE\n\n for ch in string.upper():\n if not i... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Enter description here ...
@param PhingFile $parent
@param string $child
@throws NullPointerException | [
"protected function _constructFileParentStringChild($parent, $child = null)\n {\n // obtain ref to the filesystem layer\n $fs = FileSystem::getFileSystem();\n\n if ($child === null) {\n throw new NullPointerException(\"Argument to function must not be null\");\n }\n\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:"
} |
// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. | [
"func (s *UpdateNotebookInstanceLifecycleConfigInput) SetNotebookInstanceLifecycleConfigName(v string) *UpdateNotebookInstanceLifecycleConfigInput {\n\ts.NotebookInstanceLifecycleConfigName = &v\n\treturn s\n}"
] | [
"func (p *Provider) ValidateResourceTypeConfig(providers.ValidateResourceTypeConfigRequest) providers.ValidateResourceTypeConfigResponse {\n\t// At this moment there is nothing to configure for the terraform provider,\n\t// so we will happily return without taking any action\n\tvar res providers.ValidateResourceTyp... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
This hook will fire for all commands in this command file.
@hook init | [
"public function initialize() {\n $this->bltRoot = $this->getConfigValue('blt.root');\n $this->repoRoot = $this->getConfigValue('repo.root');\n $this->deployDir = $this->getConfigValue('deploy.dir');\n $this->formatter = new FormatterHelper();\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// PeerFilter receives a SubChannelSelectionCriteria and returns a RoutingFilter that selects
// only peer identities that match the given criteria, and that they published their channel participation | [
"func (g *gossipServiceImpl) PeerFilter(channel common.ChainID, messagePredicate api.SubChannelSelectionCriteria) (filter.RoutingFilter, error) {\n\tgc := g.chanState.getGossipChannelByChainID(channel)\n\tif gc == nil {\n\t\treturn nil, errors.Errorf(\"Channel %s doesn't exist\", string(channel))\n\t}\n\treturn gc.... | [
"@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
// NewSigFilter creates a new signature filter, at every evaluation, the policy manager is called
// to retrieve the latest version of the policy | [
"func NewSigFilter(policyName string, support SigFilterSupport) *SigFilter {\n\treturn &SigFilter{\n\t\tpolicyName: policyName,\n\t\tsupport: support,\n\t}\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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Print out update information. | [
"async def check_update(dev: Device, internet: bool, update: bool):\n \"\"\"\"\"\"\n if internet:\n print(\"Checking updates from network\")\n else:\n print(\"Not checking updates from internet\")\n update_info = await dev.get_update_info(from_network=internet)\n if not update_info.isUp... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Stores the processing results in a file. CSV (comma separated values) is
a simple format that makes sense for such tasks. It can be imported
easily into spreadsheet tools to generate diagrams from the data. | [
"public void storeResults() {\n\t\tSystem.out.println(\"Processed \" + countItems + \" items and \"\n\t\t\t\t+ countProperties + \" properties in total.\");\n\t\tSystem.out.println(\"Storing data ...\");\n\n\t\ttry (PrintStream out = new PrintStream(new FileOutputStream(\n\t\t\t\t\"tutorial-results.csv\"))) {\n\t\t... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Internal recursive traversal for conversion. | [
"func convert(a *AutomatonBuilder, s *dfsaState, visited map[*dfsaState]int) int {\n\tpanic(\"not implemented yet\")\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:"
} |
Configure object
@param array $options | [
"public function config(array $options)\n {\n $this->options = $options;\n \n $this->initializeOptions($options);\n \n if ($this->getSession()->debug == true) {\n $this->setDebug(true);\n }\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns the different xml editor widgets used in the form to display.<p>
@return the different xml editor widgets used in the form to display | [
"public CmsXmlContentWidgetVisitor getWidgetCollector() {\n\n if (m_widgetCollector == null) {\n // create an instance of the widget collector\n m_widgetCollector = new CmsXmlContentWidgetVisitor(getElementLocale());\n m_content.visitAllValuesWith(m_widgetCollector);\n ... | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Display faq.
@param Request $request
@param Model $faq
@return Response | [
"public function show(FaqRequest $request, Faq $faq)\n {\n\n if ($faq->exists) {\n $view = 'faq::faq.show';\n } else {\n $view = 'faq::faq.new';\n }\n\n return $this->response->title(trans('app.view') . ' ' . trans('faq::faq.name'))\n ->data(compact('f... | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
<p>
getAnnotatedFields.
</p>
@param clazz
a {@link java.lang.Class} object.
@param annotationClass
a {@link java.lang.Class} object.
@param <T>
a T object.
@return a {@link java.util.List} object. | [
"public static <T> List<Field> getAnnotatedFields(Class<?> clazz, Class<? extends Annotation> annotationClass) {\n\t\tList<Field> annotatedFields = new LinkedList<Field>();\n\t\tField[] allFields = getAllDeclaredFields(clazz);\n\t\tfor (Field field : allFields) {\n\t\t\tif (null != (field.getAnnotation(annotationCl... | [
"@Override\n <T> Class<T> loadClass(final Class<T> superclassOrInterfaceType) {\n final Class<?> type = getType();\n if (!superclassOrInterfaceType.isAssignableFrom(type)) {\n throw new IllegalArgumentException(\n \"Primitive class \" + baseType + \" cannot be cast to ... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// SetImage sets the tray image | [
"func (t *Tray) SetImage(image string) (err error) {\n\tif err = t.isActionable(); err != nil {\n\t\treturn\n\t}\n\tt.o.Image = PtrStr(image)\n\t_, err = synchronousEvent(t.c, t, t.w, Event{Name: EventNameTrayCmdSetImage, Image: image, TargetID: t.id}, EventNameTrayEventImageSet)\n\treturn\n}"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Parse the root XML element as an array. | [
"def parse_at_root(\n self,\n root, # type: ET.Element\n state # type: _ProcessorState\n ):\n # type: (...) -> Any\n \"\"\"\"\"\"\n if not self._nested:\n raise InvalidRootProcessor('Non-nested array \"{}\" cannot be root element'.format(\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:"
} |
Generates the fields array for the message attachment.
@param Vulnerabilities $vulnerabilities List of vulnerabilities.
@return array | [
"protected function build_attachment_fields( Vulnerabilities $vulnerabilities ) {\n\t\t$fields = [];\n\n\t\tforeach ( $vulnerabilities as $vulnerability ) {\n\t\t\t$fixed_in = $vulnerability->fixed_in\n\t\t\t\t? 'Fixed in v' . $vulnerability->fixed_in\n\t\t\t\t: 'Not fixed yet';\n\t\t\t$wpvdb_url = \"https://wpvuln... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Dispatch a single callback in the current thread.
:param boolean block: If True, blocks waiting for a callback to come.
:return: True if a callback was processed; otherwise False. | [
"def process_callback(self, block=True):\n \n try:\n (callback, args) = self._queue.get(block=block)\n try:\n callback(*args)\n finally:\n self._queue.task_done()\n except queue.Empty:\n return False\n return True"... | [
"def process_request_thread(self, request, client_address):\n \"\"\"\"\"\"\n # Instantiate the request handler.\n handler = self.RequestHandlerClass(request, client_address, self)\n try:\n # Attempt to handle a request with the handler.\n handler.handle_request()\n self.request_complete_c... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetSortBy sets the SortBy field's value. | [
"func (s *SearchProductsInput) SetSortBy(v string) *SearchProductsInput {\n\ts.SortBy = &v\n\treturn s\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Transforms Collection entities to json ([{id: 123, name: "Slurms MacKenzie"}, {id: 555, name: "Bob Hoskins"}])
@param Collection $collection
@return string (JSON) | [
"public function transform($collection)\n {\n if (null === $collection) {\n return null;\n }\n\n if (!($collection instanceof Collection)) {\n throw new UnexpectedTypeException($collection, 'Doctrine\\Common\\Collection\\Collection');\n }\n\n $results = ar... | [
"def tempo_account_add_account(self, data=None):\n \n url = 'rest/tempo-accounts/1/account/'\n if data is None:\n return \"\"\"Please, provide data e.g.\n {name: \"12312312321\",\n key: \"1231231232\",\n lead: {name: \... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
// Return a connection for a master of a given name. As with the pool package,
// do not return a connection which is having connectivity issues, or which is
// otherwise unable to perform requests. | [
"func (c *Client) PutMaster(name string, client *redis.Client) {\n\tc.putCh <- &putReq{name, client}\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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Before 2.12.0 Piwik stored this list as an array mapping year months to arrays of site IDs. If this is
found in the DB, we convert the array to an array of year months to avoid errors and to make sure
the correct tables are still purged. | [
"private function convertOldDistributedList(&$yearMonths)\n {\n foreach ($yearMonths as $key => $value) {\n if (preg_match(\"/^[0-9]{4}_[0-9]{2}$/\", $key)) {\n unset($yearMonths[$key]);\n\n $yearMonths[] = $key;\n }\n }\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Query the Overpass API
:param String|Bytes query: The query string in Overpass QL
:return: The parsed result
:rtype: overpy.Result | [
"def query(self, query):\n \n if not isinstance(query, bytes):\n query = query.encode(\"utf-8\")\n\n retry_num = 0\n retry_exceptions = []\n do_retry = True if self.max_retry_count > 0 else False\n while retry_num <= self.max_retry_count:\n if retry_nu... | [
"def get(self, project):\n \"\"\"\"\"\"\n try:\n data = self.request(project + '/')\n except:\n raise\n if not isinstance(data, clam.common.data.CLAMData):\n raise Exception(\"Unable to retrieve CLAM Data\")\n else:\n return data"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Get blog posts.
@EXT\Route("", name="apiv2_blog_post_list")
@EXT\Method("GET")
@param Blog $blog
@return array | [
"public function listAction(Request $request, Blog $blog)\n {\n $this->checkPermission('OPEN', $blog->getResourceNode(), [], true);\n\n $parameters = $request->query->all();\n\n //if no edit rights, list only published posts\n $posts = $this->postManager->getPosts(\n $blog-... | [
"public static function Connection () {\n\t\t\\ickx\\fw2\\router\\Router::Connect('/{:controller}/{:action}/{:args}');\n\t\t\\ickx\\fw2\\router\\Router::Connect('/{:args}');\n\t}"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Reads the session data.
@see http://php.net/sessionhandlerinterface.read
@param string $sessionId Session ID, see http://php.net/function.session-id
@return string Same session data as passed in write() or empty string when non-existent or on failure | [
"public function read($sessionId)\n {\n $this->sessionExpired = false;\n\n $selectSql = $this->getSelectSql();\n $selectStmt = $this->db->query($selectSql)\n ->bind(':id', $sessionId);\n\n $sessionRows = $selectStmt->row();\n\n if ($sessionRows) {\n ... | [
"public static function configure($memcacheContainer = null) {\n $handler = new MemcacheSessionHandler($memcacheContainer);\n\n session_set_save_handler($handler, true);\n\n /**\n * Set so that it is clear that Memcache is being used for session handling,\n * as retrieving session.save_handler just... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
this method completes the keys list in a key-value schema in the format table.keyName | [
"def complete_key(name, field, val)\n return [\"#{name}.\"] if !val || !val.is_a?(String) || !(val.include?('.'))\n val = val.sub(/.*\\./,'')\n\n connection = definition.klass.connection\n quoted_table = field.key_klass.connection.quote_table_name(field.key_klass.table_name)\n quoted_fi... | [
"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:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.