query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Runs the dispatch loop | [
"protected function dispatchLoop()\n {\n $ini = eZINI::instance();\n\n // Start the module loop\n while ( $this->siteBasics['module-run-required'] )\n {\n $objectHasMovedError = false;\n $objectHasMovedURI = false;\n $this->actualRequestedURI = $this->... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@param string $key
@param int $when [optional]
@return $this | [
"public function remove($key, $when = self::NEXT)\n {\n $deleteWhen = $when == self::ALL ? self::$when : (array) $when;\n foreach ($deleteWhen as $when) {\n $this->set($key, null, $when);\n }\n\n return $this;\n }"
] | [
"public static function getPageAuthority($url = false)\n {\n $data = static::getCols('34359738368', $url);\n return (parent::noDataDefaultValue() == $data) ? $data :\n $data['upa'];\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Creates a Flink {@link InputFormat} that wraps the given Hadoop {@link org.apache.hadoop.mapreduce.lib.input.FileInputFormat}.
@return A Flink InputFormat that wraps the Hadoop FileInputFormat. | [
"public static <K, V> org.apache.flink.api.java.hadoop.mapreduce.HadoopInputFormat<K, V> readHadoopFile(\n\t\t\torg.apache.hadoop.mapreduce.lib.input.FileInputFormat<K, V> mapreduceInputFormat, Class<K> key, Class<V> value, String inputPath) throws IOException {\n\t\treturn readHadoopFile(mapreduceInputFormat, key,... | [
"@Deprecated\n public CqlRecordWriter getRecordWriter(org.apache.hadoop.fs.FileSystem filesystem, org.apache.hadoop.mapred.JobConf job, String name, org.apache.hadoop.util.Progressable progress) throws IOException\n {\n return new CqlRecordWriter(job, progress);\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
// SearchShards returns statistical information about nodes and shards. | [
"func (c *Client) SearchShards(indices ...string) *SearchShardsService {\n\treturn NewSearchShardsService(c).Index(indices...)\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 Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
True if this is a broken reference; False otherwise. | [
"def _is_broken_ref(key1, value1, key2, value2):\n \"\"\"\"\"\"\n # A link followed by a string may represent a broken reference\n if key1 != 'Link' or key2 != 'Str':\n return False\n # Assemble the parts\n n = 0 if _PANDOCVERSION < '1.16' else 1\n\n if isinstance(value1[n][0]['c'], list):\... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Native storage object. | [
"def native_obj(self):\n \"\"\"\"\"\"\n if self.__native is None:\n self.__native = self._get_object()\n\n return self.__native"
] | [
"@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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
// SetToken updates sthe stored token in the struct | [
"func (t *tokenAccessor) SetToken(serverID string, validity time.Duration, secret secrets.Secrets) error {\n\n\tt.Lock()\n\tdefer t.Unlock()\n\ttokenEngine, err := tokens.NewJWT(validity, serverID, secret)\n\tif err != nil {\n\t\treturn err\n\t}\n\tt.tokens = tokenEngine\n\treturn nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Get options for the currently running pipeline, if and only if it is currently running
@return ArrayList List of items with a Link and Title attribute | [
"public function RunningOptions() {\n\t\tif(!$this->isActive()) return null;\n\t\t$actions = array();\n\n\t\t// Let current step update the current list of options\n\t\tif(($step = $this->CurrentStep()) && ($step->isRunning())) {\n\t\t\t$actions = $step->allowedActions();\n\t\t}\n\t\treturn new ArrayList($actions);... | [
"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 instruction about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code about programming:"
} |
Render all the cron jobs.
@return string | [
"private function render()\n {\n $output = '';\n\n foreach ($this->jobs as $job) {\n $output .= $this->getTaskDefinition($job);\n }\n\n return $output;\n }"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
For entities with attributes that are part of a bidirectional relationship update the other
side of the relationship.
@param entity created or updated entity
@param existingEntity existing entity | [
"public void updateMappedByEntities(\n @Nonnull Entity entity, @Nullable @CheckForNull Entity existingEntity) {\n entity\n .getEntityType()\n .getMappedByAttributes()\n .forEach(\n mappedByAttr -> {\n AttributeType type = mappedByAttr.getDataType();\n ... | [
"public boolean deleteEdgeReference(AtlasEdge edge, DataTypes.TypeCategory typeCategory, boolean isComposite,\n boolean forceDeleteStructTrait) throws AtlasException {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Deleting {}\", string(edge));\n }\n\n ... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software Development:"
} |
Load a bitmap file from the backends/images subdirectory in which the
matplotlib library is installed. The filename parameter should not
contain any path information as this is determined automatically.
Returns a wx.Bitmap object | [
"def _load_bitmap(filename):\n \n\n basedir = os.path.join(rcParams['datapath'],'images')\n\n bmpFilename = os.path.normpath(os.path.join(basedir, filename))\n if not os.path.exists(bmpFilename):\n raise IOError('Could not find bitmap file \"%s\"; dying'%bmpFilename)\n\n bmp = wx.Bitmap(bmpFil... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Callback to retrieve the list of files from the server response: | [
"function (data) {\n if (data.result && $.isArray(data.result.files)) {\n return data.result.files;\n }\n return [];\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Gets the detail page information for everything.<p>
@param cms the current CMS context
@return the list with all the detail page information | [
"public List<DetailInfo> getDetailInfo(CmsObject cms) {\n\n return getCacheState(isOnline(cms)).getDetailInfosForSubsites(cms);\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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
columnTransformer has access to Key, Value information in each Table.Cell
@param table
@param columnTransformer
@param <R>
@param <C>
@param <V>
@param <C2>
@return | [
"public static <R, C, V, C2> ImmutableTable<R, C2, V> columnTransformerByCell(\n final Table<R, C, V> table,\n final Function<Table.Cell<R, C, V>, C2> columnTransformer) {\n final ImmutableTable.Builder<R, C2, V> newTable = ImmutableTable.builder();\n for(Table.Cell<R, C, V> cell : table.cellSet()) ... | [
"public <V> Function<Cursor, V> cursorToBean(Class<V> api)\n {\n return (FindDataVault<ID,T,V>) _valueBeans.get(api);\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns an ordered list of unique classpath element and module URIs.
@return The unique classpath element and module URIs. | [
"public List<URI> getClasspathURIs() {\n if (closed.get()) {\n throw new IllegalArgumentException(\"Cannot use a ScanResult after it has been closed\");\n }\n final List<URI> classpathElementOrderURIs = new ArrayList<>();\n for (final ClasspathElement classpathElement : classp... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@constructor
@param {String} name - Name of the connection
@param {Object} config - Config of the connection | [
"function(name, config)\n{\n this.mongo = require('mongodb');\n this.mongoose = require('mongoose');\n\n this.config = config;\n this.name = name;\n\n this.connection = undefined;\n this.orm = {\n instance : undefined,\n models : {}\n };\n}"
] | [
"function createConnection(connectionOptions, config)\n {\n // create a new ConnectionConfig and skip credential-validation if a config\n // object has been specified; this is because if a config object has been\n // specified, we're trying to deserialize a connection and the account name,\n // usernam... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Create RSA key pair.
Returns n, e, d, where (n, e) is the public
key and (n, e, d) is the private key (and k is
the number of rounds used in the Miller-Rabin
primality test). | [
"def make_rsa_keys(bits=2048, e=65537, k=64):\n \n p, q = None, None\n while p == q:\n p, q = get_prime(bits // 2), get_prime(bits // 2)\n n = p * q\n phi_n = phi(n, p, q)\n d = mult_inv(e, phi_n)\n return n, e, d"
] | [
"function(algo) {\n switch (algo) {\n // Algorithm-Specific Fields for RSA encrypted session keys:\n // - MPI of RSA encrypted value m**e mod n.\n case enums.publicKey.rsa_encrypt:\n case enums.publicKey.rsa_encrypt_sign:\n return [type_mpi];\n\n // Algorithm-Specific Fi... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Encryption:"
} |
Calculates noise properties and saves values to pickle.
chunk defines window for measurement. at least one measurement always made. | [
"def noisepickle(d, data, u, v, w, chunk=200):\n \n\n if d['savenoise']:\n noisefile = getnoisefile(d)\n\n if os.path.exists(noisefile):\n logger.warn('noisefile %s already exists' % noisefile)\n else:\n nints = len(data)\n chunk = min(chunk, nints) # ens... | [
"def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
@param \DOMElement|\DOMText|\DOMAttr $node
@return \DiDom\Element|string
@throws InvalidArgumentException if node is not DOMElement, DOMText, DOMComment, DOMCdataSection or DOMAttr | [
"protected function wrapNode($node)\n {\n switch (get_class($node)) {\n case 'DOMElement':\n return new Element($node);\n\n case 'DOMText':\n return $node->data;\n\n case 'DOMComment':\n return new Element($node);\n\n ... | [
"public function normalizeValue($value)\n\t{\n\t\tif ($value instanceof AttributeFilter)\n\t\t{\n\t\t\treturn $value;\n\t\t}\n\n\t\tif (is_callable($value))\n\t\t{\n\t\t\treturn new AttributeFilter($value);\n\t\t}\n\n\t\tthrow new InvalidArgumentException('Argument 1 passed to ' . __METHOD__ . ' must be a valid cal... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
/* (non-Javadoc)
@see nz.co.senanque.validationengine.annotations1.FieldValidator#init(java.lang.annotation.Annotation) | [
"public void init(Length annotation, PropertyMetadata propertyMetadata)\n {\n m_minLength = annotation.minLength()==null?-1:Integer.valueOf(annotation.minLength());\n m_maxLength = annotation.maxLength()==null?-1:Integer.valueOf(annotation.maxLength());\n m_propertyMetadata = propertyMetadat... | [
"@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
&readBuffer
@param int $length
@return mixed | [
"public function &readBuffer($length) {\n\n if ($length+$this->cursor > strlen($this->rawData)) {\n throw new Exception('Buffer underrun at position: '. $this->cursor . '. Trying to fetch '. $length . ' bytes');\n return false;\n }\n $data = substr($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 sentence about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
Replace placeholders in the SQL with '?' or real value
@param string $sql
@param array &$bindings
@param array $settings
@return string
@access public | [
"public function bindValues(\n /*# string */ $sql,\n array &$bindings,\n array $settings\n )/*# : string */ {\n // make sure escape function ok\n $this->setEscapeCallable($settings['escapeFunction']);\n\n // replace each placeholder with corresponding ?/:name/value\n ... | [
"public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Retrieves an Issuing <code>Card</code> object. | [
"public static Card retrieve(String card) throws StripeException {\n return retrieve(card, (Map<String, Object>) null, (RequestOptions) null);\n }"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the sentence about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code about Programming:"
} |
Get validation schemas name.
@param string $scenario
@return array | [
"protected function getValidationSchemasName($scenario)\n {\n $on = 'on' . ucfirst($scenario);\n $extend = 'extend' . ucfirst($scenario);\n\n return [$on, $extend];\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:"
} |
code verifier用のランダム文字列を生成します。
@throws \ErrorException code verifierの生成に失敗した場合
@return string code verifier | [
"protected function generateCodeVerifier () {\n\t\t$sp\t\t= ['-'. '/', '_', '~'];\n\t\t$length\t= random_int(43, 128);\n\t\t$stack\t= [];\n\n\t\tfor ($i = 0;$i < $length;$i++) {\n\t\t\tswitch (random_int(1, 4)) {\n\t\t\t\tcase 1:\n\t\t\t\t\t$stack[] = chr(random_int(0x30, 0x39));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:... | [
"public static function Connect (array $options, $name = self::DEFAULT_CONNECTION_NAME) {\n\t\tforeach (['server_key', 'server_salt', 'client_key', 'client_salt'] as $key) {\n\t\t\tif (!isset($options[$key])) {\n\t\t\t\tthrow CoreException::RaiseSystemError('クッキー認証の%sが設定されていません。CookieAuth::Connect([\\'%s\\' => 任意のパ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// getNextBuildName returns name of the next build and increments BuildConfig's LastVersion. | [
"func getNextBuildName(buildConfig *buildv1.BuildConfig) string {\n\tbuildConfig.Status.LastVersion++\n\treturn apihelpers.GetName(buildConfig.Name, strconv.FormatInt(buildConfig.Status.LastVersion, 10), kvalidation.DNS1123SubdomainMaxLength)\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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Check the http status code and num_tries/num_apikey_tries to see if it should try again or not
Log any data as needed | [
"def _get_site_status_code(self, url, status_code, api, num_tries, num_apikey_tries):\n \n # Make status code an int\n try:\n status_code = int(status_code)\n except ValueError:\n logger.exception(\"Incorrect status code passed in\")\n return None\n ... | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Populate the round-robin lists with the fallback backends. | [
"private void useFallbackBackends() {\n usingFallbackBackends = true;\n logger.log(ChannelLogLevel.INFO, \"Using fallback backends\");\n\n List<DropEntry> newDropList = new ArrayList<>();\n List<BackendAddressGroup> newBackendAddrList = new ArrayList<>();\n for (EquivalentAddressGroup eag : fallbackB... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Returns an HTML string
@return string Returns an HTML string | [
"public function output_html($data, $query='') {\n global $OUTPUT;\n $context = new stdClass();\n $context->title = $this->visiblename;\n $context->description = $this->description;\n $context->descriptionformatted = highlight($query, markdown_to_html($this->description));\n ... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the sentence about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
Replaces the where statement. The statement
will be reformatted to match, allowing further
chaining by Monga.
@param array $where An array of where conditions
@return object $this | [
"public function setWhere(array $where)\n {\n // When the statement is empty set the\n // where property to null to prevent\n // empty statement errors.\n if (empty($where)) {\n // delete the current where statement\n $this->where = null;\n\n // Skip f... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Handles the ModelUpdated event from the database. | [
"function(model)\n {\n var exists = this.has( model.$key() );\n var matches = this.filter( model );\n\n if ( exists && !matches )\n {\n this.remove( model );\n }\n if ( !exists && matches )\n {\n this.add( model );\n }\n }"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Gets whether or not a name has an extension
@param string $name The name to check
@param array $sortedExtensions The list of sorted extensions to check against
@return bool True if the name has an extension, otherwise false | [
"protected function nameHasExtension(string $name, array $sortedExtensions) : bool\n {\n foreach ($sortedExtensions as $extension) {\n $lengthDifference = strlen($name) - strlen($extension);\n\n if ($lengthDifference > 0 && strpos($name, $extension, $lengthDifference) !== false) {\n ... | [
"function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public EClass getRemoteServiceCalled() {\r\n\t\tif (remoteServiceCalledEClass == null) {\r\n\t\t\tremoteServiceCalledEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(LogPackage.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(31);\r\n\t\t}\r\n\t\treturn remoteServiceCalledEClass;\r\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the summarization about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Removes menu items from an array if the supplied user lacks permission.
@param User $user A user object
@param array $items A collection of menu items
@return array The filtered menu items | [
"protected function filterItemPermissions($user, array $items)\n {\n if (!$user) {\n return $items;\n }\n\n $items = array_filter($items, function ($item) use ($user) {\n if (!$item->permissions || !count($item->permissions)) {\n return true;\n ... | [
"protected function showsTopParentsOnly()\n {\n $relation = $this->getModelInformation()->list->default_top_relation;\n\n // If the default is to restrict to top-level only,\n // or the reverse with a user-initiated reversal (relation = false):\n // Restrict the query to top level.\n\... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Return's the page layout for the passed page layout string.
@param string $pageLayout The page layout string to return the key for
@return integer The requested page layout
@throws \Exception Is thrown, if the requested page layout is not available | [
"public function getPageLayoutByValue($pageLayout)\n {\n\n // query whether or not, the requested display mode is available\n if (isset($this->availablePageLayouts[$pageLayout])) {\n return $this->availablePageLayouts[$pageLayout];\n }\n\n // throw an exception, if not\n ... | [
"private function getColumnFromName($name)\n {\n foreach ($this->columnConfiguration as $i => $col) {\n if ($col->getName() == $name) {\n return $col;\n }\n }\n\n // This exception should never happen. If it does, something is\n // wrong w/ the rel... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// NewWSClient returns a new client. See the commentary on the func(*WSClient)
// functions for a detailed description of how to configure ping period and
// pong wait time. The endpoint argument must begin with a `/`. | [
"func NewWSClient(remoteAddr, endpoint string, options ...func(*WSClient)) *WSClient {\n\taddr, dialer := makeHTTPDialer(remoteAddr)\n\tc := &WSClient{\n\t\tAddress: addr,\n\t\tDialer: dialer,\n\t\tEndpoint: endpoint,\n\t\tPingPongLatencyTimer: metrics.NewTimer(),\n\n\t\tmaxRe... | [
"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 post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
// SetDesiredIngressPolicyEnabled sets Endpoint's ingress policy enforcement
// configuration to the specified value. The endpoint's mutex must not be held. | [
"func (e *Endpoint) SetDesiredIngressPolicyEnabled(ingress bool) {\n\te.UnconditionalLock()\n\te.desiredPolicy.IngressPolicyEnabled = ingress\n\te.Unlock()\n\n}"
] | [
"func GetAPIServerProbeAddress(endpoint *kubeadmapi.APIEndpoint) string {\n\t// In the case of a self-hosted deployment, the initial host on which kubeadm --init is run,\n\t// will generate a DaemonSet with a nodeSelector such that all nodes with the label\n\t// node-role.kubernetes.io/master='' will have the API s... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
Process embed tags for a single tag type (embed or embed-inline).
@param \DOMDocument $xmlDoc
@param $tagName string name of the tag to extract | [
"protected function processTag(DOMDocument $xmlDoc, $tagName)\n {\n /** @var $embed \\DOMElement */\n foreach ($xmlDoc->getElementsByTagName($tagName) as $embed) {\n if (!$view = $embed->getAttribute('view')) {\n $view = $tagName;\n }\n\n $embedConten... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
/*
Set the value of the TimeToLive field in the message header.
Javadoc description supplied by JsJmsMessage interface. | [
"@Override\n public final void uncheckedSetTimeToLive(long value) {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(this, tc, \"uncheckedSetTimeToLive\", Long.valueOf(value));\n getHdr2().setLongField(JsHdr2Access.TIMETOLIVE, value);\n if (TraceCom... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the summarization about Java programming:",
"pos": "Represent the code about Java programming:",
"neg": "Represent the code about programming:"
} |
// WithHandler returns a TxnRunner than handles transaction errors r.Handlers
// chained with h. | [
"func (r *Env) WithHandler(h Handler) TxnRunner {\n\treturn &handlerRunner{\n\t\tenv: r,\n\t\th: r.Handlers.Append(h),\n\t}\n}"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetPatterns sets the Patterns optional argument. If specified, only
// requests matching any of these patterns will produce fetchRequested
// event and will be paused until clients response. If not set, all
// requests will be affected. | [
"func (a *EnableArgs) SetPatterns(patterns []RequestPattern) *EnableArgs {\n\ta.Patterns = patterns\n\treturn a\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
A slave sent a `ready` commands which basically says that the slave bootstrapped successfully the
application and is ready to accept connections.
@param array $data
@param ConnectionInterface $conn | [
"protected function commandReady(array $data, ConnectionInterface $conn)\n {\n try {\n $slave = $this->slaves->getByConnection($conn);\n } catch (\\Exception $e) {\n $this->output->writeln(\n '<error>A ready command was sent by a worker with no connection. This ... | [
"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:"
} |
// CleanUp removes the TXT record matching the specified parameters | [
"func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {\n\tfqdn, _ := dns01.GetRecord(domain, keyAuth)\n\n\tzoneID, err := d.getHostedZoneID(fqdn)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"rackspace: %v\", err)\n\t}\n\n\trecord, err := d.findTxtRecord(fqdn, zoneID)\n\tif err != nil {\n\t\treturn fmt... | [
"@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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Image Upload with $_FILES array:
Post values:
+ file
+ folderId
+ isHidden
@return array
@since 1.2.3 | [
"public function actionImagesUpload()\n {\n $result = $this->actionFilesUpload();\n\n if ($result['upload'] && $result['file']) {\n $fileId = $result['file']->id;\n\n $image = Yii::$app->storage->createImage($fileId, 0);\n\n if ($image) {\n // create ... | [
"private function getFormOptionsDeclaration()\n {\n\n // we got a max instances allowed in normality tags\n $formOptions = json_encode( $this->formOptions );\n $formOptions = Php::varExport( $formOptions, true );\n\n $this->class->classComponents[] = new VariableDeclaration(\n ... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Returns a boolean value. To be used when parameter is required or has a default value.
@throws java.lang.IllegalArgumentException is value is null or blank | [
"public boolean mandatoryParamAsBoolean(String key) {\n String s = mandatoryParam(key);\n return parseBoolean(key, s);\n }"
] | [
"public void setValue(Object value) {\n\n if(LOGGER.isInfoEnabled() && !(value instanceof java.io.Serializable))\n LOGGER.info(\"Warning: setting a filter value tiat is not serializable. The Filter object is serializable and should contain only serializable state\");\n\n _value = value;\n ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Same effect as {@link Iterate#count(Iterable, Predicate)}, but executed in parallel batches.
@return The number of elements which satisfy the predicate. | [
"public static <T> int count(Iterable<T> iterable, Predicate<? super T> predicate, int batchSize, Executor executor)\n {\n CountCombiner<T> combiner = new CountCombiner<T>();\n CountProcedureFactory<T> procedureFactory = new CountProcedureFactory<T>(predicate);\n ParallelIterate.forEach(\n ... | [
"@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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
// UnmarshalTOML decodes the parsed data to the object | [
"func (p *Prometheus) UnmarshalTOML(data interface{}) error {\n\tdataOK, ok := data.(map[string]interface{})\n\tif !ok {\n\t\treturn errors.New(\"bad urls for prometheus input plugin\")\n\t}\n\turls, ok := dataOK[\"urls\"].([]interface{})\n\tif !ok {\n\t\treturn errors.New(\"urls is not an array for prometheus inpu... | [
"@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:"
} |
Convenience method that can have faster implementation
by not allocating buffers.
@param char32a the first code point to be checked against
@param str2 the second string
@param options A bit set of options | [
"public static int compare(int char32a, String str2, int options) {\n return internalCompare(UTF16.valueOf(char32a), str2, options);\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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Get details about a security group. | [
"def cli(env, identifier):\n \"\"\"\"\"\"\n\n mgr = SoftLayer.NetworkManager(env.client)\n\n secgroup = mgr.get_securitygroup(identifier)\n\n table = formatting.KeyValueTable(['name', 'value'])\n table.align['name'] = 'r'\n table.align['value'] = 'l'\n\n table.add_row(['id', secgroup['id']])\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
请求服务器jsapi_ticket
@param string $type
@return array|bool | [
"protected function requestJsApiTicket($type = 'jsapi')\n {\n $result = $this->httpGet(self::WECHAT_JS_API_TICKET_PREFIX, [\n 'access_token' => $this->getAccessToken(),\n 'type' => $type\n ]);\n return isset($result['ticket']) ? $result : false;\n }"
] | [
"function hot(backendTplServer) {\n backendTplServer.app.get('/news/hot', function(request, response) {\n var data = Mock.mock({\n 'news|0-10': [news]\n });\n\n // 如果对象中有方法的定义, 最好不要放在 Mock.mock 中, 因为他会将方法定义变成直接的属性值(方法的返回值)\n data.__helper = __helper;\n\n response.ren... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Performs a bulk load on this RTree with the specified data. Is called by
the constructor and should be overwritten by subclasses if necessary. | [
"@Override\n protected void bulkLoad(List<E> spatialObjects) {\n if(!initialized) {\n initialize(spatialObjects.get(0));\n }\n\n StringBuilder msg = getLogger().isDebuggingFine() ? new StringBuilder() : null;\n\n // Tiny tree that fits into a single page\n if(spatialObjects.size() <= leafCapaci... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// ExecSyncContainer execs a command in a container and returns it's stdout, stderr and return code. | [
"func (r *Runtime) ExecSyncContainer(c *Container, command []string, timeout int64) (*ExecSyncResponse, error) {\n\timpl, err := r.RuntimeImpl(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn impl.ExecSyncContainer(c, command, timeout)\n}"
] | [
"def work_on_machine(context):\n \n print(\"Created context. Context ID is\", context.context_id)\n\n # You don't need to understand any/all of this, but it's helpful to grok\n # the whole chain:\n\n # - Context.call() is a light wrapper around .call_async(), the wrapper\n # simply blocks the ca... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Creates a new and empty database. | [
"def _create(self):\n \"\"\"\"\"\"\n from .tools import makedirs_safe\n\n # create directory for sql database\n makedirs_safe(os.path.dirname(self._database))\n\n # create all the tables\n Base.metadata.create_all(self._engine)\n logger.debug(\"Created new empty database '%s'\" % self._database... | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Middleware to be used in before()
@param Application $app
@param string $scopeName
@return JsonResponse | [
"protected function requireScope(Application $app, $scopeName)\n {\n /** @var ResourceServer $server */\n $server = $app[ResourceServer::class];\n if ($response = $this->requireAuthorization($app)) {\n return $response;\n }\n $accessToken = $server->getAccessToken();... | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Override preparePaintComponent to set the initial selection from the app preferences. The selection is set the
first time the example is accessed or when the reset button is used.
@param request the request being responded to. | [
"@Override\n\tpublic void preparePaintComponent(final Request request) {\n\t\tif (!this.isInitialised() || resetButton.isPressed()) {\n\t\t\tString preferredState = request.getAppPreferenceParameter(\"example.preferred.state\");\n\t\t\tstateSelector.setSelected(preferredState);\n\t\t\tthis.setInitialised(true);\n\t... | [
"public void onTransformChanged() {\n Log.v(Log.SUBSYSTEM.WIDGET, TAG, \"onTransformChanged(): %s mPreventTransformChanged = %b\",\n getName(), mPreventTransformChanged);\n\n // Even if the calling code that altered the transform doesn't request a\n // layout, we'll do a layout t... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Imports the current organizational unit.<p> | [
"public void importOrgUnit() {\n\n try {\n if (m_throwable != null) {\n getReport().println(m_throwable);\n getReport().addError(m_throwable);\n\n CmsMessageContainer message = Messages.get().container(\n Messages.ERR_IMPORTEXPORT_ERR... | [
"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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Creates/updates all errand job instances
@return [void] | [
"def update_instances\n instance_group_updater = InstanceGroupUpdater.new(\n ip_provider: @deployment_planner.ip_provider,\n instance_group: @instance_group,\n disk_manager: @disk_manager,\n template_blob_cache: @template_blob_cache,\n dns_encoder: @dns_encoder,\n link... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
First point of call: if nodes are comparable it compares node values then
recurses to compare node children.
@param control
@param test
@param listener
@param elementQualifier
@throws DifferenceFoundException | [
"protected void compareNode(Node control, Node test,\n DifferenceListener listener, ElementQualifier elementQualifier) \n throws DifferenceFoundException {\n boolean comparable = compareNodeBasics(control, test, listener);\n boolean isDocumentNode = false;\n\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Start a windows service
@param [String] service_name name of the service to start
@param optional [Integer] timeout the minumum number of seconds to wait before timing out | [
"def start(service_name, timeout: DEFAULT_TIMEOUT)\n Puppet.debug _(\"Starting the %{service_name} service. Timeout set to: %{timeout} seconds\") % { service_name: service_name, timeout: timeout }\n\n valid_initial_states = [\n SERVICE_STOP_PENDING,\n SERVICE_STOPPED,\n SERVICE_START_... | [
"def start(self, timeout=None):\n \n\n # we lazily create our process delegate (with same arguments)\n if self.daemon:\n daemonic = True\n else:\n daemonic = False\n\n pargs = self._pargs.copy()\n pargs.pop('daemonic', None)\n\n self._process = ... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
This file can be any file type supported by the DataReader. E.g. for the OSMReader it is the
OSM xml (.osm), a compressed xml (.osm.zip or .osm.gz) or a protobuf file (.pbf) | [
"public GraphHopper setDataReaderFile(String dataReaderFileStr) {\n ensureNotLoaded();\n if (isEmpty(dataReaderFileStr))\n throw new IllegalArgumentException(\"Data reader file cannot be empty.\");\n\n dataReaderFile = dataReaderFileStr;\n return this;\n }"
] | [
"def _guess_format(path):\n \n if os.path.isdir(path):\n return 'dir-npy'\n\n if path.endswith('.h5') or path.endswith('.hdf5'):\n # TODO: Check for mdtraj .h5 file\n return 'hdf5'\n\n # TODO: What about a list of trajectories, e.g. from command line nargs='+'\n return 'mdtraj'"
... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about File management:"
} |
// ConvertWorkItemTypeFromModel converts from models to app representation | [
"func ConvertWorkItemTypeFromModel(request *http.Request, t *workitem.WorkItemType) app.WorkItemTypeData {\n\tspaceTemplateRelatedURL := rest.AbsoluteURL(request, app.SpaceTemplateHref(t.SpaceTemplateID.String()))\n\tspaceRelatedURL := rest.AbsoluteURL(request, app.SpaceHref(space.SystemSpace.String()))\n\tvar conv... | [
"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 text about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code about programming:"
} |
Returns the ID of an observer with public = 1 and with similar request and params.
@param string $request
@param string $params
@return null|string | [
"private function _get_id(string $request, $params): ?string\n {\n if ( $this->check() ){\n if ( $params ){\n return $this->db->select_one('bbn_observers', 'id', [\n 'id_string' => $this->_get_id_string($request, $params)\n ]);\n }\n return $this->db->get_one(\"\n SE... | [
"public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Construct set of port bindings from comma delimited list of ports.
@param portSpecs
@param exposedPorts
@param context
@return | [
"private Ports getPortBindings(String portSpecs, ExposedPort[] exposedPorts, TestContext context) {\n String[] ports = StringUtils.commaDelimitedListToStringArray(portSpecs);\n Ports portsBindings = new Ports();\n\n for (String portSpec : ports) {\n String[] binding = context.replace... | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the text about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code:"
} |
Given an action, compute the integer value for that action
which is to be put in the action table of the generated machine.
Return negative if no action should be generated.
@param PHP_ParserGenerator_Action | [
"function compute_action($ap)\n {\n switch ($ap->type) {\n case PHP_ParserGenerator_Action::SHIFT:\n $act = $ap->x->statenum;\n break;\n case PHP_ParserGenerator_Action::REDUCE:\n $act = $ap->x->index + $this->nstate;\n brea... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Adds the given bindings to this tuple. | [
"public TupleRefBuilder bindings( VarBinding... bindings)\n {\n for( VarBinding binding : bindings)\n {\n tupleRef_.addVarBinding( binding);\n }\n return this;\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 comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
takes a screenshot of the users desktop (Currently Win only) | [
"def screenshot(fname):\n \n try:\n im = ImageGrab.grab()\n im.save(fname)\n except Exception as ex:\n print('image_tools.screenshot:cant create screenshot ' + str(ex))"
] | [
"def document_agents(p):\n \n p.comment('agent.py', 'base agent class')\n p.comment('run_agents.py', 'Top level function to run the agents')\n \n p.comment('agent_image_metadata.py', 'agent to collect file picture metadata')\n p.comment('agent_learn_aixi.py', '')\n p.comment('dummy_learn_1.py',... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Encode method calls.
@param Definition $definition The current definition.
@param Encoder $encoder The encoder.
@param EncodeValueEvent $event The event.
@return void | [
"private function handleMethodCalls(Definition $definition, Encoder $encoder, EncodeValueEvent $event)\n {\n $hash = spl_object_hash($definition);\n\n if (!isset(static::$encodedMethods[$hash])) {\n static::$encodedMethods[$hash] = true;\n\n foreach ($definition->getMethodCall... | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Gets rotated point
@param {Object} b
@param {Object} a
@param {Number} bRadius
@returns {Object} | [
"function rotateGlobe(b, a, bRadius) {\n var br, brp, alat, acos, asin, bx, by, bz;\n\n // Get modified coordinates of 'b' by rotating the globe so\n // that 'a' is at lat=0, lng=0\n br = { lat: b.lat, lng: (b.lng - a.lng), elv:b.elv };\n brp = locationToPoint(br);\n\n // scale all the coordinates based on th... | [
"function(other, t) {\n var newpos = this.pos.lerp(other.pos, t);\n return new CSG.Vertex(newpos);\n }"
] | codesearchnet | {
"query": "Represent the Github comment about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
Return the start and end position of pairs of brackets.
https://stackoverflow.com/questions/29991917/
indices-of-matching-parentheses-in-python | [
"def _find_bracket_position(self, text, bracket_left, bracket_right,\r\n pos_quote):\r\n \r\n pos = {}\r\n pstack = []\r\n\r\n for idx, character in enumerate(text):\r\n if character == bracket_left and \\\r\n not self.is_char_i... | [
"def gen_part_from_iterables(iterables: Iterable[Any],\n part_index: int) -> Generator[Any, None, None]:\n \n\n \"\"\"\n # RST: make part of word bold/italic:\n # https://stackoverflow.com/questions/12771480/part-of-a-word-bold-in-restructuredtext # noqa\n for iterable in ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns content type for a file extension. If no suitable content types
are found, 'application/octet-stream' is used as the default content type
@param {String} extension Extension to be checked for
@return {String} File extension | [
"function detectMimeType() {\n var extension = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n extension = extension.toString().toLowerCase().replace(/\\s/g, '').replace(/^\\./g, '');\n\n if (!(extension in _listExtensions.extensions)) {\n return 'application/octet-stream';\n }\n\... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic boolean eIsSet(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.ESG__REG_NAME:\n\t\t\t\treturn REG_NAME_EDEFAULT == null ? regName != null : !REG_NAME_EDEFAULT.equals(regName);\n\t\t}\n\t\treturn super.eIsSet(featureID);\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the sentence about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Binary subtraction with broadcsting.
Args:
x1: a Tensor
x2: a Tensor
output_shape: an optional Shape
name: an optional string
Returns:
a Tensor | [
"def sub(x1, x2, output_shape=None, name=None):\n \n output_shape = convert_to_shape(output_shape)\n if not isinstance(x2, Tensor):\n return ScalarAddOperation(x1, -x2).outputs[0]\n with tf.name_scope(name, default_name=\"sub\"):\n x1, x2 = binary_arguments_to_tensors(x1, x2)\n return add(x1, negative(... | [
"def remove(self, x):\n \n with tf.name_scope(\"pad_reduce/remove\"):\n x_shape = x.get_shape().as_list()\n x = tf.gather_nd(\n x,\n indices=self.nonpad_ids,\n )\n if not tf.executing_eagerly():\n # This is a hack but for some reason, gather_nd return a tensor of\n... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
// SetHsmConfigurations sets the HsmConfigurations field's value. | [
"func (s *DescribeHsmConfigurationsOutput) SetHsmConfigurations(v []*HsmConfiguration) *DescribeHsmConfigurationsOutput {\n\ts.HsmConfigurations = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Blurs an image
@param int $method One of blue methods: GAUSSIAN_BLUR or SELECTIVE_BLUR
@return Imagery this object | [
"public function blur($method = self::GAUSSIAN_BLUR) {\n\t\tif (!in_array($method, array(self::GAUSSIAN_BLUR, self::SELECTIVE_BLUR)))\n\t\t\treturn false;\n\t\timagefilter($this->resource, $method);\n\t\treturn $this;\n\t}"
] | [
"function( rgbEq, alphaEq ){\n this._dat[ 0|BLEND_EQ_C] = rgbEq;\n this._dat[ 0|BLEND_EQ_A ] = alphaEq;\n this._set |= BLEND_EQ_SET | BLEND_EQ_A_SET;\n return this;\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:"
} |
/* (non-Javadoc)
@see com.ibm.ws.sib.mfp.control.ControlDecisionExpected#getTick() | [
"public final long[] getTick() {\n List<Long> list = (List<Long>)jmo.getField(ControlAccess.BODY_DECISIONEXPECTED_TICK);\n\n long lists[] = new long[list.size()];\n\n for (int i = 0; i < lists.length; i++)\n lists[i] = list.get(i).longValue();\n\n return lists;\n }"
] | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
All of the magic together. | [
"def main(unusedargv):\n \"\"\"\"\"\"\n del unusedargv\n\n bt_table = (bigtable\n .Client(FLAGS.cbt_project, admin=True)\n .instance(FLAGS.cbt_instance)\n .table(FLAGS.cbt_table))\n assert bt_table.exists(), \"Table doesn't exist\"\n\n # Get current game c... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
处理编译时间记录标签
@param string $content
原模板内容
@return void | [
"protected function processBuildTime(string &$content): void\n {\n $pattern = $this->getTagPattern('build_time');\n $content = preg_replace_callback($pattern, function ($match) {\n return '<?php /*模板编译于' . date('Y-m-d H:i:s') . '*/ ?>';\n }, $content);\n }"
] | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the instruction about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
// Build validates the configuration options provided then builds the command | [
"func (builder *ResetBucketCommandBuilder) Build() (Command, error) {\n\tif builder.protobuf == nil {\n\t\tpanic(\"builder.protobuf must not be nil\")\n\t}\n\tif err := validateLocatable(builder.protobuf); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ResetBucketCommand{protobuf: builder.protobuf}, nil\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Retrieve an authenticating user
get '/users/self'
Returns a single authenticating user, according to the authentication credentials provided
@param array $options Additional request's options.
@return array Resource object. | [
"public function self(array $options = array())\n {\n list($code, $resource) = $this->httpClient->get(\"/users/self\", null, $options);\n return $resource;\n }"
] | [
"def attributes_properties(**options)\n options_set = Set.new options.keys.map(&:to_s)\n\n unless options_set.subset? Set.new(@fields)\n fail \"You have to provide correct attribute names in\" +\n \"'attributes_properties' for '#{@model}'.\"\n end\n\n # TODO: Check for valid v... | codesearchnet | {
"query": "Represent the Github instruction about accounts.authinfo:",
"pos": "Represent the Github code about accounts.authinfo:",
"neg": "Represent the Github code:"
} |
Convenince method for creating a
shared memory numpy array based on a CloudVolume
and Bbox. c.f. sharedmemory.ndarray for information
on the optional lock parameter. | [
"def bbox2array(vol, bbox, order='F', readonly=False, lock=None, location=None):\n \"\"\"\"\"\"\n location = location or vol.shared_memory_id\n shape = list(bbox.size3()) + [ vol.num_channels ]\n return ndarray(shape=shape, dtype=vol.dtype, location=location, \n readonly=readonly, lock=lock, order=order)"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
//
// OPERATIONS
// The following methods perform operations on Schemas.
//
// IsEmpty returns true if no members of the Schema are specified. | [
"func (schema *Schema) IsEmpty() bool {\n\treturn (schema.Schema == nil) &&\n\t\t(schema.ID == nil) &&\n\t\t(schema.MultipleOf == nil) &&\n\t\t(schema.Maximum == nil) &&\n\t\t(schema.ExclusiveMaximum == nil) &&\n\t\t(schema.Minimum == nil) &&\n\t\t(schema.ExclusiveMinimum == nil) &&\n\t\t(schema.MaxLength == nil) &... | [
"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:"
} |
Get the type from the row in case it was not set
@param array $row Loaded row
@return string Data type for the row | [
"protected function getFieldType(array &$row)\n {\n if (isset($row[$this->_modelField]) && ($row[$this->_modelField] === self::APPOINTMENTS_NAME)) {\n return 'appointment';\n }\n\n if (isset($row['gtf_id_field']) && $row['gtf_id_field']) {\n $row[\\Gems_Model::FIELD_ID]... | [
"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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software Development:"
} |
Parameterizes the local strategy fields of a channel such that the channel produces the desired local properties.
@param channel The channel to parameterize. | [
"public void parameterizeChannel(Channel channel) {\n\t\tif (this.ordering != null) {\n\t\t\tchannel.setLocalStrategy(LocalStrategy.SORT, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections());\n\t\t} else if (this.groupedFields != null) {\n\t\t\tboolean[] dirs = new boolean[this.groupedFields.... | [
"@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:"
} |
// NewHasParentQuery creates and initializes a new has_parent query. | [
"func NewHasParentQuery(parentType string, query Query) *HasParentQuery {\n\treturn &HasParentQuery{\n\t\tquery: query,\n\t\tparentType: parentType,\n\t}\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 Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software Development:"
} |
构建运行时缓存
@param string $runtimeFile 如果为空则默认为runtime.cache
@return void | [
"public static function buildRuntime($runtimeFile = null)\n {\n /**\n * 处理列类型和大小\n *\n * @param \\Imi\\Model\\Annotation\\Column $column\n * @return [$type, $size]\n */\n $parseColumnTypeAndSize = function($column) {\n $type = $column->type;\n ... | [
"function addEntries(env, webpackConfig) {\n // 指定入口的 js 文件和 html 文件的路径, 默认相对于 src 目录(根目录)\n wieldyWebpack.createEntry('index.js', 'index.html', {\n env: env,\n\n // 如果有多个入口, 则在创建时需要设置 setChunks 为 true\n // setChunks: true,\n\n // 多项目时需要修改 src 目录的根目录\n srcBase: 'src/' + env.... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Execute the given callback while selecting the given columns.
After running the callback, the columns are reset to the original value.
@param array $columns
@param callable $callback
@return mixed | [
"protected function onceWithColumns($columns, $callback)\n {\n $original = $this->columns;\n\n if (is_null($original)) {\n $this->columns = $columns;\n }\n\n $result = $callback();\n\n $this->columns = $original;\n\n return $result;\n }"
] | [
"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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software Development:"
} |
Gives back the serialized LogRecord as an arrays of bytes.
@return ObjectManagerByteArrayOutputStream[] the buffers containing the serialized LogRecord. | [
"protected ObjectManagerByteArrayOutputStream[] getBuffers()\n throws ObjectManagerException\n {\n if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())\n trace.entry(this,\n cclass,\n \"getBuffers\");\n\n ObjectMana... | [
"@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 summarization about Java programming:",
"pos": "Represent the Github code about Java programming:",
"neg": "Represent the Github code:"
} |
// SetLogStreams sets the LogStreams field's value. | [
"func (s *GetRelationalDatabaseLogStreamsOutput) SetLogStreams(v []*string) *GetRelationalDatabaseLogStreamsOutput {\n\ts.LogStreams = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
查询多行数据
@return array | [
"public function findAll()\n {\n $this->compile();\n $queryArr = $this->queryArr;\n return $this->connection->fetchAll(implode(\" \", $queryArr), $this->arguments);\n }"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns a bytestring version of 's', encoded as specified in 'encoding'.
If strings_only is True, don't convert (some) non-string-like objects.
from django | [
"def smart_str(s, encoding='utf-8', errors='strict'):\n \n if not isinstance(s, basestring):\n try:\n return str(s)\n except UnicodeEncodeError:\n if isinstance(s, Exception):\n # An Exception subclass containing non-ASCII data that doesn't\n #... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Return the distribution name with version.
If for_filename is true, return a filename-escaped form. | [
"def _get_name_and_version(name, version, for_filename=False):\n \"\"\"\"\"\"\n if for_filename:\n # For both name and version any runs of non-alphanumeric or '.'\n # characters are replaced with a single '-'. Additionally any\n # spaces in the version string become '.'\n name = _... | [
"def get_docs_url(self, role, name):\n \n\n # Expand partial names to full names\n name = self.get_full_name(role, name)\n # Look up domain corresponding to role\n dom = IntersphinxInventory.roledomain[role]\n # Get the inventory entry tuple corresponding to the name\n ... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Adds to a "GROUP BY" clause
@param string[] $expression,... A variable list of expressions of what to group by
@return self For method chaining | [
"public function addGroupBy(string ...$expression) : self\n {\n $this->groupByClauses = array_merge($this->groupByClauses, $expression);\n\n return $this;\n }"
] | [
"public function compileUpdateLabels(Builder $query, $labels, $operation = 'add' )\n {\n if(trim(strtolower($operation)) == 'add')\n {\n $updateType = 'SET';\n } else\n {\n $updateType = 'REMOVE';\n }\n // Each one of the columns in the update state... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Refetch instance data from the API. | [
"def refresh(self):\n '''\n '''\n response = requests.get('%s/categories/%s' % (API_BASE_URL, self.name))\n attributes = response.json()\n \n self.ancestors = [Category(name) for name in attributes['ancestors']]\n self.contents = WikiText(attributes['contents_raw'],\n ... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@param string $uri
@param string $query
@param \Seat\Eseye\Containers\EsiResponse $data
@return void | [
"public function set(string $uri, string $query, EsiResponse $data)\n {\n\n if ($this->is_memcached)\n $this->memcached->set($this->buildCacheKey($uri, $query), serialize($data), 0);\n else\n $this->memcached->set($this->buildCacheKey($uri, $query), serialize($data), $this->fl... | [
"public function beforeSend(\\Mmi\\Http\\Request $request)\n {\n //pobranie odpowiedzi\n $response = \\Mmi\\App\\FrontController::getInstance()->getResponse();\n //zmiana contentu\n $response->setContent((new \\Cms\\Model\\ContentFilter($response->getContent()))->getFilteredContent())... | codesearchnet | {
"query": "Represent the Github summarization about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Programming:"
} |
Query Asterisk Manager Interface to initialize internal list of
supported channel types.
CLI Command - core show applications | [
"def _initChannelTypesList(self):\n \n if self.checkVersion('1.4'):\n cmd = \"core show channeltypes\"\n else:\n cmd = \"show channeltypes\"\n cmdresp = self.executeCommand(cmd)\n self._chantypes = set()\n for line in cmdresp.splitlines()[2:]:\n ... | [
"def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Manipulates the content String and removes leading and trailing white spaces.<p>
@param save if set to true, the content parameter is not updated
@return the prepared content String | [
"@Override\n protected String prepareContent(boolean save) {\n\n String content = getParamContent().trim();\n // ensure all chars in the content are valid for the selected encoding\n content = CmsEncoder.adjustHtmlEncoding(content, getFileEncoding());\n if (!save) {\n setPa... | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Method to add visibility classes to widget wrapper based on ACF field
@return void | [
"protected function visibilityClasses()\n {\n if (!$this->get_field('widget_header_visibility') || !is_array($this->get_field('widget_header_visibility')) || empty($this->get_field('widget_header_visibility'))) {\n return false;\n }\n\n $options = array(\n 'xs' => 'hidd... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetName sets the Name field's value. | [
"func (s *PutPlaybackConfigurationInput) SetName(v string) *PutPlaybackConfigurationInput {\n\ts.Name = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Executes a JavaScript action.
@param jsExpressionable $js
@return $this | [
"public function send($js)\n {\n $this->_output_bypass = true;\n $this->sse->send($js);\n $this->_output_bypass = false;\n\n return $this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Secrets takes name of the imageStream, and returns the corresponding corev1.SecretList object, and an error if there is any. | [
"func (c *imageStreams) Secrets(imageStreamName string, options v1.GetOptions) (result *corev1.SecretList, err error) {\n\tresult = &corev1.SecretList{}\n\terr = c.client.Get().\n\t\tNamespace(c.ns).\n\t\tResource(\"imagestreams\").\n\t\tName(imageStreamName).\n\t\tSubResource(\"secrets\").\n\t\tVersionedParams(&op... | [
"func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\... | codesearchnet | {
"query": "Represent the post 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.