query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// NoReplyWait ensures that previous queries with the noreply flag have been
// processed by the server. Note that this guarantee only applies to queries
// run on the given connection | [
"func (s *Session) NoReplyWait() error {\n\ts.mu.RLock()\n\tdefer s.mu.RUnlock()\n\n\tif s.closed {\n\t\treturn ErrConnectionClosed\n\t}\n\n\treturn s.cluster.Exec(nil, Query{ // nil = connection opts' defaults\n\t\tType: p.Query_NOREPLY_WAIT,\n\t})\n}"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
check the VAT identification number, country version for Luxembourg.
@param pvatId vat id to check
@return true if checksum is ok | [
"private boolean checkLuVatId(final String pvatId) {\r\n final int numberPart = Integer.parseInt(pvatId.substring(2, 8));\r\n final int checkSum = Integer.parseInt(pvatId.substring(8));\r\n final int calculatedCheckSum = numberPart % 89;\r\n return checkSum == calculatedCheckSum;\r\n }"
] | [
"private void required(String attributeName, String attributValue) throws ApplicationException {\n\tif (StringUtil.isEmpty(attributValue))\n\t throw new ApplicationException(\"invalid attribute constellation for the tag zip\", \"attribute [\" + attributeName + \"] is required, if action is [\" + action + \"]\");... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Build raw envelope.
@return string | [
"private function _buildRaw()\n {\n $boundary = md5(uniqid(rand(), true));\n $raw_message = 'From: ' . $this->_encodeHeader($this->_source) . \"\\n\";\n if (!empty($this->_to)) {\n $raw_message .= 'To: ' . $this->_encodeHeader($this->_to) . \"\\n\";\n }\n if (!empty(... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Add untracked files.
@param mixed $files Files to be added to the repository | [
"public function add($files = '.')\n {\n if (is_array($files)) {\n $files = implode(' ', array_map('escapeshellarg', $files));\n } else {\n $files = escapeshellarg($files);\n }\n\n $this->getClient()->run($this, \"add $files\");\n\n return $this;\n }"
] | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Creates and adds a text node
@param root:Element Root element
@param name:str Tag name
@param value:object Text value
@param cdata:bool A value indicating whether to use CDATA or not.
@return:Node | [
"def _create_text_node(self, root, name, value, cdata=False):\n '''\n \n '''\n if is_empty_or_none(value):\n return\n\n if type(value) == date:\n value = date_to_string(value)\n\n if type(value) == datetime:\n value = datetime_to_string(valu... | [
"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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Get request parameters for redirect url. | [
"def get_redirect_args(self, request, callback):\n \"\"\n callback = force_text(request.build_absolute_uri(callback))\n raw_token = self.get_request_token(request, callback)\n token, secret = self.parse_raw_token(raw_token)\n if token is not None and secret is not None:\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Dispatch the next available middleware and return the response.
@param ServerRequestInterface $request
@return ResponseInterface
@SuppressWarnings("Unused")
@throws NotFoundExceptionInterface | [
"public function process(ServerRequestInterface $request): ResponseInterface\n {\n /** @var Middleware $middleware */\n $middleware = current($this->middlewares);\n next($this->middlewares);\n\n // return $middleware->process($request, $this);\n try {\n $response = $... | [
"private static function publishThrowable(string $eventClass, string $errorMessage, KernelContext $context): \\Generator\n {\n /**\n * @noinspection VariableFunctionsUsageInspection\n *\n * @var \\ServiceBus\\Services\\Contracts\\ExecutionFailedEvent $event\n */\n $e... | 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:"
} |
// Register sets a specific decoder to be used for the specified content types. If a decoder is
// already registered, it is overwritten. | [
"func (decoder *HTTPDecoder) Register(f DecoderFunc, contentTypes ...string) {\n\tp := newDecodePool(f)\n\n\tfor _, contentType := range contentTypes {\n\t\tmediaType, _, err := mime.ParseMediaType(contentType)\n\t\tif err != nil {\n\t\t\tmediaType = contentType\n\t\t}\n\t\tdecoder.pools[mediaType] = p\n\t}\n}"
] | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Check browser is in private browsing mode or not
@return {Boolean} | [
"function isPrivateBrowsingMode () {\n try {\n localStorage.setItem(TEST_KEY, '1')\n localStorage.removeItem(TEST_KEY)\n return false\n } catch (error) {\n return true\n }\n}"
] | [
"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 sentence about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code:"
} |
Ask for confirmation, given a ``prompt`` and return a boolean value. | [
"def confirm(prompt):\n \n while True:\n try:\n answer = input(prompt)\n except KeyboardInterrupt:\n # the user presses ctrl+c, just say 'no'\n return False\n answer = answer.strip().lower()\n if answer not in ('y', 'n'):\n print('Please ... | [
"def get_value(self, context):\n \"\"\"\"\"\"\n if self.value:\n return expressions.eval_string(self.value, context)\n else:\n # Empty input raises cryptic EOF syntax err, this more human\n # friendly\n raise ValueError('!py string expression is empty... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"func (in *ExternalMetricValueList) DeepCopyInto(out *ExternalMetricValueList) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tout.ListMeta = in.ListMeta\n\tif in.Items != nil {\n\t\tin, out := &in.Items, &out.Items\n\t\t*out = make([]ExternalMetricValue, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCop... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return all stats for variants of randomly selected questions for one slot $slot.
@param int $slot The slot no.
@return calculated[] The instances storing the calculated stats. | [
"protected function all_subq_variants_for_one_slot($slot) {\n $toreturn = array();\n $displayorder = 1;\n foreach ($this->for_slot($slot)->get_sub_question_ids() as $subqid) {\n if ($variants = $this->for_subq($subqid)->get_variants()) {\n foreach ($variants as $varian... | [
"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 Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get search text from repeater blocks
@param null|string $content
@return null|string | [
"public function generateSearchText($content)\r\n {\r\n $searchText = '';\r\n $repeaterRows = PageBlockRepeaterData::loadRepeaterData($content, $this->_block->getVersionId());\r\n $repeaterBlocks = BlockRepeater::getRepeaterBlocks($this->_block->id);\r\n\r\n foreach ($repeaterRows as ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns true if a variable is declared in this or any parent scope. | [
"public final boolean hasSlot(String name) {\n S scope = thisScope();\n while (scope != null) {\n if (scope.hasOwnSlot(name)) {\n return true;\n }\n scope = scope.getParent();\n }\n return false;\n }"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// Set encryption key for the current segment of media playlist (pointer to Segment.Key) | [
"func (p *MediaPlaylist) SetKey(method, uri, iv, keyformat, keyformatversions string) error {\n\tif p.count == 0 {\n\t\treturn errors.New(\"playlist is empty\")\n\t}\n\n\t// A Media Playlist MUST indicate a EXT-X-VERSION of 5 or higher if it\n\t// contains:\n\t// - The KEYFORMAT and KEYFORMATVERSIONS attributes o... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
//makes a hash out of an double | [
"static int hash(double d) {\n\t\tlong bits = Double.doubleToLongBits(d);\n\t\tint hc = (int) (bits ^ (bits >>> 32));\n\t\treturn hash(hc);\n\t}"
] | [
"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:"
} |
// SetBaselineId sets the BaselineId field's value. | [
"func (s *GetDefaultPatchBaselineOutput) SetBaselineId(v string) *GetDefaultPatchBaselineOutput {\n\ts.BaselineId = &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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Directory sets the working directory of the command.
// If workingDirectory is the empty string, Run runs the command in the
// calling process's current directory. | [
"func (cmd *Cmd) Directory(workingDirectory string) *Cmd {\n\tcmd.Cmd.Dir = workingDirectory\n\treturn cmd\n}"
] | [
"def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Check if the parent node exists | [
"function create_node_in_parent(error, parentDirectoryNode) {\n if(error) {\n callback(error);\n } else if(parentDirectoryNode.type !== NODE_TYPE_DIRECTORY) {\n callback(new Errors.ENOTDIR('a component of the path prefix is not a directory', path));\n } else {\n parentNode = parentDirectoryN... | [
"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:"
} |
Return a randomly weighted sum of the force vectors.
args:
force_vectors: A list of force vectors on solution i.
returns:
numpy.array; The total force on solution i. | [
"def _gsa_total_force(force_vectors, vector_length):\n \n if len(force_vectors) == 0:\n return [0.0] * vector_length\n # The GSA algorithm specifies that the total force in each dimension\n # is a random sum of the individual forces in that dimension.\n # For this reason we sum the dimensions ... | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Convenience access to primitive type fields | [
"void setIntField(int accessor, int value) {\n try {\n jmfPart.setInt(accessor, value);\n } catch (JMFException e) {\n FFDCFilter.processException(e, \"setIntField\", \"109\", this);\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, \"setIntField failed: \... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
window property getter with easy way for XGetWindowProperty
which return nil, if the specified property name does not exist,
a String or a Array of Number | [
"def prop atom\n val, format, nitems = prop_raw atom\n case format\n when 32; val.unpack(\"l!#{nitems}\")\n when 16; val.unpack(\"s#{nitems}\")\n when 8; val[0, nitems]\n when 0; nil\n end\n end"
] | [
"def handle_key ch\n $log.debug \" KeyDispatcher GOT KEY #{ch} \"\n @keyint = ch\n @keychr = nil\n chr = nil\n chr = ch.chr if ch > 32 and ch < 127\n @keychr = chr\n\n ret = process_key ch\n # revert to the basic handling of key_map and refreshing pad.\n #####\n # ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param $aObj
@param $bObj
@return int | [
"protected function sortByName($aObj, $bObj)\n {\n $aName = class_basename($aObj);\n $bName = class_basename($bObj);\n\n return $aName < $bName ? -1 : 1;\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
build image from provided build_args
:return: BuildResults | [
"def _build(self, build_method):\n \n logger.info(\"building image '%s'\", self.image)\n self.ensure_not_built()\n self.temp_dir = tempfile.mkdtemp()\n temp_path = os.path.join(self.temp_dir, BUILD_JSON)\n try:\n with open(temp_path, 'w') as build_json:\n ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return XML for these tags. This method uses the Builder library.
The only parameter ist the builder object. | [
"def to_xml(options = {})\n xml = options[:builder] ||= Builder::XmlMarkup.new\n xml.instruct! unless options[:skip_instruct]\n each do |key, value|\n # Remove leading and trailing whitespace from tag values\n xml.tag(:k => key, :v => coder.decode(value.strip)) unless value.blank?\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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
<code>
.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata text_classification_details = 9;
</code> | [
"public com.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata\n getTextClassificationDetails() {\n if (detailsCase_ == 9) {\n return (com.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata)\n details_;\n }\n return com.google.cloud.datalab... | [
"@java.lang.Deprecated\n public java.util.Map<java.lang.String, com.google.cloud.automl.v1beta1.DataType> getFields() {\n return getFieldsMap();\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Register renderer
@param \ViKon\Parser\Renderer\Renderer $renderer | [
"public function register(Renderer $renderer) {\n $this->registerTokenRenderer(LinkInlineRule::NAME, 'renderInline', $renderer);\n $this->registerTokenRenderer(LinkReferenceRule::NAME, 'renderReference', $renderer);\n $this->registerTokenRenderer(LinkAutoRule::NAME, 'renderAuto', $renderer);\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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Query for the row where the field is like the value
@param fieldName
field name
@param value
value
@return result
@since 3.0.1 | [
"public TResult queryForLike(String fieldName, Object value) {\n\t\treturn queryForLike(fieldName, value, null, null, null);\n\t}"
] | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Load the Inbound Message handler details for a given record.
@param \stdClass $record The record to retrieve the handler for.
@return \core\message\inbound\handler or false | [
"protected static function handler_from_record($record) {\n $classname = $record->classname;\n if (strpos($classname, '\\\\') !== 0) {\n $classname = '\\\\' . $classname;\n }\n if (!class_exists($classname)) {\n return false;\n }\n\n $handler = new $cl... | [
"public function get() {\n $storeId = '';\n $requestHeaders = $this->currentRequest->headers;\n if ($requestHeaders->has('X-ACM-UUID')) {\n $storeId = $requestHeaders->get('X-ACM-UUID');\n }\n\n \\Drupal::logger('acm')->info(\"Verifying mapping for acm_uuid \" . $storeId . \".\");\n\n // Retu... | 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:"
} |
This method takes a rule and populates the ruleIndex field.
@param rule | [
"private void updateRuleIndexes(CQIE rule) {\n\t\tFunction head = rule.getHead();\n\t\truleIndex.put(head.getFunctionSymbol(), rule);\n\t\tupdateRuleIndexByBodyPredicate(rule);\n\t}"
] | [
"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 sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. | [
"func (l *License) GetHTMLURL() string {\n\tif l == nil || l.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.HTMLURL\n}"
] | [
"def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetJobArn sets the JobArn field's value. | [
"func (s *Job) SetJobArn(v string) *Job {\n\ts.JobArn = &v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Get the HTML tag to display for this button
Can be used by sub-classes to change the setup of the input tag.
@return SwatHtmlTag the HTML tag to display for this button. | [
"protected function getInputTag()\n {\n // We do not use a 'button' element because it is broken differently in\n // different versions of Internet Explorer\n\n $tag = new SwatHtmlTag('input');\n\n $tag->type = 'submit';\n $tag->name = $this->id;\n $tag->id = $this->id;\... | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Open and extract data from rpm files | [
"private boolean handleRpmFile(String innerDir, String archiveFile) {\n boolean success = true;\n File rpmFile = new File(archiveFile);\n FileInputStream rpmFIS = null;\n try {\n rpmFIS = new FileInputStream(rpmFile.getPath());\n } catch (FileNotFoundException e) {\n ... | [
"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:"
} |
Exports the inputed tree object to the given excel file.
:param tree | <QTreeWidget>
filename | <str>
:return <bool> | [
"def exportTree(self, tree, filename):\r\n \r\n book = xlwt.Workbook()\r\n \r\n # determine the title for the sheet to export\r\n title = nativestring(tree.windowTitle())\r\n if not title:\r\n title = nativestring(tree.objectName())\r\n if not title:\r\n ... | [
"def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
This parses a single crontab field and returns the data necessary for
this matcher to accept the proper values.
See the README for information about what is accepted. | [
"def _parse_crontab(self, which, entry):\n '''\n \n '''\n\n # this handles day of week/month abbreviations\n def _fix(it):\n if which in _alternate and not it.isdigit():\n if it in _alternate[which]:\n return _alternate[which][it]\n ... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Gets the refreshType value for this MasterPlaylistSettings.
@return refreshType * Indicates how the master playlist gets refreshed. This field
is optional and defaults to {@link
RefreshType#AUTOMATIC}. | [
"public com.google.api.ads.admanager.axis.v201902.RefreshType getRefreshType() {\n return refreshType;\n }"
] | [
"static void addParameterChild(Element node, String name, String value) {\n if (node != null) {\n Document doc = node.getOwnerDocument();\n Element parm = doc.createElement(Constants.ELM_PARAMETER);\n parm.setAttribute(Constants.ATT_NAME, name);\n parm.setAttribute... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// VotesOnBlock indicates if the vote is voting on the validity of block
// specified by the given hash. | [
"func (vi *VoteInfo) VotesOnBlock(blockHash string) bool {\n\treturn vi.Validation.ForBlock(blockHash)\n}"
] | [
"func validateChaincodeProposalMessage(prop *pb.Proposal, hdr *common.Header) (*pb.ChaincodeHeaderExtension, error) {\n\tif prop == nil || hdr == nil {\n\t\treturn nil, errors.New(\"nil arguments\")\n\t}\n\n\tputilsLogger.Debugf(\"validateChaincodeProposalMessage starts for proposal %p, header %p\", prop, hdr)\n\n\... | codesearchnet | {
"query": "Represent the comment about Blockchain:",
"pos": "Represent the code about Blockchain:",
"neg": "Represent the code:"
} |
******************** Methods ******************************************* | [
"@Override protected void handleEvents(final String EVENT_TYPE) {\n super.handleEvents(EVENT_TYPE);\n if (\"VISIBILITY\".equals(EVENT_TYPE)) {\n chart.setSymbolsVisible(tile.getDataPointsVisible());\n } else if (\"SERIES\".equals(EVENT_TYPE)) {\n switch(tile.getChartType()... | [
"def new_station(self, _id, callSign, name, affiliate, fccChannelNumber):\n \"\"\"\"\"\"\n\n if self.__v_station:\n # [Station: 11440, WFLX, WFLX, Fox Affiliate, 29]\n # [Station: 11836, WSCV, WSCV, TELEMUNDO (HBC) Affiliate, 51]\n # [Station: 11867, TBS, Turner Broadc... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Copies this stream to the output stream.
@param os destination stream. | [
"public void writeToStream(OutputStream os) throws IOException\n {\n if (_readLength <= _readOffset) {\n readBuffer();\n }\n\n while (_readOffset < _readLength) {\n os.write(_readBuffer, _readOffset, _readLength - _readOffset);\n\n readBuffer();\n }\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:"
} |
// Runs the command in the given context and returns any error that occurred. | [
"func runCommand(ctx context.Context, command []string) error {\n\tcmd := exec.Command(command[0], command[1:]...)\n\tcmd.Stderr = os.Stderr\n\tcmd.Stdout = os.Stdout\n\treturn cmd.Run()\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 Github instruction about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about programming:"
} |
Returns IRI, or blank node curie/iri depending on
self.skolemize_blank_node setting
:param curie: str id as curie or iri
:return: | [
"def _getnode(self, curie):\n \n if re.match(r'^_:', curie):\n if self.are_bnodes_skized is True:\n node = self.skolemizeBlankNode(curie)\n else:\n node = curie\n elif re.match(r'^http|^ftp', curie):\n node = curie\n elif len... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return the value at the given time in ``cache`` | [
"def _valcache_lookup(self, cache, branch, turn, tick):\n \"\"\"\"\"\"\n if branch in cache:\n branc = cache[branch]\n try:\n if turn in branc and branc[turn].rev_gettable(tick):\n return branc[turn][tick]\n elif branc.rev_gettable... | [
"def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value"
] | codesearchnet | {
"query": "Represent the Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Modify the response to add link to the email preview.
@param $response
@param $previewPath | [
"private function addLinkToResponse($response, $previewPath)\n {\n if (app()->runningInConsole()) {\n return;\n }\n\n $content = $response->getContent();\n\n $linkHTML = \"<div id='MailPreviewDriverBox' style='\n position:absolute;\n top:0;\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// GetIPv6NetID IPv6アドレスが所属するIPv6NetのIDを取得 | [
"func (a *IPv6Addr) GetIPv6NetID() int64 {\n\tif a.IPv6Net != nil {\n\t\treturn a.IPv6Net.ID\n\t}\n\treturn 0\n}"
] | [
"func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Add or remove the statement block from this function definition.
@param {boolean} hasStatements True if a statement block is needed.
@this Blockly.Block | [
"function(hasStatements) {\n if (this.hasStatements_ === hasStatements) {\n return;\n }\n if (hasStatements) {\n this.appendStatementInput('STACK')\n .appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_DO);\n if (this.getInput('RETURN')) {\n this.moveInputBefore('STACK', 'RETURN'... | [
"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 Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Returns a BigQuery Copy Job configuration for the given destination and source tables. | [
"public static CopyJobConfiguration of(TableId destinationTable, List<TableId> sourceTables) {\n return newBuilder(destinationTable, sourceTables).build();\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Initializes this thumbnail
@param integer $initializationCause
@return void | [
"public function initializeObject($initializationCause)\n {\n if ($initializationCause === ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED) {\n if ($this->async === false) {\n $this->refresh();\n }\n }\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
str: The IBAN formatted in blocks of 4 digits. | [
"def formatted(self):\n \"\"\"\"\"\"\n return ' '.join(self.compact[i:i + 4] for i in range(0, len(self.compact), 4))"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Retrieve all the clients for the AbstractClientStatsCollectors. | [
"def Run(self):\n \"\"\"\"\"\"\n try:\n\n self.stats = {}\n\n self.BeginProcessing()\n\n processed_count = 0\n\n for client_info_batch in _IterateAllClients(\n recency_window=self.recency_window):\n for client_info in client_info_batch:\n self.ProcessClientFullInfo... | [
"@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 instruction about computer science:",
"pos": "Represent the code about computer science:",
"neg": "Represent the code about Programming:"
} |
Dumps the given resource and all resources linked to it into the given
ZIP file. | [
"def to_zipfile(self, resource, zipfile):\n \n rpr_map = self.to_strings(resource)\n with ZipFile(zipfile, 'w') as zipf:\n for (mb_cls, rpr_string) in iteritems_(rpr_map):\n fn = get_collection_filename(mb_cls, self.__content_type)\n zipf.writestr(fn, rp... | [
"@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:"
} |
borrow a Handler instance from Modelhandler pool | [
"public ModelHandler borrowtHandlerObject(String formName) {\r\n\t\tModelHandler modelHandler = null;\r\n\t\ttry {\r\n\t\t\tmodelHandler = handlerObjectFactory.borrowHandlerObject(formName);\r\n\t\t\tmodelHandler.setModelMapping(modelFactory.getModelMapping(formName));\r\n\t\t} catch (Exception ex) {\r\n\t\t\tDebug... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Retrieve the de-serialized object
@param savePoint the save point
@param objClass the object class
@return the object the object | [
"public Object restore(String savePoint, Class<?> objClass)\r\n {\r\n\tString location = whereIs(savePoint, objClass);\r\n\t\r\n\tObject cacheObject = CacheFarm.getCache().get(location);\r\n\tif(cacheObject != null)\r\n\t return cacheObject;\r\n\t\r\n\tcacheObject = IO.deserialize(new File(location));\r\n\tCac... | [
"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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Writes at most one chunk of data. | [
"def _WritePartial(self, data):\n \"\"\"\"\"\"\n\n chunk = self.offset // self.chunksize\n chunk_offset = self.offset % self.chunksize\n data = utils.SmartStr(data)\n\n available_to_write = min(len(data), self.chunksize - chunk_offset)\n\n fd = self._GetChunkForWriting(chunk)\n fd.seek(chunk_of... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Shutdown zmq listener. | [
"def stop(self):\n '''\n \n '''\n log.info('Stopping the zmq listener class')\n self.sub.close()\n self.ctx.term()"
] | [
"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 Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Override method of class Knget | [
"def run(self, tags, begin, end=False):\n \n if not end:\n end = begin\n\n # Type `H` doesn't cast anything, so we\n # manually cast the strings end to integer.\n super(KngetShell, self).run(tags, begin, int(end))"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Retourne un composant Selectmenu
@return Selectmenu | [
"public function selectmenu($attachTo=NULL, $params=NULL) {\n\t\treturn $this->addComponent(new Selectmenu($this->js), $attachTo, $params);\n\t}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Converts the first character of the supplied string to lower case.
@param string $str String to modify
@param string $encoding The character encoding
@return string String with the first character being lower case | [
"public static function lowerCaseFirst($str, $encoding = null)\n {\n return (string) Stringy::create($str, $encoding)->lowerCaseFirst();\n }"
] | [
"def _sanitize(self, value):\n \n if isinstance(value, six.binary_type):\n value = value.decode('utf-8')\n if isinstance(value, six.text_type):\n new_value = ''.join(ch for ch in value if self._valid_char(ch))\n else:\n return value\n # The new str... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Get the changeset information with the given id. Always includes the changeset discussion.
@param id changeset id
@throws OsmAuthorizationException if not logged in
@return info for the given changeset. Null if it does not exist. | [
"public ChangesetInfo get(long id)\r\n\t{\r\n\t\tSingleElementHandler<ChangesetInfo> handler = new SingleElementHandler<>();\r\n\t\tString query = CHANGESET + \"/\" + id + \"?include_discussion=true\";\r\n\t\ttry\r\n\t\t{\r\n\t\t\tosm.makeAuthenticatedRequest(query, null, new ChangesetParser(handler));\r\n\t\t}\r\n... | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the sentence about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code about Software development:"
} |
Update the target name of constructed IndexTerm recursively | [
"private void updateIndexTermTargetName() {\n if (defaultTitle == null) {\n defaultTitle = targetFile;\n }\n for (final IndexTerm indexterm : indexTermList) {\n updateIndexTermTargetName(indexterm);\n }\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Adds to an existing bunsen model with schemas defined in the view
@param {BunsenModel} model Model to expand
@param {BunsenView} view View containing additional schema
@returns {BunsenModel} Expanded version of the model | [
"function expandModel (model, view) {\n const modelPath = new BunsenModelPath(model)\n const modelExpansions = aggregateModels(view, modelPath)\n let newModel = model\n _.forEach(modelExpansions, (propertyModel, path) => {\n newModel = addBunsenModelProperty(newModel, propertyModel, path)\n })\n return new... | [
"function initCreate (args) {\n // method name is moduleNameCreate\n var methodName = `${this.name}Create`\n // method signature is moduleName.methodname\n var methodSignature = `${this.moduleName}.${methodName}`\n // capture model to pass to function\n var model = this\n // add create method t... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Send a ping request to a lambda function.
:param awsclient:
:param function_name:
:param start_dt:
:param end_dt:
:param tail:
:return: | [
"def logs(awsclient, function_name, start_dt, end_dt=None, tail=False):\n \n log.debug('Getting cloudwatch logs for: %s', function_name)\n log_group_name = '/aws/lambda/%s' % function_name\n\n current_date = None\n start_ts = datetime_to_timestamp(start_dt)\n if end_dt:\n end_ts = datetime_... | [
"def selenol_params(**kwargs):\n \"\"\"\"\"\"\n def params_decorator(func):\n \"\"\"Param decorator.\n\n :param f: Function to decorate, typically on_request.\n \"\"\"\n def service_function_wrapper(service, message):\n \"\"\"Wrap function call.\n\n :param ser... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Color-palette popup | [
"function( popup, forecolor )\n {\n // http://stackoverflow.com/questions/17242144/javascript-convert-hsb-hsv-color-to-rgb-accurately\n var HSVtoRGB = function( h, s, v )\n {\n var r, g, b, i, f, p, q, t;\n i = Math.floor(h * 6);\n ... | [
"def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetPartitionInputList sets the PartitionInputList field's value. | [
"func (s *BatchCreatePartitionInput) SetPartitionInputList(v []*PartitionInput) *BatchCreatePartitionInput {\n\ts.PartitionInputList = 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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
通过本地文件上传
@param $filePath
@param null $key
@param string $bucket
@throws \Exception | [
"public function uploadFile($filePath, $key = null, $bucket = '')\r\n {\r\n if (!file_exists($filePath)) {\r\n throw new \\Exception(\"上传的文件不存在\",400);\r\n }\r\n $bucket = $bucket ? $bucket : $this->bucket;\r\n\r\n $uploadToken = $this->uploadToken(array('scope' => $bucket)... | [
"public function pushGitInit()\n {\n if (!isset($this->config['git_address'])) {\n Log::info('Git地址没有配置,请在Config.php文件参照如下方式配置:' );\n Log::info('$config[\\'git_address\\']=\\'git@github.com:seeruo/seeruo.github.io.git\\';','error');\n }\n $Git = new GitService($this->co... | codesearchnet | {
"query": "Represent the Github description about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Programming:"
} |
Response macro to send a response based on a payload.
@return mixed | [
"public function viewWithPayload()\n {\n return function (string $view, PayloadContract $payload, string $key = 'payload') {\n return ResponseFactory::view($view, [$key => $payload->getUnwrappedOutput()], $payload->getStatus());\n };\n }"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github post about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
Parse the HEALTHCHECK command. https://docs.docker.com/engine/reference/builder/#/healthcheck | [
"function parseHealthcheck(cmd) {\n var words = parseWords(cmd.rest),\n cmdDirectiveIndex = words.indexOf(\"CMD\"), \n noneDirectiveIndex = words.indexOf(\"NONE\");\n\n if (cmdDirectiveIndex === -1 && noneDirectiveIndex === -1) {\n cmd.error = 'A HEALTHCHECK instruction must specif... | [
"def write_login(collector, image, **kwargs):\n \"\"\"\"\"\"\n docker_api = collector.configuration[\"harpoon\"].docker_api\n collector.configuration[\"authentication\"].login(docker_api, image, is_pushing=True, global_docker=True)"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Parse the given XML string. | [
"function parseXML(xml) {\n\t\tif ( window.DOMParser == undefined && window.ActiveXObject ) {\n\t\t\tDOMParser = function() { };\n\t\t\tDOMParser.prototype.parseFromString = function( xmlString ) {\n\t\t\t\tvar doc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\tdoc.async = 'false';\n\t\t\t\tdoc.loadXML( xmlStrin... | [
"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:"
} |
Display the status text.
@param strMessage The message to display. | [
"public void setStatus(int iStatus)\n {\n if (m_iconArea != null)\n {\n if ((iStatus == Cursor.WAIT_CURSOR) && (BaseApplet.getSharedInstance() != null))\n m_iconArea.setIcon(BaseApplet.getSharedInstance().loadImageIcon(ThinMenuConstants.WAIT));\n else\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 Localization:",
"pos": "Represent the code about Localization:",
"neg": "Represent the code about programming:"
} |
Retrieve the dashboard's widgets.
@param callable $widgetCallback A callback applied to each widget.
@return UiItemInterface[]|\Generator | [
"public function widgets(callable $widgetCallback = null)\n {\n $widgets = $this->widgets;\n\n $gridStack = $this->gridStack() ?: [];\n $parsedGridStack = [];\n\n array_walk($gridStack, function ($item) use (&$parsedGridStack) {\n $parsedGridStack[$item['id']] = $item;\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 description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software Development:"
} |
Lists all the items in a container to stdout. | [
"def handle(self, *args, **options):\n \n self._connection = Auth()._get_connection()\n\n if len(args) == 0:\n containers = self._connection.list_containers()\n if not containers:\n print(\"No containers were found for this account.\")\n elif len(args... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
// XXX_OneofFuncs is for the internal use of the proto package. | [
"func (*SharedCriterion) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _SharedCriterion_OneofMarshaler, _SharedCriterion_OneofUnmarshaler, _SharedCriterion_OneofSize... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
/*
(non-Javadoc)
@see org.restcomm.protocols.ss7.isup.ISUPMessageImpl#decodeMandatoryVariableBody(byte [], int) | [
"protected void decodeMandatoryVariableBody(ISUPParameterFactory parameterFactory, byte[] parameterBody, int parameterIndex)\n throws ParameterException {\n switch (parameterIndex) {\n case _INDEX_V_RangeAndStatus:\n RangeAndStatus ras = parameterFactory.createRangeAndSta... | [
"@Override\n public void onUnstructuredSSRequest(UnstructuredSSRequest unstrReqInd) {\n if (logger.isDebugEnabled()) {\n logger.debug(String.format(\"Rx UnstructuredSSRequestIndication. USSD String=%s \", unstrReqInd.getUSSDString()));\n }\n MAPDialogSupplementary mapDialog = unst... | codesearchnet | {
"query": "Represent the Github description about Java programming:",
"pos": "Represent the Github code about Java programming:",
"neg": "Represent the Github code:"
} |
// HasFields tests if an object has all of the specified fields. An object has a field if
// it has the specified key and that key maps to a non-null value. For instance,
// the object `{'a':1,'b':2,'c':null}` has the fields `a` and `b`. | [
"func (t Term) HasFields(args ...interface{}) Term {\n\treturn constructMethodTerm(t, \"HasFields\", p.Term_HAS_FIELDS, args, map[string]interface{}{})\n}"
] | [
"function validateDoc(lines) {\n expect(lines.length).toBe(18);\n\n // First line should be overall comment with preamble\n expect(lines[0]).toBe('\\t * Test object comment');\n\n // Second line should be a newline with preamble\n expect(lines[1]).toBe('\\t * ');\n\n /* Third line should be first parameter de... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Helper function that returns a dictionary of all DateFields or
DateTimeFields in the given model. If self.field_names is set,
it takes that into account when building the dictionary. | [
"def field_dict(self, model):\n \n if self.field_names is None:\n return dict([(f.name, f) for f in model._meta.fields\n if isinstance(f, models.DateField)])\n else:\n return dict([(f.name, f)\n for f in model._meta.fields\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
///////////////////////////////////////////////////////// | [
"protected JKTableRecord createEmptyRecord() {\r\n\t\tfinal JKTableRecord record = new JKTableRecord();\r\n\t\trecord.addEmptyValues(this.tableColumns);\r\n\t\trecord.setStatus(RecordStatus.NEW);\r\n\t\treturn record;\r\n\t}"
] | [
"public static function ws()\n {\n if (!isset(self::core()->soap)) {\n //====================================================================//\n // WEBSERVICE INITIALISATION\n //====================================================================//\n // Initial... | codesearchnet | {
"query": "Represent the description about language and writing:",
"pos": "Represent the code about language and writing:",
"neg": "Represent the code:"
} |
manages options when called from command line | [
"def main(args=None):\n \n parser = ArgumentParser(usage=__usage__)\n parser.add_argument(\"--no-skip-hidden\", action=\"store_false\",\n dest=\"skip_hidden\",\n help=\"Do not skip hidden files. \"\n \"Use this if you know what you are do... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Environment returns a list of environment variables which are needed to make
// BPF programs and tc aware of the actual BPFFS mount path. | [
"func Environment() []string {\n\treturn append(\n\t\tos.Environ(),\n\t\tfmt.Sprintf(\"CILIUM_BPF_MNT=%s\", GetMapRoot()),\n\t\tfmt.Sprintf(\"TC_BPF_MNT=%s\", GetMapRoot()),\n\t)\n}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. | [
"func (in *ClusterList) DeepCopy() *ClusterList {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ClusterList)\n\tin.DeepCopyInto(out)\n\treturn out\n}"
] | [
"func (resource *Flag) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Flag\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Flag), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*resource)\n}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// ReportError records a DSL error for reporting post DSL execution. | [
"func ReportError(fm string, vals ...interface{}) {\n\tvar suffix string\n\tif cur := ctxStack.Current(); cur != nil {\n\t\tif ctx := cur.Context(); ctx != \"\" {\n\t\t\tsuffix = fmt.Sprintf(\" in %s\", ctx)\n\t\t}\n\t} else {\n\t\tsuffix = \" (top level)\"\n\t}\n\terr := fmt.Errorf(fm+suffix, vals...)\n\tfile, lin... | [
"@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 description about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about programming:"
} |
Validate a colormap
Parameters
----------
val: str or :class:`mpl.colors.Colormap`
Returns
-------
str or :class:`mpl.colors.Colormap`
Raises
------
ValueError | [
"def validate_cmap(val):\n \"\"\"\"\"\"\n from matplotlib.colors import Colormap\n try:\n return validate_str(val)\n except ValueError:\n if not isinstance(val, Colormap):\n raise ValueError(\n \"Could not find a valid colormap!\")\n return val"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Load application bundled services.
:return: <void> | [
"def _loadViperServices(self):\n \n servicesPath = os.path.join(\n os.path.dirname(os.path.realpath(__file__)),\n \"service\"\n )\n for serviceFile in os.listdir(servicesPath):\n if serviceFile.startswith(\"__\") or serviceFile.startswith(\".\"):\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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// shad Double Sha256 Hash; sha256(sha256(data)) | [
"func shad(data []byte) []byte {\n\th1 := sha256.Sum256(data)\n\th2 := sha256.Sum256(h1[:])\n\treturn h2[:]\n}"
] | [
"public static String mix(String string, int key) {\n return ascii(JavaEncrypt.base64(xor(string, key)), key);\n }"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about text processing:"
} |
// Action triggers the action passed to it. | [
"func (mod *mastodonBee) Action(action bees.Action) []bees.Placeholder {\n\touts := []bees.Placeholder{}\n\n\tswitch action.Name {\n\tcase \"toot\":\n\t\tvar text string\n\t\taction.Options.Bind(\"text\", &text)\n\n\t\t// Post status toot on mastodon\n\t\tstatus, err := mod.client.PostStatus(context.Background(), &... | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Assumes a 3D Numpy array, and reshapes like
arr.reshape((arr.shape[0], arr.shape[1]*arr.shape[2]))
This is useful for converting processed data from `complex_to_power`
and from `autocorrelation` into a 2D array for image analysis and display. | [
"def reshape_to_2d(arr):\n '''\n \n\n '''\n return arr.reshape((arr.shape[0], arr.shape[1]*arr.shape[2]))"
] | [
"def getCSD (lfps,sampr,minf=0.05,maxf=300,norm=True,vaknin=False,spacing=1.0):\n \n datband = getbandpass(lfps,sampr,minf,maxf)\n if datband.shape[0] > datband.shape[1]: # take CSD along smaller dimension\n ax = 1\n else:\n ax = 0\n # can change default to run Vaknin on bandpass filtered LFPs before cal... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return the first document matching the filter | [
"def one(cls, filter=None, **kwargs):\n \"\"\"\"\"\"\n from mongoframes.queries import Condition, Group, to_refs\n\n # Flatten the projection\n kwargs['projection'], references, subs = \\\n cls._flatten_projection(\n kwargs.get('projection', cls._default... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Closes out annotations. | [
"private void finishValue()\n {\n final ContainerInfo current = currentContainer();\n if (current != null && current.type == ContainerType.ANNOTATION)\n {\n // close out and patch the length\n popContainer();\n }\n hasWrittenValuesSinceFinished = true;\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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Encrypt password using a salt and multiple SHA512 rounds Override for password strength checking - password: password string - repeat: password repeat, optional Provides: {pass:,salt:,ok:,why:} use why if password too weak | [
"function cmd_encrypt_password(args, done) {\n // 128 bits of salt\n var salt = args.salt || create_salt()\n var password = args.password\n\n hasher(pepper + password + salt, options.rounds, function(pass) {\n done(null, { ok: true, pass: pass, salt: salt })\n })\n }"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Panic is equivalent to Log() followed by a call to panic(). | [
"func Panic(a ...interface{}) {\n\tLog(a...)\n\tpanic(strings.TrimSpace(fmt.Sprintln(a...)))\n}"
] | [
"func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Computer Science:"
} |
Feature SIB0112b.mp.1 | [
"public final void restore(List<DataSlice> dataSlices)\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(tc, \"restore\", dataSlices);\n\n try\n {\n DataSlice slice = dataSlices.get(0);\n\n ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputSt... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
rubocop: disable Metrics/MethodLength, Metrics/AbcSize | [
"def load_target\n target = super\n return unless target\n return target if inversed\n\n time = owner.logidze_requested_ts\n\n if target.is_a? Array\n target.map! do |object|\n object.at(time: time)\n end.compact!\n else\n target.at!(time: time)\n end... | [
"public Configuration withDifferenceListener(DifferenceListener differenceListener) {\n return new Configuration(tolerance, options, ignorePlaceholder, matchers, pathsToBeIgnored, differenceListener);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Prepends the given entities to the list.
@param SortableEntityInterface[] $prepended
@param array $where | [
"public function prependEntities (array $prepended, array $where = []) : void\n {\n $all = $this->getAllEntities($where);\n $index = 0;\n\n // first prepend\n foreach ($prepended as $prependedEntity)\n {\n $prependedEntity->setSortOrder($index);\n ++$index... | [
"public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Documentation:"
} |
// Evaluate executes code and pretty prints the result to the specified output
// stream. | [
"func (re *JSRE) Evaluate(code string, w io.Writer) error {\n\tvar fail error\n\n\tre.Do(func(vm *otto.Otto) {\n\t\tval, err := vm.Run(code)\n\t\tif err != nil {\n\t\t\tprettyError(vm, err, w)\n\t\t} else {\n\t\t\tprettyPrint(vm, val, w)\n\t\t}\n\t\tfmt.Fprintln(w)\n\t})\n\treturn fail\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Setzt die maximale Anzahl der Redirects, denen gefolgt werden soll.
@param int $maxRedirects
@return $this | [
"public function setMaxRedirects($maxRedirects) {\n if (!is_int($maxRedirects)) throw new IllegalTypeException('Illegal type of parameter $maxRedirects: '.gettype($maxRedirects));\n\n $this->maxRedirects = $maxRedirects;\n return $this;\n }"
] | [
"protected function processEntityFormRequest(Entity $entity, FormData $requestData, $revision) {\n $dataName = 'layoutManager';\n \n if (isset($requestData->$dataName) && count($requestData->$dataName) > 0) {\n $serialized = $requestData->$dataName;\n } /*else {\n throw $this->err->validationE... | codesearchnet | {
"query": "Represent the description about Laravel:",
"pos": "Represent the code about Laravel:",
"neg": "Represent the code:"
} |
// Initialize distributed locking only in case of distributed setup.
// Returns lock clients and the node index for the current server. | [
"func newDsyncNodes(endpoints EndpointList) (clnts []dsync.NetLocker, myNode int) {\n\tmyNode = -1\n\tseenHosts := set.NewStringSet()\n\tfor _, endpoint := range endpoints {\n\t\tif seenHosts.Contains(endpoint.Host) {\n\t\t\tcontinue\n\t\t}\n\t\tseenHosts.Add(endpoint.Host)\n\n\t\tvar locker dsync.NetLocker\n\t\tif... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Set the invoice object
@param integer $iInvoiceId The invoice to use for the request
@return $this
@throws RequestException | [
"public function setInvoice($iInvoiceId)\n {\n // Validate\n $oModel = $this->oInvoiceModel;\n $oInvoice = $oModel->getById(\n $iInvoiceId,\n ['expand' => $oModel::EXPAND_ALL]\n );\n\n if (empty($oInvoice)) {\n throw new RequestException('Inv... | [
"public static function all($params = null, $opts = null)\n {\n $msg = \"Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. \" .\n \"List those using \\$schedule->allRevisions('revision_id') instead.\";\n throw new Error\\InvalidRequest($msg, null);\n... | codesearchnet | {
"query": "Represent the summarization about invoice calculation:",
"pos": "Represent the code about invoice calculation:",
"neg": "Represent the code about PHP:"
} |
// SetRecordFormatType sets the RecordFormatType field's value. | [
"func (s *DestinationSchema) SetRecordFormatType(v string) *DestinationSchema {\n\ts.RecordFormatType = &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:"
} |
Construct an selector for context. | [
"def construct_selector(self, el, attr=''):\n \"\"\"\"\"\"\n\n selector = deque()\n ancestor = el\n while ancestor and ancestor.parent:\n if ancestor is not el:\n selector.appendleft(ancestor.name)\n else:\n tag = ancestor.name\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Clean attribute value before required change.
@param string $name
@param mixed $value
@return array | [
"private function manipulateAttribute($name, $value)\n {\n $current_value = array_get($this->attribute, $name, '');\n $separator = (strlen(trim($current_value)) > 0) ? $this->getAttributeValueSeparator($name) : '';\n $current_value = $separator !== '' ? explode($separator, $current_value) : ... | [
"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:"
} |
Add a value addition
@param float $value
@return $this | [
"public function addAddition($value)\n {\n $this->data->amount->subtotals->addition += $this->convertAmount($value);\n\n return $this;\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.