query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Destroy the client | [
"def destroy(self):\n \n if self.client:\n #: Stop listening\n self.client.setWebView(self.widget, None)\n del self.client\n super(AndroidWebView, self).destroy()"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Returns an array [ most recent date, oldest date ] (Time instances). | [
"def range\n\n now = Time.now\n\n [ (Time.parse(@history.first['seen_at']) rescue now),\n (Time.parse(@history.last['seen_at']) rescue now) ]\n end"
] | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
If a default grandchild template ID is set then that is returned.
Otherwise the current template ID of this page is returned. | [
"public function getDefaultGrandchildTemplateId(): int\n {\n $grandchildTemplateId = $this->getGrandchildTemplateId();\n\n return empty($grandchildTemplateId) ? $this->getTemplateId() : (int) $grandchildTemplateId;\n }"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Language and programming:"
} |
Sets multiselect option.
When multiselect is set to true, multiple choices can be answered.
@param bool $multiselect
@return $this | [
"public function setMultiselect($multiselect)\n {\n $this->multiselect = $multiselect;\n $this->setValidator($this->getDefaultValidator());\n\n return $this;\n }"
] | [
"public function updateConfigOptions()\n {\n //search the config menu for our item\n $options = $this->searchMenu($this->name);\n\n //override the config's options\n $this->getConfig()->setOptions($options);\n }"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Action `ssecfg`. Is used to get configuration for SSE object
@throws BadRequestException if request is not `AJAX`, or not `POST`
or not `JSON`
@return void | [
"public function ssecfg() {\n\t\tConfigure::write('debug', 0);\n\t\tif (!$this->request->is('ajax') || !$this->request->is('post') ||\n\t\t\t!$this->RequestHandler->prefers('json')) {\n\t\t\tthrow new BadRequestException();\n\t\t}\n\n\t\t$data = $this->ConfigTheme->getSseConfig();\n\t\t$this->set(compact('data'));\... | [
"def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
Say hello to the parent class. | [
"public function ActiveCollabDatabaseStructureBehaviourPositionInterfaceImplementation()\n {\n $this->registerEventHandler('on_before_save', function () {\n if (!$this->getPosition()) {\n $table_name = $this->connection->escapeTableName($this->getTableName());\n $c... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return number of deployment threads.
To populate the dropdown list from the jelly:
<j:forEach var="r" items="${server.deploymentsThreads}"> | [
"@SuppressWarnings(\"unused\")\n public List<Integer> getDeploymentsThreads() {\n List<Integer> items = new ArrayList<>();\n for (int i = 1; i <= 10; i++) {\n items.add(i);\n }\n return items;\n }"
] | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetGroupId sets the GroupId field's value. | [
"func (s *CreateIpGroupOutput) SetGroupId(v string) *CreateIpGroupOutput {\n\ts.GroupId = &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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// Here is the broker task. It uses the zmq_proxy function to switch
// messages between frontend and backend: | [
"func BrokerTask() {\n\t// Prepare our sockets\n\tfrontend, _ := zmq.NewSocket(zmq.DEALER)\n\tfrontend.Bind(\"tcp://*:5555\")\n\tbackend, _ := zmq.NewSocket(zmq.DEALER)\n\tbackend.Bind(\"tcp://*:5556\")\n\tzmq.Proxy(frontend, backend, 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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// sprintIfExists prints a pretty line if value exists | [
"func sprintIfExists(n string, v string) {\n\tif v != \"\" {\n\t\tfmt.Printf(\"----> %s: %s\\n\", n, v)\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 text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Installs virtual environment | [
"def install_virtualenv(parser_args):\n \n python_version = '.'.join(str(v) for v in sys.version_info[:2])\n sys.stdout.write('Installing Python {0} virtualenv into {1} \\n'.format(python_version, VE_ROOT))\n if sys.version_info < (3, 3):\n install_virtualenv_p2(VE_ROOT, python_version)\n else... | [
"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:"
} |
return the file name for spectral templates | [
"def spectral_template(self, **kwargs):\n \n kwargs_copy = self.base_dict.copy()\n kwargs_copy.update(**kwargs)\n localpath = NameFactory.spectral_template_format.format(**kwargs_copy)\n if kwargs.get('fullpath', False):\n return self.fullpath(localpath=localpath)\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Output a page update that will display messages in the flash | [
"def output_admin_messages(fields = nil, title = '', options = { :class => 'notify-box' }, flash_only = false)\n output_errors_ajax('admin-messages', title, options, fields, flash_only)\n end"
] | [
"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:"
} |
Intermediate operation returning a Stream of elements chunks of the specified size obtained
from this Stream (the last chunk may be smaller).
@param chunkSize
the chunk size, positive
@return a Stream wrapping this Stream and returning chunks of elements | [
"public final Stream<List<T>> chunk(final int chunkSize) {\n synchronized (this.state) {\n checkState();\n return new ChunkStream<T>(this, chunkSize);\n }\n }"
] | [
"@Override\n\tprotected org.apache.flink.api.common.operators.SingleInputOperator<T, T, ?> translateToDataFlow(Operator<T> input) {\n\t\t// All the translation magic happens when the iteration end is encountered.\n\t\tthrow new InvalidProgramException(\"A data set that is part of an iteration was used as a sink or ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about language and writing:"
} |
/*
Caret position has changed, remove the highlight | [
"private void resetHighlight()\n\t{\n\t\t// Use invokeLater to make sure updates to the Document are completed,\n\t\t// otherwise Undo processing causes the modelToView method to loop.\n\n\t\tSwingUtilities.invokeLater(new Runnable()\n\t\t{\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tint ... | [
"function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Given a credential definition identifier, return its schema sequence number.
Raise BadIdentifier on input that is not a credential definition identifier.
:param cd_id: credential definition identifier
:return: sequence number | [
"def cred_def_id2seq_no(cd_id: str) -> int:\n \n\n if ok_cred_def_id(cd_id):\n return int(cd_id.split(':')[3]) # sequence number is token at 0-based position 3\n raise BadIdentifier('Bad credential definition identifier {}'.format(cd_id))"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// NewRepoBuilder is the only way to get a pre-built RepoBuilder | [
"func NewRepoBuilder(gun data.GUN, cs signed.CryptoService, trustpin trustpinning.TrustPinConfig) RepoBuilder {\n\treturn NewBuilderFromRepo(gun, NewRepo(cs), trustpin)\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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
a quick query to check whether the Image is ready for rendering
@public
@param {Image} aImage
@return {boolean} | [
"function isReady(aImage) {\n\n // first check : load status\n if (typeof aImage.complete === \"boolean\" && !aImage.complete) return false;\n\n // second check : validity of source (can be 0 until bitmap has been fully parsed by browser)\n return !(typeof aImage.naturalWidth !== \"undef... | [
"@SuppressWarnings(\"unused\") // called through reflection by RequestServer\n public FramesV3 delete(int version, FramesV3 frames) {\n Frame frame = getFromDKV(\"key\", frames.frame_id.key()); // safe\n frame.delete(); // lock & remove\n return frames;\n }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Parses the statements defined by the tokens list.
@param Parser $parser the instance that requests parsing
@param TokensList $list the list of tokens to be parsed | [
"public function parse(Parser $parser, TokensList $list)\n {\n /**\n * Array containing all list of clauses parsed.\n * This is used to check for duplicates.\n *\n * @var array\n */\n $parsedClauses = [];\n\n // This may be corrected by the parser.\n ... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Remove a row from the cellmap.
@param Frame | [
"function remove_row(Frame $row) {\n\n $key = $row->get_id();\n if ( !isset($this->_frames[$key]) )\n return; // Presumably this row has alredy been removed\n\n $this->_row = $this->_num_rows--;\n\n $rows = $this->_frames[$key][\"rows\"];\n $columns = $this->_frames[$key][\"columns\"];\n\n /... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Recalculate dynamic property values
@param {any} entity Entity instance
@param {any} properties Entity's properties' configuration
@memberof EnTTExt | [
"function recalculateAllDynamicProperties (entity, properties) {\n // Find all dynamic properties\n _.forEach(properties, (propertyConfiguration, propertyName) => {\n if (isDynamicProperty(propertyConfiguration)) {\n // Recalculate dynamic property value\n const dynamicValue = propertyConfiguration.d... | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Get the Data
@param string $table
@return Array | [
"public function getData($table, $max, $exclude = null, $orderBy = null, $direction = 'ASC')\n {\n $result = \\DB::connection($this->databaseName)->table($table);\n\n if (!empty($exclude)) {\n $allColumns = \\DB::connection($this->databaseName)->getSchemaBuilder()->getColumnListing($tabl... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
if sender is self.tree_gui_settings this will open a filedialog and ask for a filepath
this filepath will be updated in the field of self.tree_gui_settings that has been double clicked | [
"def edit_tree_item(self):\n \n\n def open_path_dialog_folder(path):\n \"\"\"\n opens a file dialog to get the path to a file and\n \"\"\"\n dialog = QtWidgets.QFileDialog()\n dialog.setFileMode(QtWidgets.QFileDialog.Directory)\n dialog... | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetServiceSetting sets the ServiceSetting field's value. | [
"func (s *ResetServiceSettingOutput) SetServiceSetting(v *ServiceSetting) *ResetServiceSettingOutput {\n\ts.ServiceSetting = 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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
将 key 中储存的数字值增一。
如果 key 不存在,那么 key 的值会先被初始化为 0 ,然后再执行 INCR 操作。
如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。
本操作的值限制在 64 位(bit)有符号数字表示之内。 | [
"public Long incr(Object key) {\r\n\t\tJedis jedis = getJedis();\r\n\t\ttry {\r\n\t\t\treturn jedis.incr(keyToBytes(key));\r\n\t\t}\r\n\t\tfinally {close(jedis);}\r\n\t}"
] | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about text processing:"
} |
Apply filters to array
@param array $settings
@return void
@throws Grid\GridException | [
"private function applyFilters(array $settings): void\n {\n $data = $this->getSource();\n $data = array_filter(\n $data,\n function ($row) use ($settings) {\n foreach ($settings as $column => $filters) {\n foreach ($filters as $filter => $valu... | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Create a client builder for JSON values.
@return The builder | [
"public static <T> MemcachedClientBuilder<T> newJsonClient(final ObjectMapper objectMapper, final Class<T> valueType) {\n return newClient(new JsonTranscoder<>(objectMapper, valueType));\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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Controller::getArticle hook
@param \Database_Result $row module database result
@return void | [
"public static function getArticleHook($row)\n\t{\n\t\tif (! static::checkLogin()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$cssId = \\StringUtil::deserialize($row->cssID, true);\n\t\t$cssId[1] = trim($cssId[1] . ' rsfh-article-' . $row->id . '-' . bin2hex($row->inColumn ?: ''));\n\t\t$row->cssID = serialize($cssId);\n\t}"
] | [
"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 post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Shutdown the send/event threads. This method should not be called
directly - rather it should be called as part of close operation. This
method is primarily here to allow the tests to verify disconnection
behavior. | [
"public void disconnect() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Disconnecting client for session: 0x\"\n + Long.toHexString(getSessionId()));\n }\n\n sendThread.close();\n eventThread.queueEventOfDeath();\n }"
] | [
"def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Returns a quoted version of the given table, index or column name. Does
not quote the given name if it's already been quoted. | [
"def quote_name(self, name):\n \n if name.startswith(self.left_sql_quote) and name.endswith(self.right_sql_quote):\n return name # Quoting once is enough.\n return '%s%s%s' % (self.left_sql_quote, name, self.right_sql_quote)"
] | [
"def generate(options, command: nil)\n # First, enable `always_trace`, to show the stack trace\n always_trace!\n\n used_switches = []\n options.each do |option|\n next if option.description.to_s.empty? # \"private\" options\n next unless option.display_in_shell\n\n short_swi... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Use this API to delete dnssuffix resources of given names. | [
"public static base_responses delete(nitro_service client, String Dnssuffix[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (Dnssuffix != null && Dnssuffix.length > 0) {\n\t\t\tdnssuffix deleteresources[] = new dnssuffix[Dnssuffix.length];\n\t\t\tfor (int i=0;i<Dnssuffix.length;i++){\n\t\t\t\tdelet... | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
// Quantile returns the nth quantile from the latency summary. | [
"func (l LatencyMetrics) Quantile(nth float64) time.Duration {\n\tl.init()\n\treturn time.Duration(l.estimator.Get(nth))\n}"
] | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Return true if the type is considered a whitespace type for the line break rules. | [
"private static boolean isWhitespace(byte biditype) {\n switch (biditype) {\n case LRE:\n case RLE:\n case LRO:\n case RLO:\n case PDF:\n case BN:\n case WS:\n return true;\n default:\n retur... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Add returns the result of a + b for each named resource | [
"func Add(a corev1.ResourceList, b corev1.ResourceList) corev1.ResourceList {\n\tresult := corev1.ResourceList{}\n\tfor key, value := range a {\n\t\tquantity := *value.Copy()\n\t\tif other, found := b[key]; found {\n\t\t\tquantity.Add(other)\n\t\t}\n\t\tresult[key] = quantity\n\t}\n\tfor key, value := range b {\n\t... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
The method is submitting dataset upload | [
"def upload_submit(self, upload_request):\r\n \"\"\"\"\"\"\r\n\r\n path = '/api/1.0/upload/save'\r\n return self._api_post(definition.DatasetUploadResponse, path, upload_request)"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
将 HTML 颜色(如 #0099FF)转换为 RGB 三个整数的数组
@param string $sColor
@static
@access protected
@return array | [
"protected static function _colorRGB($sColor) {\n\t\t$sError = 'unknown color \"'.$sColor.'\"';\n\t\t$sColor = strtolower($sColor);\n\n\t\t$sColorOrig = $sColor;\n\n\t\t$sColor = preg_replace('/^#/', '', $sColor);\n\t\tif (strlen($sColor) > 6 || !preg_match('#^[0-9a-f]+$#', $sColor)) {\n\t\t\tthrow new TangoExcepti... | [
"static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// QueryRowxContext this NamedStmt. Because of limitations with QueryRow, this is
// an alias for QueryRow.
// Any named placeholder parameters are replaced with fields from arg. | [
"func (n *NamedStmt) QueryRowxContext(ctx context.Context, arg interface{}) *Row {\n\treturn n.QueryRowContext(ctx, arg)\n}"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@param \Darvin\ContentBundle\Widget\WidgetInterface $widget Widget
@return string
@throws \Darvin\ContentBundle\Widget\Embedder\Exception\HttpException | [
"private function getWidgetContent(WidgetInterface $widget)\n {\n if (!isset($this->widgetContents[$widget->getName()])) {\n try {\n $this->widgetContents[$widget->getName()] = $widget->getContent();\n } catch (KernelHttpException $ex) {\n throw new Http... | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
根据用户账号密码,登录用户
@param mixed $data
@return array | [
"public function login($data)\n {\n // 1. 校验用户账号密码是否符合规则\n $validator = wei()->validate([\n 'data' => $data,\n 'rules' => [\n 'username' => [\n 'required' => true,\n ],\n 'password' => [\n 'requ... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the text about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
// SetUserStorage sets the UserStorage field's value. | [
"func (s *WorkspaceBundle) SetUserStorage(v *UserStorage) *WorkspaceBundle {\n\ts.UserStorage = 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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Populates an object's attributes using the provided dict | [
"def populate_obj(obj, attrs):\n \n for k, v in attrs.iteritems():\n setattr(obj, k, v)"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Lists all User models.
@return mixed | [
"public function actionIndex()\n {\n $request = \\Yii::$app->request;\n if ($request->getIsOptions()) {\n return $this->ResponseOptions($this->verbs()['index']);\n }\n try{\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about File management:"
} |
Gets existing config files.
@return the existing config files | [
"private List<File> getConfigFiles() {\n\n String[] filenames = {\n \"opencms-modules.xml\",\n \"opencms-system.xml\",\n \"opencms-vfs.xml\",\n \"opencms-importexport.xml\",\n \"opencms-sites.xml\",\n \"opencms-variables.xml\",\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
/* (non-Javadoc)
@see org.apereo.portal.portlets.lookup.IPersonLookupHelper#findPerson(org.apereo.portal.security.IPerson, java.lang.String) | [
"@Override\n public IPersonAttributes findPerson(final IPerson searcher, final String username) {\n\n // get the IAuthorizationPrincipal for the searching user\n final IAuthorizationPrincipal principal = getPrincipalForUser(searcher);\n\n // build a set of all possible user attributes the cu... | [
"private void checkAuthorization(Action action) throws NotAuthorizedException {\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tMap<String, List<String>> httpHeaders = (Map<String, List<String>>) wsContext.getMessageContext().get(MessageContext.HTTP_REQUEST_HEADERS);\n\t\tString clientApplicationName = httpHeaders.get(A... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about PHP:"
} |
// Run runs the command to get platforms. | [
"func (c *GetPlatformsCmd) Run(app subcommands.Application, args []string, env subcommands.Env) int {\n\tctx := cli.GetContext(app, c, env)\n\tclient := getClient(ctx)\n\tresp, err := client.ListPlatforms(ctx, &c.req)\n\tif err != nil {\n\t\terrors.Log(ctx, err)\n\t\treturn 1\n\t}\n\tprintPlatforms(c.f.tsv, resp.Pl... | [
"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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Technology:"
} |
Wrap an AST Call node to lambda expression node.
call: ast.Call node | [
"def make_lambda(call):\n \n empty_args = ast.arguments(args=[], vararg=None, kwarg=None, defaults=[])\n return ast.Lambda(args=empty_args, body=call)"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Remove an array of body style classes from the itemBody of all qti items in given class
@param array $styleNames
@param core_kernel_classes_Class $itemClass
@param boolean $recursive | [
"public function removeClassBodyStyles($styleNames, core_kernel_classes_Class $itemClass, $recursive = true){\n $updatedItems = [];\n $items = $itemClass->getInstances($recursive);\n foreach($items as $item){\n if($this->isQtiItem($item)){\n if($this->removeBodyStyles(... | [
"function storeObjectAttribute( $contentObjectAttribute )\n {\n $page = $contentObjectAttribute->content();\n $contentObjectAttribute->setAttribute( 'data_text', $page->toXML() );\n return true;\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Retrieve the regular expression to check the value against.
@return string | [
"public function regexp()\n {\n if ($this->regexp === null) {\n $this->regexp = self::DEFAULT_REGEXP;\n }\n\n return $this->regexp;\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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Open the HID device for reading and writing. | [
"def open(self):\n \n if self._is_open:\n raise HIDException(\"Failed to open device: HIDDevice already open\")\n\n path = self.path.encode('utf-8')\n dev = hidapi.hid_open_path(path)\n\n if dev:\n self._is_open = True\n self._device = dev\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Checks if socket connected. Can be extended with pings | [
"func (kea *KamEvapi) Connected() bool {\n\tkea.connMutex.RLock()\n\tdefer kea.connMutex.RUnlock()\n\tif kea.conn == nil {\n\t\treturn false\n\t}\n\treturn 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 text about Networking:",
"pos": "Represent the code about Networking:",
"neg": "Represent the code about programming:"
} |
Returns all the commerce tier price entries where uuid = ? and companyId = ?.
@param uuid the uuid
@param companyId the company ID
@return the matching commerce tier price entries | [
"public static List<CommerceTierPriceEntry> findByUuid_C(String uuid,\n\t\tlong companyId) {\n\t\treturn getPersistence().findByUuid_C(uuid, companyId);\n\t}"
] | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
//WriteBytes writes []byte value to w io.Writer | [
"func WriteBytes(w io.Writer, data []byte, offset int, count int) error {\n\n\t_, err := w.Write(data[offset : offset+count])\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}"
] | [
"func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return distribution full name with - replaced with _ | [
"def wheel_dist_name(self):\n \"\"\"\"\"\"\n components = (safer_name(self.distribution.get_name()),\n safer_version(self.distribution.get_version()))\n if self.build_number:\n components += (self.build_number,)\n return '-'.join(components)"
] | [
"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:"
} |
Format the where clause statements into one string.
@param \Illuminate\Database\Query\Builder $query
@param array $sql
@return string | [
"protected function concatenateWhereClauses($query, $sql)\n {\n $conjunction = $query instanceof JoinClause ? 'on' : 'where';\n\n return $conjunction.' '.$this->removeLeadingBoolean(implode(' ', $sql));\n }"
] | [
"public function sqlStatement(CompilerInterface $compiler = null): string\n {\n if (empty($compiler)) {\n $compiler = clone $this->compiler;\n }\n\n if (!$compiler instanceof PostgresCompiler) {\n throw new BuilderException('Postgres InsertQuery can be used only with Po... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
Reverses part of an array. See {@link #reverse(int[])}
@param order The array containing the data to reverse.
@param offset Where to start reversing.
@param length How many elements to reverse | [
"@SuppressWarnings(\"WeakerAccess\")\n public static void reverse(int[] order, int offset, int length) {\n for (int i = 0; i < length / 2; i++) {\n int t = order[offset + i];\n order[offset + i] = order[offset + length - i - 1];\n order[offset + length - i - 1] = t;\n ... | [
"public static int[] stride(INDArray arr, INDArrayIndex[] indexes, int... shape) {\n List<Integer> strides = new ArrayList<>();\n int strideIndex = 0;\n //list of indexes to prepend to for new axes\n //if all is encountered\n List<Integer> prependNewAxes = new ArrayList<>();\n\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Close this table. | [
"public void close()\n {\n super.close(); // Write the current record, etc.\n\n try {\n if (this.lockOnDBTrxType(null, DBConstants.AFTER_REFRESH_TYPE, false)) // AFTER_REFRESH_TYPE = Close since there is no close\n this.unlockIfLocked(this.getRecord(), null); // Relea... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Create the document collection for a mapped class.
@throws InvalidArgumentException | [
"public function createDocumentCollection(string $documentName, ?int $maxTimeMs = null, ?WriteConcern $writeConcern = null) : void\n {\n $class = $this->dm->getClassMetadata($documentName);\n\n if ($class->isMappedSuperclass || $class->isEmbeddedDocument || $class->isQueryResultDocument) {\n ... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Adds a best carbon copy
@param string $bcc Email address to send to
@return \Email | [
"public function addBcc($bcc) {\n $this->bcc = (!empty($this->bcc)) ? $this->bcc . ',' . $bcc : $bcc;\n return $this;\n }"
] | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about Programming:"
} |
Marshall the given parameter object. | [
"public void marshall(ShareDirectoryRequest shareDirectoryRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (shareDirectoryRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(sh... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Convert an array of integers to a string
@param array<int, int> $integers
@return string | [
"public static function intArrayToString(array $integers): string\n {\n $args = $integers;\n foreach ($args as $i => $v) {\n $args[$i] = (int) ($v & 0xff);\n }\n return \\pack(\n \\str_repeat('C', \\count($args)),\n ...$args\n );\n }"
] | [
"public List<Integer> getPositiveIntegerList(final String param) {\n return getList(param, new StringToInteger(),\n new IsPositive<Integer>(), \"positive integer\");\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Execute the Command
@access protected
@param InputInterface $input
@param OutputInterface $output | [
"protected function execute(InputInterface $input, OutputInterface $output) {\n\t\tif (!file_exists(\\Skeleton\\Database\\Migration\\Config::$migration_directory)) {\n\t\t\tthrow new \\Exception('Config::$migration_directory is not set to a valid directory');\n\t\t}\n\n\t\t$name = $input->getArgument('name');\n\n\t... | [
"public function runTransient(InputInterface $input=null,\n OutputInterface $output=null\n ) {\n $this->printLn(\"Vagrant Transient Version: \".$this->getVersion(), 'normal');\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get Segment
Gets the nth segment
@param integer $number
@return string|null | [
"public static function getSegment($number) {\n $segments = self::getAllSegments();\n\n if (isset($segments[$number]))\n return $segments[$number];\n\n return NULL;\n }"
] | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Set user's country.
\public
\static | [
"static function setUserCountry( $user, $country )\n {\n $userObject = $user->attribute( 'contentobject' );\n $requireUserCountry = eZVATManager::isUserCountryRequired();\n $countryAttributeName = eZVATManager::getUserCountryAttributeName( $requireUserCountry );\n if ( $countryAttribu... | [
"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:"
} |
// PredicatePushDown implements LogicalPlan PredicatePushDown interface. | [
"func (p *LogicalJoin) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan) {\n\tsimplifyOuterJoin(p, predicates)\n\tvar equalCond []*expression.ScalarFunction\n\tvar leftPushCond, rightPushCond, otherCond, leftCond, rightCond []expression.Expression\n\tswitch p.J... | [
"private AbstractPlanNode handleUnionLimitOperator(AbstractPlanNode root) {\n // The coordinator's top limit graph fragment for a MP plan.\n // If planning \"order by ... limit\", getNextUnionPlan()\n // will have already added an order by to the coordinator frag.\n // This is the only l... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Wraps hidden states in new Variables, to detach them from their history. | [
"def repackage_hidden(self, h):\n \"\"\"\"\"\"\n if isinstance(h, Variable):\n return torch.tensor(h.data, device=h.device)\n else:\n return tuple(self.repackage_hidden(v) for v in h)"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Converts seconds to some more user friendly string.
@static
@param int $seconds
@return string | [
"protected static function get_duration_text($seconds) {\n if (empty($seconds)) {\n return get_string('none');\n }\n $data = self::parse_seconds($seconds);\n switch ($data['u']) {\n case (60*60*24*7):\n return get_string('numweeks', '', $data['v']);\n... | [
"def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get password
If no password has been set, this method will
set and return a default password, if any such
value is available
@see getDefaultPassword()
@return PasswordBroker|null password or null if none password has been set | [
"public function getPassword(): ?PasswordBroker\n {\n if (!$this->hasPassword()) {\n $this->setPassword($this->getDefaultPassword());\n }\n return $this->password;\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
alert, prompt, and confirm behave as if the OK button is always clicked. | [
"@Override\n\tpublic void handlePopups() {\n\t\t/*\n\t\t * try { executeJavaScript(\"window.alert = function(msg){return true;};\" +\n\t\t * \"window.confirm = function(msg){return true;};\" +\n\t\t * \"window.prompt = function(msg){return true;};\"); } catch (CrawljaxException e) {\n\t\t * LOGGER.error(\"Handling ... | [
"function getTargetInstForInputEventPolyfill(topLevelType, targetInst, nativeEvent) {\n if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {\n // On the selectionchange event, the target is just document which isn't\n // helpful for us so just check act... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// IsAmazonFIPSUSEastWestEndpoint - Match if it is exactly Amazon S3 FIPS US East/West endpoint.
// See https://aws.amazon.com/compliance/fips. | [
"func IsAmazonFIPSUSEastWestEndpoint(endpointURL url.URL) bool {\n\tif endpointURL == sentinelURL {\n\t\treturn false\n\t}\n\tswitch endpointURL.Host {\n\tcase \"s3-fips.us-east-2.amazonaws.com\":\n\tcase \"s3-fips.dualstack.us-west-1.amazonaws.com\":\n\tcase \"s3-fips.dualstack.us-west-2.amazonaws.com\":\n\tcase \... | [
"public static List<Image> describeAllImages() {\n // pass any credentials as aws-mock does not authenticate them at all\n AWSCredentials credentials = new BasicAWSCredentials(\"foo\", \"bar\");\n AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);\n\n // the mock endpoin... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Validates the return type and registers an error if there is one.
@param array|null $returnTypes
@throws CodeWarning
@return void | [
"private function validateReturnType(?array $returnTypes): void\n {\n if (!$returnTypes) {\n $returnTypes = [];\n }\n\n $fixableTypes = $this->loadFixableTypes($returnTypes);\n\n if (count($returnTypes) === count($fixableTypes)) {\n // Make sure this var is only ... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
根据name获取头信息
@param name Header名
@return Header值 | [
"public String header(Header name) {\r\n\t\tif(null == name) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn header(name.toString());\r\n\t}"
] | [
"public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {\n String[] arr = nsAtZealotId.split(ZealotConst.SP_AT);\n if (arr.length != LEN) {\n throw new ValidFailException(\"nsAtZealotId参数的值必须是xml文件中的 nameSpace + '@@' + zealotId 节点的值,\"\n + \"如:'stu... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software Development:"
} |
hidden function to merge the list of results into one
dictionary and 'normalize' the time stamps | [
"def _merge_results(self):\n\t\t\n\t\tnew_dict = {}\n\t\tfor it in self.data:\n\t\t\tnew_dict.update(it)\n\n\t\tfor k,v in new_dict.items():\n\t\t\tfor kk, vv in v.time_stamps.items():\n\t\t\t\tfor kkk,vvv in vv.items():\n\t\t\t\t\tnew_dict[k].time_stamps[kk][kkk] = vvv - self.HB_config['time_ref']\n\n\t\tself.data... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"func (in *ServiceAccountRestriction) DeepCopyInto(out *ServiceAccountRestriction) {\n\t*out = *in\n\tif in.ServiceAccounts != nil {\n\t\tin, out := &in.ServiceAccounts, &out.ServiceAccounts\n\t\t*out = make([]ServiceAccountReference, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Namespaces != nil {\n\t\tin, out := ... | [
"func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Retry the job.
Args:
**kwargs: Extra options to send to the server (e.g. sudo)
Raises:
GitlabAuthenticationError: If authentication is not correct
GitlabJobRetryError: If the job could not be retried | [
"def retry(self, **kwargs):\n \n path = '%s/%s/retry' % (self.manager.path, self.get_id())\n self.manager.gitlab.http_post(path)"
] | [
"def send(self, method=\"GET\", *args, **kwargs):\n \n proxies = self._get_request_proxies()\n\n try:\n if method.upper() in self.allowed_methods:\n kwargs['timeout'] = kwargs['timeout'] if 'timeout' in kwargs else 5\n return request(method, proxies=prox... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
Returns description of method parameters
@return external_function_parameters
@since Moodle 2.7
@deprecated Moodle 3.2 MDL-51373 - Please do not call this function any more.
@see gradereport_user_external::get_grade_items for a similar function | [
"public static function get_grades_parameters() {\n return new external_function_parameters(\n array(\n 'courseid' => new external_value(PARAM_INT, 'id of course'),\n 'component' => new external_value(\n PARAM_COMPONENT, 'A component, for example mo... | [
"public function build() {\n\n // Define the task contextid (the course one)\n $this->contextid = context_course::instance($this->get_courseid())->id;\n\n // We always try to restore as much info from sections as possible, no matter of the type\n // of restore (new, existing, deleting, i... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// NewCounter returns a counter. Observations are aggregated and emitted once
// per write invocation. | [
"func (g *Graphite) NewCounter(name string) *Counter {\n\tc := NewCounter(g.prefix + name)\n\tg.mtx.Lock()\n\tg.counters[g.prefix+name] = c\n\tg.mtx.Unlock()\n\treturn c\n}"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
} |
Copy a string several times
@param string $content Content to copy
@param int $coef Coefficient
@return string The result of opy
@method copyContent | [
"final private function copyContent(string $content, int $coef):string\n {\n $str = \"\";\n for ($i = 0; $i < $coef; $i++) {\n $str = $str.$content;\n }\n return ($str);\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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
IDE information
@return void | [
"protected function ide()\n {\n foreach ($this->readdmesg() as $line) {\n if (preg_match('/^(.*) at pciide[0-9]+ (.*): <(.*)>/', $line, $ar_buf)) {\n $dev = new HWDevice();\n $dev->setName($ar_buf[3]);\n if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_S... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Renders a new menu
@param string|null $customTemplate
@return string the menu's HTML | [
"public function render($customTemplate = null)\n {\n $items = $this->generateItems($this->items);\n\n return $this->theme->render(\n $customTemplate,\n ['items' => $items, 'class' => $this->class],\n 'menu'\n );\n }"
] | [
"protected function configureFormer()\n {\n // Use Bootstrap 3\n Config::set('former.framework', 'TwitterBootstrap3');\n\n // Reduce the horizontal form's label width\n Config::set('former.TwitterBootstrap3.labelWidths', []);\n\n // Change Former's required field HTML\n ... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// EncodeToNode Converts an element to a node.
// element -> nodes | [
"func EncodeToNode(element interface{}) (*Node, error) {\n\trValue := reflect.ValueOf(element)\n\tnode := &Node{Name: \"traefik\"}\n\n\terr := setNodeValue(node, rValue)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn node, nil\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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Create a translation.
@param string $projectKey
@param string $keyId
@param string $content
@param array $params
@return TranslationCreated|ResponseInterface | [
"public function create(string $projectKey, string $localeId, string $keyId, string $content, array $params = [])\n {\n $params['locale_id'] = $localeId;\n $params['key_id'] = $keyId;\n $params['content'] = $content;\n\n $response = $this->httpPost(sprintf('/api/v2/projects/%s/transla... | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the description about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str | [
"def do_execute(self):\n \n fname = str(self.input.payload)\n spattern = str(self.resolve_option(\"regexp\"))\n pattern = None\n if (spattern is not None) and (spattern != \".*\"):\n pattern = re.compile(spattern)\n if (pattern is None) or (pattern.match(fname)):... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
/*
separate different state scope using action's key | [
"function copifyReducer(reducer) {\n return (state, action) => {\n // every action has a specific key\n const { key } = action\n // MAYBE it's redux INIT action when in combineReducers, state is undefined\n // and reducer(state, action) will generate defaultState\n if (key === undefined) {\n /*... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
If request_id is set in flask.g, add it to log record. | [
"def filter(self, record):\n \"\"\"\"\"\"\n if g and hasattr(g, 'request_id'):\n record.request_id = g.request_id\n return True"
] | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
TODO: also consider the other steps | [
"Optional<SQLPPMapping> loadPPMapping(Supplier<Optional<File>> mappingFileSupplier,\n Supplier<Optional<Reader>> mappingReaderSupplier,\n Supplier<Optional<Graph>> mappingGraphSupplier)\n throws MappingIOException, InvalidMap... | [
"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 post about writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code about programming:"
} |
Run the database seeds.
@return void | [
"public function run(Factory $factory, Generator $faker)\n {\n $factory->define(\\App\\Http\\Node\\Model\\CategoryExampleModel::class, function () use ($faker) {\n\n return [\n 'url' => $faker->domainWord,\n 'title' => $faker->text($maxNbChars = 20),\n ... | [
"public function run(array $args)\n {\n Index::info('Help Menu');\n Index::info('- `eve generate <schema*> <namespace>` Generates files based on schema');\n Index::info('- `eve database <schema*>` Generates database table/s schema');\n Index::info('- `eve install` ... | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software Development:"
} |
// NewRequestBodyOrReference creates an object of type RequestBodyOrReference if possible, returning an error if not. | [
"func NewRequestBodyOrReference(in interface{}, context *compiler.Context) (*RequestBodyOrReference, error) {\n\terrors := make([]error, 0)\n\tx := &RequestBodyOrReference{}\n\tmatched := false\n\t// RequestBody request_body = 1;\n\t{\n\t\tm, ok := compiler.UnpackMap(in)\n\t\tif ok {\n\t\t\t// errors might be ok he... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is... | codesearchnet | {
"query": "Represent the post about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
Push the recorded changes to disk, notify all the listeners | [
"async def commit(self, snap):\n '''\n \n '''\n if not self.npvs: # nothing to do\n return\n\n for node, prop, _, valu in self.npvs:\n node.props[prop.name] = valu\n node.proplayr[prop.name] = snap.wlyr\n\n splices = [snap.splice('node:add'... | [
"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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
@deprecated
@param LocalizablePackageInterface $package
@param string|null $locale
@param \Zend\I18n\Translator\Translator|'current' $translator | [
"public function setupLocalization(LocalizablePackageInterface $package, $locale = null, $translator = 'current')\n {\n if ($translator === 'current') {\n $translator = $this->localization->getActiveTranslateObject();\n }\n if (is_object($translator)) {\n $locale = (str... | [
"public function createService(ServiceLocatorInterface $serviceLocator)\n {\n if ($serviceLocator instanceof ServiceLocatorAwareInterface) {\n $serviceLocator = $serviceLocator->getServiceLocator();\n }\n\n /** @var \\Zend\\View\\HelperPluginManager $viewHelperManager */\n ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// SetVlan sets the Vlan field's value. | [
"func (s *NewPrivateVirtualInterface) SetVlan(v int64) *NewPrivateVirtualInterface {\n\ts.Vlan = &v\n\treturn s\n}"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
@param OperatorNode $node
@return string | [
"private function getMethodName(OperatorNode $node)\n {\n if ($node->hasData('mode')) {\n $mode = $node->getData('mode');\n } else {\n $mode = 'get';\n }\n\n switch ($mode) {\n case 'has':\n return 'hasProperty';\n\n default:\... | [
"@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 text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
ensure storage pool is absent on the system
name : string
name of storage pool
export : boolean
export instread of destroy the zpool if present
force : boolean
force destroy or export | [
"def absent(name, export=False, force=False):\n '''\n \n\n '''\n ret = {'name': name,\n 'changes': {},\n 'result': None,\n 'comment': ''}\n\n # log configuration\n log.debug('zpool.absent::%s::config::force = %s', name, force)\n log.debug('zpool.absent::%s::config:... | [
"def add_device(self, device, container):\n \n # There is a size tag which the JSS manages for us, so we can\n # ignore it.\n if self.findtext(\"is_smart\") == \"false\":\n self.add_object_to_path(device, container)\n else:\n # Technically this isn't true. It... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Remove children
@param \Coral\ContentBundle\Entity\Node $children | [
"public function removeChild(\\Coral\\ContentBundle\\Entity\\Node $children)\n {\n $this->children->removeElement($children);\n }"
] | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code:"
} |
Same as django.views.generic.edit.ProcessFormView.get(), but adds test cookie stuff | [
"def get(self, request, *args, **kwargs):\n \n self.set_test_cookie()\n return super(LoginView, self).get(request, *args, **kwargs)"
] | [
"def render_item(self, contentitem):\n \n render_language = get_render_language(contentitem)\n with smart_override(render_language):\n # Plugin output is likely HTML, but it should be placed in mark_safe() to raise awareness about escaping.\n # This is just like Django's I... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// interpolationFuncList creates a list from the parameters passed
// to it. | [
"func interpolationFuncList() ast.Function {\n\treturn ast.Function{\n\t\tArgTypes: []ast.Type{},\n\t\tReturnType: ast.TypeList,\n\t\tVariadic: true,\n\t\tVariadicType: ast.TypeAny,\n\t\tCallback: func(args []interface{}) (interface{}, error) {\n\t\t\tvar outputList []ast.Variable\n\n\t\t\tfor i, val := r... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Action around image with defined configuration | [
"public void execInternal(@Nonnull final DockerClient client, @Nonnull final String imageName, TaskListener listener)\n throws IOException {\n PrintStream llog = listener.getLogger();\n\n if (shouldPullImage(client, imageName)) {\n LOG.info(\"Pulling image '{}'. This may take awh... | [
"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:"
} |
// newDeleteMemberHandler returns a handler func for a DELETE to /members or /owners endpoints | [
"func newDeleteMemberHandler(b MemberBackend) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tctx := r.Context()\n\n\t\treq, err := decodeDeleteMemberRequest(ctx, r)\n\t\tif err != nil {\n\t\t\tEncodeError(ctx, err, w)\n\t\t\treturn\n\t\t}\n\n\t\tif err := b.UserResourceMappingServi... | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Natural Language Processing:"
} |
Get a {@link Collector} that calculates the <code>ANY()</code> function. | [
"public static <T> Collector<T, ?, Boolean> anyMatch(Predicate<? super T> predicate) {\n return collectingAndThen(noneMatch(predicate), t -> !t);\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
load the article list and store it in $this->oList.
@return int - number of items found | [
"protected function LoadArticleList()\n {\n if (is_null($this->oList)) {\n parent::LoadArticleList();\n if (!is_null($this->oList) && '1' == $this->global->GetUserData(TdbPkgShopListfilter::URL_PARAMETER_IS_NEW_REQUEST)) {\n TdbShop::ResetAllRegisteredActiveVariantsFor... | [
"def QA_fetch_index_list_adv(collections=DATABASE.index_list):\n '''\n \n '''\n index_list_items = QA_fetch_index_list(collections)\n if len(index_list_items) == 0:\n print(\"QA Error QA_fetch_index_list_adv call item for item in collections.find() return 0 item, maybe the DATABASE.index_list ... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Get dominant color of image
@param Asset|string $image
@param int $quality
@param string $colorValue
@return string|array|boolean|null | [
"public function getDominantColor($image, $quality, $colorValue)\n {\n try {\n $source = new LocalSourceImageModel($image);\n $source->getLocalCopy();\n } catch (ImagerException $e) {\n return null;\n }\n\n $dominantColor = ColorThief::getColor($source... | [
"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:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.