query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Draw arced lines over the text
@access private | [
"function arcLines()\n {\n $colors = explode(',', $this->arc_line_colors);\n imagesetthickness($this->im, 3);\n\n $color = $colors[rand(0, sizeof($colors) - 1)];\n $linecolor = imagecolorallocate($this->im, hexdec(substr($color, 1, 2)), hexdec(substr($color, 3, 2)), hexdec(substr($color, 5, 2)));\n\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
将byte解码为对象
@param content
@param genericType
@param charset
@param <T>
@return | [
"public static <T> T map(byte[] content, Class<T> genericType, Charset charset) {\n // 获取映射对象\n ObjectMetaData objectMap = getObjectMap(genericType);\n if (LOGGER.isDebugEnabled()) {\n objectMap.dumpObjectMetaData();\n }\n\n try {\n return mapByIndex(content,... | [
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about Encryption:",
"pos": "Represent the code about Encryption:",
"neg": "Represent the code:"
} |
Check if `value` is valid this property in the entity `obj`. Append
validation results to `errors` (list). | [
"def check(self, obj, value, errors):\n \n fieldname = \"%s.%s\" % (type(obj).__name__, self._name)\n\n if value is None:\n if not self._null:\n errors.append(\"%s may not be 'null'\" % fieldname)\n\n # If None, just leave. The rest of checks don't make any ... | [
"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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Saves a file that is specified in event.attr
Parameters
----------
event.attr: Dict
\tkey filepath contains file path of file to be saved | [
"def save(self, event):\n \n\n filepath = event.attr[\"filepath\"]\n\n try:\n filetype = event.attr[\"filetype\"]\n except KeyError:\n filetype = \"pys\"\n\n # If saving is already in progress abort\n if self.saving:\n return\n\n # Us... | [
"def fix_config(self, options):\n \n options = super(ContainerValuePicker, self).fix_config(options)\n\n opt = \"value\"\n if opt not in options:\n options[opt] = \"Model\"\n if opt not in self.help:\n self.help[opt] = \"The name of the container value to pic... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Return a dict with all current options prior submitting request. | [
"def preupdate(self, force_refresh=True):\n \"\"\"\"\"\"\n ddata = MANUAL_OP_DATA.copy()\n\n # force update to make sure status is accurate\n if force_refresh:\n self.update()\n\n # select current controller and faucet\n ddata['select_controller'] = \\\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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Set all labels for the ComputationGraph network | [
"public void setLabels(INDArray... labels) {\n if (labels != null && labels.length != this.numOutputArrays) {\n throw new IllegalArgumentException(\"Invalid output array: network has \" + numOutputArrays\n + \" outputs, but array is of length \" + labels.length);\n }\n ... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Dictionary : dictionary IDENTIFIER Inheritance "{" DictionaryMembers "}" ";" | [
"def p_Dictionary(p):\n \n p[0] = model.Dictionary(name=p[2], parent=p[3], members=p[5])"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Load logs from DB.
@author Vova Feldman (@svovaf)
@since 1.2.1.6
@param bool $filters
@param int $limit
@param int $offset
@param bool $order
@return object[]|null | [
"public static function load_db_logs(\n\t\t\t$filters = false,\n\t\t\t$limit = 200,\n\t\t\t$offset = 0,\n\t\t\t$order = false\n\t\t) {\n\t\t\tglobal $wpdb;\n\n\t\t\t$query = self::build_db_logs_query(\n\t\t\t\t$filters,\n\t\t\t\t$limit,\n\t\t\t\t$offset,\n\t\t\t\t$order\n\t\t\t);\n\n\t\t\treturn $wpdb->get_results(... | [
"public function __async_table()\n {\n // Create query to get users\n $query = dbQuery('user')->Active(1)->order_by('UserID');\n\n // Create generic table for users\n $table = new Table($query);\n\n return array ('status'=>1, 'table'=>$table->render());\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Removes the peer connection from the channel.
This does NOT unjoin the peer from from the channel.
Fabric does not support that at this time -- maybe some day, but not today
@param peer | [
"public void removePeer(Peer peer) throws InvalidArgumentException {\n if (shutdown) {\n throw new InvalidArgumentException(format(\"Can not remove peer from channel %s already shutdown.\", name));\n }\n logger.debug(format(\"removePeer %s from channel %s\", peer, toString()));\n\n ... | [
"public final void sendMessage(ByteBuffer bb, byte msg_priority) {\n UDP_TCP_SendThread sendThread = _sendThread;\n if (sendThread == null) {\n // Sending threads are created lazily.\n // This is because we will intern all client nodes including the ones that have nothing to do with the cluster.\n ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// challengeParams constructs the value to be used in
// the WWW-Authenticate response challenge header.
// See https://tools.ietf.org/html/rfc6750#section-3 | [
"func (ac authChallenge) challengeParams(r *http.Request) string {\n\tvar realm string\n\tif ac.autoRedirect {\n\t\trealm = fmt.Sprintf(\"https://%s/auth/token\", r.Host)\n\t} else {\n\t\trealm = ac.realm\n\t}\n\tstr := fmt.Sprintf(\"Bearer realm=%q,service=%q\", realm, ac.service)\n\n\tif scope := ac.accessSet.sco... | [
"func (this *Request) Get(f string) string {\n\n\t/*\n\t Possible future bug.\n\t http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2\n\t Message headers are case-insensitive.\n\t*/\n\n\treturn this.Header.Get(f)\n}"
] | codesearchnet | {
"query": "Represent the Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Web development:"
} |
This method is called from within the constructor to initialize the form.
WARNING: Do NOT modify this code. The content of this method is always
regenerated by the Form Editor. | [
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n java.awt.GridBagConstraints gridBagConstraints;\n\n _populationSizeLabel = new javax.swing.JLabel();\n _populationSizeSpinn... | [
"public function getPassword() : IHashedPassword\n {\n return new class implements IHashedPassword\n {\n /**\n * Gets the hashed password string.\n *\n * @return string\n */\n public function getHash() : string\n {\n ... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Dynamically creates a module named defined by the PEP-8 version of
the string contained in service_name (from the YAML config). This
module will contain a Client class, a Call Factory, and list of API
definition objects. | [
"def create_service_module(service_name, apis):\n \n service_module = imp.new_module(service_name.lower())\n\n for api in apis:\n setattr(service_module, api.__class__.__name__, api)\n\n ClientClass = create_rest_client_class(service_name, apis)\n\n setattr(service_module, 'resources', tuple(apis))\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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n public boolean eIsSet(int featureID)\n {\n switch (featureID)\n {\n case SimpleExpressionsPackage.NOT_EXPRESSION__EXPRESSION:\n return expression != null;\n }\n return super.eIsSet(featureID);\n }"
] | [
"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 comment about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
// GroupByNumber returns a group based on the number of the group, or nil if the group number does not exist | [
"func (m *Match) GroupByNumber(num int) *Group {\n\t// check our sparse map\n\tif m.sparseCaps != nil {\n\t\tif newNum, ok := m.sparseCaps[num]; ok {\n\t\t\tnum = newNum\n\t\t}\n\t}\n\tif num >= len(m.matchcount) || num < 0 {\n\t\treturn nil\n\t}\n\n\tif num == 0 {\n\t\treturn &m.Group\n\t}\n\n\tm.populateOtherGrou... | [
"function parsePointer(pointer) {\n // Let's split pointer string by tokens' separator character.\n // Also we will reverse resulting array to simplify it's further usage.\n var tokens = pointer.split(tokenSeparator).reverse();\n // Last item in resulting array is always an empty string, we don't need it.\n to... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Decrement the quantity of the subscription.
@param int $count
@return $this | [
"public function decrementQuantity(int $count = 1)\n {\n $this->updateQuantity(max(1, $this->quantity - $count));\n\n return $this;\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// NumRequests returns the rolling number of requests | [
"func (d *DefaultMetricCollector) NumRequests() *rolling.Number {\n\td.mutex.RLock()\n\tdefer d.mutex.RUnlock()\n\treturn d.numRequests\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
{@inheritDoc}
@return string | [
"public function filter($content, array $options = array())\n\t{\n\t\t$itemTemplate = ! empty($options['itemTemplate']) ? (string) $options['itemTemplate'] : '';\n\t\t$wrapperTemplate = ! empty($options['wrapperTemplate']) ? (string) $options['wrapperTemplate'] : '';\n\n\t\t$output = '';\n\n\t\t$fileStorage = $this... | [
"@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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
REGR_SXY makes the following computation after the elimination of null (arg1, arg2) pairs:
<p>REGR_COUNT(arg1, arg2) * COVAR_POP(arg1, arg2)</p>
@param arg1 first arg
@param arg2 second arg
@return regr_sxy(arg1, arg2) | [
"public static WindowOver<Double> regrSxy(Expression<? extends Number> arg1, Expression<? extends Number> arg2) {\n return new WindowOver<Double>(Double.class, SQLOps.REGR_SXY, arg1, arg2);\n }"
] | [
"def cnst_AT(self, X):\n \n \"\"\"\n\n return np.sum(self.cnst_A0T(X), axis=-1) + self.cnst_A1T(X)"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Mathematics:"
} |
Start the ConnectedThread to begin managing a Bluetooth connection
@param socket The BluetoothSocket on which the connection was made
@param device The BluetoothDevice that has been connected | [
"public synchronized void connected(BluetoothSocket socket, BluetoothDevice\n device, final String socketType) {\n // Cancel the thread that completed the connection\n if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}\n\n // Cancel any thread currently run... | [
"public int getPort() {\n final Connector[] connectors = this.server.getConnectors();\n checkState(connectors.length >= 1, \"Server must have at least 1 connector\");\n\n // The first connector is created upon initializing the server. That's the one that has the port.\n return connectors[0].getLocalPort... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
@param HasExtensionsInterface $objectDefinition
@return ExtensionInterface[] | [
"private function resolveObjectExtensions(HasExtensionsInterface $objectDefinition): array\n {\n $extensions = [];\n\n //get all extensions registered as services\n $registeredExtensions = $this->container->get(ExtensionManager::class)->getExtensions();\n foreach ($registeredExtension... | [
"public function objectFromIndex(IObjectSetWithIdentityByIndex $objects) : ObjectFieldBuilder\n {\n return new ObjectFieldBuilder(\n $this->type(new ObjectIdType(new ObjectIndexOptions($objects), $loadAsObjects = true))\n );\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Attempt to get the directory name from a path.
@param string $path
@return string | [
"protected function dirname($path)\n {\n if (is_file($path)) {\n return dirname($path);\n }\n\n if (is_dir($path)) {\n return rtrim($path, '/');\n }\n\n // no known file/dir, start making assumptions\n\n // ends in / = dir\n if (mb_substr($pa... | [
"public File getExistingDirectory(final String param) {\n return get(param, new StringToFile(),\n new And<>(new FileExists(), new IsDirectory()),\n \"existing directory\");\n }"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Center on the given item or point. | [
"def center_on(self, item):\n \n if not isinstance(item, GraphicsItem):\n item = coerce_point(item)\n self.proxy.center_on(item)"
] | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Create an empty livetime cube. | [
"def create_empty(cls, tstart, tstop, fill=0.0, nside=64):\n \"\"\"\"\"\"\n cth_edges = np.linspace(0, 1.0, 41)\n domega = utils.edge_to_width(cth_edges) * 2.0 * np.pi\n hpx = HPX(nside, True, 'CEL', ebins=cth_edges)\n data = np.ones((len(cth_edges) - 1, hpx.npix)) * fill\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:"
} |
Create a percolator document
Any kwargs will be added to the document as extra properties. | [
"def create_percolator(self, index, name, query, **kwargs):\n \n if isinstance(query, Query):\n query = {\"query\": query.serialize()}\n if not isinstance(query, dict):\n raise InvalidQuery(\"create_percolator() must be supplied with a Query object or dict\")\n if k... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param string $fieldName
@param int $maxValue
@param int $valueToTest
@param int $exceptionCode
@throws InvalidValueException | [
"protected function ensureIsLowerThan($fieldName, $maxValue, $valueToTest, $exceptionCode = 0)\n {\n if ($valueToTest >= $maxValue) {\n $message = sprintf(\n '%s is greater than or equal expected value \"%d\", got \"%d\"',\n $fieldName,\n $maxValue,\... | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// GetCPU CPUコア数 取得 | [
"func (p *propPrivateHostPlan) GetCPU() int {\n\tif p.Plan == nil {\n\t\treturn -1\n\t}\n\n\treturn p.Plan.GetCPU()\n}"
] | [
"function GroupProfile(_id, _owner) {\n this._id = _id;\n this._owner = _owner;\n this._parent = null; //!< 親 GroupProfile インスタンス\n this._children = []; //!< 子 GroupProfile インスタンス\n this._expanded = false; //!< 開閉情報\n this._st... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Returns the zero-inflated negative binomial log-likelihood of the data. | [
"def zinb_ll(data, P, R, Z):\n \n lls = nb_ll(data, P, R)\n clusters = P.shape[1]\n for c in range(clusters):\n pass\n return lls"
] | [
"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 summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Natural Language Processing:"
} |
// GetPolicyLabelsv1 extracts the name of np. It uses the name from the Cilium
// annotation if present. If the policy's annotations do not contain
// the Cilium annotation, the policy's name field is used instead. | [
"func GetPolicyLabelsv1(np *networkingv1.NetworkPolicy) labels.LabelArray {\n\tif np == nil {\n\t\tlog.Warningf(\"unable to extract policy labels because provided NetworkPolicy is nil\")\n\t\treturn nil\n\t}\n\n\tpolicyName := np.Annotations[annotation.Name]\n\tpolicyUID := np.UID\n\n\tif policyName == \"\" {\n\t\t... | [
"func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Update the specified resource in storage.
@param int $id
@param Request $request
@return Response | [
"public function update($id, Request $request)\n {\n //BUSCAR ID\n $post = $this->noticiaRepo->findOrFail($id);\n\n //VALIDACION DE DATOS\n $this->validate($request, $this->rules);\n\n //VARIABLES\n $titulo = $request->input('titulo');\n $slug_url = SlugUrl($titul... | [
"@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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Sends an invoice | [
"def send_invoice(invoice)\n response = post_xml(invoice.to_xml, {:action => 'send', :type => 'invoice'})\n InvoiceParser.parse(response, invoice)\n end"
] | [
"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:"
} |
The composite index to create.
Generated from protobuf field <code>.google.firestore.admin.v1.Index index = 2;</code>
@param \Google\Cloud\Firestore\Admin\V1\Index $var
@return $this | [
"public function setIndex($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Firestore\\Admin\\V1\\Index::class);\n $this->index = $var;\n\n return $this;\n }"
] | [
"public function setReadOnly($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Firestore\\V1beta1\\TransactionOptions_ReadOnly::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Sets a token
@param string|null $token
@return string | [
"public function setToken($token = null)\n {\n if (isset($token)) {\n return $this->token = $token;\n }\n\n return $this->token = gplcart_string_encode(crypt(session_id(), $this->config->getKey()));\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Fetch from origin.
:raise CalledProcessError: Unhandled git command failure.
:param str local_root: Local path to git root directory.
:param iter remotes: Output of list_remote(). | [
"def fetch_commits(local_root, remotes):\n \n # Fetch all known branches.\n command = ['git', 'fetch', 'origin']\n run_command(local_root, command)\n\n # Fetch new branches/tags.\n for sha, name, kind in remotes:\n try:\n run_command(local_root, ['git', 'reflog', sha])\n e... | [
"def find_revision_id(self, revision=None):\n \"\"\"\"\"\"\n # Make sure the local repository exists.\n self.create()\n # Try to find the revision id of the specified revision.\n revision = revision or self.default_revision\n output = self.context.capture(\n 'bzr... | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Temporarily cd into a directory | [
"def cd(dest):\n \n origin = os.getcwd()\n try:\n os.chdir(dest)\n yield dest\n finally:\n os.chdir(origin)"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Switch site's theme.
@return void | [
"public function main()\n {\n if (empty($this->params['theme'])) {\n $this->err(__d('installer', 'You must provide a theme.'));\n\n return false;\n }\n\n if (!Plugin::exists($this->params['theme'])) {\n $this->err(__d('installer', 'Theme \"{0}\" was not found... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Is this string a valid Python script? | [
"def is_python(text, filename='<string>'):\n \"\"\n try:\n compile(text, filename, 'exec')\n except (SyntaxError, TypeError):\n return False\n else:\n return True"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
A static version of the above. | [
"static String constantValueExpression(Object cb) {\n if (cb == null) return null;\n if (cb instanceof Character) return sourceForm(((Character)cb).charValue());\n if (cb instanceof Byte) return sourceForm(((Byte)cb).byteValue());\n if (cb instanceof String) return sourceForm((String)cb)... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get the Location of the IP Address.
@param string $ip (optional, no value will always return NULL)
@param string $purpose (optional)
@param bool $deep_detect (optional)
@return string | [
"public static function checkIP($ip = null, $purpose = 'location', $deep_detect = true)\n {\n $output = null;\n if (filter_var($ip, FILTER_VALIDATE_IP) === false) {\n $ip = $_SERVER['REMOTE_ADDR'];\n if ($deep_detect) {\n if (filter_var(@$_SERVER['HTTP_X_FORWARD... | [
"private function filter($variable, $filter, $options = null)\n {\n\n //gets a specific external variable and filter it\n //determine what variable name is being used here;\n $this->sanitized = true;\n\n //@TODO To trust or not to trust?\n return filter_var($variable, $filter, ... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
The parameters from the Authorization header (only). If the
Authorization header is not present or is not an AWS SigV4 header, an
AttributeError exception is raised. | [
"def authorization_header_parameters(self):\n \n result = getattr(self, \"_authorization_header_parameters\", None)\n if result is None:\n auth = self.headers.get(_authorization)\n if auth is None:\n raise AttributeError(\"Authorization header is not present... | [
"def openid_authorization_validator(self, request):\n \n request_info = super(ImplicitGrant, self).openid_authorization_validator(request)\n if not request_info: # returns immediately if OAuth2.0\n return request_info\n\n # REQUIRED. String value used to associate a Client se... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
A Bark logging handler logging output to a named file. If the
file has changed since the last log message was written, it will
be closed and reopened.
Similar to logging.handlers.WatchedFileHandler. | [
"def watched_file_handler(name, logname, filename, mode='a', encoding=None,\n delay=False):\n \n\n return wrap_log_handler(logging.handlers.WatchedFileHandler(\n filename, mode=mode, encoding=encoding, delay=delay))"
] | [
"def get_modernrpc_logger(name):\n \"\"\"\"\"\"\n logger = logging.getLogger(name)\n if not logger_has_handlers(logger):\n # If logging is not configured in the current project, configure this logger to discard all logs messages.\n # This will prevent the 'No handlers could be found for logge... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterLookupByUUID | [
"func (c *Connect) LookupNWFilterByUUID(uuid []byte) (*NWFilter, error) {\n\tif len(uuid) != C.VIR_UUID_BUFLEN {\n\t\treturn nil, fmt.Errorf(\"UUID must be exactly %d bytes in size\",\n\t\t\tint(C.VIR_UUID_BUFLEN))\n\t}\n\tcUuid := make([]C.uchar, C.VIR_UUID_BUFLEN)\n\tfor i := 0; i < C.VIR_UUID_BUFLEN; i++ {\n\t\t... | [
"func (ncc *SeesawNCC) LBInterfaceAddVserver(lbVserver *ncctypes.LBInterfaceVserver, out *int) error {\n\treturn iptablesAddRules(lbVserver.Vserver, lbVserver.Iface.ClusterVIP, lbVserver.AF)\n}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Param replaces one or multiple path param expressions by the given value | [
"func Param(key, value string) p.Plugin {\n\treturn p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {\n\t\tctx.Request.URL.Path = replace(ctx.Request.URL.Path, key, value)\n\t\th.Next(ctx)\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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Create a single ContentType entity.
@param Entity\Content $contentEntity | [
"private function fillEntity(Entity\\Content $contentEntity)\n {\n $contentType = $this->repository->getEntityManager()->getContentType($contentEntity->getContenttype());\n\n foreach ($contentType['fields'] as $field => $values) {\n $this->setFieldValue($contentEntity, $contentType, $fie... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// After runs a function after each spec in the group. | [
"func (s S) After(f func()) {\n\ts(\"\", f, func(c *config) { c.after = true })\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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Checks to see if the service handles alternative authentication
@return bool | [
"public function handlesAlternateAuth()\n {\n if (\n config('df.alternate_auth') === true &&\n !empty(array_get($this->config, 'alt_auth_db_service_id')) &&\n !empty(array_get($this->config, 'alt_auth_table')) &&\n !empty(array_get($this->config, 'alt_auth_usern... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github sentence about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about Programming:"
} |
Temporary way of improving price rendering,
until core is updated.
@see https://github.com/silverstripe/silverstripe-framework/issues/1388 | [
"function Nicer(){\n\t\t$value = $this->owner->getValue();\n\t\tif($value == 0){\n\t\t\treturn _t(\"Currency.NICEZERO\", \"Free\");\n\t\t}\n\n\t\treturn $this->owner->Nice();\n\t}"
] | [
"func IsNotFoundError(err error) bool {\n\tes := err.Error()\n\tif strings.Contains(es, \"does not exist\") {\n\t\t// set with the same name already exists\n\t\t// xref: https://github.com/Olipro/ipset/blob/master/lib/errcode.c#L32-L33\n\t\treturn true\n\t}\n\tif strings.Contains(es, \"element is missing\") {\n\t\t... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Convert_kops_KubeAPIServerConfig_To_v1alpha1_KubeAPIServerConfig is an autogenerated conversion function. | [
"func Convert_kops_KubeAPIServerConfig_To_v1alpha1_KubeAPIServerConfig(in *kops.KubeAPIServerConfig, out *KubeAPIServerConfig, s conversion.Scope) error {\n\treturn autoConvert_kops_KubeAPIServerConfig_To_v1alpha1_KubeAPIServerConfig(in, out, s)\n}"
] | [
"func (c *autoRegisterController) AddAPIServiceToSyncOnStart(in *apiregistration.APIService) {\n\tc.addAPIServiceToSync(in, manageOnStart)\n}"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Prepare nameparser Constants.
Remove nameparser's titles and use our own and add as suffixes the roman numerals.
Configuration is the same for all names (i.e. instances). | [
"def _prepare_nameparser_constants():\n \n constants = Constants()\n roman_numeral_suffixes = [u'v', u'vi', u'vii', u'viii', u'ix', u'x',\n u'xii', u'xiii', u'xiv', u'xv']\n titles = [u'Dr', u'Prof', u'Professor', u'Sir', u'Editor', u'Ed', u'Mr',\n u'Mrs', u'Ms'... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Transposes an individual block inside a block matrix. | [
"private static void transposeBlock(DMatrixRBlock A , DMatrixRBlock A_tran,\n int indexA , int indexC ,\n int width , int height )\n {\n for( int i = 0; i < height; i++ ) {\n int rowIndexC = indexC + i;\n int... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Creates Redis Sentinel client.
`sentinels` is a list of sentinel nodes. | [
"async def create_sentinel(sentinels, *, db=None, password=None,\n encoding=None, minsize=1, maxsize=10,\n ssl=None, timeout=0.2, loop=None):\n \n\n if loop is None:\n loop = asyncio.get_event_loop()\n\n pool = await create_sentinel_pool(sentinels,\n... | [
"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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
Создает новую коллекцию помощников вида.
@return IHelperCollection | [
"private function newViewHelperCollectionInstance()\n {\n $viewHelperCollection = $this->getPrototype(\n $this->viewHelperCollectionClass,\n ['umi\\templating\\extension\\helper\\collection\\IHelperCollection']\n )\n ->createInstance();\n\n if ($v... | [
"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 about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code about Programming:"
} |
Since the sign of the homography is ambiguous a point is required to make sure the correct
one was selected.
@param p test point, used to determine the sign of the matrix. | [
"protected void adjustHomographSign( AssociatedPair p , DMatrixRMaj H ) {\n\t\tdouble val = GeometryMath_F64.innerProd(p.p2, H, p.p1);\n\n\t\tif( val < 0 )\n\t\t\tCommonOps_DDRM.scale(-1, H);\n\t}"
] | [
"@Override\n public int parity() {\n\n // create three vectors, v->u, v->w and u->x\n double[] vu = toVector(v, u);\n double[] vw = toVector(v, w);\n double[] ux = toVector(u, x);\n\n // normal vector (to compare against), the normal vector (n) looks like:\n // x n w... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get the appropriate connection for a chip. | [
"def _get_connection(self, x, y):\n \"\"\"\"\"\"\n if (self._width is None or self._height is None or\n self._root_chip is None):\n return self.connections[None]\n else:\n # If possible, use the local Ethernet connected chip\n eth_chip = spinn5_lo... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Register the taxonomy.
@return TaxonomyInterface | [
"public function set(): TaxonomyInterface\n {\n if (function_exists('current_filter') && 'init' === $hook = current_filter()) {\n $this->register();\n } else {\n $this->action->add('init', [$this, 'register']);\n }\n\n return $this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// New returns a Rope representing a given string. | [
"func New(arg string) Rope {\n\tif len(arg) == 0 {\n\t\treturn emptyRope\n\t}\n\treturn Rope{\n\t\tnode: leaf(arg),\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 description about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
Sets the components of the given composite property.
All parameters are <feature>value strings | [
"def compose (composite_property_s, component_properties_s):\n \n from . import property\n\n component_properties_s = to_seq (component_properties_s)\n composite_property = property.create_from_string(composite_property_s)\n f = composite_property.feature\n\n if len(component_properties_s) > 0 and... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Validates the group and throws a number of
Exceptions if validation fails.
@return bool
@throws \Cartalyst\Sentry\Groups\NameRequiredException
@throws \Cartalyst\Sentry\Groups\GroupExistsException | [
"public function validate()\n\t{\n\t\t// Check if name field was passed\n\t\t$name = $this->name;\n\n\t\tif ( empty($name) )\n\t\t{\n\t\t\tthrow new NameRequiredException(\"A name is required for a group, none given.\");\n\t\t}\n\n\t\t// Check if group already exists\n\t\t$persistedGroup = $this->unique_key_exists(... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
TODO (2014-02-03) jonk => document | [
"def get_tabs(tabs, options, index)\n tab_array = []\n\n Array(tabs).map do |tab|\n tab_hash = {}\n\n if tab[:anchor_string]\n tab_hash[:anchorString] = tab[:anchor_string]\n tab_hash[:anchorXOffset] = tab[:anchor_x_offset] || '0'\n tab_hash[... | [
"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 text about writing:",
"pos": "Represent the Github code about writing:",
"neg": "Represent the Github code:"
} |
fieldCallBack.doForField() for each field in each class | [
"private void forEachFieldDo(FieldCallBack fieldCallBack) {\n\t\tClass<?> clazz = this.getClass();\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tField[] fields = clazz.getDeclaredFields();\n\t\t\ttry {\n\t\t\t\tfor (Field field : fields) {\n\t\t\t\t\t// FIXME: test skipped cases\n\t\t\t\t\t// skip Logger object\n\t\t\t\... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Handle the ticket form registration
@param array $data
@param SummaryForm $form
@return \SS_HTTPResponse
@throws \ValidationException | [
"public function makePayment(array $data, SummaryForm $form)\n {\n // If the summary is changed and email receivers are set\n if (isset($data['Summary']) && is_array($data['Summary'])) {\n foreach ($data['Summary'] as $attendeeID => $fields) {\n $attendee = $form->reservat... | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the Github comment about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code:"
} |
Recreates the envelope from a json string.
@param string $envelope
@return self | [
"public static function fromString(string $envelope): self\n {\n $envelope = json_decode($envelope, true);\n if (!is_array($envelope)) {\n throw new \\InvalidArgumentException('Envelope is invalid. ' . json_last_error_msg());\n }\n\n $serializer = isset($envelope['serialize... | [
"def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]"
] | codesearchnet | {
"query": "Represent the description about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
// checkIPandProtocol checks if IP and Protocol of Entry is valid. | [
"func (e *Entry) checkIPandProtocol(set *IPSet) bool {\n\t// set default protocol to tcp if empty\n\tif len(e.Protocol) == 0 {\n\t\te.Protocol = ProtocolTCP\n\t} else if !validateProtocol(e.Protocol) {\n\t\treturn false\n\t}\n\n\tif net.ParseIP(e.IP) == nil {\n\t\tklog.Errorf(\"Error parsing entry %v ip address %v ... | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
@param $type
@param $expressions
@return mixed
@throws UnknowCompositeTypeException | [
"private function buildComposite($type, $expressions)\n {\n switch ($type) {\n case Lexer::T_AND:\n return $this->expressionBuilder->andX($expressions);\n case Lexer::T_NOT_AND:\n return $this->expressionBuilder->nandX($expressions);\n case Le... | [
"public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Processes a request_token request and returns the
request token on success. | [
"def fetch_request_token(self, oauth_request):\n \n try:\n # Get the request token for authorization.\n token = self._get_token(oauth_request, 'request')\n except Error:\n # No token required for the initial token request.\n version = self._get_versio... | [
"def openid_authorization_validator(self, request):\n \n request_info = super(ImplicitGrant, self).openid_authorization_validator(request)\n if not request_info: # returns immediately if OAuth2.0\n return request_info\n\n # REQUIRED. String value used to associate a Client se... | codesearchnet | {
"query": "Represent the post about Web development:",
"pos": "Represent the code about Web development:",
"neg": "Represent the code:"
} |
Subscribes an external handler to this channel. | [
"def subscribe(self, receiver):\n \"\"\n log.debug('{0}.{1} subscribe to {2}'\n .format(receiver.__module__, receiver.__name__, self))\n self.signal.connect(receiver)"
] | [
"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 Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
time in milliseconds | [
"async function getCurrentServerTimeAndBlock() {\n await retrieveDynGlobProps();\n if(props.time) { \n lastCommitedBlock = props.last_irreversible_block_num;\n trace(\"lastCommitedBlock = \" + lastCommitedBlock + \", headBlock = \" + props.head_block_number);\n return {\n time ... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Renders the HTML representation of the element. | [
"def render(self, **kwargs):\n \"\"\"\"\"\"\n vegalite_major_version = self._get_vegalite_major_versions(self.data)\n\n self._parent.html.add_child(Element(Template(\"\"\"\n <div id=\"{{this.get_name()}}\"></div>\n \"\"\").render(this=self, kwargs=kwargs)), name=self.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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Unlinks matched (typically cancelled) nodes encountered in a
traversal from head. | [
"private void sweep() {\n for (Node p = head, s, n; p != null && (s = p.next) != null; ) {\n if (!s.isMatched())\n // Unmatched nodes are never self-linked\n p = s;\n else if ((n = s.next) == null) // trailing node is pinned\n break;\n ... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Build i18n resource PROPERTIES.
@return JSON
@throws IOException | [
"public String getI18nPropertiesString() throws IOException {\n // Load all properties\n Properties i18nProps = new Properties();\n\n // add entries\n for (Entry<String, String> entry : properties.entrySet()) {\n String key = entry.getKey();\n String escapedKey = validName(key);\n i18nPro... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// FieldName specifies the name of the field to be used for sorting. | [
"func (s *FieldSort) FieldName(fieldName string) *FieldSort {\n\ts.fieldName = fieldName\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// opWait waits for the operation to complete, and a stop signal or a
// cancelation signal. | [
"func (b *Local) opWait(\n\tdoneCh <-chan struct{},\n\tstopCtx context.Context,\n\tcancelCtx context.Context,\n\ttfCtx *terraform.Context,\n\topStateMgr statemgr.Persister) (canceled bool) {\n\t// Wait for the operation to finish or for us to be interrupted so\n\t// we can handle it properly.\n\tselect {\n\tcase <-... | [
"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 Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Resets the executer scheduler internal state.
Raises:
RuntimeError: is the executor is still running. | [
"def reset(self):\n \n if self.running:\n raise RuntimeError('paco: executor is still running')\n\n self.pool.clear()\n self.observer.clear()\n self.semaphore = asyncio.Semaphore(self.limit, loop=self.loop)"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns the embed HTML for TrackJS
@return string | [
"public function getEmbedHtml () : string\n {\n if (null === $this->assetHelper && null === $this->packages)\n {\n throw new AssetIntegrationFailedException(\"No asset integration extension found. Please either install `becklyn/assets-bundle` or `symfony/asset` to use this bundle.\");\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 instruction about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about Programming:"
} |
(non-PHPdoc)
@see Webcreate\Vcs.VcsInterface::cat() | [
"public function cat($path)\n {\n if (!$this->hasCheckout) {\n $this->checkout();\n }\n\n if (false === file_exists($this->cwd . '/' . $path)) {\n throw new NotFoundException(sprintf('The path \\'%s\\' is not found', $path));\n }\n\n return file_get_conten... | [
"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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// SetContentDisposition sets the ContentDisposition field's value. | [
"func (s *HeadObjectOutput) SetContentDisposition(v string) *HeadObjectOutput {\n\ts.ContentDisposition = &v\n\treturn s\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 Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Relative path to absolute | [
"def fullpath(relpath):\n ''''''\n if (type(relpath) is object or type(relpath) is file):\n relpath = relpath.name\n return os.path.abspath(os.path.expanduser(relpath))"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Generate url for navigation link href | [
"function(suffix) {\n if ( suffix.match(/^([a-z]*:?\\d*)\\/\\//) ) { return suffix; }\n var base = this.enablePushState ? this.baseUrl : '#/';\n return base + suffix.replace(/^\\//,'');\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
ファイルが1904年始まりの設定かどうか。
@param sheet 判定対象のシート。
@return true:1904年始まり
@throws IllegalArgumentException {@literal sheet == null.} | [
"public static boolean isDateStart1904(final Sheet sheet) {\r\n ArgUtils.notNull(sheet, \"sheet\");\r\n \r\n if(sheet instanceof SheetImpl) {\r\n try {\r\n Field field = SheetImpl.class.getDeclaredField(\"nineteenFour\");\r\n field.setAccessible(true);\r... | [
"func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S... | codesearchnet | {
"query": "Represent the Github instruction about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code about Software development:"
} |
Pan event in the pan window. Just pan the channel viewer. | [
"def pan_pan_cb(self, fitsimage, event):\n \n chviewer = self.fv.getfocus_viewer()\n bd = chviewer.get_bindings()\n\n if hasattr(bd, 'pa_pan'):\n return bd.pa_pan(chviewer, event)\n\n return False"
] | [
"def handle_key ch\n $log.debug \" KeyDispatcher GOT KEY #{ch} \"\n @keyint = ch\n @keychr = nil\n chr = nil\n chr = ch.chr if ch > 32 and ch < 127\n @keychr = chr\n\n ret = process_key ch\n # revert to the basic handling of key_map and refreshing pad.\n #####\n # ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Single column only. | [
"def Akmaev_adjustment(theta, q, beta, n_k, theta_k, s_k, t_k):\n ''''''\n L = q.size # number of vertical levels\n # Akmaev step 1\n k = 1\n n_k[k-1] = 1\n theta_k[k-1] = theta[k-1]\n l = 2\n while True:\n # Akmaev step 2\n n = 1\n thistheta = theta[l-1]\n while... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Attempts to login the given user. | [
"public void login(AuthenticatedUser user) throws AuthenticationException\n {\n if (!user.isAnonymous() && !Auth.isExistingUser(user.getName()))\n throw new AuthenticationException(String.format(\"User %s doesn't exist - create it with CREATE USER query first\",\n ... | [
"public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Return a JavaRDD of Object by unpickling
It will convert each Python object into Java object by Pyrolite, whenever the
RDD is serialized in batch or not. | [
"def _to_java_object_rdd(rdd):\n \n rdd = rdd._reserialize(AutoBatchedSerializer(PickleSerializer()))\n return rdd.ctx._jvm.org.apache.spark.mllib.api.python.SerDe.pythonToJava(rdd._jrdd, True)"
] | [
"@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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Escapes all regex control characters returning expression suitable for
literal parsing.
@param literal
@return Escaped string | [
"public static String escape(String literal)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n for (int ii = 0; ii < literal.length(); ii++)\r\n {\r\n char cc = literal.charAt(ii);\r\n switch (cc)\r\n {\r\n case '[':\r\n case... | [
"def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// TermVectors returns information and statistics on terms in the fields
// of a particular document. | [
"func (c *Client) TermVectors(index, typ string) *TermvectorsService {\n\tbuilder := NewTermvectorsService(c)\n\tbuilder = builder.Index(index).Type(typ)\n\treturn builder\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Capture events that occur anywhere on the page. Event values will be relative to the page
(not the rootElement) {@see #getRelativeX(NativeEvent, Element)} and
{@see #getRelativeY(NativeEvent, Element)}. | [
"static HandlerRegistration capturePageEvent (String name, EventHandler handler) {\n return addEventListener(Document.get(), name, handler, true);\n }"
] | [
"@Deprecated\n @SuppressWarnings(\"unused\")\n public void middleClick() { // TODO(andreastt): Add this to Actions\n Point point = coordinates.inViewPort();\n exec.mouseAction(point.x, point.y, OperaMouseKeys.MIDDLE);\n }"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Returns an array containing the ids of the colors in the specified class. | [
"public int[] enumerateColorIds (String className)\n {\n // make sure the class exists\n ClassRecord record = getClassRecord(className);\n if (record == null) {\n return null;\n }\n\n int[] cids = new int[record.colors.size()];\n Iterator<ColorRecord> crecs = ... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@param string $eventName
@param array $withArgs
@return mixed|null | [
"private function callListener(string $eventName, array $withArgs)\n {\n $listener = Container\\get($eventName);\n\n if (is_callable($listener)) {\n return call_user_func_array($listener, $withArgs);\n }\n\n return null;\n }"
] | [
"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:"
} |
// NewDataPlacementRestrictionSatisfyPolicyDetails returns a new DataPlacementRestrictionSatisfyPolicyDetails instance | [
"func NewDataPlacementRestrictionSatisfyPolicyDetails(PlacementRestriction *PlacementRestriction) *DataPlacementRestrictionSatisfyPolicyDetails {\n\ts := new(DataPlacementRestrictionSatisfyPolicyDetails)\n\ts.PlacementRestriction = PlacementRestriction\n\treturn s\n}"
] | [
"<P extends PatchingArtifact.ArtifactState, S extends PatchingArtifact.ArtifactState> PatchingArtifactStateHandler<S> getHandlerForArtifact(PatchingArtifact<P, S> artifact) {\n return handlers.get(artifact);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Flag indicating if the asset has a balance.
Args:
assetId (UInt256):
Returns:
bool: True if a balance is present. False otherwise. | [
"def HasBalance(self, assetId):\n \n for key, fixed8 in self.Balances.items():\n if key == assetId:\n return True\n return False"
] | [
"def _validate_none_or_type(t):\n \n def _validate(setting):\n \"\"\"\n Check the setting to make sure it's the right type.\n\n Args:\n setting (object): The setting to check.\n\n Returns:\n object: The unmodified object if it's the proper type.\n\n Rai... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Engineering:"
} |
// executeAdminQuery executes a query on a given tablet as 'allprivs' user. The query is executed
// using timeout value from --schema_swap_admin_query_timeout flag. | [
"func (shardSwap *shardSchemaSwap) executeAdminQuery(tablet *topodatapb.Tablet, query string, maxRows int) (*sqltypes.Result, error) {\n\tsqlCtx, cancelSQLCtx := context.WithTimeout(shardSwap.parent.ctx, *adminQueryTimeout)\n\tdefer cancelSQLCtx()\n\n\tsqlResultProto, err := shardSwap.parent.tabletClient.ExecuteFet... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about AWS Auto Scaling:"
} |
// GetPublicRepos returns the PublicRepos field if it's non-nil, zero value otherwise. | [
"func (u *User) GetPublicRepos() int {\n\tif u == nil || u.PublicRepos == nil {\n\t\treturn 0\n\t}\n\treturn *u.PublicRepos\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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Execute a command and return a parsed response | [
"def execute_command(self, *args, **options):\n \"\"\"\"\"\"\n pool = self.connection_pool\n command_name = args[0]\n for i in _xrange(self.execution_attempts):\n connection = pool.get_connection(command_name, **options)\n try:\n connection.send_comma... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// TruncateScope mocks base method | [
"func (m *MockConnector) TruncateScope(arg0 context.Context, arg1 string) error {\n\tret := m.ctrl.Call(m, \"TruncateScope\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Returns a list of file-based module loaders.
Each item is a tuple (loader, suffixes). | [
"def get_supported_file_loaders_2(force=False):\n \n\n if force or (2, 7) <= sys.version_info < (3, 4): # valid until which py3 version ?\n\n import imp\n\n loaders = []\n for suffix, mode, type in imp.get_suffixes():\n if type == imp.PY_SOURCE:\n loaders.append... | [
"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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Logic for getting $GOPATH | [
"func Gopath() string {\n\tepath := os.Getenv(\"GOPATH\")\n\tif epath == \"\" {\n\t\t// It's now safe to assume $HOME/go\n\t\t// thanks to Dave Cheney and the folks\n\t\t// who work on the standard library\n\t\t// https://github.com/golang/go/issues/17262\n\t\tpath := fmt.Sprintf(\"%s/go\", local.Home())\n\t\tretur... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Redirects the client for authorization.
@param array $options
@param callable|null $redirectHandler
@return mixed | [
"public function authorize(\n array $options = [],\n callable $redirectHandler = null\n ) {\n $url = $this->getAuthorizationUrl($options);\n if ($redirectHandler) {\n return $redirectHandler($url, $this);\n }\n\n // @codeCoverageIgnoreStart\n header('Lo... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
@param array $entry
@throws \League\ISO3166\Exception\DomainException if given data entry does not have all the required keys | [
"private function assertEntryHasRequiredKeys(array $entry)\n {\n if (!isset($entry[ISO3166::KEY_ALPHA2])) {\n throw new DomainException('Each data entry must have a valid alpha2 key.');\n }\n\n Guards::guardAgainstInvalidAlpha2($entry[ISO3166::KEY_ALPHA2]);\n\n if (!isset($... | [
"private function guardValidModelAndIdentifier($model, $identifier)\n {\n if (empty($model) || (!is_object($model) && (null === $identifier || '' === $identifier))) {\n throw new ResolveComponentDataException('Model has to be an object or (a scalar + an identifier in 2nd argument)');\n }... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Get the settings associated to the specified keyword or, if
keyword is None, get all the settings.
:param keyword: settings to be retrieved
:return: dictionary with the settings plus a key to identify from which
keyword where retrieved. | [
"def get_settings_by_keyword(keyword=None):\n \n settings = []\n if keyword is None:\n # iterate over all the schemas to return all settings\n for key, ischemas in CONTROLPANEL_INTERFACE_MAPPING.items():\n settings_from_ifaces = map(get_settings_from_interface, ischemas)\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
The input parameter must contain the string c. if yes, the check passes
@param c contained strings
@return Validation | [
"public static Validation<String> contains(String c) {\n return contains(c, I18N_MAP.get(i18nPrefix + \"CONTAINS\"));\n }"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns the {@link CommandServices} for this {@link AbstractCommand}. | [
"protected CommandServices getCommandServices() {\n\t\tif (commandServices == null) {\n\t\t\tcommandServices = ValkyrieRepository.getInstance().getApplicationConfig().commandServices();\n\t\t}\n\t\treturn this.commandServices;\n\t}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.