query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// assumes the first group is the bit we want | [
"func (l *lex) spanRegexp(re *regexp.Regexp) (before string, match string, success bool) {\n\tloc := re.FindStringSubmatchIndex(l.s[l.p:])\n\tif loc == nil {\n\t\treturn \"\", \"\", false\n\t}\n\tsuccess = true\n\tstart, end := loc[2], loc[3]\n\tbefore = l.s[l.p : l.p+start]\n\tmatch = l.s[l.p:][start:end]\n\tl.p +... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github sentence about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Returns a formatted string representation of this phone number.
@param int $format One of the PhoneNumberFormat constants.
@return string | [
"public function format(int $format) : string\n {\n return PhoneNumberUtil::getInstance()->format($this->phoneNumber, $format);\n }"
] | [
"public static function configureInput(InputDefinition $definition)\n {\n $definition->addOption(new InputOption(\n 'date-fmt',\n null,\n InputOption::VALUE_REQUIRED,\n 'The date format (as a PHP date format string)',\n // @todo refactor so this can b... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Parse a schema and return the corresponding type or protocol. | [
"function parse(schema, opts) {\n var attrs = files.load(schema);\n return attrs.protocol ?\n protocols.createProtocol(attrs, opts) :\n types.createType(attrs, opts);\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code:"
} |
Returns a {@link Pattern} that matches up to {@code max} number of characters satisfying
{@code predicate}.
@since 2.2 | [
"public static Pattern atMost(final int max, final CharPredicate predicate) {\n Checks.checkMax(max);\n return new Pattern() {\n @Override\n public int match(CharSequence src, int begin, int end) {\n return matchSome(max, predicate, src, end, begin, 0);\n }\n };\n }"
] | [
"private static String dotsToRegex(String dotsName) {\n /*\n * oops, next line requires JDK 1.5 return dotsName.replace(\"$\",\n * \"\\\\$\").replace(\".\", SEP); could use String.replaceAll(regex, repl)\n * but that can be problematic--javadoc says \"Note that backslashes (\\)\n ... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Returns true if the given input is a UUID (accepts UUIDs with or without hyphens)
@param uuid
candidate UUID
@return UUID | [
"public static boolean isUuid(final String uuid) {\n return uuid != null && (uuid.length() == 36 || uuid.length() == 32)\n && UUID_PATTERN.matcher(uuid).matches();\n }"
] | [
"public ByteBuffer getByteBuffer() throws InvalidRequestException\n {\n switch (type)\n {\n case STRING:\n return AsciiType.instance.fromString(text);\n case INTEGER:\n return IntegerType.instance.fromString(text);\n case UUID:\n ... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Returns a slot profile for the given resource profile, without any locality requirements. | [
"public static SlotProfile noLocality(ResourceProfile resourceProfile) {\n\t\treturn new SlotProfile(resourceProfile, Collections.emptyList(), Collections.emptyList());\n\t}"
] | [
"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 about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Get the exact installed version for the specified package.
@param string $packageName
@return string mixed | [
"public function getPackageInfo($packageName)\n {\n $composerLock = json_decode($this->finder->get('composer.lock'));\n foreach ($composerLock->packages as $package) {\n if ($package->name == $packageName) {\n return $package;\n }\n }\n }"
] | [
"public File getExistingDirectory(final String param) {\n return get(param, new StringToFile(),\n new And<>(new FileExists(), new IsDirectory()),\n \"existing directory\");\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns the position of the selected area, or <code>null</code> if nothing is selected.<p>
@param relative if <code>true</code> the relative position is returned, otherwise the absolute position
@return the position of the selected area | [
"public CmsPositionBean getAreaPosition(boolean relative) {\n\n // returning the relative position\n if (relative) {\n return new CmsPositionBean(m_currentSelection);\n }\n\n // returning the absolute position\n CmsPositionBean abs = new CmsPositionBean(m_currentSelecti... | [
"function () {\n \n Overlay.superclass.initDefaultConfig.call(this);\n\n var cfg = this.cfg;\n\n // Add overlay config properties //\n \n /**\n * The absolute x-coordinate position of the Overlay\n * @config x\n * @type Numbe... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Set or get the from attribute
@param int $from Give this a value to set the from property
@return int|self | [
"public function from($from = null) {\n if ($from === null) {\n return $this->from;\n }\n\n $this->from = (int) $from;\n\n return $this;\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
<code>.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig k_anonymity_config = 3;</code> | [
"public com.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfigOrBuilder\n getKAnonymityConfigOrBuilder() {\n if (typeCase_ == 3) {\n return (com.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig) type_;\n }\n return com.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.getDefaultInstance(... | [
"@java.lang.Deprecated\n public java.util.Map<\n java.lang.String, com.google.cloud.automl.v1beta1.TimestampStats.GranularStats>\n getGranularStats() {\n return getGranularStatsMap();\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Run MASH to determine the closest refseq genomes | [
"def run_mash(self):\n \n self.pipeline = True\n mash.Mash(inputobject=self,\n analysistype='mash')"
] | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the {@link Option} at the given index.
@param index
@return | [
"public Option getItem(final int index) {\n checkIndex(index);\n OptionElement item = selectElement.getOptions().getItem(index);\n return itemMap.get(item);\n }"
] | [
"public static TypeAnnotationPosition\n classExtends(final List<TypePathEntry> location,\n final int type_index) {\n return classExtends(location, null, type_index, -1);\n }"
] | codesearchnet | {
"query": "Represent the Github post about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
Convenience method to check if 60 seconds has passed since the time this link was created.
@return false if creation time is less than 60 seconds, true otherwise. | [
"public boolean isEmbedLinkUrlExpired(){\n Long urlCreationTime = getUrlCreationTime();\n if (urlCreationTime == null){\n return true;\n }\n return (System.currentTimeMillis() - urlCreationTime) < (60 * 1000);\n }"
] | [
"function ClientState(client) {\n\n /**\n * The associated client instance.\n *\n * @property client\n * @type Client\n */\n this.client = client;\n\n /**\n * The time (in milliseconds) to wait before the next request\n * may be sent to the API; this value is only updated upon\n * reception of a ... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Adds an entity to this Engine.
This will throw an IllegalArgumentException if the given entity
was already registered with an engine. | [
"public void addEntity(Entity entity){\n\t\tboolean delayed = updating || familyManager.notifying();\n\t\tentityManager.addEntity(entity, delayed);\n\t}"
] | [
"@Override\n public void unIndex(Class entityClazz, Object entity, EntityMetadata metadata, MetamodelImpl metamodel)\n {\n // we need not implement this method for Redis because\n // redis automatically removes indexes while performing delete\n logger.warn(\"Removing index is implicitly m... | 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:"
} |
// Decrypt will decrypt the data using AES GCM | [
"func (c *aesGCM) Decrypt(src io.Reader) io.Reader {\n\treturn &gcmDecryptReader{\n\t\tdecrypter: c.aead,\n\t\tnonce: c.nonce,\n\t\tsrc: src,\n\t}\n}"
] | [
"def get_finished_record_bytes(cls, tls_version: TlsVersionEnum) -> bytes:\n \n # TODO(AD): The ROBOT poc script uses the same Finished record for all possible client hello (default, GCM,\n # etc.); as the Finished record contains a hashes of all previous records, it will be wrong and will caus... | codesearchnet | {
"query": "Represent the instruction about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code:"
} |
Convert path objects to strings and path strings to objects | [
"function (input, outputType, verbose) {\n\t\t\tvar output;\n\n\t\t\t// If no output type has been specified, try to set it to the\n\t\t\t// opposite of the input\n\t\t\tif (typeof outputType === 'undefined') {\n\t\t\t\toutputType = (typeof input === 'string') ? 'object' : 'string';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * ... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Creates an addValue transaction through the HpsGiftCardService | [
"public function execute()\n {\n parent::execute();\n\n $addValueSvc = new HpsGiftCardService($this->service->servicesConfig());\n if ($this->token != null && ($this->token instanceof HpsTokenData)) {\n if ($this->card == null) {\n $this->card = new HpsGiftCard();\n... | [
"@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Limit feedrate. | [
"func (vm *Machine) LimitFeedrate(feed float64) {\n\tfor idx, m := range vm.Positions {\n\t\tif m.State.Feedrate > feed {\n\t\t\tvm.Positions[idx].State.Feedrate = feed\n\t\t}\n\t}\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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Register custom entity services implementations.
@return void
@throws BindingResolutionException | [
"protected function registerCustomBindings(): void\n {\n $entityServiceFactory = $this->app->make(IEntityServiceFactory::class);\n\n foreach (config('laravel_entity_services.bindings') as $className => $entityService) {\n $entityServiceFactory->register($className, $entityService);\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// SetBackLED sets the Sphero Back LED to the specified brightness | [
"func (s *SpheroDriver) SetBackLED(level uint8) {\n\ts.packetChannel <- s.craftPacket([]uint8{level}, 0x02, 0x21)\n}"
] | [
"def get_hs_color(self):\n \n # Get the color from homematic. In general this is just the hue parameter.\n hm_color = self.getCachedOrUpdatedValue(\"COLOR\", channel=self._color_channel)\n\n if hm_color >= 200:\n # 200 is a special case (white), so we have a saturation of 0.\n... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Implementation of the HuggableInterface
@param Huggable $huggable | [
"public function hug(Huggable $huggable)\n {\n // If huggable is a container\n if ($huggable instanceof Container) {\n $this->register($huggable);\n }\n $this->returnHug($this);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Create an import declaration and delegates its registration for an upper class. | [
"public synchronized void createImportationDeclaration(String deviceId, String deviceType, String deviceSubType) {\n Map<String, Object> metadata = new HashMap<String, Object>();\n metadata.put(Constants.DEVICE_ID, deviceId);\n metadata.put(Constants.DEVICE_TYPE, deviceType);\n metadata.... | [
"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 software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code about Software development:"
} |
Sets the activityAssociations value for this LineItemSummary.
@param activityAssociations * This attribute is required and meaningful only if the {@link
LineItem#costType} is {@link
CostType.CPA}. | [
"public void setActivityAssociations(com.google.api.ads.admanager.axis.v201805.LineItemActivityAssociation[] activityAssociations) {\n this.activityAssociations = activityAssociations;\n }"
] | [
"@Override\n public void writeFragmentTo(MwsWriter w) {\n w.write(\"SellerId\", sellerId);\n w.writeList(\"AmazonOrderId\", \"Id\", amazonOrderId);\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about writing:"
} |
Configure polling of an attribute or a command and start it
@param polledObject The name of the polled object (attribute or command)
@param pollingPeriod The polling period
@throws DevFailed | [
"public void startPolling(final String polledObject, final int pollingPeriod) throws DevFailed {\n try {\n final AttributeImpl attr = AttributeGetterSetter.getAttribute(polledObject, device.getAttributeList());\n attr.configurePolling(pollingPeriod);\n device.startPolling(att... | [
"private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(UnprocessedIdentityId unprocessedIdentityId, ProtocolMarshaller protocolMarshaller) {\n\n if (unprocessedIdentityId == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(un... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Use the current IDD and read an IDF from text data. If the IDD has not
yet been initialised then this is done first.
Parameters
----------
idftxt : str
Text representing an IDF file. | [
"def initreadtxt(self, idftxt):\n \n iddfhandle = StringIO(iddcurrent.iddtxt)\n if self.getiddname() == None:\n self.setiddname(iddfhandle)\n idfhandle = StringIO(idftxt)\n self.idfname = idfhandle\n self.read()"
] | [
"def getMetadata(L):\n \n _l = {}\n try:\n # Create a copy. Do not affect the original data.\n _l = copy.deepcopy(L)\n # Remove values fields\n _l = rm_values_fields(_l)\n except Exception as e:\n # Input likely not formatted correctly, though other problems can occur.... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Computer Science:"
} |
Implementations for collections. | [
"@Override\n protected SoyValue visitListLiteralNode(ListLiteralNode node) {\n List<SoyValue> values = this.visitChildren(node);\n return ListImpl.forProviderList(values);\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returned expression results in the first position of the substring within the string, or -1.
The position is zero-based, i.e., the first position is 0. | [
"public static Expression position(String expression, String substring) {\n return position(x(expression), substring);\n }"
] | [
"def _get_fill_indexer_searchsorted(self, target, method, limit=None):\n \n if limit is not None:\n raise ValueError('limit argument for %r method only well-defined '\n 'if index and target are monotonic' % method)\n\n side = 'left' if method == 'pad' else... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Create the URL
@param properties
@return
@throws RottenTomatoesException | [
"public static String create(Map<String, String> properties) throws RottenTomatoesException {\n if (StringUtils.isBlank(apiKey)) {\n throw new RottenTomatoesException(ApiExceptionType.INVALID_URL, \"Missing API Key\");\n }\n\n StringBuilder urlBuilder = new StringBuilder(API_SITE);\n... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the post about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code:"
} |
// DeviceForPath returns the device ID for the specified volume. | [
"func DeviceForPath(path string) (int32, error) {\n\tstat := syscall.Stat_t{}\n\tif err := syscall.Lstat(path, &stat); err != nil {\n\t\treturn 0, err\n\t}\n\treturn stat.Dev, nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Helper method for the ping command that uses `output()` for info output
and raises `CLIError()` on handled errors.
This function is invariant to output format and/or error signaling mechanism. | [
"def _ping(config_file, profile, solver_def, request_timeout, polling_timeout, output):\n \n\n config = dict(config_file=config_file, profile=profile, solver=solver_def)\n if request_timeout is not None:\n config.update(request_timeout=request_timeout)\n if polling_timeout is not None:\n c... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Normalizes string, converts to lowercase, removes non-alpha characters,
and converts spaces to hyphens. | [
"def slugify(value, hyphenate=True, lower=True):\n \n import unicodedata\n value = unicodedata.normalize('NFKD', value).strip()\n replacement = '-' if hyphenate else ''\n if lower: value = value.lower()\n return _CHANGEME_RE.sub(replacement, value)"
] | [
"public static String pathEncode(String path, Charset charset) {\n return encodeReserved(path, FragmentType.PATH_SEGMENT, charset);\n\n /*\n * path encoding is not equivalent to query encoding, there are few differences, namely dealing\n * with spaces, !, ', (, ), and ~ characters. we will need to man... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
This method gets the {@link IocContainer} for the given {@code xmlClasspath}.
@param xmlClasspath is the classpath to the XML configuration.
@return the requested container. | [
"public static IocContainer getInstance(String xmlClasspath) {\n\n if (xml2containerMap == null) {\n xml2containerMap = new HashMap<>();\n }\n SpringContainer container = xml2containerMap.get(xmlClasspath);\n if (container == null) {\n container = new SpringContainer(new ClassPathXmlApplicatio... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp... | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Method: moveTo
Move the marker to the new location.
Parameters:
px - {<OpenLayers.Pixel>|Object} the pixel position to move to.
An OpenLayers.Pixel or an object with a 'x' and 'y' properties. | [
"function (px) {\n if ((px != null) && (this.icon != null)) {\n this.icon.moveTo(px);\n } \n this.lonlat = this.map.getLonLatFromLayerPx(px);\n }"
] | [
"function (type) {\n /**\n * Type of this object.\n * @type {WKTType}\n */\n this.type = type;\n\n /**\n * It is possible for the WKT object to be displayed not in 2D but in 3D.\n * @type {Boolean}\n * @private\n */\n this._is3d = f... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns:
np.ndarray: Predictions on the hold-out folds (unseen data, corresponds to :py:attr:`y`). | [
"def get_CV_prediction(self):\n \n # TODO: get it from the test_prediction ...\n # test_id, prediction\n # sort by test_id\n predict_vec = np.zeros((self._n_rows, self._concise_model._num_tasks))\n for fold, train, test in self._kf:\n acc = self._cv_model[fold].g... | [
"def _match_class_pos(self):\n \"\"\"\"\"\"\n # TODO: add notfitted warnings\n if self.kernel.classes_.shape[0] != 2:\n raise ValueError(\"Number of classes is {}, expected 2.\".format(\n self.kernel.classes_.shape[0]))\n\n # # get the position of match probabil... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(StartGatewayRequest startGatewayRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (startGatewayRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(startGat... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Bootstrap any application services.
@return void | [
"public function boot()\n {\n $this->publishes([\n __DIR__.'/../../config/admin-lte.php' => config_path('admin-lte.php'),\n ], 'config');\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'admin-lte');\n $this->publishes([\n __DIR__.'/../../resources/views... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// Insert returns insert all columns statement. | [
"func (t *Table) Insert() (stmt string, names []string) {\n\treturn t.insert.stmt, t.insert.names\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
--- Localizations --- | [
"public void addRequestedLocalization(final Object node, final String key, final String domain, final String locale, final Localization localization) {\n\n\t\tfinal GenericProperty keyKey = new GenericProperty(\"key\");\n\t\tfinal GenericProperty domainKey = new GenericProperty(\"domain\");\n\t\tfinal GenericPro... | [
"def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Fetches the configuration summary of active tasks for the specified job.
//
// Parameters:
// - Job | [
"func (p *ReadOnlySchedulerClient) GetConfigSummary(ctx context.Context, job *JobKey) (r *Response, err error) {\n var _args62 ReadOnlySchedulerGetConfigSummaryArgs\n _args62.Job = job\n var _result63 ReadOnlySchedulerGetConfigSummaryResult\n if err = p.Client_().Call(ctx, \"getConfigSummary\", &_args62, &_resu... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
// Retrieve The metric tracking object for this network component. | [
"func (r Network_Component) GetMetricTrackingObject() (resp datatypes.Metric_Tracking_Object, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Network_Component\", \"getMetricTrackingObject\", nil, &r.Options, &resp)\n\treturn\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 about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code:"
} |
Import a JSON dict into this DDO. | [
"def _read_dict(self, dictionary):\n \"\"\"\"\"\"\n values = dictionary\n self._did = values['id']\n self._created = values.get('created', None)\n if 'publicKey' in values:\n self._public_keys = []\n for value in values['publicKey']:\n if isins... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Convert a byte value to boolean (0 or 1) if
the global flag strictBool is True | [
"def convertToBool():\n \n if not OPTIONS.strictBool.value:\n return []\n\n REQUIRES.add('strictbool.asm')\n\n result = []\n result.append('pop af')\n result.append('call __NORMALIZE_BOOLEAN')\n result.append('push af')\n\n return result"
] | [
"public static Boolean lte(Object left, Object right) {\n return or(lt(left, right),\n eq(left, right)); // do not use Java || to avoid potential NPE due to FEEL 3vl.\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Sorts the measurements of this buffer in reverse chronological order | [
"def sort_reverse_chronologically(self):\n \n self.measurements.sort(key=lambda m: m.timestamp, reverse=True)"
] | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Save the results into the form
Calls function $record->onChange($items) before saving to the assummed
Component set.
@param DataObjectInterface $record | [
"public function saveInto(DataObjectInterface $record)\n {\n $items = [];\n $fieldName = $this->name;\n $saveDest = $record->$fieldName();\n\n if (!$saveDest) {\n $recordClass = get_class($record);\n user_error(\n \"TreeMultiselectField::saveInto()... | [
"function resolve(){\n\t\tLRState::clear_index();\n\t\tLRStation::clear_index();\n\t\t// create Root Set\n\t\t// we SHOULD have a single etransition to an intial state\n\t\treturn LRStateSet::init( $this->etransitions[0], $this->Grammar );\n\t}"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Computer Science:"
} |
Creates client exception from response.
@param ResponseInterface $response
@param array $data Parsed response data
@return IdentityProviderException | [
"public static function clientException(ResponseInterface $response, $data)\n {\n return static::fromResponse(\n $response,\n isset($data['message']) ? $data['message'] : $response->getReasonPhrase()\n );\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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Preparing before init
@param object Source request
@return void | [
"protected function preinit($req)\n {\n if ($req === null) {\n $req = new \\stdClass;\n $req->attrs = new \\stdClass;\n }\n\n $this->attrs = $req->attrs;\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:"
} |
Render the template
@access public
@param string $template
@param array $data
@param int $status
@return void | [
"public function render($template, $data = array(), $status = null)\n {\n if (!is_null($status) && headers_sent() === false) {\n header($this->container->getResponse()->_convert_status($status));\n }\n $this->container->getView()->display($template, $data);\n }"
] | [
"protected function createLink(DataGrid $grid, $href, $params)\n\t{\n\t\t/**\n\t\t * Int case of ActionCallback, $this->href is a identifier of user callback\n\t\t */\n\t\t$params = $params + ['__key' => $this->href];\n\n\t\treturn $this->grid->link('actionCallback!', $params);\n\t}"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
upload from the given inputstream
@param fileToUpload
@param filename
@param contents
@param comment
@throws Exception | [
"public synchronized void upload(InputStream fileToUpload, String filename,\n String contents, String comment) throws Exception {\n TokenResult token = getEditToken(\"File:\" + filename, \"edit\");\n final FormDataMultiPart multiPart = new FormDataMultiPart();\n // http://stackoverflow.com/questions/5... | [
"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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about File management:"
} |
<p>
Gets the minimum of two <code>float</code> values.
</p>
<p>
NaN is only returned if all numbers are NaN as per IEEE-754r.
</p>
@param a
value 1
@param b
value 2
@return the smallest of the values | [
"public static float min(final float a, final float b) {\r\n if (Float.isNaN(a)) {\r\n return b;\r\n } else if (Float.isNaN(b)) {\r\n return a;\r\n } else {\r\n return Math.min(a, b);\r\n }\r\n }"
] | [
"function parseFormulaData (nulls, operation, result) {\n /**\n * @description\n * Object containing formula data\n *\n * @typedef {object} carto.dataview.FormulaData\n * @property {number} nulls - Number of null values in the column\n * @property {string} operation - Operation used\n * @property {nu... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// NewClearDataForOriginArgs initializes ClearDataForOriginArgs with the required arguments. | [
"func NewClearDataForOriginArgs(origin string, storageTypes string) *ClearDataForOriginArgs {\n\targs := new(ClearDataForOriginArgs)\n\targs.Origin = origin\n\targs.StorageTypes = storageTypes\n\treturn args\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
@param $name
@return LkNgHeader | [
"static function register($name) {\n if(!isset(self::$items[$name])) {\n self::$items[$name] = new LkNgHeader($name);\n }\n \n return self::$items[$name];\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
You can add Nodes (Uris, Blank Nodes, Predicates), Literals and Collections
So a Node has the following structure:
<node> <uri> or <node> <literal> (tuple)
<node> <predicate> == <node> (<predicate_node> <predicate.nodes>) (triples) | [
"def <<(node)\n raise ArgumentError, \"#{node.inspect} is no IqRdf::Node or a IqRdf::Literal or a IqRdf::Collection\" unless node.is_a?(IqRdf::Node) || node.is_a?(IqRdf::Literal) || node.is_a?(IqRdf::Collection)\n @nodes << node\n end"
] | [
"def add_molecular_activity(_activity_identifier)\n argument(\n term(\n function(\n identifier('molecularActivity')),\n argument(\n parameter(\n prefix(nil),\n value(\n identifier('kin'))))))\n end"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
物理属性渲染
@memberOf PhysicsViewMixin
@private | [
"function() {\n this.x = this.body.p.x;\n this.y = this.body.p.y;\n this.rotation = this.body.a * RAD2DEG;\n }"
] | [
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return a dictionary of the form {name: field_generator} containing
all tohu generators defined in the class and instance namespace
of this custom generator. | [
"def _find_field_generator_templates(self):\n \n field_gen_templates = {}\n\n # Extract field generators from class dict\n for name, g in self.__class__.__dict__.items():\n if isinstance(g, TohuBaseGenerator):\n field_gen_templates[name] = g.set_tohu_name(f'{nam... | [
"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 Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
根据<code>JsonNode</code>以及<code>Type</code>还原对象
@param type
@param jsonNode
@return
@throws Exception | [
"@SuppressWarnings(\"unchecked\")\r\n public <T> T decode(Type type, JsonNode jsonNode) throws Exception {\r\n return (T) (mapper.fromJson(jsonNode, type));\r\n }"
] | [
"public static XmlTypeConvert resolve(BeanUtils.CustomPropertyDescriptor filed) {\n XmlTypeConvert convert;\n if (filed.isGeneralType() || filed.isBasic()) {\n convert = XmlTypeConverterUtil.converters.get(filed.getTypeName());\n } else if (String.class.equals(filed.getRealType())) {... | codesearchnet | {
"query": "Represent the Github instruction about Encryption:",
"pos": "Represent the Github code about Encryption:",
"neg": "Represent the Github code about programming:"
} |
Process the extends recursively
:nodoc:
@api private | [
"def recurse_extends(yml, key, visited)\n assert_not_visited(key, visited)\n return yml[key] unless has_extends?(yml, key)\n return yml[key] unless parents_exist?(yml, key)\n visited[key] = key\n parent_keys = [yml[key]['extends']].flatten\n h = {}\n parent_keys.each do |parent_ke... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Render an exception into an HTTP response.
@param \Illuminate\Http\Request $request
@param \Exception $exception
@return \Illuminate\Http\Response | [
"public function render($request, Exception $exception)\n\t{\n\t\treturn Exceptum::render($request, $exception) ?? parent::render($request, $exception);\n\t}"
] | [
"public function run()\n {\n $this->loadMiddleware();\n\n //~ Default response\n $response = new HttpMessage\\Response();\n //$response->getBody()->write('-- static --');\n\n //~ Get response\n $stack = new HttpMiddleware\\Stack($response, $this->middleware);\n ... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// int rbd_snap_protect(rbd_image_t image, const char *snap_name); | [
"func (snapshot *Snapshot) Protect() error {\n\tvar c_snapname *C.char = C.CString(snapshot.name)\n\tdefer C.free(unsafe.Pointer(c_snapname))\n\n\treturn GetError(C.rbd_snap_protect(snapshot.image.image, c_snapname))\n}"
] | [
"def _bse_cli_create_bundle(args):\n ''''''\n bundle.create_bundle(args.bundle_file, args.fmt, args.reffmt, args.archive_type, args.data_dir)\n return \"Created \" + args.bundle_file"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates Data-Object for Deletion
@param string|string[] $shipmentNumbers - Shipment-Number(s) of the Shipment(s) to delete (up to 30 Numbers)
@return StdClass - Data-Object | [
"private function createDeleteClass_v2($shipmentNumbers) {\n\t\t$data = new StdClass;\n\n\t\t$data->Version = $this->getVersionClass();\n\n\t\tif(is_array($shipmentNumbers)) {\n\t\t\t$this->checkRequestCount($shipmentNumbers, 'deleteShipmentOrder');\n\n\t\t\tforeach($shipmentNumbers as $key => &$number)\n\t\t\t\t$d... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about PHP:"
} |
The 'nearest' implementation of the OSRM server API.
https://github.com/DennisOSRM/Project-OSRM/wiki/Server-api
@param \Osrm\Coordinate $coordinate
@return type | [
"public function getNearestStreetPoint(Coordinate $coordinate) {\n $this->prepareServerUrl();\n \n $requestUrl = $this->server . 'nearest?' . $coordinate;\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $... | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
If pkg is null then will use any available bundle to provide the translator. | [
"public static boolean isXmlDocumentTranslator(Package pkg, String type) {\n com.centurylink.mdw.variable.VariableTranslator trans = getTranslator(pkg, type);\n return (trans instanceof XmlDocumentTranslator);\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
执行查询并返回结果
@access public
@param string $sql SQL语句
@param array $data 参数预绑定
@return array | [
"public function query(string $sql, $data = null) {\n\t\t$connection = $this->pool->getConnection();\n\t\t$result = null;\n\t\t$tryAgain = true;\nSQL_START_EXECUTE:\n\t\tif (is_array($data) && count($data) > 0) {\n\t\t\tif (strpos($sql, ':') !== false) {\n\t\t\t\t$bind = [];\n\t\t\t\t$sql = preg_replace_callback('/... | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Interval assuming gaussian posterior. | [
"def mean_interval(self, name, alpha=_alpha, **kwargs):\n \n data = self.get(name,**kwargs)\n #return ugali.utils.stats.mean_interval(data,alpha)\n return mean_interval(data,alpha)"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Insert a new record
@param string $name
@return boolean | [
"protected function insertRecord($name)\n {\n try {\n return (bool) $this->db\n ->insert(array(\n $this->columns['name'] => $name,\n $this->columns['data'] => serialize($this->cache[$name]->toArray()),\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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SimpleFSFolderEditHistory returns the edit history for the given TLF. | [
"func (k *SimpleFS) SimpleFSFolderEditHistory(\n\tctx context.Context, path keybase1.Path) (\n\tres keybase1.FSFolderEditHistory, err error) {\n\tctx = k.makeContext(ctx)\n\tfb, _, err := k.getFolderBranchFromPath(ctx, path)\n\tif err != nil {\n\t\treturn keybase1.FSFolderEditHistory{}, err\n\t}\n\tif fb == (data.F... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
增加查询条件,查询字段的值必须为指定值。
:param key: 查询条件的字段名
:param value: 查询条件的值
:rtype: Query | [
"def equal_to(self, key, value):\n \n self._where[key] = utils.encode(value)\n return self"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the Github description about text analysis:",
"pos": "Represent the Github code about text analysis:",
"neg": "Represent the Github code about programming:"
} |
Temporarily disable SSH host-key checking for SSH clients invoked by Git, for the duration of the
block that is passed to this method.
@yield after disabling strict host key checking, yields to caller | [
"def without_host_key_checking_linux\n tmpdir = ::Dir.mktmpdir\n ssh_cmd = ::File.join(tmpdir, 'ssh')\n\n ::File.open(ssh_cmd, 'w') do |cmd|\n cmd.puts \"#!/bin/bash\"\n cmd.puts \"exec ssh -o StrictHostKeyChecking=no ${@}\"\n end\n ::FileUtils.chmod(0700, ssh_cmd)\n\n ol... | [
"def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Initialize kundera params.
@param reader
the reader | [
"private void initializeKunderaParams(PropertyReader reader)\n {\n Map<String, String> props = KunderaPropertyBuilder.populatePersistenceUnitProperties(reader);\n try\n {\n emf = Persistence.createEntityManagerFactory(EthConstants.PU, props);\n }\n catch (ClientResol... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// ViewHistory returns a list of the revision history of a statefulset
// TODO: this should be a describer
// TODO: needs to implement detailed revision view | [
"func (h *StatefulSetHistoryViewer) ViewHistory(namespace, name string, revision int64) (string, error) {\n\t_, history, err := statefulSetHistory(h.c.AppsV1(), namespace, name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif len(history) <= 0 {\n\t\treturn \"No rollout history found.\", nil\n\t}\n\trevisions... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
//= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
//
// Change Handling
//
//= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | [
"func (n *Node) handleChanges(changes []Change) {\n\tn.disseminator.AdjustMaxPropagations()\n\tfor _, change := range changes {\n\t\tn.disseminator.RecordChange(change)\n\n\t\tswitch change.Status {\n\t\tcase Alive:\n\t\t\tn.stateTransitions.Cancel(change)\n\n\t\tcase Suspect:\n\t\t\tn.stateTransitions.ScheduleSusp... | [
"public static int crossLine (float x1, float y1, float x2, float y2, float x, float y) {\n // LEFT/RIGHT/UP/EMPTY\n if ((x < x1 && x < x2) || (x > x1 && x > x2) || (y > y1 && y > y2) || (x1 == x2)) {\n return 0;\n }\n\n // DOWN\n if (y < y1 && y < y2) {\n } else... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
在某个段落起始处插入表格
@param run
@param row
@param col
@return | [
"public XWPFTable insertNewTable(XWPFRun run, int row, int col) {\n XmlCursor cursor = ((XWPFParagraph) run.getParent()).getCTP().newCursor();\n\n // XmlCursor cursor = run.getCTR().newCursor();\n if (isCursorInBody(cursor)) {\n String uri = CTTbl.type.getName().getNamespaceURI();\n ... | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Helper function for the getXXX calls to check isFunction and index == 1.
@param parameterIndex index of getXXX (index) check to make sure is a function and index == 1
@param fetchingData fetching data | [
"private void checkIndex(int parameterIndex, boolean fetchingData) throws SQLException {\n if (!isFunction) {\n throw new PSQLException(\n GT.tr(\n \"A CallableStatement was declared, but no call to registerOutParameter(1, <some type>) was made.\"),\n PSQLState.STATEMENT_NOT_A... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
/* (non-Javadoc)
@see org.archive.wayback.resourcestore.resourcefile.ResourceFileSource#getFileList() | [
"public ResourceFileList getResourceFileList() throws IOException {\n\t\t\n\t\tString url = \"http://localhost:8080\" + jsp + \"?url=\" + prefix;\n\t\tURL u = new URL(url);\n\t\tInputStream is = u.openStream();\n\t\tInputStreamReader isr = new InputStreamReader(is,ByteOp.UTF8);\n\t\tStringBuilder sb = new StringBui... | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the sentence about org.archive.wayback.resourceindex:",
"pos": "Represent the code about org.archive.wayback.resourceindex:",
"neg": "Represent the code:"
} |
Format and validate the phone number using libphonenumber. | [
"def _deserialize(self, value, attr, data):\n \"\"\"\"\"\"\n if value:\n value = self._format_phone_number(value, attr)\n\n return super(PhoneNumberField, self)._deserialize(value, attr, data)"
] | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Serialized tx will have:
- raw tx data
- array of input colors (verified yes/no, asset id, units)
- array of output colors (verified yes/no, asset id, units) - do not contain marker output | [
"def data\n data = \"\".b\n txdata = @transaction.data\n data << WireFormat.encode_string(txdata)\n @inputs.each do |ain|\n data << ain.assets_data\n end\n @outputs.each do |aout|\n if !aout.marker?\n data << aout.assets_data\n end\n end\n data\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 Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// IsValidObjectPrefix verifies whether the prefix is a valid object name.
// Its valid to have a empty prefix. | [
"func IsValidObjectPrefix(object string) bool {\n\tif hasBadPathComponent(object) {\n\t\treturn false\n\t}\n\tif len(object) > 1024 {\n\t\treturn false\n\t}\n\tif !utf8.ValidString(object) {\n\t\treturn false\n\t}\n\t// Reject unsupported characters in object name.\n\tif strings.ContainsAny(object, \"\\\\\") {\n\t\... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
@param Request $request
@param string $name
@return Response|RedirectResponse | [
"public function styleEditAction(Request $request, $name)\n {\n $style_file_path = $this->get('kernel')->getBundle('SiteBundle')->getPath().'/Resources/public/css/'.$name;\n\n if (!file_exists($style_file_path)) {\n return $this->redirectToRoute('cms_admin_appearance');\n }\n\n ... | [
"public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes\n {\n return new File($data->getResult(), $logger);\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Iterate on object
@param {*} object
@param {Function} iterator
@param {*} thisp
@return undefined | [
"function forEach(object, iterator, thisp) {\n if (object) {\n if (object.forEach) {\n object.forEach(iterator, thisp);\n return;\n }\n //Default implementation\n if (! (iterator instanceof Function)) {\n throw new TypeError('iterator should be a Funct... | [
"function Message(instanceList, // @arg InstanceObject - address list. { id: instance, ... }\n methodName) { // @arg MethodNameString = \"inbox\" - instance[method]\n // @desc MessagePassing implementation.\n this._instanceList = instanceList;\n this._methodName ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// addUnit modifies the map of applications being watched when a unit is
// added to the machine. Notification is sent if a new unit whose charm has
// an lxd profile is added. | [
"func (w *MachineLXDProfileWatcher) addUnit(topic string, value interface{}) {\n\t// We don't want to respond to any events until we have been fully initialized.\n\tselect {\n\tcase <-w.initialized:\n\tcase <-w.tomb.Dying():\n\t\treturn\n\t}\n\tvar notify bool\n\tdefer func(notify *bool) {\n\t\tif *notify {\n\t\t\t... | [
"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 comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
// checkExtensionTypes checks that the given extension is valid for pb. | [
"func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error {\n\tvar pbi interface{} = pb\n\t// Check the extended type.\n\tif ea, ok := pbi.(extensionAdapter); ok {\n\t\tpbi = ea.extendableProtoV1\n\t}\n\tif a, b := reflect.TypeOf(pbi), reflect.TypeOf(extension.ExtendedType); a != b {\n\t\treturn... | [
"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 comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
writes the sha1 a file if and only if the contents of the file do not match | [
"def write_sha1(file,sha1)\n shafile = \"#{file}.sha1\"\n File.open(shafile, 'w') { |f| f.write(sha1) }\n end"
] | [
"def check_header\n # According to the official DICOM standard, a DICOM file shall contain 128 consequtive (zero) bytes,\n # followed by 4 bytes that spell the string 'DICM'. Apparently, some providers seems to skip this in their DICOM files.\n # Check that the string is long enough to contain a vali... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Create new file
Returns True if successful | [
"def create_new_file(self, current_path, title, filters, create_func):\r\n \"\"\"\"\"\"\r\n if current_path is None:\r\n current_path = ''\r\n if osp.isfile(current_path):\r\n current_path = osp.dirname(current_path)\r\n self.redirect_stdio.emit(False)\r\n fn... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Display information about a domain. | [
"def info(gandi, resource):\n \"\"\"\"\"\"\n output_keys = ['fqdn', 'nameservers', 'services', 'zone_id', 'tags',\n 'created', 'expires', 'updated']\n contact_field = ['owner', 'admin', 'bill', 'tech', 'reseller']\n\n result = gandi.domain.info(resource)\n output_contact_info(gandi,... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Col returns a vector representing the corresponding column (starting at col 0).
// This package makes no distinction between row and column vectors, so it
// will be a normal VecN for a MxN matrix. | [
"func (m Mat2) Col(col int) Vec2 {\n\treturn Vec2{m[col*2+0], m[col*2+1]}\n}"
] | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get the confusion matrix as a String
@return Confusion matrix as a String | [
"public String confusionMatrix(){\n int nClasses = numClasses();\n\n if(confusion == null){\n return \"Confusion matrix: <no data>\";\n }\n\n //First: work out the maximum count\n List<Integer> classes = confusion.getClasses();\n int maxCount = 1;\n for (I... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set the configured user to what was probably suggested | [
"public function setConfiguredUserAction()\n {\n $user = $this->getRequest()->getParam('user');\n Mage::getModel('core/config')\n ->saveConfig(Aoe_Scheduler_Helper_Data::XML_PATH_CRON_USER, (string) $user);\n\n $this->_getSession()->addSuccess($this->__('Configured cron user updat... | [
"func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add task to this storage. Depends on :attr:`.WTaskRegistryStorage.__multiple_tasks_per_tag__`
tasks with the same __registry_tag__ can be treated as error.
:param task_cls: task to add
:return: None | [
"def add(self, task_cls):\n\t\t\n\n\t\tregistry_tag = task_cls.__registry_tag__\n\t\tif registry_tag not in self.__registry.keys():\n\t\t\tself.__registry[registry_tag] = [task_cls]\n\t\telif self.__multiple_tasks_per_tag__ is True:\n\t\t\tself.__registry[registry_tag].append(task_cls)\n\t\telse:\n\t\t\traise Runti... | [
"def remove_component(self, component, **kwargs):\n \n # NOTE: run_checks will check if an entry is in the hierarchy but has no parameters\n kwargs['component'] = component\n # NOTE: we do not remove from 'model' by default\n kwargs['context'] = ['component', 'constraint', 'datase... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Saves (if not already saved) by stream id a subscription of service call coming in form of
{@link Disposable} reference.
@param streamId stream id
@param disposable service subscription
@return true if disposable subscription was stored | [
"public boolean register(Long streamId, Disposable disposable) {\n boolean result = false;\n if (!disposable.isDisposed()) {\n result = subscriptions.putIfAbsent(streamId, disposable) == null;\n }\n if (result) {\n LOGGER.debug(\"Registered subscription with sid={}, session={}\", streamId, id)... | [
"public void away (ClientObject caller, String message)\n {\n BodyObject body = _locator.forClient(caller);\n // we modify this field via an invocation service request because a body object is not\n // modifiable by the client\n body.setAwayMessage(message);\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Returns the tax rate for the given country code.
This method is used to allow backwards compatibility.
@param $countryCode
@param bool $company
@param string $type
@return float | [
"public function getTaxRateForCountry($countryCode, $company = false, $type = null)\n {\n return $this->getTaxRateForLocation($countryCode, null, $company, $type);\n }"
] | [
"public function resetAllInvoiceOptions(): Client\n {\n $this->sendInvoiceByPost = null;\n $this->invoiceMaturityDays = null;\n $this->stopServiceDue = null;\n $this->stopServiceDueDays = null;\n // TODO: Add 'Late fee delay' to list of resets when made available!\n\n /*... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Returns the field-descriptors. Ensures that the descriptors get only instantiated once.
@param $entityName
@return DoctrineFieldDescriptor[] | [
"private function getFieldDescriptors($entityName, $id)\n {\n if (null === $this->fieldDescriptors) {\n $this->initFieldDescriptors($entityName, $id);\n }\n\n return $this->fieldDescriptors;\n }"
] | [
"private void checkSchemaFields(ZooClassDef schema, Collection<ZooClassDef> cachedSchemata, \n\t\t\tSet<String> missingSchemas) {\n\t\t//do this only now, because only now we can check which field types\n\t\t//are really persistent!\n\t\t//TODO check for field types that became persistent only now -> error!!\n\t\t/... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Registers with the leader master.
@param masterId the master id of the standby master registering
@param configList the configuration of this master | [
"public void register(final long masterId, final List<ConfigProperty> configList)\n throws IOException {\n retryRPC(() -> {\n mClient.registerMaster(RegisterMasterPRequest.newBuilder().setMasterId(masterId)\n .setOptions(RegisterMasterPOptions.newBuilder().addAllConfigs(configList).build())\n ... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
取得一个缩略图.
path - 文件的路径, 可以包括绝对路径, 也可以是文件名.
isdir - 是否为一个目录.
icon_size - 图标的大小, 如果是显示在IconView中的, 48就可以;
如果是显示在TreView的话, 可以用Gtk.IconSize.MENU
@return 会返回一个Pixbuf以象, 和这个文件的类型(MIME) | [
"def get(self, path, isdir, icon_size=ICON_SIZE):\n '''\n '''\n file_type = self.get_mime(path, isdir)\n key = (file_type, icon_size)\n if key in self._data:\n return (self._data.get(key), file_type)\n\n themed_icon = Gio.content_type_get_icon(file_type)\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about text processing:"
} |
Create Hibernate query object and initialize it from this helper properties.
@param hql query string expressed in HQL.
@return newly created Hibernate query object. | [
"private org.hibernate.Query query(String hql, Class<?>... type)\r\n {\r\n org.hibernate.Query q = session.createQuery(hql);\r\n for(int i = 0; i < positionedParameters.length; i++) {\r\n q.setParameter(i, positionedParameters[i]);\r\n }\r\n for(Map.Entry<String, Object> entry : namedParameters.en... | [
"public static QueryBuilderFind fromType(Class<? extends WindupVertexFrame> type)\n {\n final Query query = new Query();\n // this query is going to be added after evaluate() method, because in some cases we need gremlin and in some\n // frames\n query.searchType = type;\n retu... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software Development:"
} |
Marshall the given parameter object. | [
"public void marshall(DeleteMailboxPermissionsRequest deleteMailboxPermissionsRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (deleteMailboxPermissionsRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Optimize index.
Merges all segments into one | [
"public function optimize()\n {\n // Commit changes if any changes have been made\n $this->commit();\n\n if (count($this->_segmentInfos) > 1 || $this->hasDeletions()) {\n $this->_getIndexWriter()->optimize();\n $this->_updateDocCount();\n }\n }"
] | [
"long storeSpaceForAdd() {\n return ConcurrentSubList.maximumSerializedSize() // List header\n + 3 * ConcurrentSubList.Link.maximumSerializedSize() // Current,Previous,Next links \n + 4 * owningToken.objectStore.getAddSpaceOverhead() // Store overhead for all of the above.\n ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Action to clear all items in file starting with the prefix.
@param bool $ok The delete status
@param \SplFileInfo $file The spl file info
@param string $prefix The prefix | [
"private function doClearFile(&$ok, \\SplFileInfo $file, $prefix): void\n {\n $keys = [];\n\n if ($file->isFile()) {\n $key = $this->getFileKey($file);\n\n if (null !== $key && ('' === $prefix || 0 === strpos($key, $prefix))) {\n $keys[] = $key;\n }\n... | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Adds properties from file to the default properties if the file exists.
@param configFile
@return default properties instance | [
"public Properties appendToDefaultProperties(File configFile) {\n\n if(defaultProperties != null && configFile.canRead()) {\n\n defaultProperties = appendProperties(defaultProperties, configFile); \n }\n\n return defaultProperties;\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// End positions the iterator at the end of the index. | [
"func (s *ShapeIndexIterator) End() {\n\ts.position = len(s.index.cells)\n\ts.refresh()\n}"
] | [
"private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
مقدار دهی فیلدها.
@see Pluf_Form::initFields() | [
"public function initFields($extra = array())\n {\n $this->tag = $extra['tag'];\n $this->fields['tag_title'] = new Pluf_Form_Field_Varchar(array(\n 'required' => false,\n 'label' => __('title')\n ));\n \n $this->fields['tag_description'] = new Pluf_Form_Fi... | [
"public static function get($request, $match)\n {\n $discount = Discount_Views_Discount::getDiscount($request, $match);\n // حق دسترسی\n // CMS_Precondition::userCanAccessContent($request, $content);\n // اجرای درخواست\n return new Pluf_HTTP_Response_Json($discount);\n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"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.