query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Archives category.
@param int $id
@return PodiumResponse
@throws ModelNotFoundException | [
"public function archive(int $id): PodiumResponse\r\n {\r\n $categoryArchiver = $this->getArchiver($id);\r\n\r\n if ($categoryArchiver === null) {\r\n throw new ModelNotFoundException('Category of given ID can not be found.');\r\n }\r\n\r\n return $categoryArchiver->archive... | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
systemcall : DOLLER ID | [
"def p_systemcall_noargs(self, p):\n ''\n p[0] = SystemCall(p[2], (), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetScrubFields sets the regular expression to match keys in the item payload for scrubbing.
// The default vlaue is regexp.MustCompile("password|secret|token"), | [
"func (c *Client) SetScrubFields(fields *regexp.Regexp) {\n\tc.configuration.scrubFields = fields\n}"
] | [
"def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// SecretFromGRPC converts a grpc Secret to a Secret. | [
"func SecretFromGRPC(s *swarmapi.Secret) swarmtypes.Secret {\n\tsecret := swarmtypes.Secret{\n\t\tID: s.ID,\n\t\tSpec: swarmtypes.SecretSpec{\n\t\t\tAnnotations: annotationsFromGRPC(s.Spec.Annotations),\n\t\t\tData: s.Spec.Data,\n\t\t\tDriver: driverFromGRPC(s.Spec.Driver),\n\t\t},\n\t}\n\n\tsecret.Vers... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public EClass getCMRFidelity() {\n\t\tif (cmrFidelityEClass == null) {\n\t\t\tcmrFidelityEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(508);\n\t\t}\n\t\treturn cmrFidelityEClass;\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the Github post about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Get all the addresses this message should be sent to.
Note that Mandrill still respects CC, BCC headers in raw message itself.
@param \Swift_Mime_Message $message
@return array | [
"protected function getToAddresses( Swift_Mime_Message $message )\n\t{\n\t\t$to = [];\n\n\t\tif ( $message->getTo() )\n\t\t\t$to = array_merge( $to, array_keys( $message->getTo() ) );\n\n\t\tif ( $message->getCc() )\n\t\t\t$to = array_merge( $to, array_keys( $message->getCc() ) );\n\n\t\tif ( $message->getBcc() )\n... | [
"public function send()\n {\n $transport = $this->getConnection()->getTransportObject();\n\n // Refactor: Not full toArray needed in exec?\n return $transport->exec($this, $this->getConnection()->toArray());\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
@param ImagineImageInterface $image
@return ImagineImageInterface | [
"public function updateFile(ImagineImageInterface $image)\n {\n if ($this->direction !== null) {\n $transformation = new Transformation();\n\n if ($this->direction == 'x') {\n $transformation->flipHorizontally();\n } elseif ($this->direction == 'y') {\n ... | [
"protected function setGeneratorImages()\n {\n $this->logger->debug('Base:setGeneratorImages');\n $this->setParam('generator', 'images');\n $this->setParam('gimlimit', $this->getLimit());\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Create a new SimpleExpression
@param expr expression
@return new SimpleExpression | [
"public static <T> SimpleExpression<T> asSimple(Expression<T> expr) {\n Expression<T> underlyingMixin = ExpressionUtils.extract(expr);\n if (underlyingMixin instanceof PathImpl) {\n return new SimplePath<T>((PathImpl<T>) underlyingMixin);\n } else if (underlyingMixin instanceof Opera... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// setupNode is used to setup the initial node | [
"func (c *Client) setupNode() error {\n\tnode := c.config.Node\n\tif node == nil {\n\t\tnode = &structs.Node{}\n\t\tc.config.Node = node\n\t}\n\t// Generate an ID and secret for the node\n\tid, secretID, err := c.nodeID()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"node ID setup failed: %v\", err)\n\t}\n\n\tnode.ID... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Creates the given Synthetics alert condition.
@param policyId The id of the policy to add the alert condition to
@param condition The alert condition to create
@return The alert condition that was created | [
"public Optional<SyntheticsAlertCondition> create(long policyId, SyntheticsAlertCondition condition)\n {\n return HTTP.POST(String.format(\"/v2/alerts_synthetics_conditions/policies/%d.json\", policyId), condition, SYNTHETICS_ALERT_CONDITION);\n }"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
case_list : empty
| case_list CASE expr case_separator inner_statement_list
| case_list DEFAULT case_separator inner_statement_list | [
"def p_case_list(p):\n ''''''\n if len(p) == 6:\n p[0] = p[1] + [ast.Case(p[3], p[5], lineno=p.lineno(2))]\n elif len(p) == 5:\n p[0] = p[1] + [ast.Default(p[4], lineno=p.lineno(2))]\n else:\n p[0] = []"
] | [
"def get_hgvs_language() -> ParserElement:\n \"\"\"\"\"\"\n hgvs = (variant_characters | quote)(IDENTIFIER)\n language = variant_tags + nest(hgvs)\n return language"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Persist json file with the upstream steps structure, that is step names and their connections. | [
"def persist_upstream_structure(self):\n \"\"\"\"\"\"\n persist_dir = os.path.join(self.experiment_directory, '{}_upstream_structure.json'.format(self.name))\n logger.info('Step {}, saving upstream pipeline structure to {}'.format(self.name, persist_dir))\n joblib.dump(self.upstream_stru... | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
Generates strong pseudo-random bytes sync.
@param {number} size
@return {Buffer}
@public | [
"function randomBytesSync (size) {\n var err = null\n\n for (var i = 0; i < GENERATE_ATTEMPTS; i++) {\n try {\n return crypto.randomBytes(size)\n } catch (e) {\n err = e\n }\n }\n\n throw err\n}"
] | [
"function BinaryPacker_pack(source, // @arg Any - source data\n formatID) { // @arg Integer - 0x0001 - 0xffff\n // @ret Uint8Array|null\n//{@dev\n $valid(_isValidFormatID(formatID), BinaryPacker_pack, \"formatID\");\n//}@dev\n var moduleID = ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Java programming:"
} |
If list is empty, return undefined, if elements have different parents return undefined,
If they all have the same parent, return that parent | [
"@Override\n Object parent() {\n if (length() == 0) return Undefined.instance;\n\n XML candidateParent = null;\n\n for (int i = 0; i < length(); i++) {\n Object currParent = getXmlFromAnnotation(i).parent();\n if (!(currParent instanceof XML)) return Undefined.instance;... | [
"function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Open the selected comment with the URL viewer | [
"def comment_urlview(self):\n \n data = self.get_selected_item()\n comment = data.get('body') or data.get('text') or data.get('url_full')\n if comment:\n self.term.open_urlview(comment)\n else:\n self.term.flash()"
] | [
"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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
//----------------------------------------
// Get some object, or panic.
// objPtr: pointer to the object to populate, if value exists for key
// Use the return value, so nil can be returned for keys with no value. | [
"func (gov *Governmint) getObject(store base.KVStore, key []byte, objPtr interface{}) interface{} {\n\tvalueBytes := store.Get(key)\n\tif len(valueBytes) == 0 {\n\t\treturn nil // NOTE must use return value\n\t}\n\terr := wire.ReadBinaryBytes(valueBytes, objPtr)\n\tif err != nil {\n\t\tpanic(\"Error parsing obj: \"... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Reads a tag and sets the bits to a new tag at same time for max
speedification | [
"long readTagAndSet(long bucketIndex, int posInBucket, long newTag) {\r\n\t\tlong tagStartIdx = getTagOffset(bucketIndex, posInBucket);\r\n\t\tlong tag = 0;\r\n\t\tlong tagEndIdx = tagStartIdx + bitsPerTag;\r\n\t\tint tagPos = 0;\r\n\t\tfor (long i = tagStartIdx; i < tagEndIdx; i++) {\r\n\t\t\tif ((newTag & (1L << ... | [
"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:"
} |
Assign data to the quote payment info instance
@param Quote $quote
@param array $data
@return void | [
"private function setQuotePaymentInfoData($quote, $data)\n {\n foreach ($data as $key => $value) {\n $this->getQuotePaymentInfoInstance($quote)->setData($key, $value)->save();\n }\n }"
] | [
"public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Permanently fail to retrieve the element associated with the key, independently of any timeout. | [
"private void fail(final K key) {\n final String methodName = \"fail(): \";\n stateLock.writeLock().lock();\n try {\n Integer index = actualIndices.remove(key);\n if (index == null)\n throw new IllegalArgumentException(\"unknown key: \" + key);\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
This syncdb checks our PERMISSIONS setting in settings.py and makes sure all those permissions
actually exit. | [
"def check_all_permissions(sender, **kwargs):\n \n if not is_permissions_app(sender):\n return\n\n config = getattr(settings, 'PERMISSIONS', dict())\n\n # for each of our items\n for natural_key, permissions in config.items():\n # if the natural key '*' then that means add to all object... | [
"def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Int63 returns a positive random integer, uniformly distributed on
// the range 0, 1, ..., 2^63-1. This function is part of the
// rand.Source interface. | [
"func (gen *Generator) Int63() int64 {\n\tbytes := gen.PseudoRandomData(8)\n\tbytes[0] &= 0x7f\n\treturn bytesToInt64(bytes)\n}"
] | [
"func Intn(n int) int {\n\tif n <= 0 {\n\t\tpanic(\"fastrand: argument to Intn is <= 0: \" + strconv.Itoa(n))\n\t}\n\t// NOTE: since n is at most math.MaxUint64/2, max is minimized when:\n\t// n = math.MaxUint64/4 + 1 -> max = math.MaxUint64 - math.MaxUint64/4\n\t// This gives an expected 1.333 tries before choo... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Prepare the simple count select
@param Select $select
@return Select | [
"protected function prepareSelect(Select $select) {\n\t\t$select->reset(Select::COLUMNS)\n\t\t ->reset(Select::LIMIT_OFFSET)\n\t\t ->reset(Select::LIMIT_COUNT)\n\t\t ->reset(Select::ORDER)\n\t\t ->columns([self::COUNT_COLUMN => 'count(*)']);\n\n\t\treturn $select;\n\t}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Resize the rendering and start sending video over TCP. | [
"public void start(MissionInit missionInit, IVideoProducer videoProducer, VideoProducedObserver observer, MalmoEnvServer envServer)\n {\n if (videoProducer == null)\n {\n return; // Don't start up if there is nothing to provide the video.\n }\n\n videoProducer.prepare(missi... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Translate the raw input from a parameter to something usable.
@param $value
@return mixed | [
"public function toParameterValue($value)\n {\n if ($value === null) {\n return null;\n }\n\n $format = $this->formatIn ?? $this->format;\n return \\DateTime::createFromFormat($format, $value);\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
prints a double metric value with optional fields | [
"private void printDoubleWithFields(String name, String fields, double value) {\r\n\t\tprint(METRIC_PREFIX);\r\n\t\tprint(name);\r\n\t\tif (fields != null) {\r\n\t\t\tprint(fields);\r\n\t\t}\r\n\t\tprint(' ');\r\n\t\tprintln(decimalFormat.format(value));\r\n\t}"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github comment about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
Context as a :class:`shelter.core.context.Context` class or subclass. | [
"def context_class(self):\n \n if 'context_class' not in self._cached_values:\n context_cls_name = getattr(self.settings, 'CONTEXT_CLASS', '')\n if context_cls_name:\n context_class = import_object(context_cls_name)\n else:\n context_class... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Builds a string containing the formatted name e.g. (1 H, 0 M, 0 L ).
@private
@param {object} oValues
@name sap.ui.support.IssueManager._getFormattedName
@returns {string} String containing the formatted name. | [
"function(oValues) {\n\t\t\t\tvar sHighColor = \"\",\n\t\t\t\t\tsMediumColor = \"\",\n\t\t\t\t\tsLowColor = \"\";\n\n\t\t\t\tif (oValues.highCount > 0) {\n\t\t\t\t\tsHighColor = \"color: \" + constants.SUPPORT_ASSISTANT_SEVERITY_HIGH_COLOR + \";\";\n\t\t\t\t}\n\n\t\t\t\tif (oValues.mediumCount > 0) {\n\t\t\t\t\tsMe... | [
"public void addCaption(String name, String type) {\n captions.add(new StatCaptionBean(name, name + \" as \" + type, \"\"));\n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about document management:"
} |
Removes a resource.
@param Resource $resource
Resource object to remove.
@return static
This collection, for fluent interface. | [
"public function remove($resource)\n {\n $keysToRemove = array_keys($this->collection, $resource, true);\n $this->collection = array_values(array_diff_key($this->collection, array_flip($keysToRemove)));\n return $this;\n }"
] | [
"public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key.... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
/* enqueue css and js of fields | [
"public function load_js_css_fields(){\n\n //Loading any custom field if is required\n if( !empty( $_GET['post']) && is_numeric( $_GET['post'] ) ) {//when the post already exists\n $post_type = get_post_type($_GET['post']);\n }else{ //Creating a new post\n $post_type = (!empty($_GET['post_type']... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
See Api#search_for | [
"def search_for( spec )\n found = []\n specs_list.each do |name, version, platform|\n up_spec = Stickler::SpecLite.new( name, version, platform )\n found << up_spec if spec =~ up_spec\n end\n return found\n end"
] | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Initialize a logger from a configuration file to use throughout the project | [
"def init_logging():\n \"\"\"\"\"\"\n with open(os.path.join(os.path.dirname(__file__),'logging.conf'), 'r') as yf:\n config = yaml.load(yf)\n logging.config.dictConfig(config)"
] | [
"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 summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Returns the xhtml code to be included
@return string
@throws Error | [
"public function Code(Environment $environment, $name, $type, $version = 'latest', $params = null)\n {\n $type = strtolower($type);\n\n //Gets type for local file\n $local = false;\n if ('local' == $type) {\n $local = true;\n $type = strtolower(substr($name, strr... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
// GetBody gets an appropriate multipart form payload to use in a request body
// to create a new file. | [
"func (f *FileParams) GetBody() (*bytes.Buffer, string, error) {\n\tbody := &bytes.Buffer{}\n\twriter := multipart.NewWriter(body)\n\n\tif f.Purpose != nil {\n\t\terr := writer.WriteField(\"purpose\", StringValue(f.Purpose))\n\t\tif err != nil {\n\t\t\treturn nil, \"\", err\n\t\t}\n\t}\n\n\tif f.FileReader != nil &... | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the description about File management:",
"pos": "Represent the code about File management:",
"neg": "Represent the code about programming:"
} |
验证签名
@return array|bool | [
"public function check_notify(){\n /*获取xml*/\n $xml=file_get_contents('php://input', 'r');\n /*转成php数组*/\n $data=$this->to_array($xml);\n /*保存原sign*/\n $data_sign=$data['sign'];\n /*sign不参与签名*/\n unset($data['sign']);\n $sign=$this->make_sign($data);\n\... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the Github comment about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code:"
} |
@param SerializerInterface $jmsSerializer
@return EntryPoint | [
"public function addDefaultDeserializers(SerializerInterface $jmsSerializer): EntryPoint\n {\n $this->addDeserializer(new ArticleHandler($jmsSerializer));\n $this->addDeserializer(new OrderHandler($jmsSerializer));\n $this->addDeserializer(new CategoryHandler($jmsSerializer));\n $this... | [
"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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Returns an attribute's value from a non-main section of this JAR's manifest.
@param section the manifest's section
@param name the attribute's name | [
"public String getAttribute(String section, String name) {\n Attributes attr = getManifest().getAttributes(section);\n return attr != null ? attr.getValue(name) : null;\n }"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Unregisters all of the shortcuts registered on any focused BrowserWindow
instance. This method does not unregister any shortcut you registered on
a particular window instance.
@param {BrowserWindow} win BrowserWindow instance
@return {Undefined} | [
"function unregisterAll(win) {\n\tdebug(`Unregistering all shortcuts on window ${title(win)}`);\n\tconst wc = win.webContents;\n\tconst shortcutsOfWindow = windowsWithShortcuts.get(wc);\n\n\t// Remove listener from window\n\tshortcutsOfWindow.removeListener();\n\n\twindowsWithShortcuts.delete(wc);\n}"
] | [
"function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Put implements the MDCache interface for MDCacheStandard. | [
"func (md *MDCacheStandard) Put(rmd ImmutableRootMetadata) error {\n\tmd.lock.Lock()\n\tdefer md.lock.Unlock()\n\tkey := mdCacheKey{rmd.TlfID(), rmd.Revision(), rmd.BID()}\n\tif _, ok := md.lru.Get(key); ok {\n\t\t// Don't overwrite the cache. In the case that `rmd` is\n\t\t// different from what's in the cache, w... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
required keys:
migration_status, migration_request_id | [
"def execute(self, conn, daoinput, transaction = False):\n \t\n if not conn:\n\t dbsExceptionHandler(\"dbsException-failed-connect2host\", \"Oracle/MigrationRequests/UpdateRequestStatus. Expects db connection from upper layer.\", \n self.logger.exception)\n if ... | [
"def load_tasks(self, cmd, params, args):\n \"\"\"\"\"\"\n return generate_tasks('taskname that shows up in log', self._gen_tasks()), self.DOIT_CONFIG"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
根据时间变量返回时间字符串
@return 返回时间字符串
@param pattern
时间字符串样式
@param date
时间变量 | [
"public static String dateToString(Date date, String pattern) {\n\n if (date == null) {\n\n return null;\n }\n\n try {\n\n SimpleDateFormat sfDate = new SimpleDateFormat(pattern);\n sfDate.setLenient(false);\n\n return sfDate.format(date);\n } ... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
// SetOk sets the global health status of all plugin configured in this server. | [
"func (h *health) SetOk(ok bool) {\n\th.Lock()\n\tdefer h.Unlock()\n\th.ok = ok\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Remove dir
@param bool $withFoler
@return $this | [
"public function removeDir($withFolder = false)\n {\n if (!is_dir($this->dir)) {\n return $this;\n }\n\n foreach (glob($this->dir.'/*') as $item) {\n if (is_dir($item)) {\n static::create($item)->removeDir(true);\n } else {\n @un... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Delete selected messages for the current user
:param ids: list of ids | [
"def delete_messages(self, ids):\n \n str_ids = self._return_comma_list(ids)\n return self.request('MsgAction', {'action': {'op': 'delete',\n 'id': str_ids}})"
] | [
"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 about Work management:",
"pos": "Represent the code about Work management:",
"neg": "Represent the code:"
} |
// ToRawInfo returns a description of ParameterOrReference suitable for JSON or YAML export. | [
"func (m *ParameterOrReference) ToRawInfo() interface{} {\n\t// ONE OF WRAPPER\n\t// ParameterOrReference\n\t// {Name:parameter Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}\n\tv0 := m.GetParameter()\n\tif v0 != nil {\n\t\treturn v0.ToRawInfo()\n\t}\n\t// {Name:ref... | [
"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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Deserializes from base64url
@param string $data
@return string | [
"public function fromBase64URL($data)\n {\n if ($remainder = strlen($data) % 4) {\n $data .= str_repeat('=', 4 - $remainder);\n }\n\n return base64_decode(strtr($data, '-_', '+/'));\n }"
] | [
"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 summarization about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code:"
} |
Query for typed values in a single (first) row
@param <T>
result value type
@param sql
sql statement
@param args
arguments
@return single row results
@since 3.1.0 | [
"public <T> List<T> querySingleRowTypedResults(String sql, String[] args) {\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<T> result = (List<T>) querySingleRowResults(sql, args);\n\t\treturn result;\n\t}"
] | [
"@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 sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
/*!
Returns false, telling the template parser that this is a single tag. | [
"function hasChildren()\n {\n return array( $this->SetName => false,\n $this->LetName => true,\n $this->DefaultName => true );\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 instruction about CSS:",
"pos": "Represent the code about CSS:",
"neg": "Represent the code about Software development:"
} |
@param \PHPMD\Node\ClassNode $node
@param \PHPMD\Node\InterfaceNode $interfaceNode
@return void | [
"protected function verifyClass(ClassNode $node, InterfaceNode $interfaceNode): void\n {\n $classMethods = $node->getMethods();\n $interfaceMethods = $interfaceNode->getMethods();\n\n $notMatchingMethods = $this->findNotMatchingMethodsForBridgeClass($classMethods, $interfaceMethods);\n\n ... | [
"public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@tracing')\n );\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Recursively walk an object graph applying `fn`/`args` to objects. | [
"def walk(fn, obj, *args, **kwargs):\n \"\"\"\"\"\"\n if type(obj) in [list, tuple]:\n return list(walk(fn, o, *args) for o in obj)\n if type(obj) is dict:\n return dict((walk(fn, k, *args), walk(fn, v, *args)) for k, v in\n obj.items())\n return fn(obj, *args, **kwargs)... | [
"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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Helper method to get the configured list of URLs.
@return The list of URLs. | [
"@SuppressWarnings(\"unchecked\")\n @Trivial\n private List<String> getEnvURLList() {\n return (List<String>) iEnvironment.get(ENVKEY_URL_LIST);\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Add the primary key to the current table | [
"public function modifyTable()\n {\n $table = $this->getTable();\n if (!$table->hasPrimaryKey() && !$table->hasBehavior('concrete_inheritance')) {\n $columnAttributes = array_merge(['primaryKey' => 'true'], $this->getParameters());\n $this->getTable()->addColumn($columnAttribu... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns a subset of an array.
@see https://docs.mongodb.org/manual/reference/operator/aggregation/slice/
@see Expr::slice
@param mixed|Expr $array
@param mixed|Expr $n
@param mixed|Expr|null $position
@return $this
@since 1.3 | [
"public function slice($array, $n, $position = null)\n {\n $this->expr->slice($array, $n, $position);\n\n return $this;\n }"
] | [
"protected function _fetchAll($namespace, $filter, $options, $readPreference)\n {\n $cursor = $this->_getManager()->executeQuery($namespace, new MongodbQuery($filter, $options), $readPreference);\n $cursor->setTypeMap(['root' => 'array']);\n return $cursor->toArray();\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@param Response $response
@throws Code103ResponseException
@return bool | [
"public static function parseResponse(Response $response)\n {\n $jsonData = \\GuzzleHttp\\json_decode($response->getBody(), true);\n if (\n (isset($jsonData['errCode']) && 0 === $jsonData['errCode'])\n || (isset($jsonData['retcode']) && 0 === $jsonData['retcode'])\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 comment about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about Programming:"
} |
Serializes this InlineQueryResultAudio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"def to_array(self):\n \n array = super(InlineQueryResultAudio, self).to_array()\n # 'type' and 'id' given by superclass\n array['audio_url'] = u(self.audio_url) # py2: type unicode, py3: type str\n array['title'] = u(self.title) # py2: type unicode, py3: type str\n if se... | [
"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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
<p>extractParameterMultiple.</p>
@param name a {@link java.lang.String} object.
@param parameters a {@link java.util.Map} object.
@return an array of {@link java.lang.String} objects. | [
"public static String[] extractParameterMultiple(String name, Map parameters) {\n\t\tString paramValues = extractParameter(name, parameters);\n\t\treturn StringUtils.stripAll(StringUtils.split(paramValues, \", \"));\n\t}"
] | [
"public EntityFilter withTags(java.util.Collection<java.util.Map<String, String>> tags) {\n setTags(tags);\n return this;\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
transformer ///////////////////////////// | [
"public static MissingAuthorizationDto fromInfo(MissingAuthorization info) {\n MissingAuthorizationDto dto = new MissingAuthorizationDto();\n\n dto.setPermissionName(info.getViolatedPermissionName());\n dto.setResourceId(info.getResourceId());\n dto.setResourceName(info.getResourceType());\n\n return... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
defines the success url of the "get alias" call
by default we want to return to the shipping step with processing parameters set (execute step, active shipping group and payment method).
@param string $sStepName
@return bool|string | [
"protected function GetSuccessURL($sStepName = '')\n {\n if (empty($sStepName)) {\n $sStepName = 'shipping';\n }\n $sURL = false;\n $oShippingStep = TdbShopOrderStep::GetStep($sStepName);\n /** @var $oShippingStep TdbShopOrderStep */\n if (!is_null($oShippingS... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// OpenRange opens the item for reading starting at byte start and ending
// at byte end. | [
"func (i *item) OpenRange(start, end uint64) (io.ReadCloser, error) {\n\topts := &az.GetBlobRangeOptions{\n\t\tRange: &az.BlobRange{\n\t\t\tStart: start,\n\t\t\tEnd: end,\n\t\t},\n\t}\n\treturn i.client.GetContainerReference(i.container.id).GetBlobReference(i.id).GetRange(opts)\n}"
] | [
"int blockForReadSpace(int readLocation) {\n\n // sets the nextReadLocation my moving it on by 1, this may cause it it wrap back to the start.\n final int nextReadLocation = (readLocation + 1 == capacity) ? 0 : readLocation + 1;\n\n // in the for loop below, we are blocked reading unit another ... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Gets the bounds of the supplied text layout in a way that works around the various
befuckeries that currently happen on the Mac. | [
"protected Rectangle2D getBounds (TextLayout layout)\n {\n if (RunAnywhere.isMacOS()) {\n return layout.getOutline(null).getBounds();\n } else {\n return layout.getBounds();\n }\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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// GET /firewall_policies/{id} | [
"func (api *API) GetFirewallPolicy(fp_id string) (*FirewallPolicy, error) {\n\tresult := new(FirewallPolicy)\n\turl := createUrl(api, firewallPolicyPathSegment, fp_id)\n\terr := api.Client.Get(url, &result, http.StatusOK)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresult.api = api\n\treturn result, nil\n\n}"
] | [
"def list(self, subid, params=None):\n ''' \n '''\n params = update_params(params, {'SUBID': subid})\n return self.request('/v1/server/list_ipv4', params, 'GET')"
] | codesearchnet | {
"query": "Represent the Github post about Object properties:",
"pos": "Represent the Github code about Object properties:",
"neg": "Represent the Github code:"
} |
// SetFlowLogsS3Bucket sets the FlowLogsS3Bucket field's value. | [
"func (s *UpdateAcceleratorAttributesInput) SetFlowLogsS3Bucket(v string) *UpdateAcceleratorAttributesInput {\n\ts.FlowLogsS3Bucket = &v\n\treturn s\n}"
] | [
"func NewTarTimeoutError() error {\n\treturn Error{\n\t\tMessage: fmt.Sprintf(\"timeout waiting for tar stream\"),\n\t\tDetails: nil,\n\t\tErrorCode: TarTimeoutError,\n\t\tSuggestion: \"check the Source-To-Image scripts if it accepts tar stream for assemble and sends for save-artifacts\",\n\t}\n}"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Creates the parsed_lines dict which keeps all record data in document order indexed by the record type. | [
"def _split_lines(self):\n ''''''\n parsed_lines = {}\n for rt in all_record_types:\n parsed_lines[rt] = []\n parsed_lines[0] = []\n\n for line in self.lines:\n linetype = line[0:6]\n if linetype in all_record_types:\n parsed_lines[l... | [
"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 Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code:"
} |
Validates order total
@return boolean|null | [
"protected function validateTotalOrder()\n {\n $field = 'total';\n $value = $this->getSubmitted($field);\n\n if (!isset($value)) {\n $this->unsetSubmitted($field);\n return null;\n }\n\n $label = $this->translation->text('Total');\n\n if (!is_numeri... | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Get JsonResponse array for Settings novalidate and form display.
@param FormInterface $form
@param View $view
@param $novalidate
@throws \Exception
@return array | [
"private function getNotPersistedSettingsResponse(FormInterface $form, View $view, $novalidate)\n {\n $template = sprintf(\n '%s:%s',\n $this->getBaseTemplatePath(),\n ($novalidate === false) ? 'settings.html.twig' : 'form.html.twig'\n );\n\n return [\n ... | [
"protected function loadStructure()\n {\n // Method ajaxTreeView is in TreeView.php - watch out!\n $response = new Response(\n $this->getDataContainer()->ajaxTreeView($this->getAjaxId(), (int) $this->getPost('level'))\n );\n\n throw new ResponseException($response);\n }"... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
/*
(non-Javadoc)
@see com.impetus.kundera.client.Client#findByRelation(java.lang.String,
java.lang.Object, java.lang.Class) | [
"@Override\n public List<Object> findByRelation(String colName, Object colValue, Class entityClazz)\n {\n EntityMetadata m = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClazz);\n Object[] ids = findIdsByColumn(m.getSchema(), m.getTableName(),\n ((AbstractAttrib... | [
"@Override\n public void serialize(List<org.audit4j.core.dto.Field> auditFields, Object object,\n String objectName, DeIdentify deidentify) {\n visited.clear();\n String text = toString(object, deidentify);\n auditFields.add(new org.audit4j.core.dto.Field(objectName, text, object.... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
// Get volume or snapshot name without config tag | [
"func (d *driver) getPrintableName(name string) string {\n\treturn strings.TrimPrefix(name, d.tag()+azureud.TagDelimiter)\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 Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Technology:"
} |
CMG parent classes -------------------- | [
"public function renderWidget( $config = [] ) {\n\n\t\t$commentProperties = CommentProperties::getInstance();\n\n\t\t$this->allFields\t= $commentProperties->isAllFields();\n\t\t$this->labels\t\t= $commentProperties->isLabels();\n\n\t\t$user = Yii::$app->user->getIdentity();\n\n\t\t// Comments are disabled by admin\... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Resets the iterator to the beginning of the iteration | [
"@Override\n public final void reset()\n {\n m_currentCodepoint_ = 0;\n m_nextCodepoint_ = 0;\n m_nextIndex_ = 0;\n m_nextBlock_ = m_trie_.m_index_[0] << Trie.INDEX_STAGE_2_SHIFT_;\n if (m_nextBlock_ == m_trie_.m_dataOffset_) {\n m_nextValue_ = m_initial... | [
"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 Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Checks if there is enough space in the buffer to write N additional bytes. Will grow the buffer
if necessary. It takes current position in the buffer into account.
@param numBytesToAdd the number of bytes you want to add to the buffer | [
"public void ensureHasSpace(int numBytesToAdd) {\n if (numBytesToAdd < 0) {\n throw new IllegalArgumentException(\"Number of bytes can't be negative\");\n }\n int capacityLeft = getCapacityLeft();\n if (capacityLeft < numBytesToAdd) {\n grow(numBytesToAdd - capacityLeft, true);\n }\n }"
] | [
"@Nonnull\n public String getLine() {\n if (preLoaded) {\n if (bufferOffset >= 0) {\n int lineStart = bufferOffset;\n if (linePos > 0) {\n lineStart -= linePos - 1;\n }\n int lineEnd = bufferOffset;\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Main method.
@param database Database
@param nrel Neighborhood relation
@param relation Data relation (1d!)
@return Outlier detection result | [
"public OutlierResult run(Database database, Relation<N> nrel, Relation<? extends NumberVector> relation) {\n final NeighborSetPredicate npred = getNeighborSetPredicateFactory().instantiate(database, nrel);\n WritableDoubleDataStore means = DataStoreUtil.makeDoubleStorage(relation.getDBIDs(), DataStoreFactory... | [
"def path_from_structure(cls, ndivsm, structure):\n \"\"\"\"\"\"\n return cls._path(ndivsm, structure=structure, comment=\"K-path generated automatically from structure\")"
] | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
Return the metagraph definition, if there is one.
Raises:
ValueError: If there is no metagraph for this run.
Returns:
The `meta_graph_def` proto. | [
"def MetaGraph(self):\n \n if self._meta_graph is None:\n raise ValueError('There is no metagraph in this EventAccumulator')\n meta_graph = meta_graph_pb2.MetaGraphDef()\n meta_graph.ParseFromString(self._meta_graph)\n return meta_graph"
] | [
"def _get_metadata_path_for_display(self, name):\n \n try:\n # We need to access _get_metadata_path() on the provider object\n # directly rather than through this class's __getattr__()\n # since _get_metadata_path() is marked private.\n path = self._provider... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
创建记录.
@param array $data 数据.
@param \Closure $cb 数据处理函数.
@return bool|int 成功返回true或主键值,失败返回false.
@throws | [
"protected final function insert($data, $cb = null) {\n if ($cb && $cb instanceof \\Closure) {\n $data = $cb ($data, $this);\n }\n if ($data) {\n $this->filterFields($data);\n if (method_exists($this, 'validateNewData')) {\n if (isset($this->_form... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Escapes the inserted value for LDAP.
@param string $value
@param string $ignore
@param int $flags
@return string | [
"protected function escapeManual($value, $ignore = '', $flags = 0)\n {\n /*\n * If a flag was supplied, we'll send the value\n * off to be escaped using the PHP flag values\n * and return the result.\n */\n if ($flags) {\n return $this->escapeManualWithFla... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get page keywords
@return string url | [
"public function getPageKeywords()\n {\n if (!$this->parser) {\n return;\n }\n\n $node = $this->parser->find('meta[name=keywords]', 0);\n\n if ($node) {\n return $node->getAttribute('content');\n }\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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
TODO: share with gasPriceEditor.spec.js | [
"function createApi () {\n api = {\n eth: {\n blockNumber: sinon.stub().resolves(new BigNumber(2)),\n gasPrice: sinon.stub().resolves(GASPRICE)\n },\n parity: {\n gasPriceHistogram: sinon.stub().resolves(HISTOGRAM)\n }\n };\n\n return api;\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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// CommonAccessor returns a Common interface for the provided object or an error if the object does
// not provide List. | [
"func CommonAccessor(obj interface{}) (metav1.Common, error) {\n\tswitch t := obj.(type) {\n\tcase List:\n\t\treturn t, nil\n\tcase metav1.ListInterface:\n\t\treturn t, nil\n\tcase ListMetaAccessor:\n\t\tif m := t.GetListMeta(); m != nil {\n\t\t\treturn m, nil\n\t\t}\n\t\treturn nil, errNotCommon\n\tcase metav1.Lis... | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Adapts a CryptonitBalance to an AccountInfo
@param cryptonitBalance The Cryptonit balance
@param userName The user name
@return The account info | [
"public static AccountInfo adaptAccountInfo(CryptonitBalance cryptonitBalance, String userName) {\n\n // Adapt to XChange DTOs\n List<Balance> balances = new ArrayList<>();\n for (CryptonitBalance.Balance b : cryptonitBalance.getBalances()) {\n Balance xchangeBalance =\n new Balance(\n ... | [
"def GetStandardAddress(self):\n \n for contract in self._contracts.values():\n if contract.IsStandard:\n return contract.ScriptHash\n\n raise Exception(\"Could not find a standard contract address\")"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
From Harmony Long.toString(l,radix) | [
"private static void appendToBuilder(long l, int radix, StringBuilder builder, char[] bufferConversion)\n {\n if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)\n {\n radix = 10;\n }\n if (l == 0)\n {\n builder.append('0');\n return... | [
"final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Send directly to socket the sql data.
@param pos output stream
@param sqlBytes the query in UTF-8 bytes
@throws IOException if connection error occur | [
"public static void sendDirect(final PacketOutputStream pos, byte[] sqlBytes) throws IOException {\n pos.startPacket(0);\n pos.write(Packet.COM_QUERY);\n pos.write(sqlBytes);\n pos.flush();\n }"
] | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
<p>Refresh entity from DB by its ID.</p>
@param <T> entity type
@param pAddParam additional param
@param pEntityClass entity class
@param pItsId entity ID
@return entity or null
@throws Exception - an exception | [
"@Override\n public final <T> T retrieveEntityById(final Map<String, Object> pAddParam,\n final Class<T> pEntityClass, final Object pItsId) throws Exception {\n String query = evalSqlSelect(pAddParam, pEntityClass);\n @SuppressWarnings(\"unchecked\")\n IFactorySimple<T> facEn = (IFactorySimple<T>) this... | [
"@Override\n public OptionalThing<USER_BEAN> getSavedUserBean() { // use covariant generic type\n final String key = getUserBeanKey();\n return OptionalThing.ofNullable(sessionManager.getAttribute(key, getUserBeanType()).orElse(null), () -> {\n throwLoginRequiredException(\"Not found the... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about language and writing:"
} |
Removes a tag from the TimePoint
@param string $tag
@return TimePoint | [
"public function removeTag($tag)\n {\n $index = array_search($tag, $this->tags);\n\n if ($index !== false) {\n array_splice($this->tags, $index, 1);\n $this->ref = null;\n }\n\n return $this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
if config has plugin, override it, else add it | [
"def add_plugin(self, phase, name, args, reason=None):\n \n plugin_modified = False\n\n for plugin in self.template[phase]:\n if plugin['name'] == name:\n plugin['args'] = args\n plugin_modified = True\n\n if not plugin_modified:\n self... | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Appends link to automation script to the test description. | [
"def add_automation_link(testcase):\n \"\"\"\"\"\"\n automation_link = (\n '<a href=\"{}\">Test Source</a>'.format(testcase[\"automation_script\"])\n if testcase.get(\"automation_script\")\n else \"\"\n )\n testcase[\"description\"] = \"{}<br/>{}\".format(testcase.get(\"description\... | [
"@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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns `True` if short cadence data is available for this target.
:param int EPIC: The EPIC ID number
:param int season: The campaign number. Default :py:obj:`None` | [
"def HasShortCadence(EPIC, season=None):\n '''\n \n\n '''\n\n if season is None:\n season = Campaign(EPIC)\n if season is None:\n return None\n stars = GetK2Campaign(season)\n i = np.where([s[0] == EPIC for s in stars])[0]\n if len(i):\n return stars[i[0]][3]\n ... | [
"def _unpack_list(example):\n \n try:\n x = example[0]\n y = example[1]\n meta = None\n return x, y, meta\n except IndexError:\n raise IndicoError(\n \"Invalid input data. Please ensure input data is \"\n \"formatted as a list of `[data, target]` pa... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
end capture
@return Scripts
@access public | [
"public function captureEnd()\n {\n $capture = array_pop($this->capture);\n array_unshift($capture['args'], ob_get_clean());\n call_user_func_array(\n [$this, $capture['func']],\n $capture['args']\n );\n return $this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Chain returns a Chain that evaluates the given Rules, in order, propagating the (context.Context, *scheduler.Call, error)
// from Rule to Rule. Chain is safe to invoke concurrently. | [
"func (rs Rules) Chain() Chain {\n\tif len(rs) == 0 {\n\t\treturn ChainIdentity\n\t}\n\treturn func(ctx context.Context, e *scheduler.Call, z mesos.Response, err error) (context.Context, *scheduler.Call, mesos.Response, error) {\n\t\treturn rs[0].Eval(ctx, e, z, err, rs[1:].Chain())\n\t}\n}"
] | [
"@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Either call close() or get().close() when finished with this handle to close the underlying InputStream. | [
"@Override\n public void close() {\n if ( content != null ) {\n try {\n content.close();\n } catch (IOException e) {\n logger.error(\"Failed to close underlying InputStream\",e);\n throw new MarkLogicIOException(e);\n }\n }\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// NewNvidiaDevice returns a new nvidia device plugin. | [
"func NewNvidiaDevice(log log.Logger) *NvidiaDevice {\n\tnvmlClient, err := nvml.NewNvmlClient()\n\tlogger := log.Named(pluginName)\n\tif err != nil && err.Error() != nvml.UnavailableLib.Error() {\n\t\tlogger.Error(\"unable to initialize Nvidia driver\", \"reason\", err)\n\t}\n\treturn &NvidiaDevice{\n\t\tlogger: ... | [
"@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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Reschedules the specified task, cancelling existing one if applicable.
@param taskRef task reference
@param millis delay in milliseconds | [
"private void rescheduleTask(AtomicReference<TimerTask> taskRef, long millis) {\n ProcessorTask newTask = new ProcessorTask();\n timer.schedule(newTask, millis);\n swapAndCancelTask(taskRef, newTask);\n }"
] | [
"function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Non-blocking call
@param key
@param value
@return | [
"public Future<PutObjectResult> putAsync(String key, String value) {\n return Future.of(() -> put(key, value), this.uploadService)\n .flatMap(t->t.fold(p->Future.ofResult(p),e->Future.ofError(e)));\n }"
] | [
"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:"
} |
Called by the connection manager to let us know when a connection has been closed. | [
"public synchronized void connectionClosed (Connection conn)\n {\n // remove the session from the connection map\n PresentsSession session = _conmap.remove(conn);\n if (session != null) {\n log.debug(\"Unmapped session\", \"session\", session, \"conn\", conn);\n // let ... | [
"private void removeContext(final String contextID) {\n\n synchronized (this.contextStack) {\n\n if (!contextID.equals(this.contextStack.peek().getIdentifier())) {\n throw new IllegalStateException(\"Trying to close context with id `\" + contextID +\n \"`. But the top context has id `\" +\... | codesearchnet | {
"query": "Represent the Github post about Computer Networking:",
"pos": "Represent the Github code about Computer Networking:",
"neg": "Represent the Github code about programming:"
} |
Mutual-accessibility matrix (strongly connected components).
@type graph: graph, digraph
@param graph: Graph.
@rtype: dictionary
@return: Mutual-accessibility information for each node. | [
"def mutual_accessibility(graph):\n \n recursionlimit = getrecursionlimit()\n setrecursionlimit(max(len(graph.nodes())*2,recursionlimit))\n \n mutual_access = {}\n stack = []\n low = {}\n \n def visit(node):\n if node in low:\n return\n\n num = len(low)\n ... | [
"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:"
} |
// SetNextToken sets the NextToken field's value. | [
"func (s *GetConnectorDefinitionVersionInput) SetNextToken(v string) *GetConnectorDefinitionVersionInput {\n\ts.NextToken = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Create a concatenated string of author names. Separate names with semi-colons.
:param any pub: Publication author structure is ambiguous
:param int idx: Index number of Pub | [
"def _extract_authors(pub, idx, _root):\n \n logger_ts.info(\"enter extract_authors\")\n try:\n # DOI Author data. We'd prefer to have this first.\n names = pub['author']\n except KeyError as e:\n try:\n # Manually entered author data. This is second best.\n na... | [
"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 summarization about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code:"
} |
// SetAcceptLanguage sets the AcceptLanguage field's value. | [
"func (s *UpdateProductInput) SetAcceptLanguage(v string) *UpdateProductInput {\n\ts.AcceptLanguage = &v\n\treturn s\n}"
] | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// ReserveAlphaRegionAddress creates an Alpha, regional address. | [
"func (g *Cloud) ReserveAlphaRegionAddress(addr *computealpha.Address, region string) error {\n\tctx, cancel := cloud.ContextWithCallTimeout()\n\tdefer cancel()\n\n\tmc := newAddressMetricContext(\"reserve\", region)\n\treturn mc.Observe(g.c.AlphaAddresses().Insert(ctx, meta.RegionalKey(addr.Name, region), addr))\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 Address:",
"pos": "Represent the Github code about Address:",
"neg": "Represent the Github code about programming:"
} |
Load plugin modules. | [
"def load_modules(self, modules, config):\n \"\"\"\"\"\"\n for pluginclass in get_plugin_classes(modules):\n name = pluginclass.__name__\n if name in config[\"enabledplugins\"]:\n if issubclass(pluginclass, _ConnectionPlugin):\n log.debug(LOG_PLU... | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SafeTimingDuration submits a statsd timing type, logging errors | [
"func (s *LoggingStatter) SafeTimingDuration(stat string, delta time.Duration, rate float32) {\n\tif err := s.TimingDuration(stat, delta, rate); err != nil {\n\t\tlogger.WithError(err).Errorf(\"Error sending stat %s TimingDuration to statsd\", stat)\n\t}\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// GetAddressTransactionsRawWithSkip returns an array of apitypes.AddressTxRaw objects
// representing the raw result of SearchRawTransactionsverbose | [
"func (db *WiredDB) GetAddressTransactionsRawWithSkip(addr string, count int, skip int) []*apitypes.AddressTxRaw {\n\taddress, err := dcrutil.DecodeAddress(addr)\n\tif err != nil {\n\t\tlog.Infof(\"Invalid address %s: %v\", addr, err)\n\t\treturn nil\n\t}\n\ttxs, err := db.client.SearchRawTransactionsVerbose(addres... | [
"func updateAddressesMatchingTxHashPatch(db *sql.DB) (rowsUpdated int64, err error) {\n\treturn sqlExec(db, internal.UpdateAddressesFundingMatchingHash,\n\t\t\"failed to update addresses rows matching_tx_hash\")\n}"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Address:"
} |
// SinglePort returns the port of a non multi-port spec | [
"func (s *PortSpec) SinglePort() (uint16, error) {\n\tif s.IsMultiPort() {\n\t\treturn 0, errors.New(\"Not a single port specification\")\n\t}\n\n\treturn s.Min, nil\n}"
] | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.