query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
create a new folder (and parent folders if needed)
@param string $folder folder name
@return bool success | [
"public function createFolder($cb, $folder, $parentFolder = null)\n {\n $this->onResponse->push($cb);\n if ($parentFolder) {\n $folder = $parentFolder . '/' . $folder ;\n }\n $this->writeln(self::TAG_CREATEFOLDER . \" CREATE \".$this->escapeString($folder));\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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
listVarTypes
@param array $data
@return string | [
"public static function listVarTypes(array $data)\n {\n $vars = [];\n\n foreach ($data as $key => $value) {\n if (is_object($value)) {\n $type = '\\\\' . get_class($value);\n } else {\n $type = gettype($value);\n }\n\n $vars[... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
@param array $node
@return AbstractValidator
@throws Exception | [
"private function getClassValidator($node)\n {\n $classStringName = $node['_type'].'_validator';\n $classStringNamespace = '\\Volan\\Validator\\\\';\n\n $classNames = [];\n $classNames[] = $classStringNamespace.$classStringName;\n $classNames[] = $classStringNamespace.$this->ge... | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns a new builder with siblings of the active item.
@return Builder | [
"public function siblingMenu()\n {\n $nb = $this->spawn('siblingMenu', new Collection());\n\n $parent = $this->active()->parent();\n if ($parent) {\n $siblings = $parent->children();\n } else {\n $siblings = $this->roots();\n }\n\n if ($siblings->co... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param Asset $asset
@return bool | [
"public function purge (Asset $asset)\n {\n $url = $this->getImgixUrl($asset);\n\n Craft::trace(\n Craft::t(\n 'imgix',\n 'Purging asset #{id}: {url}', [ 'id' => $asset->id, 'url' => $url ]\n ),\n 'imgix');\n\n return $this->purg... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns true if the specified class node is a trait.
@param cNode a class node to test
@return true if the classnode represents a trait | [
"public static boolean isTrait(final ClassNode cNode) {\n return cNode!=null\n && ((cNode.isInterface() && !cNode.getAnnotations(TRAIT_CLASSNODE).isEmpty())\n || isAnnotatedWithTrait(cNode));\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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Only most frequent k words to be included in the embeddings. | [
"def most_frequent(self, k, inplace=False):\n \"\"\"\"\"\"\n vocabulary = self.vocabulary.most_frequent(k)\n vectors = np.asarray([self[w] for w in vocabulary])\n if inplace:\n self.vocabulary = vocabulary\n self.vectors = vectors\n return self\n return Embedding(vectors=vectors, vocab... | [
"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 comment about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
List of partitions
@return mixed[][] | [
"public function partitions(string $table, int $limit = null, bool $active = null)\n {\n $database = $this->settings()->getDatabase();\n $whereActiveClause = $active === null ? '' : sprintf(' AND active = %s', (int) $active);\n $limitClause = $limit !== null ? ' LIMIT ' . $lim... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Schedule an activity to run off the SCR action thread,
if the ExecutorService is available
@param action Runnable action to execute
@param addToQueue Set to false if the action should be scheduled independently of the actionQueue | [
"@Trivial\n private void performAction(Runnable action, boolean addToQueue) {\n ExecutorService exec = executorService.getService();\n\n if (exec == null) {\n // If we can't find the executor service, we have to run it in place.\n action.run();\n } else {\n /... | [
"@Override\n public void checkin(K key, V resource) {\n super.checkin(key, resource);\n // NB: Blocking checkout calls for synchronous requests get the resource\n // checked in above before processQueueLoop() attempts checkout below.\n // There is therefore a risk that asynchronous re... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
/*
WriteDeadline sets the write deadline duration.
*/ | [
"func (c *Connection) WriteDeadline(d time.Duration) {\n\tc.log(\"Write Deadline\", d)\n\tc.dld.wdld = d\n\tc.dld.wds = true\n}"
] | [
"function Cpu(kernel, number) {\n if (kernel === undefined || number === undefined)\n throw new Error('Missing arguments');\n this.kernel = kernel;\n this.cpuNumber = number;\n this.slices = [];\n this.counters = {};\n this.bounds = new tr.b.Range();\n this.samples_ = undefined; // Set dur... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Creates Service
@param ServiceLocatorInterface $serviceLocator Zend Service Locator
@return \Reliv\RcmConfig\Model\ConfigModel | [
"public function createService(ServiceLocatorInterface $serviceLocator)\n {\n $entityManager = $serviceLocator->get('Doctrine\\ORM\\EntityManager');\n\n return new \\Reliv\\RcmConfig\\Model\\DoctrineModel($entityManager, null);\n }"
] | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Divide an input string to a list of substrings based on window_length and curse_forward values
:param input_str: str
:param window_length: int
:param curse_forward: int
:return: list [str] | [
"def _str_to_windows(self, input_str, window_length, curse_forward):\n \n windows = []\n\n i = 0\n len_input = len(input_str)\n while i < len_input:\n window_text = input_str[i:i+window_length]\n\n if self.sanitize_input:\n windows.append({\n ... | [
"def get_tokenizer(fhp # type: Optional[field_formats.FieldHashingProperties]\n ):\n # type: (...) -> Callable[[Text, Optional[Text]], Iterable[Text]]\n \n\n def dummy(word, ignore=None):\n # type: (Text, Optional[Text]) -> Iterable[Text]\n \"\"\"\n Null tokenizer ret... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Set attribute.
@param string $name
@param mixed $value
@return $this | [
"public function setAttribute(string $name, $value)\n {\n if (\\in_array($name, ['id'])) {\n $this->{$name} = $value;\n }\n\n $this->menu[$name] = $value;\n\n return $this;\n }"
] | [
"private function getFormOptionsDeclaration()\n {\n\n // we got a max instances allowed in normality tags\n $formOptions = json_encode( $this->formOptions );\n $formOptions = Php::varExport( $formOptions, true );\n\n $this->class->classComponents[] = new VariableDeclaration(\n ... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// SetStackResources sets the StackResources field's value. | [
"func (s *DescribeStackResourcesOutput) SetStackResources(v []*StackResource) *DescribeStackResourcesOutput {\n\ts.StackResources = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
TODO-Shunli: now update group always failed, tip system error, check later | [
"public static JsonRtn updateGroup(License license, Group group) {\n if (group == null) {\n return JsonRtnUtil.buildFailureJsonRtn(JsonRtn.class, \"missing group\");\n }\n\n return HttpUtil.postBodyRequest(WechatRequest.UPDATE_GROUP, license, new GroupWarpper(group), GroupJsonRtn.cla... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
This will will extract the raw data from the response
:return: None | [
"def extract_data(self):\n \n content_type = 'Exception in extracting content-type from header'\n try:\n content_type = self.response.headers.get('content-type', '')\n if 'application/json' in content_type:\n self.raw_data = self.data = self.response.json()\... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Check access rights to the servlets path - is checking ACLs of the console path
@param context the current request
@return 'true' if access granted or access check switched off | [
"protected boolean checkConsoleAccess(BeanContext context) {\n String consolePath = getConsolePath(context);\n if (StringUtils.isNotBlank(consolePath)) {\n return context.getResolver().getResource(consolePath) != null;\n }\n return true;\n }"
] | [
"def get_app(self):\n \n # First see to connection stack\n ctx = connection_stack.top\n if ctx is not None:\n return ctx.app\n\n # Next return app from instance cache\n if self.app is not None:\n return self.app\n\n # Something went wrong, in mo... | codesearchnet | {
"query": "Represent the Github sentence about Access control:",
"pos": "Represent the Github code about Access control:",
"neg": "Represent the Github code:"
} |
// addUint32 encodes x as 7-bit little-endian varint.
// TODO(adonovan): opt: steal top two bits of opcode
// to encode the number of complete bytes that follow. | [
"func addUint32(code []byte, x uint32, min int) []byte {\n\tend := len(code) + min\n\tfor x >= 0x80 {\n\t\tcode = append(code, byte(x)|0x80)\n\t\tx >>= 7\n\t}\n\tcode = append(code, byte(x))\n\t// Pad the operand with NOPs to exactly min bytes.\n\tfor len(code) < end {\n\t\tcode = append(code, byte(NOP))\n\t}\n\tre... | [
"func estimateUnknownSize(unk *runtime.Unknown, byteSize uint64) uint64 {\n\tsize := uint64(unk.Size())\n\t// protobuf uses 1 byte for the tag, a varint for the length of the array (at most 8 bytes - uint64 - here),\n\t// and the size of the array.\n\tsize += 1 + 8 + byteSize\n\treturn size\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Execute a transaction that involves consensus pool management, like
adding a node, client or a steward.
:param ppTime: PrePrepare request time
:param reqs_keys: requests keys to be committed | [
"def execute_pool_txns(self, three_pc_batch) -> List:\n \n committed_txns = self.default_executer(three_pc_batch)\n for txn in committed_txns:\n self.poolManager.onPoolMembershipChange(txn)\n return committed_txns"
] | [
"def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Connect to the SQLite3 database (c.q. open the database file).
@param boolean $create_db
@param boolean $read_only
@return void
@throws SQLException | [
"protected function _connect($create_db = false, $read_only = false){\n\n\t\tif($create_db && $read_only){\n\n\t\t\tExceptionHandler::notice('SQLite::_connect() was called with both\n\t\t\t\t$create_db and $read_only enabled: Assuming read-only');\n\n\t\t\t$create_db = false;\n\t\t}\n\n\t\tif(!file_exists($this->_d... | [
"function openForWrite()\n {\n $this->mode_xxx['write'] = 'W';\n\n if (!$this->hasCreate() && !$this->hasXCreate())\n ## write to file must has create or xcreate by default\n $this->createFile();\n\n return $this;\n }"
] | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about File management:"
} |
Called when a client disconnects from the bus | [
"def clientDisconnected(self, proto):\n \n for rule_id in proto.matchRules:\n self.router.delMatch(rule_id)\n\n for busName in proto.busNames.keys():\n self.dbus_ReleaseName(busName, proto.uniqueName)\n\n if proto.uniqueName:\n del self.clients[proto.uniq... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Удалить UF
@param $id
@throws \Exception | [
"public static function delete($id)\n {\n $result = (new \\CUserTypeEntity())->Delete($id);\n\n if (!$result) {\n global $APPLICATION;\n throw new \\Exception($APPLICATION->GetException());\n }\n\n Logger::log(\"Удален UF {$id}\", Logger::COLOR_GREEN);\n }"
] | [
"function check(AE $e) {return\n\t\t// 2016-11-20\n\t\t// !! обязательно, потому что нам нужно вернуть именно true|Phrase|Phrase[]\n\t\t!!df_filter($this->_iso3, function($c) {return df_currency_has_rate($c);}) ?: $this->message()\n\t;}"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Get the ModelServiceInstance by serviceName and instanceId.
@param serviceName
the service name.
@param instanceId
the instanceId.
@return
the ModelServiceInstance. | [
"public ModelServiceInstance getModelServiceInstance(String serviceName, String instanceId){\n ModelService service = getModelService(serviceName);\n if(service != null && service.getServiceInstances() != null ){\n for(ModelServiceInstance instance : service.getServiceInstances()){\n ... | [
"public static IGroupMember getGroupMember(String key, Class<?> type) throws GroupsException {\n /*\n * WARNING: The 'type' parameter is not the leafType; you're obligated\n * to say whether you want a group or a non-group (i.e. some type of\n * entity). In fact, the underlying imp... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Checks that an attachment is valid.
@param string $filename Filename of the attachment.
@return bool True if successful, false otherwise.
@param string &$error Error message to be set if the header is invalid. | [
"protected function checkValidAttachment($filename, &$error) {\n if (!is_string($filename)) {\n $error = sprintf(\"Filename must be a string but was type %s\",\n gettype($filename));\n return false;\n }\n\n $path_parts = pathinfo($filename);\n if (isset($path_parts['exten... | [
"public function validate( $input )\n {\n // Check if passed input is an object and instance of phpillowDocument\n // at all, otherwise we can exit immediately\n if ( !is_object( $input ) ||\n !( $input instanceof phpillowDocument ) )\n {\n throw new phpillowVal... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about PHP programming:"
} |
Run a virus scan against a file
@param string $file The name of the file [not full path]
@return boolean | [
"public function isSafe($file)\n\t{\n\t\t$file = Util::normalizePath($file);\n\n\t\treturn (bool) $this->adapter->isSafe($file);\n\t}"
] | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
An attribute write handler which performs cache operations
@param context the operation context
@param operation the operation being executed
@throws org.jboss.as.controller.OperationFailedException | [
"@Override\n public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {\n final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));\n ListIterator<PathElement> iterator = address.iterator();\n PathElement element = iterator.nex... | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about AWS Auto Scaling:"
} |
// Convert_core_LocalObjectReference_To_v1_LocalObjectReference is an autogenerated conversion function. | [
"func Convert_core_LocalObjectReference_To_v1_LocalObjectReference(in *core.LocalObjectReference, out *v1.LocalObjectReference, s conversion.Scope) error {\n\treturn autoConvert_core_LocalObjectReference_To_v1_LocalObjectReference(in, out, s)\n}"
] | [
"func NewProtoWrapperWithSerializer(db keyval.CoreBrokerWatcher, serializer keyval.Serializer) *ProtoWrapper {\n\t// OBSOLETE, use NewProtoWrapper\n\treturn NewProtoWrapper(db, serializer)\n}"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get all instance data source names.
@return instance data source names | [
"public Collection<String> getAllInstanceDataSourceNames() {\n Collection<String> result = new LinkedList<>();\n for (Entry<String, DataSourceMetaData> entry : dataSourceMetaDataMap.entrySet()) {\n if (!isExisted(entry.getKey(), result)) {\n result.add(entry.getKey());\n ... | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Check if the child is a column.
@param ResolvedBlockTypeInterface $type
@return bool | [
"protected function isColumn(ResolvedBlockTypeInterface $type)\n {\n if ('table_column' === $type->getBlockPrefix()) {\n return true;\n }\n\n if (null !== $type->getParent()) {\n return $this->isColumn($type->getParent());\n }\n\n return false;\n }"
] | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about File management:"
} |
Bounds image pixels to be between these two values
@param img Image
@param min minimum value.
@param max maximum value. | [
"public static void boundImage( GrayU16 img , int min , int max ) {\n\t\tImplPixelMath.boundImage(img,min,max);\n\t}"
] | [
"def getPixelValue(self, x, y):\n \"\"\"\"\"\"\n assert x < self.size, \"x: %d<%d\" % (x, self.size)\n assert y < self.size, \"y: %d<%d\" % (y, self.size)\n # Same as calcOffset, inlined for performance reasons\n offset = x + self.size * (self.size - y - 1)\n #print offset\... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
Creates the given alert channel.
@param channel The alert channel to create
@return The alert channel that was created | [
"public Optional<AlertChannel> create(AlertChannel channel)\n {\n return Optional.of(HTTP.POST(\"/v2/alerts_channels.json\", channel, ALERT_CHANNELS).get().iterator().next());\n }"
] | [
"def __resolveport(self, definitions):\n \n ref = qualify(self.type, self.root, definitions.tns)\n port_type = definitions.port_types.get(ref)\n if port_type is None:\n raise Exception(\"portType '%s', not-found\" % (self.type,))\n # Later on we will require access to t... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Write a valid salt string to file
@throws \InvalidArgumentException when storing fails
@param string $salt Valid salt string
@return void | [
"protected static function writeSaltToFile(string $salt): void\n {\n static::validateSalt($salt);\n $result = @file_put_contents(static::$saltFile, $salt);\n\n if (($result === false) || ($result <> strlen($salt))) {\n throw new InvalidArgumentException(\"Failed to write salt to f... | [
"public static function createFactoryDoesNotReturnObject(string $path, string $dataType): self\n {\n return new self(sprintf('Factory does not return object, \"%s\" given at path: \"%s\"', $dataType, $path));\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Programming:"
} |
Returns the size of the smallest array.
@param arr1 the first array
@param arr2 the second array
@return the size of the smallest array | [
"private int getLeastCommonArrayLength(String[] arr1, String[] arr2) {\n return arr1.length <= arr2.length ? arr1.length : arr2.length;\n }"
] | [
"public String getDescriptiveName()\n {\n StringBuilder sb = new StringBuilder(getDistributionName());\n sb.append(\"(\");\n String[] vars = getVariables();\n double[] vals = getCurrentVariableValues();\n \n sb.append(vars[0]).append(\" = \").append(vals[0]);\n \n... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Downloads and imports package.
Sets $this->ErrorMsg in case of an error.
\param $forceDownload download even if this package already exists.
\private
\return false on error, package object otherwise. | [
"function downloadAndImportPackage( $packageName, $packageUrl, $forceDownload = false )\n {\n $package = eZPackage::fetch( $packageName, false, false, false );\n\n if ( is_object( $package ) )\n {\n if ( $forceDownload )\n {\n $package->remove();\n ... | [
"public function initialize() {\n $this->keepSnapshots(true);\n $this->setup(\n array(\n 'exceptionOnFailedSave' => true, //Throw an exception instead of returning false from saves\n 'notNullValidations' => false //Allow empty strings instead of the wtf new \\P... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Utility function for downloading files from the web
and retaining the same filename. | [
"def download(url, localFileName=None, localDirName=None):\n \n localName = url2name(url)\n req = Request(url)\n r = urlopen(req)\n if r.info().has_key('Content-Disposition'):\n # If the response has Content-Disposition, we take file name from it\n localName = r.info()['Content-Disposit... | [
"def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about AWS S3:"
} |
// SetStddev sets the Stddev field's value. | [
"func (s *FieldStats) SetStddev(v float64) *FieldStats {\n\ts.Stddev = &v\n\treturn s\n}"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// NewLocalProvider creates a new local dynamic discovery provider | [
"func NewLocalProvider(config fab.EndpointConfig, opts ...coptions.Opt) *LocalProvider {\n\treturn &LocalProvider{\n\t\tcache: lazycache.New(\"Local_Discovery_Service_Cache\", func(key lazycache.Key) (interface{}, error) {\n\t\t\treturn newLocalService(config, key.String(), opts...), nil\n\t\t}),\n\t}\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get journal voucher by organization, by period and by status
@param int $organizationId
@param array $periodIds
@param string $status
@return integer | [
"public function getByOrganizationByPeriodAndByStatus($organizationId, $periodIds, $status, $databaseConnectionName = null)\n {\n if(empty($databaseConnectionName))\n {\n $databaseConnectionName = $this->databaseConnectionName;\n }\n\n return $this->JournalVoucher->setConnection($databaseConnectio... | [
"public MessageProcessInfoModel getMessageProcessInfo(String strMessageInfoType, String strContactType, String strRequestType, String strMessageProcessType, String strProcessType)\n {\n return null; // No thin impl\n }"
] | codesearchnet | {
"query": "Represent the post about Transaction Management:",
"pos": "Represent the code about Transaction Management:",
"neg": "Represent the code:"
} |
Loads a network definition from a json network file. | [
"private JsonObject loadJson(String fileName) {\n URL url = cl.getResource(fileName);\n try {\n try (Scanner scanner = new Scanner(url.openStream(), \"UTF-8\").useDelimiter(\"\\\\A\")) {\n String json = scanner.next();\n return new JsonObject(json);\n } catch (NoSuchElementException e)... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Auto Generated Code | [
"def hide_routemap_holder_route_map_content_match_route_type_route_type_rmm(self, **kwargs):\n \n config = ET.Element(\"config\")\n hide_routemap_holder = ET.SubElement(config, \"hide-routemap-holder\", xmlns=\"urn:brocade.com:mgmt:brocade-ip-policy\")\n route_map = ET.SubElement(hide_ro... | [
"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 sentence about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about File management:"
} |
Finds a document in the replicator database.
@return {@link ReplicatorDocument} | [
"public com.cloudant.client.api.model.ReplicatorDocument find() {\r\n ReplicatorDocument couchDbReplicatorDoc = replicator.find();\r\n com.cloudant.client.api.model.ReplicatorDocument replicatorDoc = new com.cloudant.client\r\n .api.model.ReplicatorDocument(couchDbReplicatorDoc);\r\n ... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about File management:"
} |
Compares two complex numbers
**Note:** new Complex(Infinity).equals(Infinity) === false
@returns {boolean} | [
"function(a, b) {\n\n var z = new Complex(a, b);\n\n return Math.abs(z['re'] - this['re']) <= Complex['EPSILON'] &&\n Math.abs(z['im'] - this['im']) <= Complex['EPSILON'];\n }"
] | [
"public int getCount(T x, T y) {\n // REMINDER: check for indexing?\n return counts.get(getIndex(x, y));\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Read from the Cache. | [
"def [](url)\n interpret case\n when store.respond_to?(:[])\n store[key_for(url)]\n when store.respond_to?(:get)\n store.get key_for(url)\n when store.respond_to?(:read)\n store.read key_for(url)\n end\n end"
] | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Defines one or several keywords in ajv instance
@param {Ajv} ajv validator instance
@param {String|Array<String>|undefined} keyword keyword(s) to define
@return {Ajv} ajv instance (for chaining) | [
"function defineKeywords(ajv, keyword) {\n if (Array.isArray(keyword)) {\n for (var i=0; i<keyword.length; i++)\n get(keyword[i])(ajv);\n return ajv;\n }\n if (keyword) {\n get(keyword)(ajv);\n return ajv;\n }\n for (keyword in KEYWORDS) get(keyword)(ajv);\n return ajv;\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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
// Flush writes all unflushed Write* calls to the underlying writer. | [
"func (w *Writer) Flush() error {\n\tif _, err := w.w.Write(w.b); err != nil {\n\t\treturn err\n\t}\n\tw.b = w.b[:0]\n\treturn 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 description about writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code:"
} |
Create a Castro data object from a text file containing a
sequence of differential flux points. | [
"def create_from_flux_points(cls, txtfile):\n \"\"\"\"\"\"\n\n tab = Table.read(txtfile, format='ascii.ecsv')\n dnde_unit = u.ph / (u.MeV * u.cm ** 2 * u.s)\n loge = np.log10(np.array(tab['e_ref'].to(u.MeV)))\n norm = np.array(tab['norm'].to(dnde_unit))\n norm_errp = np.arr... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
function _percentageAdjustValues() | [
"private function _getCaption($captionElement) {\r\n\t\t//\tRead any caption\r\n\t\t$caption = (!is_null($captionElement)) ? $captionElement->getCaption() : NULL;\r\n\t\t//\tTest if we have a title caption to display\r\n\t\tif (!is_null($caption)) {\r\n\t\t\t//\tIf we do, it could be a plain string or an array\r\n\... | [
"def creationTime(item):\n \n forThisItem = _CreationTime.createdItem == item\n return item.store.findUnique(_CreationTime, forThisItem).timestamp"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@param array $options
@param bool $recursive
@param bool $reverse
@return $this | [
"public function mergeOptions(array $options, $recursive = false, $reverse = false)\n {\n\n $nameSpace = $this->getOptionNameSpace();\n if (!empty($nameSpace)) {\n\n $o = [];\n Config::set($nameSpace, $options, $o);\n $options = $o;\n }\n\n $this->getT... | [
"public function fetchData(OutputNode $node = null): array\n {\n /** @var OutputNode $node */\n $node = $node ?? $this->loader->createNode();\n\n //Working with parser defined by loader itself\n $this->loader->loadData($node);\n\n return $node->getResult();\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Run the migrations.
@return void | [
"public function up()\n {\n\n Schema::create('character_minings', function (Blueprint $table) {\n\n $table->bigInteger('character_id');\n $table->date('date');\n $table->time('time');\n $table->integer('year');\n $table->integer('month');\n ... | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the instruction about Database management:",
"pos": "Represent the code about Database management:",
"neg": "Represent the code about programming:"
} |
If necessary, layouts new items for predictive animations | [
"private void layoutForPredictiveAnimations(RecyclerView.Recycler recycler,\n RecyclerView.State state, int startOffset, int endOffset) {\n // If there are scrap children that we did not layout, we need to find where they did go\n // and layout them accor... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
<p>
The smart home appliances.
</p>
@param smartHomeAppliances
The smart home appliances. | [
"public void setSmartHomeAppliances(java.util.Collection<SmartHomeAppliance> smartHomeAppliances) {\n if (smartHomeAppliances == null) {\n this.smartHomeAppliances = null;\n return;\n }\n\n this.smartHomeAppliances = new java.util.ArrayList<SmartHomeAppliance>(smartHomeApp... | [
"def _update_details(self,data):\n ''''''\n # DeviceName, IconID, HouseID, DeviceID always present\n self.device_id = data['DeviceID']\n self.device_name = data['DeviceName']\n self.properties = data"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Data processing:"
} |
// ReceiveBlob stores received blobs on the upper layer. | [
"func (sto *overlayStorage) ReceiveBlob(ctx context.Context, br blob.Ref, src io.Reader) (sb blob.SizedRef, err error) {\n\tsb, err = sto.upper.ReceiveBlob(ctx, br, src)\n\tif err == nil && sto.deleted != nil {\n\t\terr = sto.deleted.Delete(br.String())\n\t}\n\treturn sb, err\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Thai Soundex
:param string text: word
:param str engine: soundex engine
:Parameters for engine:
* udom83 (default)
* lk82
* metasound
:return: soundex code | [
"def soundex(text: str, engine: str = \"udom83\") -> str:\n \n if engine == \"lk82\":\n _soundex = lk82\n elif engine == \"metasound\":\n _soundex = metasound\n else: # default, use \"udom83\"\n _soundex = udom83\n\n return _soundex(text)"
] | [
"def convert_id36_to_numeric_id(id36):\n \"\"\"\"\"\"\n if not isinstance(id36, six.string_types) or id36.count(\"_\") > 0:\n raise ValueError(\"must supply base36 string, not fullname (e.g. use \"\n \"xxxxx, not t3_xxxxx)\")\n return int(id36, 36)"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
For each key and value of the map, the function is evaluated with the key and value as the parameter.
The results of these evaluations are collected into the target map. | [
"public static <K, V, V2> MutableMap<K, V2> collectValues(\n Map<K, V> map,\n Function2<? super K, ? super V, ? extends V2> function)\n {\n return MapIterate.collectValues(map, function, UnifiedMap.<K, V2>newMap(map.size()));\n }"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
7.6 Identifier Names and Identifiers | [
"function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch)... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Patches an Express Application to support Swagger.
@param {SwaggerServer} server | [
"function(server) {\n var app = server.app;\n var set = app.set;\n\n /**\n * Emit the \"set\" event whenever a setting is changed\n */\n app.set = function(name, value) {\n // Track the old/new value of the setting\n var oldValue = set.call(app, name);\n var result = set.apply(app... | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Converts Date type to String based on RFC3339 formatting
@param date
@return String | [
"public static String dateToString(Date date) {\n final TimeZone utc = TimeZone.getTimeZone(\"UTC\");\n\n SimpleDateFormat tformat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSXXX\");\n tformat.setTimeZone(utc);\n return tformat.format(date);\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Figure what kind of record this record is and move it to the correct record.
@record The record to move to current. | [
"public Record moveToCurrentRecord(Record recBase)\n {\n if (recBase == null)\n recBase = this.getBaseRecord(); // Actually, should always be the recBase.\n BaseField fldRecordType = recBase.getSharedRecordTypeKey();\n Object objKey = fldRecordType.getData();\n BaseTable ta... | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Update a MacFilter
@param \alphayax\freebox\api\v3\models\WiFi\MacFilter $MacFilter
@return \alphayax\freebox\api\v3\models\WiFi\MacFilter | [
"public function update( models\\WiFi\\MacFilter $MacFilter){\n $rest = $this->getService( self::API_WIFI_MAC_FILTER . $MacFilter->getId());\n $rest->PUT( $MacFilter);\n\n return $rest->getResult( models\\WiFi\\MacFilter::class);\n }"
] | [
"public function getAll(){\n $rest = $this->getService( self::API_VPN_CLIENT_CONFIG);\n $rest->GET();\n\n return $rest->getResultAsArray( models\\VPN\\Client\\Config\\ClientConfig::class);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// GetSnatPool retrieves a SnatPool by name. Returns nil if the snatpool does not exist | [
"func (b *BigIP) GetSnatPool(name string) (*SnatPool, error) {\n\tvar snatPool SnatPool\n\terr, ok := b.getForEntity(&snatPool, uriLtm, uriSnatPool, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !ok {\n\t\treturn nil, nil\n\t}\n\n\treturn &snatPool, nil\n}"
] | [
"func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
(non-PHPdoc)
@see Webcreate\Vcs.VcsInterface::changelog() | [
"public function changelog($revision1, $revision2)\n {\n $this->fetch();\n\n return $this->execute('log', array(\n '--pretty=' => self::PRETTY_FORMAT,\n sprintf('%s^1..%s', $revision1, $revision2),\n )\n );\n }"
] | [
"public function getTokenStatusDescriptionForBridge(\\MUtil_Model_Bridge_TableBridgeAbstract $bridge, $addDescription = false)\n {\n return \\MUtil_Lazy::method($this, 'getStatusDescription', $bridge->getLazy('token_status'));\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Generates XML for a method request.
@param string $functionname Name of the method to call.
@param mixed $params Method parameters compatible with the method signature.
@return string | [
"protected function encode_request($functionname, $params) {\n\n $outputoptions = array(\n 'encoding' => 'utf-8',\n 'escaping' => 'markup',\n );\n\n // See MDL-53962 - needed for backwards compatibility on <= 3.0.\n $params = array_values($params);\n\n return... | [
"@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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Creates a description of a Coiflet of order I wavelet.
@param I order of the wavelet.
@return Wavelet description. | [
"public static WaveletDescription<WlCoef_F32> generate_F32( int I ) {\n\t\tif( I != 6 ) {\n\t\t\tthrow new IllegalArgumentException(\"Only 6 is currently supported\");\n\t\t}\n\n\t\tWlCoef_F32 coef = new WlCoef_F32();\n\n\t\tcoef.offsetScaling = -2;\n\t\tcoef.offsetWavelet = -2;\n\n\t\tcoef.scaling = new float[6];\... | [
"def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// Inputs returns the array of inputs that defines the Env. | [
"func (tlc EnvTLC) Inputs() []Input {\n\tsort.Sort(tlc)\n\n\tvar (\n\t\tlp = len(tlc)\n\t\tlevels = make([]Input, lp)\n\t\ttimes = make([]Input, lp-1)\n\t\tcurves = make([]interface{}, lp-1)\n\t)\n\tfor i, t := range tlc {\n\t\tlevels[i] = C(t.Level)\n\t\tif i > 0 {\n\t\t\ttimes[i-1] = C(t.Time - tlc[i-1].Time... | [
"@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:"
} |
// SetNextToken sets the NextToken field's value. | [
"func (s *DescribePlayerSessionsInput) SetNextToken(v string) *DescribePlayerSessionsInput {\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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Determine if we should wait for the managed cloud automation before
running. Either 'False' (default) or 'True'. | [
"def managedcloud(vm_):\n '''\n \n '''\n return config.get_cloud_config_value(\n 'managedcloud', vm_, __opts__, default=False,\n search_global=False\n )"
] | [
"def register_options(cls, register):\n \n super(JvmResolverBase, cls).register_options(register)\n # TODO This flag should be defaulted to True when we are doing hermetic execution,\n # and should probably go away as we move forward into that direction.\n register('--capture-snapshots', type=bool, d... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
make line pattern | [
"def patSiemensStar(s0, n=72, vhigh=255, vlow=0, antiasing=False):\r\n ''''''\r\n arr = np.full((s0,s0),vlow, dtype=np.uint8)\r\n c = int(round(s0/2.))\r\n s = 2*np.pi/(2*n)\r\n step = 0\r\n for i in range(2*n): \r\n p0 = round(c+np.sin(step)*2*s0)\r\n p1 = round(c+np.cos(step)*2*s0... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Retrieve a single feature collection.
The route for this endpoint is:
``/dossier/v1/feature-collections/<content_id>``.
This endpoint returns a JSON serialization of the feature collection
identified by ``content_id``. | [
"def v1_fc_get(visid_to_dbid, store, cid):\n '''\n '''\n fc = store.get(visid_to_dbid(cid))\n if fc is None:\n bottle.abort(404, 'Feature collection \"%s\" does not exist.' % cid)\n return util.fc_to_json(fc)"
] | [
"def reload(self) -> None:\n \"\"\"\"\"\"\n if not self.state_.is_persisted or self.state_.is_changed:\n raise InvalidStateError(f'`{self.__class__.__name__}` object is in invalid state')\n\n # Retrieve the entity's ID by the configured Identifier field\n identifier = getattr(... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Sets the JAXWS endpoint config for the current endpoint. This is called by configurer when
org.apache.cxf.jaxws.EndpointImpl#getServer(..) executes 'configureObject(this)' | [
"public void setEndpointConfig(CommonConfig config)\n {\n if (this.config == null)\n {\n this.config = config;\n //setup using provided configuration\n Map<String, String> epConfProps = config.getProperties();\n if (!epConfProps.isEmpty())\n {\n final M... | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param Request $request
@return mixed | [
"public function show(Request $request, $id)\n {\n $menuItem = Menu::where('id', $id)->first();\n\n return $this->response()->item($menuItem, new NodeTransformer());\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 Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Connection.abort() has been called, abort remaining active result-set
@throws SQLException exception | [
"public void abort() throws SQLException {\n if (fetchSize != 0) {\n fetchSize = 0;\n if (resultSet != null) {\n resultSet.abort();\n } else {\n SelectResultSet firstResult = executionResults.peekFirst();\n if (firstResult != null) {\n firstResult.abort();\n }\... | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get all manageable roles for pages
@return Role[] | [
"public function getManageableRolesForPages()\n {\n $roles = $this->em->getRepository('KunstmaanAdminBundle:Role')->findAll();\n\n if (($token = $this->tokenStorage->getToken()) && ($user = $token->getUser())) {\n if ($user && !$user->isSuperAdmin() && ($superAdminRole = array_keys($role... | [
"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 about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Encode stream $in to stream $out.
@param int $firstLineOffset | [
"public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0)\n {\n if (0 >= $maxLineLength || 76 < $maxLineLength) {\n $maxLineLength = 76;\n }\n\n $remainder = 0;\n $base64ReadBufferRemainderBytes = null... | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@param HttpClientConfigurator $httpClientConfigurator
@param Hydrator|null $hydrator
@param RequestBuilder|null $requestBuilder
@return LocoClient | [
"public static function configure(\n HttpClientConfigurator $httpClientConfigurator,\n Hydrator $hydrator = null,\n RequestBuilder $requestBuilder = null\n ): self {\n $httpClient = $httpClientConfigurator->createConfiguredClient();\n\n return new self($httpClient, $hydrator, $... | [
"protected function createGetUserRequest(Message $message, NodeRef $nodeRef, Pbjx $pbjx): GetUserRequest\n {\n /** @var GetUserRequest $request */\n $request = GetUserRequestV1Mixin::findOne()->createMessage();\n return $request;\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Specifies the minimum and maximum times for this regex to repeat.
@param min the minimum times the pattern should repeat
@param max the maximum times the pattern should repeat
@return the regex | [
"public Regex range(int min, int max) {\n return re(this.pattern + \"{\" + Integer.toString(min) + \",\" + Integer.toString(max) + \"}\");\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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Remove removes thin device and snapshot metadata by key | [
"func (s *Snapshotter) Remove(ctx context.Context, key string) error {\n\tlog.G(ctx).WithField(\"key\", key).Debug(\"remove\")\n\n\treturn s.withTransaction(ctx, true, func(ctx context.Context) error {\n\t\treturn s.removeDevice(ctx, key)\n\t})\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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Technology:"
} |
// applyPodPresetsOnPod updates the PodSpec with merged information from all the
// applicable PodPresets. It ignores the errors of merge functions because merge
// errors have already been checked in safeToApplyPodPresetsOnPod function. | [
"func applyPodPresetsOnPod(pod *api.Pod, podPresets []*settingsv1alpha1.PodPreset) {\n\tif len(podPresets) == 0 {\n\t\treturn\n\t}\n\n\tvolumes, _ := mergeVolumes(pod.Spec.Volumes, podPresets)\n\tpod.Spec.Volumes = volumes\n\n\tfor i, ctr := range pod.Spec.Containers {\n\t\tapplyPodPresetsOnContainer(&ctr, podPrese... | [
"func (idr *InitDryRunGetter) handleSystemNodesClusterRoleBinding(action core.GetAction) (bool, runtime.Object, error) {\n\tif action.GetName() != constants.NodesClusterRoleBinding || action.GetResource().Resource != \"clusterrolebindings\" {\n\t\t// We can't handle this event\n\t\treturn false, nil, nil\n\t}\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 API documentation:"
} |
// write sends the given buffer to the RegionServer. | [
"func (c *client) write(buf []byte) error {\n\t_, err := c.conn.Write(buf)\n\treturn err\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 Github instruction about writing:",
"pos": "Represent the Github code about writing:",
"neg": "Represent the Github code:"
} |
// SetGlobalExternalKeyStore is called by Android to register Android's KeyStore with Go | [
"func SetGlobalExternalKeyStore(s UnsafeExternalKeyStore) {\n\texternalKeyStoreMu.Lock()\n\tdefer externalKeyStoreMu.Unlock()\n\texternalKeyStore = TypeSafeExternalKeyStoreProxy{s}\n\texternalKeyStoreInitialized = false\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Method invoked on the beginning of the createAction after checking request validity. | [
"protected function beforeCreate()\n {\n $this->dispatcher->getEventsManager()->fire(Events::BEFORE_CREATE, $this);\n $this->beforeSave();\n }"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetLookbackPeriodInDays sets the LookbackPeriodInDays field's value. | [
"func (s *GetReservationPurchaseRecommendationInput) SetLookbackPeriodInDays(v string) *GetReservationPurchaseRecommendationInput {\n\ts.LookbackPeriodInDays = &v\n\treturn s\n}"
] | [
"func (s *FuncMovingAverage) Signature() ([]Arg, []Arg) {\n\treturn []Arg{\n\t\tArgSeriesList{val: &s.in},\n\t\t// this could be an int OR a string.\n\t\t// we need to figure out the interval of the data we will consume\n\t\t// and request from -= interval * points\n\t\t// interestingly the from adjustment might me... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Import attribute/class from from a python module. Raise AdevConfigError if the import failed.
:return: (attribute, Path object for directory of file) | [
"def import_app_factory(self):\n \n rel_py_file = self.py_file.relative_to(self.python_path)\n module_path = '.'.join(rel_py_file.with_suffix('').parts)\n\n sys.path.append(str(self.python_path))\n try:\n module = import_module(module_path)\n except ImportError a... | [
"def _type_description(self):\n \"\"\"\"\"\"\n #This is a little tricker because the docstring is housed\n #inside of the module that contains the actual executable.\n #These TypeExecutables are just pointers.\n iexec = self._element.target\n if iexec is not None:\n ... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// stringListQuery runs the given query, and returns all results from the first column as a string list | [
"func (sink *influxdbSink) stringListQuery(q string, errStr string) ([]string, error) {\n\tsink.RLock()\n\tdefer sink.RUnlock()\n\n\tresp, err := sink.runQuery(q)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(errStr)\n\t}\n\n\tif len(resp[0].Series) < 1 {\n\t\treturn nil, fmt.Errorf(errStr)\n\t}\n\n\tres := make([... | [
"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 sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Sends a request over the connection.
@param request [#encode, #response_class] the request that should be
encoded and written.
@return [Object] the response. | [
"def send_request(request)\n api_name = Protocol.api_name(request.api_key)\n\n # Default notification payload.\n notification = {\n broker_host: @host,\n api: api_name,\n request_size: 0,\n response_size: 0,\n }\n\n raise IdleConnection if idle?\n\n @logger.... | [
"public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Pad block with 0.
Pad current block with 0. Reader will simply treat these as corrupted
record and skip the block.
This method is idempotent. | [
"def _pad_block(self):\n \n pad_length = _BLOCK_SIZE - self.__position % _BLOCK_SIZE\n if pad_length and pad_length != _BLOCK_SIZE:\n self.__writer.write('\\x00' * pad_length)\n self.__position += pad_length"
] | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Relkind satisfies Loader's Relkind. | [
"func (tl TypeLoader) Relkind(rt RelType) string {\n\tif tl.ProcessRelkind != nil {\n\t\treturn tl.ProcessRelkind(rt)\n\t}\n\n\treturn rt.String()\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:"
} |
Filter by multi select value
@param mixed $row
@param FilterMultiSelect $filter
@return void | [
"public function applyFilterMultiSelect($row, FilterMultiSelect $filter)\n\t{\n\t\t$condition = $filter->getCondition();\n\t\t$values = $condition[$filter->getColumn()];\n\n\t\treturn in_array($row[$filter->getColumn()], $values, true);\n\t}"
] | [
"protected function map() {return df_map_0(df_sort_a(df_map_r(df_cms_blocks(), function(B $b) {return [\n\t\t$b->getId(), $b->getTitle()\n\t];})), '-- select a CMS block --');}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param Factory $factory
@return Resolver | [
"public function getResolver(Factory $factory = null)\n {\n if ($this->resolver instanceof Resolver) {\n $this->logDebug('Existing Resolver found using it');\n return $this->resolver;\n }\n\n if ($factory === null) {\n $factory = new Factory();\n }\n\n... | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Find record by pk
@param $id
@return array|mixed | [
"static public function find($id)\n {\n $model = new static;\n $result = $model->execute('SELECT * FROM '.$model->table.' WHERE '.$model->key.' = ?', [$id]);\n if (is_array($result)) {\n $result = current($result);\n }\n return $result;\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Call when you are done with the client
@throws Exception | [
"public void destroy() throws Exception {\n if (_clientId == null) {\n return;\n }\n\n // delete the clientId here\n String uri = BASE_PROFILE + uriEncode(_profileName) + \"/\" + BASE_CLIENTS + \"/\" + _clientId;\n try {\n doDelete(uri, null);\n } catc... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Check permission by name
@param string $name
@param mixed $attribute
@return boolean | [
"private function _checkPermission($name, $attribute)\n {\n if ($name == 'store') {\n return $this->permissionStore($attribute);\n }\n\n if ($name == 'update') {\n return $this->permissionUpdate($attribute);\n }\n\n if ($name == 'delete') {\n re... | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
If available set the error data. | [
"private function setErrorData()\n {\n if (!isset($this->record['context']['error'])) {\n return;\n }\n\n $this->errorData = $this->record['context']['error'];\n\n // remove the error from the context so we can use it for for other things.\n unset($this->record['cont... | [
"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 about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
Returns a URL for the given file. | [
"private static URL toUrl( File file)\n {\n try\n {\n return\n file == null\n ? null\n : file.toURI().toURL();\n }\n catch( Exception e)\n {\n throw new IllegalArgumentException( \"Can't get URL for file=\" + file);\n }\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Recursive search all dome tree in order to find all translatable labels.
@param Container|\FML\ManiaLink $control
@param $translations | [
"protected function getDictionaryInformation($control, &$translations)\n {\n foreach ($control->getChildren() as $child) {\n if (($child instanceof Label || $child instanceof FmlLabel) && $child->getTranslate()) {\n $id = $child->getTextId();\n\n if (!isset($this->... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// cancel aborts all of the operations and resets the queue. However, cancel does
// not wait for the running download goroutines to finish. This method should be
// used when cancelling the downloads from inside the downloader. | [
"func (d *Downloader) cancel() {\n\t// Close the current cancel channel\n\td.cancelLock.Lock()\n\tif d.cancelCh != nil {\n\t\tselect {\n\t\tcase <-d.cancelCh:\n\t\t\t// Channel was already closed\n\t\tdefault:\n\t\t\tclose(d.cancelCh)\n\t\t}\n\t}\n\td.cancelLock.Unlock()\n}"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Returns a single bundle from the bundles map.
@param bundleName
The name of the bundle to be retrieved.
@return returns the specified bundle from the cache | [
"public ResourceBundle getBundle(final String bundleName) {\n\t\tLOG.info(\"Getting bundle: \" + bundleName);\n\t\treturn bundles.get(bundleName);\n\t}"
] | [
"function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Creates an instance of an entity.
This method must return always an empty instance
@return Tax Empty entity | [
"public function create()\n {\n /**\n * @var Tax $tax\n */\n $classNamespace = $this->getEntityNamespace();\n $tax = new $classNamespace();\n $tax\n ->setName('')\n ->setDescription('')\n ->setValue(0)\n ->setEnabled(false);\... | [
"protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// returns: new, prev | [
"func advance_scope(s *scope) (*scope, *scope) {\n\tif len(s.entities) == 0 {\n\t\treturn s, s.parent\n\t}\n\treturn new_scope(s), s\n}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// addPadding pads the encoded data upto the full length required. | [
"func (q *QRCode) addPadding() {\n\tnumDataBits := q.version.numDataBits()\n\n\tif q.data.Len() == numDataBits {\n\t\treturn\n\t}\n\n\t// Pad to the nearest codeword boundary.\n\tq.data.AppendNumBools(q.version.numBitsToPadToCodeword(q.data.Len()), false)\n\n\t// Pad codewords 0b11101100 and 0b00010001.\n\tpadding ... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// ToScopeList converts a list of access to a
// scope list string | [
"func ToScopeList(access []auth.Access) string {\n\tvar s []string\n\tfor _, a := range access {\n\t\ts = append(s, scopeString(a))\n\t}\n\treturn strings.Join(s, \",\")\n}"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.